UNPKG

701 kBJavaScriptView Raw
1 /**
2 * React v15.3.2
3 */
4(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
5/**
6 * Copyright 2013-present, Facebook, Inc.
7 * All rights reserved.
8 *
9 * This source code is licensed under the BSD-style license found in the
10 * LICENSE file in the root directory of this source tree. An additional grant
11 * of patent rights can be found in the PATENTS file in the same directory.
12 *
13 * @providesModule AutoFocusUtils
14 */
15
16'use strict';
17
18var ReactDOMComponentTree = _dereq_(42);
19
20var focusNode = _dereq_(156);
21
22var AutoFocusUtils = {
23 focusDOMComponent: function () {
24 focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
25 }
26};
27
28module.exports = AutoFocusUtils;
29},{"156":156,"42":42}],2:[function(_dereq_,module,exports){
30/**
31 * Copyright 2013-present Facebook, Inc.
32 * All rights reserved.
33 *
34 * This source code is licensed under the BSD-style license found in the
35 * LICENSE file in the root directory of this source tree. An additional grant
36 * of patent rights can be found in the PATENTS file in the same directory.
37 *
38 * @providesModule BeforeInputEventPlugin
39 */
40
41'use strict';
42
43var EventConstants = _dereq_(16);
44var EventPropagators = _dereq_(20);
45var ExecutionEnvironment = _dereq_(148);
46var FallbackCompositionState = _dereq_(21);
47var SyntheticCompositionEvent = _dereq_(103);
48var SyntheticInputEvent = _dereq_(107);
49
50var keyOf = _dereq_(166);
51
52var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
53var START_KEYCODE = 229;
54
55var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
56
57var documentMode = null;
58if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
59 documentMode = document.documentMode;
60}
61
62// Webkit offers a very useful `textInput` event that can be used to
63// directly represent `beforeInput`. The IE `textinput` event is not as
64// useful, so we don't use it.
65var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
66
67// In IE9+, we have access to composition events, but the data supplied
68// by the native compositionend event may be incorrect. Japanese ideographic
69// spaces, for instance (\u3000) are not recorded correctly.
70var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
71
72/**
73 * Opera <= 12 includes TextEvent in window, but does not fire
74 * text input events. Rely on keypress instead.
75 */
76function isPresto() {
77 var opera = window.opera;
78 return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
79}
80
81var SPACEBAR_CODE = 32;
82var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
83
84var topLevelTypes = EventConstants.topLevelTypes;
85
86// Events and their corresponding property names.
87var eventTypes = {
88 beforeInput: {
89 phasedRegistrationNames: {
90 bubbled: keyOf({ onBeforeInput: null }),
91 captured: keyOf({ onBeforeInputCapture: null })
92 },
93 dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]
94 },
95 compositionEnd: {
96 phasedRegistrationNames: {
97 bubbled: keyOf({ onCompositionEnd: null }),
98 captured: keyOf({ onCompositionEndCapture: null })
99 },
100 dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
101 },
102 compositionStart: {
103 phasedRegistrationNames: {
104 bubbled: keyOf({ onCompositionStart: null }),
105 captured: keyOf({ onCompositionStartCapture: null })
106 },
107 dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
108 },
109 compositionUpdate: {
110 phasedRegistrationNames: {
111 bubbled: keyOf({ onCompositionUpdate: null }),
112 captured: keyOf({ onCompositionUpdateCapture: null })
113 },
114 dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
115 }
116};
117
118// Track whether we've ever handled a keypress on the space key.
119var hasSpaceKeypress = false;
120
121/**
122 * Return whether a native keypress event is assumed to be a command.
123 * This is required because Firefox fires `keypress` events for key commands
124 * (cut, copy, select-all, etc.) even though no character is inserted.
125 */
126function isKeypressCommand(nativeEvent) {
127 return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
128 // ctrlKey && altKey is equivalent to AltGr, and is not a command.
129 !(nativeEvent.ctrlKey && nativeEvent.altKey);
130}
131
132/**
133 * Translate native top level events into event types.
134 *
135 * @param {string} topLevelType
136 * @return {object}
137 */
138function getCompositionEventType(topLevelType) {
139 switch (topLevelType) {
140 case topLevelTypes.topCompositionStart:
141 return eventTypes.compositionStart;
142 case topLevelTypes.topCompositionEnd:
143 return eventTypes.compositionEnd;
144 case topLevelTypes.topCompositionUpdate:
145 return eventTypes.compositionUpdate;
146 }
147}
148
149/**
150 * Does our fallback best-guess model think this event signifies that
151 * composition has begun?
152 *
153 * @param {string} topLevelType
154 * @param {object} nativeEvent
155 * @return {boolean}
156 */
157function isFallbackCompositionStart(topLevelType, nativeEvent) {
158 return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
159}
160
161/**
162 * Does our fallback mode think that this event is the end of composition?
163 *
164 * @param {string} topLevelType
165 * @param {object} nativeEvent
166 * @return {boolean}
167 */
168function isFallbackCompositionEnd(topLevelType, nativeEvent) {
169 switch (topLevelType) {
170 case topLevelTypes.topKeyUp:
171 // Command keys insert or clear IME input.
172 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
173 case topLevelTypes.topKeyDown:
174 // Expect IME keyCode on each keydown. If we get any other
175 // code we must have exited earlier.
176 return nativeEvent.keyCode !== START_KEYCODE;
177 case topLevelTypes.topKeyPress:
178 case topLevelTypes.topMouseDown:
179 case topLevelTypes.topBlur:
180 // Events are not possible without cancelling IME.
181 return true;
182 default:
183 return false;
184 }
185}
186
187/**
188 * Google Input Tools provides composition data via a CustomEvent,
189 * with the `data` property populated in the `detail` object. If this
190 * is available on the event object, use it. If not, this is a plain
191 * composition event and we have nothing special to extract.
192 *
193 * @param {object} nativeEvent
194 * @return {?string}
195 */
196function getDataFromCustomEvent(nativeEvent) {
197 var detail = nativeEvent.detail;
198 if (typeof detail === 'object' && 'data' in detail) {
199 return detail.data;
200 }
201 return null;
202}
203
204// Track the current IME composition fallback object, if any.
205var currentComposition = null;
206
207/**
208 * @return {?object} A SyntheticCompositionEvent.
209 */
210function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
211 var eventType;
212 var fallbackData;
213
214 if (canUseCompositionEvent) {
215 eventType = getCompositionEventType(topLevelType);
216 } else if (!currentComposition) {
217 if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
218 eventType = eventTypes.compositionStart;
219 }
220 } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
221 eventType = eventTypes.compositionEnd;
222 }
223
224 if (!eventType) {
225 return null;
226 }
227
228 if (useFallbackCompositionData) {
229 // The current composition is stored statically and must not be
230 // overwritten while composition continues.
231 if (!currentComposition && eventType === eventTypes.compositionStart) {
232 currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);
233 } else if (eventType === eventTypes.compositionEnd) {
234 if (currentComposition) {
235 fallbackData = currentComposition.getData();
236 }
237 }
238 }
239
240 var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
241
242 if (fallbackData) {
243 // Inject data generated from fallback path into the synthetic event.
244 // This matches the property of native CompositionEventInterface.
245 event.data = fallbackData;
246 } else {
247 var customData = getDataFromCustomEvent(nativeEvent);
248 if (customData !== null) {
249 event.data = customData;
250 }
251 }
252
253 EventPropagators.accumulateTwoPhaseDispatches(event);
254 return event;
255}
256
257/**
258 * @param {string} topLevelType Record from `EventConstants`.
259 * @param {object} nativeEvent Native browser event.
260 * @return {?string} The string corresponding to this `beforeInput` event.
261 */
262function getNativeBeforeInputChars(topLevelType, nativeEvent) {
263 switch (topLevelType) {
264 case topLevelTypes.topCompositionEnd:
265 return getDataFromCustomEvent(nativeEvent);
266 case topLevelTypes.topKeyPress:
267 /**
268 * If native `textInput` events are available, our goal is to make
269 * use of them. However, there is a special case: the spacebar key.
270 * In Webkit, preventing default on a spacebar `textInput` event
271 * cancels character insertion, but it *also* causes the browser
272 * to fall back to its default spacebar behavior of scrolling the
273 * page.
274 *
275 * Tracking at:
276 * https://code.google.com/p/chromium/issues/detail?id=355103
277 *
278 * To avoid this issue, use the keypress event as if no `textInput`
279 * event is available.
280 */
281 var which = nativeEvent.which;
282 if (which !== SPACEBAR_CODE) {
283 return null;
284 }
285
286 hasSpaceKeypress = true;
287 return SPACEBAR_CHAR;
288
289 case topLevelTypes.topTextInput:
290 // Record the characters to be added to the DOM.
291 var chars = nativeEvent.data;
292
293 // If it's a spacebar character, assume that we have already handled
294 // it at the keypress level and bail immediately. Android Chrome
295 // doesn't give us keycodes, so we need to blacklist it.
296 if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
297 return null;
298 }
299
300 return chars;
301
302 default:
303 // For other native event types, do nothing.
304 return null;
305 }
306}
307
308/**
309 * For browsers that do not provide the `textInput` event, extract the
310 * appropriate string to use for SyntheticInputEvent.
311 *
312 * @param {string} topLevelType Record from `EventConstants`.
313 * @param {object} nativeEvent Native browser event.
314 * @return {?string} The fallback string for this `beforeInput` event.
315 */
316function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
317 // If we are currently composing (IME) and using a fallback to do so,
318 // try to extract the composed characters from the fallback object.
319 // If composition event is available, we extract a string only at
320 // compositionevent, otherwise extract it at fallback events.
321 if (currentComposition) {
322 if (topLevelType === topLevelTypes.topCompositionEnd || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
323 var chars = currentComposition.getData();
324 FallbackCompositionState.release(currentComposition);
325 currentComposition = null;
326 return chars;
327 }
328 return null;
329 }
330
331 switch (topLevelType) {
332 case topLevelTypes.topPaste:
333 // If a paste event occurs after a keypress, throw out the input
334 // chars. Paste events should not lead to BeforeInput events.
335 return null;
336 case topLevelTypes.topKeyPress:
337 /**
338 * As of v27, Firefox may fire keypress events even when no character
339 * will be inserted. A few possibilities:
340 *
341 * - `which` is `0`. Arrow keys, Esc key, etc.
342 *
343 * - `which` is the pressed key code, but no char is available.
344 * Ex: 'AltGr + d` in Polish. There is no modified character for
345 * this key combination and no character is inserted into the
346 * document, but FF fires the keypress for char code `100` anyway.
347 * No `input` event will occur.
348 *
349 * - `which` is the pressed key code, but a command combination is
350 * being used. Ex: `Cmd+C`. No character is inserted, and no
351 * `input` event will occur.
352 */
353 if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
354 return String.fromCharCode(nativeEvent.which);
355 }
356 return null;
357 case topLevelTypes.topCompositionEnd:
358 return useFallbackCompositionData ? null : nativeEvent.data;
359 default:
360 return null;
361 }
362}
363
364/**
365 * Extract a SyntheticInputEvent for `beforeInput`, based on either native
366 * `textInput` or fallback behavior.
367 *
368 * @return {?object} A SyntheticInputEvent.
369 */
370function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
371 var chars;
372
373 if (canUseTextInputEvent) {
374 chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
375 } else {
376 chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
377 }
378
379 // If no characters are being inserted, no BeforeInput event should
380 // be fired.
381 if (!chars) {
382 return null;
383 }
384
385 var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
386
387 event.data = chars;
388 EventPropagators.accumulateTwoPhaseDispatches(event);
389 return event;
390}
391
392/**
393 * Create an `onBeforeInput` event to match
394 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
395 *
396 * This event plugin is based on the native `textInput` event
397 * available in Chrome, Safari, Opera, and IE. This event fires after
398 * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
399 *
400 * `beforeInput` is spec'd but not implemented in any browsers, and
401 * the `input` event does not provide any useful information about what has
402 * actually been added, contrary to the spec. Thus, `textInput` is the best
403 * available event to identify the characters that have actually been inserted
404 * into the target node.
405 *
406 * This plugin is also responsible for emitting `composition` events, thus
407 * allowing us to share composition fallback code for both `beforeInput` and
408 * `composition` event types.
409 */
410var BeforeInputEventPlugin = {
411
412 eventTypes: eventTypes,
413
414 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
415 return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
416 }
417};
418
419module.exports = BeforeInputEventPlugin;
420},{"103":103,"107":107,"148":148,"16":16,"166":166,"20":20,"21":21}],3:[function(_dereq_,module,exports){
421/**
422 * Copyright 2013-present, Facebook, Inc.
423 * All rights reserved.
424 *
425 * This source code is licensed under the BSD-style license found in the
426 * LICENSE file in the root directory of this source tree. An additional grant
427 * of patent rights can be found in the PATENTS file in the same directory.
428 *
429 * @providesModule CSSProperty
430 */
431
432'use strict';
433
434/**
435 * CSS properties which accept numbers but are not in units of "px".
436 */
437
438var isUnitlessNumber = {
439 animationIterationCount: true,
440 borderImageOutset: true,
441 borderImageSlice: true,
442 borderImageWidth: true,
443 boxFlex: true,
444 boxFlexGroup: true,
445 boxOrdinalGroup: true,
446 columnCount: true,
447 flex: true,
448 flexGrow: true,
449 flexPositive: true,
450 flexShrink: true,
451 flexNegative: true,
452 flexOrder: true,
453 gridRow: true,
454 gridColumn: true,
455 fontWeight: true,
456 lineClamp: true,
457 lineHeight: true,
458 opacity: true,
459 order: true,
460 orphans: true,
461 tabSize: true,
462 widows: true,
463 zIndex: true,
464 zoom: true,
465
466 // SVG-related properties
467 fillOpacity: true,
468 floodOpacity: true,
469 stopOpacity: true,
470 strokeDasharray: true,
471 strokeDashoffset: true,
472 strokeMiterlimit: true,
473 strokeOpacity: true,
474 strokeWidth: true
475};
476
477/**
478 * @param {string} prefix vendor-specific prefix, eg: Webkit
479 * @param {string} key style name, eg: transitionDuration
480 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
481 * WebkitTransitionDuration
482 */
483function prefixKey(prefix, key) {
484 return prefix + key.charAt(0).toUpperCase() + key.substring(1);
485}
486
487/**
488 * Support style names that may come passed in prefixed by adding permutations
489 * of vendor prefixes.
490 */
491var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
492
493// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
494// infinite loop, because it iterates over the newly added props too.
495Object.keys(isUnitlessNumber).forEach(function (prop) {
496 prefixes.forEach(function (prefix) {
497 isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
498 });
499});
500
501/**
502 * Most style properties can be unset by doing .style[prop] = '' but IE8
503 * doesn't like doing that with shorthand properties so for the properties that
504 * IE8 breaks on, which are listed here, we instead unset each of the
505 * individual properties. See http://bugs.jquery.com/ticket/12385.
506 * The 4-value 'clock' properties like margin, padding, border-width seem to
507 * behave without any problems. Curiously, list-style works too without any
508 * special prodding.
509 */
510var shorthandPropertyExpansions = {
511 background: {
512 backgroundAttachment: true,
513 backgroundColor: true,
514 backgroundImage: true,
515 backgroundPositionX: true,
516 backgroundPositionY: true,
517 backgroundRepeat: true
518 },
519 backgroundPosition: {
520 backgroundPositionX: true,
521 backgroundPositionY: true
522 },
523 border: {
524 borderWidth: true,
525 borderStyle: true,
526 borderColor: true
527 },
528 borderBottom: {
529 borderBottomWidth: true,
530 borderBottomStyle: true,
531 borderBottomColor: true
532 },
533 borderLeft: {
534 borderLeftWidth: true,
535 borderLeftStyle: true,
536 borderLeftColor: true
537 },
538 borderRight: {
539 borderRightWidth: true,
540 borderRightStyle: true,
541 borderRightColor: true
542 },
543 borderTop: {
544 borderTopWidth: true,
545 borderTopStyle: true,
546 borderTopColor: true
547 },
548 font: {
549 fontStyle: true,
550 fontVariant: true,
551 fontWeight: true,
552 fontSize: true,
553 lineHeight: true,
554 fontFamily: true
555 },
556 outline: {
557 outlineWidth: true,
558 outlineStyle: true,
559 outlineColor: true
560 }
561};
562
563var CSSProperty = {
564 isUnitlessNumber: isUnitlessNumber,
565 shorthandPropertyExpansions: shorthandPropertyExpansions
566};
567
568module.exports = CSSProperty;
569},{}],4:[function(_dereq_,module,exports){
570/**
571 * Copyright 2013-present, Facebook, Inc.
572 * All rights reserved.
573 *
574 * This source code is licensed under the BSD-style license found in the
575 * LICENSE file in the root directory of this source tree. An additional grant
576 * of patent rights can be found in the PATENTS file in the same directory.
577 *
578 * @providesModule CSSPropertyOperations
579 */
580
581'use strict';
582
583var CSSProperty = _dereq_(3);
584var ExecutionEnvironment = _dereq_(148);
585var ReactInstrumentation = _dereq_(73);
586
587var camelizeStyleName = _dereq_(150);
588var dangerousStyleValue = _dereq_(121);
589var hyphenateStyleName = _dereq_(161);
590var memoizeStringOnly = _dereq_(167);
591var warning = _dereq_(171);
592
593var processStyleName = memoizeStringOnly(function (styleName) {
594 return hyphenateStyleName(styleName);
595});
596
597var hasShorthandPropertyBug = false;
598var styleFloatAccessor = 'cssFloat';
599if (ExecutionEnvironment.canUseDOM) {
600 var tempStyle = document.createElement('div').style;
601 try {
602 // IE8 throws "Invalid argument." if resetting shorthand style properties.
603 tempStyle.font = '';
604 } catch (e) {
605 hasShorthandPropertyBug = true;
606 }
607 // IE8 only supports accessing cssFloat (standard) as styleFloat
608 if (document.documentElement.style.cssFloat === undefined) {
609 styleFloatAccessor = 'styleFloat';
610 }
611}
612
613if ("development" !== 'production') {
614 // 'msTransform' is correct, but the other prefixes should be capitalized
615 var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
616
617 // style values shouldn't contain a semicolon
618 var badStyleValueWithSemicolonPattern = /;\s*$/;
619
620 var warnedStyleNames = {};
621 var warnedStyleValues = {};
622 var warnedForNaNValue = false;
623
624 var warnHyphenatedStyleName = function (name, owner) {
625 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
626 return;
627 }
628
629 warnedStyleNames[name] = true;
630 "development" !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
631 };
632
633 var warnBadVendoredStyleName = function (name, owner) {
634 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
635 return;
636 }
637
638 warnedStyleNames[name] = true;
639 "development" !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
640 };
641
642 var warnStyleValueWithSemicolon = function (name, value, owner) {
643 if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
644 return;
645 }
646
647 warnedStyleValues[value] = true;
648 "development" !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;
649 };
650
651 var warnStyleValueIsNaN = function (name, value, owner) {
652 if (warnedForNaNValue) {
653 return;
654 }
655
656 warnedForNaNValue = true;
657 "development" !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
658 };
659
660 var checkRenderMessage = function (owner) {
661 if (owner) {
662 var name = owner.getName();
663 if (name) {
664 return ' Check the render method of `' + name + '`.';
665 }
666 }
667 return '';
668 };
669
670 /**
671 * @param {string} name
672 * @param {*} value
673 * @param {ReactDOMComponent} component
674 */
675 var warnValidStyle = function (name, value, component) {
676 var owner;
677 if (component) {
678 owner = component._currentElement._owner;
679 }
680 if (name.indexOf('-') > -1) {
681 warnHyphenatedStyleName(name, owner);
682 } else if (badVendoredStyleNamePattern.test(name)) {
683 warnBadVendoredStyleName(name, owner);
684 } else if (badStyleValueWithSemicolonPattern.test(value)) {
685 warnStyleValueWithSemicolon(name, value, owner);
686 }
687
688 if (typeof value === 'number' && isNaN(value)) {
689 warnStyleValueIsNaN(name, value, owner);
690 }
691 };
692}
693
694/**
695 * Operations for dealing with CSS properties.
696 */
697var CSSPropertyOperations = {
698
699 /**
700 * Serializes a mapping of style properties for use as inline styles:
701 *
702 * > createMarkupForStyles({width: '200px', height: 0})
703 * "width:200px;height:0;"
704 *
705 * Undefined values are ignored so that declarative programming is easier.
706 * The result should be HTML-escaped before insertion into the DOM.
707 *
708 * @param {object} styles
709 * @param {ReactDOMComponent} component
710 * @return {?string}
711 */
712 createMarkupForStyles: function (styles, component) {
713 var serialized = '';
714 for (var styleName in styles) {
715 if (!styles.hasOwnProperty(styleName)) {
716 continue;
717 }
718 var styleValue = styles[styleName];
719 if ("development" !== 'production') {
720 warnValidStyle(styleName, styleValue, component);
721 }
722 if (styleValue != null) {
723 serialized += processStyleName(styleName) + ':';
724 serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
725 }
726 }
727 return serialized || null;
728 },
729
730 /**
731 * Sets the value for multiple styles on a node. If a value is specified as
732 * '' (empty string), the corresponding style property will be unset.
733 *
734 * @param {DOMElement} node
735 * @param {object} styles
736 * @param {ReactDOMComponent} component
737 */
738 setValueForStyles: function (node, styles, component) {
739 if ("development" !== 'production') {
740 ReactInstrumentation.debugTool.onHostOperation(component._debugID, 'update styles', styles);
741 }
742
743 var style = node.style;
744 for (var styleName in styles) {
745 if (!styles.hasOwnProperty(styleName)) {
746 continue;
747 }
748 if ("development" !== 'production') {
749 warnValidStyle(styleName, styles[styleName], component);
750 }
751 var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
752 if (styleName === 'float' || styleName === 'cssFloat') {
753 styleName = styleFloatAccessor;
754 }
755 if (styleValue) {
756 style[styleName] = styleValue;
757 } else {
758 var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
759 if (expansion) {
760 // Shorthand property that IE8 won't like unsetting, so unset each
761 // component to placate it
762 for (var individualStyleName in expansion) {
763 style[individualStyleName] = '';
764 }
765 } else {
766 style[styleName] = '';
767 }
768 }
769 }
770 }
771
772};
773
774module.exports = CSSPropertyOperations;
775},{"121":121,"148":148,"150":150,"161":161,"167":167,"171":171,"3":3,"73":73}],5:[function(_dereq_,module,exports){
776/**
777 * Copyright 2013-present, Facebook, Inc.
778 * All rights reserved.
779 *
780 * This source code is licensed under the BSD-style license found in the
781 * LICENSE file in the root directory of this source tree. An additional grant
782 * of patent rights can be found in the PATENTS file in the same directory.
783 *
784 * @providesModule CallbackQueue
785 */
786
787'use strict';
788
789var _prodInvariant = _dereq_(140),
790 _assign = _dereq_(172);
791
792var PooledClass = _dereq_(25);
793
794var invariant = _dereq_(162);
795
796/**
797 * A specialized pseudo-event module to help keep track of components waiting to
798 * be notified when their DOM representations are available for use.
799 *
800 * This implements `PooledClass`, so you should never need to instantiate this.
801 * Instead, use `CallbackQueue.getPooled()`.
802 *
803 * @class ReactMountReady
804 * @implements PooledClass
805 * @internal
806 */
807function CallbackQueue() {
808 this._callbacks = null;
809 this._contexts = null;
810}
811
812_assign(CallbackQueue.prototype, {
813
814 /**
815 * Enqueues a callback to be invoked when `notifyAll` is invoked.
816 *
817 * @param {function} callback Invoked when `notifyAll` is invoked.
818 * @param {?object} context Context to call `callback` with.
819 * @internal
820 */
821 enqueue: function (callback, context) {
822 this._callbacks = this._callbacks || [];
823 this._contexts = this._contexts || [];
824 this._callbacks.push(callback);
825 this._contexts.push(context);
826 },
827
828 /**
829 * Invokes all enqueued callbacks and clears the queue. This is invoked after
830 * the DOM representation of a component has been created or updated.
831 *
832 * @internal
833 */
834 notifyAll: function () {
835 var callbacks = this._callbacks;
836 var contexts = this._contexts;
837 if (callbacks) {
838 !(callbacks.length === contexts.length) ? "development" !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0;
839 this._callbacks = null;
840 this._contexts = null;
841 for (var i = 0; i < callbacks.length; i++) {
842 callbacks[i].call(contexts[i]);
843 }
844 callbacks.length = 0;
845 contexts.length = 0;
846 }
847 },
848
849 checkpoint: function () {
850 return this._callbacks ? this._callbacks.length : 0;
851 },
852
853 rollback: function (len) {
854 if (this._callbacks) {
855 this._callbacks.length = len;
856 this._contexts.length = len;
857 }
858 },
859
860 /**
861 * Resets the internal queue.
862 *
863 * @internal
864 */
865 reset: function () {
866 this._callbacks = null;
867 this._contexts = null;
868 },
869
870 /**
871 * `PooledClass` looks for this.
872 */
873 destructor: function () {
874 this.reset();
875 }
876
877});
878
879PooledClass.addPoolingTo(CallbackQueue);
880
881module.exports = CallbackQueue;
882},{"140":140,"162":162,"172":172,"25":25}],6:[function(_dereq_,module,exports){
883/**
884 * Copyright 2013-present, Facebook, Inc.
885 * All rights reserved.
886 *
887 * This source code is licensed under the BSD-style license found in the
888 * LICENSE file in the root directory of this source tree. An additional grant
889 * of patent rights can be found in the PATENTS file in the same directory.
890 *
891 * @providesModule ChangeEventPlugin
892 */
893
894'use strict';
895
896var EventConstants = _dereq_(16);
897var EventPluginHub = _dereq_(17);
898var EventPropagators = _dereq_(20);
899var ExecutionEnvironment = _dereq_(148);
900var ReactDOMComponentTree = _dereq_(42);
901var ReactUpdates = _dereq_(96);
902var SyntheticEvent = _dereq_(105);
903
904var getEventTarget = _dereq_(129);
905var isEventSupported = _dereq_(136);
906var isTextInputElement = _dereq_(137);
907var keyOf = _dereq_(166);
908
909var topLevelTypes = EventConstants.topLevelTypes;
910
911var eventTypes = {
912 change: {
913 phasedRegistrationNames: {
914 bubbled: keyOf({ onChange: null }),
915 captured: keyOf({ onChangeCapture: null })
916 },
917 dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
918 }
919};
920
921/**
922 * For IE shims
923 */
924var activeElement = null;
925var activeElementInst = null;
926var activeElementValue = null;
927var activeElementValueProp = null;
928
929/**
930 * SECTION: handle `change` event
931 */
932function shouldUseChangeEvent(elem) {
933 var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
934 return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
935}
936
937var doesChangeEventBubble = false;
938if (ExecutionEnvironment.canUseDOM) {
939 // See `handleChange` comment below
940 doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8);
941}
942
943function manualDispatchChangeEvent(nativeEvent) {
944 var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
945 EventPropagators.accumulateTwoPhaseDispatches(event);
946
947 // If change and propertychange bubbled, we'd just bind to it like all the
948 // other events and have it go through ReactBrowserEventEmitter. Since it
949 // doesn't, we manually listen for the events and so we have to enqueue and
950 // process the abstract event manually.
951 //
952 // Batching is necessary here in order to ensure that all event handlers run
953 // before the next rerender (including event handlers attached to ancestor
954 // elements instead of directly on the input). Without this, controlled
955 // components don't work properly in conjunction with event bubbling because
956 // the component is rerendered and the value reverted before all the event
957 // handlers can run. See https://github.com/facebook/react/issues/708.
958 ReactUpdates.batchedUpdates(runEventInBatch, event);
959}
960
961function runEventInBatch(event) {
962 EventPluginHub.enqueueEvents(event);
963 EventPluginHub.processEventQueue(false);
964}
965
966function startWatchingForChangeEventIE8(target, targetInst) {
967 activeElement = target;
968 activeElementInst = targetInst;
969 activeElement.attachEvent('onchange', manualDispatchChangeEvent);
970}
971
972function stopWatchingForChangeEventIE8() {
973 if (!activeElement) {
974 return;
975 }
976 activeElement.detachEvent('onchange', manualDispatchChangeEvent);
977 activeElement = null;
978 activeElementInst = null;
979}
980
981function getTargetInstForChangeEvent(topLevelType, targetInst) {
982 if (topLevelType === topLevelTypes.topChange) {
983 return targetInst;
984 }
985}
986function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
987 if (topLevelType === topLevelTypes.topFocus) {
988 // stopWatching() should be a noop here but we call it just in case we
989 // missed a blur event somehow.
990 stopWatchingForChangeEventIE8();
991 startWatchingForChangeEventIE8(target, targetInst);
992 } else if (topLevelType === topLevelTypes.topBlur) {
993 stopWatchingForChangeEventIE8();
994 }
995}
996
997/**
998 * SECTION: handle `input` event
999 */
1000var isInputEventSupported = false;
1001if (ExecutionEnvironment.canUseDOM) {
1002 // IE9 claims to support the input event but fails to trigger it when
1003 // deleting text, so we ignore its input events.
1004 // IE10+ fire input events to often, such when a placeholder
1005 // changes or when an input with a placeholder is focused.
1006 isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 11);
1007}
1008
1009/**
1010 * (For IE <=11) Replacement getter/setter for the `value` property that gets
1011 * set on the active element.
1012 */
1013var newValueProp = {
1014 get: function () {
1015 return activeElementValueProp.get.call(this);
1016 },
1017 set: function (val) {
1018 // Cast to a string so we can do equality checks.
1019 activeElementValue = '' + val;
1020 activeElementValueProp.set.call(this, val);
1021 }
1022};
1023
1024/**
1025 * (For IE <=11) Starts tracking propertychange events on the passed-in element
1026 * and override the value property so that we can distinguish user events from
1027 * value changes in JS.
1028 */
1029function startWatchingForValueChange(target, targetInst) {
1030 activeElement = target;
1031 activeElementInst = targetInst;
1032 activeElementValue = target.value;
1033 activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
1034
1035 // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
1036 // on DOM elements
1037 Object.defineProperty(activeElement, 'value', newValueProp);
1038 if (activeElement.attachEvent) {
1039 activeElement.attachEvent('onpropertychange', handlePropertyChange);
1040 } else {
1041 activeElement.addEventListener('propertychange', handlePropertyChange, false);
1042 }
1043}
1044
1045/**
1046 * (For IE <=11) Removes the event listeners from the currently-tracked element,
1047 * if any exists.
1048 */
1049function stopWatchingForValueChange() {
1050 if (!activeElement) {
1051 return;
1052 }
1053
1054 // delete restores the original property definition
1055 delete activeElement.value;
1056
1057 if (activeElement.detachEvent) {
1058 activeElement.detachEvent('onpropertychange', handlePropertyChange);
1059 } else {
1060 activeElement.removeEventListener('propertychange', handlePropertyChange, false);
1061 }
1062
1063 activeElement = null;
1064 activeElementInst = null;
1065 activeElementValue = null;
1066 activeElementValueProp = null;
1067}
1068
1069/**
1070 * (For IE <=11) Handles a propertychange event, sending a `change` event if
1071 * the value of the active element has changed.
1072 */
1073function handlePropertyChange(nativeEvent) {
1074 if (nativeEvent.propertyName !== 'value') {
1075 return;
1076 }
1077 var value = nativeEvent.srcElement.value;
1078 if (value === activeElementValue) {
1079 return;
1080 }
1081 activeElementValue = value;
1082
1083 manualDispatchChangeEvent(nativeEvent);
1084}
1085
1086/**
1087 * If a `change` event should be fired, returns the target's ID.
1088 */
1089function getTargetInstForInputEvent(topLevelType, targetInst) {
1090 if (topLevelType === topLevelTypes.topInput) {
1091 // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
1092 // what we want so fall through here and trigger an abstract event
1093 return targetInst;
1094 }
1095}
1096
1097function handleEventsForInputEventIE(topLevelType, target, targetInst) {
1098 if (topLevelType === topLevelTypes.topFocus) {
1099 // In IE8, we can capture almost all .value changes by adding a
1100 // propertychange handler and looking for events with propertyName
1101 // equal to 'value'
1102 // In IE9-11, propertychange fires for most input events but is buggy and
1103 // doesn't fire when text is deleted, but conveniently, selectionchange
1104 // appears to fire in all of the remaining cases so we catch those and
1105 // forward the event if the value has changed
1106 // In either case, we don't want to call the event handler if the value
1107 // is changed from JS so we redefine a setter for `.value` that updates
1108 // our activeElementValue variable, allowing us to ignore those changes
1109 //
1110 // stopWatching() should be a noop here but we call it just in case we
1111 // missed a blur event somehow.
1112 stopWatchingForValueChange();
1113 startWatchingForValueChange(target, targetInst);
1114 } else if (topLevelType === topLevelTypes.topBlur) {
1115 stopWatchingForValueChange();
1116 }
1117}
1118
1119// For IE8 and IE9.
1120function getTargetInstForInputEventIE(topLevelType, targetInst) {
1121 if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
1122 // On the selectionchange event, the target is just document which isn't
1123 // helpful for us so just check activeElement instead.
1124 //
1125 // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
1126 // propertychange on the first input event after setting `value` from a
1127 // script and fires only keydown, keypress, keyup. Catching keyup usually
1128 // gets it and catching keydown lets us fire an event for the first
1129 // keystroke if user does a key repeat (it'll be a little delayed: right
1130 // before the second keystroke). Other input methods (e.g., paste) seem to
1131 // fire selectionchange normally.
1132 if (activeElement && activeElement.value !== activeElementValue) {
1133 activeElementValue = activeElement.value;
1134 return activeElementInst;
1135 }
1136 }
1137}
1138
1139/**
1140 * SECTION: handle `click` event
1141 */
1142function shouldUseClickEvent(elem) {
1143 // Use the `click` event to detect changes to checkbox and radio inputs.
1144 // This approach works across all browsers, whereas `change` does not fire
1145 // until `blur` in IE8.
1146 return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
1147}
1148
1149function getTargetInstForClickEvent(topLevelType, targetInst) {
1150 if (topLevelType === topLevelTypes.topClick) {
1151 return targetInst;
1152 }
1153}
1154
1155/**
1156 * This plugin creates an `onChange` event that normalizes change events
1157 * across form elements. This event fires at a time when it's possible to
1158 * change the element's value without seeing a flicker.
1159 *
1160 * Supported elements are:
1161 * - input (see `isTextInputElement`)
1162 * - textarea
1163 * - select
1164 */
1165var ChangeEventPlugin = {
1166
1167 eventTypes: eventTypes,
1168
1169 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
1170 var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
1171
1172 var getTargetInstFunc, handleEventFunc;
1173 if (shouldUseChangeEvent(targetNode)) {
1174 if (doesChangeEventBubble) {
1175 getTargetInstFunc = getTargetInstForChangeEvent;
1176 } else {
1177 handleEventFunc = handleEventsForChangeEventIE8;
1178 }
1179 } else if (isTextInputElement(targetNode)) {
1180 if (isInputEventSupported) {
1181 getTargetInstFunc = getTargetInstForInputEvent;
1182 } else {
1183 getTargetInstFunc = getTargetInstForInputEventIE;
1184 handleEventFunc = handleEventsForInputEventIE;
1185 }
1186 } else if (shouldUseClickEvent(targetNode)) {
1187 getTargetInstFunc = getTargetInstForClickEvent;
1188 }
1189
1190 if (getTargetInstFunc) {
1191 var inst = getTargetInstFunc(topLevelType, targetInst);
1192 if (inst) {
1193 var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);
1194 event.type = 'change';
1195 EventPropagators.accumulateTwoPhaseDispatches(event);
1196 return event;
1197 }
1198 }
1199
1200 if (handleEventFunc) {
1201 handleEventFunc(topLevelType, targetNode, targetInst);
1202 }
1203 }
1204
1205};
1206
1207module.exports = ChangeEventPlugin;
1208},{"105":105,"129":129,"136":136,"137":137,"148":148,"16":16,"166":166,"17":17,"20":20,"42":42,"96":96}],7:[function(_dereq_,module,exports){
1209/**
1210 * Copyright 2013-present, Facebook, Inc.
1211 * All rights reserved.
1212 *
1213 * This source code is licensed under the BSD-style license found in the
1214 * LICENSE file in the root directory of this source tree. An additional grant
1215 * of patent rights can be found in the PATENTS file in the same directory.
1216 *
1217 * @providesModule DOMChildrenOperations
1218 */
1219
1220'use strict';
1221
1222var DOMLazyTree = _dereq_(8);
1223var Danger = _dereq_(12);
1224var ReactMultiChildUpdateTypes = _dereq_(78);
1225var ReactDOMComponentTree = _dereq_(42);
1226var ReactInstrumentation = _dereq_(73);
1227
1228var createMicrosoftUnsafeLocalFunction = _dereq_(120);
1229var setInnerHTML = _dereq_(142);
1230var setTextContent = _dereq_(143);
1231
1232function getNodeAfter(parentNode, node) {
1233 // Special case for text components, which return [open, close] comments
1234 // from getHostNode.
1235 if (Array.isArray(node)) {
1236 node = node[1];
1237 }
1238 return node ? node.nextSibling : parentNode.firstChild;
1239}
1240
1241/**
1242 * Inserts `childNode` as a child of `parentNode` at the `index`.
1243 *
1244 * @param {DOMElement} parentNode Parent node in which to insert.
1245 * @param {DOMElement} childNode Child node to insert.
1246 * @param {number} index Index at which to insert the child.
1247 * @internal
1248 */
1249var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
1250 // We rely exclusively on `insertBefore(node, null)` instead of also using
1251 // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so
1252 // we are careful to use `null`.)
1253 parentNode.insertBefore(childNode, referenceNode);
1254});
1255
1256function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
1257 DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
1258}
1259
1260function moveChild(parentNode, childNode, referenceNode) {
1261 if (Array.isArray(childNode)) {
1262 moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
1263 } else {
1264 insertChildAt(parentNode, childNode, referenceNode);
1265 }
1266}
1267
1268function removeChild(parentNode, childNode) {
1269 if (Array.isArray(childNode)) {
1270 var closingComment = childNode[1];
1271 childNode = childNode[0];
1272 removeDelimitedText(parentNode, childNode, closingComment);
1273 parentNode.removeChild(closingComment);
1274 }
1275 parentNode.removeChild(childNode);
1276}
1277
1278function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
1279 var node = openingComment;
1280 while (true) {
1281 var nextNode = node.nextSibling;
1282 insertChildAt(parentNode, node, referenceNode);
1283 if (node === closingComment) {
1284 break;
1285 }
1286 node = nextNode;
1287 }
1288}
1289
1290function removeDelimitedText(parentNode, startNode, closingComment) {
1291 while (true) {
1292 var node = startNode.nextSibling;
1293 if (node === closingComment) {
1294 // The closing comment is removed by ReactMultiChild.
1295 break;
1296 } else {
1297 parentNode.removeChild(node);
1298 }
1299 }
1300}
1301
1302function replaceDelimitedText(openingComment, closingComment, stringText) {
1303 var parentNode = openingComment.parentNode;
1304 var nodeAfterComment = openingComment.nextSibling;
1305 if (nodeAfterComment === closingComment) {
1306 // There are no text nodes between the opening and closing comments; insert
1307 // a new one if stringText isn't empty.
1308 if (stringText) {
1309 insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
1310 }
1311 } else {
1312 if (stringText) {
1313 // Set the text content of the first node after the opening comment, and
1314 // remove all following nodes up until the closing comment.
1315 setTextContent(nodeAfterComment, stringText);
1316 removeDelimitedText(parentNode, nodeAfterComment, closingComment);
1317 } else {
1318 removeDelimitedText(parentNode, openingComment, closingComment);
1319 }
1320 }
1321
1322 if ("development" !== 'production') {
1323 ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, 'replace text', stringText);
1324 }
1325}
1326
1327var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
1328if ("development" !== 'production') {
1329 dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
1330 Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
1331 if (prevInstance._debugID !== 0) {
1332 ReactInstrumentation.debugTool.onHostOperation(prevInstance._debugID, 'replace with', markup.toString());
1333 } else {
1334 var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
1335 if (nextInstance._debugID !== 0) {
1336 ReactInstrumentation.debugTool.onHostOperation(nextInstance._debugID, 'mount', markup.toString());
1337 }
1338 }
1339 };
1340}
1341
1342/**
1343 * Operations for updating with DOM children.
1344 */
1345var DOMChildrenOperations = {
1346
1347 dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
1348
1349 replaceDelimitedText: replaceDelimitedText,
1350
1351 /**
1352 * Updates a component's children by processing a series of updates. The
1353 * update configurations are each expected to have a `parentNode` property.
1354 *
1355 * @param {array<object>} updates List of update configurations.
1356 * @internal
1357 */
1358 processUpdates: function (parentNode, updates) {
1359 if ("development" !== 'production') {
1360 var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
1361 }
1362
1363 for (var k = 0; k < updates.length; k++) {
1364 var update = updates[k];
1365 switch (update.type) {
1366 case ReactMultiChildUpdateTypes.INSERT_MARKUP:
1367 insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
1368 if ("development" !== 'production') {
1369 ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'insert child', { toIndex: update.toIndex, content: update.content.toString() });
1370 }
1371 break;
1372 case ReactMultiChildUpdateTypes.MOVE_EXISTING:
1373 moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
1374 if ("development" !== 'production') {
1375 ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'move child', { fromIndex: update.fromIndex, toIndex: update.toIndex });
1376 }
1377 break;
1378 case ReactMultiChildUpdateTypes.SET_MARKUP:
1379 setInnerHTML(parentNode, update.content);
1380 if ("development" !== 'production') {
1381 ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'replace children', update.content.toString());
1382 }
1383 break;
1384 case ReactMultiChildUpdateTypes.TEXT_CONTENT:
1385 setTextContent(parentNode, update.content);
1386 if ("development" !== 'production') {
1387 ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'replace text', update.content.toString());
1388 }
1389 break;
1390 case ReactMultiChildUpdateTypes.REMOVE_NODE:
1391 removeChild(parentNode, update.fromNode);
1392 if ("development" !== 'production') {
1393 ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'remove child', { fromIndex: update.fromIndex });
1394 }
1395 break;
1396 }
1397 }
1398 }
1399
1400};
1401
1402module.exports = DOMChildrenOperations;
1403},{"12":12,"120":120,"142":142,"143":143,"42":42,"73":73,"78":78,"8":8}],8:[function(_dereq_,module,exports){
1404/**
1405 * Copyright 2015-present, Facebook, Inc.
1406 * All rights reserved.
1407 *
1408 * This source code is licensed under the BSD-style license found in the
1409 * LICENSE file in the root directory of this source tree. An additional grant
1410 * of patent rights can be found in the PATENTS file in the same directory.
1411 *
1412 * @providesModule DOMLazyTree
1413 */
1414
1415'use strict';
1416
1417var DOMNamespaces = _dereq_(9);
1418var setInnerHTML = _dereq_(142);
1419
1420var createMicrosoftUnsafeLocalFunction = _dereq_(120);
1421var setTextContent = _dereq_(143);
1422
1423var ELEMENT_NODE_TYPE = 1;
1424var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
1425
1426/**
1427 * In IE (8-11) and Edge, appending nodes with no children is dramatically
1428 * faster than appending a full subtree, so we essentially queue up the
1429 * .appendChild calls here and apply them so each node is added to its parent
1430 * before any children are added.
1431 *
1432 * In other browsers, doing so is slower or neutral compared to the other order
1433 * (in Firefox, twice as slow) so we only do this inversion in IE.
1434 *
1435 * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
1436 */
1437var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
1438
1439function insertTreeChildren(tree) {
1440 if (!enableLazy) {
1441 return;
1442 }
1443 var node = tree.node;
1444 var children = tree.children;
1445 if (children.length) {
1446 for (var i = 0; i < children.length; i++) {
1447 insertTreeBefore(node, children[i], null);
1448 }
1449 } else if (tree.html != null) {
1450 setInnerHTML(node, tree.html);
1451 } else if (tree.text != null) {
1452 setTextContent(node, tree.text);
1453 }
1454}
1455
1456var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
1457 // DocumentFragments aren't actually part of the DOM after insertion so
1458 // appending children won't update the DOM. We need to ensure the fragment
1459 // is properly populated first, breaking out of our lazy approach for just
1460 // this level. Also, some <object> plugins (like Flash Player) will read
1461 // <param> nodes immediately upon insertion into the DOM, so <object>
1462 // must also be populated prior to insertion into the DOM.
1463 if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) {
1464 insertTreeChildren(tree);
1465 parentNode.insertBefore(tree.node, referenceNode);
1466 } else {
1467 parentNode.insertBefore(tree.node, referenceNode);
1468 insertTreeChildren(tree);
1469 }
1470});
1471
1472function replaceChildWithTree(oldNode, newTree) {
1473 oldNode.parentNode.replaceChild(newTree.node, oldNode);
1474 insertTreeChildren(newTree);
1475}
1476
1477function queueChild(parentTree, childTree) {
1478 if (enableLazy) {
1479 parentTree.children.push(childTree);
1480 } else {
1481 parentTree.node.appendChild(childTree.node);
1482 }
1483}
1484
1485function queueHTML(tree, html) {
1486 if (enableLazy) {
1487 tree.html = html;
1488 } else {
1489 setInnerHTML(tree.node, html);
1490 }
1491}
1492
1493function queueText(tree, text) {
1494 if (enableLazy) {
1495 tree.text = text;
1496 } else {
1497 setTextContent(tree.node, text);
1498 }
1499}
1500
1501function toString() {
1502 return this.node.nodeName;
1503}
1504
1505function DOMLazyTree(node) {
1506 return {
1507 node: node,
1508 children: [],
1509 html: null,
1510 text: null,
1511 toString: toString
1512 };
1513}
1514
1515DOMLazyTree.insertTreeBefore = insertTreeBefore;
1516DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
1517DOMLazyTree.queueChild = queueChild;
1518DOMLazyTree.queueHTML = queueHTML;
1519DOMLazyTree.queueText = queueText;
1520
1521module.exports = DOMLazyTree;
1522},{"120":120,"142":142,"143":143,"9":9}],9:[function(_dereq_,module,exports){
1523/**
1524 * Copyright 2013-present, Facebook, Inc.
1525 * All rights reserved.
1526 *
1527 * This source code is licensed under the BSD-style license found in the
1528 * LICENSE file in the root directory of this source tree. An additional grant
1529 * of patent rights can be found in the PATENTS file in the same directory.
1530 *
1531 * @providesModule DOMNamespaces
1532 */
1533
1534'use strict';
1535
1536var DOMNamespaces = {
1537 html: 'http://www.w3.org/1999/xhtml',
1538 mathml: 'http://www.w3.org/1998/Math/MathML',
1539 svg: 'http://www.w3.org/2000/svg'
1540};
1541
1542module.exports = DOMNamespaces;
1543},{}],10:[function(_dereq_,module,exports){
1544/**
1545 * Copyright 2013-present, Facebook, Inc.
1546 * All rights reserved.
1547 *
1548 * This source code is licensed under the BSD-style license found in the
1549 * LICENSE file in the root directory of this source tree. An additional grant
1550 * of patent rights can be found in the PATENTS file in the same directory.
1551 *
1552 * @providesModule DOMProperty
1553 */
1554
1555'use strict';
1556
1557var _prodInvariant = _dereq_(140);
1558
1559var invariant = _dereq_(162);
1560
1561function checkMask(value, bitmask) {
1562 return (value & bitmask) === bitmask;
1563}
1564
1565var DOMPropertyInjection = {
1566 /**
1567 * Mapping from normalized, camelcased property names to a configuration that
1568 * specifies how the associated DOM property should be accessed or rendered.
1569 */
1570 MUST_USE_PROPERTY: 0x1,
1571 HAS_BOOLEAN_VALUE: 0x4,
1572 HAS_NUMERIC_VALUE: 0x8,
1573 HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
1574 HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
1575
1576 /**
1577 * Inject some specialized knowledge about the DOM. This takes a config object
1578 * with the following properties:
1579 *
1580 * isCustomAttribute: function that given an attribute name will return true
1581 * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
1582 * attributes where it's impossible to enumerate all of the possible
1583 * attribute names,
1584 *
1585 * Properties: object mapping DOM property name to one of the
1586 * DOMPropertyInjection constants or null. If your attribute isn't in here,
1587 * it won't get written to the DOM.
1588 *
1589 * DOMAttributeNames: object mapping React attribute name to the DOM
1590 * attribute name. Attribute names not specified use the **lowercase**
1591 * normalized name.
1592 *
1593 * DOMAttributeNamespaces: object mapping React attribute name to the DOM
1594 * attribute namespace URL. (Attribute names not specified use no namespace.)
1595 *
1596 * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
1597 * Property names not specified use the normalized name.
1598 *
1599 * DOMMutationMethods: Properties that require special mutation methods. If
1600 * `value` is undefined, the mutation method should unset the property.
1601 *
1602 * @param {object} domPropertyConfig the config as described above.
1603 */
1604 injectDOMPropertyConfig: function (domPropertyConfig) {
1605 var Injection = DOMPropertyInjection;
1606 var Properties = domPropertyConfig.Properties || {};
1607 var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
1608 var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
1609 var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
1610 var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
1611
1612 if (domPropertyConfig.isCustomAttribute) {
1613 DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
1614 }
1615
1616 for (var propName in Properties) {
1617 !!DOMProperty.properties.hasOwnProperty(propName) ? "development" !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property \'%s\' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.', propName) : _prodInvariant('48', propName) : void 0;
1618
1619 var lowerCased = propName.toLowerCase();
1620 var propConfig = Properties[propName];
1621
1622 var propertyInfo = {
1623 attributeName: lowerCased,
1624 attributeNamespace: null,
1625 propertyName: propName,
1626 mutationMethod: null,
1627
1628 mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
1629 hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
1630 hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
1631 hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
1632 hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
1633 };
1634 !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? "development" !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s', propName) : _prodInvariant('50', propName) : void 0;
1635
1636 if ("development" !== 'production') {
1637 DOMProperty.getPossibleStandardName[lowerCased] = propName;
1638 }
1639
1640 if (DOMAttributeNames.hasOwnProperty(propName)) {
1641 var attributeName = DOMAttributeNames[propName];
1642 propertyInfo.attributeName = attributeName;
1643 if ("development" !== 'production') {
1644 DOMProperty.getPossibleStandardName[attributeName] = propName;
1645 }
1646 }
1647
1648 if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
1649 propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
1650 }
1651
1652 if (DOMPropertyNames.hasOwnProperty(propName)) {
1653 propertyInfo.propertyName = DOMPropertyNames[propName];
1654 }
1655
1656 if (DOMMutationMethods.hasOwnProperty(propName)) {
1657 propertyInfo.mutationMethod = DOMMutationMethods[propName];
1658 }
1659
1660 DOMProperty.properties[propName] = propertyInfo;
1661 }
1662 }
1663};
1664
1665/* eslint-disable max-len */
1666var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
1667/* eslint-enable max-len */
1668
1669/**
1670 * DOMProperty exports lookup objects that can be used like functions:
1671 *
1672 * > DOMProperty.isValid['id']
1673 * true
1674 * > DOMProperty.isValid['foobar']
1675 * undefined
1676 *
1677 * Although this may be confusing, it performs better in general.
1678 *
1679 * @see http://jsperf.com/key-exists
1680 * @see http://jsperf.com/key-missing
1681 */
1682var DOMProperty = {
1683
1684 ID_ATTRIBUTE_NAME: 'data-reactid',
1685 ROOT_ATTRIBUTE_NAME: 'data-reactroot',
1686
1687 ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
1688 ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
1689
1690 /**
1691 * Map from property "standard name" to an object with info about how to set
1692 * the property in the DOM. Each object contains:
1693 *
1694 * attributeName:
1695 * Used when rendering markup or with `*Attribute()`.
1696 * attributeNamespace
1697 * propertyName:
1698 * Used on DOM node instances. (This includes properties that mutate due to
1699 * external factors.)
1700 * mutationMethod:
1701 * If non-null, used instead of the property or `setAttribute()` after
1702 * initial render.
1703 * mustUseProperty:
1704 * Whether the property must be accessed and mutated as an object property.
1705 * hasBooleanValue:
1706 * Whether the property should be removed when set to a falsey value.
1707 * hasNumericValue:
1708 * Whether the property must be numeric or parse as a numeric and should be
1709 * removed when set to a falsey value.
1710 * hasPositiveNumericValue:
1711 * Whether the property must be positive numeric or parse as a positive
1712 * numeric and should be removed when set to a falsey value.
1713 * hasOverloadedBooleanValue:
1714 * Whether the property can be used as a flag as well as with a value.
1715 * Removed when strictly equal to false; present without a value when
1716 * strictly equal to true; present with a value otherwise.
1717 */
1718 properties: {},
1719
1720 /**
1721 * Mapping from lowercase property names to the properly cased version, used
1722 * to warn in the case of missing properties. Available only in __DEV__.
1723 * @type {Object}
1724 */
1725 getPossibleStandardName: "development" !== 'production' ? {} : null,
1726
1727 /**
1728 * All of the isCustomAttribute() functions that have been injected.
1729 */
1730 _isCustomAttributeFunctions: [],
1731
1732 /**
1733 * Checks whether a property name is a custom attribute.
1734 * @method
1735 */
1736 isCustomAttribute: function (attributeName) {
1737 for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
1738 var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
1739 if (isCustomAttributeFn(attributeName)) {
1740 return true;
1741 }
1742 }
1743 return false;
1744 },
1745
1746 injection: DOMPropertyInjection
1747};
1748
1749module.exports = DOMProperty;
1750},{"140":140,"162":162}],11:[function(_dereq_,module,exports){
1751/**
1752 * Copyright 2013-present, Facebook, Inc.
1753 * All rights reserved.
1754 *
1755 * This source code is licensed under the BSD-style license found in the
1756 * LICENSE file in the root directory of this source tree. An additional grant
1757 * of patent rights can be found in the PATENTS file in the same directory.
1758 *
1759 * @providesModule DOMPropertyOperations
1760 */
1761
1762'use strict';
1763
1764var DOMProperty = _dereq_(10);
1765var ReactDOMComponentTree = _dereq_(42);
1766var ReactInstrumentation = _dereq_(73);
1767
1768var quoteAttributeValueForBrowser = _dereq_(139);
1769var warning = _dereq_(171);
1770
1771var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
1772var illegalAttributeNameCache = {};
1773var validatedAttributeNameCache = {};
1774
1775function isAttributeNameSafe(attributeName) {
1776 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
1777 return true;
1778 }
1779 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
1780 return false;
1781 }
1782 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
1783 validatedAttributeNameCache[attributeName] = true;
1784 return true;
1785 }
1786 illegalAttributeNameCache[attributeName] = true;
1787 "development" !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
1788 return false;
1789}
1790
1791function shouldIgnoreValue(propertyInfo, value) {
1792 return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
1793}
1794
1795/**
1796 * Operations for dealing with DOM properties.
1797 */
1798var DOMPropertyOperations = {
1799
1800 /**
1801 * Creates markup for the ID property.
1802 *
1803 * @param {string} id Unescaped ID.
1804 * @return {string} Markup string.
1805 */
1806 createMarkupForID: function (id) {
1807 return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
1808 },
1809
1810 setAttributeForID: function (node, id) {
1811 node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
1812 },
1813
1814 createMarkupForRoot: function () {
1815 return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
1816 },
1817
1818 setAttributeForRoot: function (node) {
1819 node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
1820 },
1821
1822 /**
1823 * Creates markup for a property.
1824 *
1825 * @param {string} name
1826 * @param {*} value
1827 * @return {?string} Markup string, or null if the property was invalid.
1828 */
1829 createMarkupForProperty: function (name, value) {
1830 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1831 if (propertyInfo) {
1832 if (shouldIgnoreValue(propertyInfo, value)) {
1833 return '';
1834 }
1835 var attributeName = propertyInfo.attributeName;
1836 if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
1837 return attributeName + '=""';
1838 }
1839 return attributeName + '=' + quoteAttributeValueForBrowser(value);
1840 } else if (DOMProperty.isCustomAttribute(name)) {
1841 if (value == null) {
1842 return '';
1843 }
1844 return name + '=' + quoteAttributeValueForBrowser(value);
1845 }
1846 return null;
1847 },
1848
1849 /**
1850 * Creates markup for a custom property.
1851 *
1852 * @param {string} name
1853 * @param {*} value
1854 * @return {string} Markup string, or empty string if the property was invalid.
1855 */
1856 createMarkupForCustomAttribute: function (name, value) {
1857 if (!isAttributeNameSafe(name) || value == null) {
1858 return '';
1859 }
1860 return name + '=' + quoteAttributeValueForBrowser(value);
1861 },
1862
1863 /**
1864 * Sets the value for a property on a node.
1865 *
1866 * @param {DOMElement} node
1867 * @param {string} name
1868 * @param {*} value
1869 */
1870 setValueForProperty: function (node, name, value) {
1871 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1872 if (propertyInfo) {
1873 var mutationMethod = propertyInfo.mutationMethod;
1874 if (mutationMethod) {
1875 mutationMethod(node, value);
1876 } else if (shouldIgnoreValue(propertyInfo, value)) {
1877 this.deleteValueForProperty(node, name);
1878 return;
1879 } else if (propertyInfo.mustUseProperty) {
1880 // Contrary to `setAttribute`, object properties are properly
1881 // `toString`ed by IE8/9.
1882 node[propertyInfo.propertyName] = value;
1883 } else {
1884 var attributeName = propertyInfo.attributeName;
1885 var namespace = propertyInfo.attributeNamespace;
1886 // `setAttribute` with objects becomes only `[object]` in IE8/9,
1887 // ('' + value) makes it output the correct toString()-value.
1888 if (namespace) {
1889 node.setAttributeNS(namespace, attributeName, '' + value);
1890 } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
1891 node.setAttribute(attributeName, '');
1892 } else {
1893 node.setAttribute(attributeName, '' + value);
1894 }
1895 }
1896 } else if (DOMProperty.isCustomAttribute(name)) {
1897 DOMPropertyOperations.setValueForAttribute(node, name, value);
1898 return;
1899 }
1900
1901 if ("development" !== 'production') {
1902 var payload = {};
1903 payload[name] = value;
1904 ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
1905 }
1906 },
1907
1908 setValueForAttribute: function (node, name, value) {
1909 if (!isAttributeNameSafe(name)) {
1910 return;
1911 }
1912 if (value == null) {
1913 node.removeAttribute(name);
1914 } else {
1915 node.setAttribute(name, '' + value);
1916 }
1917
1918 if ("development" !== 'production') {
1919 var payload = {};
1920 payload[name] = value;
1921 ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
1922 }
1923 },
1924
1925 /**
1926 * Deletes an attributes from a node.
1927 *
1928 * @param {DOMElement} node
1929 * @param {string} name
1930 */
1931 deleteValueForAttribute: function (node, name) {
1932 node.removeAttribute(name);
1933 if ("development" !== 'production') {
1934 ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
1935 }
1936 },
1937
1938 /**
1939 * Deletes the value for a property on a node.
1940 *
1941 * @param {DOMElement} node
1942 * @param {string} name
1943 */
1944 deleteValueForProperty: function (node, name) {
1945 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1946 if (propertyInfo) {
1947 var mutationMethod = propertyInfo.mutationMethod;
1948 if (mutationMethod) {
1949 mutationMethod(node, undefined);
1950 } else if (propertyInfo.mustUseProperty) {
1951 var propName = propertyInfo.propertyName;
1952 if (propertyInfo.hasBooleanValue) {
1953 node[propName] = false;
1954 } else {
1955 node[propName] = '';
1956 }
1957 } else {
1958 node.removeAttribute(propertyInfo.attributeName);
1959 }
1960 } else if (DOMProperty.isCustomAttribute(name)) {
1961 node.removeAttribute(name);
1962 }
1963
1964 if ("development" !== 'production') {
1965 ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
1966 }
1967 }
1968
1969};
1970
1971module.exports = DOMPropertyOperations;
1972},{"10":10,"139":139,"171":171,"42":42,"73":73}],12:[function(_dereq_,module,exports){
1973/**
1974 * Copyright 2013-present, Facebook, Inc.
1975 * All rights reserved.
1976 *
1977 * This source code is licensed under the BSD-style license found in the
1978 * LICENSE file in the root directory of this source tree. An additional grant
1979 * of patent rights can be found in the PATENTS file in the same directory.
1980 *
1981 * @providesModule Danger
1982 */
1983
1984'use strict';
1985
1986var _prodInvariant = _dereq_(140);
1987
1988var DOMLazyTree = _dereq_(8);
1989var ExecutionEnvironment = _dereq_(148);
1990
1991var createNodesFromMarkup = _dereq_(153);
1992var emptyFunction = _dereq_(154);
1993var invariant = _dereq_(162);
1994
1995var Danger = {
1996
1997 /**
1998 * Replaces a node with a string of markup at its current position within its
1999 * parent. The markup must render into a single root node.
2000 *
2001 * @param {DOMElement} oldChild Child node to replace.
2002 * @param {string} markup Markup to render in place of the child node.
2003 * @internal
2004 */
2005 dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
2006 !ExecutionEnvironment.canUseDOM ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('56') : void 0;
2007 !markup ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0;
2008 !(oldChild.nodeName !== 'HTML') ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString().') : _prodInvariant('58') : void 0;
2009
2010 if (typeof markup === 'string') {
2011 var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
2012 oldChild.parentNode.replaceChild(newChild, oldChild);
2013 } else {
2014 DOMLazyTree.replaceChildWithTree(oldChild, markup);
2015 }
2016 }
2017
2018};
2019
2020module.exports = Danger;
2021},{"140":140,"148":148,"153":153,"154":154,"162":162,"8":8}],13:[function(_dereq_,module,exports){
2022/**
2023 * Copyright 2013-present, Facebook, Inc.
2024 * All rights reserved.
2025 *
2026 * This source code is licensed under the BSD-style license found in the
2027 * LICENSE file in the root directory of this source tree. An additional grant
2028 * of patent rights can be found in the PATENTS file in the same directory.
2029 *
2030 * @providesModule DefaultEventPluginOrder
2031 */
2032
2033'use strict';
2034
2035var keyOf = _dereq_(166);
2036
2037/**
2038 * Module that is injectable into `EventPluginHub`, that specifies a
2039 * deterministic ordering of `EventPlugin`s. A convenient way to reason about
2040 * plugins, without having to package every one of them. This is better than
2041 * having plugins be ordered in the same order that they are injected because
2042 * that ordering would be influenced by the packaging order.
2043 * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
2044 * preventing default on events is convenient in `SimpleEventPlugin` handlers.
2045 */
2046var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
2047
2048module.exports = DefaultEventPluginOrder;
2049},{"166":166}],14:[function(_dereq_,module,exports){
2050/**
2051 * Copyright 2013-present, Facebook, Inc.
2052 * All rights reserved.
2053 *
2054 * This source code is licensed under the BSD-style license found in the
2055 * LICENSE file in the root directory of this source tree. An additional grant
2056 * of patent rights can be found in the PATENTS file in the same directory.
2057 *
2058 * @providesModule DisabledInputUtils
2059 */
2060
2061'use strict';
2062
2063var disableableMouseListenerNames = {
2064 onClick: true,
2065 onDoubleClick: true,
2066 onMouseDown: true,
2067 onMouseMove: true,
2068 onMouseUp: true,
2069
2070 onClickCapture: true,
2071 onDoubleClickCapture: true,
2072 onMouseDownCapture: true,
2073 onMouseMoveCapture: true,
2074 onMouseUpCapture: true
2075};
2076
2077/**
2078 * Implements a host component that does not receive mouse events
2079 * when `disabled` is set.
2080 */
2081var DisabledInputUtils = {
2082 getHostProps: function (inst, props) {
2083 if (!props.disabled) {
2084 return props;
2085 }
2086
2087 // Copy the props, except the mouse listeners
2088 var hostProps = {};
2089 for (var key in props) {
2090 if (!disableableMouseListenerNames[key] && props.hasOwnProperty(key)) {
2091 hostProps[key] = props[key];
2092 }
2093 }
2094
2095 return hostProps;
2096 }
2097};
2098
2099module.exports = DisabledInputUtils;
2100},{}],15:[function(_dereq_,module,exports){
2101/**
2102 * Copyright 2013-present, Facebook, Inc.
2103 * All rights reserved.
2104 *
2105 * This source code is licensed under the BSD-style license found in the
2106 * LICENSE file in the root directory of this source tree. An additional grant
2107 * of patent rights can be found in the PATENTS file in the same directory.
2108 *
2109 * @providesModule EnterLeaveEventPlugin
2110 */
2111
2112'use strict';
2113
2114var EventConstants = _dereq_(16);
2115var EventPropagators = _dereq_(20);
2116var ReactDOMComponentTree = _dereq_(42);
2117var SyntheticMouseEvent = _dereq_(109);
2118
2119var keyOf = _dereq_(166);
2120
2121var topLevelTypes = EventConstants.topLevelTypes;
2122
2123var eventTypes = {
2124 mouseEnter: {
2125 registrationName: keyOf({ onMouseEnter: null }),
2126 dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
2127 },
2128 mouseLeave: {
2129 registrationName: keyOf({ onMouseLeave: null }),
2130 dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
2131 }
2132};
2133
2134var EnterLeaveEventPlugin = {
2135
2136 eventTypes: eventTypes,
2137
2138 /**
2139 * For almost every interaction we care about, there will be both a top-level
2140 * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
2141 * we do not extract duplicate events. However, moving the mouse into the
2142 * browser from outside will not fire a `mouseout` event. In this case, we use
2143 * the `mouseover` top-level event.
2144 */
2145 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2146 if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
2147 return null;
2148 }
2149 if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
2150 // Must not be a mouse in or mouse out - ignoring.
2151 return null;
2152 }
2153
2154 var win;
2155 if (nativeEventTarget.window === nativeEventTarget) {
2156 // `nativeEventTarget` is probably a window object.
2157 win = nativeEventTarget;
2158 } else {
2159 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
2160 var doc = nativeEventTarget.ownerDocument;
2161 if (doc) {
2162 win = doc.defaultView || doc.parentWindow;
2163 } else {
2164 win = window;
2165 }
2166 }
2167
2168 var from;
2169 var to;
2170 if (topLevelType === topLevelTypes.topMouseOut) {
2171 from = targetInst;
2172 var related = nativeEvent.relatedTarget || nativeEvent.toElement;
2173 to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
2174 } else {
2175 // Moving to a node from outside the window.
2176 from = null;
2177 to = targetInst;
2178 }
2179
2180 if (from === to) {
2181 // Nothing pertains to our managed components.
2182 return null;
2183 }
2184
2185 var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
2186 var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
2187
2188 var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
2189 leave.type = 'mouseleave';
2190 leave.target = fromNode;
2191 leave.relatedTarget = toNode;
2192
2193 var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
2194 enter.type = 'mouseenter';
2195 enter.target = toNode;
2196 enter.relatedTarget = fromNode;
2197
2198 EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
2199
2200 return [leave, enter];
2201 }
2202
2203};
2204
2205module.exports = EnterLeaveEventPlugin;
2206},{"109":109,"16":16,"166":166,"20":20,"42":42}],16:[function(_dereq_,module,exports){
2207/**
2208 * Copyright 2013-present, Facebook, Inc.
2209 * All rights reserved.
2210 *
2211 * This source code is licensed under the BSD-style license found in the
2212 * LICENSE file in the root directory of this source tree. An additional grant
2213 * of patent rights can be found in the PATENTS file in the same directory.
2214 *
2215 * @providesModule EventConstants
2216 */
2217
2218'use strict';
2219
2220var keyMirror = _dereq_(165);
2221
2222var PropagationPhases = keyMirror({ bubbled: null, captured: null });
2223
2224/**
2225 * Types of raw signals from the browser caught at the top level.
2226 */
2227var topLevelTypes = keyMirror({
2228 topAbort: null,
2229 topAnimationEnd: null,
2230 topAnimationIteration: null,
2231 topAnimationStart: null,
2232 topBlur: null,
2233 topCanPlay: null,
2234 topCanPlayThrough: null,
2235 topChange: null,
2236 topClick: null,
2237 topCompositionEnd: null,
2238 topCompositionStart: null,
2239 topCompositionUpdate: null,
2240 topContextMenu: null,
2241 topCopy: null,
2242 topCut: null,
2243 topDoubleClick: null,
2244 topDrag: null,
2245 topDragEnd: null,
2246 topDragEnter: null,
2247 topDragExit: null,
2248 topDragLeave: null,
2249 topDragOver: null,
2250 topDragStart: null,
2251 topDrop: null,
2252 topDurationChange: null,
2253 topEmptied: null,
2254 topEncrypted: null,
2255 topEnded: null,
2256 topError: null,
2257 topFocus: null,
2258 topInput: null,
2259 topInvalid: null,
2260 topKeyDown: null,
2261 topKeyPress: null,
2262 topKeyUp: null,
2263 topLoad: null,
2264 topLoadedData: null,
2265 topLoadedMetadata: null,
2266 topLoadStart: null,
2267 topMouseDown: null,
2268 topMouseMove: null,
2269 topMouseOut: null,
2270 topMouseOver: null,
2271 topMouseUp: null,
2272 topPaste: null,
2273 topPause: null,
2274 topPlay: null,
2275 topPlaying: null,
2276 topProgress: null,
2277 topRateChange: null,
2278 topReset: null,
2279 topScroll: null,
2280 topSeeked: null,
2281 topSeeking: null,
2282 topSelectionChange: null,
2283 topStalled: null,
2284 topSubmit: null,
2285 topSuspend: null,
2286 topTextInput: null,
2287 topTimeUpdate: null,
2288 topTouchCancel: null,
2289 topTouchEnd: null,
2290 topTouchMove: null,
2291 topTouchStart: null,
2292 topTransitionEnd: null,
2293 topVolumeChange: null,
2294 topWaiting: null,
2295 topWheel: null
2296});
2297
2298var EventConstants = {
2299 topLevelTypes: topLevelTypes,
2300 PropagationPhases: PropagationPhases
2301};
2302
2303module.exports = EventConstants;
2304},{"165":165}],17:[function(_dereq_,module,exports){
2305/**
2306 * Copyright 2013-present, Facebook, Inc.
2307 * All rights reserved.
2308 *
2309 * This source code is licensed under the BSD-style license found in the
2310 * LICENSE file in the root directory of this source tree. An additional grant
2311 * of patent rights can be found in the PATENTS file in the same directory.
2312 *
2313 * @providesModule EventPluginHub
2314 */
2315
2316'use strict';
2317
2318var _prodInvariant = _dereq_(140);
2319
2320var EventPluginRegistry = _dereq_(18);
2321var EventPluginUtils = _dereq_(19);
2322var ReactErrorUtils = _dereq_(64);
2323
2324var accumulateInto = _dereq_(116);
2325var forEachAccumulated = _dereq_(125);
2326var invariant = _dereq_(162);
2327
2328/**
2329 * Internal store for event listeners
2330 */
2331var listenerBank = {};
2332
2333/**
2334 * Internal queue of events that have accumulated their dispatches and are
2335 * waiting to have their dispatches executed.
2336 */
2337var eventQueue = null;
2338
2339/**
2340 * Dispatches an event and releases it back into the pool, unless persistent.
2341 *
2342 * @param {?object} event Synthetic event to be dispatched.
2343 * @param {boolean} simulated If the event is simulated (changes exn behavior)
2344 * @private
2345 */
2346var executeDispatchesAndRelease = function (event, simulated) {
2347 if (event) {
2348 EventPluginUtils.executeDispatchesInOrder(event, simulated);
2349
2350 if (!event.isPersistent()) {
2351 event.constructor.release(event);
2352 }
2353 }
2354};
2355var executeDispatchesAndReleaseSimulated = function (e) {
2356 return executeDispatchesAndRelease(e, true);
2357};
2358var executeDispatchesAndReleaseTopLevel = function (e) {
2359 return executeDispatchesAndRelease(e, false);
2360};
2361
2362var getDictionaryKey = function (inst) {
2363 // Prevents V8 performance issue:
2364 // https://github.com/facebook/react/pull/7232
2365 return '.' + inst._rootNodeID;
2366};
2367
2368/**
2369 * This is a unified interface for event plugins to be installed and configured.
2370 *
2371 * Event plugins can implement the following properties:
2372 *
2373 * `extractEvents` {function(string, DOMEventTarget, string, object): *}
2374 * Required. When a top-level event is fired, this method is expected to
2375 * extract synthetic events that will in turn be queued and dispatched.
2376 *
2377 * `eventTypes` {object}
2378 * Optional, plugins that fire events must publish a mapping of registration
2379 * names that are used to register listeners. Values of this mapping must
2380 * be objects that contain `registrationName` or `phasedRegistrationNames`.
2381 *
2382 * `executeDispatch` {function(object, function, string)}
2383 * Optional, allows plugins to override how an event gets dispatched. By
2384 * default, the listener is simply invoked.
2385 *
2386 * Each plugin that is injected into `EventsPluginHub` is immediately operable.
2387 *
2388 * @public
2389 */
2390var EventPluginHub = {
2391
2392 /**
2393 * Methods for injecting dependencies.
2394 */
2395 injection: {
2396
2397 /**
2398 * @param {array} InjectedEventPluginOrder
2399 * @public
2400 */
2401 injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
2402
2403 /**
2404 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
2405 */
2406 injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
2407
2408 },
2409
2410 /**
2411 * Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent.
2412 *
2413 * @param {object} inst The instance, which is the source of events.
2414 * @param {string} registrationName Name of listener (e.g. `onClick`).
2415 * @param {function} listener The callback to store.
2416 */
2417 putListener: function (inst, registrationName, listener) {
2418 !(typeof listener === 'function') ? "development" !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0;
2419
2420 var key = getDictionaryKey(inst);
2421 var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
2422 bankForRegistrationName[key] = listener;
2423
2424 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2425 if (PluginModule && PluginModule.didPutListener) {
2426 PluginModule.didPutListener(inst, registrationName, listener);
2427 }
2428 },
2429
2430 /**
2431 * @param {object} inst The instance, which is the source of events.
2432 * @param {string} registrationName Name of listener (e.g. `onClick`).
2433 * @return {?function} The stored callback.
2434 */
2435 getListener: function (inst, registrationName) {
2436 var bankForRegistrationName = listenerBank[registrationName];
2437 var key = getDictionaryKey(inst);
2438 return bankForRegistrationName && bankForRegistrationName[key];
2439 },
2440
2441 /**
2442 * Deletes a listener from the registration bank.
2443 *
2444 * @param {object} inst The instance, which is the source of events.
2445 * @param {string} registrationName Name of listener (e.g. `onClick`).
2446 */
2447 deleteListener: function (inst, registrationName) {
2448 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2449 if (PluginModule && PluginModule.willDeleteListener) {
2450 PluginModule.willDeleteListener(inst, registrationName);
2451 }
2452
2453 var bankForRegistrationName = listenerBank[registrationName];
2454 // TODO: This should never be null -- when is it?
2455 if (bankForRegistrationName) {
2456 var key = getDictionaryKey(inst);
2457 delete bankForRegistrationName[key];
2458 }
2459 },
2460
2461 /**
2462 * Deletes all listeners for the DOM element with the supplied ID.
2463 *
2464 * @param {object} inst The instance, which is the source of events.
2465 */
2466 deleteAllListeners: function (inst) {
2467 var key = getDictionaryKey(inst);
2468 for (var registrationName in listenerBank) {
2469 if (!listenerBank.hasOwnProperty(registrationName)) {
2470 continue;
2471 }
2472
2473 if (!listenerBank[registrationName][key]) {
2474 continue;
2475 }
2476
2477 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2478 if (PluginModule && PluginModule.willDeleteListener) {
2479 PluginModule.willDeleteListener(inst, registrationName);
2480 }
2481
2482 delete listenerBank[registrationName][key];
2483 }
2484 },
2485
2486 /**
2487 * Allows registered plugins an opportunity to extract events from top-level
2488 * native browser events.
2489 *
2490 * @return {*} An accumulation of synthetic events.
2491 * @internal
2492 */
2493 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2494 var events;
2495 var plugins = EventPluginRegistry.plugins;
2496 for (var i = 0; i < plugins.length; i++) {
2497 // Not every plugin in the ordering may be loaded at runtime.
2498 var possiblePlugin = plugins[i];
2499 if (possiblePlugin) {
2500 var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
2501 if (extractedEvents) {
2502 events = accumulateInto(events, extractedEvents);
2503 }
2504 }
2505 }
2506 return events;
2507 },
2508
2509 /**
2510 * Enqueues a synthetic event that should be dispatched when
2511 * `processEventQueue` is invoked.
2512 *
2513 * @param {*} events An accumulation of synthetic events.
2514 * @internal
2515 */
2516 enqueueEvents: function (events) {
2517 if (events) {
2518 eventQueue = accumulateInto(eventQueue, events);
2519 }
2520 },
2521
2522 /**
2523 * Dispatches all synthetic events on the event queue.
2524 *
2525 * @internal
2526 */
2527 processEventQueue: function (simulated) {
2528 // Set `eventQueue` to null before processing it so that we can tell if more
2529 // events get enqueued while processing.
2530 var processingEventQueue = eventQueue;
2531 eventQueue = null;
2532 if (simulated) {
2533 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
2534 } else {
2535 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
2536 }
2537 !!eventQueue ? "development" !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : _prodInvariant('95') : void 0;
2538 // This would be a good time to rethrow if any of the event handlers threw.
2539 ReactErrorUtils.rethrowCaughtError();
2540 },
2541
2542 /**
2543 * These are needed for tests only. Do not use!
2544 */
2545 __purge: function () {
2546 listenerBank = {};
2547 },
2548
2549 __getListenerBank: function () {
2550 return listenerBank;
2551 }
2552
2553};
2554
2555module.exports = EventPluginHub;
2556},{"116":116,"125":125,"140":140,"162":162,"18":18,"19":19,"64":64}],18:[function(_dereq_,module,exports){
2557/**
2558 * Copyright 2013-present, Facebook, Inc.
2559 * All rights reserved.
2560 *
2561 * This source code is licensed under the BSD-style license found in the
2562 * LICENSE file in the root directory of this source tree. An additional grant
2563 * of patent rights can be found in the PATENTS file in the same directory.
2564 *
2565 * @providesModule EventPluginRegistry
2566 */
2567
2568'use strict';
2569
2570var _prodInvariant = _dereq_(140);
2571
2572var invariant = _dereq_(162);
2573
2574/**
2575 * Injectable ordering of event plugins.
2576 */
2577var EventPluginOrder = null;
2578
2579/**
2580 * Injectable mapping from names to event plugin modules.
2581 */
2582var namesToPlugins = {};
2583
2584/**
2585 * Recomputes the plugin list using the injected plugins and plugin ordering.
2586 *
2587 * @private
2588 */
2589function recomputePluginOrdering() {
2590 if (!EventPluginOrder) {
2591 // Wait until an `EventPluginOrder` is injected.
2592 return;
2593 }
2594 for (var pluginName in namesToPlugins) {
2595 var PluginModule = namesToPlugins[pluginName];
2596 var pluginIndex = EventPluginOrder.indexOf(pluginName);
2597 !(pluginIndex > -1) ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0;
2598 if (EventPluginRegistry.plugins[pluginIndex]) {
2599 continue;
2600 }
2601 !PluginModule.extractEvents ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0;
2602 EventPluginRegistry.plugins[pluginIndex] = PluginModule;
2603 var publishedEvents = PluginModule.eventTypes;
2604 for (var eventName in publishedEvents) {
2605 !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0;
2606 }
2607 }
2608}
2609
2610/**
2611 * Publishes an event so that it can be dispatched by the supplied plugin.
2612 *
2613 * @param {object} dispatchConfig Dispatch configuration for the event.
2614 * @param {object} PluginModule Plugin publishing the event.
2615 * @return {boolean} True if the event was successfully published.
2616 * @private
2617 */
2618function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
2619 !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? "development" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0;
2620 EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
2621
2622 var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
2623 if (phasedRegistrationNames) {
2624 for (var phaseName in phasedRegistrationNames) {
2625 if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
2626 var phasedRegistrationName = phasedRegistrationNames[phaseName];
2627 publishRegistrationName(phasedRegistrationName, PluginModule, eventName);
2628 }
2629 }
2630 return true;
2631 } else if (dispatchConfig.registrationName) {
2632 publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName);
2633 return true;
2634 }
2635 return false;
2636}
2637
2638/**
2639 * Publishes a registration name that is used to identify dispatched events and
2640 * can be used with `EventPluginHub.putListener` to register listeners.
2641 *
2642 * @param {string} registrationName Registration name to add.
2643 * @param {object} PluginModule Plugin publishing the event.
2644 * @private
2645 */
2646function publishRegistrationName(registrationName, PluginModule, eventName) {
2647 !!EventPluginRegistry.registrationNameModules[registrationName] ? "development" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0;
2648 EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
2649 EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
2650
2651 if ("development" !== 'production') {
2652 var lowerCasedName = registrationName.toLowerCase();
2653 EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
2654
2655 if (registrationName === 'onDoubleClick') {
2656 EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName;
2657 }
2658 }
2659}
2660
2661/**
2662 * Registers plugins so that they can extract and dispatch events.
2663 *
2664 * @see {EventPluginHub}
2665 */
2666var EventPluginRegistry = {
2667
2668 /**
2669 * Ordered list of injected plugins.
2670 */
2671 plugins: [],
2672
2673 /**
2674 * Mapping from event name to dispatch config
2675 */
2676 eventNameDispatchConfigs: {},
2677
2678 /**
2679 * Mapping from registration name to plugin module
2680 */
2681 registrationNameModules: {},
2682
2683 /**
2684 * Mapping from registration name to event name
2685 */
2686 registrationNameDependencies: {},
2687
2688 /**
2689 * Mapping from lowercase registration names to the properly cased version,
2690 * used to warn in the case of missing event handlers. Available
2691 * only in __DEV__.
2692 * @type {Object}
2693 */
2694 possibleRegistrationNames: "development" !== 'production' ? {} : null,
2695
2696 /**
2697 * Injects an ordering of plugins (by plugin name). This allows the ordering
2698 * to be decoupled from injection of the actual plugins so that ordering is
2699 * always deterministic regardless of packaging, on-the-fly injection, etc.
2700 *
2701 * @param {array} InjectedEventPluginOrder
2702 * @internal
2703 * @see {EventPluginHub.injection.injectEventPluginOrder}
2704 */
2705 injectEventPluginOrder: function (InjectedEventPluginOrder) {
2706 !!EventPluginOrder ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : void 0;
2707 // Clone the ordering so it cannot be dynamically mutated.
2708 EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
2709 recomputePluginOrdering();
2710 },
2711
2712 /**
2713 * Injects plugins to be used by `EventPluginHub`. The plugin names must be
2714 * in the ordering injected by `injectEventPluginOrder`.
2715 *
2716 * Plugins can be injected as part of page initialization or on-the-fly.
2717 *
2718 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
2719 * @internal
2720 * @see {EventPluginHub.injection.injectEventPluginsByName}
2721 */
2722 injectEventPluginsByName: function (injectedNamesToPlugins) {
2723 var isOrderingDirty = false;
2724 for (var pluginName in injectedNamesToPlugins) {
2725 if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
2726 continue;
2727 }
2728 var PluginModule = injectedNamesToPlugins[pluginName];
2729 if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
2730 !!namesToPlugins[pluginName] ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0;
2731 namesToPlugins[pluginName] = PluginModule;
2732 isOrderingDirty = true;
2733 }
2734 }
2735 if (isOrderingDirty) {
2736 recomputePluginOrdering();
2737 }
2738 },
2739
2740 /**
2741 * Looks up the plugin for the supplied event.
2742 *
2743 * @param {object} event A synthetic event.
2744 * @return {?object} The plugin that created the supplied event.
2745 * @internal
2746 */
2747 getPluginModuleForEvent: function (event) {
2748 var dispatchConfig = event.dispatchConfig;
2749 if (dispatchConfig.registrationName) {
2750 return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
2751 }
2752 for (var phase in dispatchConfig.phasedRegistrationNames) {
2753 if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
2754 continue;
2755 }
2756 var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
2757 if (PluginModule) {
2758 return PluginModule;
2759 }
2760 }
2761 return null;
2762 },
2763
2764 /**
2765 * Exposed for unit testing.
2766 * @private
2767 */
2768 _resetEventPlugins: function () {
2769 EventPluginOrder = null;
2770 for (var pluginName in namesToPlugins) {
2771 if (namesToPlugins.hasOwnProperty(pluginName)) {
2772 delete namesToPlugins[pluginName];
2773 }
2774 }
2775 EventPluginRegistry.plugins.length = 0;
2776
2777 var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
2778 for (var eventName in eventNameDispatchConfigs) {
2779 if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
2780 delete eventNameDispatchConfigs[eventName];
2781 }
2782 }
2783
2784 var registrationNameModules = EventPluginRegistry.registrationNameModules;
2785 for (var registrationName in registrationNameModules) {
2786 if (registrationNameModules.hasOwnProperty(registrationName)) {
2787 delete registrationNameModules[registrationName];
2788 }
2789 }
2790
2791 if ("development" !== 'production') {
2792 var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
2793 for (var lowerCasedName in possibleRegistrationNames) {
2794 if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
2795 delete possibleRegistrationNames[lowerCasedName];
2796 }
2797 }
2798 }
2799 }
2800
2801};
2802
2803module.exports = EventPluginRegistry;
2804},{"140":140,"162":162}],19:[function(_dereq_,module,exports){
2805/**
2806 * Copyright 2013-present, Facebook, Inc.
2807 * All rights reserved.
2808 *
2809 * This source code is licensed under the BSD-style license found in the
2810 * LICENSE file in the root directory of this source tree. An additional grant
2811 * of patent rights can be found in the PATENTS file in the same directory.
2812 *
2813 * @providesModule EventPluginUtils
2814 */
2815
2816'use strict';
2817
2818var _prodInvariant = _dereq_(140);
2819
2820var EventConstants = _dereq_(16);
2821var ReactErrorUtils = _dereq_(64);
2822
2823var invariant = _dereq_(162);
2824var warning = _dereq_(171);
2825
2826/**
2827 * Injected dependencies:
2828 */
2829
2830/**
2831 * - `ComponentTree`: [required] Module that can convert between React instances
2832 * and actual node references.
2833 */
2834var ComponentTree;
2835var TreeTraversal;
2836var injection = {
2837 injectComponentTree: function (Injected) {
2838 ComponentTree = Injected;
2839 if ("development" !== 'production') {
2840 "development" !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
2841 }
2842 },
2843 injectTreeTraversal: function (Injected) {
2844 TreeTraversal = Injected;
2845 if ("development" !== 'production') {
2846 "development" !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
2847 }
2848 }
2849};
2850
2851var topLevelTypes = EventConstants.topLevelTypes;
2852
2853function isEndish(topLevelType) {
2854 return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
2855}
2856
2857function isMoveish(topLevelType) {
2858 return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
2859}
2860function isStartish(topLevelType) {
2861 return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
2862}
2863
2864var validateEventDispatches;
2865if ("development" !== 'production') {
2866 validateEventDispatches = function (event) {
2867 var dispatchListeners = event._dispatchListeners;
2868 var dispatchInstances = event._dispatchInstances;
2869
2870 var listenersIsArr = Array.isArray(dispatchListeners);
2871 var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
2872
2873 var instancesIsArr = Array.isArray(dispatchInstances);
2874 var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
2875
2876 "development" !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
2877 };
2878}
2879
2880/**
2881 * Dispatch the event to the listener.
2882 * @param {SyntheticEvent} event SyntheticEvent to handle
2883 * @param {boolean} simulated If the event is simulated (changes exn behavior)
2884 * @param {function} listener Application-level callback
2885 * @param {*} inst Internal component instance
2886 */
2887function executeDispatch(event, simulated, listener, inst) {
2888 var type = event.type || 'unknown-event';
2889 event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
2890 if (simulated) {
2891 ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
2892 } else {
2893 ReactErrorUtils.invokeGuardedCallback(type, listener, event);
2894 }
2895 event.currentTarget = null;
2896}
2897
2898/**
2899 * Standard/simple iteration through an event's collected dispatches.
2900 */
2901function executeDispatchesInOrder(event, simulated) {
2902 var dispatchListeners = event._dispatchListeners;
2903 var dispatchInstances = event._dispatchInstances;
2904 if ("development" !== 'production') {
2905 validateEventDispatches(event);
2906 }
2907 if (Array.isArray(dispatchListeners)) {
2908 for (var i = 0; i < dispatchListeners.length; i++) {
2909 if (event.isPropagationStopped()) {
2910 break;
2911 }
2912 // Listeners and Instances are two parallel arrays that are always in sync.
2913 executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
2914 }
2915 } else if (dispatchListeners) {
2916 executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
2917 }
2918 event._dispatchListeners = null;
2919 event._dispatchInstances = null;
2920}
2921
2922/**
2923 * Standard/simple iteration through an event's collected dispatches, but stops
2924 * at the first dispatch execution returning true, and returns that id.
2925 *
2926 * @return {?string} id of the first dispatch execution who's listener returns
2927 * true, or null if no listener returned true.
2928 */
2929function executeDispatchesInOrderStopAtTrueImpl(event) {
2930 var dispatchListeners = event._dispatchListeners;
2931 var dispatchInstances = event._dispatchInstances;
2932 if ("development" !== 'production') {
2933 validateEventDispatches(event);
2934 }
2935 if (Array.isArray(dispatchListeners)) {
2936 for (var i = 0; i < dispatchListeners.length; i++) {
2937 if (event.isPropagationStopped()) {
2938 break;
2939 }
2940 // Listeners and Instances are two parallel arrays that are always in sync.
2941 if (dispatchListeners[i](event, dispatchInstances[i])) {
2942 return dispatchInstances[i];
2943 }
2944 }
2945 } else if (dispatchListeners) {
2946 if (dispatchListeners(event, dispatchInstances)) {
2947 return dispatchInstances;
2948 }
2949 }
2950 return null;
2951}
2952
2953/**
2954 * @see executeDispatchesInOrderStopAtTrueImpl
2955 */
2956function executeDispatchesInOrderStopAtTrue(event) {
2957 var ret = executeDispatchesInOrderStopAtTrueImpl(event);
2958 event._dispatchInstances = null;
2959 event._dispatchListeners = null;
2960 return ret;
2961}
2962
2963/**
2964 * Execution of a "direct" dispatch - there must be at most one dispatch
2965 * accumulated on the event or it is considered an error. It doesn't really make
2966 * sense for an event with multiple dispatches (bubbled) to keep track of the
2967 * return values at each dispatch execution, but it does tend to make sense when
2968 * dealing with "direct" dispatches.
2969 *
2970 * @return {*} The return value of executing the single dispatch.
2971 */
2972function executeDirectDispatch(event) {
2973 if ("development" !== 'production') {
2974 validateEventDispatches(event);
2975 }
2976 var dispatchListener = event._dispatchListeners;
2977 var dispatchInstance = event._dispatchInstances;
2978 !!Array.isArray(dispatchListener) ? "development" !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0;
2979 event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
2980 var res = dispatchListener ? dispatchListener(event) : null;
2981 event.currentTarget = null;
2982 event._dispatchListeners = null;
2983 event._dispatchInstances = null;
2984 return res;
2985}
2986
2987/**
2988 * @param {SyntheticEvent} event
2989 * @return {boolean} True iff number of dispatches accumulated is greater than 0.
2990 */
2991function hasDispatches(event) {
2992 return !!event._dispatchListeners;
2993}
2994
2995/**
2996 * General utilities that are useful in creating custom Event Plugins.
2997 */
2998var EventPluginUtils = {
2999 isEndish: isEndish,
3000 isMoveish: isMoveish,
3001 isStartish: isStartish,
3002
3003 executeDirectDispatch: executeDirectDispatch,
3004 executeDispatchesInOrder: executeDispatchesInOrder,
3005 executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
3006 hasDispatches: hasDispatches,
3007
3008 getInstanceFromNode: function (node) {
3009 return ComponentTree.getInstanceFromNode(node);
3010 },
3011 getNodeFromInstance: function (node) {
3012 return ComponentTree.getNodeFromInstance(node);
3013 },
3014 isAncestor: function (a, b) {
3015 return TreeTraversal.isAncestor(a, b);
3016 },
3017 getLowestCommonAncestor: function (a, b) {
3018 return TreeTraversal.getLowestCommonAncestor(a, b);
3019 },
3020 getParentInstance: function (inst) {
3021 return TreeTraversal.getParentInstance(inst);
3022 },
3023 traverseTwoPhase: function (target, fn, arg) {
3024 return TreeTraversal.traverseTwoPhase(target, fn, arg);
3025 },
3026 traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
3027 return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
3028 },
3029
3030 injection: injection
3031};
3032
3033module.exports = EventPluginUtils;
3034},{"140":140,"16":16,"162":162,"171":171,"64":64}],20:[function(_dereq_,module,exports){
3035/**
3036 * Copyright 2013-present, Facebook, Inc.
3037 * All rights reserved.
3038 *
3039 * This source code is licensed under the BSD-style license found in the
3040 * LICENSE file in the root directory of this source tree. An additional grant
3041 * of patent rights can be found in the PATENTS file in the same directory.
3042 *
3043 * @providesModule EventPropagators
3044 */
3045
3046'use strict';
3047
3048var EventConstants = _dereq_(16);
3049var EventPluginHub = _dereq_(17);
3050var EventPluginUtils = _dereq_(19);
3051
3052var accumulateInto = _dereq_(116);
3053var forEachAccumulated = _dereq_(125);
3054var warning = _dereq_(171);
3055
3056var PropagationPhases = EventConstants.PropagationPhases;
3057var getListener = EventPluginHub.getListener;
3058
3059/**
3060 * Some event types have a notion of different registration names for different
3061 * "phases" of propagation. This finds listeners by a given phase.
3062 */
3063function listenerAtPhase(inst, event, propagationPhase) {
3064 var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
3065 return getListener(inst, registrationName);
3066}
3067
3068/**
3069 * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
3070 * here, allows us to not have to bind or create functions for each event.
3071 * Mutating the event's members allows us to not have to create a wrapping
3072 * "dispatch" object that pairs the event with the listener.
3073 */
3074function accumulateDirectionalDispatches(inst, upwards, event) {
3075 if ("development" !== 'production') {
3076 "development" !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
3077 }
3078 var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
3079 var listener = listenerAtPhase(inst, event, phase);
3080 if (listener) {
3081 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3082 event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
3083 }
3084}
3085
3086/**
3087 * Collect dispatches (must be entirely collected before dispatching - see unit
3088 * tests). Lazily allocate the array to conserve memory. We must loop through
3089 * each event and perform the traversal for each one. We cannot perform a
3090 * single traversal for the entire collection of events because each event may
3091 * have a different target.
3092 */
3093function accumulateTwoPhaseDispatchesSingle(event) {
3094 if (event && event.dispatchConfig.phasedRegistrationNames) {
3095 EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
3096 }
3097}
3098
3099/**
3100 * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
3101 */
3102function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
3103 if (event && event.dispatchConfig.phasedRegistrationNames) {
3104 var targetInst = event._targetInst;
3105 var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
3106 EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
3107 }
3108}
3109
3110/**
3111 * Accumulates without regard to direction, does not look for phased
3112 * registration names. Same as `accumulateDirectDispatchesSingle` but without
3113 * requiring that the `dispatchMarker` be the same as the dispatched ID.
3114 */
3115function accumulateDispatches(inst, ignoredDirection, event) {
3116 if (event && event.dispatchConfig.registrationName) {
3117 var registrationName = event.dispatchConfig.registrationName;
3118 var listener = getListener(inst, registrationName);
3119 if (listener) {
3120 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3121 event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
3122 }
3123 }
3124}
3125
3126/**
3127 * Accumulates dispatches on an `SyntheticEvent`, but only for the
3128 * `dispatchMarker`.
3129 * @param {SyntheticEvent} event
3130 */
3131function accumulateDirectDispatchesSingle(event) {
3132 if (event && event.dispatchConfig.registrationName) {
3133 accumulateDispatches(event._targetInst, null, event);
3134 }
3135}
3136
3137function accumulateTwoPhaseDispatches(events) {
3138 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
3139}
3140
3141function accumulateTwoPhaseDispatchesSkipTarget(events) {
3142 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
3143}
3144
3145function accumulateEnterLeaveDispatches(leave, enter, from, to) {
3146 EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
3147}
3148
3149function accumulateDirectDispatches(events) {
3150 forEachAccumulated(events, accumulateDirectDispatchesSingle);
3151}
3152
3153/**
3154 * A small set of propagation patterns, each of which will accept a small amount
3155 * of information, and generate a set of "dispatch ready event objects" - which
3156 * are sets of events that have already been annotated with a set of dispatched
3157 * listener functions/ids. The API is designed this way to discourage these
3158 * propagation strategies from actually executing the dispatches, since we
3159 * always want to collect the entire set of dispatches before executing event a
3160 * single one.
3161 *
3162 * @constructor EventPropagators
3163 */
3164var EventPropagators = {
3165 accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
3166 accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
3167 accumulateDirectDispatches: accumulateDirectDispatches,
3168 accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
3169};
3170
3171module.exports = EventPropagators;
3172},{"116":116,"125":125,"16":16,"17":17,"171":171,"19":19}],21:[function(_dereq_,module,exports){
3173/**
3174 * Copyright 2013-present, Facebook, Inc.
3175 * All rights reserved.
3176 *
3177 * This source code is licensed under the BSD-style license found in the
3178 * LICENSE file in the root directory of this source tree. An additional grant
3179 * of patent rights can be found in the PATENTS file in the same directory.
3180 *
3181 * @providesModule FallbackCompositionState
3182 */
3183
3184'use strict';
3185
3186var _assign = _dereq_(172);
3187
3188var PooledClass = _dereq_(25);
3189
3190var getTextContentAccessor = _dereq_(133);
3191
3192/**
3193 * This helper class stores information about text content of a target node,
3194 * allowing comparison of content before and after a given event.
3195 *
3196 * Identify the node where selection currently begins, then observe
3197 * both its text content and its current position in the DOM. Since the
3198 * browser may natively replace the target node during composition, we can
3199 * use its position to find its replacement.
3200 *
3201 * @param {DOMEventTarget} root
3202 */
3203function FallbackCompositionState(root) {
3204 this._root = root;
3205 this._startText = this.getText();
3206 this._fallbackText = null;
3207}
3208
3209_assign(FallbackCompositionState.prototype, {
3210 destructor: function () {
3211 this._root = null;
3212 this._startText = null;
3213 this._fallbackText = null;
3214 },
3215
3216 /**
3217 * Get current text of input.
3218 *
3219 * @return {string}
3220 */
3221 getText: function () {
3222 if ('value' in this._root) {
3223 return this._root.value;
3224 }
3225 return this._root[getTextContentAccessor()];
3226 },
3227
3228 /**
3229 * Determine the differing substring between the initially stored
3230 * text content and the current content.
3231 *
3232 * @return {string}
3233 */
3234 getData: function () {
3235 if (this._fallbackText) {
3236 return this._fallbackText;
3237 }
3238
3239 var start;
3240 var startValue = this._startText;
3241 var startLength = startValue.length;
3242 var end;
3243 var endValue = this.getText();
3244 var endLength = endValue.length;
3245
3246 for (start = 0; start < startLength; start++) {
3247 if (startValue[start] !== endValue[start]) {
3248 break;
3249 }
3250 }
3251
3252 var minEnd = startLength - start;
3253 for (end = 1; end <= minEnd; end++) {
3254 if (startValue[startLength - end] !== endValue[endLength - end]) {
3255 break;
3256 }
3257 }
3258
3259 var sliceTail = end > 1 ? 1 - end : undefined;
3260 this._fallbackText = endValue.slice(start, sliceTail);
3261 return this._fallbackText;
3262 }
3263});
3264
3265PooledClass.addPoolingTo(FallbackCompositionState);
3266
3267module.exports = FallbackCompositionState;
3268},{"133":133,"172":172,"25":25}],22:[function(_dereq_,module,exports){
3269/**
3270 * Copyright 2013-present, Facebook, Inc.
3271 * All rights reserved.
3272 *
3273 * This source code is licensed under the BSD-style license found in the
3274 * LICENSE file in the root directory of this source tree. An additional grant
3275 * of patent rights can be found in the PATENTS file in the same directory.
3276 *
3277 * @providesModule HTMLDOMPropertyConfig
3278 */
3279
3280'use strict';
3281
3282var DOMProperty = _dereq_(10);
3283
3284var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
3285var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
3286var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
3287var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
3288var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
3289
3290var HTMLDOMPropertyConfig = {
3291 isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
3292 Properties: {
3293 /**
3294 * Standard Properties
3295 */
3296 accept: 0,
3297 acceptCharset: 0,
3298 accessKey: 0,
3299 action: 0,
3300 allowFullScreen: HAS_BOOLEAN_VALUE,
3301 allowTransparency: 0,
3302 alt: 0,
3303 // specifies target context for links with `preload` type
3304 as: 0,
3305 async: HAS_BOOLEAN_VALUE,
3306 autoComplete: 0,
3307 // autoFocus is polyfilled/normalized by AutoFocusUtils
3308 // autoFocus: HAS_BOOLEAN_VALUE,
3309 autoPlay: HAS_BOOLEAN_VALUE,
3310 capture: HAS_BOOLEAN_VALUE,
3311 cellPadding: 0,
3312 cellSpacing: 0,
3313 charSet: 0,
3314 challenge: 0,
3315 checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3316 cite: 0,
3317 classID: 0,
3318 className: 0,
3319 cols: HAS_POSITIVE_NUMERIC_VALUE,
3320 colSpan: 0,
3321 content: 0,
3322 contentEditable: 0,
3323 contextMenu: 0,
3324 controls: HAS_BOOLEAN_VALUE,
3325 coords: 0,
3326 crossOrigin: 0,
3327 data: 0, // For `<object />` acts as `src`.
3328 dateTime: 0,
3329 'default': HAS_BOOLEAN_VALUE,
3330 defer: HAS_BOOLEAN_VALUE,
3331 dir: 0,
3332 disabled: HAS_BOOLEAN_VALUE,
3333 download: HAS_OVERLOADED_BOOLEAN_VALUE,
3334 draggable: 0,
3335 encType: 0,
3336 form: 0,
3337 formAction: 0,
3338 formEncType: 0,
3339 formMethod: 0,
3340 formNoValidate: HAS_BOOLEAN_VALUE,
3341 formTarget: 0,
3342 frameBorder: 0,
3343 headers: 0,
3344 height: 0,
3345 hidden: HAS_BOOLEAN_VALUE,
3346 high: 0,
3347 href: 0,
3348 hrefLang: 0,
3349 htmlFor: 0,
3350 httpEquiv: 0,
3351 icon: 0,
3352 id: 0,
3353 inputMode: 0,
3354 integrity: 0,
3355 is: 0,
3356 keyParams: 0,
3357 keyType: 0,
3358 kind: 0,
3359 label: 0,
3360 lang: 0,
3361 list: 0,
3362 loop: HAS_BOOLEAN_VALUE,
3363 low: 0,
3364 manifest: 0,
3365 marginHeight: 0,
3366 marginWidth: 0,
3367 max: 0,
3368 maxLength: 0,
3369 media: 0,
3370 mediaGroup: 0,
3371 method: 0,
3372 min: 0,
3373 minLength: 0,
3374 // Caution; `option.selected` is not updated if `select.multiple` is
3375 // disabled with `removeAttribute`.
3376 multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3377 muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3378 name: 0,
3379 nonce: 0,
3380 noValidate: HAS_BOOLEAN_VALUE,
3381 open: HAS_BOOLEAN_VALUE,
3382 optimum: 0,
3383 pattern: 0,
3384 placeholder: 0,
3385 playsInline: HAS_BOOLEAN_VALUE,
3386 poster: 0,
3387 preload: 0,
3388 profile: 0,
3389 radioGroup: 0,
3390 readOnly: HAS_BOOLEAN_VALUE,
3391 referrerPolicy: 0,
3392 rel: 0,
3393 required: HAS_BOOLEAN_VALUE,
3394 reversed: HAS_BOOLEAN_VALUE,
3395 role: 0,
3396 rows: HAS_POSITIVE_NUMERIC_VALUE,
3397 rowSpan: HAS_NUMERIC_VALUE,
3398 sandbox: 0,
3399 scope: 0,
3400 scoped: HAS_BOOLEAN_VALUE,
3401 scrolling: 0,
3402 seamless: HAS_BOOLEAN_VALUE,
3403 selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3404 shape: 0,
3405 size: HAS_POSITIVE_NUMERIC_VALUE,
3406 sizes: 0,
3407 span: HAS_POSITIVE_NUMERIC_VALUE,
3408 spellCheck: 0,
3409 src: 0,
3410 srcDoc: 0,
3411 srcLang: 0,
3412 srcSet: 0,
3413 start: HAS_NUMERIC_VALUE,
3414 step: 0,
3415 style: 0,
3416 summary: 0,
3417 tabIndex: 0,
3418 target: 0,
3419 title: 0,
3420 // Setting .type throws on non-<input> tags
3421 type: 0,
3422 useMap: 0,
3423 value: 0,
3424 width: 0,
3425 wmode: 0,
3426 wrap: 0,
3427
3428 /**
3429 * RDFa Properties
3430 */
3431 about: 0,
3432 datatype: 0,
3433 inlist: 0,
3434 prefix: 0,
3435 // property is also supported for OpenGraph in meta tags.
3436 property: 0,
3437 resource: 0,
3438 'typeof': 0,
3439 vocab: 0,
3440
3441 /**
3442 * Non-standard Properties
3443 */
3444 // autoCapitalize and autoCorrect are supported in Mobile Safari for
3445 // keyboard hints.
3446 autoCapitalize: 0,
3447 autoCorrect: 0,
3448 // autoSave allows WebKit/Blink to persist values of input fields on page reloads
3449 autoSave: 0,
3450 // color is for Safari mask-icon link
3451 color: 0,
3452 // itemProp, itemScope, itemType are for
3453 // Microdata support. See http://schema.org/docs/gs.html
3454 itemProp: 0,
3455 itemScope: HAS_BOOLEAN_VALUE,
3456 itemType: 0,
3457 // itemID and itemRef are for Microdata support as well but
3458 // only specified in the WHATWG spec document. See
3459 // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
3460 itemID: 0,
3461 itemRef: 0,
3462 // results show looking glass icon and recent searches on input
3463 // search fields in WebKit/Blink
3464 results: 0,
3465 // IE-only attribute that specifies security restrictions on an iframe
3466 // as an alternative to the sandbox attribute on IE<10
3467 security: 0,
3468 // IE-only attribute that controls focus behavior
3469 unselectable: 0
3470 },
3471 DOMAttributeNames: {
3472 acceptCharset: 'accept-charset',
3473 className: 'class',
3474 htmlFor: 'for',
3475 httpEquiv: 'http-equiv'
3476 },
3477 DOMPropertyNames: {}
3478};
3479
3480module.exports = HTMLDOMPropertyConfig;
3481},{"10":10}],23:[function(_dereq_,module,exports){
3482/**
3483 * Copyright 2013-present, Facebook, Inc.
3484 * All rights reserved.
3485 *
3486 * This source code is licensed under the BSD-style license found in the
3487 * LICENSE file in the root directory of this source tree. An additional grant
3488 * of patent rights can be found in the PATENTS file in the same directory.
3489 *
3490 * @providesModule KeyEscapeUtils
3491 *
3492 */
3493
3494'use strict';
3495
3496/**
3497 * Escape and wrap key so it is safe to use as a reactid
3498 *
3499 * @param {string} key to be escaped.
3500 * @return {string} the escaped key.
3501 */
3502
3503function escape(key) {
3504 var escapeRegex = /[=:]/g;
3505 var escaperLookup = {
3506 '=': '=0',
3507 ':': '=2'
3508 };
3509 var escapedString = ('' + key).replace(escapeRegex, function (match) {
3510 return escaperLookup[match];
3511 });
3512
3513 return '$' + escapedString;
3514}
3515
3516/**
3517 * Unescape and unwrap key for human-readable display
3518 *
3519 * @param {string} key to unescape.
3520 * @return {string} the unescaped key.
3521 */
3522function unescape(key) {
3523 var unescapeRegex = /(=0|=2)/g;
3524 var unescaperLookup = {
3525 '=0': '=',
3526 '=2': ':'
3527 };
3528 var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
3529
3530 return ('' + keySubstring).replace(unescapeRegex, function (match) {
3531 return unescaperLookup[match];
3532 });
3533}
3534
3535var KeyEscapeUtils = {
3536 escape: escape,
3537 unescape: unescape
3538};
3539
3540module.exports = KeyEscapeUtils;
3541},{}],24:[function(_dereq_,module,exports){
3542/**
3543 * Copyright 2013-present, Facebook, Inc.
3544 * All rights reserved.
3545 *
3546 * This source code is licensed under the BSD-style license found in the
3547 * LICENSE file in the root directory of this source tree. An additional grant
3548 * of patent rights can be found in the PATENTS file in the same directory.
3549 *
3550 * @providesModule LinkedValueUtils
3551 */
3552
3553'use strict';
3554
3555var _prodInvariant = _dereq_(140);
3556
3557var ReactPropTypes = _dereq_(84);
3558var ReactPropTypeLocations = _dereq_(83);
3559var ReactPropTypesSecret = _dereq_(85);
3560
3561var invariant = _dereq_(162);
3562var warning = _dereq_(171);
3563
3564var hasReadOnlyValue = {
3565 'button': true,
3566 'checkbox': true,
3567 'image': true,
3568 'hidden': true,
3569 'radio': true,
3570 'reset': true,
3571 'submit': true
3572};
3573
3574function _assertSingleLink(inputProps) {
3575 !(inputProps.checkedLink == null || inputProps.valueLink == null) ? "development" !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don\'t want to use valueLink and vice versa.') : _prodInvariant('87') : void 0;
3576}
3577function _assertValueLink(inputProps) {
3578 _assertSingleLink(inputProps);
3579 !(inputProps.value == null && inputProps.onChange == null) ? "development" !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don\'t want to use valueLink.') : _prodInvariant('88') : void 0;
3580}
3581
3582function _assertCheckedLink(inputProps) {
3583 _assertSingleLink(inputProps);
3584 !(inputProps.checked == null && inputProps.onChange == null) ? "development" !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don\'t want to use checkedLink') : _prodInvariant('89') : void 0;
3585}
3586
3587var propTypes = {
3588 value: function (props, propName, componentName) {
3589 if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
3590 return null;
3591 }
3592 return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
3593 },
3594 checked: function (props, propName, componentName) {
3595 if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
3596 return null;
3597 }
3598 return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
3599 },
3600 onChange: ReactPropTypes.func
3601};
3602
3603var loggedTypeFailures = {};
3604function getDeclarationErrorAddendum(owner) {
3605 if (owner) {
3606 var name = owner.getName();
3607 if (name) {
3608 return ' Check the render method of `' + name + '`.';
3609 }
3610 }
3611 return '';
3612}
3613
3614/**
3615 * Provide a linked `value` attribute for controlled forms. You should not use
3616 * this outside of the ReactDOM controlled form components.
3617 */
3618var LinkedValueUtils = {
3619 checkPropTypes: function (tagName, props, owner) {
3620 for (var propName in propTypes) {
3621 if (propTypes.hasOwnProperty(propName)) {
3622 var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop, null, ReactPropTypesSecret);
3623 }
3624 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
3625 // Only monitor this failure once because there tends to be a lot of the
3626 // same error.
3627 loggedTypeFailures[error.message] = true;
3628
3629 var addendum = getDeclarationErrorAddendum(owner);
3630 "development" !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
3631 }
3632 }
3633 },
3634
3635 /**
3636 * @param {object} inputProps Props for form component
3637 * @return {*} current value of the input either from value prop or link.
3638 */
3639 getValue: function (inputProps) {
3640 if (inputProps.valueLink) {
3641 _assertValueLink(inputProps);
3642 return inputProps.valueLink.value;
3643 }
3644 return inputProps.value;
3645 },
3646
3647 /**
3648 * @param {object} inputProps Props for form component
3649 * @return {*} current checked status of the input either from checked prop
3650 * or link.
3651 */
3652 getChecked: function (inputProps) {
3653 if (inputProps.checkedLink) {
3654 _assertCheckedLink(inputProps);
3655 return inputProps.checkedLink.value;
3656 }
3657 return inputProps.checked;
3658 },
3659
3660 /**
3661 * @param {object} inputProps Props for form component
3662 * @param {SyntheticEvent} event change event to handle
3663 */
3664 executeOnChange: function (inputProps, event) {
3665 if (inputProps.valueLink) {
3666 _assertValueLink(inputProps);
3667 return inputProps.valueLink.requestChange(event.target.value);
3668 } else if (inputProps.checkedLink) {
3669 _assertCheckedLink(inputProps);
3670 return inputProps.checkedLink.requestChange(event.target.checked);
3671 } else if (inputProps.onChange) {
3672 return inputProps.onChange.call(undefined, event);
3673 }
3674 }
3675};
3676
3677module.exports = LinkedValueUtils;
3678},{"140":140,"162":162,"171":171,"83":83,"84":84,"85":85}],25:[function(_dereq_,module,exports){
3679/**
3680 * Copyright 2013-present, Facebook, Inc.
3681 * All rights reserved.
3682 *
3683 * This source code is licensed under the BSD-style license found in the
3684 * LICENSE file in the root directory of this source tree. An additional grant
3685 * of patent rights can be found in the PATENTS file in the same directory.
3686 *
3687 * @providesModule PooledClass
3688 */
3689
3690'use strict';
3691
3692var _prodInvariant = _dereq_(140);
3693
3694var invariant = _dereq_(162);
3695
3696/**
3697 * Static poolers. Several custom versions for each potential number of
3698 * arguments. A completely generic pooler is easy to implement, but would
3699 * require accessing the `arguments` object. In each of these, `this` refers to
3700 * the Class itself, not an instance. If any others are needed, simply add them
3701 * here, or in their own files.
3702 */
3703var oneArgumentPooler = function (copyFieldsFrom) {
3704 var Klass = this;
3705 if (Klass.instancePool.length) {
3706 var instance = Klass.instancePool.pop();
3707 Klass.call(instance, copyFieldsFrom);
3708 return instance;
3709 } else {
3710 return new Klass(copyFieldsFrom);
3711 }
3712};
3713
3714var twoArgumentPooler = function (a1, a2) {
3715 var Klass = this;
3716 if (Klass.instancePool.length) {
3717 var instance = Klass.instancePool.pop();
3718 Klass.call(instance, a1, a2);
3719 return instance;
3720 } else {
3721 return new Klass(a1, a2);
3722 }
3723};
3724
3725var threeArgumentPooler = function (a1, a2, a3) {
3726 var Klass = this;
3727 if (Klass.instancePool.length) {
3728 var instance = Klass.instancePool.pop();
3729 Klass.call(instance, a1, a2, a3);
3730 return instance;
3731 } else {
3732 return new Klass(a1, a2, a3);
3733 }
3734};
3735
3736var fourArgumentPooler = function (a1, a2, a3, a4) {
3737 var Klass = this;
3738 if (Klass.instancePool.length) {
3739 var instance = Klass.instancePool.pop();
3740 Klass.call(instance, a1, a2, a3, a4);
3741 return instance;
3742 } else {
3743 return new Klass(a1, a2, a3, a4);
3744 }
3745};
3746
3747var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
3748 var Klass = this;
3749 if (Klass.instancePool.length) {
3750 var instance = Klass.instancePool.pop();
3751 Klass.call(instance, a1, a2, a3, a4, a5);
3752 return instance;
3753 } else {
3754 return new Klass(a1, a2, a3, a4, a5);
3755 }
3756};
3757
3758var standardReleaser = function (instance) {
3759 var Klass = this;
3760 !(instance instanceof Klass) ? "development" !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
3761 instance.destructor();
3762 if (Klass.instancePool.length < Klass.poolSize) {
3763 Klass.instancePool.push(instance);
3764 }
3765};
3766
3767var DEFAULT_POOL_SIZE = 10;
3768var DEFAULT_POOLER = oneArgumentPooler;
3769
3770/**
3771 * Augments `CopyConstructor` to be a poolable class, augmenting only the class
3772 * itself (statically) not adding any prototypical fields. Any CopyConstructor
3773 * you give this may have a `poolSize` property, and will look for a
3774 * prototypical `destructor` on instances.
3775 *
3776 * @param {Function} CopyConstructor Constructor that can be used to reset.
3777 * @param {Function} pooler Customizable pooler.
3778 */
3779var addPoolingTo = function (CopyConstructor, pooler) {
3780 var NewKlass = CopyConstructor;
3781 NewKlass.instancePool = [];
3782 NewKlass.getPooled = pooler || DEFAULT_POOLER;
3783 if (!NewKlass.poolSize) {
3784 NewKlass.poolSize = DEFAULT_POOL_SIZE;
3785 }
3786 NewKlass.release = standardReleaser;
3787 return NewKlass;
3788};
3789
3790var PooledClass = {
3791 addPoolingTo: addPoolingTo,
3792 oneArgumentPooler: oneArgumentPooler,
3793 twoArgumentPooler: twoArgumentPooler,
3794 threeArgumentPooler: threeArgumentPooler,
3795 fourArgumentPooler: fourArgumentPooler,
3796 fiveArgumentPooler: fiveArgumentPooler
3797};
3798
3799module.exports = PooledClass;
3800},{"140":140,"162":162}],26:[function(_dereq_,module,exports){
3801/**
3802 * Copyright 2013-present, Facebook, Inc.
3803 * All rights reserved.
3804 *
3805 * This source code is licensed under the BSD-style license found in the
3806 * LICENSE file in the root directory of this source tree. An additional grant
3807 * of patent rights can be found in the PATENTS file in the same directory.
3808 *
3809 * @providesModule React
3810 */
3811
3812'use strict';
3813
3814var _assign = _dereq_(172);
3815
3816var ReactChildren = _dereq_(29);
3817var ReactComponent = _dereq_(32);
3818var ReactPureComponent = _dereq_(86);
3819var ReactClass = _dereq_(31);
3820var ReactDOMFactories = _dereq_(45);
3821var ReactElement = _dereq_(61);
3822var ReactPropTypes = _dereq_(84);
3823var ReactVersion = _dereq_(97);
3824
3825var onlyChild = _dereq_(138);
3826var warning = _dereq_(171);
3827
3828var createElement = ReactElement.createElement;
3829var createFactory = ReactElement.createFactory;
3830var cloneElement = ReactElement.cloneElement;
3831
3832if ("development" !== 'production') {
3833 var ReactElementValidator = _dereq_(62);
3834 createElement = ReactElementValidator.createElement;
3835 createFactory = ReactElementValidator.createFactory;
3836 cloneElement = ReactElementValidator.cloneElement;
3837}
3838
3839var __spread = _assign;
3840
3841if ("development" !== 'production') {
3842 var warned = false;
3843 __spread = function () {
3844 "development" !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
3845 warned = true;
3846 return _assign.apply(null, arguments);
3847 };
3848}
3849
3850var React = {
3851
3852 // Modern
3853
3854 Children: {
3855 map: ReactChildren.map,
3856 forEach: ReactChildren.forEach,
3857 count: ReactChildren.count,
3858 toArray: ReactChildren.toArray,
3859 only: onlyChild
3860 },
3861
3862 Component: ReactComponent,
3863 PureComponent: ReactPureComponent,
3864
3865 createElement: createElement,
3866 cloneElement: cloneElement,
3867 isValidElement: ReactElement.isValidElement,
3868
3869 // Classic
3870
3871 PropTypes: ReactPropTypes,
3872 createClass: ReactClass.createClass,
3873 createFactory: createFactory,
3874 createMixin: function (mixin) {
3875 // Currently a noop. Will be used to validate and trace mixins.
3876 return mixin;
3877 },
3878
3879 // This looks DOM specific but these are actually isomorphic helpers
3880 // since they are just generating DOM strings.
3881 DOM: ReactDOMFactories,
3882
3883 version: ReactVersion,
3884
3885 // Deprecated hook for JSX spread, don't use this for anything.
3886 __spread: __spread
3887};
3888
3889module.exports = React;
3890},{"138":138,"171":171,"172":172,"29":29,"31":31,"32":32,"45":45,"61":61,"62":62,"84":84,"86":86,"97":97}],27:[function(_dereq_,module,exports){
3891/**
3892 * Copyright 2013-present, Facebook, Inc.
3893 * All rights reserved.
3894 *
3895 * This source code is licensed under the BSD-style license found in the
3896 * LICENSE file in the root directory of this source tree. An additional grant
3897 * of patent rights can be found in the PATENTS file in the same directory.
3898 *
3899 * @providesModule ReactBrowserEventEmitter
3900 */
3901
3902'use strict';
3903
3904var _assign = _dereq_(172);
3905
3906var EventConstants = _dereq_(16);
3907var EventPluginRegistry = _dereq_(18);
3908var ReactEventEmitterMixin = _dereq_(65);
3909var ViewportMetrics = _dereq_(115);
3910
3911var getVendorPrefixedEventName = _dereq_(134);
3912var isEventSupported = _dereq_(136);
3913
3914/**
3915 * Summary of `ReactBrowserEventEmitter` event handling:
3916 *
3917 * - Top-level delegation is used to trap most native browser events. This
3918 * may only occur in the main thread and is the responsibility of
3919 * ReactEventListener, which is injected and can therefore support pluggable
3920 * event sources. This is the only work that occurs in the main thread.
3921 *
3922 * - We normalize and de-duplicate events to account for browser quirks. This
3923 * may be done in the worker thread.
3924 *
3925 * - Forward these native events (with the associated top-level type used to
3926 * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
3927 * to extract any synthetic events.
3928 *
3929 * - The `EventPluginHub` will then process each event by annotating them with
3930 * "dispatches", a sequence of listeners and IDs that care about that event.
3931 *
3932 * - The `EventPluginHub` then dispatches the events.
3933 *
3934 * Overview of React and the event system:
3935 *
3936 * +------------+ .
3937 * | DOM | .
3938 * +------------+ .
3939 * | .
3940 * v .
3941 * +------------+ .
3942 * | ReactEvent | .
3943 * | Listener | .
3944 * +------------+ . +-----------+
3945 * | . +--------+|SimpleEvent|
3946 * | . | |Plugin |
3947 * +-----|------+ . v +-----------+
3948 * | | | . +--------------+ +------------+
3949 * | +-----------.--->|EventPluginHub| | Event |
3950 * | | . | | +-----------+ | Propagators|
3951 * | ReactEvent | . | | |TapEvent | |------------|
3952 * | Emitter | . | |<---+|Plugin | |other plugin|
3953 * | | . | | +-----------+ | utilities |
3954 * | +-----------.--->| | +------------+
3955 * | | | . +--------------+
3956 * +-----|------+ . ^ +-----------+
3957 * | . | |Enter/Leave|
3958 * + . +-------+|Plugin |
3959 * +-------------+ . +-----------+
3960 * | application | .
3961 * |-------------| .
3962 * | | .
3963 * | | .
3964 * +-------------+ .
3965 * .
3966 * React Core . General Purpose Event Plugin System
3967 */
3968
3969var hasEventPageXY;
3970var alreadyListeningTo = {};
3971var isMonitoringScrollValue = false;
3972var reactTopListenersCounter = 0;
3973
3974// For events like 'submit' which don't consistently bubble (which we trap at a
3975// lower node than `document`), binding at `document` would cause duplicate
3976// events so we don't include them here
3977var topEventMapping = {
3978 topAbort: 'abort',
3979 topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
3980 topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
3981 topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
3982 topBlur: 'blur',
3983 topCanPlay: 'canplay',
3984 topCanPlayThrough: 'canplaythrough',
3985 topChange: 'change',
3986 topClick: 'click',
3987 topCompositionEnd: 'compositionend',
3988 topCompositionStart: 'compositionstart',
3989 topCompositionUpdate: 'compositionupdate',
3990 topContextMenu: 'contextmenu',
3991 topCopy: 'copy',
3992 topCut: 'cut',
3993 topDoubleClick: 'dblclick',
3994 topDrag: 'drag',
3995 topDragEnd: 'dragend',
3996 topDragEnter: 'dragenter',
3997 topDragExit: 'dragexit',
3998 topDragLeave: 'dragleave',
3999 topDragOver: 'dragover',
4000 topDragStart: 'dragstart',
4001 topDrop: 'drop',
4002 topDurationChange: 'durationchange',
4003 topEmptied: 'emptied',
4004 topEncrypted: 'encrypted',
4005 topEnded: 'ended',
4006 topError: 'error',
4007 topFocus: 'focus',
4008 topInput: 'input',
4009 topKeyDown: 'keydown',
4010 topKeyPress: 'keypress',
4011 topKeyUp: 'keyup',
4012 topLoadedData: 'loadeddata',
4013 topLoadedMetadata: 'loadedmetadata',
4014 topLoadStart: 'loadstart',
4015 topMouseDown: 'mousedown',
4016 topMouseMove: 'mousemove',
4017 topMouseOut: 'mouseout',
4018 topMouseOver: 'mouseover',
4019 topMouseUp: 'mouseup',
4020 topPaste: 'paste',
4021 topPause: 'pause',
4022 topPlay: 'play',
4023 topPlaying: 'playing',
4024 topProgress: 'progress',
4025 topRateChange: 'ratechange',
4026 topScroll: 'scroll',
4027 topSeeked: 'seeked',
4028 topSeeking: 'seeking',
4029 topSelectionChange: 'selectionchange',
4030 topStalled: 'stalled',
4031 topSuspend: 'suspend',
4032 topTextInput: 'textInput',
4033 topTimeUpdate: 'timeupdate',
4034 topTouchCancel: 'touchcancel',
4035 topTouchEnd: 'touchend',
4036 topTouchMove: 'touchmove',
4037 topTouchStart: 'touchstart',
4038 topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
4039 topVolumeChange: 'volumechange',
4040 topWaiting: 'waiting',
4041 topWheel: 'wheel'
4042};
4043
4044/**
4045 * To ensure no conflicts with other potential React instances on the page
4046 */
4047var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
4048
4049function getListeningForDocument(mountAt) {
4050 // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
4051 // directly.
4052 if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
4053 mountAt[topListenersIDKey] = reactTopListenersCounter++;
4054 alreadyListeningTo[mountAt[topListenersIDKey]] = {};
4055 }
4056 return alreadyListeningTo[mountAt[topListenersIDKey]];
4057}
4058
4059/**
4060 * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
4061 * example:
4062 *
4063 * EventPluginHub.putListener('myID', 'onClick', myFunction);
4064 *
4065 * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
4066 *
4067 * @internal
4068 */
4069var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
4070
4071 /**
4072 * Injectable event backend
4073 */
4074 ReactEventListener: null,
4075
4076 injection: {
4077 /**
4078 * @param {object} ReactEventListener
4079 */
4080 injectReactEventListener: function (ReactEventListener) {
4081 ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
4082 ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
4083 }
4084 },
4085
4086 /**
4087 * Sets whether or not any created callbacks should be enabled.
4088 *
4089 * @param {boolean} enabled True if callbacks should be enabled.
4090 */
4091 setEnabled: function (enabled) {
4092 if (ReactBrowserEventEmitter.ReactEventListener) {
4093 ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
4094 }
4095 },
4096
4097 /**
4098 * @return {boolean} True if callbacks are enabled.
4099 */
4100 isEnabled: function () {
4101 return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
4102 },
4103
4104 /**
4105 * We listen for bubbled touch events on the document object.
4106 *
4107 * Firefox v8.01 (and possibly others) exhibited strange behavior when
4108 * mounting `onmousemove` events at some node that was not the document
4109 * element. The symptoms were that if your mouse is not moving over something
4110 * contained within that mount point (for example on the background) the
4111 * top-level listeners for `onmousemove` won't be called. However, if you
4112 * register the `mousemove` on the document object, then it will of course
4113 * catch all `mousemove`s. This along with iOS quirks, justifies restricting
4114 * top-level listeners to the document object only, at least for these
4115 * movement types of events and possibly all events.
4116 *
4117 * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
4118 *
4119 * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
4120 * they bubble to document.
4121 *
4122 * @param {string} registrationName Name of listener (e.g. `onClick`).
4123 * @param {object} contentDocumentHandle Document which owns the container
4124 */
4125 listenTo: function (registrationName, contentDocumentHandle) {
4126 var mountAt = contentDocumentHandle;
4127 var isListening = getListeningForDocument(mountAt);
4128 var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
4129
4130 var topLevelTypes = EventConstants.topLevelTypes;
4131 for (var i = 0; i < dependencies.length; i++) {
4132 var dependency = dependencies[i];
4133 if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
4134 if (dependency === topLevelTypes.topWheel) {
4135 if (isEventSupported('wheel')) {
4136 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
4137 } else if (isEventSupported('mousewheel')) {
4138 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
4139 } else {
4140 // Firefox needs to capture a different mouse scroll event.
4141 // @see http://www.quirksmode.org/dom/events/tests/scroll.html
4142 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
4143 }
4144 } else if (dependency === topLevelTypes.topScroll) {
4145
4146 if (isEventSupported('scroll', true)) {
4147 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
4148 } else {
4149 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
4150 }
4151 } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
4152
4153 if (isEventSupported('focus', true)) {
4154 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
4155 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
4156 } else if (isEventSupported('focusin')) {
4157 // IE has `focusin` and `focusout` events which bubble.
4158 // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
4159 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
4160 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
4161 }
4162
4163 // to make sure blur and focus event listeners are only attached once
4164 isListening[topLevelTypes.topBlur] = true;
4165 isListening[topLevelTypes.topFocus] = true;
4166 } else if (topEventMapping.hasOwnProperty(dependency)) {
4167 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
4168 }
4169
4170 isListening[dependency] = true;
4171 }
4172 }
4173 },
4174
4175 trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
4176 return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
4177 },
4178
4179 trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
4180 return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
4181 },
4182
4183 /**
4184 * Protect against document.createEvent() returning null
4185 * Some popup blocker extensions appear to do this:
4186 * https://github.com/facebook/react/issues/6887
4187 */
4188 supportsEventPageXY: function () {
4189 if (!document.createEvent) {
4190 return false;
4191 }
4192 var ev = document.createEvent('MouseEvent');
4193 return ev != null && 'pageX' in ev;
4194 },
4195
4196 /**
4197 * Listens to window scroll and resize events. We cache scroll values so that
4198 * application code can access them without triggering reflows.
4199 *
4200 * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
4201 * pageX/pageY isn't supported (legacy browsers).
4202 *
4203 * NOTE: Scroll events do not bubble.
4204 *
4205 * @see http://www.quirksmode.org/dom/events/scroll.html
4206 */
4207 ensureScrollValueMonitoring: function () {
4208 if (hasEventPageXY === undefined) {
4209 hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY();
4210 }
4211 if (!hasEventPageXY && !isMonitoringScrollValue) {
4212 var refresh = ViewportMetrics.refreshScrollValues;
4213 ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
4214 isMonitoringScrollValue = true;
4215 }
4216 }
4217
4218});
4219
4220module.exports = ReactBrowserEventEmitter;
4221},{"115":115,"134":134,"136":136,"16":16,"172":172,"18":18,"65":65}],28:[function(_dereq_,module,exports){
4222(function (process){
4223/**
4224 * Copyright 2014-present, Facebook, Inc.
4225 * All rights reserved.
4226 *
4227 * This source code is licensed under the BSD-style license found in the
4228 * LICENSE file in the root directory of this source tree. An additional grant
4229 * of patent rights can be found in the PATENTS file in the same directory.
4230 *
4231 * @providesModule ReactChildReconciler
4232 */
4233
4234'use strict';
4235
4236var ReactReconciler = _dereq_(88);
4237
4238var instantiateReactComponent = _dereq_(135);
4239var KeyEscapeUtils = _dereq_(23);
4240var shouldUpdateReactComponent = _dereq_(144);
4241var traverseAllChildren = _dereq_(145);
4242var warning = _dereq_(171);
4243
4244var ReactComponentTreeHook;
4245
4246if (typeof process !== 'undefined' && process.env && "development" === 'test') {
4247 // Temporary hack.
4248 // Inline requires don't work well with Jest:
4249 // https://github.com/facebook/react/issues/7240
4250 // Remove the inline requires when we don't need them anymore:
4251 // https://github.com/facebook/react/pull/7178
4252 ReactComponentTreeHook = _dereq_(35);
4253}
4254
4255function instantiateChild(childInstances, child, name, selfDebugID) {
4256 // We found a component instance.
4257 var keyUnique = childInstances[name] === undefined;
4258 if ("development" !== 'production') {
4259 if (!ReactComponentTreeHook) {
4260 ReactComponentTreeHook = _dereq_(35);
4261 }
4262 if (!keyUnique) {
4263 "development" !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
4264 }
4265 }
4266 if (child != null && keyUnique) {
4267 childInstances[name] = instantiateReactComponent(child, true);
4268 }
4269}
4270
4271/**
4272 * ReactChildReconciler provides helpers for initializing or updating a set of
4273 * children. Its output is suitable for passing it onto ReactMultiChild which
4274 * does diffed reordering and insertion.
4275 */
4276var ReactChildReconciler = {
4277 /**
4278 * Generates a "mount image" for each of the supplied children. In the case
4279 * of `ReactDOMComponent`, a mount image is a string of markup.
4280 *
4281 * @param {?object} nestedChildNodes Nested child maps.
4282 * @return {?object} A set of child instances.
4283 * @internal
4284 */
4285 instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID // 0 in production and for roots
4286 ) {
4287 if (nestedChildNodes == null) {
4288 return null;
4289 }
4290 var childInstances = {};
4291
4292 if ("development" !== 'production') {
4293 traverseAllChildren(nestedChildNodes, function (childInsts, child, name) {
4294 return instantiateChild(childInsts, child, name, selfDebugID);
4295 }, childInstances);
4296 } else {
4297 traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
4298 }
4299 return childInstances;
4300 },
4301
4302 /**
4303 * Updates the rendered children and returns a new set of children.
4304 *
4305 * @param {?object} prevChildren Previously initialized set of children.
4306 * @param {?object} nextChildren Flat child element maps.
4307 * @param {ReactReconcileTransaction} transaction
4308 * @param {object} context
4309 * @return {?object} A new set of child instances.
4310 * @internal
4311 */
4312 updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID // 0 in production and for roots
4313 ) {
4314 // We currently don't have a way to track moves here but if we use iterators
4315 // instead of for..in we can zip the iterators and check if an item has
4316 // moved.
4317 // TODO: If nothing has changed, return the prevChildren object so that we
4318 // can quickly bailout if nothing has changed.
4319 if (!nextChildren && !prevChildren) {
4320 return;
4321 }
4322 var name;
4323 var prevChild;
4324 for (name in nextChildren) {
4325 if (!nextChildren.hasOwnProperty(name)) {
4326 continue;
4327 }
4328 prevChild = prevChildren && prevChildren[name];
4329 var prevElement = prevChild && prevChild._currentElement;
4330 var nextElement = nextChildren[name];
4331 if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
4332 ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
4333 nextChildren[name] = prevChild;
4334 } else {
4335 if (prevChild) {
4336 removedNodes[name] = ReactReconciler.getHostNode(prevChild);
4337 ReactReconciler.unmountComponent(prevChild, false);
4338 }
4339 // The child must be instantiated before it's mounted.
4340 var nextChildInstance = instantiateReactComponent(nextElement, true);
4341 nextChildren[name] = nextChildInstance;
4342 // Creating mount image now ensures refs are resolved in right order
4343 // (see https://github.com/facebook/react/pull/7101 for explanation).
4344 var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
4345 mountImages.push(nextChildMountImage);
4346 }
4347 }
4348 // Unmount children that are no longer present.
4349 for (name in prevChildren) {
4350 if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
4351 prevChild = prevChildren[name];
4352 removedNodes[name] = ReactReconciler.getHostNode(prevChild);
4353 ReactReconciler.unmountComponent(prevChild, false);
4354 }
4355 }
4356 },
4357
4358 /**
4359 * Unmounts all rendered children. This should be used to clean up children
4360 * when this component is unmounted.
4361 *
4362 * @param {?object} renderedChildren Previously initialized set of children.
4363 * @internal
4364 */
4365 unmountChildren: function (renderedChildren, safely) {
4366 for (var name in renderedChildren) {
4367 if (renderedChildren.hasOwnProperty(name)) {
4368 var renderedChild = renderedChildren[name];
4369 ReactReconciler.unmountComponent(renderedChild, safely);
4370 }
4371 }
4372 }
4373
4374};
4375
4376module.exports = ReactChildReconciler;
4377}).call(this,undefined)
4378},{"135":135,"144":144,"145":145,"171":171,"23":23,"35":35,"88":88}],29:[function(_dereq_,module,exports){
4379/**
4380 * Copyright 2013-present, Facebook, Inc.
4381 * All rights reserved.
4382 *
4383 * This source code is licensed under the BSD-style license found in the
4384 * LICENSE file in the root directory of this source tree. An additional grant
4385 * of patent rights can be found in the PATENTS file in the same directory.
4386 *
4387 * @providesModule ReactChildren
4388 */
4389
4390'use strict';
4391
4392var PooledClass = _dereq_(25);
4393var ReactElement = _dereq_(61);
4394
4395var emptyFunction = _dereq_(154);
4396var traverseAllChildren = _dereq_(145);
4397
4398var twoArgumentPooler = PooledClass.twoArgumentPooler;
4399var fourArgumentPooler = PooledClass.fourArgumentPooler;
4400
4401var userProvidedKeyEscapeRegex = /\/+/g;
4402function escapeUserProvidedKey(text) {
4403 return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
4404}
4405
4406/**
4407 * PooledClass representing the bookkeeping associated with performing a child
4408 * traversal. Allows avoiding binding callbacks.
4409 *
4410 * @constructor ForEachBookKeeping
4411 * @param {!function} forEachFunction Function to perform traversal with.
4412 * @param {?*} forEachContext Context to perform context with.
4413 */
4414function ForEachBookKeeping(forEachFunction, forEachContext) {
4415 this.func = forEachFunction;
4416 this.context = forEachContext;
4417 this.count = 0;
4418}
4419ForEachBookKeeping.prototype.destructor = function () {
4420 this.func = null;
4421 this.context = null;
4422 this.count = 0;
4423};
4424PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
4425
4426function forEachSingleChild(bookKeeping, child, name) {
4427 var func = bookKeeping.func;
4428 var context = bookKeeping.context;
4429
4430 func.call(context, child, bookKeeping.count++);
4431}
4432
4433/**
4434 * Iterates through children that are typically specified as `props.children`.
4435 *
4436 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
4437 *
4438 * The provided forEachFunc(child, index) will be called for each
4439 * leaf child.
4440 *
4441 * @param {?*} children Children tree container.
4442 * @param {function(*, int)} forEachFunc
4443 * @param {*} forEachContext Context for forEachContext.
4444 */
4445function forEachChildren(children, forEachFunc, forEachContext) {
4446 if (children == null) {
4447 return children;
4448 }
4449 var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
4450 traverseAllChildren(children, forEachSingleChild, traverseContext);
4451 ForEachBookKeeping.release(traverseContext);
4452}
4453
4454/**
4455 * PooledClass representing the bookkeeping associated with performing a child
4456 * mapping. Allows avoiding binding callbacks.
4457 *
4458 * @constructor MapBookKeeping
4459 * @param {!*} mapResult Object containing the ordered map of results.
4460 * @param {!function} mapFunction Function to perform mapping with.
4461 * @param {?*} mapContext Context to perform mapping with.
4462 */
4463function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
4464 this.result = mapResult;
4465 this.keyPrefix = keyPrefix;
4466 this.func = mapFunction;
4467 this.context = mapContext;
4468 this.count = 0;
4469}
4470MapBookKeeping.prototype.destructor = function () {
4471 this.result = null;
4472 this.keyPrefix = null;
4473 this.func = null;
4474 this.context = null;
4475 this.count = 0;
4476};
4477PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
4478
4479function mapSingleChildIntoContext(bookKeeping, child, childKey) {
4480 var result = bookKeeping.result;
4481 var keyPrefix = bookKeeping.keyPrefix;
4482 var func = bookKeeping.func;
4483 var context = bookKeeping.context;
4484
4485
4486 var mappedChild = func.call(context, child, bookKeeping.count++);
4487 if (Array.isArray(mappedChild)) {
4488 mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
4489 } else if (mappedChild != null) {
4490 if (ReactElement.isValidElement(mappedChild)) {
4491 mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
4492 // Keep both the (mapped) and old keys if they differ, just as
4493 // traverseAllChildren used to do for objects as children
4494 keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
4495 }
4496 result.push(mappedChild);
4497 }
4498}
4499
4500function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
4501 var escapedPrefix = '';
4502 if (prefix != null) {
4503 escapedPrefix = escapeUserProvidedKey(prefix) + '/';
4504 }
4505 var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
4506 traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
4507 MapBookKeeping.release(traverseContext);
4508}
4509
4510/**
4511 * Maps children that are typically specified as `props.children`.
4512 *
4513 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
4514 *
4515 * The provided mapFunction(child, key, index) will be called for each
4516 * leaf child.
4517 *
4518 * @param {?*} children Children tree container.
4519 * @param {function(*, int)} func The map function.
4520 * @param {*} context Context for mapFunction.
4521 * @return {object} Object containing the ordered map of results.
4522 */
4523function mapChildren(children, func, context) {
4524 if (children == null) {
4525 return children;
4526 }
4527 var result = [];
4528 mapIntoWithKeyPrefixInternal(children, result, null, func, context);
4529 return result;
4530}
4531
4532function forEachSingleChildDummy(traverseContext, child, name) {
4533 return null;
4534}
4535
4536/**
4537 * Count the number of children that are typically specified as
4538 * `props.children`.
4539 *
4540 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
4541 *
4542 * @param {?*} children Children tree container.
4543 * @return {number} The number of children.
4544 */
4545function countChildren(children, context) {
4546 return traverseAllChildren(children, forEachSingleChildDummy, null);
4547}
4548
4549/**
4550 * Flatten a children object (typically specified as `props.children`) and
4551 * return an array with appropriately re-keyed children.
4552 *
4553 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
4554 */
4555function toArray(children) {
4556 var result = [];
4557 mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
4558 return result;
4559}
4560
4561var ReactChildren = {
4562 forEach: forEachChildren,
4563 map: mapChildren,
4564 mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
4565 count: countChildren,
4566 toArray: toArray
4567};
4568
4569module.exports = ReactChildren;
4570},{"145":145,"154":154,"25":25,"61":61}],30:[function(_dereq_,module,exports){
4571/**
4572 * Copyright 2013-present, Facebook, Inc.
4573 * All rights reserved.
4574 *
4575 * This source code is licensed under the BSD-style license found in the
4576 * LICENSE file in the root directory of this source tree. An additional grant
4577 * of patent rights can be found in the PATENTS file in the same directory.
4578 *
4579 * @providesModule ReactChildrenMutationWarningHook
4580 */
4581
4582'use strict';
4583
4584var ReactComponentTreeHook = _dereq_(35);
4585
4586var warning = _dereq_(171);
4587
4588function handleElement(debugID, element) {
4589 if (element == null) {
4590 return;
4591 }
4592 if (element._shadowChildren === undefined) {
4593 return;
4594 }
4595 if (element._shadowChildren === element.props.children) {
4596 return;
4597 }
4598 var isMutated = false;
4599 if (Array.isArray(element._shadowChildren)) {
4600 if (element._shadowChildren.length === element.props.children.length) {
4601 for (var i = 0; i < element._shadowChildren.length; i++) {
4602 if (element._shadowChildren[i] !== element.props.children[i]) {
4603 isMutated = true;
4604 }
4605 }
4606 } else {
4607 isMutated = true;
4608 }
4609 }
4610 if (!Array.isArray(element._shadowChildren) || isMutated) {
4611 "development" !== 'production' ? warning(false, 'Component\'s children should not be mutated.%s', ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
4612 }
4613}
4614
4615var ReactChildrenMutationWarningHook = {
4616 onMountComponent: function (debugID) {
4617 handleElement(debugID, ReactComponentTreeHook.getElement(debugID));
4618 },
4619 onUpdateComponent: function (debugID) {
4620 handleElement(debugID, ReactComponentTreeHook.getElement(debugID));
4621 }
4622};
4623
4624module.exports = ReactChildrenMutationWarningHook;
4625},{"171":171,"35":35}],31:[function(_dereq_,module,exports){
4626/**
4627 * Copyright 2013-present, Facebook, Inc.
4628 * All rights reserved.
4629 *
4630 * This source code is licensed under the BSD-style license found in the
4631 * LICENSE file in the root directory of this source tree. An additional grant
4632 * of patent rights can be found in the PATENTS file in the same directory.
4633 *
4634 * @providesModule ReactClass
4635 */
4636
4637'use strict';
4638
4639var _prodInvariant = _dereq_(140),
4640 _assign = _dereq_(172);
4641
4642var ReactComponent = _dereq_(32);
4643var ReactElement = _dereq_(61);
4644var ReactPropTypeLocations = _dereq_(83);
4645var ReactPropTypeLocationNames = _dereq_(82);
4646var ReactNoopUpdateQueue = _dereq_(80);
4647
4648var emptyObject = _dereq_(155);
4649var invariant = _dereq_(162);
4650var keyMirror = _dereq_(165);
4651var keyOf = _dereq_(166);
4652var warning = _dereq_(171);
4653
4654var MIXINS_KEY = keyOf({ mixins: null });
4655
4656/**
4657 * Policies that describe methods in `ReactClassInterface`.
4658 */
4659var SpecPolicy = keyMirror({
4660 /**
4661 * These methods may be defined only once by the class specification or mixin.
4662 */
4663 DEFINE_ONCE: null,
4664 /**
4665 * These methods may be defined by both the class specification and mixins.
4666 * Subsequent definitions will be chained. These methods must return void.
4667 */
4668 DEFINE_MANY: null,
4669 /**
4670 * These methods are overriding the base class.
4671 */
4672 OVERRIDE_BASE: null,
4673 /**
4674 * These methods are similar to DEFINE_MANY, except we assume they return
4675 * objects. We try to merge the keys of the return values of all the mixed in
4676 * functions. If there is a key conflict we throw.
4677 */
4678 DEFINE_MANY_MERGED: null
4679});
4680
4681var injectedMixins = [];
4682
4683/**
4684 * Composite components are higher-level components that compose other composite
4685 * or host components.
4686 *
4687 * To create a new type of `ReactClass`, pass a specification of
4688 * your new class to `React.createClass`. The only requirement of your class
4689 * specification is that you implement a `render` method.
4690 *
4691 * var MyComponent = React.createClass({
4692 * render: function() {
4693 * return <div>Hello World</div>;
4694 * }
4695 * });
4696 *
4697 * The class specification supports a specific protocol of methods that have
4698 * special meaning (e.g. `render`). See `ReactClassInterface` for
4699 * more the comprehensive protocol. Any other properties and methods in the
4700 * class specification will be available on the prototype.
4701 *
4702 * @interface ReactClassInterface
4703 * @internal
4704 */
4705var ReactClassInterface = {
4706
4707 /**
4708 * An array of Mixin objects to include when defining your component.
4709 *
4710 * @type {array}
4711 * @optional
4712 */
4713 mixins: SpecPolicy.DEFINE_MANY,
4714
4715 /**
4716 * An object containing properties and methods that should be defined on
4717 * the component's constructor instead of its prototype (static methods).
4718 *
4719 * @type {object}
4720 * @optional
4721 */
4722 statics: SpecPolicy.DEFINE_MANY,
4723
4724 /**
4725 * Definition of prop types for this component.
4726 *
4727 * @type {object}
4728 * @optional
4729 */
4730 propTypes: SpecPolicy.DEFINE_MANY,
4731
4732 /**
4733 * Definition of context types for this component.
4734 *
4735 * @type {object}
4736 * @optional
4737 */
4738 contextTypes: SpecPolicy.DEFINE_MANY,
4739
4740 /**
4741 * Definition of context types this component sets for its children.
4742 *
4743 * @type {object}
4744 * @optional
4745 */
4746 childContextTypes: SpecPolicy.DEFINE_MANY,
4747
4748 // ==== Definition methods ====
4749
4750 /**
4751 * Invoked when the component is mounted. Values in the mapping will be set on
4752 * `this.props` if that prop is not specified (i.e. using an `in` check).
4753 *
4754 * This method is invoked before `getInitialState` and therefore cannot rely
4755 * on `this.state` or use `this.setState`.
4756 *
4757 * @return {object}
4758 * @optional
4759 */
4760 getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
4761
4762 /**
4763 * Invoked once before the component is mounted. The return value will be used
4764 * as the initial value of `this.state`.
4765 *
4766 * getInitialState: function() {
4767 * return {
4768 * isOn: false,
4769 * fooBaz: new BazFoo()
4770 * }
4771 * }
4772 *
4773 * @return {object}
4774 * @optional
4775 */
4776 getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
4777
4778 /**
4779 * @return {object}
4780 * @optional
4781 */
4782 getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
4783
4784 /**
4785 * Uses props from `this.props` and state from `this.state` to render the
4786 * structure of the component.
4787 *
4788 * No guarantees are made about when or how often this method is invoked, so
4789 * it must not have side effects.
4790 *
4791 * render: function() {
4792 * var name = this.props.name;
4793 * return <div>Hello, {name}!</div>;
4794 * }
4795 *
4796 * @return {ReactComponent}
4797 * @nosideeffects
4798 * @required
4799 */
4800 render: SpecPolicy.DEFINE_ONCE,
4801
4802 // ==== Delegate methods ====
4803
4804 /**
4805 * Invoked when the component is initially created and about to be mounted.
4806 * This may have side effects, but any external subscriptions or data created
4807 * by this method must be cleaned up in `componentWillUnmount`.
4808 *
4809 * @optional
4810 */
4811 componentWillMount: SpecPolicy.DEFINE_MANY,
4812
4813 /**
4814 * Invoked when the component has been mounted and has a DOM representation.
4815 * However, there is no guarantee that the DOM node is in the document.
4816 *
4817 * Use this as an opportunity to operate on the DOM when the component has
4818 * been mounted (initialized and rendered) for the first time.
4819 *
4820 * @param {DOMElement} rootNode DOM element representing the component.
4821 * @optional
4822 */
4823 componentDidMount: SpecPolicy.DEFINE_MANY,
4824
4825 /**
4826 * Invoked before the component receives new props.
4827 *
4828 * Use this as an opportunity to react to a prop transition by updating the
4829 * state using `this.setState`. Current props are accessed via `this.props`.
4830 *
4831 * componentWillReceiveProps: function(nextProps, nextContext) {
4832 * this.setState({
4833 * likesIncreasing: nextProps.likeCount > this.props.likeCount
4834 * });
4835 * }
4836 *
4837 * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
4838 * transition may cause a state change, but the opposite is not true. If you
4839 * need it, you are probably looking for `componentWillUpdate`.
4840 *
4841 * @param {object} nextProps
4842 * @optional
4843 */
4844 componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
4845
4846 /**
4847 * Invoked while deciding if the component should be updated as a result of
4848 * receiving new props, state and/or context.
4849 *
4850 * Use this as an opportunity to `return false` when you're certain that the
4851 * transition to the new props/state/context will not require a component
4852 * update.
4853 *
4854 * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
4855 * return !equal(nextProps, this.props) ||
4856 * !equal(nextState, this.state) ||
4857 * !equal(nextContext, this.context);
4858 * }
4859 *
4860 * @param {object} nextProps
4861 * @param {?object} nextState
4862 * @param {?object} nextContext
4863 * @return {boolean} True if the component should update.
4864 * @optional
4865 */
4866 shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
4867
4868 /**
4869 * Invoked when the component is about to update due to a transition from
4870 * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
4871 * and `nextContext`.
4872 *
4873 * Use this as an opportunity to perform preparation before an update occurs.
4874 *
4875 * NOTE: You **cannot** use `this.setState()` in this method.
4876 *
4877 * @param {object} nextProps
4878 * @param {?object} nextState
4879 * @param {?object} nextContext
4880 * @param {ReactReconcileTransaction} transaction
4881 * @optional
4882 */
4883 componentWillUpdate: SpecPolicy.DEFINE_MANY,
4884
4885 /**
4886 * Invoked when the component's DOM representation has been updated.
4887 *
4888 * Use this as an opportunity to operate on the DOM when the component has
4889 * been updated.
4890 *
4891 * @param {object} prevProps
4892 * @param {?object} prevState
4893 * @param {?object} prevContext
4894 * @param {DOMElement} rootNode DOM element representing the component.
4895 * @optional
4896 */
4897 componentDidUpdate: SpecPolicy.DEFINE_MANY,
4898
4899 /**
4900 * Invoked when the component is about to be removed from its parent and have
4901 * its DOM representation destroyed.
4902 *
4903 * Use this as an opportunity to deallocate any external resources.
4904 *
4905 * NOTE: There is no `componentDidUnmount` since your component will have been
4906 * destroyed by that point.
4907 *
4908 * @optional
4909 */
4910 componentWillUnmount: SpecPolicy.DEFINE_MANY,
4911
4912 // ==== Advanced methods ====
4913
4914 /**
4915 * Updates the component's currently mounted DOM representation.
4916 *
4917 * By default, this implements React's rendering and reconciliation algorithm.
4918 * Sophisticated clients may wish to override this.
4919 *
4920 * @param {ReactReconcileTransaction} transaction
4921 * @internal
4922 * @overridable
4923 */
4924 updateComponent: SpecPolicy.OVERRIDE_BASE
4925
4926};
4927
4928/**
4929 * Mapping from class specification keys to special processing functions.
4930 *
4931 * Although these are declared like instance properties in the specification
4932 * when defining classes using `React.createClass`, they are actually static
4933 * and are accessible on the constructor instead of the prototype. Despite
4934 * being static, they must be defined outside of the "statics" key under
4935 * which all other static methods are defined.
4936 */
4937var RESERVED_SPEC_KEYS = {
4938 displayName: function (Constructor, displayName) {
4939 Constructor.displayName = displayName;
4940 },
4941 mixins: function (Constructor, mixins) {
4942 if (mixins) {
4943 for (var i = 0; i < mixins.length; i++) {
4944 mixSpecIntoComponent(Constructor, mixins[i]);
4945 }
4946 }
4947 },
4948 childContextTypes: function (Constructor, childContextTypes) {
4949 if ("development" !== 'production') {
4950 validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
4951 }
4952 Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
4953 },
4954 contextTypes: function (Constructor, contextTypes) {
4955 if ("development" !== 'production') {
4956 validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
4957 }
4958 Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
4959 },
4960 /**
4961 * Special case getDefaultProps which should move into statics but requires
4962 * automatic merging.
4963 */
4964 getDefaultProps: function (Constructor, getDefaultProps) {
4965 if (Constructor.getDefaultProps) {
4966 Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
4967 } else {
4968 Constructor.getDefaultProps = getDefaultProps;
4969 }
4970 },
4971 propTypes: function (Constructor, propTypes) {
4972 if ("development" !== 'production') {
4973 validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
4974 }
4975 Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
4976 },
4977 statics: function (Constructor, statics) {
4978 mixStaticSpecIntoComponent(Constructor, statics);
4979 },
4980 autobind: function () {} };
4981
4982// noop
4983function validateTypeDef(Constructor, typeDef, location) {
4984 for (var propName in typeDef) {
4985 if (typeDef.hasOwnProperty(propName)) {
4986 // use a warning instead of an invariant so components
4987 // don't show up in prod but only in __DEV__
4988 "development" !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : void 0;
4989 }
4990 }
4991}
4992
4993function validateMethodOverride(isAlreadyDefined, name) {
4994 var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
4995
4996 // Disallow overriding of base class methods unless explicitly allowed.
4997 if (ReactClassMixin.hasOwnProperty(name)) {
4998 !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? "development" !== 'production' ? 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) : _prodInvariant('73', name) : void 0;
4999 }
5000
5001 // Disallow defining methods more than once unless explicitly allowed.
5002 if (isAlreadyDefined) {
5003 !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? "development" !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0;
5004 }
5005}
5006
5007/**
5008 * Mixin helper which handles policy validation and reserved
5009 * specification keys when building React classes.
5010 */
5011function mixSpecIntoComponent(Constructor, spec) {
5012 if (!spec) {
5013 if ("development" !== 'production') {
5014 var typeofSpec = typeof spec;
5015 var isMixinValid = typeofSpec === 'object' && spec !== null;
5016
5017 "development" !== 'production' ? 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) : void 0;
5018 }
5019
5020 return;
5021 }
5022
5023 !(typeof spec !== 'function') ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;
5024 !!ReactElement.isValidElement(spec) ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;
5025
5026 var proto = Constructor.prototype;
5027 var autoBindPairs = proto.__reactAutoBindPairs;
5028
5029 // By handling mixins before any other properties, we ensure the same
5030 // chaining order is applied to methods with DEFINE_MANY policy, whether
5031 // mixins are listed before or after these methods in the spec.
5032 if (spec.hasOwnProperty(MIXINS_KEY)) {
5033 RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
5034 }
5035
5036 for (var name in spec) {
5037 if (!spec.hasOwnProperty(name)) {
5038 continue;
5039 }
5040
5041 if (name === MIXINS_KEY) {
5042 // We have already handled mixins in a special case above.
5043 continue;
5044 }
5045
5046 var property = spec[name];
5047 var isAlreadyDefined = proto.hasOwnProperty(name);
5048 validateMethodOverride(isAlreadyDefined, name);
5049
5050 if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
5051 RESERVED_SPEC_KEYS[name](Constructor, property);
5052 } else {
5053 // Setup methods on prototype:
5054 // The following member methods should not be automatically bound:
5055 // 1. Expected ReactClass methods (in the "interface").
5056 // 2. Overridden methods (that were mixed in).
5057 var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
5058 var isFunction = typeof property === 'function';
5059 var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
5060
5061 if (shouldAutoBind) {
5062 autoBindPairs.push(name, property);
5063 proto[name] = property;
5064 } else {
5065 if (isAlreadyDefined) {
5066 var specPolicy = ReactClassInterface[name];
5067
5068 // These cases should already be caught by validateMethodOverride.
5069 !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? "development" !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;
5070
5071 // For methods which are defined more than once, call the existing
5072 // methods before calling the new property, merging if appropriate.
5073 if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
5074 proto[name] = createMergedResultFunction(proto[name], property);
5075 } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
5076 proto[name] = createChainedFunction(proto[name], property);
5077 }
5078 } else {
5079 proto[name] = property;
5080 if ("development" !== 'production') {
5081 // Add verbose displayName to the function, which helps when looking
5082 // at profiling tools.
5083 if (typeof property === 'function' && spec.displayName) {
5084 proto[name].displayName = spec.displayName + '_' + name;
5085 }
5086 }
5087 }
5088 }
5089 }
5090 }
5091}
5092
5093function mixStaticSpecIntoComponent(Constructor, statics) {
5094 if (!statics) {
5095 return;
5096 }
5097 for (var name in statics) {
5098 var property = statics[name];
5099 if (!statics.hasOwnProperty(name)) {
5100 continue;
5101 }
5102
5103 var isReserved = name in RESERVED_SPEC_KEYS;
5104 !!isReserved ? "development" !== 'production' ? 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) : _prodInvariant('78', name) : void 0;
5105
5106 var isInherited = name in Constructor;
5107 !!isInherited ? "development" !== 'production' ? invariant(false, 'ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('79', name) : void 0;
5108 Constructor[name] = property;
5109 }
5110}
5111
5112/**
5113 * Merge two objects, but throw if both contain the same key.
5114 *
5115 * @param {object} one The first object, which is mutated.
5116 * @param {object} two The second object
5117 * @return {object} one after it has been mutated to contain everything in two.
5118 */
5119function mergeIntoWithNoDuplicateKeys(one, two) {
5120 !(one && two && typeof one === 'object' && typeof two === 'object') ? "development" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0;
5121
5122 for (var key in two) {
5123 if (two.hasOwnProperty(key)) {
5124 !(one[key] === undefined) ? "development" !== 'production' ? 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) : _prodInvariant('81', key) : void 0;
5125 one[key] = two[key];
5126 }
5127 }
5128 return one;
5129}
5130
5131/**
5132 * Creates a function that invokes two functions and merges their return values.
5133 *
5134 * @param {function} one Function to invoke first.
5135 * @param {function} two Function to invoke second.
5136 * @return {function} Function that invokes the two argument functions.
5137 * @private
5138 */
5139function createMergedResultFunction(one, two) {
5140 return function mergedResult() {
5141 var a = one.apply(this, arguments);
5142 var b = two.apply(this, arguments);
5143 if (a == null) {
5144 return b;
5145 } else if (b == null) {
5146 return a;
5147 }
5148 var c = {};
5149 mergeIntoWithNoDuplicateKeys(c, a);
5150 mergeIntoWithNoDuplicateKeys(c, b);
5151 return c;
5152 };
5153}
5154
5155/**
5156 * Creates a function that invokes two functions and ignores their return vales.
5157 *
5158 * @param {function} one Function to invoke first.
5159 * @param {function} two Function to invoke second.
5160 * @return {function} Function that invokes the two argument functions.
5161 * @private
5162 */
5163function createChainedFunction(one, two) {
5164 return function chainedFunction() {
5165 one.apply(this, arguments);
5166 two.apply(this, arguments);
5167 };
5168}
5169
5170/**
5171 * Binds a method to the component.
5172 *
5173 * @param {object} component Component whose method is going to be bound.
5174 * @param {function} method Method to be bound.
5175 * @return {function} The bound method.
5176 */
5177function bindAutoBindMethod(component, method) {
5178 var boundMethod = method.bind(component);
5179 if ("development" !== 'production') {
5180 boundMethod.__reactBoundContext = component;
5181 boundMethod.__reactBoundMethod = method;
5182 boundMethod.__reactBoundArguments = null;
5183 var componentName = component.constructor.displayName;
5184 var _bind = boundMethod.bind;
5185 boundMethod.bind = function (newThis) {
5186 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5187 args[_key - 1] = arguments[_key];
5188 }
5189
5190 // User is trying to bind() an autobound method; we effectively will
5191 // ignore the value of "this" that the user is trying to use, so
5192 // let's warn.
5193 if (newThis !== component && newThis !== null) {
5194 "development" !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
5195 } else if (!args.length) {
5196 "development" !== 'production' ? 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. See %s', componentName) : void 0;
5197 return boundMethod;
5198 }
5199 var reboundMethod = _bind.apply(boundMethod, arguments);
5200 reboundMethod.__reactBoundContext = component;
5201 reboundMethod.__reactBoundMethod = method;
5202 reboundMethod.__reactBoundArguments = args;
5203 return reboundMethod;
5204 };
5205 }
5206 return boundMethod;
5207}
5208
5209/**
5210 * Binds all auto-bound methods in a component.
5211 *
5212 * @param {object} component Component whose method is going to be bound.
5213 */
5214function bindAutoBindMethods(component) {
5215 var pairs = component.__reactAutoBindPairs;
5216 for (var i = 0; i < pairs.length; i += 2) {
5217 var autoBindKey = pairs[i];
5218 var method = pairs[i + 1];
5219 component[autoBindKey] = bindAutoBindMethod(component, method);
5220 }
5221}
5222
5223/**
5224 * Add more to the ReactClass base class. These are all legacy features and
5225 * therefore not already part of the modern ReactComponent.
5226 */
5227var ReactClassMixin = {
5228
5229 /**
5230 * TODO: This will be deprecated because state should always keep a consistent
5231 * type signature and the only use case for this, is to avoid that.
5232 */
5233 replaceState: function (newState, callback) {
5234 this.updater.enqueueReplaceState(this, newState);
5235 if (callback) {
5236 this.updater.enqueueCallback(this, callback, 'replaceState');
5237 }
5238 },
5239
5240 /**
5241 * Checks whether or not this composite component is mounted.
5242 * @return {boolean} True if mounted, false otherwise.
5243 * @protected
5244 * @final
5245 */
5246 isMounted: function () {
5247 return this.updater.isMounted(this);
5248 }
5249};
5250
5251var ReactClassComponent = function () {};
5252_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
5253
5254/**
5255 * Module for creating composite components.
5256 *
5257 * @class ReactClass
5258 */
5259var ReactClass = {
5260
5261 /**
5262 * Creates a composite component class given a class specification.
5263 * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
5264 *
5265 * @param {object} spec Class specification (which must define `render`).
5266 * @return {function} Component constructor function.
5267 * @public
5268 */
5269 createClass: function (spec) {
5270 var Constructor = function (props, context, updater) {
5271 // This constructor gets overridden by mocks. The argument is used
5272 // by mocks to assert on what gets mounted.
5273
5274 if ("development" !== 'production') {
5275 "development" !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0;
5276 }
5277
5278 // Wire up auto-binding
5279 if (this.__reactAutoBindPairs.length) {
5280 bindAutoBindMethods(this);
5281 }
5282
5283 this.props = props;
5284 this.context = context;
5285 this.refs = emptyObject;
5286 this.updater = updater || ReactNoopUpdateQueue;
5287
5288 this.state = null;
5289
5290 // ReactClasses doesn't have constructors. Instead, they use the
5291 // getInitialState and componentWillMount methods for initialization.
5292
5293 var initialState = this.getInitialState ? this.getInitialState() : null;
5294 if ("development" !== 'production') {
5295 // We allow auto-mocks to proceed as if they're returning null.
5296 if (initialState === undefined && this.getInitialState._isMockFunction) {
5297 // This is probably bad practice. Consider warning here and
5298 // deprecating this convenience.
5299 initialState = null;
5300 }
5301 }
5302 !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : _prodInvariant('82', Constructor.displayName || 'ReactCompositeComponent') : void 0;
5303
5304 this.state = initialState;
5305 };
5306 Constructor.prototype = new ReactClassComponent();
5307 Constructor.prototype.constructor = Constructor;
5308 Constructor.prototype.__reactAutoBindPairs = [];
5309
5310 injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
5311
5312 mixSpecIntoComponent(Constructor, spec);
5313
5314 // Initialize the defaultProps property after all mixins have been merged.
5315 if (Constructor.getDefaultProps) {
5316 Constructor.defaultProps = Constructor.getDefaultProps();
5317 }
5318
5319 if ("development" !== 'production') {
5320 // This is a tag to indicate that the use of these method names is ok,
5321 // since it's used with createClass. If it's not, then it's likely a
5322 // mistake so we'll warn you to use the static property, property
5323 // initializer or constructor respectively.
5324 if (Constructor.getDefaultProps) {
5325 Constructor.getDefaultProps.isReactClassApproved = {};
5326 }
5327 if (Constructor.prototype.getInitialState) {
5328 Constructor.prototype.getInitialState.isReactClassApproved = {};
5329 }
5330 }
5331
5332 !Constructor.prototype.render ? "development" !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0;
5333
5334 if ("development" !== 'production') {
5335 "development" !== 'production' ? 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') : void 0;
5336 "development" !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
5337 }
5338
5339 // Reduce time spent doing lookups by setting these on the prototype.
5340 for (var methodName in ReactClassInterface) {
5341 if (!Constructor.prototype[methodName]) {
5342 Constructor.prototype[methodName] = null;
5343 }
5344 }
5345
5346 return Constructor;
5347 },
5348
5349 injection: {
5350 injectMixin: function (mixin) {
5351 injectedMixins.push(mixin);
5352 }
5353 }
5354
5355};
5356
5357module.exports = ReactClass;
5358},{"140":140,"155":155,"162":162,"165":165,"166":166,"171":171,"172":172,"32":32,"61":61,"80":80,"82":82,"83":83}],32:[function(_dereq_,module,exports){
5359/**
5360 * Copyright 2013-present, Facebook, Inc.
5361 * All rights reserved.
5362 *
5363 * This source code is licensed under the BSD-style license found in the
5364 * LICENSE file in the root directory of this source tree. An additional grant
5365 * of patent rights can be found in the PATENTS file in the same directory.
5366 *
5367 * @providesModule ReactComponent
5368 */
5369
5370'use strict';
5371
5372var _prodInvariant = _dereq_(140);
5373
5374var ReactNoopUpdateQueue = _dereq_(80);
5375
5376var canDefineProperty = _dereq_(118);
5377var emptyObject = _dereq_(155);
5378var invariant = _dereq_(162);
5379var warning = _dereq_(171);
5380
5381/**
5382 * Base class helpers for the updating state of a component.
5383 */
5384function ReactComponent(props, context, updater) {
5385 this.props = props;
5386 this.context = context;
5387 this.refs = emptyObject;
5388 // We initialize the default updater but the real one gets injected by the
5389 // renderer.
5390 this.updater = updater || ReactNoopUpdateQueue;
5391}
5392
5393ReactComponent.prototype.isReactComponent = {};
5394
5395/**
5396 * Sets a subset of the state. Always use this to mutate
5397 * state. You should treat `this.state` as immutable.
5398 *
5399 * There is no guarantee that `this.state` will be immediately updated, so
5400 * accessing `this.state` after calling this method may return the old value.
5401 *
5402 * There is no guarantee that calls to `setState` will run synchronously,
5403 * as they may eventually be batched together. You can provide an optional
5404 * callback that will be executed when the call to setState is actually
5405 * completed.
5406 *
5407 * When a function is provided to setState, it will be called at some point in
5408 * the future (not synchronously). It will be called with the up to date
5409 * component arguments (state, props, context). These values can be different
5410 * from this.* because your function may be called after receiveProps but before
5411 * shouldComponentUpdate, and this new state, props, and context will not yet be
5412 * assigned to this.
5413 *
5414 * @param {object|function} partialState Next partial state or function to
5415 * produce next partial state to be merged with current state.
5416 * @param {?function} callback Called after state is updated.
5417 * @final
5418 * @protected
5419 */
5420ReactComponent.prototype.setState = function (partialState, callback) {
5421 !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0;
5422 this.updater.enqueueSetState(this, partialState);
5423 if (callback) {
5424 this.updater.enqueueCallback(this, callback, 'setState');
5425 }
5426};
5427
5428/**
5429 * Forces an update. This should only be invoked when it is known with
5430 * certainty that we are **not** in a DOM transaction.
5431 *
5432 * You may want to call this when you know that some deeper aspect of the
5433 * component's state has changed but `setState` was not called.
5434 *
5435 * This will not invoke `shouldComponentUpdate`, but it will invoke
5436 * `componentWillUpdate` and `componentDidUpdate`.
5437 *
5438 * @param {?function} callback Called after update is complete.
5439 * @final
5440 * @protected
5441 */
5442ReactComponent.prototype.forceUpdate = function (callback) {
5443 this.updater.enqueueForceUpdate(this);
5444 if (callback) {
5445 this.updater.enqueueCallback(this, callback, 'forceUpdate');
5446 }
5447};
5448
5449/**
5450 * Deprecated APIs. These APIs used to exist on classic React classes but since
5451 * we would like to deprecate them, we're not going to move them over to this
5452 * modern base class. Instead, we define a getter that warns if it's accessed.
5453 */
5454if ("development" !== 'production') {
5455 var deprecatedAPIs = {
5456 isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
5457 replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
5458 };
5459 var defineDeprecationWarning = function (methodName, info) {
5460 if (canDefineProperty) {
5461 Object.defineProperty(ReactComponent.prototype, methodName, {
5462 get: function () {
5463 "development" !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
5464 return undefined;
5465 }
5466 });
5467 }
5468 };
5469 for (var fnName in deprecatedAPIs) {
5470 if (deprecatedAPIs.hasOwnProperty(fnName)) {
5471 defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
5472 }
5473 }
5474}
5475
5476module.exports = ReactComponent;
5477},{"118":118,"140":140,"155":155,"162":162,"171":171,"80":80}],33:[function(_dereq_,module,exports){
5478/**
5479 * Copyright 2013-present, Facebook, Inc.
5480 * All rights reserved.
5481 *
5482 * This source code is licensed under the BSD-style license found in the
5483 * LICENSE file in the root directory of this source tree. An additional grant
5484 * of patent rights can be found in the PATENTS file in the same directory.
5485 *
5486 * @providesModule ReactComponentBrowserEnvironment
5487 */
5488
5489'use strict';
5490
5491var DOMChildrenOperations = _dereq_(7);
5492var ReactDOMIDOperations = _dereq_(47);
5493
5494/**
5495 * Abstracts away all functionality of the reconciler that requires knowledge of
5496 * the browser context. TODO: These callers should be refactored to avoid the
5497 * need for this injection.
5498 */
5499var ReactComponentBrowserEnvironment = {
5500
5501 processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
5502
5503 replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup
5504
5505};
5506
5507module.exports = ReactComponentBrowserEnvironment;
5508},{"47":47,"7":7}],34:[function(_dereq_,module,exports){
5509/**
5510 * Copyright 2014-present, Facebook, Inc.
5511 * All rights reserved.
5512 *
5513 * This source code is licensed under the BSD-style license found in the
5514 * LICENSE file in the root directory of this source tree. An additional grant
5515 * of patent rights can be found in the PATENTS file in the same directory.
5516 *
5517 * @providesModule ReactComponentEnvironment
5518 */
5519
5520'use strict';
5521
5522var _prodInvariant = _dereq_(140);
5523
5524var invariant = _dereq_(162);
5525
5526var injected = false;
5527
5528var ReactComponentEnvironment = {
5529
5530 /**
5531 * Optionally injectable hook for swapping out mount images in the middle of
5532 * the tree.
5533 */
5534 replaceNodeWithMarkup: null,
5535
5536 /**
5537 * Optionally injectable hook for processing a queue of child updates. Will
5538 * later move into MultiChildComponents.
5539 */
5540 processChildrenUpdates: null,
5541
5542 injection: {
5543 injectEnvironment: function (environment) {
5544 !!injected ? "development" !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0;
5545 ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
5546 ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
5547 injected = true;
5548 }
5549 }
5550
5551};
5552
5553module.exports = ReactComponentEnvironment;
5554},{"140":140,"162":162}],35:[function(_dereq_,module,exports){
5555/**
5556 * Copyright 2016-present, Facebook, Inc.
5557 * All rights reserved.
5558 *
5559 * This source code is licensed under the BSD-style license found in the
5560 * LICENSE file in the root directory of this source tree. An additional grant
5561 * of patent rights can be found in the PATENTS file in the same directory.
5562 *
5563 * @providesModule ReactComponentTreeHook
5564 */
5565
5566'use strict';
5567
5568var _prodInvariant = _dereq_(140);
5569
5570var ReactCurrentOwner = _dereq_(37);
5571
5572var invariant = _dereq_(162);
5573var warning = _dereq_(171);
5574
5575function isNative(fn) {
5576 // Based on isNative() from Lodash
5577 var funcToString = Function.prototype.toString;
5578 var hasOwnProperty = Object.prototype.hasOwnProperty;
5579 var reIsNative = RegExp('^' + funcToString
5580 // Take an example native function source for comparison
5581 .call(hasOwnProperty)
5582 // Strip regex characters so we can use it for regex
5583 .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
5584 // Remove hasOwnProperty from the template to make it generic
5585 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
5586 try {
5587 var source = funcToString.call(fn);
5588 return reIsNative.test(source);
5589 } catch (err) {
5590 return false;
5591 }
5592}
5593
5594var canUseCollections =
5595// Array.from
5596typeof Array.from === 'function' &&
5597// Map
5598typeof Map === 'function' && isNative(Map) &&
5599// Map.prototype.keys
5600Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
5601// Set
5602typeof Set === 'function' && isNative(Set) &&
5603// Set.prototype.keys
5604Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
5605
5606var itemMap;
5607var rootIDSet;
5608
5609var itemByKey;
5610var rootByKey;
5611
5612if (canUseCollections) {
5613 itemMap = new Map();
5614 rootIDSet = new Set();
5615} else {
5616 itemByKey = {};
5617 rootByKey = {};
5618}
5619
5620var unmountedIDs = [];
5621
5622// Use non-numeric keys to prevent V8 performance issues:
5623// https://github.com/facebook/react/pull/7232
5624function getKeyFromID(id) {
5625 return '.' + id;
5626}
5627function getIDFromKey(key) {
5628 return parseInt(key.substr(1), 10);
5629}
5630
5631function get(id) {
5632 if (canUseCollections) {
5633 return itemMap.get(id);
5634 } else {
5635 var key = getKeyFromID(id);
5636 return itemByKey[key];
5637 }
5638}
5639
5640function remove(id) {
5641 if (canUseCollections) {
5642 itemMap['delete'](id);
5643 } else {
5644 var key = getKeyFromID(id);
5645 delete itemByKey[key];
5646 }
5647}
5648
5649function create(id, element, parentID) {
5650 var item = {
5651 element: element,
5652 parentID: parentID,
5653 text: null,
5654 childIDs: [],
5655 isMounted: false,
5656 updateCount: 0
5657 };
5658
5659 if (canUseCollections) {
5660 itemMap.set(id, item);
5661 } else {
5662 var key = getKeyFromID(id);
5663 itemByKey[key] = item;
5664 }
5665}
5666
5667function addRoot(id) {
5668 if (canUseCollections) {
5669 rootIDSet.add(id);
5670 } else {
5671 var key = getKeyFromID(id);
5672 rootByKey[key] = true;
5673 }
5674}
5675
5676function removeRoot(id) {
5677 if (canUseCollections) {
5678 rootIDSet['delete'](id);
5679 } else {
5680 var key = getKeyFromID(id);
5681 delete rootByKey[key];
5682 }
5683}
5684
5685function getRegisteredIDs() {
5686 if (canUseCollections) {
5687 return Array.from(itemMap.keys());
5688 } else {
5689 return Object.keys(itemByKey).map(getIDFromKey);
5690 }
5691}
5692
5693function getRootIDs() {
5694 if (canUseCollections) {
5695 return Array.from(rootIDSet.keys());
5696 } else {
5697 return Object.keys(rootByKey).map(getIDFromKey);
5698 }
5699}
5700
5701function purgeDeep(id) {
5702 var item = get(id);
5703 if (item) {
5704 var childIDs = item.childIDs;
5705
5706 remove(id);
5707 childIDs.forEach(purgeDeep);
5708 }
5709}
5710
5711function describeComponentFrame(name, source, ownerName) {
5712 return '\n in ' + name + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
5713}
5714
5715function getDisplayName(element) {
5716 if (element == null) {
5717 return '#empty';
5718 } else if (typeof element === 'string' || typeof element === 'number') {
5719 return '#text';
5720 } else if (typeof element.type === 'string') {
5721 return element.type;
5722 } else {
5723 return element.type.displayName || element.type.name || 'Unknown';
5724 }
5725}
5726
5727function describeID(id) {
5728 var name = ReactComponentTreeHook.getDisplayName(id);
5729 var element = ReactComponentTreeHook.getElement(id);
5730 var ownerID = ReactComponentTreeHook.getOwnerID(id);
5731 var ownerName;
5732 if (ownerID) {
5733 ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
5734 }
5735 "development" !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
5736 return describeComponentFrame(name, element && element._source, ownerName);
5737}
5738
5739var ReactComponentTreeHook = {
5740 onSetChildren: function (id, nextChildIDs) {
5741 var item = get(id);
5742 item.childIDs = nextChildIDs;
5743
5744 for (var i = 0; i < nextChildIDs.length; i++) {
5745 var nextChildID = nextChildIDs[i];
5746 var nextChild = get(nextChildID);
5747 !nextChild ? "development" !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
5748 !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? "development" !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
5749 !nextChild.isMounted ? "development" !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
5750 if (nextChild.parentID == null) {
5751 nextChild.parentID = id;
5752 // TODO: This shouldn't be necessary but mounting a new root during in
5753 // componentWillMount currently causes not-yet-mounted components to
5754 // be purged from our tree data so their parent ID is missing.
5755 }
5756 !(nextChild.parentID === id) ? "development" !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
5757 }
5758 },
5759 onBeforeMountComponent: function (id, element, parentID) {
5760 create(id, element, parentID);
5761 },
5762 onBeforeUpdateComponent: function (id, element) {
5763 var item = get(id);
5764 if (!item || !item.isMounted) {
5765 // We may end up here as a result of setState() in componentWillUnmount().
5766 // In this case, ignore the element.
5767 return;
5768 }
5769 item.element = element;
5770 },
5771 onMountComponent: function (id) {
5772 var item = get(id);
5773 item.isMounted = true;
5774 var isRoot = item.parentID === 0;
5775 if (isRoot) {
5776 addRoot(id);
5777 }
5778 },
5779 onUpdateComponent: function (id) {
5780 var item = get(id);
5781 if (!item || !item.isMounted) {
5782 // We may end up here as a result of setState() in componentWillUnmount().
5783 // In this case, ignore the element.
5784 return;
5785 }
5786 item.updateCount++;
5787 },
5788 onUnmountComponent: function (id) {
5789 var item = get(id);
5790 if (item) {
5791 // We need to check if it exists.
5792 // `item` might not exist if it is inside an error boundary, and a sibling
5793 // error boundary child threw while mounting. Then this instance never
5794 // got a chance to mount, but it still gets an unmounting event during
5795 // the error boundary cleanup.
5796 item.isMounted = false;
5797 var isRoot = item.parentID === 0;
5798 if (isRoot) {
5799 removeRoot(id);
5800 }
5801 }
5802 unmountedIDs.push(id);
5803 },
5804 purgeUnmountedComponents: function () {
5805 if (ReactComponentTreeHook._preventPurging) {
5806 // Should only be used for testing.
5807 return;
5808 }
5809
5810 for (var i = 0; i < unmountedIDs.length; i++) {
5811 var id = unmountedIDs[i];
5812 purgeDeep(id);
5813 }
5814 unmountedIDs.length = 0;
5815 },
5816 isMounted: function (id) {
5817 var item = get(id);
5818 return item ? item.isMounted : false;
5819 },
5820 getCurrentStackAddendum: function (topElement) {
5821 var info = '';
5822 if (topElement) {
5823 var type = topElement.type;
5824 var name = typeof type === 'function' ? type.displayName || type.name : type;
5825 var owner = topElement._owner;
5826 info += describeComponentFrame(name || 'Unknown', topElement._source, owner && owner.getName());
5827 }
5828
5829 var currentOwner = ReactCurrentOwner.current;
5830 var id = currentOwner && currentOwner._debugID;
5831
5832 info += ReactComponentTreeHook.getStackAddendumByID(id);
5833 return info;
5834 },
5835 getStackAddendumByID: function (id) {
5836 var info = '';
5837 while (id) {
5838 info += describeID(id);
5839 id = ReactComponentTreeHook.getParentID(id);
5840 }
5841 return info;
5842 },
5843 getChildIDs: function (id) {
5844 var item = get(id);
5845 return item ? item.childIDs : [];
5846 },
5847 getDisplayName: function (id) {
5848 var element = ReactComponentTreeHook.getElement(id);
5849 if (!element) {
5850 return null;
5851 }
5852 return getDisplayName(element);
5853 },
5854 getElement: function (id) {
5855 var item = get(id);
5856 return item ? item.element : null;
5857 },
5858 getOwnerID: function (id) {
5859 var element = ReactComponentTreeHook.getElement(id);
5860 if (!element || !element._owner) {
5861 return null;
5862 }
5863 return element._owner._debugID;
5864 },
5865 getParentID: function (id) {
5866 var item = get(id);
5867 return item ? item.parentID : null;
5868 },
5869 getSource: function (id) {
5870 var item = get(id);
5871 var element = item ? item.element : null;
5872 var source = element != null ? element._source : null;
5873 return source;
5874 },
5875 getText: function (id) {
5876 var element = ReactComponentTreeHook.getElement(id);
5877 if (typeof element === 'string') {
5878 return element;
5879 } else if (typeof element === 'number') {
5880 return '' + element;
5881 } else {
5882 return null;
5883 }
5884 },
5885 getUpdateCount: function (id) {
5886 var item = get(id);
5887 return item ? item.updateCount : 0;
5888 },
5889
5890
5891 getRegisteredIDs: getRegisteredIDs,
5892
5893 getRootIDs: getRootIDs
5894};
5895
5896module.exports = ReactComponentTreeHook;
5897},{"140":140,"162":162,"171":171,"37":37}],36:[function(_dereq_,module,exports){
5898/**
5899 * Copyright 2013-present, Facebook, Inc.
5900 * All rights reserved.
5901 *
5902 * This source code is licensed under the BSD-style license found in the
5903 * LICENSE file in the root directory of this source tree. An additional grant
5904 * of patent rights can be found in the PATENTS file in the same directory.
5905 *
5906 * @providesModule ReactCompositeComponent
5907 */
5908
5909'use strict';
5910
5911var _prodInvariant = _dereq_(140),
5912 _assign = _dereq_(172);
5913
5914var ReactComponentEnvironment = _dereq_(34);
5915var ReactCurrentOwner = _dereq_(37);
5916var ReactElement = _dereq_(61);
5917var ReactErrorUtils = _dereq_(64);
5918var ReactInstanceMap = _dereq_(72);
5919var ReactInstrumentation = _dereq_(73);
5920var ReactNodeTypes = _dereq_(79);
5921var ReactPropTypeLocations = _dereq_(83);
5922var ReactReconciler = _dereq_(88);
5923
5924var checkReactTypeSpec = _dereq_(119);
5925var emptyObject = _dereq_(155);
5926var invariant = _dereq_(162);
5927var shallowEqual = _dereq_(170);
5928var shouldUpdateReactComponent = _dereq_(144);
5929var warning = _dereq_(171);
5930
5931var CompositeTypes = {
5932 ImpureClass: 0,
5933 PureClass: 1,
5934 StatelessFunctional: 2
5935};
5936
5937function StatelessComponent(Component) {}
5938StatelessComponent.prototype.render = function () {
5939 var Component = ReactInstanceMap.get(this)._currentElement.type;
5940 var element = Component(this.props, this.context, this.updater);
5941 warnIfInvalidElement(Component, element);
5942 return element;
5943};
5944
5945function warnIfInvalidElement(Component, element) {
5946 if ("development" !== 'production') {
5947 "development" !== 'production' ? warning(element === null || element === false || ReactElement.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0;
5948 "development" !== 'production' ? warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component') : void 0;
5949 }
5950}
5951
5952function shouldConstruct(Component) {
5953 return !!(Component.prototype && Component.prototype.isReactComponent);
5954}
5955
5956function isPureComponent(Component) {
5957 return !!(Component.prototype && Component.prototype.isPureReactComponent);
5958}
5959
5960// Separated into a function to contain deoptimizations caused by try/finally.
5961function measureLifeCyclePerf(fn, debugID, timerType) {
5962 if (debugID === 0) {
5963 // Top-level wrappers (see ReactMount) and empty components (see
5964 // ReactDOMEmptyComponent) are invisible to hooks and devtools.
5965 // Both are implementation details that should go away in the future.
5966 return fn();
5967 }
5968
5969 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType);
5970 try {
5971 return fn();
5972 } finally {
5973 ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType);
5974 }
5975}
5976
5977/**
5978 * ------------------ The Life-Cycle of a Composite Component ------------------
5979 *
5980 * - constructor: Initialization of state. The instance is now retained.
5981 * - componentWillMount
5982 * - render
5983 * - [children's constructors]
5984 * - [children's componentWillMount and render]
5985 * - [children's componentDidMount]
5986 * - componentDidMount
5987 *
5988 * Update Phases:
5989 * - componentWillReceiveProps (only called if parent updated)
5990 * - shouldComponentUpdate
5991 * - componentWillUpdate
5992 * - render
5993 * - [children's constructors or receive props phases]
5994 * - componentDidUpdate
5995 *
5996 * - componentWillUnmount
5997 * - [children's componentWillUnmount]
5998 * - [children destroyed]
5999 * - (destroyed): The instance is now blank, released by React and ready for GC.
6000 *
6001 * -----------------------------------------------------------------------------
6002 */
6003
6004/**
6005 * An incrementing ID assigned to each component when it is mounted. This is
6006 * used to enforce the order in which `ReactUpdates` updates dirty components.
6007 *
6008 * @private
6009 */
6010var nextMountID = 1;
6011
6012/**
6013 * @lends {ReactCompositeComponent.prototype}
6014 */
6015var ReactCompositeComponentMixin = {
6016
6017 /**
6018 * Base constructor for all composite component.
6019 *
6020 * @param {ReactElement} element
6021 * @final
6022 * @internal
6023 */
6024 construct: function (element) {
6025 this._currentElement = element;
6026 this._rootNodeID = 0;
6027 this._compositeType = null;
6028 this._instance = null;
6029 this._hostParent = null;
6030 this._hostContainerInfo = null;
6031
6032 // See ReactUpdateQueue
6033 this._updateBatchNumber = null;
6034 this._pendingElement = null;
6035 this._pendingStateQueue = null;
6036 this._pendingReplaceState = false;
6037 this._pendingForceUpdate = false;
6038
6039 this._renderedNodeType = null;
6040 this._renderedComponent = null;
6041 this._context = null;
6042 this._mountOrder = 0;
6043 this._topLevelWrapper = null;
6044
6045 // See ReactUpdates and ReactUpdateQueue.
6046 this._pendingCallbacks = null;
6047
6048 // ComponentWillUnmount shall only be called once
6049 this._calledComponentWillUnmount = false;
6050
6051 if ("development" !== 'production') {
6052 this._warnedAboutRefsInRender = false;
6053 }
6054 },
6055
6056 /**
6057 * Initializes the component, renders markup, and registers event listeners.
6058 *
6059 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
6060 * @param {?object} hostParent
6061 * @param {?object} hostContainerInfo
6062 * @param {?object} context
6063 * @return {?string} Rendered markup to be inserted into the DOM.
6064 * @final
6065 * @internal
6066 */
6067 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
6068 var _this = this;
6069
6070 this._context = context;
6071 this._mountOrder = nextMountID++;
6072 this._hostParent = hostParent;
6073 this._hostContainerInfo = hostContainerInfo;
6074
6075 var publicProps = this._currentElement.props;
6076 var publicContext = this._processContext(context);
6077
6078 var Component = this._currentElement.type;
6079
6080 var updateQueue = transaction.getUpdateQueue();
6081
6082 // Initialize the public class
6083 var doConstruct = shouldConstruct(Component);
6084 var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue);
6085 var renderedElement;
6086
6087 // Support functional components
6088 if (!doConstruct && (inst == null || inst.render == null)) {
6089 renderedElement = inst;
6090 warnIfInvalidElement(Component, renderedElement);
6091 !(inst === null || inst === false || ReactElement.isValidElement(inst)) ? "development" !== 'production' ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : _prodInvariant('105', Component.displayName || Component.name || 'Component') : void 0;
6092 inst = new StatelessComponent(Component);
6093 this._compositeType = CompositeTypes.StatelessFunctional;
6094 } else {
6095 if (isPureComponent(Component)) {
6096 this._compositeType = CompositeTypes.PureClass;
6097 } else {
6098 this._compositeType = CompositeTypes.ImpureClass;
6099 }
6100 }
6101
6102 if ("development" !== 'production') {
6103 // This will throw later in _renderValidatedComponent, but add an early
6104 // warning now to help debugging
6105 if (inst.render == null) {
6106 "development" !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0;
6107 }
6108
6109 var propsMutated = inst.props !== publicProps;
6110 var componentName = Component.displayName || Component.name || 'Component';
6111
6112 "development" !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\'s constructor was passed.', componentName, componentName) : void 0;
6113 }
6114
6115 // These should be set up in the constructor, but as a convenience for
6116 // simpler class abstractions, we set them up after the fact.
6117 inst.props = publicProps;
6118 inst.context = publicContext;
6119 inst.refs = emptyObject;
6120 inst.updater = updateQueue;
6121
6122 this._instance = inst;
6123
6124 // Store a reference from the instance back to the internal representation
6125 ReactInstanceMap.set(inst, this);
6126
6127 if ("development" !== 'production') {
6128 // Since plain JS classes are defined without any special initialization
6129 // logic, we can not catch common errors early. Therefore, we have to
6130 // catch them here, at initialization time, instead.
6131 "development" !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
6132 "development" !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
6133 "development" !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
6134 "development" !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
6135 "development" !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%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.', this.getName() || 'A component') : void 0;
6136 "development" !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : void 0;
6137 "development" !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;
6138 }
6139
6140 var initialState = inst.state;
6141 if (initialState === undefined) {
6142 inst.state = initialState = null;
6143 }
6144 !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : _prodInvariant('106', this.getName() || 'ReactCompositeComponent') : void 0;
6145
6146 this._pendingStateQueue = null;
6147 this._pendingReplaceState = false;
6148 this._pendingForceUpdate = false;
6149
6150 var markup;
6151 if (inst.unstable_handleError) {
6152 markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context);
6153 } else {
6154 markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
6155 }
6156
6157 if (inst.componentDidMount) {
6158 if ("development" !== 'production') {
6159 transaction.getReactMountReady().enqueue(function () {
6160 measureLifeCyclePerf(function () {
6161 return inst.componentDidMount();
6162 }, _this._debugID, 'componentDidMount');
6163 });
6164 } else {
6165 transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
6166 }
6167 }
6168
6169 return markup;
6170 },
6171
6172 _constructComponent: function (doConstruct, publicProps, publicContext, updateQueue) {
6173 if ("development" !== 'production') {
6174 ReactCurrentOwner.current = this;
6175 try {
6176 return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
6177 } finally {
6178 ReactCurrentOwner.current = null;
6179 }
6180 } else {
6181 return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
6182 }
6183 },
6184
6185 _constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) {
6186 var Component = this._currentElement.type;
6187
6188 if (doConstruct) {
6189 if ("development" !== 'production') {
6190 return measureLifeCyclePerf(function () {
6191 return new Component(publicProps, publicContext, updateQueue);
6192 }, this._debugID, 'ctor');
6193 } else {
6194 return new Component(publicProps, publicContext, updateQueue);
6195 }
6196 }
6197
6198 // This can still be an instance in case of factory components
6199 // but we'll count this as time spent rendering as the more common case.
6200 if ("development" !== 'production') {
6201 return measureLifeCyclePerf(function () {
6202 return Component(publicProps, publicContext, updateQueue);
6203 }, this._debugID, 'render');
6204 } else {
6205 return Component(publicProps, publicContext, updateQueue);
6206 }
6207 },
6208
6209 performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
6210 var markup;
6211 var checkpoint = transaction.checkpoint();
6212 try {
6213 markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
6214 } catch (e) {
6215 // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
6216 transaction.rollback(checkpoint);
6217 this._instance.unstable_handleError(e);
6218 if (this._pendingStateQueue) {
6219 this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
6220 }
6221 checkpoint = transaction.checkpoint();
6222
6223 this._renderedComponent.unmountComponent(true);
6224 transaction.rollback(checkpoint);
6225
6226 // Try again - we've informed the component about the error, so they can render an error message this time.
6227 // If this throws again, the error will bubble up (and can be caught by a higher error boundary).
6228 markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
6229 }
6230 return markup;
6231 },
6232
6233 performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
6234 var inst = this._instance;
6235
6236 var debugID = 0;
6237 if ("development" !== 'production') {
6238 debugID = this._debugID;
6239 }
6240
6241 if (inst.componentWillMount) {
6242 if ("development" !== 'production') {
6243 measureLifeCyclePerf(function () {
6244 return inst.componentWillMount();
6245 }, debugID, 'componentWillMount');
6246 } else {
6247 inst.componentWillMount();
6248 }
6249 // When mounting, calls to `setState` by `componentWillMount` will set
6250 // `this._pendingStateQueue` without triggering a re-render.
6251 if (this._pendingStateQueue) {
6252 inst.state = this._processPendingState(inst.props, inst.context);
6253 }
6254 }
6255
6256 // If not a stateless component, we now render
6257 if (renderedElement === undefined) {
6258 renderedElement = this._renderValidatedComponent();
6259 }
6260
6261 var nodeType = ReactNodeTypes.getType(renderedElement);
6262 this._renderedNodeType = nodeType;
6263 var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
6264 );
6265 this._renderedComponent = child;
6266
6267 var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID);
6268
6269 if ("development" !== 'production') {
6270 if (debugID !== 0) {
6271 var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
6272 ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
6273 }
6274 }
6275
6276 return markup;
6277 },
6278
6279 getHostNode: function () {
6280 return ReactReconciler.getHostNode(this._renderedComponent);
6281 },
6282
6283 /**
6284 * Releases any resources allocated by `mountComponent`.
6285 *
6286 * @final
6287 * @internal
6288 */
6289 unmountComponent: function (safely) {
6290 if (!this._renderedComponent) {
6291 return;
6292 }
6293
6294 var inst = this._instance;
6295
6296 if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
6297 inst._calledComponentWillUnmount = true;
6298
6299 if (safely) {
6300 var name = this.getName() + '.componentWillUnmount()';
6301 ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
6302 } else {
6303 if ("development" !== 'production') {
6304 measureLifeCyclePerf(function () {
6305 return inst.componentWillUnmount();
6306 }, this._debugID, 'componentWillUnmount');
6307 } else {
6308 inst.componentWillUnmount();
6309 }
6310 }
6311 }
6312
6313 if (this._renderedComponent) {
6314 ReactReconciler.unmountComponent(this._renderedComponent, safely);
6315 this._renderedNodeType = null;
6316 this._renderedComponent = null;
6317 this._instance = null;
6318 }
6319
6320 // Reset pending fields
6321 // Even if this component is scheduled for another update in ReactUpdates,
6322 // it would still be ignored because these fields are reset.
6323 this._pendingStateQueue = null;
6324 this._pendingReplaceState = false;
6325 this._pendingForceUpdate = false;
6326 this._pendingCallbacks = null;
6327 this._pendingElement = null;
6328
6329 // These fields do not really need to be reset since this object is no
6330 // longer accessible.
6331 this._context = null;
6332 this._rootNodeID = 0;
6333 this._topLevelWrapper = null;
6334
6335 // Delete the reference from the instance to this internal representation
6336 // which allow the internals to be properly cleaned up even if the user
6337 // leaks a reference to the public instance.
6338 ReactInstanceMap.remove(inst);
6339
6340 // Some existing components rely on inst.props even after they've been
6341 // destroyed (in event handlers).
6342 // TODO: inst.props = null;
6343 // TODO: inst.state = null;
6344 // TODO: inst.context = null;
6345 },
6346
6347 /**
6348 * Filters the context object to only contain keys specified in
6349 * `contextTypes`
6350 *
6351 * @param {object} context
6352 * @return {?object}
6353 * @private
6354 */
6355 _maskContext: function (context) {
6356 var Component = this._currentElement.type;
6357 var contextTypes = Component.contextTypes;
6358 if (!contextTypes) {
6359 return emptyObject;
6360 }
6361 var maskedContext = {};
6362 for (var contextName in contextTypes) {
6363 maskedContext[contextName] = context[contextName];
6364 }
6365 return maskedContext;
6366 },
6367
6368 /**
6369 * Filters the context object to only contain keys specified in
6370 * `contextTypes`, and asserts that they are valid.
6371 *
6372 * @param {object} context
6373 * @return {?object}
6374 * @private
6375 */
6376 _processContext: function (context) {
6377 var maskedContext = this._maskContext(context);
6378 if ("development" !== 'production') {
6379 var Component = this._currentElement.type;
6380 if (Component.contextTypes) {
6381 this._checkContextTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
6382 }
6383 }
6384 return maskedContext;
6385 },
6386
6387 /**
6388 * @param {object} currentContext
6389 * @return {object}
6390 * @private
6391 */
6392 _processChildContext: function (currentContext) {
6393 var Component = this._currentElement.type;
6394 var inst = this._instance;
6395 var childContext;
6396
6397 if (inst.getChildContext) {
6398 if ("development" !== 'production') {
6399 ReactInstrumentation.debugTool.onBeginProcessingChildContext();
6400 try {
6401 childContext = inst.getChildContext();
6402 } finally {
6403 ReactInstrumentation.debugTool.onEndProcessingChildContext();
6404 }
6405 } else {
6406 childContext = inst.getChildContext();
6407 }
6408 }
6409
6410 if (childContext) {
6411 !(typeof Component.childContextTypes === 'object') ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0;
6412 if ("development" !== 'production') {
6413 this._checkContextTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
6414 }
6415 for (var name in childContext) {
6416 !(name in Component.childContextTypes) ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : _prodInvariant('108', this.getName() || 'ReactCompositeComponent', name) : void 0;
6417 }
6418 return _assign({}, currentContext, childContext);
6419 }
6420 return currentContext;
6421 },
6422
6423 /**
6424 * Assert that the context types are valid
6425 *
6426 * @param {object} typeSpecs Map of context field to a ReactPropType
6427 * @param {object} values Runtime values that need to be type-checked
6428 * @param {string} location e.g. "prop", "context", "child context"
6429 * @private
6430 */
6431 _checkContextTypes: function (typeSpecs, values, location) {
6432 checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
6433 },
6434
6435 receiveComponent: function (nextElement, transaction, nextContext) {
6436 var prevElement = this._currentElement;
6437 var prevContext = this._context;
6438
6439 this._pendingElement = null;
6440
6441 this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
6442 },
6443
6444 /**
6445 * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
6446 * is set, update the component.
6447 *
6448 * @param {ReactReconcileTransaction} transaction
6449 * @internal
6450 */
6451 performUpdateIfNecessary: function (transaction) {
6452 if (this._pendingElement != null) {
6453 ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
6454 } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
6455 this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
6456 } else {
6457 this._updateBatchNumber = null;
6458 }
6459 },
6460
6461 /**
6462 * Perform an update to a mounted component. The componentWillReceiveProps and
6463 * shouldComponentUpdate methods are called, then (assuming the update isn't
6464 * skipped) the remaining update lifecycle methods are called and the DOM
6465 * representation is updated.
6466 *
6467 * By default, this implements React's rendering and reconciliation algorithm.
6468 * Sophisticated clients may wish to override this.
6469 *
6470 * @param {ReactReconcileTransaction} transaction
6471 * @param {ReactElement} prevParentElement
6472 * @param {ReactElement} nextParentElement
6473 * @internal
6474 * @overridable
6475 */
6476 updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
6477 var inst = this._instance;
6478 !(inst != null) ? "development" !== 'production' ? invariant(false, 'Attempted to update component `%s` that has already been unmounted (or failed to mount).', this.getName() || 'ReactCompositeComponent') : _prodInvariant('136', this.getName() || 'ReactCompositeComponent') : void 0;
6479
6480 var willReceive = false;
6481 var nextContext;
6482
6483 // Determine if the context has changed or not
6484 if (this._context === nextUnmaskedContext) {
6485 nextContext = inst.context;
6486 } else {
6487 nextContext = this._processContext(nextUnmaskedContext);
6488 willReceive = true;
6489 }
6490
6491 var prevProps = prevParentElement.props;
6492 var nextProps = nextParentElement.props;
6493
6494 // Not a simple state update but a props update
6495 if (prevParentElement !== nextParentElement) {
6496 willReceive = true;
6497 }
6498
6499 // An update here will schedule an update but immediately set
6500 // _pendingStateQueue which will ensure that any state updates gets
6501 // immediately reconciled instead of waiting for the next batch.
6502 if (willReceive && inst.componentWillReceiveProps) {
6503 if ("development" !== 'production') {
6504 measureLifeCyclePerf(function () {
6505 return inst.componentWillReceiveProps(nextProps, nextContext);
6506 }, this._debugID, 'componentWillReceiveProps');
6507 } else {
6508 inst.componentWillReceiveProps(nextProps, nextContext);
6509 }
6510 }
6511
6512 var nextState = this._processPendingState(nextProps, nextContext);
6513 var shouldUpdate = true;
6514
6515 if (!this._pendingForceUpdate) {
6516 if (inst.shouldComponentUpdate) {
6517 if ("development" !== 'production') {
6518 shouldUpdate = measureLifeCyclePerf(function () {
6519 return inst.shouldComponentUpdate(nextProps, nextState, nextContext);
6520 }, this._debugID, 'shouldComponentUpdate');
6521 } else {
6522 shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
6523 }
6524 } else {
6525 if (this._compositeType === CompositeTypes.PureClass) {
6526 shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState);
6527 }
6528 }
6529 }
6530
6531 if ("development" !== 'production') {
6532 "development" !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0;
6533 }
6534
6535 this._updateBatchNumber = null;
6536 if (shouldUpdate) {
6537 this._pendingForceUpdate = false;
6538 // Will set `this.props`, `this.state` and `this.context`.
6539 this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
6540 } else {
6541 // If it's determined that a component should not update, we still want
6542 // to set props and state but we shortcut the rest of the update.
6543 this._currentElement = nextParentElement;
6544 this._context = nextUnmaskedContext;
6545 inst.props = nextProps;
6546 inst.state = nextState;
6547 inst.context = nextContext;
6548 }
6549 },
6550
6551 _processPendingState: function (props, context) {
6552 var inst = this._instance;
6553 var queue = this._pendingStateQueue;
6554 var replace = this._pendingReplaceState;
6555 this._pendingReplaceState = false;
6556 this._pendingStateQueue = null;
6557
6558 if (!queue) {
6559 return inst.state;
6560 }
6561
6562 if (replace && queue.length === 1) {
6563 return queue[0];
6564 }
6565
6566 var nextState = _assign({}, replace ? queue[0] : inst.state);
6567 for (var i = replace ? 1 : 0; i < queue.length; i++) {
6568 var partial = queue[i];
6569 _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
6570 }
6571
6572 return nextState;
6573 },
6574
6575 /**
6576 * Merges new props and state, notifies delegate methods of update and
6577 * performs update.
6578 *
6579 * @param {ReactElement} nextElement Next element
6580 * @param {object} nextProps Next public object to set as properties.
6581 * @param {?object} nextState Next object to set as state.
6582 * @param {?object} nextContext Next public object to set as context.
6583 * @param {ReactReconcileTransaction} transaction
6584 * @param {?object} unmaskedContext
6585 * @private
6586 */
6587 _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
6588 var _this2 = this;
6589
6590 var inst = this._instance;
6591
6592 var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
6593 var prevProps;
6594 var prevState;
6595 var prevContext;
6596 if (hasComponentDidUpdate) {
6597 prevProps = inst.props;
6598 prevState = inst.state;
6599 prevContext = inst.context;
6600 }
6601
6602 if (inst.componentWillUpdate) {
6603 if ("development" !== 'production') {
6604 measureLifeCyclePerf(function () {
6605 return inst.componentWillUpdate(nextProps, nextState, nextContext);
6606 }, this._debugID, 'componentWillUpdate');
6607 } else {
6608 inst.componentWillUpdate(nextProps, nextState, nextContext);
6609 }
6610 }
6611
6612 this._currentElement = nextElement;
6613 this._context = unmaskedContext;
6614 inst.props = nextProps;
6615 inst.state = nextState;
6616 inst.context = nextContext;
6617
6618 this._updateRenderedComponent(transaction, unmaskedContext);
6619
6620 if (hasComponentDidUpdate) {
6621 if ("development" !== 'production') {
6622 transaction.getReactMountReady().enqueue(function () {
6623 measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate');
6624 });
6625 } else {
6626 transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
6627 }
6628 }
6629 },
6630
6631 /**
6632 * Call the component's `render` method and update the DOM accordingly.
6633 *
6634 * @param {ReactReconcileTransaction} transaction
6635 * @internal
6636 */
6637 _updateRenderedComponent: function (transaction, context) {
6638 var prevComponentInstance = this._renderedComponent;
6639 var prevRenderedElement = prevComponentInstance._currentElement;
6640 var nextRenderedElement = this._renderValidatedComponent();
6641
6642 var debugID = 0;
6643 if ("development" !== 'production') {
6644 debugID = this._debugID;
6645 }
6646
6647 if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
6648 ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
6649 } else {
6650 var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance);
6651 ReactReconciler.unmountComponent(prevComponentInstance, false);
6652
6653 var nodeType = ReactNodeTypes.getType(nextRenderedElement);
6654 this._renderedNodeType = nodeType;
6655 var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
6656 );
6657 this._renderedComponent = child;
6658
6659 var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID);
6660
6661 if ("development" !== 'production') {
6662 if (debugID !== 0) {
6663 var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
6664 ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
6665 }
6666 }
6667
6668 this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance);
6669 }
6670 },
6671
6672 /**
6673 * Overridden in shallow rendering.
6674 *
6675 * @protected
6676 */
6677 _replaceNodeWithMarkup: function (oldHostNode, nextMarkup, prevInstance) {
6678 ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance);
6679 },
6680
6681 /**
6682 * @protected
6683 */
6684 _renderValidatedComponentWithoutOwnerOrContext: function () {
6685 var inst = this._instance;
6686 var renderedComponent;
6687
6688 if ("development" !== 'production') {
6689 renderedComponent = measureLifeCyclePerf(function () {
6690 return inst.render();
6691 }, this._debugID, 'render');
6692 } else {
6693 renderedComponent = inst.render();
6694 }
6695
6696 if ("development" !== 'production') {
6697 // We allow auto-mocks to proceed as if they're returning null.
6698 if (renderedComponent === undefined && inst.render._isMockFunction) {
6699 // This is probably bad practice. Consider warning here and
6700 // deprecating this convenience.
6701 renderedComponent = null;
6702 }
6703 }
6704
6705 return renderedComponent;
6706 },
6707
6708 /**
6709 * @private
6710 */
6711 _renderValidatedComponent: function () {
6712 var renderedComponent;
6713 if ("development" !== 'production' || this._compositeType !== CompositeTypes.StatelessFunctional) {
6714 ReactCurrentOwner.current = this;
6715 try {
6716 renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
6717 } finally {
6718 ReactCurrentOwner.current = null;
6719 }
6720 } else {
6721 renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
6722 }
6723 !(
6724 // TODO: An `isValidNode` function would probably be more appropriate
6725 renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? "development" !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : _prodInvariant('109', this.getName() || 'ReactCompositeComponent') : void 0;
6726
6727 return renderedComponent;
6728 },
6729
6730 /**
6731 * Lazily allocates the refs object and stores `component` as `ref`.
6732 *
6733 * @param {string} ref Reference name.
6734 * @param {component} component Component to store as `ref`.
6735 * @final
6736 * @private
6737 */
6738 attachRef: function (ref, component) {
6739 var inst = this.getPublicInstance();
6740 !(inst != null) ? "development" !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0;
6741 var publicComponentInstance = component.getPublicInstance();
6742 if ("development" !== 'production') {
6743 var componentName = component && component.getName ? component.getName() : 'a component';
6744 "development" !== 'production' ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;
6745 }
6746 var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
6747 refs[ref] = publicComponentInstance;
6748 },
6749
6750 /**
6751 * Detaches a reference name.
6752 *
6753 * @param {string} ref Name to dereference.
6754 * @final
6755 * @private
6756 */
6757 detachRef: function (ref) {
6758 var refs = this.getPublicInstance().refs;
6759 delete refs[ref];
6760 },
6761
6762 /**
6763 * Get a text description of the component that can be used to identify it
6764 * in error messages.
6765 * @return {string} The name or null.
6766 * @internal
6767 */
6768 getName: function () {
6769 var type = this._currentElement.type;
6770 var constructor = this._instance && this._instance.constructor;
6771 return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
6772 },
6773
6774 /**
6775 * Get the publicly accessible representation of this component - i.e. what
6776 * is exposed by refs and returned by render. Can be null for stateless
6777 * components.
6778 *
6779 * @return {ReactComponent} the public component instance.
6780 * @internal
6781 */
6782 getPublicInstance: function () {
6783 var inst = this._instance;
6784 if (this._compositeType === CompositeTypes.StatelessFunctional) {
6785 return null;
6786 }
6787 return inst;
6788 },
6789
6790 // Stub
6791 _instantiateReactComponent: null
6792
6793};
6794
6795var ReactCompositeComponent = {
6796
6797 Mixin: ReactCompositeComponentMixin
6798
6799};
6800
6801module.exports = ReactCompositeComponent;
6802},{"119":119,"140":140,"144":144,"155":155,"162":162,"170":170,"171":171,"172":172,"34":34,"37":37,"61":61,"64":64,"72":72,"73":73,"79":79,"83":83,"88":88}],37:[function(_dereq_,module,exports){
6803/**
6804 * Copyright 2013-present, Facebook, Inc.
6805 * All rights reserved.
6806 *
6807 * This source code is licensed under the BSD-style license found in the
6808 * LICENSE file in the root directory of this source tree. An additional grant
6809 * of patent rights can be found in the PATENTS file in the same directory.
6810 *
6811 * @providesModule ReactCurrentOwner
6812 */
6813
6814'use strict';
6815
6816/**
6817 * Keeps track of the current owner.
6818 *
6819 * The current owner is the component who should own any components that are
6820 * currently being constructed.
6821 */
6822
6823var ReactCurrentOwner = {
6824
6825 /**
6826 * @internal
6827 * @type {ReactComponent}
6828 */
6829 current: null
6830
6831};
6832
6833module.exports = ReactCurrentOwner;
6834},{}],38:[function(_dereq_,module,exports){
6835/**
6836 * Copyright 2013-present, Facebook, Inc.
6837 * All rights reserved.
6838 *
6839 * This source code is licensed under the BSD-style license found in the
6840 * LICENSE file in the root directory of this source tree. An additional grant
6841 * of patent rights can be found in the PATENTS file in the same directory.
6842 *
6843 * @providesModule ReactDOM
6844 */
6845
6846/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
6847
6848'use strict';
6849
6850var ReactDOMComponentTree = _dereq_(42);
6851var ReactDefaultInjection = _dereq_(60);
6852var ReactMount = _dereq_(76);
6853var ReactReconciler = _dereq_(88);
6854var ReactUpdates = _dereq_(96);
6855var ReactVersion = _dereq_(97);
6856
6857var findDOMNode = _dereq_(123);
6858var getHostComponentFromComposite = _dereq_(130);
6859var renderSubtreeIntoContainer = _dereq_(141);
6860var warning = _dereq_(171);
6861
6862ReactDefaultInjection.inject();
6863
6864var ReactDOM = {
6865 findDOMNode: findDOMNode,
6866 render: ReactMount.render,
6867 unmountComponentAtNode: ReactMount.unmountComponentAtNode,
6868 version: ReactVersion,
6869
6870 /* eslint-disable camelcase */
6871 unstable_batchedUpdates: ReactUpdates.batchedUpdates,
6872 unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
6873};
6874
6875// Inject the runtime into a devtools global hook regardless of browser.
6876// Allows for debugging when the hook is injected on the page.
6877/* eslint-enable camelcase */
6878if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
6879 __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
6880 ComponentTree: {
6881 getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
6882 getNodeFromInstance: function (inst) {
6883 // inst is an internal instance (but could be a composite)
6884 if (inst._renderedComponent) {
6885 inst = getHostComponentFromComposite(inst);
6886 }
6887 if (inst) {
6888 return ReactDOMComponentTree.getNodeFromInstance(inst);
6889 } else {
6890 return null;
6891 }
6892 }
6893 },
6894 Mount: ReactMount,
6895 Reconciler: ReactReconciler
6896 });
6897}
6898
6899if ("development" !== 'production') {
6900 var ExecutionEnvironment = _dereq_(148);
6901 if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
6902
6903 // First check if devtools is not installed
6904 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
6905 // If we're in Chrome or Firefox, provide a download link if not installed.
6906 if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
6907 // Firefox does not have the issue with devtools loaded over file://
6908 var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
6909 console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');
6910 }
6911 }
6912
6913 var testFunc = function testFn() {};
6914 "development" !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;
6915
6916 // If we're in IE8, check to see if we are in compatibility mode and provide
6917 // information on preventing compatibility mode
6918 var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
6919
6920 "development" !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : void 0;
6921
6922 var expectedFeatures = [
6923 // shims
6924 Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim];
6925
6926 for (var i = 0; i < expectedFeatures.length; i++) {
6927 if (!expectedFeatures[i]) {
6928 "development" !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;
6929 break;
6930 }
6931 }
6932 }
6933}
6934
6935if ("development" !== 'production') {
6936 var ReactInstrumentation = _dereq_(73);
6937 var ReactDOMUnknownPropertyHook = _dereq_(57);
6938 var ReactDOMNullInputValuePropHook = _dereq_(49);
6939
6940 ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
6941 ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
6942}
6943
6944module.exports = ReactDOM;
6945},{"123":123,"130":130,"141":141,"148":148,"171":171,"42":42,"49":49,"57":57,"60":60,"73":73,"76":76,"88":88,"96":96,"97":97}],39:[function(_dereq_,module,exports){
6946/**
6947 * Copyright 2013-present, Facebook, Inc.
6948 * All rights reserved.
6949 *
6950 * This source code is licensed under the BSD-style license found in the
6951 * LICENSE file in the root directory of this source tree. An additional grant
6952 * of patent rights can be found in the PATENTS file in the same directory.
6953 *
6954 * @providesModule ReactDOMButton
6955 */
6956
6957'use strict';
6958
6959var DisabledInputUtils = _dereq_(14);
6960
6961/**
6962 * Implements a <button> host component that does not receive mouse events
6963 * when `disabled` is set.
6964 */
6965var ReactDOMButton = {
6966 getHostProps: DisabledInputUtils.getHostProps
6967};
6968
6969module.exports = ReactDOMButton;
6970},{"14":14}],40:[function(_dereq_,module,exports){
6971/**
6972 * Copyright 2013-present, Facebook, Inc.
6973 * All rights reserved.
6974 *
6975 * This source code is licensed under the BSD-style license found in the
6976 * LICENSE file in the root directory of this source tree. An additional grant
6977 * of patent rights can be found in the PATENTS file in the same directory.
6978 *
6979 * @providesModule ReactDOMComponent
6980 */
6981
6982/* global hasOwnProperty:true */
6983
6984'use strict';
6985
6986var _prodInvariant = _dereq_(140),
6987 _assign = _dereq_(172);
6988
6989var AutoFocusUtils = _dereq_(1);
6990var CSSPropertyOperations = _dereq_(4);
6991var DOMLazyTree = _dereq_(8);
6992var DOMNamespaces = _dereq_(9);
6993var DOMProperty = _dereq_(10);
6994var DOMPropertyOperations = _dereq_(11);
6995var EventConstants = _dereq_(16);
6996var EventPluginHub = _dereq_(17);
6997var EventPluginRegistry = _dereq_(18);
6998var ReactBrowserEventEmitter = _dereq_(27);
6999var ReactDOMButton = _dereq_(39);
7000var ReactDOMComponentFlags = _dereq_(41);
7001var ReactDOMComponentTree = _dereq_(42);
7002var ReactDOMInput = _dereq_(48);
7003var ReactDOMOption = _dereq_(50);
7004var ReactDOMSelect = _dereq_(51);
7005var ReactDOMTextarea = _dereq_(55);
7006var ReactInstrumentation = _dereq_(73);
7007var ReactMultiChild = _dereq_(77);
7008var ReactServerRenderingTransaction = _dereq_(92);
7009
7010var emptyFunction = _dereq_(154);
7011var escapeTextContentForBrowser = _dereq_(122);
7012var invariant = _dereq_(162);
7013var isEventSupported = _dereq_(136);
7014var keyOf = _dereq_(166);
7015var shallowEqual = _dereq_(170);
7016var validateDOMNesting = _dereq_(146);
7017var warning = _dereq_(171);
7018
7019var Flags = ReactDOMComponentFlags;
7020var deleteListener = EventPluginHub.deleteListener;
7021var getNode = ReactDOMComponentTree.getNodeFromInstance;
7022var listenTo = ReactBrowserEventEmitter.listenTo;
7023var registrationNameModules = EventPluginRegistry.registrationNameModules;
7024
7025// For quickly matching children type, to test if can be treated as content.
7026var CONTENT_TYPES = { 'string': true, 'number': true };
7027
7028var STYLE = keyOf({ style: null });
7029var HTML = keyOf({ __html: null });
7030var RESERVED_PROPS = {
7031 children: null,
7032 dangerouslySetInnerHTML: null,
7033 suppressContentEditableWarning: null
7034};
7035
7036// Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
7037var DOC_FRAGMENT_TYPE = 11;
7038
7039function getDeclarationErrorAddendum(internalInstance) {
7040 if (internalInstance) {
7041 var owner = internalInstance._currentElement._owner || null;
7042 if (owner) {
7043 var name = owner.getName();
7044 if (name) {
7045 return ' This DOM node was rendered by `' + name + '`.';
7046 }
7047 }
7048 }
7049 return '';
7050}
7051
7052function friendlyStringify(obj) {
7053 if (typeof obj === 'object') {
7054 if (Array.isArray(obj)) {
7055 return '[' + obj.map(friendlyStringify).join(', ') + ']';
7056 } else {
7057 var pairs = [];
7058 for (var key in obj) {
7059 if (Object.prototype.hasOwnProperty.call(obj, key)) {
7060 var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
7061 pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
7062 }
7063 }
7064 return '{' + pairs.join(', ') + '}';
7065 }
7066 } else if (typeof obj === 'string') {
7067 return JSON.stringify(obj);
7068 } else if (typeof obj === 'function') {
7069 return '[function object]';
7070 }
7071 // Differs from JSON.stringify in that undefined because undefined and that
7072 // inf and nan don't become null
7073 return String(obj);
7074}
7075
7076var styleMutationWarning = {};
7077
7078function checkAndWarnForMutatedStyle(style1, style2, component) {
7079 if (style1 == null || style2 == null) {
7080 return;
7081 }
7082 if (shallowEqual(style1, style2)) {
7083 return;
7084 }
7085
7086 var componentName = component._tag;
7087 var owner = component._currentElement._owner;
7088 var ownerName;
7089 if (owner) {
7090 ownerName = owner.getName();
7091 }
7092
7093 var hash = ownerName + '|' + componentName;
7094
7095 if (styleMutationWarning.hasOwnProperty(hash)) {
7096 return;
7097 }
7098
7099 styleMutationWarning[hash] = true;
7100
7101 "development" !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : void 0;
7102}
7103
7104/**
7105 * @param {object} component
7106 * @param {?object} props
7107 */
7108function assertValidProps(component, props) {
7109 if (!props) {
7110 return;
7111 }
7112 // Note the use of `==` which checks for null or undefined.
7113 if (voidElementTags[component._tag]) {
7114 !(props.children == null && props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : _prodInvariant('137', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : void 0;
7115 }
7116 if (props.dangerouslySetInnerHTML != null) {
7117 !(props.children == null) ? "development" !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0;
7118 !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? "development" !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : _prodInvariant('61') : void 0;
7119 }
7120 if ("development" !== 'production') {
7121 "development" !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
7122 "development" !== 'production' ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
7123 "development" !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0;
7124 }
7125 !(props.style == null || typeof props.style === 'object') ? "development" !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', getDeclarationErrorAddendum(component)) : _prodInvariant('62', getDeclarationErrorAddendum(component)) : void 0;
7126}
7127
7128function enqueuePutListener(inst, registrationName, listener, transaction) {
7129 if (transaction instanceof ReactServerRenderingTransaction) {
7130 return;
7131 }
7132 if ("development" !== 'production') {
7133 // IE8 has no API for event capturing and the `onScroll` event doesn't
7134 // bubble.
7135 "development" !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
7136 }
7137 var containerInfo = inst._hostContainerInfo;
7138 var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
7139 var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
7140 listenTo(registrationName, doc);
7141 transaction.getReactMountReady().enqueue(putListener, {
7142 inst: inst,
7143 registrationName: registrationName,
7144 listener: listener
7145 });
7146}
7147
7148function putListener() {
7149 var listenerToPut = this;
7150 EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
7151}
7152
7153function inputPostMount() {
7154 var inst = this;
7155 ReactDOMInput.postMountWrapper(inst);
7156}
7157
7158function textareaPostMount() {
7159 var inst = this;
7160 ReactDOMTextarea.postMountWrapper(inst);
7161}
7162
7163function optionPostMount() {
7164 var inst = this;
7165 ReactDOMOption.postMountWrapper(inst);
7166}
7167
7168var setAndValidateContentChildDev = emptyFunction;
7169if ("development" !== 'production') {
7170 setAndValidateContentChildDev = function (content) {
7171 var hasExistingContent = this._contentDebugID != null;
7172 var debugID = this._debugID;
7173 // This ID represents the inlined child that has no backing instance:
7174 var contentDebugID = -debugID;
7175
7176 if (content == null) {
7177 if (hasExistingContent) {
7178 ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
7179 }
7180 this._contentDebugID = null;
7181 return;
7182 }
7183
7184 validateDOMNesting(null, String(content), this, this._ancestorInfo);
7185 this._contentDebugID = contentDebugID;
7186 if (hasExistingContent) {
7187 ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
7188 ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID);
7189 } else {
7190 ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID);
7191 ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
7192 ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
7193 }
7194 };
7195}
7196
7197// There are so many media events, it makes sense to just
7198// maintain a list rather than create a `trapBubbledEvent` for each
7199var mediaEvents = {
7200 topAbort: 'abort',
7201 topCanPlay: 'canplay',
7202 topCanPlayThrough: 'canplaythrough',
7203 topDurationChange: 'durationchange',
7204 topEmptied: 'emptied',
7205 topEncrypted: 'encrypted',
7206 topEnded: 'ended',
7207 topError: 'error',
7208 topLoadedData: 'loadeddata',
7209 topLoadedMetadata: 'loadedmetadata',
7210 topLoadStart: 'loadstart',
7211 topPause: 'pause',
7212 topPlay: 'play',
7213 topPlaying: 'playing',
7214 topProgress: 'progress',
7215 topRateChange: 'ratechange',
7216 topSeeked: 'seeked',
7217 topSeeking: 'seeking',
7218 topStalled: 'stalled',
7219 topSuspend: 'suspend',
7220 topTimeUpdate: 'timeupdate',
7221 topVolumeChange: 'volumechange',
7222 topWaiting: 'waiting'
7223};
7224
7225function trapBubbledEventsLocal() {
7226 var inst = this;
7227 // If a component renders to null or if another component fatals and causes
7228 // the state of the tree to be corrupted, `node` here can be null.
7229 !inst._rootNodeID ? "development" !== 'production' ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0;
7230 var node = getNode(inst);
7231 !node ? "development" !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : _prodInvariant('64') : void 0;
7232
7233 switch (inst._tag) {
7234 case 'iframe':
7235 case 'object':
7236 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
7237 break;
7238 case 'video':
7239 case 'audio':
7240
7241 inst._wrapperState.listeners = [];
7242 // Create listener for each media event
7243 for (var event in mediaEvents) {
7244 if (mediaEvents.hasOwnProperty(event)) {
7245 inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
7246 }
7247 }
7248 break;
7249 case 'source':
7250 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node)];
7251 break;
7252 case 'img':
7253 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
7254 break;
7255 case 'form':
7256 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
7257 break;
7258 case 'input':
7259 case 'select':
7260 case 'textarea':
7261 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topInvalid, 'invalid', node)];
7262 break;
7263 }
7264}
7265
7266function postUpdateSelectWrapper() {
7267 ReactDOMSelect.postUpdateWrapper(this);
7268}
7269
7270// For HTML, certain tags should omit their close tag. We keep a whitelist for
7271// those special-case tags.
7272
7273var omittedCloseTags = {
7274 'area': true,
7275 'base': true,
7276 'br': true,
7277 'col': true,
7278 'embed': true,
7279 'hr': true,
7280 'img': true,
7281 'input': true,
7282 'keygen': true,
7283 'link': true,
7284 'meta': true,
7285 'param': true,
7286 'source': true,
7287 'track': true,
7288 'wbr': true
7289};
7290
7291// NOTE: menuitem's close tag should be omitted, but that causes problems.
7292var newlineEatingTags = {
7293 'listing': true,
7294 'pre': true,
7295 'textarea': true
7296};
7297
7298// For HTML, certain tags cannot have children. This has the same purpose as
7299// `omittedCloseTags` except that `menuitem` should still have its closing tag.
7300
7301var voidElementTags = _assign({
7302 'menuitem': true
7303}, omittedCloseTags);
7304
7305// We accept any tag to be rendered but since this gets injected into arbitrary
7306// HTML, we want to make sure that it's a safe tag.
7307// http://www.w3.org/TR/REC-xml/#NT-Name
7308
7309var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
7310var validatedTagCache = {};
7311var hasOwnProperty = {}.hasOwnProperty;
7312
7313function validateDangerousTag(tag) {
7314 if (!hasOwnProperty.call(validatedTagCache, tag)) {
7315 !VALID_TAG_REGEX.test(tag) ? "development" !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : _prodInvariant('65', tag) : void 0;
7316 validatedTagCache[tag] = true;
7317 }
7318}
7319
7320function isCustomComponent(tagName, props) {
7321 return tagName.indexOf('-') >= 0 || props.is != null;
7322}
7323
7324var globalIdCounter = 1;
7325
7326/**
7327 * Creates a new React class that is idempotent and capable of containing other
7328 * React components. It accepts event listeners and DOM properties that are
7329 * valid according to `DOMProperty`.
7330 *
7331 * - Event listeners: `onClick`, `onMouseDown`, etc.
7332 * - DOM properties: `className`, `name`, `title`, etc.
7333 *
7334 * The `style` property functions differently from the DOM API. It accepts an
7335 * object mapping of style properties to values.
7336 *
7337 * @constructor ReactDOMComponent
7338 * @extends ReactMultiChild
7339 */
7340function ReactDOMComponent(element) {
7341 var tag = element.type;
7342 validateDangerousTag(tag);
7343 this._currentElement = element;
7344 this._tag = tag.toLowerCase();
7345 this._namespaceURI = null;
7346 this._renderedChildren = null;
7347 this._previousStyle = null;
7348 this._previousStyleCopy = null;
7349 this._hostNode = null;
7350 this._hostParent = null;
7351 this._rootNodeID = 0;
7352 this._domID = 0;
7353 this._hostContainerInfo = null;
7354 this._wrapperState = null;
7355 this._topLevelWrapper = null;
7356 this._flags = 0;
7357 if ("development" !== 'production') {
7358 this._ancestorInfo = null;
7359 setAndValidateContentChildDev.call(this, null);
7360 }
7361}
7362
7363ReactDOMComponent.displayName = 'ReactDOMComponent';
7364
7365ReactDOMComponent.Mixin = {
7366
7367 /**
7368 * Generates root tag markup then recurses. This method has side effects and
7369 * is not idempotent.
7370 *
7371 * @internal
7372 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7373 * @param {?ReactDOMComponent} the parent component instance
7374 * @param {?object} info about the host container
7375 * @param {object} context
7376 * @return {string} The computed markup.
7377 */
7378 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
7379 this._rootNodeID = globalIdCounter++;
7380 this._domID = hostContainerInfo._idCounter++;
7381 this._hostParent = hostParent;
7382 this._hostContainerInfo = hostContainerInfo;
7383
7384 var props = this._currentElement.props;
7385
7386 switch (this._tag) {
7387 case 'audio':
7388 case 'form':
7389 case 'iframe':
7390 case 'img':
7391 case 'link':
7392 case 'object':
7393 case 'source':
7394 case 'video':
7395 this._wrapperState = {
7396 listeners: null
7397 };
7398 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7399 break;
7400 case 'button':
7401 props = ReactDOMButton.getHostProps(this, props, hostParent);
7402 break;
7403 case 'input':
7404 ReactDOMInput.mountWrapper(this, props, hostParent);
7405 props = ReactDOMInput.getHostProps(this, props);
7406 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7407 break;
7408 case 'option':
7409 ReactDOMOption.mountWrapper(this, props, hostParent);
7410 props = ReactDOMOption.getHostProps(this, props);
7411 break;
7412 case 'select':
7413 ReactDOMSelect.mountWrapper(this, props, hostParent);
7414 props = ReactDOMSelect.getHostProps(this, props);
7415 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7416 break;
7417 case 'textarea':
7418 ReactDOMTextarea.mountWrapper(this, props, hostParent);
7419 props = ReactDOMTextarea.getHostProps(this, props);
7420 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7421 break;
7422 }
7423
7424 assertValidProps(this, props);
7425
7426 // We create tags in the namespace of their parent container, except HTML
7427 // tags get no namespace.
7428 var namespaceURI;
7429 var parentTag;
7430 if (hostParent != null) {
7431 namespaceURI = hostParent._namespaceURI;
7432 parentTag = hostParent._tag;
7433 } else if (hostContainerInfo._tag) {
7434 namespaceURI = hostContainerInfo._namespaceURI;
7435 parentTag = hostContainerInfo._tag;
7436 }
7437 if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
7438 namespaceURI = DOMNamespaces.html;
7439 }
7440 if (namespaceURI === DOMNamespaces.html) {
7441 if (this._tag === 'svg') {
7442 namespaceURI = DOMNamespaces.svg;
7443 } else if (this._tag === 'math') {
7444 namespaceURI = DOMNamespaces.mathml;
7445 }
7446 }
7447 this._namespaceURI = namespaceURI;
7448
7449 if ("development" !== 'production') {
7450 var parentInfo;
7451 if (hostParent != null) {
7452 parentInfo = hostParent._ancestorInfo;
7453 } else if (hostContainerInfo._tag) {
7454 parentInfo = hostContainerInfo._ancestorInfo;
7455 }
7456 if (parentInfo) {
7457 // parentInfo should always be present except for the top-level
7458 // component when server rendering
7459 validateDOMNesting(this._tag, null, this, parentInfo);
7460 }
7461 this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
7462 }
7463
7464 var mountImage;
7465 if (transaction.useCreateElement) {
7466 var ownerDocument = hostContainerInfo._ownerDocument;
7467 var el;
7468 if (namespaceURI === DOMNamespaces.html) {
7469 if (this._tag === 'script') {
7470 // Create the script via .innerHTML so its "parser-inserted" flag is
7471 // set to true and it does not execute
7472 var div = ownerDocument.createElement('div');
7473 var type = this._currentElement.type;
7474 div.innerHTML = '<' + type + '></' + type + '>';
7475 el = div.removeChild(div.firstChild);
7476 } else if (props.is) {
7477 el = ownerDocument.createElement(this._currentElement.type, props.is);
7478 } else {
7479 // Separate else branch instead of using `props.is || undefined` above becuase of a Firefox bug.
7480 // See discussion in https://github.com/facebook/react/pull/6896
7481 // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
7482 el = ownerDocument.createElement(this._currentElement.type);
7483 }
7484 } else {
7485 el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
7486 }
7487 ReactDOMComponentTree.precacheNode(this, el);
7488 this._flags |= Flags.hasCachedChildNodes;
7489 if (!this._hostParent) {
7490 DOMPropertyOperations.setAttributeForRoot(el);
7491 }
7492 this._updateDOMProperties(null, props, transaction);
7493 var lazyTree = DOMLazyTree(el);
7494 this._createInitialChildren(transaction, props, context, lazyTree);
7495 mountImage = lazyTree;
7496 } else {
7497 var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
7498 var tagContent = this._createContentMarkup(transaction, props, context);
7499 if (!tagContent && omittedCloseTags[this._tag]) {
7500 mountImage = tagOpen + '/>';
7501 } else {
7502 mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
7503 }
7504 }
7505
7506 switch (this._tag) {
7507 case 'input':
7508 transaction.getReactMountReady().enqueue(inputPostMount, this);
7509 if (props.autoFocus) {
7510 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
7511 }
7512 break;
7513 case 'textarea':
7514 transaction.getReactMountReady().enqueue(textareaPostMount, this);
7515 if (props.autoFocus) {
7516 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
7517 }
7518 break;
7519 case 'select':
7520 if (props.autoFocus) {
7521 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
7522 }
7523 break;
7524 case 'button':
7525 if (props.autoFocus) {
7526 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
7527 }
7528 break;
7529 case 'option':
7530 transaction.getReactMountReady().enqueue(optionPostMount, this);
7531 break;
7532 }
7533
7534 return mountImage;
7535 },
7536
7537 /**
7538 * Creates markup for the open tag and all attributes.
7539 *
7540 * This method has side effects because events get registered.
7541 *
7542 * Iterating over object properties is faster than iterating over arrays.
7543 * @see http://jsperf.com/obj-vs-arr-iteration
7544 *
7545 * @private
7546 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7547 * @param {object} props
7548 * @return {string} Markup of opening tag.
7549 */
7550 _createOpenTagMarkupAndPutListeners: function (transaction, props) {
7551 var ret = '<' + this._currentElement.type;
7552
7553 for (var propKey in props) {
7554 if (!props.hasOwnProperty(propKey)) {
7555 continue;
7556 }
7557 var propValue = props[propKey];
7558 if (propValue == null) {
7559 continue;
7560 }
7561 if (registrationNameModules.hasOwnProperty(propKey)) {
7562 if (propValue) {
7563 enqueuePutListener(this, propKey, propValue, transaction);
7564 }
7565 } else {
7566 if (propKey === STYLE) {
7567 if (propValue) {
7568 if ("development" !== 'production') {
7569 // See `_updateDOMProperties`. style block
7570 this._previousStyle = propValue;
7571 }
7572 propValue = this._previousStyleCopy = _assign({}, props.style);
7573 }
7574 propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
7575 }
7576 var markup = null;
7577 if (this._tag != null && isCustomComponent(this._tag, props)) {
7578 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
7579 markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
7580 }
7581 } else {
7582 markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
7583 }
7584 if (markup) {
7585 ret += ' ' + markup;
7586 }
7587 }
7588 }
7589
7590 // For static pages, no need to put React ID and checksum. Saves lots of
7591 // bytes.
7592 if (transaction.renderToStaticMarkup) {
7593 return ret;
7594 }
7595
7596 if (!this._hostParent) {
7597 ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
7598 }
7599 ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
7600 return ret;
7601 },
7602
7603 /**
7604 * Creates markup for the content between the tags.
7605 *
7606 * @private
7607 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7608 * @param {object} props
7609 * @param {object} context
7610 * @return {string} Content markup.
7611 */
7612 _createContentMarkup: function (transaction, props, context) {
7613 var ret = '';
7614
7615 // Intentional use of != to avoid catching zero/false.
7616 var innerHTML = props.dangerouslySetInnerHTML;
7617 if (innerHTML != null) {
7618 if (innerHTML.__html != null) {
7619 ret = innerHTML.__html;
7620 }
7621 } else {
7622 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
7623 var childrenToUse = contentToUse != null ? null : props.children;
7624 if (contentToUse != null) {
7625 // TODO: Validate that text is allowed as a child of this node
7626 ret = escapeTextContentForBrowser(contentToUse);
7627 if ("development" !== 'production') {
7628 setAndValidateContentChildDev.call(this, contentToUse);
7629 }
7630 } else if (childrenToUse != null) {
7631 var mountImages = this.mountChildren(childrenToUse, transaction, context);
7632 ret = mountImages.join('');
7633 }
7634 }
7635 if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
7636 // text/html ignores the first character in these tags if it's a newline
7637 // Prefer to break application/xml over text/html (for now) by adding
7638 // a newline specifically to get eaten by the parser. (Alternately for
7639 // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
7640 // \r is normalized out by HTMLTextAreaElement#value.)
7641 // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
7642 // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
7643 // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
7644 // See: Parsing of "textarea" "listing" and "pre" elements
7645 // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
7646 return '\n' + ret;
7647 } else {
7648 return ret;
7649 }
7650 },
7651
7652 _createInitialChildren: function (transaction, props, context, lazyTree) {
7653 // Intentional use of != to avoid catching zero/false.
7654 var innerHTML = props.dangerouslySetInnerHTML;
7655 if (innerHTML != null) {
7656 if (innerHTML.__html != null) {
7657 DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
7658 }
7659 } else {
7660 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
7661 var childrenToUse = contentToUse != null ? null : props.children;
7662 if (contentToUse != null) {
7663 // TODO: Validate that text is allowed as a child of this node
7664 if ("development" !== 'production') {
7665 setAndValidateContentChildDev.call(this, contentToUse);
7666 }
7667 DOMLazyTree.queueText(lazyTree, contentToUse);
7668 } else if (childrenToUse != null) {
7669 var mountImages = this.mountChildren(childrenToUse, transaction, context);
7670 for (var i = 0; i < mountImages.length; i++) {
7671 DOMLazyTree.queueChild(lazyTree, mountImages[i]);
7672 }
7673 }
7674 }
7675 },
7676
7677 /**
7678 * Receives a next element and updates the component.
7679 *
7680 * @internal
7681 * @param {ReactElement} nextElement
7682 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7683 * @param {object} context
7684 */
7685 receiveComponent: function (nextElement, transaction, context) {
7686 var prevElement = this._currentElement;
7687 this._currentElement = nextElement;
7688 this.updateComponent(transaction, prevElement, nextElement, context);
7689 },
7690
7691 /**
7692 * Updates a DOM component after it has already been allocated and
7693 * attached to the DOM. Reconciles the root DOM node, then recurses.
7694 *
7695 * @param {ReactReconcileTransaction} transaction
7696 * @param {ReactElement} prevElement
7697 * @param {ReactElement} nextElement
7698 * @internal
7699 * @overridable
7700 */
7701 updateComponent: function (transaction, prevElement, nextElement, context) {
7702 var lastProps = prevElement.props;
7703 var nextProps = this._currentElement.props;
7704
7705 switch (this._tag) {
7706 case 'button':
7707 lastProps = ReactDOMButton.getHostProps(this, lastProps);
7708 nextProps = ReactDOMButton.getHostProps(this, nextProps);
7709 break;
7710 case 'input':
7711 lastProps = ReactDOMInput.getHostProps(this, lastProps);
7712 nextProps = ReactDOMInput.getHostProps(this, nextProps);
7713 break;
7714 case 'option':
7715 lastProps = ReactDOMOption.getHostProps(this, lastProps);
7716 nextProps = ReactDOMOption.getHostProps(this, nextProps);
7717 break;
7718 case 'select':
7719 lastProps = ReactDOMSelect.getHostProps(this, lastProps);
7720 nextProps = ReactDOMSelect.getHostProps(this, nextProps);
7721 break;
7722 case 'textarea':
7723 lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
7724 nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
7725 break;
7726 }
7727
7728 assertValidProps(this, nextProps);
7729 this._updateDOMProperties(lastProps, nextProps, transaction);
7730 this._updateDOMChildren(lastProps, nextProps, transaction, context);
7731
7732 switch (this._tag) {
7733 case 'input':
7734 // Update the wrapper around inputs *after* updating props. This has to
7735 // happen after `_updateDOMProperties`. Otherwise HTML5 input validations
7736 // raise warnings and prevent the new value from being assigned.
7737 ReactDOMInput.updateWrapper(this);
7738 break;
7739 case 'textarea':
7740 ReactDOMTextarea.updateWrapper(this);
7741 break;
7742 case 'select':
7743 // <select> value update needs to occur after <option> children
7744 // reconciliation
7745 transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
7746 break;
7747 }
7748 },
7749
7750 /**
7751 * Reconciles the properties by detecting differences in property values and
7752 * updating the DOM as necessary. This function is probably the single most
7753 * critical path for performance optimization.
7754 *
7755 * TODO: Benchmark whether checking for changed values in memory actually
7756 * improves performance (especially statically positioned elements).
7757 * TODO: Benchmark the effects of putting this at the top since 99% of props
7758 * do not change for a given reconciliation.
7759 * TODO: Benchmark areas that can be improved with caching.
7760 *
7761 * @private
7762 * @param {object} lastProps
7763 * @param {object} nextProps
7764 * @param {?DOMElement} node
7765 */
7766 _updateDOMProperties: function (lastProps, nextProps, transaction) {
7767 var propKey;
7768 var styleName;
7769 var styleUpdates;
7770 for (propKey in lastProps) {
7771 if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
7772 continue;
7773 }
7774 if (propKey === STYLE) {
7775 var lastStyle = this._previousStyleCopy;
7776 for (styleName in lastStyle) {
7777 if (lastStyle.hasOwnProperty(styleName)) {
7778 styleUpdates = styleUpdates || {};
7779 styleUpdates[styleName] = '';
7780 }
7781 }
7782 this._previousStyleCopy = null;
7783 } else if (registrationNameModules.hasOwnProperty(propKey)) {
7784 if (lastProps[propKey]) {
7785 // Only call deleteListener if there was a listener previously or
7786 // else willDeleteListener gets called when there wasn't actually a
7787 // listener (e.g., onClick={null})
7788 deleteListener(this, propKey);
7789 }
7790 } else if (isCustomComponent(this._tag, lastProps)) {
7791 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
7792 DOMPropertyOperations.deleteValueForAttribute(getNode(this), propKey);
7793 }
7794 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
7795 DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
7796 }
7797 }
7798 for (propKey in nextProps) {
7799 var nextProp = nextProps[propKey];
7800 var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
7801 if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
7802 continue;
7803 }
7804 if (propKey === STYLE) {
7805 if (nextProp) {
7806 if ("development" !== 'production') {
7807 checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
7808 this._previousStyle = nextProp;
7809 }
7810 nextProp = this._previousStyleCopy = _assign({}, nextProp);
7811 } else {
7812 this._previousStyleCopy = null;
7813 }
7814 if (lastProp) {
7815 // Unset styles on `lastProp` but not on `nextProp`.
7816 for (styleName in lastProp) {
7817 if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
7818 styleUpdates = styleUpdates || {};
7819 styleUpdates[styleName] = '';
7820 }
7821 }
7822 // Update styles that changed since `lastProp`.
7823 for (styleName in nextProp) {
7824 if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
7825 styleUpdates = styleUpdates || {};
7826 styleUpdates[styleName] = nextProp[styleName];
7827 }
7828 }
7829 } else {
7830 // Relies on `updateStylesByID` not mutating `styleUpdates`.
7831 styleUpdates = nextProp;
7832 }
7833 } else if (registrationNameModules.hasOwnProperty(propKey)) {
7834 if (nextProp) {
7835 enqueuePutListener(this, propKey, nextProp, transaction);
7836 } else if (lastProp) {
7837 deleteListener(this, propKey);
7838 }
7839 } else if (isCustomComponent(this._tag, nextProps)) {
7840 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
7841 DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
7842 }
7843 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
7844 var node = getNode(this);
7845 // If we're updating to null or undefined, we should remove the property
7846 // from the DOM node instead of inadvertently setting to a string. This
7847 // brings us in line with the same behavior we have on initial render.
7848 if (nextProp != null) {
7849 DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
7850 } else {
7851 DOMPropertyOperations.deleteValueForProperty(node, propKey);
7852 }
7853 }
7854 }
7855 if (styleUpdates) {
7856 CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
7857 }
7858 },
7859
7860 /**
7861 * Reconciles the children with the various properties that affect the
7862 * children content.
7863 *
7864 * @param {object} lastProps
7865 * @param {object} nextProps
7866 * @param {ReactReconcileTransaction} transaction
7867 * @param {object} context
7868 */
7869 _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
7870 var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
7871 var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
7872
7873 var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
7874 var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
7875
7876 // Note the use of `!=` which checks for null or undefined.
7877 var lastChildren = lastContent != null ? null : lastProps.children;
7878 var nextChildren = nextContent != null ? null : nextProps.children;
7879
7880 // If we're switching from children to content/html or vice versa, remove
7881 // the old content
7882 var lastHasContentOrHtml = lastContent != null || lastHtml != null;
7883 var nextHasContentOrHtml = nextContent != null || nextHtml != null;
7884 if (lastChildren != null && nextChildren == null) {
7885 this.updateChildren(null, transaction, context);
7886 } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
7887 this.updateTextContent('');
7888 if ("development" !== 'production') {
7889 ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
7890 }
7891 }
7892
7893 if (nextContent != null) {
7894 if (lastContent !== nextContent) {
7895 this.updateTextContent('' + nextContent);
7896 if ("development" !== 'production') {
7897 setAndValidateContentChildDev.call(this, nextContent);
7898 }
7899 }
7900 } else if (nextHtml != null) {
7901 if (lastHtml !== nextHtml) {
7902 this.updateMarkup('' + nextHtml);
7903 }
7904 if ("development" !== 'production') {
7905 ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
7906 }
7907 } else if (nextChildren != null) {
7908 if ("development" !== 'production') {
7909 setAndValidateContentChildDev.call(this, null);
7910 }
7911
7912 this.updateChildren(nextChildren, transaction, context);
7913 }
7914 },
7915
7916 getHostNode: function () {
7917 return getNode(this);
7918 },
7919
7920 /**
7921 * Destroys all event registrations for this instance. Does not remove from
7922 * the DOM. That must be done by the parent.
7923 *
7924 * @internal
7925 */
7926 unmountComponent: function (safely) {
7927 switch (this._tag) {
7928 case 'audio':
7929 case 'form':
7930 case 'iframe':
7931 case 'img':
7932 case 'link':
7933 case 'object':
7934 case 'source':
7935 case 'video':
7936 var listeners = this._wrapperState.listeners;
7937 if (listeners) {
7938 for (var i = 0; i < listeners.length; i++) {
7939 listeners[i].remove();
7940 }
7941 }
7942 break;
7943 case 'html':
7944 case 'head':
7945 case 'body':
7946 /**
7947 * Components like <html> <head> and <body> can't be removed or added
7948 * easily in a cross-browser way, however it's valuable to be able to
7949 * take advantage of React's reconciliation for styling and <title>
7950 * management. So we just document it and throw in dangerous cases.
7951 */
7952 !false ? "development" !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.', this._tag) : _prodInvariant('66', this._tag) : void 0;
7953 break;
7954 }
7955
7956 this.unmountChildren(safely);
7957 ReactDOMComponentTree.uncacheNode(this);
7958 EventPluginHub.deleteAllListeners(this);
7959 this._rootNodeID = 0;
7960 this._domID = 0;
7961 this._wrapperState = null;
7962
7963 if ("development" !== 'production') {
7964 setAndValidateContentChildDev.call(this, null);
7965 }
7966 },
7967
7968 getPublicInstance: function () {
7969 return getNode(this);
7970 }
7971
7972};
7973
7974_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
7975
7976module.exports = ReactDOMComponent;
7977},{"1":1,"10":10,"11":11,"122":122,"136":136,"140":140,"146":146,"154":154,"16":16,"162":162,"166":166,"17":17,"170":170,"171":171,"172":172,"18":18,"27":27,"39":39,"4":4,"41":41,"42":42,"48":48,"50":50,"51":51,"55":55,"73":73,"77":77,"8":8,"9":9,"92":92}],41:[function(_dereq_,module,exports){
7978/**
7979 * Copyright 2015-present, Facebook, Inc.
7980 * All rights reserved.
7981 *
7982 * This source code is licensed under the BSD-style license found in the
7983 * LICENSE file in the root directory of this source tree. An additional grant
7984 * of patent rights can be found in the PATENTS file in the same directory.
7985 *
7986 * @providesModule ReactDOMComponentFlags
7987 */
7988
7989'use strict';
7990
7991var ReactDOMComponentFlags = {
7992 hasCachedChildNodes: 1 << 0
7993};
7994
7995module.exports = ReactDOMComponentFlags;
7996},{}],42:[function(_dereq_,module,exports){
7997/**
7998 * Copyright 2013-present, Facebook, Inc.
7999 * All rights reserved.
8000 *
8001 * This source code is licensed under the BSD-style license found in the
8002 * LICENSE file in the root directory of this source tree. An additional grant
8003 * of patent rights can be found in the PATENTS file in the same directory.
8004 *
8005 * @providesModule ReactDOMComponentTree
8006 */
8007
8008'use strict';
8009
8010var _prodInvariant = _dereq_(140);
8011
8012var DOMProperty = _dereq_(10);
8013var ReactDOMComponentFlags = _dereq_(41);
8014
8015var invariant = _dereq_(162);
8016
8017var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
8018var Flags = ReactDOMComponentFlags;
8019
8020var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
8021
8022/**
8023 * Drill down (through composites and empty components) until we get a host or
8024 * host text component.
8025 *
8026 * This is pretty polymorphic but unavoidable with the current structure we have
8027 * for `_renderedChildren`.
8028 */
8029function getRenderedHostOrTextFromComponent(component) {
8030 var rendered;
8031 while (rendered = component._renderedComponent) {
8032 component = rendered;
8033 }
8034 return component;
8035}
8036
8037/**
8038 * Populate `_hostNode` on the rendered host/text component with the given
8039 * DOM node. The passed `inst` can be a composite.
8040 */
8041function precacheNode(inst, node) {
8042 var hostInst = getRenderedHostOrTextFromComponent(inst);
8043 hostInst._hostNode = node;
8044 node[internalInstanceKey] = hostInst;
8045}
8046
8047function uncacheNode(inst) {
8048 var node = inst._hostNode;
8049 if (node) {
8050 delete node[internalInstanceKey];
8051 inst._hostNode = null;
8052 }
8053}
8054
8055/**
8056 * Populate `_hostNode` on each child of `inst`, assuming that the children
8057 * match up with the DOM (element) children of `node`.
8058 *
8059 * We cache entire levels at once to avoid an n^2 problem where we access the
8060 * children of a node sequentially and have to walk from the start to our target
8061 * node every time.
8062 *
8063 * Since we update `_renderedChildren` and the actual DOM at (slightly)
8064 * different times, we could race here and see a newer `_renderedChildren` than
8065 * the DOM nodes we see. To avoid this, ReactMultiChild calls
8066 * `prepareToManageChildren` before we change `_renderedChildren`, at which
8067 * time the container's child nodes are always cached (until it unmounts).
8068 */
8069function precacheChildNodes(inst, node) {
8070 if (inst._flags & Flags.hasCachedChildNodes) {
8071 return;
8072 }
8073 var children = inst._renderedChildren;
8074 var childNode = node.firstChild;
8075 outer: for (var name in children) {
8076 if (!children.hasOwnProperty(name)) {
8077 continue;
8078 }
8079 var childInst = children[name];
8080 var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
8081 if (childID === 0) {
8082 // We're currently unmounting this child in ReactMultiChild; skip it.
8083 continue;
8084 }
8085 // We assume the child nodes are in the same order as the child instances.
8086 for (; childNode !== null; childNode = childNode.nextSibling) {
8087 if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {
8088 precacheNode(childInst, childNode);
8089 continue outer;
8090 }
8091 }
8092 // We reached the end of the DOM children without finding an ID match.
8093 !false ? "development" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;
8094 }
8095 inst._flags |= Flags.hasCachedChildNodes;
8096}
8097
8098/**
8099 * Given a DOM node, return the closest ReactDOMComponent or
8100 * ReactDOMTextComponent instance ancestor.
8101 */
8102function getClosestInstanceFromNode(node) {
8103 if (node[internalInstanceKey]) {
8104 return node[internalInstanceKey];
8105 }
8106
8107 // Walk up the tree until we find an ancestor whose instance we have cached.
8108 var parents = [];
8109 while (!node[internalInstanceKey]) {
8110 parents.push(node);
8111 if (node.parentNode) {
8112 node = node.parentNode;
8113 } else {
8114 // Top of the tree. This node must not be part of a React tree (or is
8115 // unmounted, potentially).
8116 return null;
8117 }
8118 }
8119
8120 var closest;
8121 var inst;
8122 for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
8123 closest = inst;
8124 if (parents.length) {
8125 precacheChildNodes(inst, node);
8126 }
8127 }
8128
8129 return closest;
8130}
8131
8132/**
8133 * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
8134 * instance, or null if the node was not rendered by this React.
8135 */
8136function getInstanceFromNode(node) {
8137 var inst = getClosestInstanceFromNode(node);
8138 if (inst != null && inst._hostNode === node) {
8139 return inst;
8140 } else {
8141 return null;
8142 }
8143}
8144
8145/**
8146 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
8147 * DOM node.
8148 */
8149function getNodeFromInstance(inst) {
8150 // Without this first invariant, passing a non-DOM-component triggers the next
8151 // invariant for a missing parent, which is super confusing.
8152 !(inst._hostNode !== undefined) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
8153
8154 if (inst._hostNode) {
8155 return inst._hostNode;
8156 }
8157
8158 // Walk up the tree until we find an ancestor whose DOM node we have cached.
8159 var parents = [];
8160 while (!inst._hostNode) {
8161 parents.push(inst);
8162 !inst._hostParent ? "development" !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;
8163 inst = inst._hostParent;
8164 }
8165
8166 // Now parents contains each ancestor that does *not* have a cached native
8167 // node, and `inst` is the deepest ancestor that does.
8168 for (; parents.length; inst = parents.pop()) {
8169 precacheChildNodes(inst, inst._hostNode);
8170 }
8171
8172 return inst._hostNode;
8173}
8174
8175var ReactDOMComponentTree = {
8176 getClosestInstanceFromNode: getClosestInstanceFromNode,
8177 getInstanceFromNode: getInstanceFromNode,
8178 getNodeFromInstance: getNodeFromInstance,
8179 precacheChildNodes: precacheChildNodes,
8180 precacheNode: precacheNode,
8181 uncacheNode: uncacheNode
8182};
8183
8184module.exports = ReactDOMComponentTree;
8185},{"10":10,"140":140,"162":162,"41":41}],43:[function(_dereq_,module,exports){
8186/**
8187 * Copyright 2013-present, Facebook, Inc.
8188 * All rights reserved.
8189 *
8190 * This source code is licensed under the BSD-style license found in the
8191 * LICENSE file in the root directory of this source tree. An additional grant
8192 * of patent rights can be found in the PATENTS file in the same directory.
8193 *
8194 * @providesModule ReactDOMContainerInfo
8195 */
8196
8197'use strict';
8198
8199var validateDOMNesting = _dereq_(146);
8200
8201var DOC_NODE_TYPE = 9;
8202
8203function ReactDOMContainerInfo(topLevelWrapper, node) {
8204 var info = {
8205 _topLevelWrapper: topLevelWrapper,
8206 _idCounter: 1,
8207 _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
8208 _node: node,
8209 _tag: node ? node.nodeName.toLowerCase() : null,
8210 _namespaceURI: node ? node.namespaceURI : null
8211 };
8212 if ("development" !== 'production') {
8213 info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
8214 }
8215 return info;
8216}
8217
8218module.exports = ReactDOMContainerInfo;
8219},{"146":146}],44:[function(_dereq_,module,exports){
8220/**
8221 * Copyright 2014-present, Facebook, Inc.
8222 * All rights reserved.
8223 *
8224 * This source code is licensed under the BSD-style license found in the
8225 * LICENSE file in the root directory of this source tree. An additional grant
8226 * of patent rights can be found in the PATENTS file in the same directory.
8227 *
8228 * @providesModule ReactDOMEmptyComponent
8229 */
8230
8231'use strict';
8232
8233var _assign = _dereq_(172);
8234
8235var DOMLazyTree = _dereq_(8);
8236var ReactDOMComponentTree = _dereq_(42);
8237
8238var ReactDOMEmptyComponent = function (instantiate) {
8239 // ReactCompositeComponent uses this:
8240 this._currentElement = null;
8241 // ReactDOMComponentTree uses these:
8242 this._hostNode = null;
8243 this._hostParent = null;
8244 this._hostContainerInfo = null;
8245 this._domID = 0;
8246};
8247_assign(ReactDOMEmptyComponent.prototype, {
8248 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
8249 var domID = hostContainerInfo._idCounter++;
8250 this._domID = domID;
8251 this._hostParent = hostParent;
8252 this._hostContainerInfo = hostContainerInfo;
8253
8254 var nodeValue = ' react-empty: ' + this._domID + ' ';
8255 if (transaction.useCreateElement) {
8256 var ownerDocument = hostContainerInfo._ownerDocument;
8257 var node = ownerDocument.createComment(nodeValue);
8258 ReactDOMComponentTree.precacheNode(this, node);
8259 return DOMLazyTree(node);
8260 } else {
8261 if (transaction.renderToStaticMarkup) {
8262 // Normally we'd insert a comment node, but since this is a situation
8263 // where React won't take over (static pages), we can simply return
8264 // nothing.
8265 return '';
8266 }
8267 return '<!--' + nodeValue + '-->';
8268 }
8269 },
8270 receiveComponent: function () {},
8271 getHostNode: function () {
8272 return ReactDOMComponentTree.getNodeFromInstance(this);
8273 },
8274 unmountComponent: function () {
8275 ReactDOMComponentTree.uncacheNode(this);
8276 }
8277});
8278
8279module.exports = ReactDOMEmptyComponent;
8280},{"172":172,"42":42,"8":8}],45:[function(_dereq_,module,exports){
8281/**
8282 * Copyright 2013-present, Facebook, Inc.
8283 * All rights reserved.
8284 *
8285 * This source code is licensed under the BSD-style license found in the
8286 * LICENSE file in the root directory of this source tree. An additional grant
8287 * of patent rights can be found in the PATENTS file in the same directory.
8288 *
8289 * @providesModule ReactDOMFactories
8290 */
8291
8292'use strict';
8293
8294var ReactElement = _dereq_(61);
8295
8296/**
8297 * Create a factory that creates HTML tag elements.
8298 *
8299 * @private
8300 */
8301var createDOMFactory = ReactElement.createFactory;
8302if ("development" !== 'production') {
8303 var ReactElementValidator = _dereq_(62);
8304 createDOMFactory = ReactElementValidator.createFactory;
8305}
8306
8307/**
8308 * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
8309 * This is also accessible via `React.DOM`.
8310 *
8311 * @public
8312 */
8313var ReactDOMFactories = {
8314 a: createDOMFactory('a'),
8315 abbr: createDOMFactory('abbr'),
8316 address: createDOMFactory('address'),
8317 area: createDOMFactory('area'),
8318 article: createDOMFactory('article'),
8319 aside: createDOMFactory('aside'),
8320 audio: createDOMFactory('audio'),
8321 b: createDOMFactory('b'),
8322 base: createDOMFactory('base'),
8323 bdi: createDOMFactory('bdi'),
8324 bdo: createDOMFactory('bdo'),
8325 big: createDOMFactory('big'),
8326 blockquote: createDOMFactory('blockquote'),
8327 body: createDOMFactory('body'),
8328 br: createDOMFactory('br'),
8329 button: createDOMFactory('button'),
8330 canvas: createDOMFactory('canvas'),
8331 caption: createDOMFactory('caption'),
8332 cite: createDOMFactory('cite'),
8333 code: createDOMFactory('code'),
8334 col: createDOMFactory('col'),
8335 colgroup: createDOMFactory('colgroup'),
8336 data: createDOMFactory('data'),
8337 datalist: createDOMFactory('datalist'),
8338 dd: createDOMFactory('dd'),
8339 del: createDOMFactory('del'),
8340 details: createDOMFactory('details'),
8341 dfn: createDOMFactory('dfn'),
8342 dialog: createDOMFactory('dialog'),
8343 div: createDOMFactory('div'),
8344 dl: createDOMFactory('dl'),
8345 dt: createDOMFactory('dt'),
8346 em: createDOMFactory('em'),
8347 embed: createDOMFactory('embed'),
8348 fieldset: createDOMFactory('fieldset'),
8349 figcaption: createDOMFactory('figcaption'),
8350 figure: createDOMFactory('figure'),
8351 footer: createDOMFactory('footer'),
8352 form: createDOMFactory('form'),
8353 h1: createDOMFactory('h1'),
8354 h2: createDOMFactory('h2'),
8355 h3: createDOMFactory('h3'),
8356 h4: createDOMFactory('h4'),
8357 h5: createDOMFactory('h5'),
8358 h6: createDOMFactory('h6'),
8359 head: createDOMFactory('head'),
8360 header: createDOMFactory('header'),
8361 hgroup: createDOMFactory('hgroup'),
8362 hr: createDOMFactory('hr'),
8363 html: createDOMFactory('html'),
8364 i: createDOMFactory('i'),
8365 iframe: createDOMFactory('iframe'),
8366 img: createDOMFactory('img'),
8367 input: createDOMFactory('input'),
8368 ins: createDOMFactory('ins'),
8369 kbd: createDOMFactory('kbd'),
8370 keygen: createDOMFactory('keygen'),
8371 label: createDOMFactory('label'),
8372 legend: createDOMFactory('legend'),
8373 li: createDOMFactory('li'),
8374 link: createDOMFactory('link'),
8375 main: createDOMFactory('main'),
8376 map: createDOMFactory('map'),
8377 mark: createDOMFactory('mark'),
8378 menu: createDOMFactory('menu'),
8379 menuitem: createDOMFactory('menuitem'),
8380 meta: createDOMFactory('meta'),
8381 meter: createDOMFactory('meter'),
8382 nav: createDOMFactory('nav'),
8383 noscript: createDOMFactory('noscript'),
8384 object: createDOMFactory('object'),
8385 ol: createDOMFactory('ol'),
8386 optgroup: createDOMFactory('optgroup'),
8387 option: createDOMFactory('option'),
8388 output: createDOMFactory('output'),
8389 p: createDOMFactory('p'),
8390 param: createDOMFactory('param'),
8391 picture: createDOMFactory('picture'),
8392 pre: createDOMFactory('pre'),
8393 progress: createDOMFactory('progress'),
8394 q: createDOMFactory('q'),
8395 rp: createDOMFactory('rp'),
8396 rt: createDOMFactory('rt'),
8397 ruby: createDOMFactory('ruby'),
8398 s: createDOMFactory('s'),
8399 samp: createDOMFactory('samp'),
8400 script: createDOMFactory('script'),
8401 section: createDOMFactory('section'),
8402 select: createDOMFactory('select'),
8403 small: createDOMFactory('small'),
8404 source: createDOMFactory('source'),
8405 span: createDOMFactory('span'),
8406 strong: createDOMFactory('strong'),
8407 style: createDOMFactory('style'),
8408 sub: createDOMFactory('sub'),
8409 summary: createDOMFactory('summary'),
8410 sup: createDOMFactory('sup'),
8411 table: createDOMFactory('table'),
8412 tbody: createDOMFactory('tbody'),
8413 td: createDOMFactory('td'),
8414 textarea: createDOMFactory('textarea'),
8415 tfoot: createDOMFactory('tfoot'),
8416 th: createDOMFactory('th'),
8417 thead: createDOMFactory('thead'),
8418 time: createDOMFactory('time'),
8419 title: createDOMFactory('title'),
8420 tr: createDOMFactory('tr'),
8421 track: createDOMFactory('track'),
8422 u: createDOMFactory('u'),
8423 ul: createDOMFactory('ul'),
8424 'var': createDOMFactory('var'),
8425 video: createDOMFactory('video'),
8426 wbr: createDOMFactory('wbr'),
8427
8428 // SVG
8429 circle: createDOMFactory('circle'),
8430 clipPath: createDOMFactory('clipPath'),
8431 defs: createDOMFactory('defs'),
8432 ellipse: createDOMFactory('ellipse'),
8433 g: createDOMFactory('g'),
8434 image: createDOMFactory('image'),
8435 line: createDOMFactory('line'),
8436 linearGradient: createDOMFactory('linearGradient'),
8437 mask: createDOMFactory('mask'),
8438 path: createDOMFactory('path'),
8439 pattern: createDOMFactory('pattern'),
8440 polygon: createDOMFactory('polygon'),
8441 polyline: createDOMFactory('polyline'),
8442 radialGradient: createDOMFactory('radialGradient'),
8443 rect: createDOMFactory('rect'),
8444 stop: createDOMFactory('stop'),
8445 svg: createDOMFactory('svg'),
8446 text: createDOMFactory('text'),
8447 tspan: createDOMFactory('tspan')
8448};
8449
8450module.exports = ReactDOMFactories;
8451},{"61":61,"62":62}],46:[function(_dereq_,module,exports){
8452/**
8453 * Copyright 2013-present, Facebook, Inc.
8454 * All rights reserved.
8455 *
8456 * This source code is licensed under the BSD-style license found in the
8457 * LICENSE file in the root directory of this source tree. An additional grant
8458 * of patent rights can be found in the PATENTS file in the same directory.
8459 *
8460 * @providesModule ReactDOMFeatureFlags
8461 */
8462
8463'use strict';
8464
8465var ReactDOMFeatureFlags = {
8466 useCreateElement: true
8467};
8468
8469module.exports = ReactDOMFeatureFlags;
8470},{}],47:[function(_dereq_,module,exports){
8471/**
8472 * Copyright 2013-present, Facebook, Inc.
8473 * All rights reserved.
8474 *
8475 * This source code is licensed under the BSD-style license found in the
8476 * LICENSE file in the root directory of this source tree. An additional grant
8477 * of patent rights can be found in the PATENTS file in the same directory.
8478 *
8479 * @providesModule ReactDOMIDOperations
8480 */
8481
8482'use strict';
8483
8484var DOMChildrenOperations = _dereq_(7);
8485var ReactDOMComponentTree = _dereq_(42);
8486
8487/**
8488 * Operations used to process updates to DOM nodes.
8489 */
8490var ReactDOMIDOperations = {
8491
8492 /**
8493 * Updates a component's children by processing a series of updates.
8494 *
8495 * @param {array<object>} updates List of update configurations.
8496 * @internal
8497 */
8498 dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
8499 var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
8500 DOMChildrenOperations.processUpdates(node, updates);
8501 }
8502};
8503
8504module.exports = ReactDOMIDOperations;
8505},{"42":42,"7":7}],48:[function(_dereq_,module,exports){
8506/**
8507 * Copyright 2013-present, Facebook, Inc.
8508 * All rights reserved.
8509 *
8510 * This source code is licensed under the BSD-style license found in the
8511 * LICENSE file in the root directory of this source tree. An additional grant
8512 * of patent rights can be found in the PATENTS file in the same directory.
8513 *
8514 * @providesModule ReactDOMInput
8515 */
8516
8517'use strict';
8518
8519var _prodInvariant = _dereq_(140),
8520 _assign = _dereq_(172);
8521
8522var DisabledInputUtils = _dereq_(14);
8523var DOMPropertyOperations = _dereq_(11);
8524var LinkedValueUtils = _dereq_(24);
8525var ReactDOMComponentTree = _dereq_(42);
8526var ReactUpdates = _dereq_(96);
8527
8528var invariant = _dereq_(162);
8529var warning = _dereq_(171);
8530
8531var didWarnValueLink = false;
8532var didWarnCheckedLink = false;
8533var didWarnValueDefaultValue = false;
8534var didWarnCheckedDefaultChecked = false;
8535var didWarnControlledToUncontrolled = false;
8536var didWarnUncontrolledToControlled = false;
8537
8538function forceUpdateIfMounted() {
8539 if (this._rootNodeID) {
8540 // DOM component is still mounted; update
8541 ReactDOMInput.updateWrapper(this);
8542 }
8543}
8544
8545function isControlled(props) {
8546 var usesChecked = props.type === 'checkbox' || props.type === 'radio';
8547 return usesChecked ? props.checked != null : props.value != null;
8548}
8549
8550/**
8551 * Implements an <input> host component that allows setting these optional
8552 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
8553 *
8554 * If `checked` or `value` are not supplied (or null/undefined), user actions
8555 * that affect the checked state or value will trigger updates to the element.
8556 *
8557 * If they are supplied (and not null/undefined), the rendered element will not
8558 * trigger updates to the element. Instead, the props must change in order for
8559 * the rendered element to be updated.
8560 *
8561 * The rendered element will be initialized as unchecked (or `defaultChecked`)
8562 * with an empty value (or `defaultValue`).
8563 *
8564 * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
8565 */
8566var ReactDOMInput = {
8567 getHostProps: function (inst, props) {
8568 var value = LinkedValueUtils.getValue(props);
8569 var checked = LinkedValueUtils.getChecked(props);
8570
8571 var hostProps = _assign({
8572 // Make sure we set .type before any other properties (setting .value
8573 // before .type means .value is lost in IE11 and below)
8574 type: undefined,
8575 // Make sure we set .step before .value (setting .value before .step
8576 // means .value is rounded on mount, based upon step precision)
8577 step: undefined,
8578 // Make sure we set .min & .max before .value (to ensure proper order
8579 // in corner cases such as min or max deriving from value, e.g. Issue #7170)
8580 min: undefined,
8581 max: undefined
8582 }, DisabledInputUtils.getHostProps(inst, props), {
8583 defaultChecked: undefined,
8584 defaultValue: undefined,
8585 value: value != null ? value : inst._wrapperState.initialValue,
8586 checked: checked != null ? checked : inst._wrapperState.initialChecked,
8587 onChange: inst._wrapperState.onChange
8588 });
8589
8590 return hostProps;
8591 },
8592
8593 mountWrapper: function (inst, props) {
8594 if ("development" !== 'production') {
8595 LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
8596
8597 var owner = inst._currentElement._owner;
8598
8599 if (props.valueLink !== undefined && !didWarnValueLink) {
8600 "development" !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
8601 didWarnValueLink = true;
8602 }
8603 if (props.checkedLink !== undefined && !didWarnCheckedLink) {
8604 "development" !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
8605 didWarnCheckedLink = true;
8606 }
8607 if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
8608 "development" !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
8609 didWarnCheckedDefaultChecked = true;
8610 }
8611 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
8612 "development" !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
8613 didWarnValueDefaultValue = true;
8614 }
8615 }
8616
8617 var defaultValue = props.defaultValue;
8618 inst._wrapperState = {
8619 initialChecked: props.checked != null ? props.checked : props.defaultChecked,
8620 initialValue: props.value != null ? props.value : defaultValue,
8621 listeners: null,
8622 onChange: _handleChange.bind(inst)
8623 };
8624
8625 if ("development" !== 'production') {
8626 inst._wrapperState.controlled = isControlled(props);
8627 }
8628 },
8629
8630 updateWrapper: function (inst) {
8631 var props = inst._currentElement.props;
8632
8633 if ("development" !== 'production') {
8634 var controlled = isControlled(props);
8635 var owner = inst._currentElement._owner;
8636
8637 if (!inst._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
8638 "development" !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
8639 didWarnUncontrolledToControlled = true;
8640 }
8641 if (inst._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
8642 "development" !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
8643 didWarnControlledToUncontrolled = true;
8644 }
8645 }
8646
8647 // TODO: Shouldn't this be getChecked(props)?
8648 var checked = props.checked;
8649 if (checked != null) {
8650 DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
8651 }
8652
8653 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
8654 var value = LinkedValueUtils.getValue(props);
8655 if (value != null) {
8656
8657 // Cast `value` to a string to ensure the value is set correctly. While
8658 // browsers typically do this as necessary, jsdom doesn't.
8659 var newValue = '' + value;
8660
8661 // To avoid side effects (such as losing text selection), only set value if changed
8662 if (newValue !== node.value) {
8663 node.value = newValue;
8664 }
8665 } else {
8666 if (props.value == null && props.defaultValue != null) {
8667 node.defaultValue = '' + props.defaultValue;
8668 }
8669 if (props.checked == null && props.defaultChecked != null) {
8670 node.defaultChecked = !!props.defaultChecked;
8671 }
8672 }
8673 },
8674
8675 postMountWrapper: function (inst) {
8676 var props = inst._currentElement.props;
8677
8678 // This is in postMount because we need access to the DOM node, which is not
8679 // available until after the component has mounted.
8680 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
8681
8682 // Detach value from defaultValue. We won't do anything if we're working on
8683 // submit or reset inputs as those values & defaultValues are linked. They
8684 // are not resetable nodes so this operation doesn't matter and actually
8685 // removes browser-default values (eg "Submit Query") when no value is
8686 // provided.
8687
8688 switch (props.type) {
8689 case 'submit':
8690 case 'reset':
8691 break;
8692 case 'color':
8693 case 'date':
8694 case 'datetime':
8695 case 'datetime-local':
8696 case 'month':
8697 case 'time':
8698 case 'week':
8699 // This fixes the no-show issue on iOS Safari and Android Chrome:
8700 // https://github.com/facebook/react/issues/7233
8701 node.value = '';
8702 node.value = node.defaultValue;
8703 break;
8704 default:
8705 node.value = node.value;
8706 break;
8707 }
8708
8709 // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
8710 // this is needed to work around a chrome bug where setting defaultChecked
8711 // will sometimes influence the value of checked (even after detachment).
8712 // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
8713 // We need to temporarily unset name to avoid disrupting radio button groups.
8714 var name = node.name;
8715 if (name !== '') {
8716 node.name = '';
8717 }
8718 node.defaultChecked = !node.defaultChecked;
8719 node.defaultChecked = !node.defaultChecked;
8720 if (name !== '') {
8721 node.name = name;
8722 }
8723 }
8724};
8725
8726function _handleChange(event) {
8727 var props = this._currentElement.props;
8728
8729 var returnValue = LinkedValueUtils.executeOnChange(props, event);
8730
8731 // Here we use asap to wait until all updates have propagated, which
8732 // is important when using controlled components within layers:
8733 // https://github.com/facebook/react/issues/1698
8734 ReactUpdates.asap(forceUpdateIfMounted, this);
8735
8736 var name = props.name;
8737 if (props.type === 'radio' && name != null) {
8738 var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
8739 var queryRoot = rootNode;
8740
8741 while (queryRoot.parentNode) {
8742 queryRoot = queryRoot.parentNode;
8743 }
8744
8745 // If `rootNode.form` was non-null, then we could try `form.elements`,
8746 // but that sometimes behaves strangely in IE8. We could also try using
8747 // `form.getElementsByName`, but that will only return direct children
8748 // and won't include inputs that use the HTML5 `form=` attribute. Since
8749 // the input might not even be in a form, let's just use the global
8750 // `querySelectorAll` to ensure we don't miss anything.
8751 var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
8752
8753 for (var i = 0; i < group.length; i++) {
8754 var otherNode = group[i];
8755 if (otherNode === rootNode || otherNode.form !== rootNode.form) {
8756 continue;
8757 }
8758 // This will throw if radio buttons rendered by different copies of React
8759 // and the same name are rendered into the same form (same as #1939).
8760 // That's probably okay; we don't support it just as we don't support
8761 // mixing React radio buttons with non-React ones.
8762 var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
8763 !otherInstance ? "development" !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : _prodInvariant('90') : void 0;
8764 // If this is a controlled radio button group, forcing the input that
8765 // was previously checked to update will cause it to be come re-checked
8766 // as appropriate.
8767 ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
8768 }
8769 }
8770
8771 return returnValue;
8772}
8773
8774module.exports = ReactDOMInput;
8775},{"11":11,"14":14,"140":140,"162":162,"171":171,"172":172,"24":24,"42":42,"96":96}],49:[function(_dereq_,module,exports){
8776/**
8777 * Copyright 2013-present, Facebook, Inc.
8778 * All rights reserved.
8779 *
8780 * This source code is licensed under the BSD-style license found in the
8781 * LICENSE file in the root directory of this source tree. An additional grant
8782 * of patent rights can be found in the PATENTS file in the same directory.
8783 *
8784 * @providesModule ReactDOMNullInputValuePropHook
8785 */
8786
8787'use strict';
8788
8789var ReactComponentTreeHook = _dereq_(35);
8790
8791var warning = _dereq_(171);
8792
8793var didWarnValueNull = false;
8794
8795function handleElement(debugID, element) {
8796 if (element == null) {
8797 return;
8798 }
8799 if (element.type !== 'input' && element.type !== 'textarea' && element.type !== 'select') {
8800 return;
8801 }
8802 if (element.props != null && element.props.value === null && !didWarnValueNull) {
8803 "development" !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
8804
8805 didWarnValueNull = true;
8806 }
8807}
8808
8809var ReactDOMNullInputValuePropHook = {
8810 onBeforeMountComponent: function (debugID, element) {
8811 handleElement(debugID, element);
8812 },
8813 onBeforeUpdateComponent: function (debugID, element) {
8814 handleElement(debugID, element);
8815 }
8816};
8817
8818module.exports = ReactDOMNullInputValuePropHook;
8819},{"171":171,"35":35}],50:[function(_dereq_,module,exports){
8820/**
8821 * Copyright 2013-present, Facebook, Inc.
8822 * All rights reserved.
8823 *
8824 * This source code is licensed under the BSD-style license found in the
8825 * LICENSE file in the root directory of this source tree. An additional grant
8826 * of patent rights can be found in the PATENTS file in the same directory.
8827 *
8828 * @providesModule ReactDOMOption
8829 */
8830
8831'use strict';
8832
8833var _assign = _dereq_(172);
8834
8835var ReactChildren = _dereq_(29);
8836var ReactDOMComponentTree = _dereq_(42);
8837var ReactDOMSelect = _dereq_(51);
8838
8839var warning = _dereq_(171);
8840var didWarnInvalidOptionChildren = false;
8841
8842function flattenChildren(children) {
8843 var content = '';
8844
8845 // Flatten children and warn if they aren't strings or numbers;
8846 // invalid types are ignored.
8847 ReactChildren.forEach(children, function (child) {
8848 if (child == null) {
8849 return;
8850 }
8851 if (typeof child === 'string' || typeof child === 'number') {
8852 content += child;
8853 } else if (!didWarnInvalidOptionChildren) {
8854 didWarnInvalidOptionChildren = true;
8855 "development" !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
8856 }
8857 });
8858
8859 return content;
8860}
8861
8862/**
8863 * Implements an <option> host component that warns when `selected` is set.
8864 */
8865var ReactDOMOption = {
8866 mountWrapper: function (inst, props, hostParent) {
8867 // TODO (yungsters): Remove support for `selected` in <option>.
8868 if ("development" !== 'production') {
8869 "development" !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
8870 }
8871
8872 // Look up whether this option is 'selected'
8873 var selectValue = null;
8874 if (hostParent != null) {
8875 var selectParent = hostParent;
8876
8877 if (selectParent._tag === 'optgroup') {
8878 selectParent = selectParent._hostParent;
8879 }
8880
8881 if (selectParent != null && selectParent._tag === 'select') {
8882 selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
8883 }
8884 }
8885
8886 // If the value is null (e.g., no specified value or after initial mount)
8887 // or missing (e.g., for <datalist>), we don't change props.selected
8888 var selected = null;
8889 if (selectValue != null) {
8890 var value;
8891 if (props.value != null) {
8892 value = props.value + '';
8893 } else {
8894 value = flattenChildren(props.children);
8895 }
8896 selected = false;
8897 if (Array.isArray(selectValue)) {
8898 // multiple
8899 for (var i = 0; i < selectValue.length; i++) {
8900 if ('' + selectValue[i] === value) {
8901 selected = true;
8902 break;
8903 }
8904 }
8905 } else {
8906 selected = '' + selectValue === value;
8907 }
8908 }
8909
8910 inst._wrapperState = { selected: selected };
8911 },
8912
8913 postMountWrapper: function (inst) {
8914 // value="" should make a value attribute (#6219)
8915 var props = inst._currentElement.props;
8916 if (props.value != null) {
8917 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
8918 node.setAttribute('value', props.value);
8919 }
8920 },
8921
8922 getHostProps: function (inst, props) {
8923 var hostProps = _assign({ selected: undefined, children: undefined }, props);
8924
8925 // Read state only from initial mount because <select> updates value
8926 // manually; we need the initial state only for server rendering
8927 if (inst._wrapperState.selected != null) {
8928 hostProps.selected = inst._wrapperState.selected;
8929 }
8930
8931 var content = flattenChildren(props.children);
8932
8933 if (content) {
8934 hostProps.children = content;
8935 }
8936
8937 return hostProps;
8938 }
8939
8940};
8941
8942module.exports = ReactDOMOption;
8943},{"171":171,"172":172,"29":29,"42":42,"51":51}],51:[function(_dereq_,module,exports){
8944/**
8945 * Copyright 2013-present, Facebook, Inc.
8946 * All rights reserved.
8947 *
8948 * This source code is licensed under the BSD-style license found in the
8949 * LICENSE file in the root directory of this source tree. An additional grant
8950 * of patent rights can be found in the PATENTS file in the same directory.
8951 *
8952 * @providesModule ReactDOMSelect
8953 */
8954
8955'use strict';
8956
8957var _assign = _dereq_(172);
8958
8959var DisabledInputUtils = _dereq_(14);
8960var LinkedValueUtils = _dereq_(24);
8961var ReactDOMComponentTree = _dereq_(42);
8962var ReactUpdates = _dereq_(96);
8963
8964var warning = _dereq_(171);
8965
8966var didWarnValueLink = false;
8967var didWarnValueDefaultValue = false;
8968
8969function updateOptionsIfPendingUpdateAndMounted() {
8970 if (this._rootNodeID && this._wrapperState.pendingUpdate) {
8971 this._wrapperState.pendingUpdate = false;
8972
8973 var props = this._currentElement.props;
8974 var value = LinkedValueUtils.getValue(props);
8975
8976 if (value != null) {
8977 updateOptions(this, Boolean(props.multiple), value);
8978 }
8979 }
8980}
8981
8982function getDeclarationErrorAddendum(owner) {
8983 if (owner) {
8984 var name = owner.getName();
8985 if (name) {
8986 return ' Check the render method of `' + name + '`.';
8987 }
8988 }
8989 return '';
8990}
8991
8992var valuePropNames = ['value', 'defaultValue'];
8993
8994/**
8995 * Validation function for `value` and `defaultValue`.
8996 * @private
8997 */
8998function checkSelectPropTypes(inst, props) {
8999 var owner = inst._currentElement._owner;
9000 LinkedValueUtils.checkPropTypes('select', props, owner);
9001
9002 if (props.valueLink !== undefined && !didWarnValueLink) {
9003 "development" !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
9004 didWarnValueLink = true;
9005 }
9006
9007 for (var i = 0; i < valuePropNames.length; i++) {
9008 var propName = valuePropNames[i];
9009 if (props[propName] == null) {
9010 continue;
9011 }
9012 var isArray = Array.isArray(props[propName]);
9013 if (props.multiple && !isArray) {
9014 "development" !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
9015 } else if (!props.multiple && isArray) {
9016 "development" !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
9017 }
9018 }
9019}
9020
9021/**
9022 * @param {ReactDOMComponent} inst
9023 * @param {boolean} multiple
9024 * @param {*} propValue A stringable (with `multiple`, a list of stringables).
9025 * @private
9026 */
9027function updateOptions(inst, multiple, propValue) {
9028 var selectedValue, i;
9029 var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
9030
9031 if (multiple) {
9032 selectedValue = {};
9033 for (i = 0; i < propValue.length; i++) {
9034 selectedValue['' + propValue[i]] = true;
9035 }
9036 for (i = 0; i < options.length; i++) {
9037 var selected = selectedValue.hasOwnProperty(options[i].value);
9038 if (options[i].selected !== selected) {
9039 options[i].selected = selected;
9040 }
9041 }
9042 } else {
9043 // Do not set `select.value` as exact behavior isn't consistent across all
9044 // browsers for all cases.
9045 selectedValue = '' + propValue;
9046 for (i = 0; i < options.length; i++) {
9047 if (options[i].value === selectedValue) {
9048 options[i].selected = true;
9049 return;
9050 }
9051 }
9052 if (options.length) {
9053 options[0].selected = true;
9054 }
9055 }
9056}
9057
9058/**
9059 * Implements a <select> host component that allows optionally setting the
9060 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
9061 * stringable. If `multiple` is true, the prop must be an array of stringables.
9062 *
9063 * If `value` is not supplied (or null/undefined), user actions that change the
9064 * selected option will trigger updates to the rendered options.
9065 *
9066 * If it is supplied (and not null/undefined), the rendered options will not
9067 * update in response to user actions. Instead, the `value` prop must change in
9068 * order for the rendered options to update.
9069 *
9070 * If `defaultValue` is provided, any options with the supplied values will be
9071 * selected.
9072 */
9073var ReactDOMSelect = {
9074 getHostProps: function (inst, props) {
9075 return _assign({}, DisabledInputUtils.getHostProps(inst, props), {
9076 onChange: inst._wrapperState.onChange,
9077 value: undefined
9078 });
9079 },
9080
9081 mountWrapper: function (inst, props) {
9082 if ("development" !== 'production') {
9083 checkSelectPropTypes(inst, props);
9084 }
9085
9086 var value = LinkedValueUtils.getValue(props);
9087 inst._wrapperState = {
9088 pendingUpdate: false,
9089 initialValue: value != null ? value : props.defaultValue,
9090 listeners: null,
9091 onChange: _handleChange.bind(inst),
9092 wasMultiple: Boolean(props.multiple)
9093 };
9094
9095 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
9096 "development" !== 'production' ? warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
9097 didWarnValueDefaultValue = true;
9098 }
9099 },
9100
9101 getSelectValueContext: function (inst) {
9102 // ReactDOMOption looks at this initial value so the initial generated
9103 // markup has correct `selected` attributes
9104 return inst._wrapperState.initialValue;
9105 },
9106
9107 postUpdateWrapper: function (inst) {
9108 var props = inst._currentElement.props;
9109
9110 // After the initial mount, we control selected-ness manually so don't pass
9111 // this value down
9112 inst._wrapperState.initialValue = undefined;
9113
9114 var wasMultiple = inst._wrapperState.wasMultiple;
9115 inst._wrapperState.wasMultiple = Boolean(props.multiple);
9116
9117 var value = LinkedValueUtils.getValue(props);
9118 if (value != null) {
9119 inst._wrapperState.pendingUpdate = false;
9120 updateOptions(inst, Boolean(props.multiple), value);
9121 } else if (wasMultiple !== Boolean(props.multiple)) {
9122 // For simplicity, reapply `defaultValue` if `multiple` is toggled.
9123 if (props.defaultValue != null) {
9124 updateOptions(inst, Boolean(props.multiple), props.defaultValue);
9125 } else {
9126 // Revert the select back to its default unselected state.
9127 updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
9128 }
9129 }
9130 }
9131};
9132
9133function _handleChange(event) {
9134 var props = this._currentElement.props;
9135 var returnValue = LinkedValueUtils.executeOnChange(props, event);
9136
9137 if (this._rootNodeID) {
9138 this._wrapperState.pendingUpdate = true;
9139 }
9140 ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
9141 return returnValue;
9142}
9143
9144module.exports = ReactDOMSelect;
9145},{"14":14,"171":171,"172":172,"24":24,"42":42,"96":96}],52:[function(_dereq_,module,exports){
9146/**
9147 * Copyright 2013-present, Facebook, Inc.
9148 * All rights reserved.
9149 *
9150 * This source code is licensed under the BSD-style license found in the
9151 * LICENSE file in the root directory of this source tree. An additional grant
9152 * of patent rights can be found in the PATENTS file in the same directory.
9153 *
9154 * @providesModule ReactDOMSelection
9155 */
9156
9157'use strict';
9158
9159var ExecutionEnvironment = _dereq_(148);
9160
9161var getNodeForCharacterOffset = _dereq_(132);
9162var getTextContentAccessor = _dereq_(133);
9163
9164/**
9165 * While `isCollapsed` is available on the Selection object and `collapsed`
9166 * is available on the Range object, IE11 sometimes gets them wrong.
9167 * If the anchor/focus nodes and offsets are the same, the range is collapsed.
9168 */
9169function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
9170 return anchorNode === focusNode && anchorOffset === focusOffset;
9171}
9172
9173/**
9174 * Get the appropriate anchor and focus node/offset pairs for IE.
9175 *
9176 * The catch here is that IE's selection API doesn't provide information
9177 * about whether the selection is forward or backward, so we have to
9178 * behave as though it's always forward.
9179 *
9180 * IE text differs from modern selection in that it behaves as though
9181 * block elements end with a new line. This means character offsets will
9182 * differ between the two APIs.
9183 *
9184 * @param {DOMElement} node
9185 * @return {object}
9186 */
9187function getIEOffsets(node) {
9188 var selection = document.selection;
9189 var selectedRange = selection.createRange();
9190 var selectedLength = selectedRange.text.length;
9191
9192 // Duplicate selection so we can move range without breaking user selection.
9193 var fromStart = selectedRange.duplicate();
9194 fromStart.moveToElementText(node);
9195 fromStart.setEndPoint('EndToStart', selectedRange);
9196
9197 var startOffset = fromStart.text.length;
9198 var endOffset = startOffset + selectedLength;
9199
9200 return {
9201 start: startOffset,
9202 end: endOffset
9203 };
9204}
9205
9206/**
9207 * @param {DOMElement} node
9208 * @return {?object}
9209 */
9210function getModernOffsets(node) {
9211 var selection = window.getSelection && window.getSelection();
9212
9213 if (!selection || selection.rangeCount === 0) {
9214 return null;
9215 }
9216
9217 var anchorNode = selection.anchorNode;
9218 var anchorOffset = selection.anchorOffset;
9219 var focusNode = selection.focusNode;
9220 var focusOffset = selection.focusOffset;
9221
9222 var currentRange = selection.getRangeAt(0);
9223
9224 // In Firefox, range.startContainer and range.endContainer can be "anonymous
9225 // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
9226 // divs do not seem to expose properties, triggering a "Permission denied
9227 // error" if any of its properties are accessed. The only seemingly possible
9228 // way to avoid erroring is to access a property that typically works for
9229 // non-anonymous divs and catch any error that may otherwise arise. See
9230 // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
9231 try {
9232 /* eslint-disable no-unused-expressions */
9233 currentRange.startContainer.nodeType;
9234 currentRange.endContainer.nodeType;
9235 /* eslint-enable no-unused-expressions */
9236 } catch (e) {
9237 return null;
9238 }
9239
9240 // If the node and offset values are the same, the selection is collapsed.
9241 // `Selection.isCollapsed` is available natively, but IE sometimes gets
9242 // this value wrong.
9243 var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
9244
9245 var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
9246
9247 var tempRange = currentRange.cloneRange();
9248 tempRange.selectNodeContents(node);
9249 tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
9250
9251 var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
9252
9253 var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
9254 var end = start + rangeLength;
9255
9256 // Detect whether the selection is backward.
9257 var detectionRange = document.createRange();
9258 detectionRange.setStart(anchorNode, anchorOffset);
9259 detectionRange.setEnd(focusNode, focusOffset);
9260 var isBackward = detectionRange.collapsed;
9261
9262 return {
9263 start: isBackward ? end : start,
9264 end: isBackward ? start : end
9265 };
9266}
9267
9268/**
9269 * @param {DOMElement|DOMTextNode} node
9270 * @param {object} offsets
9271 */
9272function setIEOffsets(node, offsets) {
9273 var range = document.selection.createRange().duplicate();
9274 var start, end;
9275
9276 if (offsets.end === undefined) {
9277 start = offsets.start;
9278 end = start;
9279 } else if (offsets.start > offsets.end) {
9280 start = offsets.end;
9281 end = offsets.start;
9282 } else {
9283 start = offsets.start;
9284 end = offsets.end;
9285 }
9286
9287 range.moveToElementText(node);
9288 range.moveStart('character', start);
9289 range.setEndPoint('EndToStart', range);
9290 range.moveEnd('character', end - start);
9291 range.select();
9292}
9293
9294/**
9295 * In modern non-IE browsers, we can support both forward and backward
9296 * selections.
9297 *
9298 * Note: IE10+ supports the Selection object, but it does not support
9299 * the `extend` method, which means that even in modern IE, it's not possible
9300 * to programmatically create a backward selection. Thus, for all IE
9301 * versions, we use the old IE API to create our selections.
9302 *
9303 * @param {DOMElement|DOMTextNode} node
9304 * @param {object} offsets
9305 */
9306function setModernOffsets(node, offsets) {
9307 if (!window.getSelection) {
9308 return;
9309 }
9310
9311 var selection = window.getSelection();
9312 var length = node[getTextContentAccessor()].length;
9313 var start = Math.min(offsets.start, length);
9314 var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
9315
9316 // IE 11 uses modern selection, but doesn't support the extend method.
9317 // Flip backward selections, so we can set with a single range.
9318 if (!selection.extend && start > end) {
9319 var temp = end;
9320 end = start;
9321 start = temp;
9322 }
9323
9324 var startMarker = getNodeForCharacterOffset(node, start);
9325 var endMarker = getNodeForCharacterOffset(node, end);
9326
9327 if (startMarker && endMarker) {
9328 var range = document.createRange();
9329 range.setStart(startMarker.node, startMarker.offset);
9330 selection.removeAllRanges();
9331
9332 if (start > end) {
9333 selection.addRange(range);
9334 selection.extend(endMarker.node, endMarker.offset);
9335 } else {
9336 range.setEnd(endMarker.node, endMarker.offset);
9337 selection.addRange(range);
9338 }
9339 }
9340}
9341
9342var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
9343
9344var ReactDOMSelection = {
9345 /**
9346 * @param {DOMElement} node
9347 */
9348 getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
9349
9350 /**
9351 * @param {DOMElement|DOMTextNode} node
9352 * @param {object} offsets
9353 */
9354 setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
9355};
9356
9357module.exports = ReactDOMSelection;
9358},{"132":132,"133":133,"148":148}],53:[function(_dereq_,module,exports){
9359/**
9360 * Copyright 2013-present, Facebook, Inc.
9361 * All rights reserved.
9362 *
9363 * This source code is licensed under the BSD-style license found in the
9364 * LICENSE file in the root directory of this source tree. An additional grant
9365 * of patent rights can be found in the PATENTS file in the same directory.
9366 *
9367 * @providesModule ReactDOMServer
9368 */
9369
9370'use strict';
9371
9372var ReactDefaultInjection = _dereq_(60);
9373var ReactServerRendering = _dereq_(91);
9374var ReactVersion = _dereq_(97);
9375
9376ReactDefaultInjection.inject();
9377
9378var ReactDOMServer = {
9379 renderToString: ReactServerRendering.renderToString,
9380 renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
9381 version: ReactVersion
9382};
9383
9384module.exports = ReactDOMServer;
9385},{"60":60,"91":91,"97":97}],54:[function(_dereq_,module,exports){
9386/**
9387 * Copyright 2013-present, Facebook, Inc.
9388 * All rights reserved.
9389 *
9390 * This source code is licensed under the BSD-style license found in the
9391 * LICENSE file in the root directory of this source tree. An additional grant
9392 * of patent rights can be found in the PATENTS file in the same directory.
9393 *
9394 * @providesModule ReactDOMTextComponent
9395 */
9396
9397'use strict';
9398
9399var _prodInvariant = _dereq_(140),
9400 _assign = _dereq_(172);
9401
9402var DOMChildrenOperations = _dereq_(7);
9403var DOMLazyTree = _dereq_(8);
9404var ReactDOMComponentTree = _dereq_(42);
9405
9406var escapeTextContentForBrowser = _dereq_(122);
9407var invariant = _dereq_(162);
9408var validateDOMNesting = _dereq_(146);
9409
9410/**
9411 * Text nodes violate a couple assumptions that React makes about components:
9412 *
9413 * - When mounting text into the DOM, adjacent text nodes are merged.
9414 * - Text nodes cannot be assigned a React root ID.
9415 *
9416 * This component is used to wrap strings between comment nodes so that they
9417 * can undergo the same reconciliation that is applied to elements.
9418 *
9419 * TODO: Investigate representing React components in the DOM with text nodes.
9420 *
9421 * @class ReactDOMTextComponent
9422 * @extends ReactComponent
9423 * @internal
9424 */
9425var ReactDOMTextComponent = function (text) {
9426 // TODO: This is really a ReactText (ReactNode), not a ReactElement
9427 this._currentElement = text;
9428 this._stringText = '' + text;
9429 // ReactDOMComponentTree uses these:
9430 this._hostNode = null;
9431 this._hostParent = null;
9432
9433 // Properties
9434 this._domID = 0;
9435 this._mountIndex = 0;
9436 this._closingComment = null;
9437 this._commentNodes = null;
9438};
9439
9440_assign(ReactDOMTextComponent.prototype, {
9441
9442 /**
9443 * Creates the markup for this text node. This node is not intended to have
9444 * any features besides containing text content.
9445 *
9446 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
9447 * @return {string} Markup for this text node.
9448 * @internal
9449 */
9450 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
9451 if ("development" !== 'production') {
9452 var parentInfo;
9453 if (hostParent != null) {
9454 parentInfo = hostParent._ancestorInfo;
9455 } else if (hostContainerInfo != null) {
9456 parentInfo = hostContainerInfo._ancestorInfo;
9457 }
9458 if (parentInfo) {
9459 // parentInfo should always be present except for the top-level
9460 // component when server rendering
9461 validateDOMNesting(null, this._stringText, this, parentInfo);
9462 }
9463 }
9464
9465 var domID = hostContainerInfo._idCounter++;
9466 var openingValue = ' react-text: ' + domID + ' ';
9467 var closingValue = ' /react-text ';
9468 this._domID = domID;
9469 this._hostParent = hostParent;
9470 if (transaction.useCreateElement) {
9471 var ownerDocument = hostContainerInfo._ownerDocument;
9472 var openingComment = ownerDocument.createComment(openingValue);
9473 var closingComment = ownerDocument.createComment(closingValue);
9474 var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
9475 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
9476 if (this._stringText) {
9477 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
9478 }
9479 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
9480 ReactDOMComponentTree.precacheNode(this, openingComment);
9481 this._closingComment = closingComment;
9482 return lazyTree;
9483 } else {
9484 var escapedText = escapeTextContentForBrowser(this._stringText);
9485
9486 if (transaction.renderToStaticMarkup) {
9487 // Normally we'd wrap this between comment nodes for the reasons stated
9488 // above, but since this is a situation where React won't take over
9489 // (static pages), we can simply return the text as it is.
9490 return escapedText;
9491 }
9492
9493 return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
9494 }
9495 },
9496
9497 /**
9498 * Updates this component by updating the text content.
9499 *
9500 * @param {ReactText} nextText The next text content
9501 * @param {ReactReconcileTransaction} transaction
9502 * @internal
9503 */
9504 receiveComponent: function (nextText, transaction) {
9505 if (nextText !== this._currentElement) {
9506 this._currentElement = nextText;
9507 var nextStringText = '' + nextText;
9508 if (nextStringText !== this._stringText) {
9509 // TODO: Save this as pending props and use performUpdateIfNecessary
9510 // and/or updateComponent to do the actual update for consistency with
9511 // other component types?
9512 this._stringText = nextStringText;
9513 var commentNodes = this.getHostNode();
9514 DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
9515 }
9516 }
9517 },
9518
9519 getHostNode: function () {
9520 var hostNode = this._commentNodes;
9521 if (hostNode) {
9522 return hostNode;
9523 }
9524 if (!this._closingComment) {
9525 var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
9526 var node = openingComment.nextSibling;
9527 while (true) {
9528 !(node != null) ? "development" !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : _prodInvariant('67', this._domID) : void 0;
9529 if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
9530 this._closingComment = node;
9531 break;
9532 }
9533 node = node.nextSibling;
9534 }
9535 }
9536 hostNode = [this._hostNode, this._closingComment];
9537 this._commentNodes = hostNode;
9538 return hostNode;
9539 },
9540
9541 unmountComponent: function () {
9542 this._closingComment = null;
9543 this._commentNodes = null;
9544 ReactDOMComponentTree.uncacheNode(this);
9545 }
9546
9547});
9548
9549module.exports = ReactDOMTextComponent;
9550},{"122":122,"140":140,"146":146,"162":162,"172":172,"42":42,"7":7,"8":8}],55:[function(_dereq_,module,exports){
9551/**
9552 * Copyright 2013-present, Facebook, Inc.
9553 * All rights reserved.
9554 *
9555 * This source code is licensed under the BSD-style license found in the
9556 * LICENSE file in the root directory of this source tree. An additional grant
9557 * of patent rights can be found in the PATENTS file in the same directory.
9558 *
9559 * @providesModule ReactDOMTextarea
9560 */
9561
9562'use strict';
9563
9564var _prodInvariant = _dereq_(140),
9565 _assign = _dereq_(172);
9566
9567var DisabledInputUtils = _dereq_(14);
9568var LinkedValueUtils = _dereq_(24);
9569var ReactDOMComponentTree = _dereq_(42);
9570var ReactUpdates = _dereq_(96);
9571
9572var invariant = _dereq_(162);
9573var warning = _dereq_(171);
9574
9575var didWarnValueLink = false;
9576var didWarnValDefaultVal = false;
9577
9578function forceUpdateIfMounted() {
9579 if (this._rootNodeID) {
9580 // DOM component is still mounted; update
9581 ReactDOMTextarea.updateWrapper(this);
9582 }
9583}
9584
9585/**
9586 * Implements a <textarea> host component that allows setting `value`, and
9587 * `defaultValue`. This differs from the traditional DOM API because value is
9588 * usually set as PCDATA children.
9589 *
9590 * If `value` is not supplied (or null/undefined), user actions that affect the
9591 * value will trigger updates to the element.
9592 *
9593 * If `value` is supplied (and not null/undefined), the rendered element will
9594 * not trigger updates to the element. Instead, the `value` prop must change in
9595 * order for the rendered element to be updated.
9596 *
9597 * The rendered element will be initialized with an empty value, the prop
9598 * `defaultValue` if specified, or the children content (deprecated).
9599 */
9600var ReactDOMTextarea = {
9601 getHostProps: function (inst, props) {
9602 !(props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : _prodInvariant('91') : void 0;
9603
9604 // Always set children to the same thing. In IE9, the selection range will
9605 // get reset if `textContent` is mutated. We could add a check in setTextContent
9606 // to only set the value if/when the value differs from the node value (which would
9607 // completely solve this IE9 bug), but Sebastian+Ben seemed to like this solution.
9608 // The value can be a boolean or object so that's why it's forced to be a string.
9609 var hostProps = _assign({}, DisabledInputUtils.getHostProps(inst, props), {
9610 value: undefined,
9611 defaultValue: undefined,
9612 children: '' + inst._wrapperState.initialValue,
9613 onChange: inst._wrapperState.onChange
9614 });
9615
9616 return hostProps;
9617 },
9618
9619 mountWrapper: function (inst, props) {
9620 if ("development" !== 'production') {
9621 LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
9622 if (props.valueLink !== undefined && !didWarnValueLink) {
9623 "development" !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
9624 didWarnValueLink = true;
9625 }
9626 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
9627 "development" !== 'production' ? warning(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
9628 didWarnValDefaultVal = true;
9629 }
9630 }
9631
9632 var value = LinkedValueUtils.getValue(props);
9633 var initialValue = value;
9634
9635 // Only bother fetching default value if we're going to use it
9636 if (value == null) {
9637 var defaultValue = props.defaultValue;
9638 // TODO (yungsters): Remove support for children content in <textarea>.
9639 var children = props.children;
9640 if (children != null) {
9641 if ("development" !== 'production') {
9642 "development" !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
9643 }
9644 !(defaultValue == null) ? "development" !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : _prodInvariant('92') : void 0;
9645 if (Array.isArray(children)) {
9646 !(children.length <= 1) ? "development" !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : _prodInvariant('93') : void 0;
9647 children = children[0];
9648 }
9649
9650 defaultValue = '' + children;
9651 }
9652 if (defaultValue == null) {
9653 defaultValue = '';
9654 }
9655 initialValue = defaultValue;
9656 }
9657
9658 inst._wrapperState = {
9659 initialValue: '' + initialValue,
9660 listeners: null,
9661 onChange: _handleChange.bind(inst)
9662 };
9663 },
9664
9665 updateWrapper: function (inst) {
9666 var props = inst._currentElement.props;
9667
9668 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
9669 var value = LinkedValueUtils.getValue(props);
9670 if (value != null) {
9671 // Cast `value` to a string to ensure the value is set correctly. While
9672 // browsers typically do this as necessary, jsdom doesn't.
9673 var newValue = '' + value;
9674
9675 // To avoid side effects (such as losing text selection), only set value if changed
9676 if (newValue !== node.value) {
9677 node.value = newValue;
9678 }
9679 if (props.defaultValue == null) {
9680 node.defaultValue = newValue;
9681 }
9682 }
9683 if (props.defaultValue != null) {
9684 node.defaultValue = props.defaultValue;
9685 }
9686 },
9687
9688 postMountWrapper: function (inst) {
9689 // This is in postMount because we need access to the DOM node, which is not
9690 // available until after the component has mounted.
9691 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
9692
9693 // Warning: node.value may be the empty string at this point (IE11) if placeholder is set.
9694 node.value = node.textContent; // Detach value from defaultValue
9695 }
9696};
9697
9698function _handleChange(event) {
9699 var props = this._currentElement.props;
9700 var returnValue = LinkedValueUtils.executeOnChange(props, event);
9701 ReactUpdates.asap(forceUpdateIfMounted, this);
9702 return returnValue;
9703}
9704
9705module.exports = ReactDOMTextarea;
9706},{"14":14,"140":140,"162":162,"171":171,"172":172,"24":24,"42":42,"96":96}],56:[function(_dereq_,module,exports){
9707/**
9708 * Copyright 2015-present, Facebook, Inc.
9709 * All rights reserved.
9710 *
9711 * This source code is licensed under the BSD-style license found in the
9712 * LICENSE file in the root directory of this source tree. An additional grant
9713 * of patent rights can be found in the PATENTS file in the same directory.
9714 *
9715 * @providesModule ReactDOMTreeTraversal
9716 */
9717
9718'use strict';
9719
9720var _prodInvariant = _dereq_(140);
9721
9722var invariant = _dereq_(162);
9723
9724/**
9725 * Return the lowest common ancestor of A and B, or null if they are in
9726 * different trees.
9727 */
9728function getLowestCommonAncestor(instA, instB) {
9729 !('_hostNode' in instA) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
9730 !('_hostNode' in instB) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
9731
9732 var depthA = 0;
9733 for (var tempA = instA; tempA; tempA = tempA._hostParent) {
9734 depthA++;
9735 }
9736 var depthB = 0;
9737 for (var tempB = instB; tempB; tempB = tempB._hostParent) {
9738 depthB++;
9739 }
9740
9741 // If A is deeper, crawl up.
9742 while (depthA - depthB > 0) {
9743 instA = instA._hostParent;
9744 depthA--;
9745 }
9746
9747 // If B is deeper, crawl up.
9748 while (depthB - depthA > 0) {
9749 instB = instB._hostParent;
9750 depthB--;
9751 }
9752
9753 // Walk in lockstep until we find a match.
9754 var depth = depthA;
9755 while (depth--) {
9756 if (instA === instB) {
9757 return instA;
9758 }
9759 instA = instA._hostParent;
9760 instB = instB._hostParent;
9761 }
9762 return null;
9763}
9764
9765/**
9766 * Return if A is an ancestor of B.
9767 */
9768function isAncestor(instA, instB) {
9769 !('_hostNode' in instA) ? "development" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
9770 !('_hostNode' in instB) ? "development" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
9771
9772 while (instB) {
9773 if (instB === instA) {
9774 return true;
9775 }
9776 instB = instB._hostParent;
9777 }
9778 return false;
9779}
9780
9781/**
9782 * Return the parent instance of the passed-in instance.
9783 */
9784function getParentInstance(inst) {
9785 !('_hostNode' in inst) ? "development" !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0;
9786
9787 return inst._hostParent;
9788}
9789
9790/**
9791 * Simulates the traversal of a two-phase, capture/bubble event dispatch.
9792 */
9793function traverseTwoPhase(inst, fn, arg) {
9794 var path = [];
9795 while (inst) {
9796 path.push(inst);
9797 inst = inst._hostParent;
9798 }
9799 var i;
9800 for (i = path.length; i-- > 0;) {
9801 fn(path[i], false, arg);
9802 }
9803 for (i = 0; i < path.length; i++) {
9804 fn(path[i], true, arg);
9805 }
9806}
9807
9808/**
9809 * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
9810 * should would receive a `mouseEnter` or `mouseLeave` event.
9811 *
9812 * Does not invoke the callback on the nearest common ancestor because nothing
9813 * "entered" or "left" that element.
9814 */
9815function traverseEnterLeave(from, to, fn, argFrom, argTo) {
9816 var common = from && to ? getLowestCommonAncestor(from, to) : null;
9817 var pathFrom = [];
9818 while (from && from !== common) {
9819 pathFrom.push(from);
9820 from = from._hostParent;
9821 }
9822 var pathTo = [];
9823 while (to && to !== common) {
9824 pathTo.push(to);
9825 to = to._hostParent;
9826 }
9827 var i;
9828 for (i = 0; i < pathFrom.length; i++) {
9829 fn(pathFrom[i], true, argFrom);
9830 }
9831 for (i = pathTo.length; i-- > 0;) {
9832 fn(pathTo[i], false, argTo);
9833 }
9834}
9835
9836module.exports = {
9837 isAncestor: isAncestor,
9838 getLowestCommonAncestor: getLowestCommonAncestor,
9839 getParentInstance: getParentInstance,
9840 traverseTwoPhase: traverseTwoPhase,
9841 traverseEnterLeave: traverseEnterLeave
9842};
9843},{"140":140,"162":162}],57:[function(_dereq_,module,exports){
9844/**
9845 * Copyright 2013-present, Facebook, Inc.
9846 * All rights reserved.
9847 *
9848 * This source code is licensed under the BSD-style license found in the
9849 * LICENSE file in the root directory of this source tree. An additional grant
9850 * of patent rights can be found in the PATENTS file in the same directory.
9851 *
9852 * @providesModule ReactDOMUnknownPropertyHook
9853 */
9854
9855'use strict';
9856
9857var DOMProperty = _dereq_(10);
9858var EventPluginRegistry = _dereq_(18);
9859var ReactComponentTreeHook = _dereq_(35);
9860
9861var warning = _dereq_(171);
9862
9863if ("development" !== 'production') {
9864 var reactProps = {
9865 children: true,
9866 dangerouslySetInnerHTML: true,
9867 key: true,
9868 ref: true,
9869
9870 autoFocus: true,
9871 defaultValue: true,
9872 valueLink: true,
9873 defaultChecked: true,
9874 checkedLink: true,
9875 innerHTML: true,
9876 suppressContentEditableWarning: true,
9877 onFocusIn: true,
9878 onFocusOut: true
9879 };
9880 var warnedProperties = {};
9881
9882 var validateProperty = function (tagName, name, debugID) {
9883 if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
9884 return true;
9885 }
9886 if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
9887 return true;
9888 }
9889 if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) {
9890 return true;
9891 }
9892 warnedProperties[name] = true;
9893 var lowerCasedName = name.toLowerCase();
9894
9895 // data-* attributes should be lowercase; suggest the lowercase version
9896 var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
9897
9898 var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
9899
9900 if (standardName != null) {
9901 "development" !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
9902 return true;
9903 } else if (registrationName != null) {
9904 "development" !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
9905 return true;
9906 } else {
9907 // We were unable to guess which prop the user intended.
9908 // It is likely that the user was just blindly spreading/forwarding props
9909 // Components should be careful to only render valid props/attributes.
9910 // Warning will be invoked in warnUnknownProperties to allow grouping.
9911 return false;
9912 }
9913 };
9914}
9915
9916var warnUnknownProperties = function (debugID, element) {
9917 var unknownProps = [];
9918 for (var key in element.props) {
9919 var isValid = validateProperty(element.type, key, debugID);
9920 if (!isValid) {
9921 unknownProps.push(key);
9922 }
9923 }
9924
9925 var unknownPropString = unknownProps.map(function (prop) {
9926 return '`' + prop + '`';
9927 }).join(', ');
9928
9929 if (unknownProps.length === 1) {
9930 "development" !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
9931 } else if (unknownProps.length > 1) {
9932 "development" !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
9933 }
9934};
9935
9936function handleElement(debugID, element) {
9937 if (element == null || typeof element.type !== 'string') {
9938 return;
9939 }
9940 if (element.type.indexOf('-') >= 0 || element.props.is) {
9941 return;
9942 }
9943 warnUnknownProperties(debugID, element);
9944}
9945
9946var ReactDOMUnknownPropertyHook = {
9947 onBeforeMountComponent: function (debugID, element) {
9948 handleElement(debugID, element);
9949 },
9950 onBeforeUpdateComponent: function (debugID, element) {
9951 handleElement(debugID, element);
9952 }
9953};
9954
9955module.exports = ReactDOMUnknownPropertyHook;
9956},{"10":10,"171":171,"18":18,"35":35}],58:[function(_dereq_,module,exports){
9957/**
9958 * Copyright 2016-present, Facebook, Inc.
9959 * All rights reserved.
9960 *
9961 * This source code is licensed under the BSD-style license found in the
9962 * LICENSE file in the root directory of this source tree. An additional grant
9963 * of patent rights can be found in the PATENTS file in the same directory.
9964 *
9965 * @providesModule ReactDebugTool
9966 */
9967
9968'use strict';
9969
9970var ReactInvalidSetStateWarningHook = _dereq_(74);
9971var ReactHostOperationHistoryHook = _dereq_(69);
9972var ReactComponentTreeHook = _dereq_(35);
9973var ReactChildrenMutationWarningHook = _dereq_(30);
9974var ExecutionEnvironment = _dereq_(148);
9975
9976var performanceNow = _dereq_(169);
9977var warning = _dereq_(171);
9978
9979var hooks = [];
9980var didHookThrowForEvent = {};
9981
9982function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
9983 try {
9984 fn.call(context, arg1, arg2, arg3, arg4, arg5);
9985 } catch (e) {
9986 "development" !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
9987 didHookThrowForEvent[event] = true;
9988 }
9989}
9990
9991function emitEvent(event, arg1, arg2, arg3, arg4, arg5) {
9992 for (var i = 0; i < hooks.length; i++) {
9993 var hook = hooks[i];
9994 var fn = hook[event];
9995 if (fn) {
9996 callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);
9997 }
9998 }
9999}
10000
10001var isProfiling = false;
10002var flushHistory = [];
10003var lifeCycleTimerStack = [];
10004var currentFlushNesting = 0;
10005var currentFlushMeasurements = null;
10006var currentFlushStartTime = null;
10007var currentTimerDebugID = null;
10008var currentTimerStartTime = null;
10009var currentTimerNestedFlushDuration = null;
10010var currentTimerType = null;
10011
10012var lifeCycleTimerHasWarned = false;
10013
10014function clearHistory() {
10015 ReactComponentTreeHook.purgeUnmountedComponents();
10016 ReactHostOperationHistoryHook.clearHistory();
10017}
10018
10019function getTreeSnapshot(registeredIDs) {
10020 return registeredIDs.reduce(function (tree, id) {
10021 var ownerID = ReactComponentTreeHook.getOwnerID(id);
10022 var parentID = ReactComponentTreeHook.getParentID(id);
10023 tree[id] = {
10024 displayName: ReactComponentTreeHook.getDisplayName(id),
10025 text: ReactComponentTreeHook.getText(id),
10026 updateCount: ReactComponentTreeHook.getUpdateCount(id),
10027 childIDs: ReactComponentTreeHook.getChildIDs(id),
10028 // Text nodes don't have owners but this is close enough.
10029 ownerID: ownerID || ReactComponentTreeHook.getOwnerID(parentID),
10030 parentID: parentID
10031 };
10032 return tree;
10033 }, {});
10034}
10035
10036function resetMeasurements() {
10037 var previousStartTime = currentFlushStartTime;
10038 var previousMeasurements = currentFlushMeasurements || [];
10039 var previousOperations = ReactHostOperationHistoryHook.getHistory();
10040
10041 if (currentFlushNesting === 0) {
10042 currentFlushStartTime = null;
10043 currentFlushMeasurements = null;
10044 clearHistory();
10045 return;
10046 }
10047
10048 if (previousMeasurements.length || previousOperations.length) {
10049 var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();
10050 flushHistory.push({
10051 duration: performanceNow() - previousStartTime,
10052 measurements: previousMeasurements || [],
10053 operations: previousOperations || [],
10054 treeSnapshot: getTreeSnapshot(registeredIDs)
10055 });
10056 }
10057
10058 clearHistory();
10059 currentFlushStartTime = performanceNow();
10060 currentFlushMeasurements = [];
10061}
10062
10063function checkDebugID(debugID) {
10064 var allowRoot = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
10065
10066 if (allowRoot && debugID === 0) {
10067 return;
10068 }
10069 if (!debugID) {
10070 "development" !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
10071 }
10072}
10073
10074function beginLifeCycleTimer(debugID, timerType) {
10075 if (currentFlushNesting === 0) {
10076 return;
10077 }
10078 if (currentTimerType && !lifeCycleTimerHasWarned) {
10079 "development" !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
10080 lifeCycleTimerHasWarned = true;
10081 }
10082 currentTimerStartTime = performanceNow();
10083 currentTimerNestedFlushDuration = 0;
10084 currentTimerDebugID = debugID;
10085 currentTimerType = timerType;
10086}
10087
10088function endLifeCycleTimer(debugID, timerType) {
10089 if (currentFlushNesting === 0) {
10090 return;
10091 }
10092 if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) {
10093 "development" !== 'production' ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
10094 lifeCycleTimerHasWarned = true;
10095 }
10096 if (isProfiling) {
10097 currentFlushMeasurements.push({
10098 timerType: timerType,
10099 instanceID: debugID,
10100 duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration
10101 });
10102 }
10103 currentTimerStartTime = null;
10104 currentTimerNestedFlushDuration = null;
10105 currentTimerDebugID = null;
10106 currentTimerType = null;
10107}
10108
10109function pauseCurrentLifeCycleTimer() {
10110 var currentTimer = {
10111 startTime: currentTimerStartTime,
10112 nestedFlushStartTime: performanceNow(),
10113 debugID: currentTimerDebugID,
10114 timerType: currentTimerType
10115 };
10116 lifeCycleTimerStack.push(currentTimer);
10117 currentTimerStartTime = null;
10118 currentTimerNestedFlushDuration = null;
10119 currentTimerDebugID = null;
10120 currentTimerType = null;
10121}
10122
10123function resumeCurrentLifeCycleTimer() {
10124 var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop();
10125
10126 var startTime = _lifeCycleTimerStack$.startTime;
10127 var nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime;
10128 var debugID = _lifeCycleTimerStack$.debugID;
10129 var timerType = _lifeCycleTimerStack$.timerType;
10130
10131 var nestedFlushDuration = performanceNow() - nestedFlushStartTime;
10132 currentTimerStartTime = startTime;
10133 currentTimerNestedFlushDuration += nestedFlushDuration;
10134 currentTimerDebugID = debugID;
10135 currentTimerType = timerType;
10136}
10137
10138var ReactDebugTool = {
10139 addHook: function (hook) {
10140 hooks.push(hook);
10141 },
10142 removeHook: function (hook) {
10143 for (var i = 0; i < hooks.length; i++) {
10144 if (hooks[i] === hook) {
10145 hooks.splice(i, 1);
10146 i--;
10147 }
10148 }
10149 },
10150 isProfiling: function () {
10151 return isProfiling;
10152 },
10153 beginProfiling: function () {
10154 if (isProfiling) {
10155 return;
10156 }
10157
10158 isProfiling = true;
10159 flushHistory.length = 0;
10160 resetMeasurements();
10161 ReactDebugTool.addHook(ReactHostOperationHistoryHook);
10162 },
10163 endProfiling: function () {
10164 if (!isProfiling) {
10165 return;
10166 }
10167
10168 isProfiling = false;
10169 resetMeasurements();
10170 ReactDebugTool.removeHook(ReactHostOperationHistoryHook);
10171 },
10172 getFlushHistory: function () {
10173 return flushHistory;
10174 },
10175 onBeginFlush: function () {
10176 currentFlushNesting++;
10177 resetMeasurements();
10178 pauseCurrentLifeCycleTimer();
10179 emitEvent('onBeginFlush');
10180 },
10181 onEndFlush: function () {
10182 resetMeasurements();
10183 currentFlushNesting--;
10184 resumeCurrentLifeCycleTimer();
10185 emitEvent('onEndFlush');
10186 },
10187 onBeginLifeCycleTimer: function (debugID, timerType) {
10188 checkDebugID(debugID);
10189 emitEvent('onBeginLifeCycleTimer', debugID, timerType);
10190 beginLifeCycleTimer(debugID, timerType);
10191 },
10192 onEndLifeCycleTimer: function (debugID, timerType) {
10193 checkDebugID(debugID);
10194 endLifeCycleTimer(debugID, timerType);
10195 emitEvent('onEndLifeCycleTimer', debugID, timerType);
10196 },
10197 onBeginProcessingChildContext: function () {
10198 emitEvent('onBeginProcessingChildContext');
10199 },
10200 onEndProcessingChildContext: function () {
10201 emitEvent('onEndProcessingChildContext');
10202 },
10203 onHostOperation: function (debugID, type, payload) {
10204 checkDebugID(debugID);
10205 emitEvent('onHostOperation', debugID, type, payload);
10206 },
10207 onSetState: function () {
10208 emitEvent('onSetState');
10209 },
10210 onSetChildren: function (debugID, childDebugIDs) {
10211 checkDebugID(debugID);
10212 childDebugIDs.forEach(checkDebugID);
10213 emitEvent('onSetChildren', debugID, childDebugIDs);
10214 },
10215 onBeforeMountComponent: function (debugID, element, parentDebugID) {
10216 checkDebugID(debugID);
10217 checkDebugID(parentDebugID, true);
10218 emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
10219 },
10220 onMountComponent: function (debugID) {
10221 checkDebugID(debugID);
10222 emitEvent('onMountComponent', debugID);
10223 },
10224 onBeforeUpdateComponent: function (debugID, element) {
10225 checkDebugID(debugID);
10226 emitEvent('onBeforeUpdateComponent', debugID, element);
10227 },
10228 onUpdateComponent: function (debugID) {
10229 checkDebugID(debugID);
10230 emitEvent('onUpdateComponent', debugID);
10231 },
10232 onBeforeUnmountComponent: function (debugID) {
10233 checkDebugID(debugID);
10234 emitEvent('onBeforeUnmountComponent', debugID);
10235 },
10236 onUnmountComponent: function (debugID) {
10237 checkDebugID(debugID);
10238 emitEvent('onUnmountComponent', debugID);
10239 },
10240 onTestEvent: function () {
10241 emitEvent('onTestEvent');
10242 }
10243};
10244
10245// TODO remove these when RN/www gets updated
10246ReactDebugTool.addDevtool = ReactDebugTool.addHook;
10247ReactDebugTool.removeDevtool = ReactDebugTool.removeHook;
10248
10249ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
10250ReactDebugTool.addHook(ReactComponentTreeHook);
10251ReactDebugTool.addHook(ReactChildrenMutationWarningHook);
10252var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
10253if (/[?&]react_perf\b/.test(url)) {
10254 ReactDebugTool.beginProfiling();
10255}
10256
10257module.exports = ReactDebugTool;
10258},{"148":148,"169":169,"171":171,"30":30,"35":35,"69":69,"74":74}],59:[function(_dereq_,module,exports){
10259/**
10260 * Copyright 2013-present, Facebook, Inc.
10261 * All rights reserved.
10262 *
10263 * This source code is licensed under the BSD-style license found in the
10264 * LICENSE file in the root directory of this source tree. An additional grant
10265 * of patent rights can be found in the PATENTS file in the same directory.
10266 *
10267 * @providesModule ReactDefaultBatchingStrategy
10268 */
10269
10270'use strict';
10271
10272var _assign = _dereq_(172);
10273
10274var ReactUpdates = _dereq_(96);
10275var Transaction = _dereq_(114);
10276
10277var emptyFunction = _dereq_(154);
10278
10279var RESET_BATCHED_UPDATES = {
10280 initialize: emptyFunction,
10281 close: function () {
10282 ReactDefaultBatchingStrategy.isBatchingUpdates = false;
10283 }
10284};
10285
10286var FLUSH_BATCHED_UPDATES = {
10287 initialize: emptyFunction,
10288 close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
10289};
10290
10291var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
10292
10293function ReactDefaultBatchingStrategyTransaction() {
10294 this.reinitializeTransaction();
10295}
10296
10297_assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
10298 getTransactionWrappers: function () {
10299 return TRANSACTION_WRAPPERS;
10300 }
10301});
10302
10303var transaction = new ReactDefaultBatchingStrategyTransaction();
10304
10305var ReactDefaultBatchingStrategy = {
10306 isBatchingUpdates: false,
10307
10308 /**
10309 * Call the provided function in a context within which calls to `setState`
10310 * and friends are batched such that components aren't updated unnecessarily.
10311 */
10312 batchedUpdates: function (callback, a, b, c, d, e) {
10313 var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
10314
10315 ReactDefaultBatchingStrategy.isBatchingUpdates = true;
10316
10317 // The code is written this way to avoid extra allocations
10318 if (alreadyBatchingUpdates) {
10319 callback(a, b, c, d, e);
10320 } else {
10321 transaction.perform(callback, null, a, b, c, d, e);
10322 }
10323 }
10324};
10325
10326module.exports = ReactDefaultBatchingStrategy;
10327},{"114":114,"154":154,"172":172,"96":96}],60:[function(_dereq_,module,exports){
10328/**
10329 * Copyright 2013-present, Facebook, Inc.
10330 * All rights reserved.
10331 *
10332 * This source code is licensed under the BSD-style license found in the
10333 * LICENSE file in the root directory of this source tree. An additional grant
10334 * of patent rights can be found in the PATENTS file in the same directory.
10335 *
10336 * @providesModule ReactDefaultInjection
10337 */
10338
10339'use strict';
10340
10341var BeforeInputEventPlugin = _dereq_(2);
10342var ChangeEventPlugin = _dereq_(6);
10343var DefaultEventPluginOrder = _dereq_(13);
10344var EnterLeaveEventPlugin = _dereq_(15);
10345var HTMLDOMPropertyConfig = _dereq_(22);
10346var ReactComponentBrowserEnvironment = _dereq_(33);
10347var ReactDOMComponent = _dereq_(40);
10348var ReactDOMComponentTree = _dereq_(42);
10349var ReactDOMEmptyComponent = _dereq_(44);
10350var ReactDOMTreeTraversal = _dereq_(56);
10351var ReactDOMTextComponent = _dereq_(54);
10352var ReactDefaultBatchingStrategy = _dereq_(59);
10353var ReactEventListener = _dereq_(66);
10354var ReactInjection = _dereq_(70);
10355var ReactReconcileTransaction = _dereq_(87);
10356var SVGDOMPropertyConfig = _dereq_(98);
10357var SelectEventPlugin = _dereq_(99);
10358var SimpleEventPlugin = _dereq_(100);
10359
10360var alreadyInjected = false;
10361
10362function inject() {
10363 if (alreadyInjected) {
10364 // TODO: This is currently true because these injections are shared between
10365 // the client and the server package. They should be built independently
10366 // and not share any injection state. Then this problem will be solved.
10367 return;
10368 }
10369 alreadyInjected = true;
10370
10371 ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
10372
10373 /**
10374 * Inject modules for resolving DOM hierarchy and plugin ordering.
10375 */
10376 ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
10377 ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
10378 ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
10379
10380 /**
10381 * Some important event plugins included by default (without having to require
10382 * them).
10383 */
10384 ReactInjection.EventPluginHub.injectEventPluginsByName({
10385 SimpleEventPlugin: SimpleEventPlugin,
10386 EnterLeaveEventPlugin: EnterLeaveEventPlugin,
10387 ChangeEventPlugin: ChangeEventPlugin,
10388 SelectEventPlugin: SelectEventPlugin,
10389 BeforeInputEventPlugin: BeforeInputEventPlugin
10390 });
10391
10392 ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent);
10393
10394 ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent);
10395
10396 ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
10397 ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
10398
10399 ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
10400 return new ReactDOMEmptyComponent(instantiate);
10401 });
10402
10403 ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
10404 ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
10405
10406 ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
10407}
10408
10409module.exports = {
10410 inject: inject
10411};
10412},{"100":100,"13":13,"15":15,"2":2,"22":22,"33":33,"40":40,"42":42,"44":44,"54":54,"56":56,"59":59,"6":6,"66":66,"70":70,"87":87,"98":98,"99":99}],61:[function(_dereq_,module,exports){
10413/**
10414 * Copyright 2014-present, Facebook, Inc.
10415 * All rights reserved.
10416 *
10417 * This source code is licensed under the BSD-style license found in the
10418 * LICENSE file in the root directory of this source tree. An additional grant
10419 * of patent rights can be found in the PATENTS file in the same directory.
10420 *
10421 * @providesModule ReactElement
10422 */
10423
10424'use strict';
10425
10426var _assign = _dereq_(172);
10427
10428var ReactCurrentOwner = _dereq_(37);
10429
10430var warning = _dereq_(171);
10431var canDefineProperty = _dereq_(118);
10432var hasOwnProperty = Object.prototype.hasOwnProperty;
10433
10434// The Symbol used to tag the ReactElement type. If there is no native Symbol
10435// nor polyfill, then a plain number is used for performance.
10436var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
10437
10438var RESERVED_PROPS = {
10439 key: true,
10440 ref: true,
10441 __self: true,
10442 __source: true
10443};
10444
10445var specialPropKeyWarningShown, specialPropRefWarningShown;
10446
10447function hasValidRef(config) {
10448 if ("development" !== 'production') {
10449 if (hasOwnProperty.call(config, 'ref')) {
10450 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
10451 if (getter && getter.isReactWarning) {
10452 return false;
10453 }
10454 }
10455 }
10456 return config.ref !== undefined;
10457}
10458
10459function hasValidKey(config) {
10460 if ("development" !== 'production') {
10461 if (hasOwnProperty.call(config, 'key')) {
10462 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
10463 if (getter && getter.isReactWarning) {
10464 return false;
10465 }
10466 }
10467 }
10468 return config.key !== undefined;
10469}
10470
10471function defineKeyPropWarningGetter(props, displayName) {
10472 var warnAboutAccessingKey = function () {
10473 if (!specialPropKeyWarningShown) {
10474 specialPropKeyWarningShown = true;
10475 "development" !== 'production' ? 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) : void 0;
10476 }
10477 };
10478 warnAboutAccessingKey.isReactWarning = true;
10479 Object.defineProperty(props, 'key', {
10480 get: warnAboutAccessingKey,
10481 configurable: true
10482 });
10483}
10484
10485function defineRefPropWarningGetter(props, displayName) {
10486 var warnAboutAccessingRef = function () {
10487 if (!specialPropRefWarningShown) {
10488 specialPropRefWarningShown = true;
10489 "development" !== 'production' ? 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) : void 0;
10490 }
10491 };
10492 warnAboutAccessingRef.isReactWarning = true;
10493 Object.defineProperty(props, 'ref', {
10494 get: warnAboutAccessingRef,
10495 configurable: true
10496 });
10497}
10498
10499/**
10500 * Factory method to create a new React element. This no longer adheres to
10501 * the class pattern, so do not use new to call it. Also, no instanceof check
10502 * will work. Instead test $$typeof field against Symbol.for('react.element') to check
10503 * if something is a React Element.
10504 *
10505 * @param {*} type
10506 * @param {*} key
10507 * @param {string|object} ref
10508 * @param {*} self A *temporary* helper to detect places where `this` is
10509 * different from the `owner` when React.createElement is called, so that we
10510 * can warn. We want to get rid of owner and replace string `ref`s with arrow
10511 * functions, and as long as `this` and owner are the same, there will be no
10512 * change in behavior.
10513 * @param {*} source An annotation object (added by a transpiler or otherwise)
10514 * indicating filename, line number, and/or other information.
10515 * @param {*} owner
10516 * @param {*} props
10517 * @internal
10518 */
10519var ReactElement = function (type, key, ref, self, source, owner, props) {
10520 var element = {
10521 // This tag allow us to uniquely identify this as a React Element
10522 $$typeof: REACT_ELEMENT_TYPE,
10523
10524 // Built-in properties that belong on the element
10525 type: type,
10526 key: key,
10527 ref: ref,
10528 props: props,
10529
10530 // Record the component responsible for creating this element.
10531 _owner: owner
10532 };
10533
10534 if ("development" !== 'production') {
10535 // The validation flag is currently mutative. We put it on
10536 // an external backing store so that we can freeze the whole object.
10537 // This can be replaced with a WeakMap once they are implemented in
10538 // commonly used development environments.
10539 element._store = {};
10540 var shadowChildren = Array.isArray(props.children) ? props.children.slice(0) : props.children;
10541
10542 // To make comparing ReactElements easier for testing purposes, we make
10543 // the validation flag non-enumerable (where possible, which should
10544 // include every environment we run tests in), so the test framework
10545 // ignores it.
10546 if (canDefineProperty) {
10547 Object.defineProperty(element._store, 'validated', {
10548 configurable: false,
10549 enumerable: false,
10550 writable: true,
10551 value: false
10552 });
10553 // self and source are DEV only properties.
10554 Object.defineProperty(element, '_self', {
10555 configurable: false,
10556 enumerable: false,
10557 writable: false,
10558 value: self
10559 });
10560 Object.defineProperty(element, '_shadowChildren', {
10561 configurable: false,
10562 enumerable: false,
10563 writable: false,
10564 value: shadowChildren
10565 });
10566 // Two elements created in two different places should be considered
10567 // equal for testing purposes and therefore we hide it from enumeration.
10568 Object.defineProperty(element, '_source', {
10569 configurable: false,
10570 enumerable: false,
10571 writable: false,
10572 value: source
10573 });
10574 } else {
10575 element._store.validated = false;
10576 element._self = self;
10577 element._shadowChildren = shadowChildren;
10578 element._source = source;
10579 }
10580 if (Object.freeze) {
10581 Object.freeze(element.props);
10582 Object.freeze(element);
10583 }
10584 }
10585
10586 return element;
10587};
10588
10589/**
10590 * Create and return a new ReactElement of the given type.
10591 * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
10592 */
10593ReactElement.createElement = function (type, config, children) {
10594 var propName;
10595
10596 // Reserved names are extracted
10597 var props = {};
10598
10599 var key = null;
10600 var ref = null;
10601 var self = null;
10602 var source = null;
10603
10604 if (config != null) {
10605 if (hasValidRef(config)) {
10606 ref = config.ref;
10607 }
10608 if (hasValidKey(config)) {
10609 key = '' + config.key;
10610 }
10611
10612 self = config.__self === undefined ? null : config.__self;
10613 source = config.__source === undefined ? null : config.__source;
10614 // Remaining properties are added to a new props object
10615 for (propName in config) {
10616 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
10617 props[propName] = config[propName];
10618 }
10619 }
10620 }
10621
10622 // Children can be more than one argument, and those are transferred onto
10623 // the newly allocated props object.
10624 var childrenLength = arguments.length - 2;
10625 if (childrenLength === 1) {
10626 props.children = children;
10627 } else if (childrenLength > 1) {
10628 var childArray = Array(childrenLength);
10629 for (var i = 0; i < childrenLength; i++) {
10630 childArray[i] = arguments[i + 2];
10631 }
10632 props.children = childArray;
10633 }
10634
10635 // Resolve default props
10636 if (type && type.defaultProps) {
10637 var defaultProps = type.defaultProps;
10638 for (propName in defaultProps) {
10639 if (props[propName] === undefined) {
10640 props[propName] = defaultProps[propName];
10641 }
10642 }
10643 }
10644 if ("development" !== 'production') {
10645 if (key || ref) {
10646 if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
10647 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
10648 if (key) {
10649 defineKeyPropWarningGetter(props, displayName);
10650 }
10651 if (ref) {
10652 defineRefPropWarningGetter(props, displayName);
10653 }
10654 }
10655 }
10656 }
10657 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
10658};
10659
10660/**
10661 * Return a function that produces ReactElements of a given type.
10662 * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
10663 */
10664ReactElement.createFactory = function (type) {
10665 var factory = ReactElement.createElement.bind(null, type);
10666 // Expose the type on the factory and the prototype so that it can be
10667 // easily accessed on elements. E.g. `<Foo />.type === Foo`.
10668 // This should not be named `constructor` since this may not be the function
10669 // that created the element, and it may not even be a constructor.
10670 // Legacy hook TODO: Warn if this is accessed
10671 factory.type = type;
10672 return factory;
10673};
10674
10675ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
10676 var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
10677
10678 return newElement;
10679};
10680
10681/**
10682 * Clone and return a new ReactElement using element as the starting point.
10683 * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
10684 */
10685ReactElement.cloneElement = function (element, config, children) {
10686 var propName;
10687
10688 // Original props are copied
10689 var props = _assign({}, element.props);
10690
10691 // Reserved names are extracted
10692 var key = element.key;
10693 var ref = element.ref;
10694 // Self is preserved since the owner is preserved.
10695 var self = element._self;
10696 // Source is preserved since cloneElement is unlikely to be targeted by a
10697 // transpiler, and the original source is probably a better indicator of the
10698 // true owner.
10699 var source = element._source;
10700
10701 // Owner will be preserved, unless ref is overridden
10702 var owner = element._owner;
10703
10704 if (config != null) {
10705 if (hasValidRef(config)) {
10706 // Silently steal the ref from the parent.
10707 ref = config.ref;
10708 owner = ReactCurrentOwner.current;
10709 }
10710 if (hasValidKey(config)) {
10711 key = '' + config.key;
10712 }
10713
10714 // Remaining properties override existing props
10715 var defaultProps;
10716 if (element.type && element.type.defaultProps) {
10717 defaultProps = element.type.defaultProps;
10718 }
10719 for (propName in config) {
10720 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
10721 if (config[propName] === undefined && defaultProps !== undefined) {
10722 // Resolve default props
10723 props[propName] = defaultProps[propName];
10724 } else {
10725 props[propName] = config[propName];
10726 }
10727 }
10728 }
10729 }
10730
10731 // Children can be more than one argument, and those are transferred onto
10732 // the newly allocated props object.
10733 var childrenLength = arguments.length - 2;
10734 if (childrenLength === 1) {
10735 props.children = children;
10736 } else if (childrenLength > 1) {
10737 var childArray = Array(childrenLength);
10738 for (var i = 0; i < childrenLength; i++) {
10739 childArray[i] = arguments[i + 2];
10740 }
10741 props.children = childArray;
10742 }
10743
10744 return ReactElement(element.type, key, ref, self, source, owner, props);
10745};
10746
10747/**
10748 * Verifies the object is a ReactElement.
10749 * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
10750 * @param {?object} object
10751 * @return {boolean} True if `object` is a valid component.
10752 * @final
10753 */
10754ReactElement.isValidElement = function (object) {
10755 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
10756};
10757
10758ReactElement.REACT_ELEMENT_TYPE = REACT_ELEMENT_TYPE;
10759
10760module.exports = ReactElement;
10761},{"118":118,"171":171,"172":172,"37":37}],62:[function(_dereq_,module,exports){
10762/**
10763 * Copyright 2014-present, Facebook, Inc.
10764 * All rights reserved.
10765 *
10766 * This source code is licensed under the BSD-style license found in the
10767 * LICENSE file in the root directory of this source tree. An additional grant
10768 * of patent rights can be found in the PATENTS file in the same directory.
10769 *
10770 * @providesModule ReactElementValidator
10771 */
10772
10773/**
10774 * ReactElementValidator provides a wrapper around a element factory
10775 * which validates the props passed to the element. This is intended to be
10776 * used only in DEV and could be replaced by a static type checker for languages
10777 * that support it.
10778 */
10779
10780'use strict';
10781
10782var ReactCurrentOwner = _dereq_(37);
10783var ReactComponentTreeHook = _dereq_(35);
10784var ReactElement = _dereq_(61);
10785var ReactPropTypeLocations = _dereq_(83);
10786
10787var checkReactTypeSpec = _dereq_(119);
10788
10789var canDefineProperty = _dereq_(118);
10790var getIteratorFn = _dereq_(131);
10791var warning = _dereq_(171);
10792
10793function getDeclarationErrorAddendum() {
10794 if (ReactCurrentOwner.current) {
10795 var name = ReactCurrentOwner.current.getName();
10796 if (name) {
10797 return ' Check the render method of `' + name + '`.';
10798 }
10799 }
10800 return '';
10801}
10802
10803/**
10804 * Warn if there's no key explicitly set on dynamic arrays of children or
10805 * object keys are not valid. This allows us to keep track of children between
10806 * updates.
10807 */
10808var ownerHasKeyUseWarning = {};
10809
10810function getCurrentComponentErrorInfo(parentType) {
10811 var info = getDeclarationErrorAddendum();
10812
10813 if (!info) {
10814 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
10815 if (parentName) {
10816 info = ' Check the top-level render call using <' + parentName + '>.';
10817 }
10818 }
10819 return info;
10820}
10821
10822/**
10823 * Warn if the element doesn't have an explicit key assigned to it.
10824 * This element is in an array. The array could grow and shrink or be
10825 * reordered. All children that haven't already been validated are required to
10826 * have a "key" property assigned to it. Error statuses are cached so a warning
10827 * will only be shown once.
10828 *
10829 * @internal
10830 * @param {ReactElement} element Element that requires a key.
10831 * @param {*} parentType element's parent's type.
10832 */
10833function validateExplicitKey(element, parentType) {
10834 if (!element._store || element._store.validated || element.key != null) {
10835 return;
10836 }
10837 element._store.validated = true;
10838
10839 var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
10840
10841 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
10842 if (memoizer[currentComponentErrorInfo]) {
10843 return;
10844 }
10845 memoizer[currentComponentErrorInfo] = true;
10846
10847 // Usually the current owner is the offender, but if it accepts children as a
10848 // property, it may be the creator of the child that's responsible for
10849 // assigning it a key.
10850 var childOwner = '';
10851 if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
10852 // Give the component that originally created this child.
10853 childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
10854 }
10855
10856 "development" !== 'production' ? warning(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, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0;
10857}
10858
10859/**
10860 * Ensure that every element either is passed in a static location, in an
10861 * array with an explicit keys property defined, or in an object literal
10862 * with valid key property.
10863 *
10864 * @internal
10865 * @param {ReactNode} node Statically passed child of any type.
10866 * @param {*} parentType node's parent's type.
10867 */
10868function validateChildKeys(node, parentType) {
10869 if (typeof node !== 'object') {
10870 return;
10871 }
10872 if (Array.isArray(node)) {
10873 for (var i = 0; i < node.length; i++) {
10874 var child = node[i];
10875 if (ReactElement.isValidElement(child)) {
10876 validateExplicitKey(child, parentType);
10877 }
10878 }
10879 } else if (ReactElement.isValidElement(node)) {
10880 // This element was passed in a valid location.
10881 if (node._store) {
10882 node._store.validated = true;
10883 }
10884 } else if (node) {
10885 var iteratorFn = getIteratorFn(node);
10886 // Entry iterators provide implicit keys.
10887 if (iteratorFn) {
10888 if (iteratorFn !== node.entries) {
10889 var iterator = iteratorFn.call(node);
10890 var step;
10891 while (!(step = iterator.next()).done) {
10892 if (ReactElement.isValidElement(step.value)) {
10893 validateExplicitKey(step.value, parentType);
10894 }
10895 }
10896 }
10897 }
10898 }
10899}
10900
10901/**
10902 * Given an element, validate that its props follow the propTypes definition,
10903 * provided by the type.
10904 *
10905 * @param {ReactElement} element
10906 */
10907function validatePropTypes(element) {
10908 var componentClass = element.type;
10909 if (typeof componentClass !== 'function') {
10910 return;
10911 }
10912 var name = componentClass.displayName || componentClass.name;
10913 if (componentClass.propTypes) {
10914 checkReactTypeSpec(componentClass.propTypes, element.props, ReactPropTypeLocations.prop, name, element, null);
10915 }
10916 if (typeof componentClass.getDefaultProps === 'function') {
10917 "development" !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
10918 }
10919}
10920
10921var ReactElementValidator = {
10922
10923 createElement: function (type, props, children) {
10924 var validType = typeof type === 'string' || typeof type === 'function';
10925 // We warn in this case but don't throw. We expect the element creation to
10926 // succeed and there will likely be errors in render.
10927 if (!validType) {
10928 "development" !== 'production' ? warning(false, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0;
10929 }
10930
10931 var element = ReactElement.createElement.apply(this, arguments);
10932
10933 // The result can be nullish if a mock or a custom function is used.
10934 // TODO: Drop this when these are no longer allowed as the type argument.
10935 if (element == null) {
10936 return element;
10937 }
10938
10939 // Skip key warning if the type isn't valid since our key validation logic
10940 // doesn't expect a non-string/function type and can throw confusing errors.
10941 // We don't want exception behavior to differ between dev and prod.
10942 // (Rendering will throw with a helpful message and as soon as the type is
10943 // fixed, the key warnings will appear.)
10944 if (validType) {
10945 for (var i = 2; i < arguments.length; i++) {
10946 validateChildKeys(arguments[i], type);
10947 }
10948 }
10949
10950 validatePropTypes(element);
10951
10952 return element;
10953 },
10954
10955 createFactory: function (type) {
10956 var validatedFactory = ReactElementValidator.createElement.bind(null, type);
10957 // Legacy hook TODO: Warn if this is accessed
10958 validatedFactory.type = type;
10959
10960 if ("development" !== 'production') {
10961 if (canDefineProperty) {
10962 Object.defineProperty(validatedFactory, 'type', {
10963 enumerable: false,
10964 get: function () {
10965 "development" !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
10966 Object.defineProperty(this, 'type', {
10967 value: type
10968 });
10969 return type;
10970 }
10971 });
10972 }
10973 }
10974
10975 return validatedFactory;
10976 },
10977
10978 cloneElement: function (element, props, children) {
10979 var newElement = ReactElement.cloneElement.apply(this, arguments);
10980 for (var i = 2; i < arguments.length; i++) {
10981 validateChildKeys(arguments[i], newElement.type);
10982 }
10983 validatePropTypes(newElement);
10984 return newElement;
10985 }
10986
10987};
10988
10989module.exports = ReactElementValidator;
10990},{"118":118,"119":119,"131":131,"171":171,"35":35,"37":37,"61":61,"83":83}],63:[function(_dereq_,module,exports){
10991/**
10992 * Copyright 2014-present, Facebook, Inc.
10993 * All rights reserved.
10994 *
10995 * This source code is licensed under the BSD-style license found in the
10996 * LICENSE file in the root directory of this source tree. An additional grant
10997 * of patent rights can be found in the PATENTS file in the same directory.
10998 *
10999 * @providesModule ReactEmptyComponent
11000 */
11001
11002'use strict';
11003
11004var emptyComponentFactory;
11005
11006var ReactEmptyComponentInjection = {
11007 injectEmptyComponentFactory: function (factory) {
11008 emptyComponentFactory = factory;
11009 }
11010};
11011
11012var ReactEmptyComponent = {
11013 create: function (instantiate) {
11014 return emptyComponentFactory(instantiate);
11015 }
11016};
11017
11018ReactEmptyComponent.injection = ReactEmptyComponentInjection;
11019
11020module.exports = ReactEmptyComponent;
11021},{}],64:[function(_dereq_,module,exports){
11022/**
11023 * Copyright 2013-present, Facebook, Inc.
11024 * All rights reserved.
11025 *
11026 * This source code is licensed under the BSD-style license found in the
11027 * LICENSE file in the root directory of this source tree. An additional grant
11028 * of patent rights can be found in the PATENTS file in the same directory.
11029 *
11030 * @providesModule ReactErrorUtils
11031 */
11032
11033'use strict';
11034
11035var caughtError = null;
11036
11037/**
11038 * Call a function while guarding against errors that happens within it.
11039 *
11040 * @param {?String} name of the guard to use for logging or debugging
11041 * @param {Function} func The function to invoke
11042 * @param {*} a First argument
11043 * @param {*} b Second argument
11044 */
11045function invokeGuardedCallback(name, func, a, b) {
11046 try {
11047 return func(a, b);
11048 } catch (x) {
11049 if (caughtError === null) {
11050 caughtError = x;
11051 }
11052 return undefined;
11053 }
11054}
11055
11056var ReactErrorUtils = {
11057 invokeGuardedCallback: invokeGuardedCallback,
11058
11059 /**
11060 * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
11061 * handler are sure to be rethrown by rethrowCaughtError.
11062 */
11063 invokeGuardedCallbackWithCatch: invokeGuardedCallback,
11064
11065 /**
11066 * During execution of guarded functions we will capture the first error which
11067 * we will rethrow to be handled by the top level error handler.
11068 */
11069 rethrowCaughtError: function () {
11070 if (caughtError) {
11071 var error = caughtError;
11072 caughtError = null;
11073 throw error;
11074 }
11075 }
11076};
11077
11078if ("development" !== 'production') {
11079 /**
11080 * To help development we can get better devtools integration by simulating a
11081 * real browser event.
11082 */
11083 if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
11084 var fakeNode = document.createElement('react');
11085 ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
11086 var boundFunc = func.bind(null, a, b);
11087 var evtType = 'react-' + name;
11088 fakeNode.addEventListener(evtType, boundFunc, false);
11089 var evt = document.createEvent('Event');
11090 evt.initEvent(evtType, false, false);
11091 fakeNode.dispatchEvent(evt);
11092 fakeNode.removeEventListener(evtType, boundFunc, false);
11093 };
11094 }
11095}
11096
11097module.exports = ReactErrorUtils;
11098},{}],65:[function(_dereq_,module,exports){
11099/**
11100 * Copyright 2013-present, Facebook, Inc.
11101 * All rights reserved.
11102 *
11103 * This source code is licensed under the BSD-style license found in the
11104 * LICENSE file in the root directory of this source tree. An additional grant
11105 * of patent rights can be found in the PATENTS file in the same directory.
11106 *
11107 * @providesModule ReactEventEmitterMixin
11108 */
11109
11110'use strict';
11111
11112var EventPluginHub = _dereq_(17);
11113
11114function runEventQueueInBatch(events) {
11115 EventPluginHub.enqueueEvents(events);
11116 EventPluginHub.processEventQueue(false);
11117}
11118
11119var ReactEventEmitterMixin = {
11120
11121 /**
11122 * Streams a fired top-level event to `EventPluginHub` where plugins have the
11123 * opportunity to create `ReactEvent`s to be dispatched.
11124 */
11125 handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
11126 var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
11127 runEventQueueInBatch(events);
11128 }
11129};
11130
11131module.exports = ReactEventEmitterMixin;
11132},{"17":17}],66:[function(_dereq_,module,exports){
11133/**
11134 * Copyright 2013-present, Facebook, Inc.
11135 * All rights reserved.
11136 *
11137 * This source code is licensed under the BSD-style license found in the
11138 * LICENSE file in the root directory of this source tree. An additional grant
11139 * of patent rights can be found in the PATENTS file in the same directory.
11140 *
11141 * @providesModule ReactEventListener
11142 */
11143
11144'use strict';
11145
11146var _assign = _dereq_(172);
11147
11148var EventListener = _dereq_(147);
11149var ExecutionEnvironment = _dereq_(148);
11150var PooledClass = _dereq_(25);
11151var ReactDOMComponentTree = _dereq_(42);
11152var ReactUpdates = _dereq_(96);
11153
11154var getEventTarget = _dereq_(129);
11155var getUnboundedScrollPosition = _dereq_(159);
11156
11157/**
11158 * Find the deepest React component completely containing the root of the
11159 * passed-in instance (for use when entire React trees are nested within each
11160 * other). If React trees are not nested, returns null.
11161 */
11162function findParent(inst) {
11163 // TODO: It may be a good idea to cache this to prevent unnecessary DOM
11164 // traversal, but caching is difficult to do correctly without using a
11165 // mutation observer to listen for all DOM changes.
11166 while (inst._hostParent) {
11167 inst = inst._hostParent;
11168 }
11169 var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
11170 var container = rootNode.parentNode;
11171 return ReactDOMComponentTree.getClosestInstanceFromNode(container);
11172}
11173
11174// Used to store ancestor hierarchy in top level callback
11175function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
11176 this.topLevelType = topLevelType;
11177 this.nativeEvent = nativeEvent;
11178 this.ancestors = [];
11179}
11180_assign(TopLevelCallbackBookKeeping.prototype, {
11181 destructor: function () {
11182 this.topLevelType = null;
11183 this.nativeEvent = null;
11184 this.ancestors.length = 0;
11185 }
11186});
11187PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
11188
11189function handleTopLevelImpl(bookKeeping) {
11190 var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
11191 var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
11192
11193 // Loop through the hierarchy, in case there's any nested components.
11194 // It's important that we build the array of ancestors before calling any
11195 // event handlers, because event handlers can modify the DOM, leading to
11196 // inconsistencies with ReactMount's node cache. See #1105.
11197 var ancestor = targetInst;
11198 do {
11199 bookKeeping.ancestors.push(ancestor);
11200 ancestor = ancestor && findParent(ancestor);
11201 } while (ancestor);
11202
11203 for (var i = 0; i < bookKeeping.ancestors.length; i++) {
11204 targetInst = bookKeeping.ancestors[i];
11205 ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
11206 }
11207}
11208
11209function scrollValueMonitor(cb) {
11210 var scrollPosition = getUnboundedScrollPosition(window);
11211 cb(scrollPosition);
11212}
11213
11214var ReactEventListener = {
11215 _enabled: true,
11216 _handleTopLevel: null,
11217
11218 WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
11219
11220 setHandleTopLevel: function (handleTopLevel) {
11221 ReactEventListener._handleTopLevel = handleTopLevel;
11222 },
11223
11224 setEnabled: function (enabled) {
11225 ReactEventListener._enabled = !!enabled;
11226 },
11227
11228 isEnabled: function () {
11229 return ReactEventListener._enabled;
11230 },
11231
11232 /**
11233 * Traps top-level events by using event bubbling.
11234 *
11235 * @param {string} topLevelType Record from `EventConstants`.
11236 * @param {string} handlerBaseName Event name (e.g. "click").
11237 * @param {object} handle Element on which to attach listener.
11238 * @return {?object} An object with a remove function which will forcefully
11239 * remove the listener.
11240 * @internal
11241 */
11242 trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
11243 var element = handle;
11244 if (!element) {
11245 return null;
11246 }
11247 return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
11248 },
11249
11250 /**
11251 * Traps a top-level event by using event capturing.
11252 *
11253 * @param {string} topLevelType Record from `EventConstants`.
11254 * @param {string} handlerBaseName Event name (e.g. "click").
11255 * @param {object} handle Element on which to attach listener.
11256 * @return {?object} An object with a remove function which will forcefully
11257 * remove the listener.
11258 * @internal
11259 */
11260 trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
11261 var element = handle;
11262 if (!element) {
11263 return null;
11264 }
11265 return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
11266 },
11267
11268 monitorScrollValue: function (refresh) {
11269 var callback = scrollValueMonitor.bind(null, refresh);
11270 EventListener.listen(window, 'scroll', callback);
11271 },
11272
11273 dispatchEvent: function (topLevelType, nativeEvent) {
11274 if (!ReactEventListener._enabled) {
11275 return;
11276 }
11277
11278 var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
11279 try {
11280 // Event queue being processed in the same cycle allows
11281 // `preventDefault`.
11282 ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
11283 } finally {
11284 TopLevelCallbackBookKeeping.release(bookKeeping);
11285 }
11286 }
11287};
11288
11289module.exports = ReactEventListener;
11290},{"129":129,"147":147,"148":148,"159":159,"172":172,"25":25,"42":42,"96":96}],67:[function(_dereq_,module,exports){
11291/**
11292 * Copyright 2013-present, Facebook, Inc.
11293 * All rights reserved.
11294 *
11295 * This source code is licensed under the BSD-style license found in the
11296 * LICENSE file in the root directory of this source tree. An additional grant
11297 * of patent rights can be found in the PATENTS file in the same directory.
11298 *
11299 * @providesModule ReactFeatureFlags
11300 *
11301 */
11302
11303'use strict';
11304
11305var ReactFeatureFlags = {
11306 // When true, call console.time() before and .timeEnd() after each top-level
11307 // render (both initial renders and updates). Useful when looking at prod-mode
11308 // timeline profiles in Chrome, for example.
11309 logTopLevelRenders: false
11310};
11311
11312module.exports = ReactFeatureFlags;
11313},{}],68:[function(_dereq_,module,exports){
11314/**
11315 * Copyright 2014-present, Facebook, Inc.
11316 * All rights reserved.
11317 *
11318 * This source code is licensed under the BSD-style license found in the
11319 * LICENSE file in the root directory of this source tree. An additional grant
11320 * of patent rights can be found in the PATENTS file in the same directory.
11321 *
11322 * @providesModule ReactHostComponent
11323 */
11324
11325'use strict';
11326
11327var _prodInvariant = _dereq_(140),
11328 _assign = _dereq_(172);
11329
11330var invariant = _dereq_(162);
11331
11332var genericComponentClass = null;
11333// This registry keeps track of wrapper classes around host tags.
11334var tagToComponentClass = {};
11335var textComponentClass = null;
11336
11337var ReactHostComponentInjection = {
11338 // This accepts a class that receives the tag string. This is a catch all
11339 // that can render any kind of tag.
11340 injectGenericComponentClass: function (componentClass) {
11341 genericComponentClass = componentClass;
11342 },
11343 // This accepts a text component class that takes the text string to be
11344 // rendered as props.
11345 injectTextComponentClass: function (componentClass) {
11346 textComponentClass = componentClass;
11347 },
11348 // This accepts a keyed object with classes as values. Each key represents a
11349 // tag. That particular tag will use this class instead of the generic one.
11350 injectComponentClasses: function (componentClasses) {
11351 _assign(tagToComponentClass, componentClasses);
11352 }
11353};
11354
11355/**
11356 * Get a host internal component class for a specific tag.
11357 *
11358 * @param {ReactElement} element The element to create.
11359 * @return {function} The internal class constructor function.
11360 */
11361function createInternalComponent(element) {
11362 !genericComponentClass ? "development" !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0;
11363 return new genericComponentClass(element);
11364}
11365
11366/**
11367 * @param {ReactText} text
11368 * @return {ReactComponent}
11369 */
11370function createInstanceForText(text) {
11371 return new textComponentClass(text);
11372}
11373
11374/**
11375 * @param {ReactComponent} component
11376 * @return {boolean}
11377 */
11378function isTextComponent(component) {
11379 return component instanceof textComponentClass;
11380}
11381
11382var ReactHostComponent = {
11383 createInternalComponent: createInternalComponent,
11384 createInstanceForText: createInstanceForText,
11385 isTextComponent: isTextComponent,
11386 injection: ReactHostComponentInjection
11387};
11388
11389module.exports = ReactHostComponent;
11390},{"140":140,"162":162,"172":172}],69:[function(_dereq_,module,exports){
11391/**
11392 * Copyright 2016-present, Facebook, Inc.
11393 * All rights reserved.
11394 *
11395 * This source code is licensed under the BSD-style license found in the
11396 * LICENSE file in the root directory of this source tree. An additional grant
11397 * of patent rights can be found in the PATENTS file in the same directory.
11398 *
11399 * @providesModule ReactHostOperationHistoryHook
11400 */
11401
11402'use strict';
11403
11404var history = [];
11405
11406var ReactHostOperationHistoryHook = {
11407 onHostOperation: function (debugID, type, payload) {
11408 history.push({
11409 instanceID: debugID,
11410 type: type,
11411 payload: payload
11412 });
11413 },
11414 clearHistory: function () {
11415 if (ReactHostOperationHistoryHook._preventClearing) {
11416 // Should only be used for tests.
11417 return;
11418 }
11419
11420 history = [];
11421 },
11422 getHistory: function () {
11423 return history;
11424 }
11425};
11426
11427module.exports = ReactHostOperationHistoryHook;
11428},{}],70:[function(_dereq_,module,exports){
11429/**
11430 * Copyright 2013-present, Facebook, Inc.
11431 * All rights reserved.
11432 *
11433 * This source code is licensed under the BSD-style license found in the
11434 * LICENSE file in the root directory of this source tree. An additional grant
11435 * of patent rights can be found in the PATENTS file in the same directory.
11436 *
11437 * @providesModule ReactInjection
11438 */
11439
11440'use strict';
11441
11442var DOMProperty = _dereq_(10);
11443var EventPluginHub = _dereq_(17);
11444var EventPluginUtils = _dereq_(19);
11445var ReactComponentEnvironment = _dereq_(34);
11446var ReactClass = _dereq_(31);
11447var ReactEmptyComponent = _dereq_(63);
11448var ReactBrowserEventEmitter = _dereq_(27);
11449var ReactHostComponent = _dereq_(68);
11450var ReactUpdates = _dereq_(96);
11451
11452var ReactInjection = {
11453 Component: ReactComponentEnvironment.injection,
11454 Class: ReactClass.injection,
11455 DOMProperty: DOMProperty.injection,
11456 EmptyComponent: ReactEmptyComponent.injection,
11457 EventPluginHub: EventPluginHub.injection,
11458 EventPluginUtils: EventPluginUtils.injection,
11459 EventEmitter: ReactBrowserEventEmitter.injection,
11460 HostComponent: ReactHostComponent.injection,
11461 Updates: ReactUpdates.injection
11462};
11463
11464module.exports = ReactInjection;
11465},{"10":10,"17":17,"19":19,"27":27,"31":31,"34":34,"63":63,"68":68,"96":96}],71:[function(_dereq_,module,exports){
11466/**
11467 * Copyright 2013-present, Facebook, Inc.
11468 * All rights reserved.
11469 *
11470 * This source code is licensed under the BSD-style license found in the
11471 * LICENSE file in the root directory of this source tree. An additional grant
11472 * of patent rights can be found in the PATENTS file in the same directory.
11473 *
11474 * @providesModule ReactInputSelection
11475 */
11476
11477'use strict';
11478
11479var ReactDOMSelection = _dereq_(52);
11480
11481var containsNode = _dereq_(151);
11482var focusNode = _dereq_(156);
11483var getActiveElement = _dereq_(157);
11484
11485function isInDocument(node) {
11486 return containsNode(document.documentElement, node);
11487}
11488
11489/**
11490 * @ReactInputSelection: React input selection module. Based on Selection.js,
11491 * but modified to be suitable for react and has a couple of bug fixes (doesn't
11492 * assume buttons have range selections allowed).
11493 * Input selection module for React.
11494 */
11495var ReactInputSelection = {
11496
11497 hasSelectionCapabilities: function (elem) {
11498 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
11499 return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
11500 },
11501
11502 getSelectionInformation: function () {
11503 var focusedElem = getActiveElement();
11504 return {
11505 focusedElem: focusedElem,
11506 selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
11507 };
11508 },
11509
11510 /**
11511 * @restoreSelection: If any selection information was potentially lost,
11512 * restore it. This is useful when performing operations that could remove dom
11513 * nodes and place them back in, resulting in focus being lost.
11514 */
11515 restoreSelection: function (priorSelectionInformation) {
11516 var curFocusedElem = getActiveElement();
11517 var priorFocusedElem = priorSelectionInformation.focusedElem;
11518 var priorSelectionRange = priorSelectionInformation.selectionRange;
11519 if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
11520 if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
11521 ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
11522 }
11523 focusNode(priorFocusedElem);
11524 }
11525 },
11526
11527 /**
11528 * @getSelection: Gets the selection bounds of a focused textarea, input or
11529 * contentEditable node.
11530 * -@input: Look up selection bounds of this input
11531 * -@return {start: selectionStart, end: selectionEnd}
11532 */
11533 getSelection: function (input) {
11534 var selection;
11535
11536 if ('selectionStart' in input) {
11537 // Modern browser with input or textarea.
11538 selection = {
11539 start: input.selectionStart,
11540 end: input.selectionEnd
11541 };
11542 } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
11543 // IE8 input.
11544 var range = document.selection.createRange();
11545 // There can only be one selection per document in IE, so it must
11546 // be in our element.
11547 if (range.parentElement() === input) {
11548 selection = {
11549 start: -range.moveStart('character', -input.value.length),
11550 end: -range.moveEnd('character', -input.value.length)
11551 };
11552 }
11553 } else {
11554 // Content editable or old IE textarea.
11555 selection = ReactDOMSelection.getOffsets(input);
11556 }
11557
11558 return selection || { start: 0, end: 0 };
11559 },
11560
11561 /**
11562 * @setSelection: Sets the selection bounds of a textarea or input and focuses
11563 * the input.
11564 * -@input Set selection bounds of this input or textarea
11565 * -@offsets Object of same form that is returned from get*
11566 */
11567 setSelection: function (input, offsets) {
11568 var start = offsets.start;
11569 var end = offsets.end;
11570 if (end === undefined) {
11571 end = start;
11572 }
11573
11574 if ('selectionStart' in input) {
11575 input.selectionStart = start;
11576 input.selectionEnd = Math.min(end, input.value.length);
11577 } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
11578 var range = input.createTextRange();
11579 range.collapse(true);
11580 range.moveStart('character', start);
11581 range.moveEnd('character', end - start);
11582 range.select();
11583 } else {
11584 ReactDOMSelection.setOffsets(input, offsets);
11585 }
11586 }
11587};
11588
11589module.exports = ReactInputSelection;
11590},{"151":151,"156":156,"157":157,"52":52}],72:[function(_dereq_,module,exports){
11591/**
11592 * Copyright 2013-present, Facebook, Inc.
11593 * All rights reserved.
11594 *
11595 * This source code is licensed under the BSD-style license found in the
11596 * LICENSE file in the root directory of this source tree. An additional grant
11597 * of patent rights can be found in the PATENTS file in the same directory.
11598 *
11599 * @providesModule ReactInstanceMap
11600 */
11601
11602'use strict';
11603
11604/**
11605 * `ReactInstanceMap` maintains a mapping from a public facing stateful
11606 * instance (key) and the internal representation (value). This allows public
11607 * methods to accept the user facing instance as an argument and map them back
11608 * to internal methods.
11609 */
11610
11611// TODO: Replace this with ES6: var ReactInstanceMap = new Map();
11612
11613var ReactInstanceMap = {
11614
11615 /**
11616 * This API should be called `delete` but we'd have to make sure to always
11617 * transform these to strings for IE support. When this transform is fully
11618 * supported we can rename it.
11619 */
11620 remove: function (key) {
11621 key._reactInternalInstance = undefined;
11622 },
11623
11624 get: function (key) {
11625 return key._reactInternalInstance;
11626 },
11627
11628 has: function (key) {
11629 return key._reactInternalInstance !== undefined;
11630 },
11631
11632 set: function (key, value) {
11633 key._reactInternalInstance = value;
11634 }
11635
11636};
11637
11638module.exports = ReactInstanceMap;
11639},{}],73:[function(_dereq_,module,exports){
11640/**
11641 * Copyright 2016-present, Facebook, Inc.
11642 * All rights reserved.
11643 *
11644 * This source code is licensed under the BSD-style license found in the
11645 * LICENSE file in the root directory of this source tree. An additional grant
11646 * of patent rights can be found in the PATENTS file in the same directory.
11647 *
11648 * @providesModule ReactInstrumentation
11649 */
11650
11651'use strict';
11652
11653var debugTool = null;
11654
11655if ("development" !== 'production') {
11656 var ReactDebugTool = _dereq_(58);
11657 debugTool = ReactDebugTool;
11658}
11659
11660module.exports = { debugTool: debugTool };
11661},{"58":58}],74:[function(_dereq_,module,exports){
11662/**
11663 * Copyright 2016-present, Facebook, Inc.
11664 * All rights reserved.
11665 *
11666 * This source code is licensed under the BSD-style license found in the
11667 * LICENSE file in the root directory of this source tree. An additional grant
11668 * of patent rights can be found in the PATENTS file in the same directory.
11669 *
11670 * @providesModule ReactInvalidSetStateWarningHook
11671 */
11672
11673'use strict';
11674
11675var warning = _dereq_(171);
11676
11677if ("development" !== 'production') {
11678 var processingChildContext = false;
11679
11680 var warnInvalidSetState = function () {
11681 "development" !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
11682 };
11683}
11684
11685var ReactInvalidSetStateWarningHook = {
11686 onBeginProcessingChildContext: function () {
11687 processingChildContext = true;
11688 },
11689 onEndProcessingChildContext: function () {
11690 processingChildContext = false;
11691 },
11692 onSetState: function () {
11693 warnInvalidSetState();
11694 }
11695};
11696
11697module.exports = ReactInvalidSetStateWarningHook;
11698},{"171":171}],75:[function(_dereq_,module,exports){
11699/**
11700 * Copyright 2013-present, Facebook, Inc.
11701 * All rights reserved.
11702 *
11703 * This source code is licensed under the BSD-style license found in the
11704 * LICENSE file in the root directory of this source tree. An additional grant
11705 * of patent rights can be found in the PATENTS file in the same directory.
11706 *
11707 * @providesModule ReactMarkupChecksum
11708 */
11709
11710'use strict';
11711
11712var adler32 = _dereq_(117);
11713
11714var TAG_END = /\/?>/;
11715var COMMENT_START = /^<\!\-\-/;
11716
11717var ReactMarkupChecksum = {
11718 CHECKSUM_ATTR_NAME: 'data-react-checksum',
11719
11720 /**
11721 * @param {string} markup Markup string
11722 * @return {string} Markup string with checksum attribute attached
11723 */
11724 addChecksumToMarkup: function (markup) {
11725 var checksum = adler32(markup);
11726
11727 // Add checksum (handle both parent tags, comments and self-closing tags)
11728 if (COMMENT_START.test(markup)) {
11729 return markup;
11730 } else {
11731 return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
11732 }
11733 },
11734
11735 /**
11736 * @param {string} markup to use
11737 * @param {DOMElement} element root React element
11738 * @returns {boolean} whether or not the markup is the same
11739 */
11740 canReuseMarkup: function (markup, element) {
11741 var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
11742 existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
11743 var markupChecksum = adler32(markup);
11744 return markupChecksum === existingChecksum;
11745 }
11746};
11747
11748module.exports = ReactMarkupChecksum;
11749},{"117":117}],76:[function(_dereq_,module,exports){
11750/**
11751 * Copyright 2013-present, Facebook, Inc.
11752 * All rights reserved.
11753 *
11754 * This source code is licensed under the BSD-style license found in the
11755 * LICENSE file in the root directory of this source tree. An additional grant
11756 * of patent rights can be found in the PATENTS file in the same directory.
11757 *
11758 * @providesModule ReactMount
11759 */
11760
11761'use strict';
11762
11763var _prodInvariant = _dereq_(140);
11764
11765var DOMLazyTree = _dereq_(8);
11766var DOMProperty = _dereq_(10);
11767var ReactBrowserEventEmitter = _dereq_(27);
11768var ReactCurrentOwner = _dereq_(37);
11769var ReactDOMComponentTree = _dereq_(42);
11770var ReactDOMContainerInfo = _dereq_(43);
11771var ReactDOMFeatureFlags = _dereq_(46);
11772var ReactElement = _dereq_(61);
11773var ReactFeatureFlags = _dereq_(67);
11774var ReactInstanceMap = _dereq_(72);
11775var ReactInstrumentation = _dereq_(73);
11776var ReactMarkupChecksum = _dereq_(75);
11777var ReactReconciler = _dereq_(88);
11778var ReactUpdateQueue = _dereq_(95);
11779var ReactUpdates = _dereq_(96);
11780
11781var emptyObject = _dereq_(155);
11782var instantiateReactComponent = _dereq_(135);
11783var invariant = _dereq_(162);
11784var setInnerHTML = _dereq_(142);
11785var shouldUpdateReactComponent = _dereq_(144);
11786var warning = _dereq_(171);
11787
11788var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
11789var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
11790
11791var ELEMENT_NODE_TYPE = 1;
11792var DOC_NODE_TYPE = 9;
11793var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
11794
11795var instancesByReactRootID = {};
11796
11797/**
11798 * Finds the index of the first character
11799 * that's not common between the two given strings.
11800 *
11801 * @return {number} the index of the character where the strings diverge
11802 */
11803function firstDifferenceIndex(string1, string2) {
11804 var minLen = Math.min(string1.length, string2.length);
11805 for (var i = 0; i < minLen; i++) {
11806 if (string1.charAt(i) !== string2.charAt(i)) {
11807 return i;
11808 }
11809 }
11810 return string1.length === string2.length ? -1 : minLen;
11811}
11812
11813/**
11814 * @param {DOMElement|DOMDocument} container DOM element that may contain
11815 * a React component
11816 * @return {?*} DOM element that may have the reactRoot ID, or null.
11817 */
11818function getReactRootElementInContainer(container) {
11819 if (!container) {
11820 return null;
11821 }
11822
11823 if (container.nodeType === DOC_NODE_TYPE) {
11824 return container.documentElement;
11825 } else {
11826 return container.firstChild;
11827 }
11828}
11829
11830function internalGetID(node) {
11831 // If node is something like a window, document, or text node, none of
11832 // which support attributes or a .getAttribute method, gracefully return
11833 // the empty string, as if the attribute were missing.
11834 return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
11835}
11836
11837/**
11838 * Mounts this component and inserts it into the DOM.
11839 *
11840 * @param {ReactComponent} componentInstance The instance to mount.
11841 * @param {DOMElement} container DOM element to mount into.
11842 * @param {ReactReconcileTransaction} transaction
11843 * @param {boolean} shouldReuseMarkup If true, do not insert markup
11844 */
11845function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
11846 var markerName;
11847 if (ReactFeatureFlags.logTopLevelRenders) {
11848 var wrappedElement = wrapperInstance._currentElement.props;
11849 var type = wrappedElement.type;
11850 markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
11851 console.time(markerName);
11852 }
11853
11854 var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */
11855 );
11856
11857 if (markerName) {
11858 console.timeEnd(markerName);
11859 }
11860
11861 wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
11862 ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
11863}
11864
11865/**
11866 * Batched mount.
11867 *
11868 * @param {ReactComponent} componentInstance The instance to mount.
11869 * @param {DOMElement} container DOM element to mount into.
11870 * @param {boolean} shouldReuseMarkup If true, do not insert markup
11871 */
11872function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
11873 var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
11874 /* useCreateElement */
11875 !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
11876 transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
11877 ReactUpdates.ReactReconcileTransaction.release(transaction);
11878}
11879
11880/**
11881 * Unmounts a component and removes it from the DOM.
11882 *
11883 * @param {ReactComponent} instance React component instance.
11884 * @param {DOMElement} container DOM element to unmount from.
11885 * @final
11886 * @internal
11887 * @see {ReactMount.unmountComponentAtNode}
11888 */
11889function unmountComponentFromNode(instance, container, safely) {
11890 if ("development" !== 'production') {
11891 ReactInstrumentation.debugTool.onBeginFlush();
11892 }
11893 ReactReconciler.unmountComponent(instance, safely);
11894 if ("development" !== 'production') {
11895 ReactInstrumentation.debugTool.onEndFlush();
11896 }
11897
11898 if (container.nodeType === DOC_NODE_TYPE) {
11899 container = container.documentElement;
11900 }
11901
11902 // http://jsperf.com/emptying-a-node
11903 while (container.lastChild) {
11904 container.removeChild(container.lastChild);
11905 }
11906}
11907
11908/**
11909 * True if the supplied DOM node has a direct React-rendered child that is
11910 * not a React root element. Useful for warning in `render`,
11911 * `unmountComponentAtNode`, etc.
11912 *
11913 * @param {?DOMElement} node The candidate DOM node.
11914 * @return {boolean} True if the DOM element contains a direct child that was
11915 * rendered by React but is not a root element.
11916 * @internal
11917 */
11918function hasNonRootReactChild(container) {
11919 var rootEl = getReactRootElementInContainer(container);
11920 if (rootEl) {
11921 var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
11922 return !!(inst && inst._hostParent);
11923 }
11924}
11925
11926/**
11927 * True if the supplied DOM node is a React DOM element and
11928 * it has been rendered by another copy of React.
11929 *
11930 * @param {?DOMElement} node The candidate DOM node.
11931 * @return {boolean} True if the DOM has been rendered by another copy of React
11932 * @internal
11933 */
11934function nodeIsRenderedByOtherInstance(container) {
11935 var rootEl = getReactRootElementInContainer(container);
11936 return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl));
11937}
11938
11939/**
11940 * True if the supplied DOM node is a valid node element.
11941 *
11942 * @param {?DOMElement} node The candidate DOM node.
11943 * @return {boolean} True if the DOM is a valid DOM node.
11944 * @internal
11945 */
11946function isValidContainer(node) {
11947 return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE));
11948}
11949
11950/**
11951 * True if the supplied DOM node is a valid React node element.
11952 *
11953 * @param {?DOMElement} node The candidate DOM node.
11954 * @return {boolean} True if the DOM is a valid React DOM node.
11955 * @internal
11956 */
11957function isReactNode(node) {
11958 return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME));
11959}
11960
11961function getHostRootInstanceInContainer(container) {
11962 var rootEl = getReactRootElementInContainer(container);
11963 var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
11964 return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null;
11965}
11966
11967function getTopLevelWrapperInContainer(container) {
11968 var root = getHostRootInstanceInContainer(container);
11969 return root ? root._hostContainerInfo._topLevelWrapper : null;
11970}
11971
11972/**
11973 * Temporary (?) hack so that we can store all top-level pending updates on
11974 * composites instead of having to worry about different types of components
11975 * here.
11976 */
11977var topLevelRootCounter = 1;
11978var TopLevelWrapper = function () {
11979 this.rootID = topLevelRootCounter++;
11980};
11981TopLevelWrapper.prototype.isReactComponent = {};
11982if ("development" !== 'production') {
11983 TopLevelWrapper.displayName = 'TopLevelWrapper';
11984}
11985TopLevelWrapper.prototype.render = function () {
11986 // this.props is actually a ReactElement
11987 return this.props;
11988};
11989
11990/**
11991 * Mounting is the process of initializing a React component by creating its
11992 * representative DOM elements and inserting them into a supplied `container`.
11993 * Any prior content inside `container` is destroyed in the process.
11994 *
11995 * ReactMount.render(
11996 * component,
11997 * document.getElementById('container')
11998 * );
11999 *
12000 * <div id="container"> <-- Supplied `container`.
12001 * <div data-reactid=".3"> <-- Rendered reactRoot of React
12002 * // ... component.
12003 * </div>
12004 * </div>
12005 *
12006 * Inside of `container`, the first element rendered is the "reactRoot".
12007 */
12008var ReactMount = {
12009
12010 TopLevelWrapper: TopLevelWrapper,
12011
12012 /**
12013 * Used by devtools. The keys are not important.
12014 */
12015 _instancesByReactRootID: instancesByReactRootID,
12016
12017 /**
12018 * This is a hook provided to support rendering React components while
12019 * ensuring that the apparent scroll position of its `container` does not
12020 * change.
12021 *
12022 * @param {DOMElement} container The `container` being rendered into.
12023 * @param {function} renderCallback This must be called once to do the render.
12024 */
12025 scrollMonitor: function (container, renderCallback) {
12026 renderCallback();
12027 },
12028
12029 /**
12030 * Take a component that's already mounted into the DOM and replace its props
12031 * @param {ReactComponent} prevComponent component instance already in the DOM
12032 * @param {ReactElement} nextElement component instance to render
12033 * @param {DOMElement} container container to render into
12034 * @param {?function} callback function triggered on completion
12035 */
12036 _updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) {
12037 ReactMount.scrollMonitor(container, function () {
12038 ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext);
12039 if (callback) {
12040 ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
12041 }
12042 });
12043
12044 return prevComponent;
12045 },
12046
12047 /**
12048 * Render a new component into the DOM. Hooked by hooks!
12049 *
12050 * @param {ReactElement} nextElement element to render
12051 * @param {DOMElement} container container to render into
12052 * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
12053 * @return {ReactComponent} nextComponent
12054 */
12055 _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
12056 // Various parts of our code (such as ReactCompositeComponent's
12057 // _renderValidatedComponent) assume that calls to render aren't nested;
12058 // verify that that's the case.
12059 "development" !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
12060
12061 !isValidContainer(container) ? "development" !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0;
12062
12063 ReactBrowserEventEmitter.ensureScrollValueMonitoring();
12064 var componentInstance = instantiateReactComponent(nextElement, false);
12065
12066 // The initial render is synchronous but any updates that happen during
12067 // rendering, in componentWillMount or componentDidMount, will be batched
12068 // according to the current batching strategy.
12069
12070 ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
12071
12072 var wrapperID = componentInstance._instance.rootID;
12073 instancesByReactRootID[wrapperID] = componentInstance;
12074
12075 return componentInstance;
12076 },
12077
12078 /**
12079 * Renders a React component into the DOM in the supplied `container`.
12080 *
12081 * If the React component was previously rendered into `container`, this will
12082 * perform an update on it and only mutate the DOM as necessary to reflect the
12083 * latest React component.
12084 *
12085 * @param {ReactComponent} parentComponent The conceptual parent of this render tree.
12086 * @param {ReactElement} nextElement Component element to render.
12087 * @param {DOMElement} container DOM element to render into.
12088 * @param {?function} callback function triggered on completion
12089 * @return {ReactComponent} Component instance rendered in `container`.
12090 */
12091 renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
12092 !(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? "development" !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0;
12093 return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
12094 },
12095
12096 _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
12097 ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
12098 !ReactElement.isValidElement(nextElement) ? "development" !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' :
12099 // Check if it quacks like an element
12100 nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0;
12101
12102 "development" !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
12103
12104 var nextWrappedElement = ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
12105
12106 var nextContext;
12107 if (parentComponent) {
12108 var parentInst = ReactInstanceMap.get(parentComponent);
12109 nextContext = parentInst._processChildContext(parentInst._context);
12110 } else {
12111 nextContext = emptyObject;
12112 }
12113
12114 var prevComponent = getTopLevelWrapperInContainer(container);
12115
12116 if (prevComponent) {
12117 var prevWrappedElement = prevComponent._currentElement;
12118 var prevElement = prevWrappedElement.props;
12119 if (shouldUpdateReactComponent(prevElement, nextElement)) {
12120 var publicInst = prevComponent._renderedComponent.getPublicInstance();
12121 var updatedCallback = callback && function () {
12122 callback.call(publicInst);
12123 };
12124 ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback);
12125 return publicInst;
12126 } else {
12127 ReactMount.unmountComponentAtNode(container);
12128 }
12129 }
12130
12131 var reactRootElement = getReactRootElementInContainer(container);
12132 var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
12133 var containerHasNonRootReactChild = hasNonRootReactChild(container);
12134
12135 if ("development" !== 'production') {
12136 "development" !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
12137
12138 if (!containerHasReactMarkup || reactRootElement.nextSibling) {
12139 var rootElementSibling = reactRootElement;
12140 while (rootElementSibling) {
12141 if (internalGetID(rootElementSibling)) {
12142 "development" !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0;
12143 break;
12144 }
12145 rootElementSibling = rootElementSibling.nextSibling;
12146 }
12147 }
12148 }
12149
12150 var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
12151 var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance();
12152 if (callback) {
12153 callback.call(component);
12154 }
12155 return component;
12156 },
12157
12158 /**
12159 * Renders a React component into the DOM in the supplied `container`.
12160 * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
12161 *
12162 * If the React component was previously rendered into `container`, this will
12163 * perform an update on it and only mutate the DOM as necessary to reflect the
12164 * latest React component.
12165 *
12166 * @param {ReactElement} nextElement Component element to render.
12167 * @param {DOMElement} container DOM element to render into.
12168 * @param {?function} callback function triggered on completion
12169 * @return {ReactComponent} Component instance rendered in `container`.
12170 */
12171 render: function (nextElement, container, callback) {
12172 return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
12173 },
12174
12175 /**
12176 * Unmounts and destroys the React component rendered in the `container`.
12177 * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
12178 *
12179 * @param {DOMElement} container DOM element containing a React component.
12180 * @return {boolean} True if a component was found in and unmounted from
12181 * `container`
12182 */
12183 unmountComponentAtNode: function (container) {
12184 // Various parts of our code (such as ReactCompositeComponent's
12185 // _renderValidatedComponent) assume that calls to render aren't nested;
12186 // verify that that's the case. (Strictly speaking, unmounting won't cause a
12187 // render but we still don't expect to be in a render call here.)
12188 "development" !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0;
12189
12190 !isValidContainer(container) ? "development" !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0;
12191
12192 if ("development" !== 'production') {
12193 "development" !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by another copy of React.') : void 0;
12194 }
12195
12196 var prevComponent = getTopLevelWrapperInContainer(container);
12197 if (!prevComponent) {
12198 // Check if the node being unmounted was rendered by React, but isn't a
12199 // root node.
12200 var containerHasNonRootReactChild = hasNonRootReactChild(container);
12201
12202 // Check if the container itself is a React root node.
12203 var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
12204
12205 if ("development" !== 'production') {
12206 "development" !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
12207 }
12208
12209 return false;
12210 }
12211 delete instancesByReactRootID[prevComponent._instance.rootID];
12212 ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
12213 return true;
12214 },
12215
12216 _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
12217 !isValidContainer(container) ? "development" !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0;
12218
12219 if (shouldReuseMarkup) {
12220 var rootElement = getReactRootElementInContainer(container);
12221 if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
12222 ReactDOMComponentTree.precacheNode(instance, rootElement);
12223 return;
12224 } else {
12225 var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
12226 rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
12227
12228 var rootMarkup = rootElement.outerHTML;
12229 rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
12230
12231 var normalizedMarkup = markup;
12232 if ("development" !== 'production') {
12233 // because rootMarkup is retrieved from the DOM, various normalizations
12234 // will have occurred which will not be present in `markup`. Here,
12235 // insert markup into a <div> or <iframe> depending on the container
12236 // type to perform the same normalizations before comparing.
12237 var normalizer;
12238 if (container.nodeType === ELEMENT_NODE_TYPE) {
12239 normalizer = document.createElement('div');
12240 normalizer.innerHTML = markup;
12241 normalizedMarkup = normalizer.innerHTML;
12242 } else {
12243 normalizer = document.createElement('iframe');
12244 document.body.appendChild(normalizer);
12245 normalizer.contentDocument.write(markup);
12246 normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
12247 document.body.removeChild(normalizer);
12248 }
12249 }
12250
12251 var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
12252 var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
12253
12254 !(container.nodeType !== DOC_NODE_TYPE) ? "development" !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s', difference) : _prodInvariant('42', difference) : void 0;
12255
12256 if ("development" !== 'production') {
12257 "development" !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : void 0;
12258 }
12259 }
12260 }
12261
12262 !(container.nodeType !== DOC_NODE_TYPE) ? "development" !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but you didn\'t use server rendering. We can\'t do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('43') : void 0;
12263
12264 if (transaction.useCreateElement) {
12265 while (container.lastChild) {
12266 container.removeChild(container.lastChild);
12267 }
12268 DOMLazyTree.insertTreeBefore(container, markup, null);
12269 } else {
12270 setInnerHTML(container, markup);
12271 ReactDOMComponentTree.precacheNode(instance, container.firstChild);
12272 }
12273
12274 if ("development" !== 'production') {
12275 var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
12276 if (hostNode._debugID !== 0) {
12277 ReactInstrumentation.debugTool.onHostOperation(hostNode._debugID, 'mount', markup.toString());
12278 }
12279 }
12280 }
12281};
12282
12283module.exports = ReactMount;
12284},{"10":10,"135":135,"140":140,"142":142,"144":144,"155":155,"162":162,"171":171,"27":27,"37":37,"42":42,"43":43,"46":46,"61":61,"67":67,"72":72,"73":73,"75":75,"8":8,"88":88,"95":95,"96":96}],77:[function(_dereq_,module,exports){
12285/**
12286 * Copyright 2013-present, Facebook, Inc.
12287 * All rights reserved.
12288 *
12289 * This source code is licensed under the BSD-style license found in the
12290 * LICENSE file in the root directory of this source tree. An additional grant
12291 * of patent rights can be found in the PATENTS file in the same directory.
12292 *
12293 * @providesModule ReactMultiChild
12294 */
12295
12296'use strict';
12297
12298var _prodInvariant = _dereq_(140);
12299
12300var ReactComponentEnvironment = _dereq_(34);
12301var ReactInstanceMap = _dereq_(72);
12302var ReactInstrumentation = _dereq_(73);
12303var ReactMultiChildUpdateTypes = _dereq_(78);
12304
12305var ReactCurrentOwner = _dereq_(37);
12306var ReactReconciler = _dereq_(88);
12307var ReactChildReconciler = _dereq_(28);
12308
12309var emptyFunction = _dereq_(154);
12310var flattenChildren = _dereq_(124);
12311var invariant = _dereq_(162);
12312
12313/**
12314 * Make an update for markup to be rendered and inserted at a supplied index.
12315 *
12316 * @param {string} markup Markup that renders into an element.
12317 * @param {number} toIndex Destination index.
12318 * @private
12319 */
12320function makeInsertMarkup(markup, afterNode, toIndex) {
12321 // NOTE: Null values reduce hidden classes.
12322 return {
12323 type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
12324 content: markup,
12325 fromIndex: null,
12326 fromNode: null,
12327 toIndex: toIndex,
12328 afterNode: afterNode
12329 };
12330}
12331
12332/**
12333 * Make an update for moving an existing element to another index.
12334 *
12335 * @param {number} fromIndex Source index of the existing element.
12336 * @param {number} toIndex Destination index of the element.
12337 * @private
12338 */
12339function makeMove(child, afterNode, toIndex) {
12340 // NOTE: Null values reduce hidden classes.
12341 return {
12342 type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
12343 content: null,
12344 fromIndex: child._mountIndex,
12345 fromNode: ReactReconciler.getHostNode(child),
12346 toIndex: toIndex,
12347 afterNode: afterNode
12348 };
12349}
12350
12351/**
12352 * Make an update for removing an element at an index.
12353 *
12354 * @param {number} fromIndex Index of the element to remove.
12355 * @private
12356 */
12357function makeRemove(child, node) {
12358 // NOTE: Null values reduce hidden classes.
12359 return {
12360 type: ReactMultiChildUpdateTypes.REMOVE_NODE,
12361 content: null,
12362 fromIndex: child._mountIndex,
12363 fromNode: node,
12364 toIndex: null,
12365 afterNode: null
12366 };
12367}
12368
12369/**
12370 * Make an update for setting the markup of a node.
12371 *
12372 * @param {string} markup Markup that renders into an element.
12373 * @private
12374 */
12375function makeSetMarkup(markup) {
12376 // NOTE: Null values reduce hidden classes.
12377 return {
12378 type: ReactMultiChildUpdateTypes.SET_MARKUP,
12379 content: markup,
12380 fromIndex: null,
12381 fromNode: null,
12382 toIndex: null,
12383 afterNode: null
12384 };
12385}
12386
12387/**
12388 * Make an update for setting the text content.
12389 *
12390 * @param {string} textContent Text content to set.
12391 * @private
12392 */
12393function makeTextContent(textContent) {
12394 // NOTE: Null values reduce hidden classes.
12395 return {
12396 type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
12397 content: textContent,
12398 fromIndex: null,
12399 fromNode: null,
12400 toIndex: null,
12401 afterNode: null
12402 };
12403}
12404
12405/**
12406 * Push an update, if any, onto the queue. Creates a new queue if none is
12407 * passed and always returns the queue. Mutative.
12408 */
12409function enqueue(queue, update) {
12410 if (update) {
12411 queue = queue || [];
12412 queue.push(update);
12413 }
12414 return queue;
12415}
12416
12417/**
12418 * Processes any enqueued updates.
12419 *
12420 * @private
12421 */
12422function processQueue(inst, updateQueue) {
12423 ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
12424}
12425
12426var setChildrenForInstrumentation = emptyFunction;
12427if ("development" !== 'production') {
12428 var getDebugID = function (inst) {
12429 if (!inst._debugID) {
12430 // Check for ART-like instances. TODO: This is silly/gross.
12431 var internal;
12432 if (internal = ReactInstanceMap.get(inst)) {
12433 inst = internal;
12434 }
12435 }
12436 return inst._debugID;
12437 };
12438 setChildrenForInstrumentation = function (children) {
12439 var debugID = getDebugID(this);
12440 // TODO: React Native empty components are also multichild.
12441 // This means they still get into this method but don't have _debugID.
12442 if (debugID !== 0) {
12443 ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) {
12444 return children[key]._debugID;
12445 }) : []);
12446 }
12447 };
12448}
12449
12450/**
12451 * ReactMultiChild are capable of reconciling multiple children.
12452 *
12453 * @class ReactMultiChild
12454 * @internal
12455 */
12456var ReactMultiChild = {
12457
12458 /**
12459 * Provides common functionality for components that must reconcile multiple
12460 * children. This is used by `ReactDOMComponent` to mount, update, and
12461 * unmount child components.
12462 *
12463 * @lends {ReactMultiChild.prototype}
12464 */
12465 Mixin: {
12466
12467 _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
12468 if ("development" !== 'production') {
12469 var selfDebugID = getDebugID(this);
12470 if (this._currentElement) {
12471 try {
12472 ReactCurrentOwner.current = this._currentElement._owner;
12473 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID);
12474 } finally {
12475 ReactCurrentOwner.current = null;
12476 }
12477 }
12478 }
12479 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
12480 },
12481
12482 _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) {
12483 var nextChildren;
12484 var selfDebugID = 0;
12485 if ("development" !== 'production') {
12486 selfDebugID = getDebugID(this);
12487 if (this._currentElement) {
12488 try {
12489 ReactCurrentOwner.current = this._currentElement._owner;
12490 nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
12491 } finally {
12492 ReactCurrentOwner.current = null;
12493 }
12494 ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
12495 return nextChildren;
12496 }
12497 }
12498 nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
12499 ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
12500 return nextChildren;
12501 },
12502
12503 /**
12504 * Generates a "mount image" for each of the supplied children. In the case
12505 * of `ReactDOMComponent`, a mount image is a string of markup.
12506 *
12507 * @param {?object} nestedChildren Nested child maps.
12508 * @return {array} An array of mounted representations.
12509 * @internal
12510 */
12511 mountChildren: function (nestedChildren, transaction, context) {
12512 var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
12513 this._renderedChildren = children;
12514
12515 var mountImages = [];
12516 var index = 0;
12517 for (var name in children) {
12518 if (children.hasOwnProperty(name)) {
12519 var child = children[name];
12520 var selfDebugID = 0;
12521 if ("development" !== 'production') {
12522 selfDebugID = getDebugID(this);
12523 }
12524 var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);
12525 child._mountIndex = index++;
12526 mountImages.push(mountImage);
12527 }
12528 }
12529
12530 if ("development" !== 'production') {
12531 setChildrenForInstrumentation.call(this, children);
12532 }
12533
12534 return mountImages;
12535 },
12536
12537 /**
12538 * Replaces any rendered children with a text content string.
12539 *
12540 * @param {string} nextContent String of content.
12541 * @internal
12542 */
12543 updateTextContent: function (nextContent) {
12544 var prevChildren = this._renderedChildren;
12545 // Remove any rendered children.
12546 ReactChildReconciler.unmountChildren(prevChildren, false);
12547 for (var name in prevChildren) {
12548 if (prevChildren.hasOwnProperty(name)) {
12549 !false ? "development" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
12550 }
12551 }
12552 // Set new text content.
12553 var updates = [makeTextContent(nextContent)];
12554 processQueue(this, updates);
12555 },
12556
12557 /**
12558 * Replaces any rendered children with a markup string.
12559 *
12560 * @param {string} nextMarkup String of markup.
12561 * @internal
12562 */
12563 updateMarkup: function (nextMarkup) {
12564 var prevChildren = this._renderedChildren;
12565 // Remove any rendered children.
12566 ReactChildReconciler.unmountChildren(prevChildren, false);
12567 for (var name in prevChildren) {
12568 if (prevChildren.hasOwnProperty(name)) {
12569 !false ? "development" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
12570 }
12571 }
12572 var updates = [makeSetMarkup(nextMarkup)];
12573 processQueue(this, updates);
12574 },
12575
12576 /**
12577 * Updates the rendered children with new children.
12578 *
12579 * @param {?object} nextNestedChildrenElements Nested child element maps.
12580 * @param {ReactReconcileTransaction} transaction
12581 * @internal
12582 */
12583 updateChildren: function (nextNestedChildrenElements, transaction, context) {
12584 // Hook used by React ART
12585 this._updateChildren(nextNestedChildrenElements, transaction, context);
12586 },
12587
12588 /**
12589 * @param {?object} nextNestedChildrenElements Nested child element maps.
12590 * @param {ReactReconcileTransaction} transaction
12591 * @final
12592 * @protected
12593 */
12594 _updateChildren: function (nextNestedChildrenElements, transaction, context) {
12595 var prevChildren = this._renderedChildren;
12596 var removedNodes = {};
12597 var mountImages = [];
12598 var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context);
12599 if (!nextChildren && !prevChildren) {
12600 return;
12601 }
12602 var updates = null;
12603 var name;
12604 // `nextIndex` will increment for each child in `nextChildren`, but
12605 // `lastIndex` will be the last index visited in `prevChildren`.
12606 var nextIndex = 0;
12607 var lastIndex = 0;
12608 // `nextMountIndex` will increment for each newly mounted child.
12609 var nextMountIndex = 0;
12610 var lastPlacedNode = null;
12611 for (name in nextChildren) {
12612 if (!nextChildren.hasOwnProperty(name)) {
12613 continue;
12614 }
12615 var prevChild = prevChildren && prevChildren[name];
12616 var nextChild = nextChildren[name];
12617 if (prevChild === nextChild) {
12618 updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
12619 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
12620 prevChild._mountIndex = nextIndex;
12621 } else {
12622 if (prevChild) {
12623 // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
12624 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
12625 // The `removedNodes` loop below will actually remove the child.
12626 }
12627 // The child must be instantiated before it's mounted.
12628 updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context));
12629 nextMountIndex++;
12630 }
12631 nextIndex++;
12632 lastPlacedNode = ReactReconciler.getHostNode(nextChild);
12633 }
12634 // Remove children that are no longer present.
12635 for (name in removedNodes) {
12636 if (removedNodes.hasOwnProperty(name)) {
12637 updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
12638 }
12639 }
12640 if (updates) {
12641 processQueue(this, updates);
12642 }
12643 this._renderedChildren = nextChildren;
12644
12645 if ("development" !== 'production') {
12646 setChildrenForInstrumentation.call(this, nextChildren);
12647 }
12648 },
12649
12650 /**
12651 * Unmounts all rendered children. This should be used to clean up children
12652 * when this component is unmounted. It does not actually perform any
12653 * backend operations.
12654 *
12655 * @internal
12656 */
12657 unmountChildren: function (safely) {
12658 var renderedChildren = this._renderedChildren;
12659 ReactChildReconciler.unmountChildren(renderedChildren, safely);
12660 this._renderedChildren = null;
12661 },
12662
12663 /**
12664 * Moves a child component to the supplied index.
12665 *
12666 * @param {ReactComponent} child Component to move.
12667 * @param {number} toIndex Destination index of the element.
12668 * @param {number} lastIndex Last index visited of the siblings of `child`.
12669 * @protected
12670 */
12671 moveChild: function (child, afterNode, toIndex, lastIndex) {
12672 // If the index of `child` is less than `lastIndex`, then it needs to
12673 // be moved. Otherwise, we do not need to move it because a child will be
12674 // inserted or moved before `child`.
12675 if (child._mountIndex < lastIndex) {
12676 return makeMove(child, afterNode, toIndex);
12677 }
12678 },
12679
12680 /**
12681 * Creates a child component.
12682 *
12683 * @param {ReactComponent} child Component to create.
12684 * @param {string} mountImage Markup to insert.
12685 * @protected
12686 */
12687 createChild: function (child, afterNode, mountImage) {
12688 return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
12689 },
12690
12691 /**
12692 * Removes a child component.
12693 *
12694 * @param {ReactComponent} child Child to remove.
12695 * @protected
12696 */
12697 removeChild: function (child, node) {
12698 return makeRemove(child, node);
12699 },
12700
12701 /**
12702 * Mounts a child with the supplied name.
12703 *
12704 * NOTE: This is part of `updateChildren` and is here for readability.
12705 *
12706 * @param {ReactComponent} child Component to mount.
12707 * @param {string} name Name of the child.
12708 * @param {number} index Index at which to insert the child.
12709 * @param {ReactReconcileTransaction} transaction
12710 * @private
12711 */
12712 _mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) {
12713 child._mountIndex = index;
12714 return this.createChild(child, afterNode, mountImage);
12715 },
12716
12717 /**
12718 * Unmounts a rendered child.
12719 *
12720 * NOTE: This is part of `updateChildren` and is here for readability.
12721 *
12722 * @param {ReactComponent} child Component to unmount.
12723 * @private
12724 */
12725 _unmountChild: function (child, node) {
12726 var update = this.removeChild(child, node);
12727 child._mountIndex = null;
12728 return update;
12729 }
12730
12731 }
12732
12733};
12734
12735module.exports = ReactMultiChild;
12736},{"124":124,"140":140,"154":154,"162":162,"28":28,"34":34,"37":37,"72":72,"73":73,"78":78,"88":88}],78:[function(_dereq_,module,exports){
12737/**
12738 * Copyright 2013-present, Facebook, Inc.
12739 * All rights reserved.
12740 *
12741 * This source code is licensed under the BSD-style license found in the
12742 * LICENSE file in the root directory of this source tree. An additional grant
12743 * of patent rights can be found in the PATENTS file in the same directory.
12744 *
12745 * @providesModule ReactMultiChildUpdateTypes
12746 */
12747
12748'use strict';
12749
12750var keyMirror = _dereq_(165);
12751
12752/**
12753 * When a component's children are updated, a series of update configuration
12754 * objects are created in order to batch and serialize the required changes.
12755 *
12756 * Enumerates all the possible types of update configurations.
12757 *
12758 * @internal
12759 */
12760var ReactMultiChildUpdateTypes = keyMirror({
12761 INSERT_MARKUP: null,
12762 MOVE_EXISTING: null,
12763 REMOVE_NODE: null,
12764 SET_MARKUP: null,
12765 TEXT_CONTENT: null
12766});
12767
12768module.exports = ReactMultiChildUpdateTypes;
12769},{"165":165}],79:[function(_dereq_,module,exports){
12770/**
12771 * Copyright 2013-present, Facebook, Inc.
12772 * All rights reserved.
12773 *
12774 * This source code is licensed under the BSD-style license found in the
12775 * LICENSE file in the root directory of this source tree. An additional grant
12776 * of patent rights can be found in the PATENTS file in the same directory.
12777 *
12778 * @providesModule ReactNodeTypes
12779 *
12780 */
12781
12782'use strict';
12783
12784var _prodInvariant = _dereq_(140);
12785
12786var ReactElement = _dereq_(61);
12787
12788var invariant = _dereq_(162);
12789
12790var ReactNodeTypes = {
12791 HOST: 0,
12792 COMPOSITE: 1,
12793 EMPTY: 2,
12794
12795 getType: function (node) {
12796 if (node === null || node === false) {
12797 return ReactNodeTypes.EMPTY;
12798 } else if (ReactElement.isValidElement(node)) {
12799 if (typeof node.type === 'function') {
12800 return ReactNodeTypes.COMPOSITE;
12801 } else {
12802 return ReactNodeTypes.HOST;
12803 }
12804 }
12805 !false ? "development" !== 'production' ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0;
12806 }
12807};
12808
12809module.exports = ReactNodeTypes;
12810},{"140":140,"162":162,"61":61}],80:[function(_dereq_,module,exports){
12811/**
12812 * Copyright 2015-present, Facebook, Inc.
12813 * All rights reserved.
12814 *
12815 * This source code is licensed under the BSD-style license found in the
12816 * LICENSE file in the root directory of this source tree. An additional grant
12817 * of patent rights can be found in the PATENTS file in the same directory.
12818 *
12819 * @providesModule ReactNoopUpdateQueue
12820 */
12821
12822'use strict';
12823
12824var warning = _dereq_(171);
12825
12826function warnNoop(publicInstance, callerName) {
12827 if ("development" !== 'production') {
12828 var constructor = publicInstance.constructor;
12829 "development" !== 'production' ? 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. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
12830 }
12831}
12832
12833/**
12834 * This is the abstract API for an update queue.
12835 */
12836var ReactNoopUpdateQueue = {
12837
12838 /**
12839 * Checks whether or not this composite component is mounted.
12840 * @param {ReactClass} publicInstance The instance we want to test.
12841 * @return {boolean} True if mounted, false otherwise.
12842 * @protected
12843 * @final
12844 */
12845 isMounted: function (publicInstance) {
12846 return false;
12847 },
12848
12849 /**
12850 * Enqueue a callback that will be executed after all the pending updates
12851 * have processed.
12852 *
12853 * @param {ReactClass} publicInstance The instance to use as `this` context.
12854 * @param {?function} callback Called after state is updated.
12855 * @internal
12856 */
12857 enqueueCallback: function (publicInstance, callback) {},
12858
12859 /**
12860 * Forces an update. This should only be invoked when it is known with
12861 * certainty that we are **not** in a DOM transaction.
12862 *
12863 * You may want to call this when you know that some deeper aspect of the
12864 * component's state has changed but `setState` was not called.
12865 *
12866 * This will not invoke `shouldComponentUpdate`, but it will invoke
12867 * `componentWillUpdate` and `componentDidUpdate`.
12868 *
12869 * @param {ReactClass} publicInstance The instance that should rerender.
12870 * @internal
12871 */
12872 enqueueForceUpdate: function (publicInstance) {
12873 warnNoop(publicInstance, 'forceUpdate');
12874 },
12875
12876 /**
12877 * Replaces all of the state. Always use this or `setState` to mutate state.
12878 * You should treat `this.state` as immutable.
12879 *
12880 * There is no guarantee that `this.state` will be immediately updated, so
12881 * accessing `this.state` after calling this method may return the old value.
12882 *
12883 * @param {ReactClass} publicInstance The instance that should rerender.
12884 * @param {object} completeState Next state.
12885 * @internal
12886 */
12887 enqueueReplaceState: function (publicInstance, completeState) {
12888 warnNoop(publicInstance, 'replaceState');
12889 },
12890
12891 /**
12892 * Sets a subset of the state. This only exists because _pendingState is
12893 * internal. This provides a merging strategy that is not available to deep
12894 * properties which is confusing. TODO: Expose pendingState or don't use it
12895 * during the merge.
12896 *
12897 * @param {ReactClass} publicInstance The instance that should rerender.
12898 * @param {object} partialState Next partial state to be merged with state.
12899 * @internal
12900 */
12901 enqueueSetState: function (publicInstance, partialState) {
12902 warnNoop(publicInstance, 'setState');
12903 }
12904};
12905
12906module.exports = ReactNoopUpdateQueue;
12907},{"171":171}],81:[function(_dereq_,module,exports){
12908/**
12909 * Copyright 2013-present, Facebook, Inc.
12910 * All rights reserved.
12911 *
12912 * This source code is licensed under the BSD-style license found in the
12913 * LICENSE file in the root directory of this source tree. An additional grant
12914 * of patent rights can be found in the PATENTS file in the same directory.
12915 *
12916 * @providesModule ReactOwner
12917 */
12918
12919'use strict';
12920
12921var _prodInvariant = _dereq_(140);
12922
12923var invariant = _dereq_(162);
12924
12925/**
12926 * ReactOwners are capable of storing references to owned components.
12927 *
12928 * All components are capable of //being// referenced by owner components, but
12929 * only ReactOwner components are capable of //referencing// owned components.
12930 * The named reference is known as a "ref".
12931 *
12932 * Refs are available when mounted and updated during reconciliation.
12933 *
12934 * var MyComponent = React.createClass({
12935 * render: function() {
12936 * return (
12937 * <div onClick={this.handleClick}>
12938 * <CustomComponent ref="custom" />
12939 * </div>
12940 * );
12941 * },
12942 * handleClick: function() {
12943 * this.refs.custom.handleClick();
12944 * },
12945 * componentDidMount: function() {
12946 * this.refs.custom.initialize();
12947 * }
12948 * });
12949 *
12950 * Refs should rarely be used. When refs are used, they should only be done to
12951 * control data that is not handled by React's data flow.
12952 *
12953 * @class ReactOwner
12954 */
12955var ReactOwner = {
12956
12957 /**
12958 * @param {?object} object
12959 * @return {boolean} True if `object` is a valid owner.
12960 * @final
12961 */
12962 isValidOwner: function (object) {
12963 return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
12964 },
12965
12966 /**
12967 * Adds a component by ref to an owner component.
12968 *
12969 * @param {ReactComponent} component Component to reference.
12970 * @param {string} ref Name by which to refer to the component.
12971 * @param {ReactOwner} owner Component on which to record the ref.
12972 * @final
12973 * @internal
12974 */
12975 addComponentAsRefTo: function (component, ref, owner) {
12976 !ReactOwner.isValidOwner(owner) ? "development" !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('119') : void 0;
12977 owner.attachRef(ref, component);
12978 },
12979
12980 /**
12981 * Removes a component by ref from an owner component.
12982 *
12983 * @param {ReactComponent} component Component to dereference.
12984 * @param {string} ref Name of the ref to remove.
12985 * @param {ReactOwner} owner Component on which the ref is recorded.
12986 * @final
12987 * @internal
12988 */
12989 removeComponentAsRefFrom: function (component, ref, owner) {
12990 !ReactOwner.isValidOwner(owner) ? "development" !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('120') : void 0;
12991 var ownerPublicInstance = owner.getPublicInstance();
12992 // Check that `component`'s owner is still alive and that `component` is still the current ref
12993 // because we do not want to detach the ref if another component stole it.
12994 if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
12995 owner.detachRef(ref);
12996 }
12997 }
12998
12999};
13000
13001module.exports = ReactOwner;
13002},{"140":140,"162":162}],82:[function(_dereq_,module,exports){
13003/**
13004 * Copyright 2013-present, Facebook, Inc.
13005 * All rights reserved.
13006 *
13007 * This source code is licensed under the BSD-style license found in the
13008 * LICENSE file in the root directory of this source tree. An additional grant
13009 * of patent rights can be found in the PATENTS file in the same directory.
13010 *
13011 * @providesModule ReactPropTypeLocationNames
13012 */
13013
13014'use strict';
13015
13016var ReactPropTypeLocationNames = {};
13017
13018if ("development" !== 'production') {
13019 ReactPropTypeLocationNames = {
13020 prop: 'prop',
13021 context: 'context',
13022 childContext: 'child context'
13023 };
13024}
13025
13026module.exports = ReactPropTypeLocationNames;
13027},{}],83:[function(_dereq_,module,exports){
13028/**
13029 * Copyright 2013-present, Facebook, Inc.
13030 * All rights reserved.
13031 *
13032 * This source code is licensed under the BSD-style license found in the
13033 * LICENSE file in the root directory of this source tree. An additional grant
13034 * of patent rights can be found in the PATENTS file in the same directory.
13035 *
13036 * @providesModule ReactPropTypeLocations
13037 */
13038
13039'use strict';
13040
13041var keyMirror = _dereq_(165);
13042
13043var ReactPropTypeLocations = keyMirror({
13044 prop: null,
13045 context: null,
13046 childContext: null
13047});
13048
13049module.exports = ReactPropTypeLocations;
13050},{"165":165}],84:[function(_dereq_,module,exports){
13051/**
13052 * Copyright 2013-present, Facebook, Inc.
13053 * All rights reserved.
13054 *
13055 * This source code is licensed under the BSD-style license found in the
13056 * LICENSE file in the root directory of this source tree. An additional grant
13057 * of patent rights can be found in the PATENTS file in the same directory.
13058 *
13059 * @providesModule ReactPropTypes
13060 */
13061
13062'use strict';
13063
13064var ReactElement = _dereq_(61);
13065var ReactPropTypeLocationNames = _dereq_(82);
13066var ReactPropTypesSecret = _dereq_(85);
13067
13068var emptyFunction = _dereq_(154);
13069var getIteratorFn = _dereq_(131);
13070var warning = _dereq_(171);
13071
13072/**
13073 * Collection of methods that allow declaration and validation of props that are
13074 * supplied to React components. Example usage:
13075 *
13076 * var Props = require('ReactPropTypes');
13077 * var MyArticle = React.createClass({
13078 * propTypes: {
13079 * // An optional string prop named "description".
13080 * description: Props.string,
13081 *
13082 * // A required enum prop named "category".
13083 * category: Props.oneOf(['News','Photos']).isRequired,
13084 *
13085 * // A prop named "dialog" that requires an instance of Dialog.
13086 * dialog: Props.instanceOf(Dialog).isRequired
13087 * },
13088 * render: function() { ... }
13089 * });
13090 *
13091 * A more formal specification of how these methods are used:
13092 *
13093 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
13094 * decl := ReactPropTypes.{type}(.isRequired)?
13095 *
13096 * Each and every declaration produces a function with the same signature. This
13097 * allows the creation of custom validation functions. For example:
13098 *
13099 * var MyLink = React.createClass({
13100 * propTypes: {
13101 * // An optional string or URI prop named "href".
13102 * href: function(props, propName, componentName) {
13103 * var propValue = props[propName];
13104 * if (propValue != null && typeof propValue !== 'string' &&
13105 * !(propValue instanceof URI)) {
13106 * return new Error(
13107 * 'Expected a string or an URI for ' + propName + ' in ' +
13108 * componentName
13109 * );
13110 * }
13111 * }
13112 * },
13113 * render: function() {...}
13114 * });
13115 *
13116 * @internal
13117 */
13118
13119var ANONYMOUS = '<<anonymous>>';
13120
13121var ReactPropTypes = {
13122 array: createPrimitiveTypeChecker('array'),
13123 bool: createPrimitiveTypeChecker('boolean'),
13124 func: createPrimitiveTypeChecker('function'),
13125 number: createPrimitiveTypeChecker('number'),
13126 object: createPrimitiveTypeChecker('object'),
13127 string: createPrimitiveTypeChecker('string'),
13128 symbol: createPrimitiveTypeChecker('symbol'),
13129
13130 any: createAnyTypeChecker(),
13131 arrayOf: createArrayOfTypeChecker,
13132 element: createElementTypeChecker(),
13133 instanceOf: createInstanceTypeChecker,
13134 node: createNodeChecker(),
13135 objectOf: createObjectOfTypeChecker,
13136 oneOf: createEnumTypeChecker,
13137 oneOfType: createUnionTypeChecker,
13138 shape: createShapeTypeChecker
13139};
13140
13141/**
13142 * inlined Object.is polyfill to avoid requiring consumers ship their own
13143 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
13144 */
13145/*eslint-disable no-self-compare*/
13146function is(x, y) {
13147 // SameValue algorithm
13148 if (x === y) {
13149 // Steps 1-5, 7-10
13150 // Steps 6.b-6.e: +0 != -0
13151 return x !== 0 || 1 / x === 1 / y;
13152 } else {
13153 // Step 6.a: NaN == NaN
13154 return x !== x && y !== y;
13155 }
13156}
13157/*eslint-enable no-self-compare*/
13158
13159/**
13160 * We use an Error-like object for backward compatibility as people may call
13161 * PropTypes directly and inspect their output. However we don't use real
13162 * Errors anymore. We don't inspect their stack anyway, and creating them
13163 * is prohibitively expensive if they are created too often, such as what
13164 * happens in oneOfType() for any type before the one that matched.
13165 */
13166function PropTypeError(message) {
13167 this.message = message;
13168 this.stack = '';
13169}
13170// Make `instanceof Error` still work for returned errors.
13171PropTypeError.prototype = Error.prototype;
13172
13173function createChainableTypeChecker(validate) {
13174 if ("development" !== 'production') {
13175 var manualPropTypeCallCache = {};
13176 }
13177 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
13178 componentName = componentName || ANONYMOUS;
13179 propFullName = propFullName || propName;
13180 if ("development" !== 'production') {
13181 if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') {
13182 var cacheKey = componentName + ':' + propName;
13183 if (!manualPropTypeCallCache[cacheKey]) {
13184 "development" !== 'production' ? 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 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) : void 0;
13185 manualPropTypeCallCache[cacheKey] = true;
13186 }
13187 }
13188 }
13189 if (props[propName] == null) {
13190 var locationName = ReactPropTypeLocationNames[location];
13191 if (isRequired) {
13192 return new PropTypeError('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
13193 }
13194 return null;
13195 } else {
13196 return validate(props, propName, componentName, location, propFullName);
13197 }
13198 }
13199
13200 var chainedCheckType = checkType.bind(null, false);
13201 chainedCheckType.isRequired = checkType.bind(null, true);
13202
13203 return chainedCheckType;
13204}
13205
13206function createPrimitiveTypeChecker(expectedType) {
13207 function validate(props, propName, componentName, location, propFullName, secret) {
13208 var propValue = props[propName];
13209 var propType = getPropType(propValue);
13210 if (propType !== expectedType) {
13211 var locationName = ReactPropTypeLocationNames[location];
13212 // `propValue` being instance of, say, date/regexp, pass the 'object'
13213 // check, but we can offer a more precise error message here rather than
13214 // 'of type `object`'.
13215 var preciseType = getPreciseType(propValue);
13216
13217 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
13218 }
13219 return null;
13220 }
13221 return createChainableTypeChecker(validate);
13222}
13223
13224function createAnyTypeChecker() {
13225 return createChainableTypeChecker(emptyFunction.thatReturns(null));
13226}
13227
13228function createArrayOfTypeChecker(typeChecker) {
13229 function validate(props, propName, componentName, location, propFullName) {
13230 if (typeof typeChecker !== 'function') {
13231 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
13232 }
13233 var propValue = props[propName];
13234 if (!Array.isArray(propValue)) {
13235 var locationName = ReactPropTypeLocationNames[location];
13236 var propType = getPropType(propValue);
13237 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
13238 }
13239 for (var i = 0; i < propValue.length; i++) {
13240 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
13241 if (error instanceof Error) {
13242 return error;
13243 }
13244 }
13245 return null;
13246 }
13247 return createChainableTypeChecker(validate);
13248}
13249
13250function createElementTypeChecker() {
13251 function validate(props, propName, componentName, location, propFullName) {
13252 var propValue = props[propName];
13253 if (!ReactElement.isValidElement(propValue)) {
13254 var locationName = ReactPropTypeLocationNames[location];
13255 var propType = getPropType(propValue);
13256 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
13257 }
13258 return null;
13259 }
13260 return createChainableTypeChecker(validate);
13261}
13262
13263function createInstanceTypeChecker(expectedClass) {
13264 function validate(props, propName, componentName, location, propFullName) {
13265 if (!(props[propName] instanceof expectedClass)) {
13266 var locationName = ReactPropTypeLocationNames[location];
13267 var expectedClassName = expectedClass.name || ANONYMOUS;
13268 var actualClassName = getClassName(props[propName]);
13269 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
13270 }
13271 return null;
13272 }
13273 return createChainableTypeChecker(validate);
13274}
13275
13276function createEnumTypeChecker(expectedValues) {
13277 if (!Array.isArray(expectedValues)) {
13278 "development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
13279 return emptyFunction.thatReturnsNull;
13280 }
13281
13282 function validate(props, propName, componentName, location, propFullName) {
13283 var propValue = props[propName];
13284 for (var i = 0; i < expectedValues.length; i++) {
13285 if (is(propValue, expectedValues[i])) {
13286 return null;
13287 }
13288 }
13289
13290 var locationName = ReactPropTypeLocationNames[location];
13291 var valuesString = JSON.stringify(expectedValues);
13292 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
13293 }
13294 return createChainableTypeChecker(validate);
13295}
13296
13297function createObjectOfTypeChecker(typeChecker) {
13298 function validate(props, propName, componentName, location, propFullName) {
13299 if (typeof typeChecker !== 'function') {
13300 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
13301 }
13302 var propValue = props[propName];
13303 var propType = getPropType(propValue);
13304 if (propType !== 'object') {
13305 var locationName = ReactPropTypeLocationNames[location];
13306 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
13307 }
13308 for (var key in propValue) {
13309 if (propValue.hasOwnProperty(key)) {
13310 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
13311 if (error instanceof Error) {
13312 return error;
13313 }
13314 }
13315 }
13316 return null;
13317 }
13318 return createChainableTypeChecker(validate);
13319}
13320
13321function createUnionTypeChecker(arrayOfTypeCheckers) {
13322 if (!Array.isArray(arrayOfTypeCheckers)) {
13323 "development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
13324 return emptyFunction.thatReturnsNull;
13325 }
13326
13327 function validate(props, propName, componentName, location, propFullName) {
13328 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
13329 var checker = arrayOfTypeCheckers[i];
13330 if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
13331 return null;
13332 }
13333 }
13334
13335 var locationName = ReactPropTypeLocationNames[location];
13336 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
13337 }
13338 return createChainableTypeChecker(validate);
13339}
13340
13341function createNodeChecker() {
13342 function validate(props, propName, componentName, location, propFullName) {
13343 if (!isNode(props[propName])) {
13344 var locationName = ReactPropTypeLocationNames[location];
13345 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
13346 }
13347 return null;
13348 }
13349 return createChainableTypeChecker(validate);
13350}
13351
13352function createShapeTypeChecker(shapeTypes) {
13353 function validate(props, propName, componentName, location, propFullName) {
13354 var propValue = props[propName];
13355 var propType = getPropType(propValue);
13356 if (propType !== 'object') {
13357 var locationName = ReactPropTypeLocationNames[location];
13358 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
13359 }
13360 for (var key in shapeTypes) {
13361 var checker = shapeTypes[key];
13362 if (!checker) {
13363 continue;
13364 }
13365 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
13366 if (error) {
13367 return error;
13368 }
13369 }
13370 return null;
13371 }
13372 return createChainableTypeChecker(validate);
13373}
13374
13375function isNode(propValue) {
13376 switch (typeof propValue) {
13377 case 'number':
13378 case 'string':
13379 case 'undefined':
13380 return true;
13381 case 'boolean':
13382 return !propValue;
13383 case 'object':
13384 if (Array.isArray(propValue)) {
13385 return propValue.every(isNode);
13386 }
13387 if (propValue === null || ReactElement.isValidElement(propValue)) {
13388 return true;
13389 }
13390
13391 var iteratorFn = getIteratorFn(propValue);
13392 if (iteratorFn) {
13393 var iterator = iteratorFn.call(propValue);
13394 var step;
13395 if (iteratorFn !== propValue.entries) {
13396 while (!(step = iterator.next()).done) {
13397 if (!isNode(step.value)) {
13398 return false;
13399 }
13400 }
13401 } else {
13402 // Iterator will provide entry [k,v] tuples rather than values.
13403 while (!(step = iterator.next()).done) {
13404 var entry = step.value;
13405 if (entry) {
13406 if (!isNode(entry[1])) {
13407 return false;
13408 }
13409 }
13410 }
13411 }
13412 } else {
13413 return false;
13414 }
13415
13416 return true;
13417 default:
13418 return false;
13419 }
13420}
13421
13422function isSymbol(propType, propValue) {
13423 // Native Symbol.
13424 if (propType === 'symbol') {
13425 return true;
13426 }
13427
13428 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
13429 if (propValue['@@toStringTag'] === 'Symbol') {
13430 return true;
13431 }
13432
13433 // Fallback for non-spec compliant Symbols which are polyfilled.
13434 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
13435 return true;
13436 }
13437
13438 return false;
13439}
13440
13441// Equivalent of `typeof` but with special handling for array and regexp.
13442function getPropType(propValue) {
13443 var propType = typeof propValue;
13444 if (Array.isArray(propValue)) {
13445 return 'array';
13446 }
13447 if (propValue instanceof RegExp) {
13448 // Old webkits (at least until Android 4.0) return 'function' rather than
13449 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
13450 // passes PropTypes.object.
13451 return 'object';
13452 }
13453 if (isSymbol(propType, propValue)) {
13454 return 'symbol';
13455 }
13456 return propType;
13457}
13458
13459// This handles more types than `getPropType`. Only used for error messages.
13460// See `createPrimitiveTypeChecker`.
13461function getPreciseType(propValue) {
13462 var propType = getPropType(propValue);
13463 if (propType === 'object') {
13464 if (propValue instanceof Date) {
13465 return 'date';
13466 } else if (propValue instanceof RegExp) {
13467 return 'regexp';
13468 }
13469 }
13470 return propType;
13471}
13472
13473// Returns class name of the object, if any.
13474function getClassName(propValue) {
13475 if (!propValue.constructor || !propValue.constructor.name) {
13476 return ANONYMOUS;
13477 }
13478 return propValue.constructor.name;
13479}
13480
13481module.exports = ReactPropTypes;
13482},{"131":131,"154":154,"171":171,"61":61,"82":82,"85":85}],85:[function(_dereq_,module,exports){
13483/**
13484 * Copyright 2013-present, Facebook, Inc.
13485 * All rights reserved.
13486 *
13487 * This source code is licensed under the BSD-style license found in the
13488 * LICENSE file in the root directory of this source tree. An additional grant
13489 * of patent rights can be found in the PATENTS file in the same directory.
13490 *
13491 * @providesModule ReactPropTypesSecret
13492 */
13493
13494'use strict';
13495
13496var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
13497
13498module.exports = ReactPropTypesSecret;
13499},{}],86:[function(_dereq_,module,exports){
13500/**
13501 * Copyright 2013-present, Facebook, Inc.
13502 * All rights reserved.
13503 *
13504 * This source code is licensed under the BSD-style license found in the
13505 * LICENSE file in the root directory of this source tree. An additional grant
13506 * of patent rights can be found in the PATENTS file in the same directory.
13507 *
13508 * @providesModule ReactPureComponent
13509 */
13510
13511'use strict';
13512
13513var _assign = _dereq_(172);
13514
13515var ReactComponent = _dereq_(32);
13516var ReactNoopUpdateQueue = _dereq_(80);
13517
13518var emptyObject = _dereq_(155);
13519
13520/**
13521 * Base class helpers for the updating state of a component.
13522 */
13523function ReactPureComponent(props, context, updater) {
13524 // Duplicated from ReactComponent.
13525 this.props = props;
13526 this.context = context;
13527 this.refs = emptyObject;
13528 // We initialize the default updater but the real one gets injected by the
13529 // renderer.
13530 this.updater = updater || ReactNoopUpdateQueue;
13531}
13532
13533function ComponentDummy() {}
13534ComponentDummy.prototype = ReactComponent.prototype;
13535ReactPureComponent.prototype = new ComponentDummy();
13536ReactPureComponent.prototype.constructor = ReactPureComponent;
13537// Avoid an extra prototype jump for these methods.
13538_assign(ReactPureComponent.prototype, ReactComponent.prototype);
13539ReactPureComponent.prototype.isPureReactComponent = true;
13540
13541module.exports = ReactPureComponent;
13542},{"155":155,"172":172,"32":32,"80":80}],87:[function(_dereq_,module,exports){
13543/**
13544 * Copyright 2013-present, Facebook, Inc.
13545 * All rights reserved.
13546 *
13547 * This source code is licensed under the BSD-style license found in the
13548 * LICENSE file in the root directory of this source tree. An additional grant
13549 * of patent rights can be found in the PATENTS file in the same directory.
13550 *
13551 * @providesModule ReactReconcileTransaction
13552 */
13553
13554'use strict';
13555
13556var _assign = _dereq_(172);
13557
13558var CallbackQueue = _dereq_(5);
13559var PooledClass = _dereq_(25);
13560var ReactBrowserEventEmitter = _dereq_(27);
13561var ReactInputSelection = _dereq_(71);
13562var ReactInstrumentation = _dereq_(73);
13563var Transaction = _dereq_(114);
13564var ReactUpdateQueue = _dereq_(95);
13565
13566/**
13567 * Ensures that, when possible, the selection range (currently selected text
13568 * input) is not disturbed by performing the transaction.
13569 */
13570var SELECTION_RESTORATION = {
13571 /**
13572 * @return {Selection} Selection information.
13573 */
13574 initialize: ReactInputSelection.getSelectionInformation,
13575 /**
13576 * @param {Selection} sel Selection information returned from `initialize`.
13577 */
13578 close: ReactInputSelection.restoreSelection
13579};
13580
13581/**
13582 * Suppresses events (blur/focus) that could be inadvertently dispatched due to
13583 * high level DOM manipulations (like temporarily removing a text input from the
13584 * DOM).
13585 */
13586var EVENT_SUPPRESSION = {
13587 /**
13588 * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
13589 * the reconciliation.
13590 */
13591 initialize: function () {
13592 var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
13593 ReactBrowserEventEmitter.setEnabled(false);
13594 return currentlyEnabled;
13595 },
13596
13597 /**
13598 * @param {boolean} previouslyEnabled Enabled status of
13599 * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
13600 * restores the previous value.
13601 */
13602 close: function (previouslyEnabled) {
13603 ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
13604 }
13605};
13606
13607/**
13608 * Provides a queue for collecting `componentDidMount` and
13609 * `componentDidUpdate` callbacks during the transaction.
13610 */
13611var ON_DOM_READY_QUEUEING = {
13612 /**
13613 * Initializes the internal `onDOMReady` queue.
13614 */
13615 initialize: function () {
13616 this.reactMountReady.reset();
13617 },
13618
13619 /**
13620 * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
13621 */
13622 close: function () {
13623 this.reactMountReady.notifyAll();
13624 }
13625};
13626
13627/**
13628 * Executed within the scope of the `Transaction` instance. Consider these as
13629 * being member methods, but with an implied ordering while being isolated from
13630 * each other.
13631 */
13632var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
13633
13634if ("development" !== 'production') {
13635 TRANSACTION_WRAPPERS.push({
13636 initialize: ReactInstrumentation.debugTool.onBeginFlush,
13637 close: ReactInstrumentation.debugTool.onEndFlush
13638 });
13639}
13640
13641/**
13642 * Currently:
13643 * - The order that these are listed in the transaction is critical:
13644 * - Suppresses events.
13645 * - Restores selection range.
13646 *
13647 * Future:
13648 * - Restore document/overflow scroll positions that were unintentionally
13649 * modified via DOM insertions above the top viewport boundary.
13650 * - Implement/integrate with customized constraint based layout system and keep
13651 * track of which dimensions must be remeasured.
13652 *
13653 * @class ReactReconcileTransaction
13654 */
13655function ReactReconcileTransaction(useCreateElement) {
13656 this.reinitializeTransaction();
13657 // Only server-side rendering really needs this option (see
13658 // `ReactServerRendering`), but server-side uses
13659 // `ReactServerRenderingTransaction` instead. This option is here so that it's
13660 // accessible and defaults to false when `ReactDOMComponent` and
13661 // `ReactDOMTextComponent` checks it in `mountComponent`.`
13662 this.renderToStaticMarkup = false;
13663 this.reactMountReady = CallbackQueue.getPooled(null);
13664 this.useCreateElement = useCreateElement;
13665}
13666
13667var Mixin = {
13668 /**
13669 * @see Transaction
13670 * @abstract
13671 * @final
13672 * @return {array<object>} List of operation wrap procedures.
13673 * TODO: convert to array<TransactionWrapper>
13674 */
13675 getTransactionWrappers: function () {
13676 return TRANSACTION_WRAPPERS;
13677 },
13678
13679 /**
13680 * @return {object} The queue to collect `onDOMReady` callbacks with.
13681 */
13682 getReactMountReady: function () {
13683 return this.reactMountReady;
13684 },
13685
13686 /**
13687 * @return {object} The queue to collect React async events.
13688 */
13689 getUpdateQueue: function () {
13690 return ReactUpdateQueue;
13691 },
13692
13693 /**
13694 * Save current transaction state -- if the return value from this method is
13695 * passed to `rollback`, the transaction will be reset to that state.
13696 */
13697 checkpoint: function () {
13698 // reactMountReady is the our only stateful wrapper
13699 return this.reactMountReady.checkpoint();
13700 },
13701
13702 rollback: function (checkpoint) {
13703 this.reactMountReady.rollback(checkpoint);
13704 },
13705
13706 /**
13707 * `PooledClass` looks for this, and will invoke this before allowing this
13708 * instance to be reused.
13709 */
13710 destructor: function () {
13711 CallbackQueue.release(this.reactMountReady);
13712 this.reactMountReady = null;
13713 }
13714};
13715
13716_assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
13717
13718PooledClass.addPoolingTo(ReactReconcileTransaction);
13719
13720module.exports = ReactReconcileTransaction;
13721},{"114":114,"172":172,"25":25,"27":27,"5":5,"71":71,"73":73,"95":95}],88:[function(_dereq_,module,exports){
13722/**
13723 * Copyright 2013-present, Facebook, Inc.
13724 * All rights reserved.
13725 *
13726 * This source code is licensed under the BSD-style license found in the
13727 * LICENSE file in the root directory of this source tree. An additional grant
13728 * of patent rights can be found in the PATENTS file in the same directory.
13729 *
13730 * @providesModule ReactReconciler
13731 */
13732
13733'use strict';
13734
13735var ReactRef = _dereq_(89);
13736var ReactInstrumentation = _dereq_(73);
13737
13738var warning = _dereq_(171);
13739
13740/**
13741 * Helper to call ReactRef.attachRefs with this composite component, split out
13742 * to avoid allocations in the transaction mount-ready queue.
13743 */
13744function attachRefs() {
13745 ReactRef.attachRefs(this, this._currentElement);
13746}
13747
13748var ReactReconciler = {
13749
13750 /**
13751 * Initializes the component, renders markup, and registers event listeners.
13752 *
13753 * @param {ReactComponent} internalInstance
13754 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
13755 * @param {?object} the containing host component instance
13756 * @param {?object} info about the host container
13757 * @return {?string} Rendered markup to be inserted into the DOM.
13758 * @final
13759 * @internal
13760 */
13761 mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots
13762 ) {
13763 if ("development" !== 'production') {
13764 if (internalInstance._debugID !== 0) {
13765 ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
13766 }
13767 }
13768 var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
13769 if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
13770 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
13771 }
13772 if ("development" !== 'production') {
13773 if (internalInstance._debugID !== 0) {
13774 ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
13775 }
13776 }
13777 return markup;
13778 },
13779
13780 /**
13781 * Returns a value that can be passed to
13782 * ReactComponentEnvironment.replaceNodeWithMarkup.
13783 */
13784 getHostNode: function (internalInstance) {
13785 return internalInstance.getHostNode();
13786 },
13787
13788 /**
13789 * Releases any resources allocated by `mountComponent`.
13790 *
13791 * @final
13792 * @internal
13793 */
13794 unmountComponent: function (internalInstance, safely) {
13795 if ("development" !== 'production') {
13796 if (internalInstance._debugID !== 0) {
13797 ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
13798 }
13799 }
13800 ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
13801 internalInstance.unmountComponent(safely);
13802 if ("development" !== 'production') {
13803 if (internalInstance._debugID !== 0) {
13804 ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
13805 }
13806 }
13807 },
13808
13809 /**
13810 * Update a component using a new element.
13811 *
13812 * @param {ReactComponent} internalInstance
13813 * @param {ReactElement} nextElement
13814 * @param {ReactReconcileTransaction} transaction
13815 * @param {object} context
13816 * @internal
13817 */
13818 receiveComponent: function (internalInstance, nextElement, transaction, context) {
13819 var prevElement = internalInstance._currentElement;
13820
13821 if (nextElement === prevElement && context === internalInstance._context) {
13822 // Since elements are immutable after the owner is rendered,
13823 // we can do a cheap identity compare here to determine if this is a
13824 // superfluous reconcile. It's possible for state to be mutable but such
13825 // change should trigger an update of the owner which would recreate
13826 // the element. We explicitly check for the existence of an owner since
13827 // it's possible for an element created outside a composite to be
13828 // deeply mutated and reused.
13829
13830 // TODO: Bailing out early is just a perf optimization right?
13831 // TODO: Removing the return statement should affect correctness?
13832 return;
13833 }
13834
13835 if ("development" !== 'production') {
13836 if (internalInstance._debugID !== 0) {
13837 ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
13838 }
13839 }
13840
13841 var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
13842
13843 if (refsChanged) {
13844 ReactRef.detachRefs(internalInstance, prevElement);
13845 }
13846
13847 internalInstance.receiveComponent(nextElement, transaction, context);
13848
13849 if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
13850 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
13851 }
13852
13853 if ("development" !== 'production') {
13854 if (internalInstance._debugID !== 0) {
13855 ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
13856 }
13857 }
13858 },
13859
13860 /**
13861 * Flush any dirty changes in a component.
13862 *
13863 * @param {ReactComponent} internalInstance
13864 * @param {ReactReconcileTransaction} transaction
13865 * @internal
13866 */
13867 performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
13868 if (internalInstance._updateBatchNumber !== updateBatchNumber) {
13869 // The component's enqueued batch number should always be the current
13870 // batch or the following one.
13871 "development" !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
13872 return;
13873 }
13874 if ("development" !== 'production') {
13875 if (internalInstance._debugID !== 0) {
13876 ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
13877 }
13878 }
13879 internalInstance.performUpdateIfNecessary(transaction);
13880 if ("development" !== 'production') {
13881 if (internalInstance._debugID !== 0) {
13882 ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
13883 }
13884 }
13885 }
13886
13887};
13888
13889module.exports = ReactReconciler;
13890},{"171":171,"73":73,"89":89}],89:[function(_dereq_,module,exports){
13891/**
13892 * Copyright 2013-present, Facebook, Inc.
13893 * All rights reserved.
13894 *
13895 * This source code is licensed under the BSD-style license found in the
13896 * LICENSE file in the root directory of this source tree. An additional grant
13897 * of patent rights can be found in the PATENTS file in the same directory.
13898 *
13899 * @providesModule ReactRef
13900 */
13901
13902'use strict';
13903
13904var ReactOwner = _dereq_(81);
13905
13906var ReactRef = {};
13907
13908function attachRef(ref, component, owner) {
13909 if (typeof ref === 'function') {
13910 ref(component.getPublicInstance());
13911 } else {
13912 // Legacy ref
13913 ReactOwner.addComponentAsRefTo(component, ref, owner);
13914 }
13915}
13916
13917function detachRef(ref, component, owner) {
13918 if (typeof ref === 'function') {
13919 ref(null);
13920 } else {
13921 // Legacy ref
13922 ReactOwner.removeComponentAsRefFrom(component, ref, owner);
13923 }
13924}
13925
13926ReactRef.attachRefs = function (instance, element) {
13927 if (element === null || element === false) {
13928 return;
13929 }
13930 var ref = element.ref;
13931 if (ref != null) {
13932 attachRef(ref, instance, element._owner);
13933 }
13934};
13935
13936ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
13937 // If either the owner or a `ref` has changed, make sure the newest owner
13938 // has stored a reference to `this`, and the previous owner (if different)
13939 // has forgotten the reference to `this`. We use the element instead
13940 // of the public this.props because the post processing cannot determine
13941 // a ref. The ref conceptually lives on the element.
13942
13943 // TODO: Should this even be possible? The owner cannot change because
13944 // it's forbidden by shouldUpdateReactComponent. The ref can change
13945 // if you swap the keys of but not the refs. Reconsider where this check
13946 // is made. It probably belongs where the key checking and
13947 // instantiateReactComponent is done.
13948
13949 var prevEmpty = prevElement === null || prevElement === false;
13950 var nextEmpty = nextElement === null || nextElement === false;
13951
13952 return (
13953 // This has a few false positives w/r/t empty components.
13954 prevEmpty || nextEmpty || nextElement.ref !== prevElement.ref ||
13955 // If owner changes but we have an unchanged function ref, don't update refs
13956 typeof nextElement.ref === 'string' && nextElement._owner !== prevElement._owner
13957 );
13958};
13959
13960ReactRef.detachRefs = function (instance, element) {
13961 if (element === null || element === false) {
13962 return;
13963 }
13964 var ref = element.ref;
13965 if (ref != null) {
13966 detachRef(ref, instance, element._owner);
13967 }
13968};
13969
13970module.exports = ReactRef;
13971},{"81":81}],90:[function(_dereq_,module,exports){
13972/**
13973 * Copyright 2014-present, Facebook, Inc.
13974 * All rights reserved.
13975 *
13976 * This source code is licensed under the BSD-style license found in the
13977 * LICENSE file in the root directory of this source tree. An additional grant
13978 * of patent rights can be found in the PATENTS file in the same directory.
13979 *
13980 * @providesModule ReactServerBatchingStrategy
13981 */
13982
13983'use strict';
13984
13985var ReactServerBatchingStrategy = {
13986 isBatchingUpdates: false,
13987 batchedUpdates: function (callback) {
13988 // Don't do anything here. During the server rendering we don't want to
13989 // schedule any updates. We will simply ignore them.
13990 }
13991};
13992
13993module.exports = ReactServerBatchingStrategy;
13994},{}],91:[function(_dereq_,module,exports){
13995/**
13996 * Copyright 2013-present, Facebook, Inc.
13997 * All rights reserved.
13998 *
13999 * This source code is licensed under the BSD-style license found in the
14000 * LICENSE file in the root directory of this source tree. An additional grant
14001 * of patent rights can be found in the PATENTS file in the same directory.
14002 *
14003 * @providesModule ReactServerRendering
14004 */
14005'use strict';
14006
14007var _prodInvariant = _dereq_(140);
14008
14009var ReactDOMContainerInfo = _dereq_(43);
14010var ReactDefaultBatchingStrategy = _dereq_(59);
14011var ReactElement = _dereq_(61);
14012var ReactInstrumentation = _dereq_(73);
14013var ReactMarkupChecksum = _dereq_(75);
14014var ReactReconciler = _dereq_(88);
14015var ReactServerBatchingStrategy = _dereq_(90);
14016var ReactServerRenderingTransaction = _dereq_(92);
14017var ReactUpdates = _dereq_(96);
14018
14019var emptyObject = _dereq_(155);
14020var instantiateReactComponent = _dereq_(135);
14021var invariant = _dereq_(162);
14022
14023var pendingTransactions = 0;
14024
14025/**
14026 * @param {ReactElement} element
14027 * @return {string} the HTML markup
14028 */
14029function renderToStringImpl(element, makeStaticMarkup) {
14030 var transaction;
14031 try {
14032 ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
14033
14034 transaction = ReactServerRenderingTransaction.getPooled(makeStaticMarkup);
14035
14036 pendingTransactions++;
14037
14038 return transaction.perform(function () {
14039 var componentInstance = instantiateReactComponent(element, true);
14040 var markup = ReactReconciler.mountComponent(componentInstance, transaction, null, ReactDOMContainerInfo(), emptyObject, 0 /* parentDebugID */
14041 );
14042 if ("development" !== 'production') {
14043 ReactInstrumentation.debugTool.onUnmountComponent(componentInstance._debugID);
14044 }
14045 if (!makeStaticMarkup) {
14046 markup = ReactMarkupChecksum.addChecksumToMarkup(markup);
14047 }
14048 return markup;
14049 }, null);
14050 } finally {
14051 pendingTransactions--;
14052 ReactServerRenderingTransaction.release(transaction);
14053 // Revert to the DOM batching strategy since these two renderers
14054 // currently share these stateful modules.
14055 if (!pendingTransactions) {
14056 ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
14057 }
14058 }
14059}
14060
14061/**
14062 * Render a ReactElement to its initial HTML. This should only be used on the
14063 * server.
14064 * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostring
14065 */
14066function renderToString(element) {
14067 !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : _prodInvariant('46') : void 0;
14068 return renderToStringImpl(element, false);
14069}
14070
14071/**
14072 * Similar to renderToString, except this doesn't create extra DOM attributes
14073 * such as data-react-id that React uses internally.
14074 * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostaticmarkup
14075 */
14076function renderToStaticMarkup(element) {
14077 !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : _prodInvariant('47') : void 0;
14078 return renderToStringImpl(element, true);
14079}
14080
14081module.exports = {
14082 renderToString: renderToString,
14083 renderToStaticMarkup: renderToStaticMarkup
14084};
14085},{"135":135,"140":140,"155":155,"162":162,"43":43,"59":59,"61":61,"73":73,"75":75,"88":88,"90":90,"92":92,"96":96}],92:[function(_dereq_,module,exports){
14086/**
14087 * Copyright 2014-present, Facebook, Inc.
14088 * All rights reserved.
14089 *
14090 * This source code is licensed under the BSD-style license found in the
14091 * LICENSE file in the root directory of this source tree. An additional grant
14092 * of patent rights can be found in the PATENTS file in the same directory.
14093 *
14094 * @providesModule ReactServerRenderingTransaction
14095 */
14096
14097'use strict';
14098
14099var _assign = _dereq_(172);
14100
14101var PooledClass = _dereq_(25);
14102var Transaction = _dereq_(114);
14103var ReactInstrumentation = _dereq_(73);
14104var ReactServerUpdateQueue = _dereq_(93);
14105
14106/**
14107 * Executed within the scope of the `Transaction` instance. Consider these as
14108 * being member methods, but with an implied ordering while being isolated from
14109 * each other.
14110 */
14111var TRANSACTION_WRAPPERS = [];
14112
14113if ("development" !== 'production') {
14114 TRANSACTION_WRAPPERS.push({
14115 initialize: ReactInstrumentation.debugTool.onBeginFlush,
14116 close: ReactInstrumentation.debugTool.onEndFlush
14117 });
14118}
14119
14120var noopCallbackQueue = {
14121 enqueue: function () {}
14122};
14123
14124/**
14125 * @class ReactServerRenderingTransaction
14126 * @param {boolean} renderToStaticMarkup
14127 */
14128function ReactServerRenderingTransaction(renderToStaticMarkup) {
14129 this.reinitializeTransaction();
14130 this.renderToStaticMarkup = renderToStaticMarkup;
14131 this.useCreateElement = false;
14132 this.updateQueue = new ReactServerUpdateQueue(this);
14133}
14134
14135var Mixin = {
14136 /**
14137 * @see Transaction
14138 * @abstract
14139 * @final
14140 * @return {array} Empty list of operation wrap procedures.
14141 */
14142 getTransactionWrappers: function () {
14143 return TRANSACTION_WRAPPERS;
14144 },
14145
14146 /**
14147 * @return {object} The queue to collect `onDOMReady` callbacks with.
14148 */
14149 getReactMountReady: function () {
14150 return noopCallbackQueue;
14151 },
14152
14153 /**
14154 * @return {object} The queue to collect React async events.
14155 */
14156 getUpdateQueue: function () {
14157 return this.updateQueue;
14158 },
14159
14160 /**
14161 * `PooledClass` looks for this, and will invoke this before allowing this
14162 * instance to be reused.
14163 */
14164 destructor: function () {},
14165
14166 checkpoint: function () {},
14167
14168 rollback: function () {}
14169};
14170
14171_assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
14172
14173PooledClass.addPoolingTo(ReactServerRenderingTransaction);
14174
14175module.exports = ReactServerRenderingTransaction;
14176},{"114":114,"172":172,"25":25,"73":73,"93":93}],93:[function(_dereq_,module,exports){
14177/**
14178 * Copyright 2015-present, Facebook, Inc.
14179 * All rights reserved.
14180 *
14181 * This source code is licensed under the BSD-style license found in the
14182 * LICENSE file in the root directory of this source tree. An additional grant
14183 * of patent rights can be found in the PATENTS file in the same directory.
14184 *
14185 * @providesModule ReactServerUpdateQueue
14186 *
14187 */
14188
14189'use strict';
14190
14191function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14192
14193var ReactUpdateQueue = _dereq_(95);
14194var Transaction = _dereq_(114);
14195var warning = _dereq_(171);
14196
14197function warnNoop(publicInstance, callerName) {
14198 if ("development" !== 'production') {
14199 var constructor = publicInstance.constructor;
14200 "development" !== 'production' ? warning(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
14201 }
14202}
14203
14204/**
14205 * This is the update queue used for server rendering.
14206 * It delegates to ReactUpdateQueue while server rendering is in progress and
14207 * switches to ReactNoopUpdateQueue after the transaction has completed.
14208 * @class ReactServerUpdateQueue
14209 * @param {Transaction} transaction
14210 */
14211
14212var ReactServerUpdateQueue = function () {
14213 /* :: transaction: Transaction; */
14214
14215 function ReactServerUpdateQueue(transaction) {
14216 _classCallCheck(this, ReactServerUpdateQueue);
14217
14218 this.transaction = transaction;
14219 }
14220
14221 /**
14222 * Checks whether or not this composite component is mounted.
14223 * @param {ReactClass} publicInstance The instance we want to test.
14224 * @return {boolean} True if mounted, false otherwise.
14225 * @protected
14226 * @final
14227 */
14228
14229
14230 ReactServerUpdateQueue.prototype.isMounted = function isMounted(publicInstance) {
14231 return false;
14232 };
14233
14234 /**
14235 * Enqueue a callback that will be executed after all the pending updates
14236 * have processed.
14237 *
14238 * @param {ReactClass} publicInstance The instance to use as `this` context.
14239 * @param {?function} callback Called after state is updated.
14240 * @internal
14241 */
14242
14243
14244 ReactServerUpdateQueue.prototype.enqueueCallback = function enqueueCallback(publicInstance, callback, callerName) {
14245 if (this.transaction.isInTransaction()) {
14246 ReactUpdateQueue.enqueueCallback(publicInstance, callback, callerName);
14247 }
14248 };
14249
14250 /**
14251 * Forces an update. This should only be invoked when it is known with
14252 * certainty that we are **not** in a DOM transaction.
14253 *
14254 * You may want to call this when you know that some deeper aspect of the
14255 * component's state has changed but `setState` was not called.
14256 *
14257 * This will not invoke `shouldComponentUpdate`, but it will invoke
14258 * `componentWillUpdate` and `componentDidUpdate`.
14259 *
14260 * @param {ReactClass} publicInstance The instance that should rerender.
14261 * @internal
14262 */
14263
14264
14265 ReactServerUpdateQueue.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance) {
14266 if (this.transaction.isInTransaction()) {
14267 ReactUpdateQueue.enqueueForceUpdate(publicInstance);
14268 } else {
14269 warnNoop(publicInstance, 'forceUpdate');
14270 }
14271 };
14272
14273 /**
14274 * Replaces all of the state. Always use this or `setState` to mutate state.
14275 * You should treat `this.state` as immutable.
14276 *
14277 * There is no guarantee that `this.state` will be immediately updated, so
14278 * accessing `this.state` after calling this method may return the old value.
14279 *
14280 * @param {ReactClass} publicInstance The instance that should rerender.
14281 * @param {object|function} completeState Next state.
14282 * @internal
14283 */
14284
14285
14286 ReactServerUpdateQueue.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState) {
14287 if (this.transaction.isInTransaction()) {
14288 ReactUpdateQueue.enqueueReplaceState(publicInstance, completeState);
14289 } else {
14290 warnNoop(publicInstance, 'replaceState');
14291 }
14292 };
14293
14294 /**
14295 * Sets a subset of the state. This only exists because _pendingState is
14296 * internal. This provides a merging strategy that is not available to deep
14297 * properties which is confusing. TODO: Expose pendingState or don't use it
14298 * during the merge.
14299 *
14300 * @param {ReactClass} publicInstance The instance that should rerender.
14301 * @param {object|function} partialState Next partial state to be merged with state.
14302 * @internal
14303 */
14304
14305
14306 ReactServerUpdateQueue.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState) {
14307 if (this.transaction.isInTransaction()) {
14308 ReactUpdateQueue.enqueueSetState(publicInstance, partialState);
14309 } else {
14310 warnNoop(publicInstance, 'setState');
14311 }
14312 };
14313
14314 return ReactServerUpdateQueue;
14315}();
14316
14317module.exports = ReactServerUpdateQueue;
14318},{"114":114,"171":171,"95":95}],94:[function(_dereq_,module,exports){
14319/**
14320 * Copyright 2013-present, Facebook, Inc.
14321 * All rights reserved.
14322 *
14323 * This source code is licensed under the BSD-style license found in the
14324 * LICENSE file in the root directory of this source tree. An additional grant
14325 * of patent rights can be found in the PATENTS file in the same directory.
14326 *
14327 * @providesModule ReactUMDEntry
14328 */
14329
14330'use strict';
14331
14332var _assign = _dereq_(172);
14333
14334var ReactDOM = _dereq_(38);
14335var ReactDOMServer = _dereq_(53);
14336var React = _dereq_(26);
14337
14338// `version` will be added here by ReactIsomorphic.
14339var ReactUMDEntry = _assign({
14340 __SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOM,
14341 __SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOMServer
14342}, React);
14343
14344module.exports = ReactUMDEntry;
14345},{"172":172,"26":26,"38":38,"53":53}],95:[function(_dereq_,module,exports){
14346/**
14347 * Copyright 2015-present, Facebook, Inc.
14348 * All rights reserved.
14349 *
14350 * This source code is licensed under the BSD-style license found in the
14351 * LICENSE file in the root directory of this source tree. An additional grant
14352 * of patent rights can be found in the PATENTS file in the same directory.
14353 *
14354 * @providesModule ReactUpdateQueue
14355 */
14356
14357'use strict';
14358
14359var _prodInvariant = _dereq_(140);
14360
14361var ReactCurrentOwner = _dereq_(37);
14362var ReactInstanceMap = _dereq_(72);
14363var ReactInstrumentation = _dereq_(73);
14364var ReactUpdates = _dereq_(96);
14365
14366var invariant = _dereq_(162);
14367var warning = _dereq_(171);
14368
14369function enqueueUpdate(internalInstance) {
14370 ReactUpdates.enqueueUpdate(internalInstance);
14371}
14372
14373function formatUnexpectedArgument(arg) {
14374 var type = typeof arg;
14375 if (type !== 'object') {
14376 return type;
14377 }
14378 var displayName = arg.constructor && arg.constructor.name || type;
14379 var keys = Object.keys(arg);
14380 if (keys.length > 0 && keys.length < 20) {
14381 return displayName + ' (keys: ' + keys.join(', ') + ')';
14382 }
14383 return displayName;
14384}
14385
14386function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
14387 var internalInstance = ReactInstanceMap.get(publicInstance);
14388 if (!internalInstance) {
14389 if ("development" !== 'production') {
14390 var ctor = publicInstance.constructor;
14391 // Only warn when we have a callerName. Otherwise we should be silent.
14392 // We're probably calling from enqueueCallback. We don't want to warn
14393 // there because we already warned for the corresponding lifecycle method.
14394 "development" !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, ctor && (ctor.displayName || ctor.name) || 'ReactClass') : void 0;
14395 }
14396 return null;
14397 }
14398
14399 if ("development" !== 'production') {
14400 "development" !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
14401 }
14402
14403 return internalInstance;
14404}
14405
14406/**
14407 * ReactUpdateQueue allows for state updates to be scheduled into a later
14408 * reconciliation step.
14409 */
14410var ReactUpdateQueue = {
14411
14412 /**
14413 * Checks whether or not this composite component is mounted.
14414 * @param {ReactClass} publicInstance The instance we want to test.
14415 * @return {boolean} True if mounted, false otherwise.
14416 * @protected
14417 * @final
14418 */
14419 isMounted: function (publicInstance) {
14420 if ("development" !== 'production') {
14421 var owner = ReactCurrentOwner.current;
14422 if (owner !== null) {
14423 "development" !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
14424 owner._warnedAboutRefsInRender = true;
14425 }
14426 }
14427 var internalInstance = ReactInstanceMap.get(publicInstance);
14428 if (internalInstance) {
14429 // During componentWillMount and render this will still be null but after
14430 // that will always render to something. At least for now. So we can use
14431 // this hack.
14432 return !!internalInstance._renderedComponent;
14433 } else {
14434 return false;
14435 }
14436 },
14437
14438 /**
14439 * Enqueue a callback that will be executed after all the pending updates
14440 * have processed.
14441 *
14442 * @param {ReactClass} publicInstance The instance to use as `this` context.
14443 * @param {?function} callback Called after state is updated.
14444 * @param {string} callerName Name of the calling function in the public API.
14445 * @internal
14446 */
14447 enqueueCallback: function (publicInstance, callback, callerName) {
14448 ReactUpdateQueue.validateCallback(callback, callerName);
14449 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
14450
14451 // Previously we would throw an error if we didn't have an internal
14452 // instance. Since we want to make it a no-op instead, we mirror the same
14453 // behavior we have in other enqueue* methods.
14454 // We also need to ignore callbacks in componentWillMount. See
14455 // enqueueUpdates.
14456 if (!internalInstance) {
14457 return null;
14458 }
14459
14460 if (internalInstance._pendingCallbacks) {
14461 internalInstance._pendingCallbacks.push(callback);
14462 } else {
14463 internalInstance._pendingCallbacks = [callback];
14464 }
14465 // TODO: The callback here is ignored when setState is called from
14466 // componentWillMount. Either fix it or disallow doing so completely in
14467 // favor of getInitialState. Alternatively, we can disallow
14468 // componentWillMount during server-side rendering.
14469 enqueueUpdate(internalInstance);
14470 },
14471
14472 enqueueCallbackInternal: function (internalInstance, callback) {
14473 if (internalInstance._pendingCallbacks) {
14474 internalInstance._pendingCallbacks.push(callback);
14475 } else {
14476 internalInstance._pendingCallbacks = [callback];
14477 }
14478 enqueueUpdate(internalInstance);
14479 },
14480
14481 /**
14482 * Forces an update. This should only be invoked when it is known with
14483 * certainty that we are **not** in a DOM transaction.
14484 *
14485 * You may want to call this when you know that some deeper aspect of the
14486 * component's state has changed but `setState` was not called.
14487 *
14488 * This will not invoke `shouldComponentUpdate`, but it will invoke
14489 * `componentWillUpdate` and `componentDidUpdate`.
14490 *
14491 * @param {ReactClass} publicInstance The instance that should rerender.
14492 * @internal
14493 */
14494 enqueueForceUpdate: function (publicInstance) {
14495 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
14496
14497 if (!internalInstance) {
14498 return;
14499 }
14500
14501 internalInstance._pendingForceUpdate = true;
14502
14503 enqueueUpdate(internalInstance);
14504 },
14505
14506 /**
14507 * Replaces all of the state. Always use this or `setState` to mutate state.
14508 * You should treat `this.state` as immutable.
14509 *
14510 * There is no guarantee that `this.state` will be immediately updated, so
14511 * accessing `this.state` after calling this method may return the old value.
14512 *
14513 * @param {ReactClass} publicInstance The instance that should rerender.
14514 * @param {object} completeState Next state.
14515 * @internal
14516 */
14517 enqueueReplaceState: function (publicInstance, completeState) {
14518 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
14519
14520 if (!internalInstance) {
14521 return;
14522 }
14523
14524 internalInstance._pendingStateQueue = [completeState];
14525 internalInstance._pendingReplaceState = true;
14526
14527 enqueueUpdate(internalInstance);
14528 },
14529
14530 /**
14531 * Sets a subset of the state. This only exists because _pendingState is
14532 * internal. This provides a merging strategy that is not available to deep
14533 * properties which is confusing. TODO: Expose pendingState or don't use it
14534 * during the merge.
14535 *
14536 * @param {ReactClass} publicInstance The instance that should rerender.
14537 * @param {object} partialState Next partial state to be merged with state.
14538 * @internal
14539 */
14540 enqueueSetState: function (publicInstance, partialState) {
14541 if ("development" !== 'production') {
14542 ReactInstrumentation.debugTool.onSetState();
14543 "development" !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
14544 }
14545
14546 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
14547
14548 if (!internalInstance) {
14549 return;
14550 }
14551
14552 var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
14553 queue.push(partialState);
14554
14555 enqueueUpdate(internalInstance);
14556 },
14557
14558 enqueueElementInternal: function (internalInstance, nextElement, nextContext) {
14559 internalInstance._pendingElement = nextElement;
14560 // TODO: introduce _pendingContext instead of setting it directly.
14561 internalInstance._context = nextContext;
14562 enqueueUpdate(internalInstance);
14563 },
14564
14565 validateCallback: function (callback, callerName) {
14566 !(!callback || typeof callback === 'function') ? "development" !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0;
14567 }
14568
14569};
14570
14571module.exports = ReactUpdateQueue;
14572},{"140":140,"162":162,"171":171,"37":37,"72":72,"73":73,"96":96}],96:[function(_dereq_,module,exports){
14573/**
14574 * Copyright 2013-present, Facebook, Inc.
14575 * All rights reserved.
14576 *
14577 * This source code is licensed under the BSD-style license found in the
14578 * LICENSE file in the root directory of this source tree. An additional grant
14579 * of patent rights can be found in the PATENTS file in the same directory.
14580 *
14581 * @providesModule ReactUpdates
14582 */
14583
14584'use strict';
14585
14586var _prodInvariant = _dereq_(140),
14587 _assign = _dereq_(172);
14588
14589var CallbackQueue = _dereq_(5);
14590var PooledClass = _dereq_(25);
14591var ReactFeatureFlags = _dereq_(67);
14592var ReactReconciler = _dereq_(88);
14593var Transaction = _dereq_(114);
14594
14595var invariant = _dereq_(162);
14596
14597var dirtyComponents = [];
14598var updateBatchNumber = 0;
14599var asapCallbackQueue = CallbackQueue.getPooled();
14600var asapEnqueued = false;
14601
14602var batchingStrategy = null;
14603
14604function ensureInjected() {
14605 !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0;
14606}
14607
14608var NESTED_UPDATES = {
14609 initialize: function () {
14610 this.dirtyComponentsLength = dirtyComponents.length;
14611 },
14612 close: function () {
14613 if (this.dirtyComponentsLength !== dirtyComponents.length) {
14614 // Additional updates were enqueued by componentDidUpdate handlers or
14615 // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
14616 // these new updates so that if A's componentDidUpdate calls setState on
14617 // B, B will update before the callback A's updater provided when calling
14618 // setState.
14619 dirtyComponents.splice(0, this.dirtyComponentsLength);
14620 flushBatchedUpdates();
14621 } else {
14622 dirtyComponents.length = 0;
14623 }
14624 }
14625};
14626
14627var UPDATE_QUEUEING = {
14628 initialize: function () {
14629 this.callbackQueue.reset();
14630 },
14631 close: function () {
14632 this.callbackQueue.notifyAll();
14633 }
14634};
14635
14636var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
14637
14638function ReactUpdatesFlushTransaction() {
14639 this.reinitializeTransaction();
14640 this.dirtyComponentsLength = null;
14641 this.callbackQueue = CallbackQueue.getPooled();
14642 this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
14643 /* useCreateElement */true);
14644}
14645
14646_assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
14647 getTransactionWrappers: function () {
14648 return TRANSACTION_WRAPPERS;
14649 },
14650
14651 destructor: function () {
14652 this.dirtyComponentsLength = null;
14653 CallbackQueue.release(this.callbackQueue);
14654 this.callbackQueue = null;
14655 ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
14656 this.reconcileTransaction = null;
14657 },
14658
14659 perform: function (method, scope, a) {
14660 // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
14661 // with this transaction's wrappers around it.
14662 return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
14663 }
14664});
14665
14666PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
14667
14668function batchedUpdates(callback, a, b, c, d, e) {
14669 ensureInjected();
14670 batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
14671}
14672
14673/**
14674 * Array comparator for ReactComponents by mount ordering.
14675 *
14676 * @param {ReactComponent} c1 first component you're comparing
14677 * @param {ReactComponent} c2 second component you're comparing
14678 * @return {number} Return value usable by Array.prototype.sort().
14679 */
14680function mountOrderComparator(c1, c2) {
14681 return c1._mountOrder - c2._mountOrder;
14682}
14683
14684function runBatchedUpdates(transaction) {
14685 var len = transaction.dirtyComponentsLength;
14686 !(len === dirtyComponents.length) ? "development" !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0;
14687
14688 // Since reconciling a component higher in the owner hierarchy usually (not
14689 // always -- see shouldComponentUpdate()) will reconcile children, reconcile
14690 // them before their children by sorting the array.
14691 dirtyComponents.sort(mountOrderComparator);
14692
14693 // Any updates enqueued while reconciling must be performed after this entire
14694 // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
14695 // C, B could update twice in a single batch if C's render enqueues an update
14696 // to B (since B would have already updated, we should skip it, and the only
14697 // way we can know to do so is by checking the batch counter).
14698 updateBatchNumber++;
14699
14700 for (var i = 0; i < len; i++) {
14701 // If a component is unmounted before pending changes apply, it will still
14702 // be here, but we assume that it has cleared its _pendingCallbacks and
14703 // that performUpdateIfNecessary is a noop.
14704 var component = dirtyComponents[i];
14705
14706 // If performUpdateIfNecessary happens to enqueue any new updates, we
14707 // shouldn't execute the callbacks until the next render happens, so
14708 // stash the callbacks first
14709 var callbacks = component._pendingCallbacks;
14710 component._pendingCallbacks = null;
14711
14712 var markerName;
14713 if (ReactFeatureFlags.logTopLevelRenders) {
14714 var namedComponent = component;
14715 // Duck type TopLevelWrapper. This is probably always true.
14716 if (component._currentElement.props === component._renderedComponent._currentElement) {
14717 namedComponent = component._renderedComponent;
14718 }
14719 markerName = 'React update: ' + namedComponent.getName();
14720 console.time(markerName);
14721 }
14722
14723 ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
14724
14725 if (markerName) {
14726 console.timeEnd(markerName);
14727 }
14728
14729 if (callbacks) {
14730 for (var j = 0; j < callbacks.length; j++) {
14731 transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
14732 }
14733 }
14734 }
14735}
14736
14737var flushBatchedUpdates = function () {
14738 // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
14739 // array and perform any updates enqueued by mount-ready handlers (i.e.,
14740 // componentDidUpdate) but we need to check here too in order to catch
14741 // updates enqueued by setState callbacks and asap calls.
14742 while (dirtyComponents.length || asapEnqueued) {
14743 if (dirtyComponents.length) {
14744 var transaction = ReactUpdatesFlushTransaction.getPooled();
14745 transaction.perform(runBatchedUpdates, null, transaction);
14746 ReactUpdatesFlushTransaction.release(transaction);
14747 }
14748
14749 if (asapEnqueued) {
14750 asapEnqueued = false;
14751 var queue = asapCallbackQueue;
14752 asapCallbackQueue = CallbackQueue.getPooled();
14753 queue.notifyAll();
14754 CallbackQueue.release(queue);
14755 }
14756 }
14757};
14758
14759/**
14760 * Mark a component as needing a rerender, adding an optional callback to a
14761 * list of functions which will be executed once the rerender occurs.
14762 */
14763function enqueueUpdate(component) {
14764 ensureInjected();
14765
14766 // Various parts of our code (such as ReactCompositeComponent's
14767 // _renderValidatedComponent) assume that calls to render aren't nested;
14768 // verify that that's the case. (This is called by each top-level update
14769 // function, like setState, forceUpdate, etc.; creation and
14770 // destruction of top-level components is guarded in ReactMount.)
14771
14772 if (!batchingStrategy.isBatchingUpdates) {
14773 batchingStrategy.batchedUpdates(enqueueUpdate, component);
14774 return;
14775 }
14776
14777 dirtyComponents.push(component);
14778 if (component._updateBatchNumber == null) {
14779 component._updateBatchNumber = updateBatchNumber + 1;
14780 }
14781}
14782
14783/**
14784 * Enqueue a callback to be run at the end of the current batching cycle. Throws
14785 * if no updates are currently being performed.
14786 */
14787function asap(callback, context) {
14788 !batchingStrategy.isBatchingUpdates ? "development" !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;
14789 asapCallbackQueue.enqueue(callback, context);
14790 asapEnqueued = true;
14791}
14792
14793var ReactUpdatesInjection = {
14794 injectReconcileTransaction: function (ReconcileTransaction) {
14795 !ReconcileTransaction ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
14796 ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
14797 },
14798
14799 injectBatchingStrategy: function (_batchingStrategy) {
14800 !_batchingStrategy ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
14801 !(typeof _batchingStrategy.batchedUpdates === 'function') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
14802 !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0;
14803 batchingStrategy = _batchingStrategy;
14804 }
14805};
14806
14807var ReactUpdates = {
14808 /**
14809 * React references `ReactReconcileTransaction` using this property in order
14810 * to allow dependency injection.
14811 *
14812 * @internal
14813 */
14814 ReactReconcileTransaction: null,
14815
14816 batchedUpdates: batchedUpdates,
14817 enqueueUpdate: enqueueUpdate,
14818 flushBatchedUpdates: flushBatchedUpdates,
14819 injection: ReactUpdatesInjection,
14820 asap: asap
14821};
14822
14823module.exports = ReactUpdates;
14824},{"114":114,"140":140,"162":162,"172":172,"25":25,"5":5,"67":67,"88":88}],97:[function(_dereq_,module,exports){
14825/**
14826 * Copyright 2013-present, Facebook, Inc.
14827 * All rights reserved.
14828 *
14829 * This source code is licensed under the BSD-style license found in the
14830 * LICENSE file in the root directory of this source tree. An additional grant
14831 * of patent rights can be found in the PATENTS file in the same directory.
14832 *
14833 * @providesModule ReactVersion
14834 */
14835
14836'use strict';
14837
14838module.exports = '15.3.2';
14839},{}],98:[function(_dereq_,module,exports){
14840/**
14841 * Copyright 2013-present, Facebook, Inc.
14842 * All rights reserved.
14843 *
14844 * This source code is licensed under the BSD-style license found in the
14845 * LICENSE file in the root directory of this source tree. An additional grant
14846 * of patent rights can be found in the PATENTS file in the same directory.
14847 *
14848 * @providesModule SVGDOMPropertyConfig
14849 */
14850
14851'use strict';
14852
14853var NS = {
14854 xlink: 'http://www.w3.org/1999/xlink',
14855 xml: 'http://www.w3.org/XML/1998/namespace'
14856};
14857
14858// We use attributes for everything SVG so let's avoid some duplication and run
14859// code instead.
14860// The following are all specified in the HTML config already so we exclude here.
14861// - class (as className)
14862// - color
14863// - height
14864// - id
14865// - lang
14866// - max
14867// - media
14868// - method
14869// - min
14870// - name
14871// - style
14872// - target
14873// - type
14874// - width
14875var ATTRS = {
14876 accentHeight: 'accent-height',
14877 accumulate: 0,
14878 additive: 0,
14879 alignmentBaseline: 'alignment-baseline',
14880 allowReorder: 'allowReorder',
14881 alphabetic: 0,
14882 amplitude: 0,
14883 arabicForm: 'arabic-form',
14884 ascent: 0,
14885 attributeName: 'attributeName',
14886 attributeType: 'attributeType',
14887 autoReverse: 'autoReverse',
14888 azimuth: 0,
14889 baseFrequency: 'baseFrequency',
14890 baseProfile: 'baseProfile',
14891 baselineShift: 'baseline-shift',
14892 bbox: 0,
14893 begin: 0,
14894 bias: 0,
14895 by: 0,
14896 calcMode: 'calcMode',
14897 capHeight: 'cap-height',
14898 clip: 0,
14899 clipPath: 'clip-path',
14900 clipRule: 'clip-rule',
14901 clipPathUnits: 'clipPathUnits',
14902 colorInterpolation: 'color-interpolation',
14903 colorInterpolationFilters: 'color-interpolation-filters',
14904 colorProfile: 'color-profile',
14905 colorRendering: 'color-rendering',
14906 contentScriptType: 'contentScriptType',
14907 contentStyleType: 'contentStyleType',
14908 cursor: 0,
14909 cx: 0,
14910 cy: 0,
14911 d: 0,
14912 decelerate: 0,
14913 descent: 0,
14914 diffuseConstant: 'diffuseConstant',
14915 direction: 0,
14916 display: 0,
14917 divisor: 0,
14918 dominantBaseline: 'dominant-baseline',
14919 dur: 0,
14920 dx: 0,
14921 dy: 0,
14922 edgeMode: 'edgeMode',
14923 elevation: 0,
14924 enableBackground: 'enable-background',
14925 end: 0,
14926 exponent: 0,
14927 externalResourcesRequired: 'externalResourcesRequired',
14928 fill: 0,
14929 fillOpacity: 'fill-opacity',
14930 fillRule: 'fill-rule',
14931 filter: 0,
14932 filterRes: 'filterRes',
14933 filterUnits: 'filterUnits',
14934 floodColor: 'flood-color',
14935 floodOpacity: 'flood-opacity',
14936 focusable: 0,
14937 fontFamily: 'font-family',
14938 fontSize: 'font-size',
14939 fontSizeAdjust: 'font-size-adjust',
14940 fontStretch: 'font-stretch',
14941 fontStyle: 'font-style',
14942 fontVariant: 'font-variant',
14943 fontWeight: 'font-weight',
14944 format: 0,
14945 from: 0,
14946 fx: 0,
14947 fy: 0,
14948 g1: 0,
14949 g2: 0,
14950 glyphName: 'glyph-name',
14951 glyphOrientationHorizontal: 'glyph-orientation-horizontal',
14952 glyphOrientationVertical: 'glyph-orientation-vertical',
14953 glyphRef: 'glyphRef',
14954 gradientTransform: 'gradientTransform',
14955 gradientUnits: 'gradientUnits',
14956 hanging: 0,
14957 horizAdvX: 'horiz-adv-x',
14958 horizOriginX: 'horiz-origin-x',
14959 ideographic: 0,
14960 imageRendering: 'image-rendering',
14961 'in': 0,
14962 in2: 0,
14963 intercept: 0,
14964 k: 0,
14965 k1: 0,
14966 k2: 0,
14967 k3: 0,
14968 k4: 0,
14969 kernelMatrix: 'kernelMatrix',
14970 kernelUnitLength: 'kernelUnitLength',
14971 kerning: 0,
14972 keyPoints: 'keyPoints',
14973 keySplines: 'keySplines',
14974 keyTimes: 'keyTimes',
14975 lengthAdjust: 'lengthAdjust',
14976 letterSpacing: 'letter-spacing',
14977 lightingColor: 'lighting-color',
14978 limitingConeAngle: 'limitingConeAngle',
14979 local: 0,
14980 markerEnd: 'marker-end',
14981 markerMid: 'marker-mid',
14982 markerStart: 'marker-start',
14983 markerHeight: 'markerHeight',
14984 markerUnits: 'markerUnits',
14985 markerWidth: 'markerWidth',
14986 mask: 0,
14987 maskContentUnits: 'maskContentUnits',
14988 maskUnits: 'maskUnits',
14989 mathematical: 0,
14990 mode: 0,
14991 numOctaves: 'numOctaves',
14992 offset: 0,
14993 opacity: 0,
14994 operator: 0,
14995 order: 0,
14996 orient: 0,
14997 orientation: 0,
14998 origin: 0,
14999 overflow: 0,
15000 overlinePosition: 'overline-position',
15001 overlineThickness: 'overline-thickness',
15002 paintOrder: 'paint-order',
15003 panose1: 'panose-1',
15004 pathLength: 'pathLength',
15005 patternContentUnits: 'patternContentUnits',
15006 patternTransform: 'patternTransform',
15007 patternUnits: 'patternUnits',
15008 pointerEvents: 'pointer-events',
15009 points: 0,
15010 pointsAtX: 'pointsAtX',
15011 pointsAtY: 'pointsAtY',
15012 pointsAtZ: 'pointsAtZ',
15013 preserveAlpha: 'preserveAlpha',
15014 preserveAspectRatio: 'preserveAspectRatio',
15015 primitiveUnits: 'primitiveUnits',
15016 r: 0,
15017 radius: 0,
15018 refX: 'refX',
15019 refY: 'refY',
15020 renderingIntent: 'rendering-intent',
15021 repeatCount: 'repeatCount',
15022 repeatDur: 'repeatDur',
15023 requiredExtensions: 'requiredExtensions',
15024 requiredFeatures: 'requiredFeatures',
15025 restart: 0,
15026 result: 0,
15027 rotate: 0,
15028 rx: 0,
15029 ry: 0,
15030 scale: 0,
15031 seed: 0,
15032 shapeRendering: 'shape-rendering',
15033 slope: 0,
15034 spacing: 0,
15035 specularConstant: 'specularConstant',
15036 specularExponent: 'specularExponent',
15037 speed: 0,
15038 spreadMethod: 'spreadMethod',
15039 startOffset: 'startOffset',
15040 stdDeviation: 'stdDeviation',
15041 stemh: 0,
15042 stemv: 0,
15043 stitchTiles: 'stitchTiles',
15044 stopColor: 'stop-color',
15045 stopOpacity: 'stop-opacity',
15046 strikethroughPosition: 'strikethrough-position',
15047 strikethroughThickness: 'strikethrough-thickness',
15048 string: 0,
15049 stroke: 0,
15050 strokeDasharray: 'stroke-dasharray',
15051 strokeDashoffset: 'stroke-dashoffset',
15052 strokeLinecap: 'stroke-linecap',
15053 strokeLinejoin: 'stroke-linejoin',
15054 strokeMiterlimit: 'stroke-miterlimit',
15055 strokeOpacity: 'stroke-opacity',
15056 strokeWidth: 'stroke-width',
15057 surfaceScale: 'surfaceScale',
15058 systemLanguage: 'systemLanguage',
15059 tableValues: 'tableValues',
15060 targetX: 'targetX',
15061 targetY: 'targetY',
15062 textAnchor: 'text-anchor',
15063 textDecoration: 'text-decoration',
15064 textRendering: 'text-rendering',
15065 textLength: 'textLength',
15066 to: 0,
15067 transform: 0,
15068 u1: 0,
15069 u2: 0,
15070 underlinePosition: 'underline-position',
15071 underlineThickness: 'underline-thickness',
15072 unicode: 0,
15073 unicodeBidi: 'unicode-bidi',
15074 unicodeRange: 'unicode-range',
15075 unitsPerEm: 'units-per-em',
15076 vAlphabetic: 'v-alphabetic',
15077 vHanging: 'v-hanging',
15078 vIdeographic: 'v-ideographic',
15079 vMathematical: 'v-mathematical',
15080 values: 0,
15081 vectorEffect: 'vector-effect',
15082 version: 0,
15083 vertAdvY: 'vert-adv-y',
15084 vertOriginX: 'vert-origin-x',
15085 vertOriginY: 'vert-origin-y',
15086 viewBox: 'viewBox',
15087 viewTarget: 'viewTarget',
15088 visibility: 0,
15089 widths: 0,
15090 wordSpacing: 'word-spacing',
15091 writingMode: 'writing-mode',
15092 x: 0,
15093 xHeight: 'x-height',
15094 x1: 0,
15095 x2: 0,
15096 xChannelSelector: 'xChannelSelector',
15097 xlinkActuate: 'xlink:actuate',
15098 xlinkArcrole: 'xlink:arcrole',
15099 xlinkHref: 'xlink:href',
15100 xlinkRole: 'xlink:role',
15101 xlinkShow: 'xlink:show',
15102 xlinkTitle: 'xlink:title',
15103 xlinkType: 'xlink:type',
15104 xmlBase: 'xml:base',
15105 xmlns: 0,
15106 xmlnsXlink: 'xmlns:xlink',
15107 xmlLang: 'xml:lang',
15108 xmlSpace: 'xml:space',
15109 y: 0,
15110 y1: 0,
15111 y2: 0,
15112 yChannelSelector: 'yChannelSelector',
15113 z: 0,
15114 zoomAndPan: 'zoomAndPan'
15115};
15116
15117var SVGDOMPropertyConfig = {
15118 Properties: {},
15119 DOMAttributeNamespaces: {
15120 xlinkActuate: NS.xlink,
15121 xlinkArcrole: NS.xlink,
15122 xlinkHref: NS.xlink,
15123 xlinkRole: NS.xlink,
15124 xlinkShow: NS.xlink,
15125 xlinkTitle: NS.xlink,
15126 xlinkType: NS.xlink,
15127 xmlBase: NS.xml,
15128 xmlLang: NS.xml,
15129 xmlSpace: NS.xml
15130 },
15131 DOMAttributeNames: {}
15132};
15133
15134Object.keys(ATTRS).forEach(function (key) {
15135 SVGDOMPropertyConfig.Properties[key] = 0;
15136 if (ATTRS[key]) {
15137 SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
15138 }
15139});
15140
15141module.exports = SVGDOMPropertyConfig;
15142},{}],99:[function(_dereq_,module,exports){
15143/**
15144 * Copyright 2013-present, Facebook, Inc.
15145 * All rights reserved.
15146 *
15147 * This source code is licensed under the BSD-style license found in the
15148 * LICENSE file in the root directory of this source tree. An additional grant
15149 * of patent rights can be found in the PATENTS file in the same directory.
15150 *
15151 * @providesModule SelectEventPlugin
15152 */
15153
15154'use strict';
15155
15156var EventConstants = _dereq_(16);
15157var EventPropagators = _dereq_(20);
15158var ExecutionEnvironment = _dereq_(148);
15159var ReactDOMComponentTree = _dereq_(42);
15160var ReactInputSelection = _dereq_(71);
15161var SyntheticEvent = _dereq_(105);
15162
15163var getActiveElement = _dereq_(157);
15164var isTextInputElement = _dereq_(137);
15165var keyOf = _dereq_(166);
15166var shallowEqual = _dereq_(170);
15167
15168var topLevelTypes = EventConstants.topLevelTypes;
15169
15170var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
15171
15172var eventTypes = {
15173 select: {
15174 phasedRegistrationNames: {
15175 bubbled: keyOf({ onSelect: null }),
15176 captured: keyOf({ onSelectCapture: null })
15177 },
15178 dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
15179 }
15180};
15181
15182var activeElement = null;
15183var activeElementInst = null;
15184var lastSelection = null;
15185var mouseDown = false;
15186
15187// Track whether a listener exists for this plugin. If none exist, we do
15188// not extract events. See #3639.
15189var hasListener = false;
15190var ON_SELECT_KEY = keyOf({ onSelect: null });
15191
15192/**
15193 * Get an object which is a unique representation of the current selection.
15194 *
15195 * The return value will not be consistent across nodes or browsers, but
15196 * two identical selections on the same node will return identical objects.
15197 *
15198 * @param {DOMElement} node
15199 * @return {object}
15200 */
15201function getSelection(node) {
15202 if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
15203 return {
15204 start: node.selectionStart,
15205 end: node.selectionEnd
15206 };
15207 } else if (window.getSelection) {
15208 var selection = window.getSelection();
15209 return {
15210 anchorNode: selection.anchorNode,
15211 anchorOffset: selection.anchorOffset,
15212 focusNode: selection.focusNode,
15213 focusOffset: selection.focusOffset
15214 };
15215 } else if (document.selection) {
15216 var range = document.selection.createRange();
15217 return {
15218 parentElement: range.parentElement(),
15219 text: range.text,
15220 top: range.boundingTop,
15221 left: range.boundingLeft
15222 };
15223 }
15224}
15225
15226/**
15227 * Poll selection to see whether it's changed.
15228 *
15229 * @param {object} nativeEvent
15230 * @return {?SyntheticEvent}
15231 */
15232function constructSelectEvent(nativeEvent, nativeEventTarget) {
15233 // Ensure we have the right element, and that the user is not dragging a
15234 // selection (this matches native `select` event behavior). In HTML5, select
15235 // fires only on input and textarea thus if there's no focused element we
15236 // won't dispatch.
15237 if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
15238 return null;
15239 }
15240
15241 // Only fire when selection has actually changed.
15242 var currentSelection = getSelection(activeElement);
15243 if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
15244 lastSelection = currentSelection;
15245
15246 var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
15247
15248 syntheticEvent.type = 'select';
15249 syntheticEvent.target = activeElement;
15250
15251 EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
15252
15253 return syntheticEvent;
15254 }
15255
15256 return null;
15257}
15258
15259/**
15260 * This plugin creates an `onSelect` event that normalizes select events
15261 * across form elements.
15262 *
15263 * Supported elements are:
15264 * - input (see `isTextInputElement`)
15265 * - textarea
15266 * - contentEditable
15267 *
15268 * This differs from native browser implementations in the following ways:
15269 * - Fires on contentEditable fields as well as inputs.
15270 * - Fires for collapsed selection.
15271 * - Fires after user input.
15272 */
15273var SelectEventPlugin = {
15274
15275 eventTypes: eventTypes,
15276
15277 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
15278 if (!hasListener) {
15279 return null;
15280 }
15281
15282 var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
15283
15284 switch (topLevelType) {
15285 // Track the input node that has focus.
15286 case topLevelTypes.topFocus:
15287 if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
15288 activeElement = targetNode;
15289 activeElementInst = targetInst;
15290 lastSelection = null;
15291 }
15292 break;
15293 case topLevelTypes.topBlur:
15294 activeElement = null;
15295 activeElementInst = null;
15296 lastSelection = null;
15297 break;
15298
15299 // Don't fire the event while the user is dragging. This matches the
15300 // semantics of the native select event.
15301 case topLevelTypes.topMouseDown:
15302 mouseDown = true;
15303 break;
15304 case topLevelTypes.topContextMenu:
15305 case topLevelTypes.topMouseUp:
15306 mouseDown = false;
15307 return constructSelectEvent(nativeEvent, nativeEventTarget);
15308
15309 // Chrome and IE fire non-standard event when selection is changed (and
15310 // sometimes when it hasn't). IE's event fires out of order with respect
15311 // to key and input events on deletion, so we discard it.
15312 //
15313 // Firefox doesn't support selectionchange, so check selection status
15314 // after each key entry. The selection changes after keydown and before
15315 // keyup, but we check on keydown as well in the case of holding down a
15316 // key, when multiple keydown events are fired but only one keyup is.
15317 // This is also our approach for IE handling, for the reason above.
15318 case topLevelTypes.topSelectionChange:
15319 if (skipSelectionChangeEvent) {
15320 break;
15321 }
15322 // falls through
15323 case topLevelTypes.topKeyDown:
15324 case topLevelTypes.topKeyUp:
15325 return constructSelectEvent(nativeEvent, nativeEventTarget);
15326 }
15327
15328 return null;
15329 },
15330
15331 didPutListener: function (inst, registrationName, listener) {
15332 if (registrationName === ON_SELECT_KEY) {
15333 hasListener = true;
15334 }
15335 }
15336};
15337
15338module.exports = SelectEventPlugin;
15339},{"105":105,"137":137,"148":148,"157":157,"16":16,"166":166,"170":170,"20":20,"42":42,"71":71}],100:[function(_dereq_,module,exports){
15340/**
15341 * Copyright 2013-present, Facebook, Inc.
15342 * All rights reserved.
15343 *
15344 * This source code is licensed under the BSD-style license found in the
15345 * LICENSE file in the root directory of this source tree. An additional grant
15346 * of patent rights can be found in the PATENTS file in the same directory.
15347 *
15348 * @providesModule SimpleEventPlugin
15349 */
15350
15351'use strict';
15352
15353var _prodInvariant = _dereq_(140);
15354
15355var EventConstants = _dereq_(16);
15356var EventListener = _dereq_(147);
15357var EventPropagators = _dereq_(20);
15358var ReactDOMComponentTree = _dereq_(42);
15359var SyntheticAnimationEvent = _dereq_(101);
15360var SyntheticClipboardEvent = _dereq_(102);
15361var SyntheticEvent = _dereq_(105);
15362var SyntheticFocusEvent = _dereq_(106);
15363var SyntheticKeyboardEvent = _dereq_(108);
15364var SyntheticMouseEvent = _dereq_(109);
15365var SyntheticDragEvent = _dereq_(104);
15366var SyntheticTouchEvent = _dereq_(110);
15367var SyntheticTransitionEvent = _dereq_(111);
15368var SyntheticUIEvent = _dereq_(112);
15369var SyntheticWheelEvent = _dereq_(113);
15370
15371var emptyFunction = _dereq_(154);
15372var getEventCharCode = _dereq_(126);
15373var invariant = _dereq_(162);
15374var keyOf = _dereq_(166);
15375
15376var topLevelTypes = EventConstants.topLevelTypes;
15377
15378var eventTypes = {
15379 abort: {
15380 phasedRegistrationNames: {
15381 bubbled: keyOf({ onAbort: true }),
15382 captured: keyOf({ onAbortCapture: true })
15383 }
15384 },
15385 animationEnd: {
15386 phasedRegistrationNames: {
15387 bubbled: keyOf({ onAnimationEnd: true }),
15388 captured: keyOf({ onAnimationEndCapture: true })
15389 }
15390 },
15391 animationIteration: {
15392 phasedRegistrationNames: {
15393 bubbled: keyOf({ onAnimationIteration: true }),
15394 captured: keyOf({ onAnimationIterationCapture: true })
15395 }
15396 },
15397 animationStart: {
15398 phasedRegistrationNames: {
15399 bubbled: keyOf({ onAnimationStart: true }),
15400 captured: keyOf({ onAnimationStartCapture: true })
15401 }
15402 },
15403 blur: {
15404 phasedRegistrationNames: {
15405 bubbled: keyOf({ onBlur: true }),
15406 captured: keyOf({ onBlurCapture: true })
15407 }
15408 },
15409 canPlay: {
15410 phasedRegistrationNames: {
15411 bubbled: keyOf({ onCanPlay: true }),
15412 captured: keyOf({ onCanPlayCapture: true })
15413 }
15414 },
15415 canPlayThrough: {
15416 phasedRegistrationNames: {
15417 bubbled: keyOf({ onCanPlayThrough: true }),
15418 captured: keyOf({ onCanPlayThroughCapture: true })
15419 }
15420 },
15421 click: {
15422 phasedRegistrationNames: {
15423 bubbled: keyOf({ onClick: true }),
15424 captured: keyOf({ onClickCapture: true })
15425 }
15426 },
15427 contextMenu: {
15428 phasedRegistrationNames: {
15429 bubbled: keyOf({ onContextMenu: true }),
15430 captured: keyOf({ onContextMenuCapture: true })
15431 }
15432 },
15433 copy: {
15434 phasedRegistrationNames: {
15435 bubbled: keyOf({ onCopy: true }),
15436 captured: keyOf({ onCopyCapture: true })
15437 }
15438 },
15439 cut: {
15440 phasedRegistrationNames: {
15441 bubbled: keyOf({ onCut: true }),
15442 captured: keyOf({ onCutCapture: true })
15443 }
15444 },
15445 doubleClick: {
15446 phasedRegistrationNames: {
15447 bubbled: keyOf({ onDoubleClick: true }),
15448 captured: keyOf({ onDoubleClickCapture: true })
15449 }
15450 },
15451 drag: {
15452 phasedRegistrationNames: {
15453 bubbled: keyOf({ onDrag: true }),
15454 captured: keyOf({ onDragCapture: true })
15455 }
15456 },
15457 dragEnd: {
15458 phasedRegistrationNames: {
15459 bubbled: keyOf({ onDragEnd: true }),
15460 captured: keyOf({ onDragEndCapture: true })
15461 }
15462 },
15463 dragEnter: {
15464 phasedRegistrationNames: {
15465 bubbled: keyOf({ onDragEnter: true }),
15466 captured: keyOf({ onDragEnterCapture: true })
15467 }
15468 },
15469 dragExit: {
15470 phasedRegistrationNames: {
15471 bubbled: keyOf({ onDragExit: true }),
15472 captured: keyOf({ onDragExitCapture: true })
15473 }
15474 },
15475 dragLeave: {
15476 phasedRegistrationNames: {
15477 bubbled: keyOf({ onDragLeave: true }),
15478 captured: keyOf({ onDragLeaveCapture: true })
15479 }
15480 },
15481 dragOver: {
15482 phasedRegistrationNames: {
15483 bubbled: keyOf({ onDragOver: true }),
15484 captured: keyOf({ onDragOverCapture: true })
15485 }
15486 },
15487 dragStart: {
15488 phasedRegistrationNames: {
15489 bubbled: keyOf({ onDragStart: true }),
15490 captured: keyOf({ onDragStartCapture: true })
15491 }
15492 },
15493 drop: {
15494 phasedRegistrationNames: {
15495 bubbled: keyOf({ onDrop: true }),
15496 captured: keyOf({ onDropCapture: true })
15497 }
15498 },
15499 durationChange: {
15500 phasedRegistrationNames: {
15501 bubbled: keyOf({ onDurationChange: true }),
15502 captured: keyOf({ onDurationChangeCapture: true })
15503 }
15504 },
15505 emptied: {
15506 phasedRegistrationNames: {
15507 bubbled: keyOf({ onEmptied: true }),
15508 captured: keyOf({ onEmptiedCapture: true })
15509 }
15510 },
15511 encrypted: {
15512 phasedRegistrationNames: {
15513 bubbled: keyOf({ onEncrypted: true }),
15514 captured: keyOf({ onEncryptedCapture: true })
15515 }
15516 },
15517 ended: {
15518 phasedRegistrationNames: {
15519 bubbled: keyOf({ onEnded: true }),
15520 captured: keyOf({ onEndedCapture: true })
15521 }
15522 },
15523 error: {
15524 phasedRegistrationNames: {
15525 bubbled: keyOf({ onError: true }),
15526 captured: keyOf({ onErrorCapture: true })
15527 }
15528 },
15529 focus: {
15530 phasedRegistrationNames: {
15531 bubbled: keyOf({ onFocus: true }),
15532 captured: keyOf({ onFocusCapture: true })
15533 }
15534 },
15535 input: {
15536 phasedRegistrationNames: {
15537 bubbled: keyOf({ onInput: true }),
15538 captured: keyOf({ onInputCapture: true })
15539 }
15540 },
15541 invalid: {
15542 phasedRegistrationNames: {
15543 bubbled: keyOf({ onInvalid: true }),
15544 captured: keyOf({ onInvalidCapture: true })
15545 }
15546 },
15547 keyDown: {
15548 phasedRegistrationNames: {
15549 bubbled: keyOf({ onKeyDown: true }),
15550 captured: keyOf({ onKeyDownCapture: true })
15551 }
15552 },
15553 keyPress: {
15554 phasedRegistrationNames: {
15555 bubbled: keyOf({ onKeyPress: true }),
15556 captured: keyOf({ onKeyPressCapture: true })
15557 }
15558 },
15559 keyUp: {
15560 phasedRegistrationNames: {
15561 bubbled: keyOf({ onKeyUp: true }),
15562 captured: keyOf({ onKeyUpCapture: true })
15563 }
15564 },
15565 load: {
15566 phasedRegistrationNames: {
15567 bubbled: keyOf({ onLoad: true }),
15568 captured: keyOf({ onLoadCapture: true })
15569 }
15570 },
15571 loadedData: {
15572 phasedRegistrationNames: {
15573 bubbled: keyOf({ onLoadedData: true }),
15574 captured: keyOf({ onLoadedDataCapture: true })
15575 }
15576 },
15577 loadedMetadata: {
15578 phasedRegistrationNames: {
15579 bubbled: keyOf({ onLoadedMetadata: true }),
15580 captured: keyOf({ onLoadedMetadataCapture: true })
15581 }
15582 },
15583 loadStart: {
15584 phasedRegistrationNames: {
15585 bubbled: keyOf({ onLoadStart: true }),
15586 captured: keyOf({ onLoadStartCapture: true })
15587 }
15588 },
15589 // Note: We do not allow listening to mouseOver events. Instead, use the
15590 // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
15591 mouseDown: {
15592 phasedRegistrationNames: {
15593 bubbled: keyOf({ onMouseDown: true }),
15594 captured: keyOf({ onMouseDownCapture: true })
15595 }
15596 },
15597 mouseMove: {
15598 phasedRegistrationNames: {
15599 bubbled: keyOf({ onMouseMove: true }),
15600 captured: keyOf({ onMouseMoveCapture: true })
15601 }
15602 },
15603 mouseOut: {
15604 phasedRegistrationNames: {
15605 bubbled: keyOf({ onMouseOut: true }),
15606 captured: keyOf({ onMouseOutCapture: true })
15607 }
15608 },
15609 mouseOver: {
15610 phasedRegistrationNames: {
15611 bubbled: keyOf({ onMouseOver: true }),
15612 captured: keyOf({ onMouseOverCapture: true })
15613 }
15614 },
15615 mouseUp: {
15616 phasedRegistrationNames: {
15617 bubbled: keyOf({ onMouseUp: true }),
15618 captured: keyOf({ onMouseUpCapture: true })
15619 }
15620 },
15621 paste: {
15622 phasedRegistrationNames: {
15623 bubbled: keyOf({ onPaste: true }),
15624 captured: keyOf({ onPasteCapture: true })
15625 }
15626 },
15627 pause: {
15628 phasedRegistrationNames: {
15629 bubbled: keyOf({ onPause: true }),
15630 captured: keyOf({ onPauseCapture: true })
15631 }
15632 },
15633 play: {
15634 phasedRegistrationNames: {
15635 bubbled: keyOf({ onPlay: true }),
15636 captured: keyOf({ onPlayCapture: true })
15637 }
15638 },
15639 playing: {
15640 phasedRegistrationNames: {
15641 bubbled: keyOf({ onPlaying: true }),
15642 captured: keyOf({ onPlayingCapture: true })
15643 }
15644 },
15645 progress: {
15646 phasedRegistrationNames: {
15647 bubbled: keyOf({ onProgress: true }),
15648 captured: keyOf({ onProgressCapture: true })
15649 }
15650 },
15651 rateChange: {
15652 phasedRegistrationNames: {
15653 bubbled: keyOf({ onRateChange: true }),
15654 captured: keyOf({ onRateChangeCapture: true })
15655 }
15656 },
15657 reset: {
15658 phasedRegistrationNames: {
15659 bubbled: keyOf({ onReset: true }),
15660 captured: keyOf({ onResetCapture: true })
15661 }
15662 },
15663 scroll: {
15664 phasedRegistrationNames: {
15665 bubbled: keyOf({ onScroll: true }),
15666 captured: keyOf({ onScrollCapture: true })
15667 }
15668 },
15669 seeked: {
15670 phasedRegistrationNames: {
15671 bubbled: keyOf({ onSeeked: true }),
15672 captured: keyOf({ onSeekedCapture: true })
15673 }
15674 },
15675 seeking: {
15676 phasedRegistrationNames: {
15677 bubbled: keyOf({ onSeeking: true }),
15678 captured: keyOf({ onSeekingCapture: true })
15679 }
15680 },
15681 stalled: {
15682 phasedRegistrationNames: {
15683 bubbled: keyOf({ onStalled: true }),
15684 captured: keyOf({ onStalledCapture: true })
15685 }
15686 },
15687 submit: {
15688 phasedRegistrationNames: {
15689 bubbled: keyOf({ onSubmit: true }),
15690 captured: keyOf({ onSubmitCapture: true })
15691 }
15692 },
15693 suspend: {
15694 phasedRegistrationNames: {
15695 bubbled: keyOf({ onSuspend: true }),
15696 captured: keyOf({ onSuspendCapture: true })
15697 }
15698 },
15699 timeUpdate: {
15700 phasedRegistrationNames: {
15701 bubbled: keyOf({ onTimeUpdate: true }),
15702 captured: keyOf({ onTimeUpdateCapture: true })
15703 }
15704 },
15705 touchCancel: {
15706 phasedRegistrationNames: {
15707 bubbled: keyOf({ onTouchCancel: true }),
15708 captured: keyOf({ onTouchCancelCapture: true })
15709 }
15710 },
15711 touchEnd: {
15712 phasedRegistrationNames: {
15713 bubbled: keyOf({ onTouchEnd: true }),
15714 captured: keyOf({ onTouchEndCapture: true })
15715 }
15716 },
15717 touchMove: {
15718 phasedRegistrationNames: {
15719 bubbled: keyOf({ onTouchMove: true }),
15720 captured: keyOf({ onTouchMoveCapture: true })
15721 }
15722 },
15723 touchStart: {
15724 phasedRegistrationNames: {
15725 bubbled: keyOf({ onTouchStart: true }),
15726 captured: keyOf({ onTouchStartCapture: true })
15727 }
15728 },
15729 transitionEnd: {
15730 phasedRegistrationNames: {
15731 bubbled: keyOf({ onTransitionEnd: true }),
15732 captured: keyOf({ onTransitionEndCapture: true })
15733 }
15734 },
15735 volumeChange: {
15736 phasedRegistrationNames: {
15737 bubbled: keyOf({ onVolumeChange: true }),
15738 captured: keyOf({ onVolumeChangeCapture: true })
15739 }
15740 },
15741 waiting: {
15742 phasedRegistrationNames: {
15743 bubbled: keyOf({ onWaiting: true }),
15744 captured: keyOf({ onWaitingCapture: true })
15745 }
15746 },
15747 wheel: {
15748 phasedRegistrationNames: {
15749 bubbled: keyOf({ onWheel: true }),
15750 captured: keyOf({ onWheelCapture: true })
15751 }
15752 }
15753};
15754
15755var topLevelEventsToDispatchConfig = {
15756 topAbort: eventTypes.abort,
15757 topAnimationEnd: eventTypes.animationEnd,
15758 topAnimationIteration: eventTypes.animationIteration,
15759 topAnimationStart: eventTypes.animationStart,
15760 topBlur: eventTypes.blur,
15761 topCanPlay: eventTypes.canPlay,
15762 topCanPlayThrough: eventTypes.canPlayThrough,
15763 topClick: eventTypes.click,
15764 topContextMenu: eventTypes.contextMenu,
15765 topCopy: eventTypes.copy,
15766 topCut: eventTypes.cut,
15767 topDoubleClick: eventTypes.doubleClick,
15768 topDrag: eventTypes.drag,
15769 topDragEnd: eventTypes.dragEnd,
15770 topDragEnter: eventTypes.dragEnter,
15771 topDragExit: eventTypes.dragExit,
15772 topDragLeave: eventTypes.dragLeave,
15773 topDragOver: eventTypes.dragOver,
15774 topDragStart: eventTypes.dragStart,
15775 topDrop: eventTypes.drop,
15776 topDurationChange: eventTypes.durationChange,
15777 topEmptied: eventTypes.emptied,
15778 topEncrypted: eventTypes.encrypted,
15779 topEnded: eventTypes.ended,
15780 topError: eventTypes.error,
15781 topFocus: eventTypes.focus,
15782 topInput: eventTypes.input,
15783 topInvalid: eventTypes.invalid,
15784 topKeyDown: eventTypes.keyDown,
15785 topKeyPress: eventTypes.keyPress,
15786 topKeyUp: eventTypes.keyUp,
15787 topLoad: eventTypes.load,
15788 topLoadedData: eventTypes.loadedData,
15789 topLoadedMetadata: eventTypes.loadedMetadata,
15790 topLoadStart: eventTypes.loadStart,
15791 topMouseDown: eventTypes.mouseDown,
15792 topMouseMove: eventTypes.mouseMove,
15793 topMouseOut: eventTypes.mouseOut,
15794 topMouseOver: eventTypes.mouseOver,
15795 topMouseUp: eventTypes.mouseUp,
15796 topPaste: eventTypes.paste,
15797 topPause: eventTypes.pause,
15798 topPlay: eventTypes.play,
15799 topPlaying: eventTypes.playing,
15800 topProgress: eventTypes.progress,
15801 topRateChange: eventTypes.rateChange,
15802 topReset: eventTypes.reset,
15803 topScroll: eventTypes.scroll,
15804 topSeeked: eventTypes.seeked,
15805 topSeeking: eventTypes.seeking,
15806 topStalled: eventTypes.stalled,
15807 topSubmit: eventTypes.submit,
15808 topSuspend: eventTypes.suspend,
15809 topTimeUpdate: eventTypes.timeUpdate,
15810 topTouchCancel: eventTypes.touchCancel,
15811 topTouchEnd: eventTypes.touchEnd,
15812 topTouchMove: eventTypes.touchMove,
15813 topTouchStart: eventTypes.touchStart,
15814 topTransitionEnd: eventTypes.transitionEnd,
15815 topVolumeChange: eventTypes.volumeChange,
15816 topWaiting: eventTypes.waiting,
15817 topWheel: eventTypes.wheel
15818};
15819
15820for (var type in topLevelEventsToDispatchConfig) {
15821 topLevelEventsToDispatchConfig[type].dependencies = [type];
15822}
15823
15824var ON_CLICK_KEY = keyOf({ onClick: null });
15825var onClickListeners = {};
15826
15827function getDictionaryKey(inst) {
15828 // Prevents V8 performance issue:
15829 // https://github.com/facebook/react/pull/7232
15830 return '.' + inst._rootNodeID;
15831}
15832
15833var SimpleEventPlugin = {
15834
15835 eventTypes: eventTypes,
15836
15837 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
15838 var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
15839 if (!dispatchConfig) {
15840 return null;
15841 }
15842 var EventConstructor;
15843 switch (topLevelType) {
15844 case topLevelTypes.topAbort:
15845 case topLevelTypes.topCanPlay:
15846 case topLevelTypes.topCanPlayThrough:
15847 case topLevelTypes.topDurationChange:
15848 case topLevelTypes.topEmptied:
15849 case topLevelTypes.topEncrypted:
15850 case topLevelTypes.topEnded:
15851 case topLevelTypes.topError:
15852 case topLevelTypes.topInput:
15853 case topLevelTypes.topInvalid:
15854 case topLevelTypes.topLoad:
15855 case topLevelTypes.topLoadedData:
15856 case topLevelTypes.topLoadedMetadata:
15857 case topLevelTypes.topLoadStart:
15858 case topLevelTypes.topPause:
15859 case topLevelTypes.topPlay:
15860 case topLevelTypes.topPlaying:
15861 case topLevelTypes.topProgress:
15862 case topLevelTypes.topRateChange:
15863 case topLevelTypes.topReset:
15864 case topLevelTypes.topSeeked:
15865 case topLevelTypes.topSeeking:
15866 case topLevelTypes.topStalled:
15867 case topLevelTypes.topSubmit:
15868 case topLevelTypes.topSuspend:
15869 case topLevelTypes.topTimeUpdate:
15870 case topLevelTypes.topVolumeChange:
15871 case topLevelTypes.topWaiting:
15872 // HTML Events
15873 // @see http://www.w3.org/TR/html5/index.html#events-0
15874 EventConstructor = SyntheticEvent;
15875 break;
15876 case topLevelTypes.topKeyPress:
15877 // Firefox creates a keypress event for function keys too. This removes
15878 // the unwanted keypress events. Enter is however both printable and
15879 // non-printable. One would expect Tab to be as well (but it isn't).
15880 if (getEventCharCode(nativeEvent) === 0) {
15881 return null;
15882 }
15883 /* falls through */
15884 case topLevelTypes.topKeyDown:
15885 case topLevelTypes.topKeyUp:
15886 EventConstructor = SyntheticKeyboardEvent;
15887 break;
15888 case topLevelTypes.topBlur:
15889 case topLevelTypes.topFocus:
15890 EventConstructor = SyntheticFocusEvent;
15891 break;
15892 case topLevelTypes.topClick:
15893 // Firefox creates a click event on right mouse clicks. This removes the
15894 // unwanted click events.
15895 if (nativeEvent.button === 2) {
15896 return null;
15897 }
15898 /* falls through */
15899 case topLevelTypes.topContextMenu:
15900 case topLevelTypes.topDoubleClick:
15901 case topLevelTypes.topMouseDown:
15902 case topLevelTypes.topMouseMove:
15903 case topLevelTypes.topMouseOut:
15904 case topLevelTypes.topMouseOver:
15905 case topLevelTypes.topMouseUp:
15906 EventConstructor = SyntheticMouseEvent;
15907 break;
15908 case topLevelTypes.topDrag:
15909 case topLevelTypes.topDragEnd:
15910 case topLevelTypes.topDragEnter:
15911 case topLevelTypes.topDragExit:
15912 case topLevelTypes.topDragLeave:
15913 case topLevelTypes.topDragOver:
15914 case topLevelTypes.topDragStart:
15915 case topLevelTypes.topDrop:
15916 EventConstructor = SyntheticDragEvent;
15917 break;
15918 case topLevelTypes.topTouchCancel:
15919 case topLevelTypes.topTouchEnd:
15920 case topLevelTypes.topTouchMove:
15921 case topLevelTypes.topTouchStart:
15922 EventConstructor = SyntheticTouchEvent;
15923 break;
15924 case topLevelTypes.topAnimationEnd:
15925 case topLevelTypes.topAnimationIteration:
15926 case topLevelTypes.topAnimationStart:
15927 EventConstructor = SyntheticAnimationEvent;
15928 break;
15929 case topLevelTypes.topTransitionEnd:
15930 EventConstructor = SyntheticTransitionEvent;
15931 break;
15932 case topLevelTypes.topScroll:
15933 EventConstructor = SyntheticUIEvent;
15934 break;
15935 case topLevelTypes.topWheel:
15936 EventConstructor = SyntheticWheelEvent;
15937 break;
15938 case topLevelTypes.topCopy:
15939 case topLevelTypes.topCut:
15940 case topLevelTypes.topPaste:
15941 EventConstructor = SyntheticClipboardEvent;
15942 break;
15943 }
15944 !EventConstructor ? "development" !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : _prodInvariant('86', topLevelType) : void 0;
15945 var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
15946 EventPropagators.accumulateTwoPhaseDispatches(event);
15947 return event;
15948 },
15949
15950 didPutListener: function (inst, registrationName, listener) {
15951 // Mobile Safari does not fire properly bubble click events on
15952 // non-interactive elements, which means delegated click listeners do not
15953 // fire. The workaround for this bug involves attaching an empty click
15954 // listener on the target node.
15955 if (registrationName === ON_CLICK_KEY) {
15956 var key = getDictionaryKey(inst);
15957 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
15958 if (!onClickListeners[key]) {
15959 onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
15960 }
15961 }
15962 },
15963
15964 willDeleteListener: function (inst, registrationName) {
15965 if (registrationName === ON_CLICK_KEY) {
15966 var key = getDictionaryKey(inst);
15967 onClickListeners[key].remove();
15968 delete onClickListeners[key];
15969 }
15970 }
15971
15972};
15973
15974module.exports = SimpleEventPlugin;
15975},{"101":101,"102":102,"104":104,"105":105,"106":106,"108":108,"109":109,"110":110,"111":111,"112":112,"113":113,"126":126,"140":140,"147":147,"154":154,"16":16,"162":162,"166":166,"20":20,"42":42}],101:[function(_dereq_,module,exports){
15976/**
15977 * Copyright 2013-present, Facebook, Inc.
15978 * All rights reserved.
15979 *
15980 * This source code is licensed under the BSD-style license found in the
15981 * LICENSE file in the root directory of this source tree. An additional grant
15982 * of patent rights can be found in the PATENTS file in the same directory.
15983 *
15984 * @providesModule SyntheticAnimationEvent
15985 */
15986
15987'use strict';
15988
15989var SyntheticEvent = _dereq_(105);
15990
15991/**
15992 * @interface Event
15993 * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
15994 * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
15995 */
15996var AnimationEventInterface = {
15997 animationName: null,
15998 elapsedTime: null,
15999 pseudoElement: null
16000};
16001
16002/**
16003 * @param {object} dispatchConfig Configuration used to dispatch this event.
16004 * @param {string} dispatchMarker Marker identifying the event target.
16005 * @param {object} nativeEvent Native browser event.
16006 * @extends {SyntheticEvent}
16007 */
16008function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16009 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16010}
16011
16012SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
16013
16014module.exports = SyntheticAnimationEvent;
16015},{"105":105}],102:[function(_dereq_,module,exports){
16016/**
16017 * Copyright 2013-present, Facebook, Inc.
16018 * All rights reserved.
16019 *
16020 * This source code is licensed under the BSD-style license found in the
16021 * LICENSE file in the root directory of this source tree. An additional grant
16022 * of patent rights can be found in the PATENTS file in the same directory.
16023 *
16024 * @providesModule SyntheticClipboardEvent
16025 */
16026
16027'use strict';
16028
16029var SyntheticEvent = _dereq_(105);
16030
16031/**
16032 * @interface Event
16033 * @see http://www.w3.org/TR/clipboard-apis/
16034 */
16035var ClipboardEventInterface = {
16036 clipboardData: function (event) {
16037 return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
16038 }
16039};
16040
16041/**
16042 * @param {object} dispatchConfig Configuration used to dispatch this event.
16043 * @param {string} dispatchMarker Marker identifying the event target.
16044 * @param {object} nativeEvent Native browser event.
16045 * @extends {SyntheticUIEvent}
16046 */
16047function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16048 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16049}
16050
16051SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
16052
16053module.exports = SyntheticClipboardEvent;
16054},{"105":105}],103:[function(_dereq_,module,exports){
16055/**
16056 * Copyright 2013-present, Facebook, Inc.
16057 * All rights reserved.
16058 *
16059 * This source code is licensed under the BSD-style license found in the
16060 * LICENSE file in the root directory of this source tree. An additional grant
16061 * of patent rights can be found in the PATENTS file in the same directory.
16062 *
16063 * @providesModule SyntheticCompositionEvent
16064 */
16065
16066'use strict';
16067
16068var SyntheticEvent = _dereq_(105);
16069
16070/**
16071 * @interface Event
16072 * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
16073 */
16074var CompositionEventInterface = {
16075 data: null
16076};
16077
16078/**
16079 * @param {object} dispatchConfig Configuration used to dispatch this event.
16080 * @param {string} dispatchMarker Marker identifying the event target.
16081 * @param {object} nativeEvent Native browser event.
16082 * @extends {SyntheticUIEvent}
16083 */
16084function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16085 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16086}
16087
16088SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
16089
16090module.exports = SyntheticCompositionEvent;
16091},{"105":105}],104:[function(_dereq_,module,exports){
16092/**
16093 * Copyright 2013-present, Facebook, Inc.
16094 * All rights reserved.
16095 *
16096 * This source code is licensed under the BSD-style license found in the
16097 * LICENSE file in the root directory of this source tree. An additional grant
16098 * of patent rights can be found in the PATENTS file in the same directory.
16099 *
16100 * @providesModule SyntheticDragEvent
16101 */
16102
16103'use strict';
16104
16105var SyntheticMouseEvent = _dereq_(109);
16106
16107/**
16108 * @interface DragEvent
16109 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16110 */
16111var DragEventInterface = {
16112 dataTransfer: null
16113};
16114
16115/**
16116 * @param {object} dispatchConfig Configuration used to dispatch this event.
16117 * @param {string} dispatchMarker Marker identifying the event target.
16118 * @param {object} nativeEvent Native browser event.
16119 * @extends {SyntheticUIEvent}
16120 */
16121function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16122 return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16123}
16124
16125SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
16126
16127module.exports = SyntheticDragEvent;
16128},{"109":109}],105:[function(_dereq_,module,exports){
16129/**
16130 * Copyright 2013-present, Facebook, Inc.
16131 * All rights reserved.
16132 *
16133 * This source code is licensed under the BSD-style license found in the
16134 * LICENSE file in the root directory of this source tree. An additional grant
16135 * of patent rights can be found in the PATENTS file in the same directory.
16136 *
16137 * @providesModule SyntheticEvent
16138 */
16139
16140'use strict';
16141
16142var _assign = _dereq_(172);
16143
16144var PooledClass = _dereq_(25);
16145
16146var emptyFunction = _dereq_(154);
16147var warning = _dereq_(171);
16148
16149var didWarnForAddedNewProperty = false;
16150var isProxySupported = typeof Proxy === 'function';
16151
16152var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
16153
16154/**
16155 * @interface Event
16156 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16157 */
16158var EventInterface = {
16159 type: null,
16160 target: null,
16161 // currentTarget is set when dispatching; no use in copying it here
16162 currentTarget: emptyFunction.thatReturnsNull,
16163 eventPhase: null,
16164 bubbles: null,
16165 cancelable: null,
16166 timeStamp: function (event) {
16167 return event.timeStamp || Date.now();
16168 },
16169 defaultPrevented: null,
16170 isTrusted: null
16171};
16172
16173/**
16174 * Synthetic events are dispatched by event plugins, typically in response to a
16175 * top-level event delegation handler.
16176 *
16177 * These systems should generally use pooling to reduce the frequency of garbage
16178 * collection. The system should check `isPersistent` to determine whether the
16179 * event should be released into the pool after being dispatched. Users that
16180 * need a persisted event should invoke `persist`.
16181 *
16182 * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
16183 * normalizing browser quirks. Subclasses do not necessarily have to implement a
16184 * DOM interface; custom application-specific events can also subclass this.
16185 *
16186 * @param {object} dispatchConfig Configuration used to dispatch this event.
16187 * @param {*} targetInst Marker identifying the event target.
16188 * @param {object} nativeEvent Native browser event.
16189 * @param {DOMEventTarget} nativeEventTarget Target node.
16190 */
16191function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
16192 if ("development" !== 'production') {
16193 // these have a getter/setter for warnings
16194 delete this.nativeEvent;
16195 delete this.preventDefault;
16196 delete this.stopPropagation;
16197 }
16198
16199 this.dispatchConfig = dispatchConfig;
16200 this._targetInst = targetInst;
16201 this.nativeEvent = nativeEvent;
16202
16203 var Interface = this.constructor.Interface;
16204 for (var propName in Interface) {
16205 if (!Interface.hasOwnProperty(propName)) {
16206 continue;
16207 }
16208 if ("development" !== 'production') {
16209 delete this[propName]; // this has a getter/setter for warnings
16210 }
16211 var normalize = Interface[propName];
16212 if (normalize) {
16213 this[propName] = normalize(nativeEvent);
16214 } else {
16215 if (propName === 'target') {
16216 this.target = nativeEventTarget;
16217 } else {
16218 this[propName] = nativeEvent[propName];
16219 }
16220 }
16221 }
16222
16223 var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
16224 if (defaultPrevented) {
16225 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
16226 } else {
16227 this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
16228 }
16229 this.isPropagationStopped = emptyFunction.thatReturnsFalse;
16230 return this;
16231}
16232
16233_assign(SyntheticEvent.prototype, {
16234
16235 preventDefault: function () {
16236 this.defaultPrevented = true;
16237 var event = this.nativeEvent;
16238 if (!event) {
16239 return;
16240 }
16241
16242 if (event.preventDefault) {
16243 event.preventDefault();
16244 } else if (typeof event.returnValue !== 'unknown') {
16245 // eslint-disable-line valid-typeof
16246 event.returnValue = false;
16247 }
16248 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
16249 },
16250
16251 stopPropagation: function () {
16252 var event = this.nativeEvent;
16253 if (!event) {
16254 return;
16255 }
16256
16257 if (event.stopPropagation) {
16258 event.stopPropagation();
16259 } else if (typeof event.cancelBubble !== 'unknown') {
16260 // eslint-disable-line valid-typeof
16261 // The ChangeEventPlugin registers a "propertychange" event for
16262 // IE. This event does not support bubbling or cancelling, and
16263 // any references to cancelBubble throw "Member not found". A
16264 // typeof check of "unknown" circumvents this issue (and is also
16265 // IE specific).
16266 event.cancelBubble = true;
16267 }
16268
16269 this.isPropagationStopped = emptyFunction.thatReturnsTrue;
16270 },
16271
16272 /**
16273 * We release all dispatched `SyntheticEvent`s after each event loop, adding
16274 * them back into the pool. This allows a way to hold onto a reference that
16275 * won't be added back into the pool.
16276 */
16277 persist: function () {
16278 this.isPersistent = emptyFunction.thatReturnsTrue;
16279 },
16280
16281 /**
16282 * Checks if this event should be released back into the pool.
16283 *
16284 * @return {boolean} True if this should not be released, false otherwise.
16285 */
16286 isPersistent: emptyFunction.thatReturnsFalse,
16287
16288 /**
16289 * `PooledClass` looks for `destructor` on each instance it releases.
16290 */
16291 destructor: function () {
16292 var Interface = this.constructor.Interface;
16293 for (var propName in Interface) {
16294 if ("development" !== 'production') {
16295 Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
16296 } else {
16297 this[propName] = null;
16298 }
16299 }
16300 for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
16301 this[shouldBeReleasedProperties[i]] = null;
16302 }
16303 if ("development" !== 'production') {
16304 Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
16305 Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
16306 Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
16307 }
16308 }
16309
16310});
16311
16312SyntheticEvent.Interface = EventInterface;
16313
16314if ("development" !== 'production') {
16315 if (isProxySupported) {
16316 /*eslint-disable no-func-assign */
16317 SyntheticEvent = new Proxy(SyntheticEvent, {
16318 construct: function (target, args) {
16319 return this.apply(target, Object.create(target.prototype), args);
16320 },
16321 apply: function (constructor, that, args) {
16322 return new Proxy(constructor.apply(that, args), {
16323 set: function (target, prop, value) {
16324 if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
16325 "development" !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
16326 didWarnForAddedNewProperty = true;
16327 }
16328 target[prop] = value;
16329 return true;
16330 }
16331 });
16332 }
16333 });
16334 /*eslint-enable no-func-assign */
16335 }
16336}
16337/**
16338 * Helper to reduce boilerplate when creating subclasses.
16339 *
16340 * @param {function} Class
16341 * @param {?object} Interface
16342 */
16343SyntheticEvent.augmentClass = function (Class, Interface) {
16344 var Super = this;
16345
16346 var E = function () {};
16347 E.prototype = Super.prototype;
16348 var prototype = new E();
16349
16350 _assign(prototype, Class.prototype);
16351 Class.prototype = prototype;
16352 Class.prototype.constructor = Class;
16353
16354 Class.Interface = _assign({}, Super.Interface, Interface);
16355 Class.augmentClass = Super.augmentClass;
16356
16357 PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
16358};
16359
16360PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
16361
16362module.exports = SyntheticEvent;
16363
16364/**
16365 * Helper to nullify syntheticEvent instance properties when destructing
16366 *
16367 * @param {object} SyntheticEvent
16368 * @param {String} propName
16369 * @return {object} defineProperty object
16370 */
16371function getPooledWarningPropertyDefinition(propName, getVal) {
16372 var isFunction = typeof getVal === 'function';
16373 return {
16374 configurable: true,
16375 set: set,
16376 get: get
16377 };
16378
16379 function set(val) {
16380 var action = isFunction ? 'setting the method' : 'setting the property';
16381 warn(action, 'This is effectively a no-op');
16382 return val;
16383 }
16384
16385 function get() {
16386 var action = isFunction ? 'accessing the method' : 'accessing the property';
16387 var result = isFunction ? 'This is a no-op function' : 'This is set to null';
16388 warn(action, result);
16389 return getVal;
16390 }
16391
16392 function warn(action, result) {
16393 var warningCondition = false;
16394 "development" !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
16395 }
16396}
16397},{"154":154,"171":171,"172":172,"25":25}],106:[function(_dereq_,module,exports){
16398/**
16399 * Copyright 2013-present, Facebook, Inc.
16400 * All rights reserved.
16401 *
16402 * This source code is licensed under the BSD-style license found in the
16403 * LICENSE file in the root directory of this source tree. An additional grant
16404 * of patent rights can be found in the PATENTS file in the same directory.
16405 *
16406 * @providesModule SyntheticFocusEvent
16407 */
16408
16409'use strict';
16410
16411var SyntheticUIEvent = _dereq_(112);
16412
16413/**
16414 * @interface FocusEvent
16415 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16416 */
16417var FocusEventInterface = {
16418 relatedTarget: null
16419};
16420
16421/**
16422 * @param {object} dispatchConfig Configuration used to dispatch this event.
16423 * @param {string} dispatchMarker Marker identifying the event target.
16424 * @param {object} nativeEvent Native browser event.
16425 * @extends {SyntheticUIEvent}
16426 */
16427function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16428 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16429}
16430
16431SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
16432
16433module.exports = SyntheticFocusEvent;
16434},{"112":112}],107:[function(_dereq_,module,exports){
16435/**
16436 * Copyright 2013-present, Facebook, Inc.
16437 * All rights reserved.
16438 *
16439 * This source code is licensed under the BSD-style license found in the
16440 * LICENSE file in the root directory of this source tree. An additional grant
16441 * of patent rights can be found in the PATENTS file in the same directory.
16442 *
16443 * @providesModule SyntheticInputEvent
16444 */
16445
16446'use strict';
16447
16448var SyntheticEvent = _dereq_(105);
16449
16450/**
16451 * @interface Event
16452 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
16453 * /#events-inputevents
16454 */
16455var InputEventInterface = {
16456 data: null
16457};
16458
16459/**
16460 * @param {object} dispatchConfig Configuration used to dispatch this event.
16461 * @param {string} dispatchMarker Marker identifying the event target.
16462 * @param {object} nativeEvent Native browser event.
16463 * @extends {SyntheticUIEvent}
16464 */
16465function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16466 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16467}
16468
16469SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
16470
16471module.exports = SyntheticInputEvent;
16472},{"105":105}],108:[function(_dereq_,module,exports){
16473/**
16474 * Copyright 2013-present, Facebook, Inc.
16475 * All rights reserved.
16476 *
16477 * This source code is licensed under the BSD-style license found in the
16478 * LICENSE file in the root directory of this source tree. An additional grant
16479 * of patent rights can be found in the PATENTS file in the same directory.
16480 *
16481 * @providesModule SyntheticKeyboardEvent
16482 */
16483
16484'use strict';
16485
16486var SyntheticUIEvent = _dereq_(112);
16487
16488var getEventCharCode = _dereq_(126);
16489var getEventKey = _dereq_(127);
16490var getEventModifierState = _dereq_(128);
16491
16492/**
16493 * @interface KeyboardEvent
16494 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16495 */
16496var KeyboardEventInterface = {
16497 key: getEventKey,
16498 location: null,
16499 ctrlKey: null,
16500 shiftKey: null,
16501 altKey: null,
16502 metaKey: null,
16503 repeat: null,
16504 locale: null,
16505 getModifierState: getEventModifierState,
16506 // Legacy Interface
16507 charCode: function (event) {
16508 // `charCode` is the result of a KeyPress event and represents the value of
16509 // the actual printable character.
16510
16511 // KeyPress is deprecated, but its replacement is not yet final and not
16512 // implemented in any major browser. Only KeyPress has charCode.
16513 if (event.type === 'keypress') {
16514 return getEventCharCode(event);
16515 }
16516 return 0;
16517 },
16518 keyCode: function (event) {
16519 // `keyCode` is the result of a KeyDown/Up event and represents the value of
16520 // physical keyboard key.
16521
16522 // The actual meaning of the value depends on the users' keyboard layout
16523 // which cannot be detected. Assuming that it is a US keyboard layout
16524 // provides a surprisingly accurate mapping for US and European users.
16525 // Due to this, it is left to the user to implement at this time.
16526 if (event.type === 'keydown' || event.type === 'keyup') {
16527 return event.keyCode;
16528 }
16529 return 0;
16530 },
16531 which: function (event) {
16532 // `which` is an alias for either `keyCode` or `charCode` depending on the
16533 // type of the event.
16534 if (event.type === 'keypress') {
16535 return getEventCharCode(event);
16536 }
16537 if (event.type === 'keydown' || event.type === 'keyup') {
16538 return event.keyCode;
16539 }
16540 return 0;
16541 }
16542};
16543
16544/**
16545 * @param {object} dispatchConfig Configuration used to dispatch this event.
16546 * @param {string} dispatchMarker Marker identifying the event target.
16547 * @param {object} nativeEvent Native browser event.
16548 * @extends {SyntheticUIEvent}
16549 */
16550function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16551 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16552}
16553
16554SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
16555
16556module.exports = SyntheticKeyboardEvent;
16557},{"112":112,"126":126,"127":127,"128":128}],109:[function(_dereq_,module,exports){
16558/**
16559 * Copyright 2013-present, Facebook, Inc.
16560 * All rights reserved.
16561 *
16562 * This source code is licensed under the BSD-style license found in the
16563 * LICENSE file in the root directory of this source tree. An additional grant
16564 * of patent rights can be found in the PATENTS file in the same directory.
16565 *
16566 * @providesModule SyntheticMouseEvent
16567 */
16568
16569'use strict';
16570
16571var SyntheticUIEvent = _dereq_(112);
16572var ViewportMetrics = _dereq_(115);
16573
16574var getEventModifierState = _dereq_(128);
16575
16576/**
16577 * @interface MouseEvent
16578 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16579 */
16580var MouseEventInterface = {
16581 screenX: null,
16582 screenY: null,
16583 clientX: null,
16584 clientY: null,
16585 ctrlKey: null,
16586 shiftKey: null,
16587 altKey: null,
16588 metaKey: null,
16589 getModifierState: getEventModifierState,
16590 button: function (event) {
16591 // Webkit, Firefox, IE9+
16592 // which: 1 2 3
16593 // button: 0 1 2 (standard)
16594 var button = event.button;
16595 if ('which' in event) {
16596 return button;
16597 }
16598 // IE<9
16599 // which: undefined
16600 // button: 0 0 0
16601 // button: 1 4 2 (onmouseup)
16602 return button === 2 ? 2 : button === 4 ? 1 : 0;
16603 },
16604 buttons: null,
16605 relatedTarget: function (event) {
16606 return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
16607 },
16608 // "Proprietary" Interface.
16609 pageX: function (event) {
16610 return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
16611 },
16612 pageY: function (event) {
16613 return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
16614 }
16615};
16616
16617/**
16618 * @param {object} dispatchConfig Configuration used to dispatch this event.
16619 * @param {string} dispatchMarker Marker identifying the event target.
16620 * @param {object} nativeEvent Native browser event.
16621 * @extends {SyntheticUIEvent}
16622 */
16623function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16624 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16625}
16626
16627SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
16628
16629module.exports = SyntheticMouseEvent;
16630},{"112":112,"115":115,"128":128}],110:[function(_dereq_,module,exports){
16631/**
16632 * Copyright 2013-present, Facebook, Inc.
16633 * All rights reserved.
16634 *
16635 * This source code is licensed under the BSD-style license found in the
16636 * LICENSE file in the root directory of this source tree. An additional grant
16637 * of patent rights can be found in the PATENTS file in the same directory.
16638 *
16639 * @providesModule SyntheticTouchEvent
16640 */
16641
16642'use strict';
16643
16644var SyntheticUIEvent = _dereq_(112);
16645
16646var getEventModifierState = _dereq_(128);
16647
16648/**
16649 * @interface TouchEvent
16650 * @see http://www.w3.org/TR/touch-events/
16651 */
16652var TouchEventInterface = {
16653 touches: null,
16654 targetTouches: null,
16655 changedTouches: null,
16656 altKey: null,
16657 metaKey: null,
16658 ctrlKey: null,
16659 shiftKey: null,
16660 getModifierState: getEventModifierState
16661};
16662
16663/**
16664 * @param {object} dispatchConfig Configuration used to dispatch this event.
16665 * @param {string} dispatchMarker Marker identifying the event target.
16666 * @param {object} nativeEvent Native browser event.
16667 * @extends {SyntheticUIEvent}
16668 */
16669function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16670 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16671}
16672
16673SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
16674
16675module.exports = SyntheticTouchEvent;
16676},{"112":112,"128":128}],111:[function(_dereq_,module,exports){
16677/**
16678 * Copyright 2013-present, Facebook, Inc.
16679 * All rights reserved.
16680 *
16681 * This source code is licensed under the BSD-style license found in the
16682 * LICENSE file in the root directory of this source tree. An additional grant
16683 * of patent rights can be found in the PATENTS file in the same directory.
16684 *
16685 * @providesModule SyntheticTransitionEvent
16686 */
16687
16688'use strict';
16689
16690var SyntheticEvent = _dereq_(105);
16691
16692/**
16693 * @interface Event
16694 * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
16695 * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
16696 */
16697var TransitionEventInterface = {
16698 propertyName: null,
16699 elapsedTime: null,
16700 pseudoElement: null
16701};
16702
16703/**
16704 * @param {object} dispatchConfig Configuration used to dispatch this event.
16705 * @param {string} dispatchMarker Marker identifying the event target.
16706 * @param {object} nativeEvent Native browser event.
16707 * @extends {SyntheticEvent}
16708 */
16709function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16710 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16711}
16712
16713SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
16714
16715module.exports = SyntheticTransitionEvent;
16716},{"105":105}],112:[function(_dereq_,module,exports){
16717/**
16718 * Copyright 2013-present, Facebook, Inc.
16719 * All rights reserved.
16720 *
16721 * This source code is licensed under the BSD-style license found in the
16722 * LICENSE file in the root directory of this source tree. An additional grant
16723 * of patent rights can be found in the PATENTS file in the same directory.
16724 *
16725 * @providesModule SyntheticUIEvent
16726 */
16727
16728'use strict';
16729
16730var SyntheticEvent = _dereq_(105);
16731
16732var getEventTarget = _dereq_(129);
16733
16734/**
16735 * @interface UIEvent
16736 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16737 */
16738var UIEventInterface = {
16739 view: function (event) {
16740 if (event.view) {
16741 return event.view;
16742 }
16743
16744 var target = getEventTarget(event);
16745 if (target.window === target) {
16746 // target is a window object
16747 return target;
16748 }
16749
16750 var doc = target.ownerDocument;
16751 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
16752 if (doc) {
16753 return doc.defaultView || doc.parentWindow;
16754 } else {
16755 return window;
16756 }
16757 },
16758 detail: function (event) {
16759 return event.detail || 0;
16760 }
16761};
16762
16763/**
16764 * @param {object} dispatchConfig Configuration used to dispatch this event.
16765 * @param {string} dispatchMarker Marker identifying the event target.
16766 * @param {object} nativeEvent Native browser event.
16767 * @extends {SyntheticEvent}
16768 */
16769function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16770 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16771}
16772
16773SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
16774
16775module.exports = SyntheticUIEvent;
16776},{"105":105,"129":129}],113:[function(_dereq_,module,exports){
16777/**
16778 * Copyright 2013-present, Facebook, Inc.
16779 * All rights reserved.
16780 *
16781 * This source code is licensed under the BSD-style license found in the
16782 * LICENSE file in the root directory of this source tree. An additional grant
16783 * of patent rights can be found in the PATENTS file in the same directory.
16784 *
16785 * @providesModule SyntheticWheelEvent
16786 */
16787
16788'use strict';
16789
16790var SyntheticMouseEvent = _dereq_(109);
16791
16792/**
16793 * @interface WheelEvent
16794 * @see http://www.w3.org/TR/DOM-Level-3-Events/
16795 */
16796var WheelEventInterface = {
16797 deltaX: function (event) {
16798 return 'deltaX' in event ? event.deltaX :
16799 // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
16800 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
16801 },
16802 deltaY: function (event) {
16803 return 'deltaY' in event ? event.deltaY :
16804 // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
16805 'wheelDeltaY' in event ? -event.wheelDeltaY :
16806 // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
16807 'wheelDelta' in event ? -event.wheelDelta : 0;
16808 },
16809 deltaZ: null,
16810
16811 // Browsers without "deltaMode" is reporting in raw wheel delta where one
16812 // notch on the scroll is always +/- 120, roughly equivalent to pixels.
16813 // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
16814 // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
16815 deltaMode: null
16816};
16817
16818/**
16819 * @param {object} dispatchConfig Configuration used to dispatch this event.
16820 * @param {string} dispatchMarker Marker identifying the event target.
16821 * @param {object} nativeEvent Native browser event.
16822 * @extends {SyntheticMouseEvent}
16823 */
16824function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
16825 return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
16826}
16827
16828SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
16829
16830module.exports = SyntheticWheelEvent;
16831},{"109":109}],114:[function(_dereq_,module,exports){
16832/**
16833 * Copyright 2013-present, Facebook, Inc.
16834 * All rights reserved.
16835 *
16836 * This source code is licensed under the BSD-style license found in the
16837 * LICENSE file in the root directory of this source tree. An additional grant
16838 * of patent rights can be found in the PATENTS file in the same directory.
16839 *
16840 * @providesModule Transaction
16841 */
16842
16843'use strict';
16844
16845var _prodInvariant = _dereq_(140);
16846
16847var invariant = _dereq_(162);
16848
16849/**
16850 * `Transaction` creates a black box that is able to wrap any method such that
16851 * certain invariants are maintained before and after the method is invoked
16852 * (Even if an exception is thrown while invoking the wrapped method). Whoever
16853 * instantiates a transaction can provide enforcers of the invariants at
16854 * creation time. The `Transaction` class itself will supply one additional
16855 * automatic invariant for you - the invariant that any transaction instance
16856 * should not be run while it is already being run. You would typically create a
16857 * single instance of a `Transaction` for reuse multiple times, that potentially
16858 * is used to wrap several different methods. Wrappers are extremely simple -
16859 * they only require implementing two methods.
16860 *
16861 * <pre>
16862 * wrappers (injected at creation time)
16863 * + +
16864 * | |
16865 * +-----------------|--------|--------------+
16866 * | v | |
16867 * | +---------------+ | |
16868 * | +--| wrapper1 |---|----+ |
16869 * | | +---------------+ v | |
16870 * | | +-------------+ | |
16871 * | | +----| wrapper2 |--------+ |
16872 * | | | +-------------+ | | |
16873 * | | | | | |
16874 * | v v v v | wrapper
16875 * | +---+ +---+ +---------+ +---+ +---+ | invariants
16876 * perform(anyMethod) | | | | | | | | | | | | maintained
16877 * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
16878 * | | | | | | | | | | | |
16879 * | | | | | | | | | | | |
16880 * | | | | | | | | | | | |
16881 * | +---+ +---+ +---------+ +---+ +---+ |
16882 * | initialize close |
16883 * +-----------------------------------------+
16884 * </pre>
16885 *
16886 * Use cases:
16887 * - Preserving the input selection ranges before/after reconciliation.
16888 * Restoring selection even in the event of an unexpected error.
16889 * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
16890 * while guaranteeing that afterwards, the event system is reactivated.
16891 * - Flushing a queue of collected DOM mutations to the main UI thread after a
16892 * reconciliation takes place in a worker thread.
16893 * - Invoking any collected `componentDidUpdate` callbacks after rendering new
16894 * content.
16895 * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
16896 * to preserve the `scrollTop` (an automatic scroll aware DOM).
16897 * - (Future use case): Layout calculations before and after DOM updates.
16898 *
16899 * Transactional plugin API:
16900 * - A module that has an `initialize` method that returns any precomputation.
16901 * - and a `close` method that accepts the precomputation. `close` is invoked
16902 * when the wrapped process is completed, or has failed.
16903 *
16904 * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
16905 * that implement `initialize` and `close`.
16906 * @return {Transaction} Single transaction for reuse in thread.
16907 *
16908 * @class Transaction
16909 */
16910var Mixin = {
16911 /**
16912 * Sets up this instance so that it is prepared for collecting metrics. Does
16913 * so such that this setup method may be used on an instance that is already
16914 * initialized, in a way that does not consume additional memory upon reuse.
16915 * That can be useful if you decide to make your subclass of this mixin a
16916 * "PooledClass".
16917 */
16918 reinitializeTransaction: function () {
16919 this.transactionWrappers = this.getTransactionWrappers();
16920 if (this.wrapperInitData) {
16921 this.wrapperInitData.length = 0;
16922 } else {
16923 this.wrapperInitData = [];
16924 }
16925 this._isInTransaction = false;
16926 },
16927
16928 _isInTransaction: false,
16929
16930 /**
16931 * @abstract
16932 * @return {Array<TransactionWrapper>} Array of transaction wrappers.
16933 */
16934 getTransactionWrappers: null,
16935
16936 isInTransaction: function () {
16937 return !!this._isInTransaction;
16938 },
16939
16940 /**
16941 * Executes the function within a safety window. Use this for the top level
16942 * methods that result in large amounts of computation/mutations that would
16943 * need to be safety checked. The optional arguments helps prevent the need
16944 * to bind in many cases.
16945 *
16946 * @param {function} method Member of scope to call.
16947 * @param {Object} scope Scope to invoke from.
16948 * @param {Object?=} a Argument to pass to the method.
16949 * @param {Object?=} b Argument to pass to the method.
16950 * @param {Object?=} c Argument to pass to the method.
16951 * @param {Object?=} d Argument to pass to the method.
16952 * @param {Object?=} e Argument to pass to the method.
16953 * @param {Object?=} f Argument to pass to the method.
16954 *
16955 * @return {*} Return value from `method`.
16956 */
16957 perform: function (method, scope, a, b, c, d, e, f) {
16958 !!this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0;
16959 var errorThrown;
16960 var ret;
16961 try {
16962 this._isInTransaction = true;
16963 // Catching errors makes debugging more difficult, so we start with
16964 // errorThrown set to true before setting it to false after calling
16965 // close -- if it's still set to true in the finally block, it means
16966 // one of these calls threw.
16967 errorThrown = true;
16968 this.initializeAll(0);
16969 ret = method.call(scope, a, b, c, d, e, f);
16970 errorThrown = false;
16971 } finally {
16972 try {
16973 if (errorThrown) {
16974 // If `method` throws, prefer to show that stack trace over any thrown
16975 // by invoking `closeAll`.
16976 try {
16977 this.closeAll(0);
16978 } catch (err) {}
16979 } else {
16980 // Since `method` didn't throw, we don't want to silence the exception
16981 // here.
16982 this.closeAll(0);
16983 }
16984 } finally {
16985 this._isInTransaction = false;
16986 }
16987 }
16988 return ret;
16989 },
16990
16991 initializeAll: function (startIndex) {
16992 var transactionWrappers = this.transactionWrappers;
16993 for (var i = startIndex; i < transactionWrappers.length; i++) {
16994 var wrapper = transactionWrappers[i];
16995 try {
16996 // Catching errors makes debugging more difficult, so we start with the
16997 // OBSERVED_ERROR state before overwriting it with the real return value
16998 // of initialize -- if it's still set to OBSERVED_ERROR in the finally
16999 // block, it means wrapper.initialize threw.
17000 this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
17001 this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
17002 } finally {
17003 if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
17004 // The initializer for wrapper i threw an error; initialize the
17005 // remaining wrappers but silence any exceptions from them to ensure
17006 // that the first error is the one to bubble up.
17007 try {
17008 this.initializeAll(i + 1);
17009 } catch (err) {}
17010 }
17011 }
17012 }
17013 },
17014
17015 /**
17016 * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
17017 * them the respective return values of `this.transactionWrappers.init[i]`
17018 * (`close`rs that correspond to initializers that failed will not be
17019 * invoked).
17020 */
17021 closeAll: function (startIndex) {
17022 !this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0;
17023 var transactionWrappers = this.transactionWrappers;
17024 for (var i = startIndex; i < transactionWrappers.length; i++) {
17025 var wrapper = transactionWrappers[i];
17026 var initData = this.wrapperInitData[i];
17027 var errorThrown;
17028 try {
17029 // Catching errors makes debugging more difficult, so we start with
17030 // errorThrown set to true before setting it to false after calling
17031 // close -- if it's still set to true in the finally block, it means
17032 // wrapper.close threw.
17033 errorThrown = true;
17034 if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
17035 wrapper.close.call(this, initData);
17036 }
17037 errorThrown = false;
17038 } finally {
17039 if (errorThrown) {
17040 // The closer for wrapper i threw an error; close the remaining
17041 // wrappers but silence any exceptions from them to ensure that the
17042 // first error is the one to bubble up.
17043 try {
17044 this.closeAll(i + 1);
17045 } catch (e) {}
17046 }
17047 }
17048 }
17049 this.wrapperInitData.length = 0;
17050 }
17051};
17052
17053var Transaction = {
17054
17055 Mixin: Mixin,
17056
17057 /**
17058 * Token to look for to determine if an error occurred.
17059 */
17060 OBSERVED_ERROR: {}
17061
17062};
17063
17064module.exports = Transaction;
17065},{"140":140,"162":162}],115:[function(_dereq_,module,exports){
17066/**
17067 * Copyright 2013-present, Facebook, Inc.
17068 * All rights reserved.
17069 *
17070 * This source code is licensed under the BSD-style license found in the
17071 * LICENSE file in the root directory of this source tree. An additional grant
17072 * of patent rights can be found in the PATENTS file in the same directory.
17073 *
17074 * @providesModule ViewportMetrics
17075 */
17076
17077'use strict';
17078
17079var ViewportMetrics = {
17080
17081 currentScrollLeft: 0,
17082
17083 currentScrollTop: 0,
17084
17085 refreshScrollValues: function (scrollPosition) {
17086 ViewportMetrics.currentScrollLeft = scrollPosition.x;
17087 ViewportMetrics.currentScrollTop = scrollPosition.y;
17088 }
17089
17090};
17091
17092module.exports = ViewportMetrics;
17093},{}],116:[function(_dereq_,module,exports){
17094/**
17095 * Copyright 2014-present, Facebook, Inc.
17096 * All rights reserved.
17097 *
17098 * This source code is licensed under the BSD-style license found in the
17099 * LICENSE file in the root directory of this source tree. An additional grant
17100 * of patent rights can be found in the PATENTS file in the same directory.
17101 *
17102 * @providesModule accumulateInto
17103 *
17104 */
17105
17106'use strict';
17107
17108var _prodInvariant = _dereq_(140);
17109
17110var invariant = _dereq_(162);
17111
17112/**
17113 * Accumulates items that must not be null or undefined into the first one. This
17114 * is used to conserve memory by avoiding array allocations, and thus sacrifices
17115 * API cleanness. Since `current` can be null before being passed in and not
17116 * null after this function, make sure to assign it back to `current`:
17117 *
17118 * `a = accumulateInto(a, b);`
17119 *
17120 * This API should be sparingly used. Try `accumulate` for something cleaner.
17121 *
17122 * @return {*|array<*>} An accumulation of items.
17123 */
17124
17125function accumulateInto(current, next) {
17126 !(next != null) ? "development" !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0;
17127
17128 if (current == null) {
17129 return next;
17130 }
17131
17132 // Both are not empty. Warning: Never call x.concat(y) when you are not
17133 // certain that x is an Array (x could be a string with concat method).
17134 if (Array.isArray(current)) {
17135 if (Array.isArray(next)) {
17136 current.push.apply(current, next);
17137 return current;
17138 }
17139 current.push(next);
17140 return current;
17141 }
17142
17143 if (Array.isArray(next)) {
17144 // A bit too dangerous to mutate `next`.
17145 return [current].concat(next);
17146 }
17147
17148 return [current, next];
17149}
17150
17151module.exports = accumulateInto;
17152},{"140":140,"162":162}],117:[function(_dereq_,module,exports){
17153/**
17154 * Copyright 2013-present, Facebook, Inc.
17155 * All rights reserved.
17156 *
17157 * This source code is licensed under the BSD-style license found in the
17158 * LICENSE file in the root directory of this source tree. An additional grant
17159 * of patent rights can be found in the PATENTS file in the same directory.
17160 *
17161 * @providesModule adler32
17162 *
17163 */
17164
17165'use strict';
17166
17167var MOD = 65521;
17168
17169// adler32 is not cryptographically strong, and is only used to sanity check that
17170// markup generated on the server matches the markup generated on the client.
17171// This implementation (a modified version of the SheetJS version) has been optimized
17172// for our use case, at the expense of conforming to the adler32 specification
17173// for non-ascii inputs.
17174function adler32(data) {
17175 var a = 1;
17176 var b = 0;
17177 var i = 0;
17178 var l = data.length;
17179 var m = l & ~0x3;
17180 while (i < m) {
17181 var n = Math.min(i + 4096, m);
17182 for (; i < n; i += 4) {
17183 b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
17184 }
17185 a %= MOD;
17186 b %= MOD;
17187 }
17188 for (; i < l; i++) {
17189 b += a += data.charCodeAt(i);
17190 }
17191 a %= MOD;
17192 b %= MOD;
17193 return a | b << 16;
17194}
17195
17196module.exports = adler32;
17197},{}],118:[function(_dereq_,module,exports){
17198/**
17199 * Copyright 2013-present, Facebook, Inc.
17200 * All rights reserved.
17201 *
17202 * This source code is licensed under the BSD-style license found in the
17203 * LICENSE file in the root directory of this source tree. An additional grant
17204 * of patent rights can be found in the PATENTS file in the same directory.
17205 *
17206 * @providesModule canDefineProperty
17207 */
17208
17209'use strict';
17210
17211var canDefineProperty = false;
17212if ("development" !== 'production') {
17213 try {
17214 Object.defineProperty({}, 'x', { get: function () {} });
17215 canDefineProperty = true;
17216 } catch (x) {
17217 // IE will fail on defineProperty
17218 }
17219}
17220
17221module.exports = canDefineProperty;
17222},{}],119:[function(_dereq_,module,exports){
17223(function (process){
17224/**
17225 * Copyright 2013-present, Facebook, Inc.
17226 * All rights reserved.
17227 *
17228 * This source code is licensed under the BSD-style license found in the
17229 * LICENSE file in the root directory of this source tree. An additional grant
17230 * of patent rights can be found in the PATENTS file in the same directory.
17231 *
17232 * @providesModule checkReactTypeSpec
17233 */
17234
17235'use strict';
17236
17237var _prodInvariant = _dereq_(140);
17238
17239var ReactPropTypeLocationNames = _dereq_(82);
17240var ReactPropTypesSecret = _dereq_(85);
17241
17242var invariant = _dereq_(162);
17243var warning = _dereq_(171);
17244
17245var ReactComponentTreeHook;
17246
17247if (typeof process !== 'undefined' && process.env && "development" === 'test') {
17248 // Temporary hack.
17249 // Inline requires don't work well with Jest:
17250 // https://github.com/facebook/react/issues/7240
17251 // Remove the inline requires when we don't need them anymore:
17252 // https://github.com/facebook/react/pull/7178
17253 ReactComponentTreeHook = _dereq_(35);
17254}
17255
17256var loggedTypeFailures = {};
17257
17258/**
17259 * Assert that the values match with the type specs.
17260 * Error messages are memorized and will only be shown once.
17261 *
17262 * @param {object} typeSpecs Map of name to a ReactPropType
17263 * @param {object} values Runtime values that need to be type-checked
17264 * @param {string} location e.g. "prop", "context", "child context"
17265 * @param {string} componentName Name of the component for error messages.
17266 * @param {?object} element The React element that is being type-checked
17267 * @param {?number} debugID The React component instance that is being type-checked
17268 * @private
17269 */
17270function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
17271 for (var typeSpecName in typeSpecs) {
17272 if (typeSpecs.hasOwnProperty(typeSpecName)) {
17273 var error;
17274 // Prop type validation may throw. In case they do, we don't want to
17275 // fail the render phase where it didn't fail before. So we log it.
17276 // After these have been cleaned up, we'll let them throw.
17277 try {
17278 // This is intentionally an invariant that gets caught. It's the same
17279 // behavior as without this statement except with a better message.
17280 !(typeof typeSpecs[typeSpecName] === 'function') ? "development" !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
17281 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
17282 } catch (ex) {
17283 error = ex;
17284 }
17285 "development" !== 'production' ? 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', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0;
17286 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
17287 // Only monitor this failure once because there tends to be a lot of the
17288 // same error.
17289 loggedTypeFailures[error.message] = true;
17290
17291 var componentStackInfo = '';
17292
17293 if ("development" !== 'production') {
17294 if (!ReactComponentTreeHook) {
17295 ReactComponentTreeHook = _dereq_(35);
17296 }
17297 if (debugID !== null) {
17298 componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
17299 } else if (element !== null) {
17300 componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
17301 }
17302 }
17303
17304 "development" !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
17305 }
17306 }
17307 }
17308}
17309
17310module.exports = checkReactTypeSpec;
17311}).call(this,undefined)
17312},{"140":140,"162":162,"171":171,"35":35,"82":82,"85":85}],120:[function(_dereq_,module,exports){
17313/**
17314 * Copyright 2013-present, Facebook, Inc.
17315 * All rights reserved.
17316 *
17317 * This source code is licensed under the BSD-style license found in the
17318 * LICENSE file in the root directory of this source tree. An additional grant
17319 * of patent rights can be found in the PATENTS file in the same directory.
17320 *
17321 * @providesModule createMicrosoftUnsafeLocalFunction
17322 */
17323
17324/* globals MSApp */
17325
17326'use strict';
17327
17328/**
17329 * Create a function which has 'unsafe' privileges (required by windows8 apps)
17330 */
17331
17332var createMicrosoftUnsafeLocalFunction = function (func) {
17333 if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
17334 return function (arg0, arg1, arg2, arg3) {
17335 MSApp.execUnsafeLocalFunction(function () {
17336 return func(arg0, arg1, arg2, arg3);
17337 });
17338 };
17339 } else {
17340 return func;
17341 }
17342};
17343
17344module.exports = createMicrosoftUnsafeLocalFunction;
17345},{}],121:[function(_dereq_,module,exports){
17346/**
17347 * Copyright 2013-present, Facebook, Inc.
17348 * All rights reserved.
17349 *
17350 * This source code is licensed under the BSD-style license found in the
17351 * LICENSE file in the root directory of this source tree. An additional grant
17352 * of patent rights can be found in the PATENTS file in the same directory.
17353 *
17354 * @providesModule dangerousStyleValue
17355 */
17356
17357'use strict';
17358
17359var CSSProperty = _dereq_(3);
17360var warning = _dereq_(171);
17361
17362var isUnitlessNumber = CSSProperty.isUnitlessNumber;
17363var styleWarnings = {};
17364
17365/**
17366 * Convert a value into the proper css writable value. The style name `name`
17367 * should be logical (no hyphens), as specified
17368 * in `CSSProperty.isUnitlessNumber`.
17369 *
17370 * @param {string} name CSS property name such as `topMargin`.
17371 * @param {*} value CSS property value such as `10px`.
17372 * @param {ReactDOMComponent} component
17373 * @return {string} Normalized style value with dimensions applied.
17374 */
17375function dangerousStyleValue(name, value, component) {
17376 // Note that we've removed escapeTextForBrowser() calls here since the
17377 // whole string will be escaped when the attribute is injected into
17378 // the markup. If you provide unsafe user data here they can inject
17379 // arbitrary CSS which may be problematic (I couldn't repro this):
17380 // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
17381 // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
17382 // This is not an XSS hole but instead a potential CSS injection issue
17383 // which has lead to a greater discussion about how we're going to
17384 // trust URLs moving forward. See #2115901
17385
17386 var isEmpty = value == null || typeof value === 'boolean' || value === '';
17387 if (isEmpty) {
17388 return '';
17389 }
17390
17391 var isNonNumeric = isNaN(value);
17392 if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
17393 return '' + value; // cast to string
17394 }
17395
17396 if (typeof value === 'string') {
17397 if ("development" !== 'production') {
17398 // Allow '0' to pass through without warning. 0 is already special and
17399 // doesn't require units, so we don't need to warn about it.
17400 if (component && value !== '0') {
17401 var owner = component._currentElement._owner;
17402 var ownerName = owner ? owner.getName() : null;
17403 if (ownerName && !styleWarnings[ownerName]) {
17404 styleWarnings[ownerName] = {};
17405 }
17406 var warned = false;
17407 if (ownerName) {
17408 var warnings = styleWarnings[ownerName];
17409 warned = warnings[name];
17410 if (!warned) {
17411 warnings[name] = true;
17412 }
17413 }
17414 if (!warned) {
17415 "development" !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;
17416 }
17417 }
17418 }
17419 value = value.trim();
17420 }
17421 return value + 'px';
17422}
17423
17424module.exports = dangerousStyleValue;
17425},{"171":171,"3":3}],122:[function(_dereq_,module,exports){
17426/**
17427 * Copyright 2016-present, Facebook, Inc.
17428 * All rights reserved.
17429 *
17430 * This source code is licensed under the BSD-style license found in the
17431 * LICENSE file in the root directory of this source tree. An additional grant
17432 * of patent rights can be found in the PATENTS file in the same directory.
17433 *
17434 * Based on the escape-html library, which is used under the MIT License below:
17435 *
17436 * Copyright (c) 2012-2013 TJ Holowaychuk
17437 * Copyright (c) 2015 Andreas Lubbe
17438 * Copyright (c) 2015 Tiancheng "Timothy" Gu
17439 *
17440 * Permission is hereby granted, free of charge, to any person obtaining
17441 * a copy of this software and associated documentation files (the
17442 * 'Software'), to deal in the Software without restriction, including
17443 * without limitation the rights to use, copy, modify, merge, publish,
17444 * distribute, sublicense, and/or sell copies of the Software, and to
17445 * permit persons to whom the Software is furnished to do so, subject to
17446 * the following conditions:
17447 *
17448 * The above copyright notice and this permission notice shall be
17449 * included in all copies or substantial portions of the Software.
17450 *
17451 * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17452 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17453 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17454 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
17455 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
17456 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17457 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17458 *
17459 * @providesModule escapeTextContentForBrowser
17460 */
17461
17462'use strict';
17463
17464// code copied and modified from escape-html
17465/**
17466 * Module variables.
17467 * @private
17468 */
17469
17470var matchHtmlRegExp = /["'&<>]/;
17471
17472/**
17473 * Escape special characters in the given string of html.
17474 *
17475 * @param {string} string The string to escape for inserting into HTML
17476 * @return {string}
17477 * @public
17478 */
17479
17480function escapeHtml(string) {
17481 var str = '' + string;
17482 var match = matchHtmlRegExp.exec(str);
17483
17484 if (!match) {
17485 return str;
17486 }
17487
17488 var escape;
17489 var html = '';
17490 var index = 0;
17491 var lastIndex = 0;
17492
17493 for (index = match.index; index < str.length; index++) {
17494 switch (str.charCodeAt(index)) {
17495 case 34:
17496 // "
17497 escape = '&quot;';
17498 break;
17499 case 38:
17500 // &
17501 escape = '&amp;';
17502 break;
17503 case 39:
17504 // '
17505 escape = '&#x27;'; // modified from escape-html; used to be '&#39'
17506 break;
17507 case 60:
17508 // <
17509 escape = '&lt;';
17510 break;
17511 case 62:
17512 // >
17513 escape = '&gt;';
17514 break;
17515 default:
17516 continue;
17517 }
17518
17519 if (lastIndex !== index) {
17520 html += str.substring(lastIndex, index);
17521 }
17522
17523 lastIndex = index + 1;
17524 html += escape;
17525 }
17526
17527 return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
17528}
17529// end code copied and modified from escape-html
17530
17531
17532/**
17533 * Escapes text to prevent scripting attacks.
17534 *
17535 * @param {*} text Text value to escape.
17536 * @return {string} An escaped string.
17537 */
17538function escapeTextContentForBrowser(text) {
17539 if (typeof text === 'boolean' || typeof text === 'number') {
17540 // this shortcircuit helps perf for types that we know will never have
17541 // special characters, especially given that this function is used often
17542 // for numeric dom ids.
17543 return '' + text;
17544 }
17545 return escapeHtml(text);
17546}
17547
17548module.exports = escapeTextContentForBrowser;
17549},{}],123:[function(_dereq_,module,exports){
17550/**
17551 * Copyright 2013-present, Facebook, Inc.
17552 * All rights reserved.
17553 *
17554 * This source code is licensed under the BSD-style license found in the
17555 * LICENSE file in the root directory of this source tree. An additional grant
17556 * of patent rights can be found in the PATENTS file in the same directory.
17557 *
17558 * @providesModule findDOMNode
17559 */
17560
17561'use strict';
17562
17563var _prodInvariant = _dereq_(140);
17564
17565var ReactCurrentOwner = _dereq_(37);
17566var ReactDOMComponentTree = _dereq_(42);
17567var ReactInstanceMap = _dereq_(72);
17568
17569var getHostComponentFromComposite = _dereq_(130);
17570var invariant = _dereq_(162);
17571var warning = _dereq_(171);
17572
17573/**
17574 * Returns the DOM node rendered by this element.
17575 *
17576 * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
17577 *
17578 * @param {ReactComponent|DOMElement} componentOrElement
17579 * @return {?DOMElement} The root node of this element.
17580 */
17581function findDOMNode(componentOrElement) {
17582 if ("development" !== 'production') {
17583 var owner = ReactCurrentOwner.current;
17584 if (owner !== null) {
17585 "development" !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
17586 owner._warnedAboutRefsInRender = true;
17587 }
17588 }
17589 if (componentOrElement == null) {
17590 return null;
17591 }
17592 if (componentOrElement.nodeType === 1) {
17593 return componentOrElement;
17594 }
17595
17596 var inst = ReactInstanceMap.get(componentOrElement);
17597 if (inst) {
17598 inst = getHostComponentFromComposite(inst);
17599 return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
17600 }
17601
17602 if (typeof componentOrElement.render === 'function') {
17603 !false ? "development" !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0;
17604 } else {
17605 !false ? "development" !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : _prodInvariant('45', Object.keys(componentOrElement)) : void 0;
17606 }
17607}
17608
17609module.exports = findDOMNode;
17610},{"130":130,"140":140,"162":162,"171":171,"37":37,"42":42,"72":72}],124:[function(_dereq_,module,exports){
17611(function (process){
17612/**
17613 * Copyright 2013-present, Facebook, Inc.
17614 * All rights reserved.
17615 *
17616 * This source code is licensed under the BSD-style license found in the
17617 * LICENSE file in the root directory of this source tree. An additional grant
17618 * of patent rights can be found in the PATENTS file in the same directory.
17619 *
17620 * @providesModule flattenChildren
17621 *
17622 */
17623
17624'use strict';
17625
17626var KeyEscapeUtils = _dereq_(23);
17627var traverseAllChildren = _dereq_(145);
17628var warning = _dereq_(171);
17629
17630var ReactComponentTreeHook;
17631
17632if (typeof process !== 'undefined' && process.env && "development" === 'test') {
17633 // Temporary hack.
17634 // Inline requires don't work well with Jest:
17635 // https://github.com/facebook/react/issues/7240
17636 // Remove the inline requires when we don't need them anymore:
17637 // https://github.com/facebook/react/pull/7178
17638 ReactComponentTreeHook = _dereq_(35);
17639}
17640
17641/**
17642 * @param {function} traverseContext Context passed through traversal.
17643 * @param {?ReactComponent} child React child component.
17644 * @param {!string} name String name of key path to child.
17645 * @param {number=} selfDebugID Optional debugID of the current internal instance.
17646 */
17647function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
17648 // We found a component instance.
17649 if (traverseContext && typeof traverseContext === 'object') {
17650 var result = traverseContext;
17651 var keyUnique = result[name] === undefined;
17652 if ("development" !== 'production') {
17653 if (!ReactComponentTreeHook) {
17654 ReactComponentTreeHook = _dereq_(35);
17655 }
17656 if (!keyUnique) {
17657 "development" !== 'production' ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
17658 }
17659 }
17660 if (keyUnique && child != null) {
17661 result[name] = child;
17662 }
17663 }
17664}
17665
17666/**
17667 * Flattens children that are typically specified as `props.children`. Any null
17668 * children will not be included in the resulting object.
17669 * @return {!object} flattened children keyed by name.
17670 */
17671function flattenChildren(children, selfDebugID) {
17672 if (children == null) {
17673 return children;
17674 }
17675 var result = {};
17676
17677 if ("development" !== 'production') {
17678 traverseAllChildren(children, function (traverseContext, child, name) {
17679 return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
17680 }, result);
17681 } else {
17682 traverseAllChildren(children, flattenSingleChildIntoContext, result);
17683 }
17684 return result;
17685}
17686
17687module.exports = flattenChildren;
17688}).call(this,undefined)
17689},{"145":145,"171":171,"23":23,"35":35}],125:[function(_dereq_,module,exports){
17690/**
17691 * Copyright 2013-present, Facebook, Inc.
17692 * All rights reserved.
17693 *
17694 * This source code is licensed under the BSD-style license found in the
17695 * LICENSE file in the root directory of this source tree. An additional grant
17696 * of patent rights can be found in the PATENTS file in the same directory.
17697 *
17698 * @providesModule forEachAccumulated
17699 *
17700 */
17701
17702'use strict';
17703
17704/**
17705 * @param {array} arr an "accumulation" of items which is either an Array or
17706 * a single item. Useful when paired with the `accumulate` module. This is a
17707 * simple utility that allows us to reason about a collection of items, but
17708 * handling the case when there is exactly one item (and we do not need to
17709 * allocate an array).
17710 */
17711
17712function forEachAccumulated(arr, cb, scope) {
17713 if (Array.isArray(arr)) {
17714 arr.forEach(cb, scope);
17715 } else if (arr) {
17716 cb.call(scope, arr);
17717 }
17718}
17719
17720module.exports = forEachAccumulated;
17721},{}],126:[function(_dereq_,module,exports){
17722/**
17723 * Copyright 2013-present, Facebook, Inc.
17724 * All rights reserved.
17725 *
17726 * This source code is licensed under the BSD-style license found in the
17727 * LICENSE file in the root directory of this source tree. An additional grant
17728 * of patent rights can be found in the PATENTS file in the same directory.
17729 *
17730 * @providesModule getEventCharCode
17731 */
17732
17733'use strict';
17734
17735/**
17736 * `charCode` represents the actual "character code" and is safe to use with
17737 * `String.fromCharCode`. As such, only keys that correspond to printable
17738 * characters produce a valid `charCode`, the only exception to this is Enter.
17739 * The Tab-key is considered non-printable and does not have a `charCode`,
17740 * presumably because it does not produce a tab-character in browsers.
17741 *
17742 * @param {object} nativeEvent Native browser event.
17743 * @return {number} Normalized `charCode` property.
17744 */
17745
17746function getEventCharCode(nativeEvent) {
17747 var charCode;
17748 var keyCode = nativeEvent.keyCode;
17749
17750 if ('charCode' in nativeEvent) {
17751 charCode = nativeEvent.charCode;
17752
17753 // FF does not set `charCode` for the Enter-key, check against `keyCode`.
17754 if (charCode === 0 && keyCode === 13) {
17755 charCode = 13;
17756 }
17757 } else {
17758 // IE8 does not implement `charCode`, but `keyCode` has the correct value.
17759 charCode = keyCode;
17760 }
17761
17762 // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
17763 // Must not discard the (non-)printable Enter-key.
17764 if (charCode >= 32 || charCode === 13) {
17765 return charCode;
17766 }
17767
17768 return 0;
17769}
17770
17771module.exports = getEventCharCode;
17772},{}],127:[function(_dereq_,module,exports){
17773/**
17774 * Copyright 2013-present, Facebook, Inc.
17775 * All rights reserved.
17776 *
17777 * This source code is licensed under the BSD-style license found in the
17778 * LICENSE file in the root directory of this source tree. An additional grant
17779 * of patent rights can be found in the PATENTS file in the same directory.
17780 *
17781 * @providesModule getEventKey
17782 */
17783
17784'use strict';
17785
17786var getEventCharCode = _dereq_(126);
17787
17788/**
17789 * Normalization of deprecated HTML5 `key` values
17790 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
17791 */
17792var normalizeKey = {
17793 'Esc': 'Escape',
17794 'Spacebar': ' ',
17795 'Left': 'ArrowLeft',
17796 'Up': 'ArrowUp',
17797 'Right': 'ArrowRight',
17798 'Down': 'ArrowDown',
17799 'Del': 'Delete',
17800 'Win': 'OS',
17801 'Menu': 'ContextMenu',
17802 'Apps': 'ContextMenu',
17803 'Scroll': 'ScrollLock',
17804 'MozPrintableKey': 'Unidentified'
17805};
17806
17807/**
17808 * Translation from legacy `keyCode` to HTML5 `key`
17809 * Only special keys supported, all others depend on keyboard layout or browser
17810 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
17811 */
17812var translateToKey = {
17813 8: 'Backspace',
17814 9: 'Tab',
17815 12: 'Clear',
17816 13: 'Enter',
17817 16: 'Shift',
17818 17: 'Control',
17819 18: 'Alt',
17820 19: 'Pause',
17821 20: 'CapsLock',
17822 27: 'Escape',
17823 32: ' ',
17824 33: 'PageUp',
17825 34: 'PageDown',
17826 35: 'End',
17827 36: 'Home',
17828 37: 'ArrowLeft',
17829 38: 'ArrowUp',
17830 39: 'ArrowRight',
17831 40: 'ArrowDown',
17832 45: 'Insert',
17833 46: 'Delete',
17834 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
17835 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
17836 144: 'NumLock',
17837 145: 'ScrollLock',
17838 224: 'Meta'
17839};
17840
17841/**
17842 * @param {object} nativeEvent Native browser event.
17843 * @return {string} Normalized `key` property.
17844 */
17845function getEventKey(nativeEvent) {
17846 if (nativeEvent.key) {
17847 // Normalize inconsistent values reported by browsers due to
17848 // implementations of a working draft specification.
17849
17850 // FireFox implements `key` but returns `MozPrintableKey` for all
17851 // printable characters (normalized to `Unidentified`), ignore it.
17852 var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
17853 if (key !== 'Unidentified') {
17854 return key;
17855 }
17856 }
17857
17858 // Browser does not implement `key`, polyfill as much of it as we can.
17859 if (nativeEvent.type === 'keypress') {
17860 var charCode = getEventCharCode(nativeEvent);
17861
17862 // The enter-key is technically both printable and non-printable and can
17863 // thus be captured by `keypress`, no other non-printable key should.
17864 return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
17865 }
17866 if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
17867 // While user keyboard layout determines the actual meaning of each
17868 // `keyCode` value, almost all function keys have a universal value.
17869 return translateToKey[nativeEvent.keyCode] || 'Unidentified';
17870 }
17871 return '';
17872}
17873
17874module.exports = getEventKey;
17875},{"126":126}],128:[function(_dereq_,module,exports){
17876/**
17877 * Copyright 2013-present, Facebook, Inc.
17878 * All rights reserved.
17879 *
17880 * This source code is licensed under the BSD-style license found in the
17881 * LICENSE file in the root directory of this source tree. An additional grant
17882 * of patent rights can be found in the PATENTS file in the same directory.
17883 *
17884 * @providesModule getEventModifierState
17885 */
17886
17887'use strict';
17888
17889/**
17890 * Translation from modifier key to the associated property in the event.
17891 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
17892 */
17893
17894var modifierKeyToProp = {
17895 'Alt': 'altKey',
17896 'Control': 'ctrlKey',
17897 'Meta': 'metaKey',
17898 'Shift': 'shiftKey'
17899};
17900
17901// IE8 does not implement getModifierState so we simply map it to the only
17902// modifier keys exposed by the event itself, does not support Lock-keys.
17903// Currently, all major browsers except Chrome seems to support Lock-keys.
17904function modifierStateGetter(keyArg) {
17905 var syntheticEvent = this;
17906 var nativeEvent = syntheticEvent.nativeEvent;
17907 if (nativeEvent.getModifierState) {
17908 return nativeEvent.getModifierState(keyArg);
17909 }
17910 var keyProp = modifierKeyToProp[keyArg];
17911 return keyProp ? !!nativeEvent[keyProp] : false;
17912}
17913
17914function getEventModifierState(nativeEvent) {
17915 return modifierStateGetter;
17916}
17917
17918module.exports = getEventModifierState;
17919},{}],129:[function(_dereq_,module,exports){
17920/**
17921 * Copyright 2013-present, Facebook, Inc.
17922 * All rights reserved.
17923 *
17924 * This source code is licensed under the BSD-style license found in the
17925 * LICENSE file in the root directory of this source tree. An additional grant
17926 * of patent rights can be found in the PATENTS file in the same directory.
17927 *
17928 * @providesModule getEventTarget
17929 */
17930
17931'use strict';
17932
17933/**
17934 * Gets the target node from a native browser event by accounting for
17935 * inconsistencies in browser DOM APIs.
17936 *
17937 * @param {object} nativeEvent Native browser event.
17938 * @return {DOMEventTarget} Target node.
17939 */
17940
17941function getEventTarget(nativeEvent) {
17942 var target = nativeEvent.target || nativeEvent.srcElement || window;
17943
17944 // Normalize SVG <use> element events #4963
17945 if (target.correspondingUseElement) {
17946 target = target.correspondingUseElement;
17947 }
17948
17949 // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
17950 // @see http://www.quirksmode.org/js/events_properties.html
17951 return target.nodeType === 3 ? target.parentNode : target;
17952}
17953
17954module.exports = getEventTarget;
17955},{}],130:[function(_dereq_,module,exports){
17956/**
17957 * Copyright 2013-present, Facebook, Inc.
17958 * All rights reserved.
17959 *
17960 * This source code is licensed under the BSD-style license found in the
17961 * LICENSE file in the root directory of this source tree. An additional grant
17962 * of patent rights can be found in the PATENTS file in the same directory.
17963 *
17964 * @providesModule getHostComponentFromComposite
17965 */
17966
17967'use strict';
17968
17969var ReactNodeTypes = _dereq_(79);
17970
17971function getHostComponentFromComposite(inst) {
17972 var type;
17973
17974 while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
17975 inst = inst._renderedComponent;
17976 }
17977
17978 if (type === ReactNodeTypes.HOST) {
17979 return inst._renderedComponent;
17980 } else if (type === ReactNodeTypes.EMPTY) {
17981 return null;
17982 }
17983}
17984
17985module.exports = getHostComponentFromComposite;
17986},{"79":79}],131:[function(_dereq_,module,exports){
17987/**
17988 * Copyright 2013-present, Facebook, Inc.
17989 * All rights reserved.
17990 *
17991 * This source code is licensed under the BSD-style license found in the
17992 * LICENSE file in the root directory of this source tree. An additional grant
17993 * of patent rights can be found in the PATENTS file in the same directory.
17994 *
17995 * @providesModule getIteratorFn
17996 *
17997 */
17998
17999'use strict';
18000
18001/* global Symbol */
18002
18003var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
18004var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
18005
18006/**
18007 * Returns the iterator method function contained on the iterable object.
18008 *
18009 * Be sure to invoke the function with the iterable as context:
18010 *
18011 * var iteratorFn = getIteratorFn(myIterable);
18012 * if (iteratorFn) {
18013 * var iterator = iteratorFn.call(myIterable);
18014 * ...
18015 * }
18016 *
18017 * @param {?object} maybeIterable
18018 * @return {?function}
18019 */
18020function getIteratorFn(maybeIterable) {
18021 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
18022 if (typeof iteratorFn === 'function') {
18023 return iteratorFn;
18024 }
18025}
18026
18027module.exports = getIteratorFn;
18028},{}],132:[function(_dereq_,module,exports){
18029/**
18030 * Copyright 2013-present, Facebook, Inc.
18031 * All rights reserved.
18032 *
18033 * This source code is licensed under the BSD-style license found in the
18034 * LICENSE file in the root directory of this source tree. An additional grant
18035 * of patent rights can be found in the PATENTS file in the same directory.
18036 *
18037 * @providesModule getNodeForCharacterOffset
18038 */
18039
18040'use strict';
18041
18042/**
18043 * Given any node return the first leaf node without children.
18044 *
18045 * @param {DOMElement|DOMTextNode} node
18046 * @return {DOMElement|DOMTextNode}
18047 */
18048
18049function getLeafNode(node) {
18050 while (node && node.firstChild) {
18051 node = node.firstChild;
18052 }
18053 return node;
18054}
18055
18056/**
18057 * Get the next sibling within a container. This will walk up the
18058 * DOM if a node's siblings have been exhausted.
18059 *
18060 * @param {DOMElement|DOMTextNode} node
18061 * @return {?DOMElement|DOMTextNode}
18062 */
18063function getSiblingNode(node) {
18064 while (node) {
18065 if (node.nextSibling) {
18066 return node.nextSibling;
18067 }
18068 node = node.parentNode;
18069 }
18070}
18071
18072/**
18073 * Get object describing the nodes which contain characters at offset.
18074 *
18075 * @param {DOMElement|DOMTextNode} root
18076 * @param {number} offset
18077 * @return {?object}
18078 */
18079function getNodeForCharacterOffset(root, offset) {
18080 var node = getLeafNode(root);
18081 var nodeStart = 0;
18082 var nodeEnd = 0;
18083
18084 while (node) {
18085 if (node.nodeType === 3) {
18086 nodeEnd = nodeStart + node.textContent.length;
18087
18088 if (nodeStart <= offset && nodeEnd >= offset) {
18089 return {
18090 node: node,
18091 offset: offset - nodeStart
18092 };
18093 }
18094
18095 nodeStart = nodeEnd;
18096 }
18097
18098 node = getLeafNode(getSiblingNode(node));
18099 }
18100}
18101
18102module.exports = getNodeForCharacterOffset;
18103},{}],133:[function(_dereq_,module,exports){
18104/**
18105 * Copyright 2013-present, Facebook, Inc.
18106 * All rights reserved.
18107 *
18108 * This source code is licensed under the BSD-style license found in the
18109 * LICENSE file in the root directory of this source tree. An additional grant
18110 * of patent rights can be found in the PATENTS file in the same directory.
18111 *
18112 * @providesModule getTextContentAccessor
18113 */
18114
18115'use strict';
18116
18117var ExecutionEnvironment = _dereq_(148);
18118
18119var contentKey = null;
18120
18121/**
18122 * Gets the key used to access text content on a DOM node.
18123 *
18124 * @return {?string} Key used to access text content.
18125 * @internal
18126 */
18127function getTextContentAccessor() {
18128 if (!contentKey && ExecutionEnvironment.canUseDOM) {
18129 // Prefer textContent to innerText because many browsers support both but
18130 // SVG <text> elements don't support innerText even when <div> does.
18131 contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
18132 }
18133 return contentKey;
18134}
18135
18136module.exports = getTextContentAccessor;
18137},{"148":148}],134:[function(_dereq_,module,exports){
18138/**
18139 * Copyright 2013-present, Facebook, Inc.
18140 * All rights reserved.
18141 *
18142 * This source code is licensed under the BSD-style license found in the
18143 * LICENSE file in the root directory of this source tree. An additional grant
18144 * of patent rights can be found in the PATENTS file in the same directory.
18145 *
18146 * @providesModule getVendorPrefixedEventName
18147 */
18148
18149'use strict';
18150
18151var ExecutionEnvironment = _dereq_(148);
18152
18153/**
18154 * Generate a mapping of standard vendor prefixes using the defined style property and event name.
18155 *
18156 * @param {string} styleProp
18157 * @param {string} eventName
18158 * @returns {object}
18159 */
18160function makePrefixMap(styleProp, eventName) {
18161 var prefixes = {};
18162
18163 prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
18164 prefixes['Webkit' + styleProp] = 'webkit' + eventName;
18165 prefixes['Moz' + styleProp] = 'moz' + eventName;
18166 prefixes['ms' + styleProp] = 'MS' + eventName;
18167 prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
18168
18169 return prefixes;
18170}
18171
18172/**
18173 * A list of event names to a configurable list of vendor prefixes.
18174 */
18175var vendorPrefixes = {
18176 animationend: makePrefixMap('Animation', 'AnimationEnd'),
18177 animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
18178 animationstart: makePrefixMap('Animation', 'AnimationStart'),
18179 transitionend: makePrefixMap('Transition', 'TransitionEnd')
18180};
18181
18182/**
18183 * Event names that have already been detected and prefixed (if applicable).
18184 */
18185var prefixedEventNames = {};
18186
18187/**
18188 * Element to check for prefixes on.
18189 */
18190var style = {};
18191
18192/**
18193 * Bootstrap if a DOM exists.
18194 */
18195if (ExecutionEnvironment.canUseDOM) {
18196 style = document.createElement('div').style;
18197
18198 // On some platforms, in particular some releases of Android 4.x,
18199 // the un-prefixed "animation" and "transition" properties are defined on the
18200 // style object but the events that fire will still be prefixed, so we need
18201 // to check if the un-prefixed events are usable, and if not remove them from the map.
18202 if (!('AnimationEvent' in window)) {
18203 delete vendorPrefixes.animationend.animation;
18204 delete vendorPrefixes.animationiteration.animation;
18205 delete vendorPrefixes.animationstart.animation;
18206 }
18207
18208 // Same as above
18209 if (!('TransitionEvent' in window)) {
18210 delete vendorPrefixes.transitionend.transition;
18211 }
18212}
18213
18214/**
18215 * Attempts to determine the correct vendor prefixed event name.
18216 *
18217 * @param {string} eventName
18218 * @returns {string}
18219 */
18220function getVendorPrefixedEventName(eventName) {
18221 if (prefixedEventNames[eventName]) {
18222 return prefixedEventNames[eventName];
18223 } else if (!vendorPrefixes[eventName]) {
18224 return eventName;
18225 }
18226
18227 var prefixMap = vendorPrefixes[eventName];
18228
18229 for (var styleProp in prefixMap) {
18230 if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
18231 return prefixedEventNames[eventName] = prefixMap[styleProp];
18232 }
18233 }
18234
18235 return '';
18236}
18237
18238module.exports = getVendorPrefixedEventName;
18239},{"148":148}],135:[function(_dereq_,module,exports){
18240/**
18241 * Copyright 2013-present, Facebook, Inc.
18242 * All rights reserved.
18243 *
18244 * This source code is licensed under the BSD-style license found in the
18245 * LICENSE file in the root directory of this source tree. An additional grant
18246 * of patent rights can be found in the PATENTS file in the same directory.
18247 *
18248 * @providesModule instantiateReactComponent
18249 */
18250
18251'use strict';
18252
18253var _prodInvariant = _dereq_(140),
18254 _assign = _dereq_(172);
18255
18256var ReactCompositeComponent = _dereq_(36);
18257var ReactEmptyComponent = _dereq_(63);
18258var ReactHostComponent = _dereq_(68);
18259
18260var invariant = _dereq_(162);
18261var warning = _dereq_(171);
18262
18263// To avoid a cyclic dependency, we create the final class in this module
18264var ReactCompositeComponentWrapper = function (element) {
18265 this.construct(element);
18266};
18267_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
18268 _instantiateReactComponent: instantiateReactComponent
18269});
18270
18271function getDeclarationErrorAddendum(owner) {
18272 if (owner) {
18273 var name = owner.getName();
18274 if (name) {
18275 return ' Check the render method of `' + name + '`.';
18276 }
18277 }
18278 return '';
18279}
18280
18281/**
18282 * Check if the type reference is a known internal type. I.e. not a user
18283 * provided composite type.
18284 *
18285 * @param {function} type
18286 * @return {boolean} Returns true if this is a valid internal type.
18287 */
18288function isInternalComponentType(type) {
18289 return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
18290}
18291
18292var nextDebugID = 1;
18293
18294/**
18295 * Given a ReactNode, create an instance that will actually be mounted.
18296 *
18297 * @param {ReactNode} node
18298 * @param {boolean} shouldHaveDebugID
18299 * @return {object} A new instance of the element's constructor.
18300 * @protected
18301 */
18302function instantiateReactComponent(node, shouldHaveDebugID) {
18303 var instance;
18304
18305 if (node === null || node === false) {
18306 instance = ReactEmptyComponent.create(instantiateReactComponent);
18307 } else if (typeof node === 'object') {
18308 var element = node;
18309 !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? "development" !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : _prodInvariant('130', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : void 0;
18310
18311 // Special case string values
18312 if (typeof element.type === 'string') {
18313 instance = ReactHostComponent.createInternalComponent(element);
18314 } else if (isInternalComponentType(element.type)) {
18315 // This is temporarily available for custom components that are not string
18316 // representations. I.e. ART. Once those are updated to use the string
18317 // representation, we can drop this code path.
18318 instance = new element.type(element);
18319
18320 // We renamed this. Allow the old name for compat. :(
18321 if (!instance.getHostNode) {
18322 instance.getHostNode = instance.getNativeNode;
18323 }
18324 } else {
18325 instance = new ReactCompositeComponentWrapper(element);
18326 }
18327 } else if (typeof node === 'string' || typeof node === 'number') {
18328 instance = ReactHostComponent.createInstanceForText(node);
18329 } else {
18330 !false ? "development" !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0;
18331 }
18332
18333 if ("development" !== 'production') {
18334 "development" !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
18335 }
18336
18337 // These two fields are used by the DOM and ART diffing algorithms
18338 // respectively. Instead of using expandos on components, we should be
18339 // storing the state needed by the diffing algorithms elsewhere.
18340 instance._mountIndex = 0;
18341 instance._mountImage = null;
18342
18343 if ("development" !== 'production') {
18344 instance._debugID = shouldHaveDebugID ? nextDebugID++ : 0;
18345 }
18346
18347 // Internal instances should fully constructed at this point, so they should
18348 // not get any new fields added to them at this point.
18349 if ("development" !== 'production') {
18350 if (Object.preventExtensions) {
18351 Object.preventExtensions(instance);
18352 }
18353 }
18354
18355 return instance;
18356}
18357
18358module.exports = instantiateReactComponent;
18359},{"140":140,"162":162,"171":171,"172":172,"36":36,"63":63,"68":68}],136:[function(_dereq_,module,exports){
18360/**
18361 * Copyright 2013-present, Facebook, Inc.
18362 * All rights reserved.
18363 *
18364 * This source code is licensed under the BSD-style license found in the
18365 * LICENSE file in the root directory of this source tree. An additional grant
18366 * of patent rights can be found in the PATENTS file in the same directory.
18367 *
18368 * @providesModule isEventSupported
18369 */
18370
18371'use strict';
18372
18373var ExecutionEnvironment = _dereq_(148);
18374
18375var useHasFeature;
18376if (ExecutionEnvironment.canUseDOM) {
18377 useHasFeature = document.implementation && document.implementation.hasFeature &&
18378 // always returns true in newer browsers as per the standard.
18379 // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
18380 document.implementation.hasFeature('', '') !== true;
18381}
18382
18383/**
18384 * Checks if an event is supported in the current execution environment.
18385 *
18386 * NOTE: This will not work correctly for non-generic events such as `change`,
18387 * `reset`, `load`, `error`, and `select`.
18388 *
18389 * Borrows from Modernizr.
18390 *
18391 * @param {string} eventNameSuffix Event name, e.g. "click".
18392 * @param {?boolean} capture Check if the capture phase is supported.
18393 * @return {boolean} True if the event is supported.
18394 * @internal
18395 * @license Modernizr 3.0.0pre (Custom Build) | MIT
18396 */
18397function isEventSupported(eventNameSuffix, capture) {
18398 if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
18399 return false;
18400 }
18401
18402 var eventName = 'on' + eventNameSuffix;
18403 var isSupported = eventName in document;
18404
18405 if (!isSupported) {
18406 var element = document.createElement('div');
18407 element.setAttribute(eventName, 'return;');
18408 isSupported = typeof element[eventName] === 'function';
18409 }
18410
18411 if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
18412 // This is the only way to test support for the `wheel` event in IE9+.
18413 isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
18414 }
18415
18416 return isSupported;
18417}
18418
18419module.exports = isEventSupported;
18420},{"148":148}],137:[function(_dereq_,module,exports){
18421/**
18422 * Copyright 2013-present, Facebook, Inc.
18423 * All rights reserved.
18424 *
18425 * This source code is licensed under the BSD-style license found in the
18426 * LICENSE file in the root directory of this source tree. An additional grant
18427 * of patent rights can be found in the PATENTS file in the same directory.
18428 *
18429 * @providesModule isTextInputElement
18430 *
18431 */
18432
18433'use strict';
18434
18435/**
18436 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
18437 */
18438
18439var supportedInputTypes = {
18440 'color': true,
18441 'date': true,
18442 'datetime': true,
18443 'datetime-local': true,
18444 'email': true,
18445 'month': true,
18446 'number': true,
18447 'password': true,
18448 'range': true,
18449 'search': true,
18450 'tel': true,
18451 'text': true,
18452 'time': true,
18453 'url': true,
18454 'week': true
18455};
18456
18457function isTextInputElement(elem) {
18458 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
18459
18460 if (nodeName === 'input') {
18461 return !!supportedInputTypes[elem.type];
18462 }
18463
18464 if (nodeName === 'textarea') {
18465 return true;
18466 }
18467
18468 return false;
18469}
18470
18471module.exports = isTextInputElement;
18472},{}],138:[function(_dereq_,module,exports){
18473/**
18474 * Copyright 2013-present, Facebook, Inc.
18475 * All rights reserved.
18476 *
18477 * This source code is licensed under the BSD-style license found in the
18478 * LICENSE file in the root directory of this source tree. An additional grant
18479 * of patent rights can be found in the PATENTS file in the same directory.
18480 *
18481 * @providesModule onlyChild
18482 */
18483'use strict';
18484
18485var _prodInvariant = _dereq_(140);
18486
18487var ReactElement = _dereq_(61);
18488
18489var invariant = _dereq_(162);
18490
18491/**
18492 * Returns the first child in a collection of children and verifies that there
18493 * is only one child in the collection.
18494 *
18495 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
18496 *
18497 * The current implementation of this function assumes that a single child gets
18498 * passed without a wrapper, but the purpose of this helper function is to
18499 * abstract away the particular structure of children.
18500 *
18501 * @param {?object} children Child collection structure.
18502 * @return {ReactElement} The first and only `ReactElement` contained in the
18503 * structure.
18504 */
18505function onlyChild(children) {
18506 !ReactElement.isValidElement(children) ? "development" !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
18507 return children;
18508}
18509
18510module.exports = onlyChild;
18511},{"140":140,"162":162,"61":61}],139:[function(_dereq_,module,exports){
18512/**
18513 * Copyright 2013-present, Facebook, Inc.
18514 * All rights reserved.
18515 *
18516 * This source code is licensed under the BSD-style license found in the
18517 * LICENSE file in the root directory of this source tree. An additional grant
18518 * of patent rights can be found in the PATENTS file in the same directory.
18519 *
18520 * @providesModule quoteAttributeValueForBrowser
18521 */
18522
18523'use strict';
18524
18525var escapeTextContentForBrowser = _dereq_(122);
18526
18527/**
18528 * Escapes attribute value to prevent scripting attacks.
18529 *
18530 * @param {*} value Value to escape.
18531 * @return {string} An escaped string.
18532 */
18533function quoteAttributeValueForBrowser(value) {
18534 return '"' + escapeTextContentForBrowser(value) + '"';
18535}
18536
18537module.exports = quoteAttributeValueForBrowser;
18538},{"122":122}],140:[function(_dereq_,module,exports){
18539/**
18540 * Copyright (c) 2013-present, Facebook, Inc.
18541 * All rights reserved.
18542 *
18543 * This source code is licensed under the BSD-style license found in the
18544 * LICENSE file in the root directory of this source tree. An additional grant
18545 * of patent rights can be found in the PATENTS file in the same directory.
18546 *
18547 * @providesModule reactProdInvariant
18548 *
18549 */
18550'use strict';
18551
18552/**
18553 * WARNING: DO NOT manually require this module.
18554 * This is a replacement for `invariant(...)` used by the error code system
18555 * and will _only_ be required by the corresponding babel pass.
18556 * It always throws.
18557 */
18558
18559function reactProdInvariant(code) {
18560 var argCount = arguments.length - 1;
18561
18562 var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
18563
18564 for (var argIdx = 0; argIdx < argCount; argIdx++) {
18565 message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
18566 }
18567
18568 message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
18569
18570 var error = new Error(message);
18571 error.name = 'Invariant Violation';
18572 error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
18573
18574 throw error;
18575}
18576
18577module.exports = reactProdInvariant;
18578},{}],141:[function(_dereq_,module,exports){
18579/**
18580 * Copyright 2013-present, Facebook, Inc.
18581 * All rights reserved.
18582 *
18583 * This source code is licensed under the BSD-style license found in the
18584 * LICENSE file in the root directory of this source tree. An additional grant
18585 * of patent rights can be found in the PATENTS file in the same directory.
18586 *
18587* @providesModule renderSubtreeIntoContainer
18588*/
18589
18590'use strict';
18591
18592var ReactMount = _dereq_(76);
18593
18594module.exports = ReactMount.renderSubtreeIntoContainer;
18595},{"76":76}],142:[function(_dereq_,module,exports){
18596/**
18597 * Copyright 2013-present, Facebook, Inc.
18598 * All rights reserved.
18599 *
18600 * This source code is licensed under the BSD-style license found in the
18601 * LICENSE file in the root directory of this source tree. An additional grant
18602 * of patent rights can be found in the PATENTS file in the same directory.
18603 *
18604 * @providesModule setInnerHTML
18605 */
18606
18607'use strict';
18608
18609var ExecutionEnvironment = _dereq_(148);
18610var DOMNamespaces = _dereq_(9);
18611
18612var WHITESPACE_TEST = /^[ \r\n\t\f]/;
18613var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
18614
18615var createMicrosoftUnsafeLocalFunction = _dereq_(120);
18616
18617// SVG temp container for IE lacking innerHTML
18618var reusableSVGContainer;
18619
18620/**
18621 * Set the innerHTML property of a node, ensuring that whitespace is preserved
18622 * even in IE8.
18623 *
18624 * @param {DOMElement} node
18625 * @param {string} html
18626 * @internal
18627 */
18628var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
18629 // IE does not have innerHTML for SVG nodes, so instead we inject the
18630 // new markup in a temp node and then move the child nodes across into
18631 // the target node
18632 if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {
18633 reusableSVGContainer = reusableSVGContainer || document.createElement('div');
18634 reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
18635 var svgNode = reusableSVGContainer.firstChild;
18636 while (svgNode.firstChild) {
18637 node.appendChild(svgNode.firstChild);
18638 }
18639 } else {
18640 node.innerHTML = html;
18641 }
18642});
18643
18644if (ExecutionEnvironment.canUseDOM) {
18645 // IE8: When updating a just created node with innerHTML only leading
18646 // whitespace is removed. When updating an existing node with innerHTML
18647 // whitespace in root TextNodes is also collapsed.
18648 // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
18649
18650 // Feature detection; only IE8 is known to behave improperly like this.
18651 var testElement = document.createElement('div');
18652 testElement.innerHTML = ' ';
18653 if (testElement.innerHTML === '') {
18654 setInnerHTML = function (node, html) {
18655 // Magic theory: IE8 supposedly differentiates between added and updated
18656 // nodes when processing innerHTML, innerHTML on updated nodes suffers
18657 // from worse whitespace behavior. Re-adding a node like this triggers
18658 // the initial and more favorable whitespace behavior.
18659 // TODO: What to do on a detached node?
18660 if (node.parentNode) {
18661 node.parentNode.replaceChild(node, node);
18662 }
18663
18664 // We also implement a workaround for non-visible tags disappearing into
18665 // thin air on IE8, this only happens if there is no visible text
18666 // in-front of the non-visible tags. Piggyback on the whitespace fix
18667 // and simply check if any non-visible tags appear in the source.
18668 if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
18669 // Recover leading whitespace by temporarily prepending any character.
18670 // \uFEFF has the potential advantage of being zero-width/invisible.
18671 // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
18672 // in hopes that this is preserved even if "\uFEFF" is transformed to
18673 // the actual Unicode character (by Babel, for example).
18674 // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
18675 node.innerHTML = String.fromCharCode(0xFEFF) + html;
18676
18677 // deleteData leaves an empty `TextNode` which offsets the index of all
18678 // children. Definitely want to avoid this.
18679 var textNode = node.firstChild;
18680 if (textNode.data.length === 1) {
18681 node.removeChild(textNode);
18682 } else {
18683 textNode.deleteData(0, 1);
18684 }
18685 } else {
18686 node.innerHTML = html;
18687 }
18688 };
18689 }
18690 testElement = null;
18691}
18692
18693module.exports = setInnerHTML;
18694},{"120":120,"148":148,"9":9}],143:[function(_dereq_,module,exports){
18695/**
18696 * Copyright 2013-present, Facebook, Inc.
18697 * All rights reserved.
18698 *
18699 * This source code is licensed under the BSD-style license found in the
18700 * LICENSE file in the root directory of this source tree. An additional grant
18701 * of patent rights can be found in the PATENTS file in the same directory.
18702 *
18703 * @providesModule setTextContent
18704 */
18705
18706'use strict';
18707
18708var ExecutionEnvironment = _dereq_(148);
18709var escapeTextContentForBrowser = _dereq_(122);
18710var setInnerHTML = _dereq_(142);
18711
18712/**
18713 * Set the textContent property of a node, ensuring that whitespace is preserved
18714 * even in IE8. innerText is a poor substitute for textContent and, among many
18715 * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
18716 * as it should.
18717 *
18718 * @param {DOMElement} node
18719 * @param {string} text
18720 * @internal
18721 */
18722var setTextContent = function (node, text) {
18723 if (text) {
18724 var firstChild = node.firstChild;
18725
18726 if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) {
18727 firstChild.nodeValue = text;
18728 return;
18729 }
18730 }
18731 node.textContent = text;
18732};
18733
18734if (ExecutionEnvironment.canUseDOM) {
18735 if (!('textContent' in document.documentElement)) {
18736 setTextContent = function (node, text) {
18737 setInnerHTML(node, escapeTextContentForBrowser(text));
18738 };
18739 }
18740}
18741
18742module.exports = setTextContent;
18743},{"122":122,"142":142,"148":148}],144:[function(_dereq_,module,exports){
18744/**
18745 * Copyright 2013-present, Facebook, Inc.
18746 * All rights reserved.
18747 *
18748 * This source code is licensed under the BSD-style license found in the
18749 * LICENSE file in the root directory of this source tree. An additional grant
18750 * of patent rights can be found in the PATENTS file in the same directory.
18751 *
18752 * @providesModule shouldUpdateReactComponent
18753 */
18754
18755'use strict';
18756
18757/**
18758 * Given a `prevElement` and `nextElement`, determines if the existing
18759 * instance should be updated as opposed to being destroyed or replaced by a new
18760 * instance. Both arguments are elements. This ensures that this logic can
18761 * operate on stateless trees without any backing instance.
18762 *
18763 * @param {?object} prevElement
18764 * @param {?object} nextElement
18765 * @return {boolean} True if the existing instance should be updated.
18766 * @protected
18767 */
18768
18769function shouldUpdateReactComponent(prevElement, nextElement) {
18770 var prevEmpty = prevElement === null || prevElement === false;
18771 var nextEmpty = nextElement === null || nextElement === false;
18772 if (prevEmpty || nextEmpty) {
18773 return prevEmpty === nextEmpty;
18774 }
18775
18776 var prevType = typeof prevElement;
18777 var nextType = typeof nextElement;
18778 if (prevType === 'string' || prevType === 'number') {
18779 return nextType === 'string' || nextType === 'number';
18780 } else {
18781 return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
18782 }
18783}
18784
18785module.exports = shouldUpdateReactComponent;
18786},{}],145:[function(_dereq_,module,exports){
18787/**
18788 * Copyright 2013-present, Facebook, Inc.
18789 * All rights reserved.
18790 *
18791 * This source code is licensed under the BSD-style license found in the
18792 * LICENSE file in the root directory of this source tree. An additional grant
18793 * of patent rights can be found in the PATENTS file in the same directory.
18794 *
18795 * @providesModule traverseAllChildren
18796 */
18797
18798'use strict';
18799
18800var _prodInvariant = _dereq_(140);
18801
18802var ReactCurrentOwner = _dereq_(37);
18803var ReactElement = _dereq_(61);
18804
18805var getIteratorFn = _dereq_(131);
18806var invariant = _dereq_(162);
18807var KeyEscapeUtils = _dereq_(23);
18808var warning = _dereq_(171);
18809
18810var SEPARATOR = '.';
18811var SUBSEPARATOR = ':';
18812
18813/**
18814 * TODO: Test that a single child and an array with one item have the same key
18815 * pattern.
18816 */
18817
18818var didWarnAboutMaps = false;
18819
18820/**
18821 * Generate a key string that identifies a component within a set.
18822 *
18823 * @param {*} component A component that could contain a manual key.
18824 * @param {number} index Index that is used if a manual key is not provided.
18825 * @return {string}
18826 */
18827function getComponentKey(component, index) {
18828 // Do some typechecking here since we call this blindly. We want to ensure
18829 // that we don't block potential future ES APIs.
18830 if (component && typeof component === 'object' && component.key != null) {
18831 // Explicit key
18832 return KeyEscapeUtils.escape(component.key);
18833 }
18834 // Implicit key determined by the index in the set
18835 return index.toString(36);
18836}
18837
18838/**
18839 * @param {?*} children Children tree container.
18840 * @param {!string} nameSoFar Name of the key path so far.
18841 * @param {!function} callback Callback to invoke with each child found.
18842 * @param {?*} traverseContext Used to pass information throughout the traversal
18843 * process.
18844 * @return {!number} The number of children in this subtree.
18845 */
18846function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
18847 var type = typeof children;
18848
18849 if (type === 'undefined' || type === 'boolean') {
18850 // All of the above are perceived as null.
18851 children = null;
18852 }
18853
18854 if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
18855 callback(traverseContext, children,
18856 // If it's the only child, treat the name as if it was wrapped in an array
18857 // so that it's consistent if the number of children grows.
18858 nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
18859 return 1;
18860 }
18861
18862 var child;
18863 var nextName;
18864 var subtreeCount = 0; // Count of children found in the current subtree.
18865 var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
18866
18867 if (Array.isArray(children)) {
18868 for (var i = 0; i < children.length; i++) {
18869 child = children[i];
18870 nextName = nextNamePrefix + getComponentKey(child, i);
18871 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
18872 }
18873 } else {
18874 var iteratorFn = getIteratorFn(children);
18875 if (iteratorFn) {
18876 var iterator = iteratorFn.call(children);
18877 var step;
18878 if (iteratorFn !== children.entries) {
18879 var ii = 0;
18880 while (!(step = iterator.next()).done) {
18881 child = step.value;
18882 nextName = nextNamePrefix + getComponentKey(child, ii++);
18883 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
18884 }
18885 } else {
18886 if ("development" !== 'production') {
18887 var mapsAsChildrenAddendum = '';
18888 if (ReactCurrentOwner.current) {
18889 var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
18890 if (mapsAsChildrenOwnerName) {
18891 mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
18892 }
18893 }
18894 "development" !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0;
18895 didWarnAboutMaps = true;
18896 }
18897 // Iterator will provide entry [k,v] tuples rather than values.
18898 while (!(step = iterator.next()).done) {
18899 var entry = step.value;
18900 if (entry) {
18901 child = entry[1];
18902 nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
18903 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
18904 }
18905 }
18906 }
18907 } else if (type === 'object') {
18908 var addendum = '';
18909 if ("development" !== 'production') {
18910 addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
18911 if (children._isReactElement) {
18912 addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
18913 }
18914 if (ReactCurrentOwner.current) {
18915 var name = ReactCurrentOwner.current.getName();
18916 if (name) {
18917 addendum += ' Check the render method of `' + name + '`.';
18918 }
18919 }
18920 }
18921 var childrenString = String(children);
18922 !false ? "development" !== 'production' ? 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) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
18923 }
18924 }
18925
18926 return subtreeCount;
18927}
18928
18929/**
18930 * Traverses children that are typically specified as `props.children`, but
18931 * might also be specified through attributes:
18932 *
18933 * - `traverseAllChildren(this.props.children, ...)`
18934 * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
18935 *
18936 * The `traverseContext` is an optional argument that is passed through the
18937 * entire traversal. It can be used to store accumulations or anything else that
18938 * the callback might find relevant.
18939 *
18940 * @param {?*} children Children tree object.
18941 * @param {!function} callback To invoke upon traversing each child.
18942 * @param {?*} traverseContext Context for traversal.
18943 * @return {!number} The number of children in this subtree.
18944 */
18945function traverseAllChildren(children, callback, traverseContext) {
18946 if (children == null) {
18947 return 0;
18948 }
18949
18950 return traverseAllChildrenImpl(children, '', callback, traverseContext);
18951}
18952
18953module.exports = traverseAllChildren;
18954},{"131":131,"140":140,"162":162,"171":171,"23":23,"37":37,"61":61}],146:[function(_dereq_,module,exports){
18955/**
18956 * Copyright 2015-present, Facebook, Inc.
18957 * All rights reserved.
18958 *
18959 * This source code is licensed under the BSD-style license found in the
18960 * LICENSE file in the root directory of this source tree. An additional grant
18961 * of patent rights can be found in the PATENTS file in the same directory.
18962 *
18963 * @providesModule validateDOMNesting
18964 */
18965
18966'use strict';
18967
18968var _assign = _dereq_(172);
18969
18970var emptyFunction = _dereq_(154);
18971var warning = _dereq_(171);
18972
18973var validateDOMNesting = emptyFunction;
18974
18975if ("development" !== 'production') {
18976 // This validation code was written based on the HTML5 parsing spec:
18977 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
18978 //
18979 // Note: this does not catch all invalid nesting, nor does it try to (as it's
18980 // not clear what practical benefit doing so provides); instead, we warn only
18981 // for cases where the parser will give a parse tree differing from what React
18982 // intended. For example, <b><div></div></b> is invalid but we don't warn
18983 // because it still parses correctly; we do warn for other cases like nested
18984 // <p> tags where the beginning of the second element implicitly closes the
18985 // first, causing a confusing mess.
18986
18987 // https://html.spec.whatwg.org/multipage/syntax.html#special
18988 var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
18989
18990 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
18991 var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
18992
18993 // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
18994 // TODO: Distinguish by namespace here -- for <title>, including it here
18995 // errs on the side of fewer warnings
18996 'foreignObject', 'desc', 'title'];
18997
18998 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
18999 var buttonScopeTags = inScopeTags.concat(['button']);
19000
19001 // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
19002 var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
19003
19004 var emptyAncestorInfo = {
19005 current: null,
19006
19007 formTag: null,
19008 aTagInScope: null,
19009 buttonTagInScope: null,
19010 nobrTagInScope: null,
19011 pTagInButtonScope: null,
19012
19013 listItemTagAutoclosing: null,
19014 dlItemTagAutoclosing: null
19015 };
19016
19017 var updatedAncestorInfo = function (oldInfo, tag, instance) {
19018 var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
19019 var info = { tag: tag, instance: instance };
19020
19021 if (inScopeTags.indexOf(tag) !== -1) {
19022 ancestorInfo.aTagInScope = null;
19023 ancestorInfo.buttonTagInScope = null;
19024 ancestorInfo.nobrTagInScope = null;
19025 }
19026 if (buttonScopeTags.indexOf(tag) !== -1) {
19027 ancestorInfo.pTagInButtonScope = null;
19028 }
19029
19030 // See rules for 'li', 'dd', 'dt' start tags in
19031 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
19032 if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
19033 ancestorInfo.listItemTagAutoclosing = null;
19034 ancestorInfo.dlItemTagAutoclosing = null;
19035 }
19036
19037 ancestorInfo.current = info;
19038
19039 if (tag === 'form') {
19040 ancestorInfo.formTag = info;
19041 }
19042 if (tag === 'a') {
19043 ancestorInfo.aTagInScope = info;
19044 }
19045 if (tag === 'button') {
19046 ancestorInfo.buttonTagInScope = info;
19047 }
19048 if (tag === 'nobr') {
19049 ancestorInfo.nobrTagInScope = info;
19050 }
19051 if (tag === 'p') {
19052 ancestorInfo.pTagInButtonScope = info;
19053 }
19054 if (tag === 'li') {
19055 ancestorInfo.listItemTagAutoclosing = info;
19056 }
19057 if (tag === 'dd' || tag === 'dt') {
19058 ancestorInfo.dlItemTagAutoclosing = info;
19059 }
19060
19061 return ancestorInfo;
19062 };
19063
19064 /**
19065 * Returns whether
19066 */
19067 var isTagValidWithParent = function (tag, parentTag) {
19068 // First, let's check if we're in an unusual parsing mode...
19069 switch (parentTag) {
19070 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
19071 case 'select':
19072 return tag === 'option' || tag === 'optgroup' || tag === '#text';
19073 case 'optgroup':
19074 return tag === 'option' || tag === '#text';
19075 // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
19076 // but
19077 case 'option':
19078 return tag === '#text';
19079
19080 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
19081 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
19082 // No special behavior since these rules fall back to "in body" mode for
19083 // all except special table nodes which cause bad parsing behavior anyway.
19084
19085 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
19086 case 'tr':
19087 return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
19088
19089 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
19090 case 'tbody':
19091 case 'thead':
19092 case 'tfoot':
19093 return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
19094
19095 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
19096 case 'colgroup':
19097 return tag === 'col' || tag === 'template';
19098
19099 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
19100 case 'table':
19101 return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
19102
19103 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
19104 case 'head':
19105 return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
19106
19107 // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
19108 case 'html':
19109 return tag === 'head' || tag === 'body';
19110 case '#document':
19111 return tag === 'html';
19112 }
19113
19114 // Probably in the "in body" parsing mode, so we outlaw only tag combos
19115 // where the parsing rules cause implicit opens or closes to be added.
19116 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
19117 switch (tag) {
19118 case 'h1':
19119 case 'h2':
19120 case 'h3':
19121 case 'h4':
19122 case 'h5':
19123 case 'h6':
19124 return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
19125
19126 case 'rp':
19127 case 'rt':
19128 return impliedEndTags.indexOf(parentTag) === -1;
19129
19130 case 'body':
19131 case 'caption':
19132 case 'col':
19133 case 'colgroup':
19134 case 'frame':
19135 case 'head':
19136 case 'html':
19137 case 'tbody':
19138 case 'td':
19139 case 'tfoot':
19140 case 'th':
19141 case 'thead':
19142 case 'tr':
19143 // These tags are only valid with a few parents that have special child
19144 // parsing rules -- if we're down here, then none of those matched and
19145 // so we allow it only if we don't know what the parent is, as all other
19146 // cases are invalid.
19147 return parentTag == null;
19148 }
19149
19150 return true;
19151 };
19152
19153 /**
19154 * Returns whether
19155 */
19156 var findInvalidAncestorForTag = function (tag, ancestorInfo) {
19157 switch (tag) {
19158 case 'address':
19159 case 'article':
19160 case 'aside':
19161 case 'blockquote':
19162 case 'center':
19163 case 'details':
19164 case 'dialog':
19165 case 'dir':
19166 case 'div':
19167 case 'dl':
19168 case 'fieldset':
19169 case 'figcaption':
19170 case 'figure':
19171 case 'footer':
19172 case 'header':
19173 case 'hgroup':
19174 case 'main':
19175 case 'menu':
19176 case 'nav':
19177 case 'ol':
19178 case 'p':
19179 case 'section':
19180 case 'summary':
19181 case 'ul':
19182
19183 case 'pre':
19184 case 'listing':
19185
19186 case 'table':
19187
19188 case 'hr':
19189
19190 case 'xmp':
19191
19192 case 'h1':
19193 case 'h2':
19194 case 'h3':
19195 case 'h4':
19196 case 'h5':
19197 case 'h6':
19198 return ancestorInfo.pTagInButtonScope;
19199
19200 case 'form':
19201 return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
19202
19203 case 'li':
19204 return ancestorInfo.listItemTagAutoclosing;
19205
19206 case 'dd':
19207 case 'dt':
19208 return ancestorInfo.dlItemTagAutoclosing;
19209
19210 case 'button':
19211 return ancestorInfo.buttonTagInScope;
19212
19213 case 'a':
19214 // Spec says something about storing a list of markers, but it sounds
19215 // equivalent to this check.
19216 return ancestorInfo.aTagInScope;
19217
19218 case 'nobr':
19219 return ancestorInfo.nobrTagInScope;
19220 }
19221
19222 return null;
19223 };
19224
19225 /**
19226 * Given a ReactCompositeComponent instance, return a list of its recursive
19227 * owners, starting at the root and ending with the instance itself.
19228 */
19229 var findOwnerStack = function (instance) {
19230 if (!instance) {
19231 return [];
19232 }
19233
19234 var stack = [];
19235 do {
19236 stack.push(instance);
19237 } while (instance = instance._currentElement._owner);
19238 stack.reverse();
19239 return stack;
19240 };
19241
19242 var didWarn = {};
19243
19244 validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) {
19245 ancestorInfo = ancestorInfo || emptyAncestorInfo;
19246 var parentInfo = ancestorInfo.current;
19247 var parentTag = parentInfo && parentInfo.tag;
19248
19249 if (childText != null) {
19250 "development" !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
19251 childTag = '#text';
19252 }
19253
19254 var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
19255 var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
19256 var problematic = invalidParent || invalidAncestor;
19257
19258 if (problematic) {
19259 var ancestorTag = problematic.tag;
19260 var ancestorInstance = problematic.instance;
19261
19262 var childOwner = childInstance && childInstance._currentElement._owner;
19263 var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
19264
19265 var childOwners = findOwnerStack(childOwner);
19266 var ancestorOwners = findOwnerStack(ancestorOwner);
19267
19268 var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
19269 var i;
19270
19271 var deepestCommon = -1;
19272 for (i = 0; i < minStackLen; i++) {
19273 if (childOwners[i] === ancestorOwners[i]) {
19274 deepestCommon = i;
19275 } else {
19276 break;
19277 }
19278 }
19279
19280 var UNKNOWN = '(unknown)';
19281 var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
19282 return inst.getName() || UNKNOWN;
19283 });
19284 var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
19285 return inst.getName() || UNKNOWN;
19286 });
19287 var ownerInfo = [].concat(
19288 // If the parent and child instances have a common owner ancestor, start
19289 // with that -- otherwise we just start with the parent's owners.
19290 deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
19291 // If we're warning about an invalid (non-parent) ancestry, add '...'
19292 invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
19293
19294 var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
19295 if (didWarn[warnKey]) {
19296 return;
19297 }
19298 didWarn[warnKey] = true;
19299
19300 var tagDisplayName = childTag;
19301 var whitespaceInfo = '';
19302 if (childTag === '#text') {
19303 if (/\S/.test(childText)) {
19304 tagDisplayName = 'Text nodes';
19305 } else {
19306 tagDisplayName = 'Whitespace text nodes';
19307 whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.';
19308 }
19309 } else {
19310 tagDisplayName = '<' + childTag + '>';
19311 }
19312
19313 if (invalidParent) {
19314 var info = '';
19315 if (ancestorTag === 'table' && childTag === 'tr') {
19316 info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
19317 }
19318 "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0;
19319 } else {
19320 "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
19321 }
19322 }
19323 };
19324
19325 validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
19326
19327 // For testing
19328 validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
19329 ancestorInfo = ancestorInfo || emptyAncestorInfo;
19330 var parentInfo = ancestorInfo.current;
19331 var parentTag = parentInfo && parentInfo.tag;
19332 return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
19333 };
19334}
19335
19336module.exports = validateDOMNesting;
19337},{"154":154,"171":171,"172":172}],147:[function(_dereq_,module,exports){
19338'use strict';
19339
19340/**
19341 * Copyright (c) 2013-present, Facebook, Inc.
19342 *
19343 * Licensed under the Apache License, Version 2.0 (the "License");
19344 * you may not use this file except in compliance with the License.
19345 * You may obtain a copy of the License at
19346 *
19347 * http://www.apache.org/licenses/LICENSE-2.0
19348 *
19349 * Unless required by applicable law or agreed to in writing, software
19350 * distributed under the License is distributed on an "AS IS" BASIS,
19351 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19352 * See the License for the specific language governing permissions and
19353 * limitations under the License.
19354 *
19355 * @typechecks
19356 */
19357
19358var emptyFunction = _dereq_(154);
19359
19360/**
19361 * Upstream version of event listener. Does not take into account specific
19362 * nature of platform.
19363 */
19364var EventListener = {
19365 /**
19366 * Listen to DOM events during the bubble phase.
19367 *
19368 * @param {DOMEventTarget} target DOM element to register listener on.
19369 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
19370 * @param {function} callback Callback function.
19371 * @return {object} Object with a `remove` method.
19372 */
19373 listen: function listen(target, eventType, callback) {
19374 if (target.addEventListener) {
19375 target.addEventListener(eventType, callback, false);
19376 return {
19377 remove: function remove() {
19378 target.removeEventListener(eventType, callback, false);
19379 }
19380 };
19381 } else if (target.attachEvent) {
19382 target.attachEvent('on' + eventType, callback);
19383 return {
19384 remove: function remove() {
19385 target.detachEvent('on' + eventType, callback);
19386 }
19387 };
19388 }
19389 },
19390
19391 /**
19392 * Listen to DOM events during the capture phase.
19393 *
19394 * @param {DOMEventTarget} target DOM element to register listener on.
19395 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
19396 * @param {function} callback Callback function.
19397 * @return {object} Object with a `remove` method.
19398 */
19399 capture: function capture(target, eventType, callback) {
19400 if (target.addEventListener) {
19401 target.addEventListener(eventType, callback, true);
19402 return {
19403 remove: function remove() {
19404 target.removeEventListener(eventType, callback, true);
19405 }
19406 };
19407 } else {
19408 if ("development" !== 'production') {
19409 console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
19410 }
19411 return {
19412 remove: emptyFunction
19413 };
19414 }
19415 },
19416
19417 registerDefault: function registerDefault() {}
19418};
19419
19420module.exports = EventListener;
19421},{"154":154}],148:[function(_dereq_,module,exports){
19422/**
19423 * Copyright (c) 2013-present, Facebook, Inc.
19424 * All rights reserved.
19425 *
19426 * This source code is licensed under the BSD-style license found in the
19427 * LICENSE file in the root directory of this source tree. An additional grant
19428 * of patent rights can be found in the PATENTS file in the same directory.
19429 *
19430 */
19431
19432'use strict';
19433
19434var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
19435
19436/**
19437 * Simple, lightweight module assisting with the detection and context of
19438 * Worker. Helps avoid circular dependencies and allows code to reason about
19439 * whether or not they are in a Worker, even if they never include the main
19440 * `ReactWorker` dependency.
19441 */
19442var ExecutionEnvironment = {
19443
19444 canUseDOM: canUseDOM,
19445
19446 canUseWorkers: typeof Worker !== 'undefined',
19447
19448 canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
19449
19450 canUseViewport: canUseDOM && !!window.screen,
19451
19452 isInWorker: !canUseDOM // For now, this is true - might change in the future.
19453
19454};
19455
19456module.exports = ExecutionEnvironment;
19457},{}],149:[function(_dereq_,module,exports){
19458"use strict";
19459
19460/**
19461 * Copyright (c) 2013-present, Facebook, Inc.
19462 * All rights reserved.
19463 *
19464 * This source code is licensed under the BSD-style license found in the
19465 * LICENSE file in the root directory of this source tree. An additional grant
19466 * of patent rights can be found in the PATENTS file in the same directory.
19467 *
19468 * @typechecks
19469 */
19470
19471var _hyphenPattern = /-(.)/g;
19472
19473/**
19474 * Camelcases a hyphenated string, for example:
19475 *
19476 * > camelize('background-color')
19477 * < "backgroundColor"
19478 *
19479 * @param {string} string
19480 * @return {string}
19481 */
19482function camelize(string) {
19483 return string.replace(_hyphenPattern, function (_, character) {
19484 return character.toUpperCase();
19485 });
19486}
19487
19488module.exports = camelize;
19489},{}],150:[function(_dereq_,module,exports){
19490/**
19491 * Copyright (c) 2013-present, Facebook, Inc.
19492 * All rights reserved.
19493 *
19494 * This source code is licensed under the BSD-style license found in the
19495 * LICENSE file in the root directory of this source tree. An additional grant
19496 * of patent rights can be found in the PATENTS file in the same directory.
19497 *
19498 * @typechecks
19499 */
19500
19501'use strict';
19502
19503var camelize = _dereq_(149);
19504
19505var msPattern = /^-ms-/;
19506
19507/**
19508 * Camelcases a hyphenated CSS property name, for example:
19509 *
19510 * > camelizeStyleName('background-color')
19511 * < "backgroundColor"
19512 * > camelizeStyleName('-moz-transition')
19513 * < "MozTransition"
19514 * > camelizeStyleName('-ms-transition')
19515 * < "msTransition"
19516 *
19517 * As Andi Smith suggests
19518 * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
19519 * is converted to lowercase `ms`.
19520 *
19521 * @param {string} string
19522 * @return {string}
19523 */
19524function camelizeStyleName(string) {
19525 return camelize(string.replace(msPattern, 'ms-'));
19526}
19527
19528module.exports = camelizeStyleName;
19529},{"149":149}],151:[function(_dereq_,module,exports){
19530'use strict';
19531
19532/**
19533 * Copyright (c) 2013-present, Facebook, Inc.
19534 * All rights reserved.
19535 *
19536 * This source code is licensed under the BSD-style license found in the
19537 * LICENSE file in the root directory of this source tree. An additional grant
19538 * of patent rights can be found in the PATENTS file in the same directory.
19539 *
19540 *
19541 */
19542
19543var isTextNode = _dereq_(164);
19544
19545/*eslint-disable no-bitwise */
19546
19547/**
19548 * Checks if a given DOM node contains or is another DOM node.
19549 */
19550function containsNode(outerNode, innerNode) {
19551 if (!outerNode || !innerNode) {
19552 return false;
19553 } else if (outerNode === innerNode) {
19554 return true;
19555 } else if (isTextNode(outerNode)) {
19556 return false;
19557 } else if (isTextNode(innerNode)) {
19558 return containsNode(outerNode, innerNode.parentNode);
19559 } else if ('contains' in outerNode) {
19560 return outerNode.contains(innerNode);
19561 } else if (outerNode.compareDocumentPosition) {
19562 return !!(outerNode.compareDocumentPosition(innerNode) & 16);
19563 } else {
19564 return false;
19565 }
19566}
19567
19568module.exports = containsNode;
19569},{"164":164}],152:[function(_dereq_,module,exports){
19570'use strict';
19571
19572/**
19573 * Copyright (c) 2013-present, Facebook, Inc.
19574 * All rights reserved.
19575 *
19576 * This source code is licensed under the BSD-style license found in the
19577 * LICENSE file in the root directory of this source tree. An additional grant
19578 * of patent rights can be found in the PATENTS file in the same directory.
19579 *
19580 * @typechecks
19581 */
19582
19583var invariant = _dereq_(162);
19584
19585/**
19586 * Convert array-like objects to arrays.
19587 *
19588 * This API assumes the caller knows the contents of the data type. For less
19589 * well defined inputs use createArrayFromMixed.
19590 *
19591 * @param {object|function|filelist} obj
19592 * @return {array}
19593 */
19594function toArray(obj) {
19595 var length = obj.length;
19596
19597 // Some browsers builtin objects can report typeof 'function' (e.g. NodeList
19598 // in old versions of Safari).
19599 !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? "development" !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
19600
19601 !(typeof length === 'number') ? "development" !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
19602
19603 !(length === 0 || length - 1 in obj) ? "development" !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
19604
19605 !(typeof obj.callee !== 'function') ? "development" !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;
19606
19607 // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
19608 // without method will throw during the slice call and skip straight to the
19609 // fallback.
19610 if (obj.hasOwnProperty) {
19611 try {
19612 return Array.prototype.slice.call(obj);
19613 } catch (e) {
19614 // IE < 9 does not support Array#slice on collections objects
19615 }
19616 }
19617
19618 // Fall back to copying key by key. This assumes all keys have a value,
19619 // so will not preserve sparsely populated inputs.
19620 var ret = Array(length);
19621 for (var ii = 0; ii < length; ii++) {
19622 ret[ii] = obj[ii];
19623 }
19624 return ret;
19625}
19626
19627/**
19628 * Perform a heuristic test to determine if an object is "array-like".
19629 *
19630 * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
19631 * Joshu replied: "Mu."
19632 *
19633 * This function determines if its argument has "array nature": it returns
19634 * true if the argument is an actual array, an `arguments' object, or an
19635 * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
19636 *
19637 * It will return false for other array-like objects like Filelist.
19638 *
19639 * @param {*} obj
19640 * @return {boolean}
19641 */
19642function hasArrayNature(obj) {
19643 return (
19644 // not null/false
19645 !!obj && (
19646 // arrays are objects, NodeLists are functions in Safari
19647 typeof obj == 'object' || typeof obj == 'function') &&
19648 // quacks like an array
19649 'length' in obj &&
19650 // not window
19651 !('setInterval' in obj) &&
19652 // no DOM node should be considered an array-like
19653 // a 'select' element has 'length' and 'item' properties on IE8
19654 typeof obj.nodeType != 'number' && (
19655 // a real array
19656 Array.isArray(obj) ||
19657 // arguments
19658 'callee' in obj ||
19659 // HTMLCollection/NodeList
19660 'item' in obj)
19661 );
19662}
19663
19664/**
19665 * Ensure that the argument is an array by wrapping it in an array if it is not.
19666 * Creates a copy of the argument if it is already an array.
19667 *
19668 * This is mostly useful idiomatically:
19669 *
19670 * var createArrayFromMixed = require('createArrayFromMixed');
19671 *
19672 * function takesOneOrMoreThings(things) {
19673 * things = createArrayFromMixed(things);
19674 * ...
19675 * }
19676 *
19677 * This allows you to treat `things' as an array, but accept scalars in the API.
19678 *
19679 * If you need to convert an array-like object, like `arguments`, into an array
19680 * use toArray instead.
19681 *
19682 * @param {*} obj
19683 * @return {array}
19684 */
19685function createArrayFromMixed(obj) {
19686 if (!hasArrayNature(obj)) {
19687 return [obj];
19688 } else if (Array.isArray(obj)) {
19689 return obj.slice();
19690 } else {
19691 return toArray(obj);
19692 }
19693}
19694
19695module.exports = createArrayFromMixed;
19696},{"162":162}],153:[function(_dereq_,module,exports){
19697'use strict';
19698
19699/**
19700 * Copyright (c) 2013-present, Facebook, Inc.
19701 * All rights reserved.
19702 *
19703 * This source code is licensed under the BSD-style license found in the
19704 * LICENSE file in the root directory of this source tree. An additional grant
19705 * of patent rights can be found in the PATENTS file in the same directory.
19706 *
19707 * @typechecks
19708 */
19709
19710/*eslint-disable fb-www/unsafe-html*/
19711
19712var ExecutionEnvironment = _dereq_(148);
19713
19714var createArrayFromMixed = _dereq_(152);
19715var getMarkupWrap = _dereq_(158);
19716var invariant = _dereq_(162);
19717
19718/**
19719 * Dummy container used to render all markup.
19720 */
19721var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
19722
19723/**
19724 * Pattern used by `getNodeName`.
19725 */
19726var nodeNamePattern = /^\s*<(\w+)/;
19727
19728/**
19729 * Extracts the `nodeName` of the first element in a string of markup.
19730 *
19731 * @param {string} markup String of markup.
19732 * @return {?string} Node name of the supplied markup.
19733 */
19734function getNodeName(markup) {
19735 var nodeNameMatch = markup.match(nodeNamePattern);
19736 return nodeNameMatch && nodeNameMatch[1].toLowerCase();
19737}
19738
19739/**
19740 * Creates an array containing the nodes rendered from the supplied markup. The
19741 * optionally supplied `handleScript` function will be invoked once for each
19742 * <script> element that is rendered. If no `handleScript` function is supplied,
19743 * an exception is thrown if any <script> elements are rendered.
19744 *
19745 * @param {string} markup A string of valid HTML markup.
19746 * @param {?function} handleScript Invoked once for each rendered <script>.
19747 * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
19748 */
19749function createNodesFromMarkup(markup, handleScript) {
19750 var node = dummyNode;
19751 !!!dummyNode ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
19752 var nodeName = getNodeName(markup);
19753
19754 var wrap = nodeName && getMarkupWrap(nodeName);
19755 if (wrap) {
19756 node.innerHTML = wrap[1] + markup + wrap[2];
19757
19758 var wrapDepth = wrap[0];
19759 while (wrapDepth--) {
19760 node = node.lastChild;
19761 }
19762 } else {
19763 node.innerHTML = markup;
19764 }
19765
19766 var scripts = node.getElementsByTagName('script');
19767 if (scripts.length) {
19768 !handleScript ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
19769 createArrayFromMixed(scripts).forEach(handleScript);
19770 }
19771
19772 var nodes = Array.from(node.childNodes);
19773 while (node.lastChild) {
19774 node.removeChild(node.lastChild);
19775 }
19776 return nodes;
19777}
19778
19779module.exports = createNodesFromMarkup;
19780},{"148":148,"152":152,"158":158,"162":162}],154:[function(_dereq_,module,exports){
19781"use strict";
19782
19783/**
19784 * Copyright (c) 2013-present, Facebook, Inc.
19785 * All rights reserved.
19786 *
19787 * This source code is licensed under the BSD-style license found in the
19788 * LICENSE file in the root directory of this source tree. An additional grant
19789 * of patent rights can be found in the PATENTS file in the same directory.
19790 *
19791 *
19792 */
19793
19794function makeEmptyFunction(arg) {
19795 return function () {
19796 return arg;
19797 };
19798}
19799
19800/**
19801 * This function accepts and discards inputs; it has no side effects. This is
19802 * primarily useful idiomatically for overridable function endpoints which
19803 * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
19804 */
19805var emptyFunction = function emptyFunction() {};
19806
19807emptyFunction.thatReturns = makeEmptyFunction;
19808emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
19809emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
19810emptyFunction.thatReturnsNull = makeEmptyFunction(null);
19811emptyFunction.thatReturnsThis = function () {
19812 return this;
19813};
19814emptyFunction.thatReturnsArgument = function (arg) {
19815 return arg;
19816};
19817
19818module.exports = emptyFunction;
19819},{}],155:[function(_dereq_,module,exports){
19820/**
19821 * Copyright (c) 2013-present, Facebook, Inc.
19822 * All rights reserved.
19823 *
19824 * This source code is licensed under the BSD-style license found in the
19825 * LICENSE file in the root directory of this source tree. An additional grant
19826 * of patent rights can be found in the PATENTS file in the same directory.
19827 *
19828 */
19829
19830'use strict';
19831
19832var emptyObject = {};
19833
19834if ("development" !== 'production') {
19835 Object.freeze(emptyObject);
19836}
19837
19838module.exports = emptyObject;
19839},{}],156:[function(_dereq_,module,exports){
19840/**
19841 * Copyright (c) 2013-present, Facebook, Inc.
19842 * All rights reserved.
19843 *
19844 * This source code is licensed under the BSD-style license found in the
19845 * LICENSE file in the root directory of this source tree. An additional grant
19846 * of patent rights can be found in the PATENTS file in the same directory.
19847 *
19848 */
19849
19850'use strict';
19851
19852/**
19853 * @param {DOMElement} node input/textarea to focus
19854 */
19855
19856function focusNode(node) {
19857 // IE8 can throw "Can't move focus to the control because it is invisible,
19858 // not enabled, or of a type that does not accept the focus." for all kinds of
19859 // reasons that are too expensive and fragile to test.
19860 try {
19861 node.focus();
19862 } catch (e) {}
19863}
19864
19865module.exports = focusNode;
19866},{}],157:[function(_dereq_,module,exports){
19867'use strict';
19868
19869/**
19870 * Copyright (c) 2013-present, Facebook, Inc.
19871 * All rights reserved.
19872 *
19873 * This source code is licensed under the BSD-style license found in the
19874 * LICENSE file in the root directory of this source tree. An additional grant
19875 * of patent rights can be found in the PATENTS file in the same directory.
19876 *
19877 * @typechecks
19878 */
19879
19880/* eslint-disable fb-www/typeof-undefined */
19881
19882/**
19883 * Same as document.activeElement but wraps in a try-catch block. In IE it is
19884 * not safe to call document.activeElement if there is nothing focused.
19885 *
19886 * The activeElement will be null only if the document or document body is not
19887 * yet defined.
19888 */
19889function getActiveElement() /*?DOMElement*/{
19890 if (typeof document === 'undefined') {
19891 return null;
19892 }
19893 try {
19894 return document.activeElement || document.body;
19895 } catch (e) {
19896 return document.body;
19897 }
19898}
19899
19900module.exports = getActiveElement;
19901},{}],158:[function(_dereq_,module,exports){
19902'use strict';
19903
19904/**
19905 * Copyright (c) 2013-present, Facebook, Inc.
19906 * All rights reserved.
19907 *
19908 * This source code is licensed under the BSD-style license found in the
19909 * LICENSE file in the root directory of this source tree. An additional grant
19910 * of patent rights can be found in the PATENTS file in the same directory.
19911 *
19912 */
19913
19914/*eslint-disable fb-www/unsafe-html */
19915
19916var ExecutionEnvironment = _dereq_(148);
19917
19918var invariant = _dereq_(162);
19919
19920/**
19921 * Dummy container used to detect which wraps are necessary.
19922 */
19923var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
19924
19925/**
19926 * Some browsers cannot use `innerHTML` to render certain elements standalone,
19927 * so we wrap them, render the wrapped nodes, then extract the desired node.
19928 *
19929 * In IE8, certain elements cannot render alone, so wrap all elements ('*').
19930 */
19931
19932var shouldWrap = {};
19933
19934var selectWrap = [1, '<select multiple="true">', '</select>'];
19935var tableWrap = [1, '<table>', '</table>'];
19936var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
19937
19938var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
19939
19940var markupWrap = {
19941 '*': [1, '?<div>', '</div>'],
19942
19943 'area': [1, '<map>', '</map>'],
19944 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
19945 'legend': [1, '<fieldset>', '</fieldset>'],
19946 'param': [1, '<object>', '</object>'],
19947 'tr': [2, '<table><tbody>', '</tbody></table>'],
19948
19949 'optgroup': selectWrap,
19950 'option': selectWrap,
19951
19952 'caption': tableWrap,
19953 'colgroup': tableWrap,
19954 'tbody': tableWrap,
19955 'tfoot': tableWrap,
19956 'thead': tableWrap,
19957
19958 'td': trWrap,
19959 'th': trWrap
19960};
19961
19962// Initialize the SVG elements since we know they'll always need to be wrapped
19963// consistently. If they are created inside a <div> they will be initialized in
19964// the wrong namespace (and will not display).
19965var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
19966svgElements.forEach(function (nodeName) {
19967 markupWrap[nodeName] = svgWrap;
19968 shouldWrap[nodeName] = true;
19969});
19970
19971/**
19972 * Gets the markup wrap configuration for the supplied `nodeName`.
19973 *
19974 * NOTE: This lazily detects which wraps are necessary for the current browser.
19975 *
19976 * @param {string} nodeName Lowercase `nodeName`.
19977 * @return {?array} Markup wrap configuration, if applicable.
19978 */
19979function getMarkupWrap(nodeName) {
19980 !!!dummyNode ? "development" !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
19981 if (!markupWrap.hasOwnProperty(nodeName)) {
19982 nodeName = '*';
19983 }
19984 if (!shouldWrap.hasOwnProperty(nodeName)) {
19985 if (nodeName === '*') {
19986 dummyNode.innerHTML = '<link />';
19987 } else {
19988 dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
19989 }
19990 shouldWrap[nodeName] = !dummyNode.firstChild;
19991 }
19992 return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
19993}
19994
19995module.exports = getMarkupWrap;
19996},{"148":148,"162":162}],159:[function(_dereq_,module,exports){
19997/**
19998 * Copyright (c) 2013-present, Facebook, Inc.
19999 * All rights reserved.
20000 *
20001 * This source code is licensed under the BSD-style license found in the
20002 * LICENSE file in the root directory of this source tree. An additional grant
20003 * of patent rights can be found in the PATENTS file in the same directory.
20004 *
20005 * @typechecks
20006 */
20007
20008'use strict';
20009
20010/**
20011 * Gets the scroll position of the supplied element or window.
20012 *
20013 * The return values are unbounded, unlike `getScrollPosition`. This means they
20014 * may be negative or exceed the element boundaries (which is possible using
20015 * inertial scrolling).
20016 *
20017 * @param {DOMWindow|DOMElement} scrollable
20018 * @return {object} Map with `x` and `y` keys.
20019 */
20020
20021function getUnboundedScrollPosition(scrollable) {
20022 if (scrollable === window) {
20023 return {
20024 x: window.pageXOffset || document.documentElement.scrollLeft,
20025 y: window.pageYOffset || document.documentElement.scrollTop
20026 };
20027 }
20028 return {
20029 x: scrollable.scrollLeft,
20030 y: scrollable.scrollTop
20031 };
20032}
20033
20034module.exports = getUnboundedScrollPosition;
20035},{}],160:[function(_dereq_,module,exports){
20036'use strict';
20037
20038/**
20039 * Copyright (c) 2013-present, Facebook, Inc.
20040 * All rights reserved.
20041 *
20042 * This source code is licensed under the BSD-style license found in the
20043 * LICENSE file in the root directory of this source tree. An additional grant
20044 * of patent rights can be found in the PATENTS file in the same directory.
20045 *
20046 * @typechecks
20047 */
20048
20049var _uppercasePattern = /([A-Z])/g;
20050
20051/**
20052 * Hyphenates a camelcased string, for example:
20053 *
20054 * > hyphenate('backgroundColor')
20055 * < "background-color"
20056 *
20057 * For CSS style names, use `hyphenateStyleName` instead which works properly
20058 * with all vendor prefixes, including `ms`.
20059 *
20060 * @param {string} string
20061 * @return {string}
20062 */
20063function hyphenate(string) {
20064 return string.replace(_uppercasePattern, '-$1').toLowerCase();
20065}
20066
20067module.exports = hyphenate;
20068},{}],161:[function(_dereq_,module,exports){
20069/**
20070 * Copyright (c) 2013-present, Facebook, Inc.
20071 * All rights reserved.
20072 *
20073 * This source code is licensed under the BSD-style license found in the
20074 * LICENSE file in the root directory of this source tree. An additional grant
20075 * of patent rights can be found in the PATENTS file in the same directory.
20076 *
20077 * @typechecks
20078 */
20079
20080'use strict';
20081
20082var hyphenate = _dereq_(160);
20083
20084var msPattern = /^ms-/;
20085
20086/**
20087 * Hyphenates a camelcased CSS property name, for example:
20088 *
20089 * > hyphenateStyleName('backgroundColor')
20090 * < "background-color"
20091 * > hyphenateStyleName('MozTransition')
20092 * < "-moz-transition"
20093 * > hyphenateStyleName('msTransition')
20094 * < "-ms-transition"
20095 *
20096 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
20097 * is converted to `-ms-`.
20098 *
20099 * @param {string} string
20100 * @return {string}
20101 */
20102function hyphenateStyleName(string) {
20103 return hyphenate(string).replace(msPattern, '-ms-');
20104}
20105
20106module.exports = hyphenateStyleName;
20107},{"160":160}],162:[function(_dereq_,module,exports){
20108/**
20109 * Copyright (c) 2013-present, Facebook, Inc.
20110 * All rights reserved.
20111 *
20112 * This source code is licensed under the BSD-style license found in the
20113 * LICENSE file in the root directory of this source tree. An additional grant
20114 * of patent rights can be found in the PATENTS file in the same directory.
20115 *
20116 */
20117
20118'use strict';
20119
20120/**
20121 * Use invariant() to assert state which your program assumes to be true.
20122 *
20123 * Provide sprintf-style format (only %s is supported) and arguments
20124 * to provide information about what broke and what you were
20125 * expecting.
20126 *
20127 * The invariant message will be stripped in production, but the invariant
20128 * will remain to ensure logic does not differ in production.
20129 */
20130
20131function invariant(condition, format, a, b, c, d, e, f) {
20132 if ("development" !== 'production') {
20133 if (format === undefined) {
20134 throw new Error('invariant requires an error message argument');
20135 }
20136 }
20137
20138 if (!condition) {
20139 var error;
20140 if (format === undefined) {
20141 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
20142 } else {
20143 var args = [a, b, c, d, e, f];
20144 var argIndex = 0;
20145 error = new Error(format.replace(/%s/g, function () {
20146 return args[argIndex++];
20147 }));
20148 error.name = 'Invariant Violation';
20149 }
20150
20151 error.framesToPop = 1; // we don't care about invariant's own frame
20152 throw error;
20153 }
20154}
20155
20156module.exports = invariant;
20157},{}],163:[function(_dereq_,module,exports){
20158'use strict';
20159
20160/**
20161 * Copyright (c) 2013-present, Facebook, Inc.
20162 * All rights reserved.
20163 *
20164 * This source code is licensed under the BSD-style license found in the
20165 * LICENSE file in the root directory of this source tree. An additional grant
20166 * of patent rights can be found in the PATENTS file in the same directory.
20167 *
20168 * @typechecks
20169 */
20170
20171/**
20172 * @param {*} object The object to check.
20173 * @return {boolean} Whether or not the object is a DOM node.
20174 */
20175function isNode(object) {
20176 return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
20177}
20178
20179module.exports = isNode;
20180},{}],164:[function(_dereq_,module,exports){
20181'use strict';
20182
20183/**
20184 * Copyright (c) 2013-present, Facebook, Inc.
20185 * All rights reserved.
20186 *
20187 * This source code is licensed under the BSD-style license found in the
20188 * LICENSE file in the root directory of this source tree. An additional grant
20189 * of patent rights can be found in the PATENTS file in the same directory.
20190 *
20191 * @typechecks
20192 */
20193
20194var isNode = _dereq_(163);
20195
20196/**
20197 * @param {*} object The object to check.
20198 * @return {boolean} Whether or not the object is a DOM text node.
20199 */
20200function isTextNode(object) {
20201 return isNode(object) && object.nodeType == 3;
20202}
20203
20204module.exports = isTextNode;
20205},{"163":163}],165:[function(_dereq_,module,exports){
20206/**
20207 * Copyright (c) 2013-present, Facebook, Inc.
20208 * All rights reserved.
20209 *
20210 * This source code is licensed under the BSD-style license found in the
20211 * LICENSE file in the root directory of this source tree. An additional grant
20212 * of patent rights can be found in the PATENTS file in the same directory.
20213 *
20214 * @typechecks static-only
20215 */
20216
20217'use strict';
20218
20219var invariant = _dereq_(162);
20220
20221/**
20222 * Constructs an enumeration with keys equal to their value.
20223 *
20224 * For example:
20225 *
20226 * var COLORS = keyMirror({blue: null, red: null});
20227 * var myColor = COLORS.blue;
20228 * var isColorValid = !!COLORS[myColor];
20229 *
20230 * The last line could not be performed if the values of the generated enum were
20231 * not equal to their keys.
20232 *
20233 * Input: {key1: val1, key2: val2}
20234 * Output: {key1: key1, key2: key2}
20235 *
20236 * @param {object} obj
20237 * @return {object}
20238 */
20239var keyMirror = function keyMirror(obj) {
20240 var ret = {};
20241 var key;
20242 !(obj instanceof Object && !Array.isArray(obj)) ? "development" !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0;
20243 for (key in obj) {
20244 if (!obj.hasOwnProperty(key)) {
20245 continue;
20246 }
20247 ret[key] = key;
20248 }
20249 return ret;
20250};
20251
20252module.exports = keyMirror;
20253},{"162":162}],166:[function(_dereq_,module,exports){
20254"use strict";
20255
20256/**
20257 * Copyright (c) 2013-present, Facebook, Inc.
20258 * All rights reserved.
20259 *
20260 * This source code is licensed under the BSD-style license found in the
20261 * LICENSE file in the root directory of this source tree. An additional grant
20262 * of patent rights can be found in the PATENTS file in the same directory.
20263 *
20264 */
20265
20266/**
20267 * Allows extraction of a minified key. Let's the build system minify keys
20268 * without losing the ability to dynamically use key strings as values
20269 * themselves. Pass in an object with a single key/val pair and it will return
20270 * you the string key of that single record. Suppose you want to grab the
20271 * value for a key 'className' inside of an object. Key/val minification may
20272 * have aliased that key to be 'xa12'. keyOf({className: null}) will return
20273 * 'xa12' in that case. Resolve keys you want to use once at startup time, then
20274 * reuse those resolutions.
20275 */
20276var keyOf = function keyOf(oneKeyObj) {
20277 var key;
20278 for (key in oneKeyObj) {
20279 if (!oneKeyObj.hasOwnProperty(key)) {
20280 continue;
20281 }
20282 return key;
20283 }
20284 return null;
20285};
20286
20287module.exports = keyOf;
20288},{}],167:[function(_dereq_,module,exports){
20289/**
20290 * Copyright (c) 2013-present, Facebook, Inc.
20291 * All rights reserved.
20292 *
20293 * This source code is licensed under the BSD-style license found in the
20294 * LICENSE file in the root directory of this source tree. An additional grant
20295 * of patent rights can be found in the PATENTS file in the same directory.
20296 *
20297 *
20298 * @typechecks static-only
20299 */
20300
20301'use strict';
20302
20303/**
20304 * Memoizes the return value of a function that accepts one string argument.
20305 */
20306
20307function memoizeStringOnly(callback) {
20308 var cache = {};
20309 return function (string) {
20310 if (!cache.hasOwnProperty(string)) {
20311 cache[string] = callback.call(this, string);
20312 }
20313 return cache[string];
20314 };
20315}
20316
20317module.exports = memoizeStringOnly;
20318},{}],168:[function(_dereq_,module,exports){
20319/**
20320 * Copyright (c) 2013-present, Facebook, Inc.
20321 * All rights reserved.
20322 *
20323 * This source code is licensed under the BSD-style license found in the
20324 * LICENSE file in the root directory of this source tree. An additional grant
20325 * of patent rights can be found in the PATENTS file in the same directory.
20326 *
20327 * @typechecks
20328 */
20329
20330'use strict';
20331
20332var ExecutionEnvironment = _dereq_(148);
20333
20334var performance;
20335
20336if (ExecutionEnvironment.canUseDOM) {
20337 performance = window.performance || window.msPerformance || window.webkitPerformance;
20338}
20339
20340module.exports = performance || {};
20341},{"148":148}],169:[function(_dereq_,module,exports){
20342'use strict';
20343
20344/**
20345 * Copyright (c) 2013-present, Facebook, Inc.
20346 * All rights reserved.
20347 *
20348 * This source code is licensed under the BSD-style license found in the
20349 * LICENSE file in the root directory of this source tree. An additional grant
20350 * of patent rights can be found in the PATENTS file in the same directory.
20351 *
20352 * @typechecks
20353 */
20354
20355var performance = _dereq_(168);
20356
20357var performanceNow;
20358
20359/**
20360 * Detect if we can use `window.performance.now()` and gracefully fallback to
20361 * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
20362 * because of Facebook's testing infrastructure.
20363 */
20364if (performance.now) {
20365 performanceNow = function performanceNow() {
20366 return performance.now();
20367 };
20368} else {
20369 performanceNow = function performanceNow() {
20370 return Date.now();
20371 };
20372}
20373
20374module.exports = performanceNow;
20375},{"168":168}],170:[function(_dereq_,module,exports){
20376/**
20377 * Copyright (c) 2013-present, Facebook, Inc.
20378 * All rights reserved.
20379 *
20380 * This source code is licensed under the BSD-style license found in the
20381 * LICENSE file in the root directory of this source tree. An additional grant
20382 * of patent rights can be found in the PATENTS file in the same directory.
20383 *
20384 * @typechecks
20385 *
20386 */
20387
20388/*eslint-disable no-self-compare */
20389
20390'use strict';
20391
20392var hasOwnProperty = Object.prototype.hasOwnProperty;
20393
20394/**
20395 * inlined Object.is polyfill to avoid requiring consumers ship their own
20396 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
20397 */
20398function is(x, y) {
20399 // SameValue algorithm
20400 if (x === y) {
20401 // Steps 1-5, 7-10
20402 // Steps 6.b-6.e: +0 != -0
20403 return x !== 0 || 1 / x === 1 / y;
20404 } else {
20405 // Step 6.a: NaN == NaN
20406 return x !== x && y !== y;
20407 }
20408}
20409
20410/**
20411 * Performs equality by iterating through keys on an object and returning false
20412 * when any key has values which are not strictly equal between the arguments.
20413 * Returns true when the values of all keys are strictly equal.
20414 */
20415function shallowEqual(objA, objB) {
20416 if (is(objA, objB)) {
20417 return true;
20418 }
20419
20420 if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
20421 return false;
20422 }
20423
20424 var keysA = Object.keys(objA);
20425 var keysB = Object.keys(objB);
20426
20427 if (keysA.length !== keysB.length) {
20428 return false;
20429 }
20430
20431 // Test for A's keys different from B.
20432 for (var i = 0; i < keysA.length; i++) {
20433 if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
20434 return false;
20435 }
20436 }
20437
20438 return true;
20439}
20440
20441module.exports = shallowEqual;
20442},{}],171:[function(_dereq_,module,exports){
20443/**
20444 * Copyright 2014-2015, Facebook, Inc.
20445 * All rights reserved.
20446 *
20447 * This source code is licensed under the BSD-style license found in the
20448 * LICENSE file in the root directory of this source tree. An additional grant
20449 * of patent rights can be found in the PATENTS file in the same directory.
20450 *
20451 */
20452
20453'use strict';
20454
20455var emptyFunction = _dereq_(154);
20456
20457/**
20458 * Similar to invariant but only logs a warning if the condition is not met.
20459 * This can be used to log issues in development environments in critical
20460 * paths. Removing the logging code for production environments will keep the
20461 * same logic and follow the same code paths.
20462 */
20463
20464var warning = emptyFunction;
20465
20466if ("development" !== 'production') {
20467 (function () {
20468 var printWarning = function printWarning(format) {
20469 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
20470 args[_key - 1] = arguments[_key];
20471 }
20472
20473 var argIndex = 0;
20474 var message = 'Warning: ' + format.replace(/%s/g, function () {
20475 return args[argIndex++];
20476 });
20477 if (typeof console !== 'undefined') {
20478 console.error(message);
20479 }
20480 try {
20481 // --- Welcome to debugging React ---
20482 // This error was thrown as a convenience so that you can use this stack
20483 // to find the callsite that caused this warning to fire.
20484 throw new Error(message);
20485 } catch (x) {}
20486 };
20487
20488 warning = function warning(condition, format) {
20489 if (format === undefined) {
20490 throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
20491 }
20492
20493 if (format.indexOf('Failed Composite propType: ') === 0) {
20494 return; // Ignore CompositeComponent proptype check.
20495 }
20496
20497 if (!condition) {
20498 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
20499 args[_key2 - 2] = arguments[_key2];
20500 }
20501
20502 printWarning.apply(undefined, [format].concat(args));
20503 }
20504 };
20505 })();
20506}
20507
20508module.exports = warning;
20509},{"154":154}],172:[function(_dereq_,module,exports){
20510'use strict';
20511/* eslint-disable no-unused-vars */
20512var hasOwnProperty = Object.prototype.hasOwnProperty;
20513var propIsEnumerable = Object.prototype.propertyIsEnumerable;
20514
20515function toObject(val) {
20516 if (val === null || val === undefined) {
20517 throw new TypeError('Object.assign cannot be called with null or undefined');
20518 }
20519
20520 return Object(val);
20521}
20522
20523function shouldUseNative() {
20524 try {
20525 if (!Object.assign) {
20526 return false;
20527 }
20528
20529 // Detect buggy property enumeration order in older V8 versions.
20530
20531 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
20532 var test1 = new String('abc'); // eslint-disable-line
20533 test1[5] = 'de';
20534 if (Object.getOwnPropertyNames(test1)[0] === '5') {
20535 return false;
20536 }
20537
20538 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
20539 var test2 = {};
20540 for (var i = 0; i < 10; i++) {
20541 test2['_' + String.fromCharCode(i)] = i;
20542 }
20543 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
20544 return test2[n];
20545 });
20546 if (order2.join('') !== '0123456789') {
20547 return false;
20548 }
20549
20550 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
20551 var test3 = {};
20552 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
20553 test3[letter] = letter;
20554 });
20555 if (Object.keys(Object.assign({}, test3)).join('') !==
20556 'abcdefghijklmnopqrst') {
20557 return false;
20558 }
20559
20560 return true;
20561 } catch (e) {
20562 // We don't expect any of the above to throw, but better to be safe.
20563 return false;
20564 }
20565}
20566
20567module.exports = shouldUseNative() ? Object.assign : function (target, source) {
20568 var from;
20569 var to = toObject(target);
20570 var symbols;
20571
20572 for (var s = 1; s < arguments.length; s++) {
20573 from = Object(arguments[s]);
20574
20575 for (var key in from) {
20576 if (hasOwnProperty.call(from, key)) {
20577 to[key] = from[key];
20578 }
20579 }
20580
20581 if (Object.getOwnPropertySymbols) {
20582 symbols = Object.getOwnPropertySymbols(from);
20583 for (var i = 0; i < symbols.length; i++) {
20584 if (propIsEnumerable.call(from, symbols[i])) {
20585 to[symbols[i]] = from[symbols[i]];
20586 }
20587 }
20588 }
20589 }
20590
20591 return to;
20592};
20593
20594},{}]},{},[94])(94)
20595});
\No newline at end of file