+ {location.city}
+ {location.member_count} members
+
+ }
+ key={locations.indexOf(location)}>{location.name}
+ )
+ }
+ return citiesContainers;
+ }
+
+ render() {
+ let cityListItems = this._renderCities();
+
+ return (
+
+ {cityListItems}
+
+ );
+ }
+}
+
+CitiesContainer.childContextTypes = { muiTheme: React.PropTypes.object };
+
+export default CitiesContainer;
diff --git a/react-map/client/react/styles/styles.jsx b/react-map/client/react/styles/styles.jsx
new file mode 100644
index 0000000..0bdf917
--- /dev/null
+++ b/react-map/client/react/styles/styles.jsx
@@ -0,0 +1,54 @@
+const K_WIDTH = 40;
+const K_HEIGHT = 40;
+
+let Colors = require('material-ui/lib/styles/colors');
+
+export const LocationContainerStyle = {
+ position: 'absolute',
+ width: K_WIDTH,
+ height: K_HEIGHT,
+ left: -K_WIDTH / 2,
+ top: -K_HEIGHT / 2,
+
+ borderRadius: '50%',
+ textAlign: 'center',
+ color: '#3f51b5',
+ fontSize: 16,
+ fontWeight: 'bold',
+ padding: 4,
+ backgroundSize: '100%',
+ backgroundColor: 'white'
+};
+
+export const MapContainerStyle = {
+ zIndex: -1,
+ position: 'absolute',
+ width: '70%',
+ right: 0,
+ height: 700,
+ paddingTop: 30,
+ borderBottom: '3px solid #f44336'
+};
+
+export const CitiesContainerStyle = {
+ zIndex: -1,
+ position: 'absolute',
+ width: '30%',
+ left: 0,
+ height: 700,
+ paddingTop: 30,
+ borderBottom: '3px solid #f44336',
+ overflow: 'scroll'
+}
+
+export const cityStyle = {
+ color: Colors.darkBlack,
+ textTransform: 'uppercase',
+ fontWeight: '500',
+ fontSize: '13px'
+};
+export const membersStyle = {
+ fontStyle: 'italic',
+ fontSize: '12px'
+};
+
diff --git a/react-map/dist/bundle.js b/react-map/dist/bundle.js
new file mode 100644
index 0000000..a4a825d
--- /dev/null
+++ b/react-map/dist/bundle.js
@@ -0,0 +1,42257 @@
+(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 1) {
+ for (var i = 1; i < arguments.length; i++) {
+ args[i - 1] = arguments[i];
+ }
+ }
+ queue.push(new Item(fun, args));
+ if (queue.length === 1 && !draining) {
+ setTimeout(drainQueue, 0);
+ }
+};
+
+// v8 likes predictible objects
+function Item(fun, array) {
+ this.fun = fun;
+ this.array = array;
+}
+Item.prototype.run = function () {
+ this.fun.apply(null, this.array);
+};
+process.title = 'browser';
+process.browser = true;
+process.env = {};
+process.argv = [];
+process.version = ''; // empty string to avoid regexp issues
+process.versions = {};
+
+function noop() {}
+
+process.on = noop;
+process.addListener = noop;
+process.once = noop;
+process.off = noop;
+process.removeListener = noop;
+process.removeAllListeners = noop;
+process.emit = noop;
+
+process.binding = function (name) {
+ throw new Error('process.binding is not supported');
+};
+
+// TODO(shtylman)
+process.cwd = function () { return '/' };
+process.chdir = function (dir) {
+ throw new Error('process.chdir is not supported');
+};
+process.umask = function() { return 0; };
+
+},{}],8:[function(require,module,exports){
+(function (process){
+'use strict';
+
+Object.defineProperty(exports, '__esModule', {
+ value: true
+});
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
+
+var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
+
+var _react = require('react');
+
+var _react2 = _interopRequireDefault(_react);
+
+var _reactPureRenderFunction = require('react-pure-render/function');
+
+var _reactPureRenderFunction2 = _interopRequireDefault(_reactPureRenderFunction);
+
+var _marker_dispatcherJs = require('./marker_dispatcher.js');
+
+var _marker_dispatcherJs2 = _interopRequireDefault(_marker_dispatcherJs);
+
+var _google_map_mapJs = require('./google_map_map.js');
+
+var _google_map_mapJs2 = _interopRequireDefault(_google_map_mapJs);
+
+var _google_map_markersJs = require('./google_map_markers.js');
+
+var _google_map_markersJs2 = _interopRequireDefault(_google_map_markersJs);
+
+var _google_map_markers_prerenderJs = require('./google_map_markers_prerender.js');
+
+var _google_map_markers_prerenderJs2 = _interopRequireDefault(_google_map_markers_prerenderJs);
+
+var _utilsLoadersGoogle_map_loaderJs = require('./utils/loaders/google_map_loader.js');
+
+var _utilsLoadersGoogle_map_loaderJs2 = _interopRequireDefault(_utilsLoadersGoogle_map_loaderJs);
+
+var _utilsDetectJs = require('./utils/detect.js');
+
+var _utilsDetectJs2 = _interopRequireDefault(_utilsDetectJs);
+
+var _utilsGeoJs = require('./utils/geo.js');
+
+var _utilsGeoJs2 = _interopRequireDefault(_utilsGeoJs);
+
+var _utilsArray_helperJs = require('./utils/array_helper.js');
+
+var _utilsArray_helperJs2 = _interopRequireDefault(_utilsArray_helperJs);
+
+var _lodashIsfunction = require('lodash.isfunction');
+
+var _lodashIsfunction2 = _interopRequireDefault(_lodashIsfunction);
+
+var _lodashIsplainobject = require('lodash.isplainobject');
+
+var _lodashIsplainobject2 = _interopRequireDefault(_lodashIsplainobject);
+
+var _lodashPick = require('lodash.pick');
+
+var _lodashPick2 = _interopRequireDefault(_lodashPick);
+
+var _lodashAssign = require('lodash.assign');
+
+var _lodashAssign2 = _interopRequireDefault(_lodashAssign);
+
+var _lodashIsnumber = require('lodash.isnumber');
+
+var _lodashIsnumber2 = _interopRequireDefault(_lodashIsnumber);
+
+var kEPS = 0.00001;
+var K_GOOGLE_TILE_SIZE = 256;
+
+function defaultOptions_() {
+ return {
+ overviewMapControl: false,
+ streetViewControl: false,
+ rotateControl: true,
+ mapTypeControl: false,
+ // disable poi
+ styles: [{ featureType: 'poi', elementType: 'labels', stylers: [{ visibility: 'off' }] }],
+ minZoom: 3 // i need to dynamically calculate possible zoom value
+ };
+}
+
+var style = {
+ width: '100%',
+ height: '100%',
+ margin: 0,
+ padding: 0,
+ position: 'relative'
+};
+
+var GoogleMap = (function (_Component) {
+ function GoogleMap(props) {
+ var _this = this;
+
+ _classCallCheck(this, GoogleMap);
+
+ _get(Object.getPrototypeOf(GoogleMap.prototype), 'constructor', this).call(this, props);
+ this.shouldComponentUpdate = _reactPureRenderFunction2['default'];
+
+ this._initMap = function () {
+ var center = _this.props.center;
+ _this.geoService_.setView(center, _this.props.zoom, 0);
+
+ _this._onBoundsChanged(); // now we can calculate map bounds center etc...
+
+ _this.props.googleMapLoader(_this.props.apiKey).then(function (maps) {
+ if (!_this.mounted_) {
+ return;
+ }
+
+ var centerLatLng = _this.geoService_.getCenter();
+
+ var propsOptions = {
+ zoom: _this.props.zoom,
+ center: new maps.LatLng(centerLatLng.lat, centerLatLng.lng)
+ };
+
+ // prevent to exapose full api
+ // next props must be exposed (console.log(Object.keys(pick(maps, isPlainObject))))
+ // "Animation", "ControlPosition", "MapTypeControlStyle", "MapTypeId",
+ // "NavigationControlStyle", "ScaleControlStyle", "StrokePosition", "SymbolPath", "ZoomControlStyle",
+ // "event", "DirectionsStatus", "DirectionsTravelMode", "DirectionsUnitSystem", "DistanceMatrixStatus",
+ // "DistanceMatrixElementStatus", "ElevationStatus", "GeocoderLocationType", "GeocoderStatus", "KmlLayerStatus",
+ // "MaxZoomStatus", "StreetViewStatus", "TransitMode", "TransitRoutePreference", "TravelMode", "UnitSystem"
+ var mapPlainObjects = (0, _lodashPick2['default'])(maps, _lodashIsplainobject2['default']);
+ var options = (0, _lodashIsfunction2['default'])(_this.props.options) ? _this.props.options(mapPlainObjects) : _this.props.options;
+ var defaultOptions = defaultOptions_(mapPlainObjects);
+
+ var mapOptions = _extends({}, defaultOptions, options, propsOptions);
+
+ var map = new maps.Map(_react2['default'].findDOMNode(_this.refs.google_map_dom), mapOptions);
+ _this.map_ = map;
+ _this.maps_ = maps;
+
+ // render in overlay
+ var this_ = _this;
+ var overlay = (0, _lodashAssign2['default'])(new maps.OverlayView(), {
+ onAdd: function onAdd() {
+ var K_MAX_WIDTH = typeof screen !== 'undefined' ? '' + screen.width + 'px' : '2000px';
+ var K_MAX_HEIGHT = typeof screen !== 'undefined' ? '' + screen.height + 'px' : '2000px';
+
+ var div = document.createElement('div');
+ this.div = div;
+ div.style.backgroundColor = 'transparent';
+ div.style.position = 'absolute';
+ div.style.left = '0px';
+ div.style.top = '0px';
+ div.style.width = K_MAX_WIDTH; // prevents some chrome draw defects
+ div.style.height = K_MAX_HEIGHT;
+
+ var panes = this.getPanes();
+ panes.overlayMouseTarget.appendChild(div);
+
+ _react2['default'].render(_react2['default'].createElement(_google_map_markersJs2['default'], {
+ onChildClick: this_._onChildClick,
+ onChildMouseEnter: this_._onChildMouseEnter,
+ onChildMouseLeave: this_._onChildMouseLeave,
+ geoService: this_.geoService_,
+ projectFromLeftTop: true,
+ distanceToMouse: this_.props.distanceToMouse,
+ hoverDistance: this_.props.hoverDistance,
+ dispatcher: this_.markersDispatcher_ }), div, function () {
+ // remove prerendered markers
+ this_.setState({ overlayCreated: true });
+ });
+ },
+
+ draw: function draw() {
+ var div = overlay.div;
+ var overlayProjection = overlay.getProjection();
+ var bounds = map.getBounds();
+ var ne = bounds.getNorthEast();
+ var sw = bounds.getSouthWest();
+ var ptx = overlayProjection.fromLatLngToDivPixel(new maps.LatLng(ne.lat(), sw.lng()));
+
+ // need round for safari still can't find what need for firefox
+ var ptxRounded = (0, _utilsDetectJs2['default'])().isSafari ? { x: Math.round(ptx.x), y: Math.round(ptx.y) } : { x: ptx.x, y: ptx.y };
+
+ this_.updateCounter_++;
+ this_._onBoundsChanged(map, maps, !this_.props.debounced);
+
+ div.style.left = '' + ptxRounded.x + 'px';
+ div.style.top = '' + ptxRounded.y + 'px';
+ if (this_.markersDispatcher_) {
+ this_.markersDispatcher_.emit('kON_CHANGE');
+ }
+ }
+ });
+
+ overlay.setMap(map);
+
+ maps.event.addListener(map, 'idle', function () {
+ if (_this.resetSizeOnIdle_) {
+ _this._setViewSize();
+ _this.resetSizeOnIdle_ = false;
+ }
+
+ var div = overlay.div;
+ var overlayProjection = overlay.getProjection();
+ var bounds = map.getBounds();
+ var ne = bounds.getNorthEast();
+ var sw = bounds.getSouthWest();
+ var ptx = overlayProjection.fromLatLngToDivPixel(new maps.LatLng(ne.lat(), sw.lng()));
+ // need round for safari still can't find what need for firefox
+ var ptxRounded = (0, _utilsDetectJs2['default'])().isSafari ? { x: Math.round(ptx.x), y: Math.round(ptx.y) } : { x: ptx.x, y: ptx.y };
+
+ this_.updateCounter_++;
+ this_._onBoundsChanged(map, maps);
+
+ this_.dragTime_ = 0;
+ div.style.left = '' + ptxRounded.x + 'px';
+ div.style.top = '' + ptxRounded.y + 'px';
+ if (this_.markersDispatcher_) {
+ this_.markersDispatcher_.emit('kON_CHANGE');
+ if (this_.fireMouseEventOnIdle_) {
+ this_.markersDispatcher_.emit('kON_MOUSE_POSITION_CHANGE');
+ }
+ }
+ });
+
+ maps.event.addListener(map, 'mouseover', function () {
+ // has advantage over div MouseLeave
+ this_.mouseInMap_ = true;
+ });
+
+ maps.event.addListener(map, 'mouseout', function () {
+ // has advantage over div MouseLeave
+ this_.mouseInMap_ = false;
+ this_.mouse_ = null;
+ this_.markersDispatcher_.emit('kON_MOUSE_POSITION_CHANGE');
+ });
+
+ maps.event.addListener(map, 'drag', function () {
+ this_.dragTime_ = new Date().getTime();
+ });
+ })['catch'](function (e) {
+ console.error(e); // eslint-disable-line no-console
+ throw e;
+ });
+ };
+
+ this._onChildClick = function () {
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ if (_this.props.onChildClick) {
+ var _props;
+
+ return (_props = _this.props).onChildClick.apply(_props, args);
+ }
+ };
+
+ this._onChildMouseEnter = function () {
+ for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+ args[_key2] = arguments[_key2];
+ }
+
+ if (_this.props.onChildMouseEnter) {
+ var _props2;
+
+ return (_props2 = _this.props).onChildMouseEnter.apply(_props2, args);
+ }
+ };
+
+ this._onChildMouseLeave = function () {
+ for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
+ args[_key3] = arguments[_key3];
+ }
+
+ if (_this.props.onChildMouseLeave) {
+ var _props3;
+
+ return (_props3 = _this.props).onChildMouseLeave.apply(_props3, args);
+ }
+ };
+
+ this._setViewSize = function () {
+ var mapDom = _react2['default'].findDOMNode(_this.refs.google_map_dom);
+ _this.geoService_.setViewSize(mapDom.clientWidth, mapDom.clientHeight);
+ _this._onBoundsChanged();
+ };
+
+ this._onWindowResize = function () {
+ _this.resetSizeOnIdle_ = true;
+ };
+
+ this._onBoundsChanged = function (map, maps, callExtBoundsChange) {
+ if (map) {
+ var gmC = map.getCenter();
+ _this.geoService_.setView([gmC.lat(), gmC.lng()], map.getZoom(), 0);
+ }
+
+ if (_this.props.onBoundsChange && _this.geoService_.canProject()) {
+ var zoom = _this.geoService_.getZoom();
+ var bounds = _this.geoService_.getBounds();
+ var centerLatLng = _this.geoService_.getCenter();
+
+ if (!(0, _utilsArray_helperJs2['default'])(bounds, _this.prevBounds_, kEPS)) {
+ if (callExtBoundsChange !== false) {
+ var marginBounds = _this.geoService_.getBounds(_this.props.margin);
+ _this.props.onBoundsChange([centerLatLng.lat, centerLatLng.lng], zoom, bounds, marginBounds);
+ _this.prevBounds_ = bounds;
+ }
+ }
+ // uncomment for strange bugs
+ if (process.env.NODE_ENV !== 'production') {
+ // compare with google calculations
+ if (map) {
+ var locBounds = map.getBounds();
+ var ne = locBounds.getNorthEast();
+ var sw = locBounds.getSouthWest();
+
+ var gmC = map.getCenter();
+ // compare with google map
+
+ if (!(0, _utilsArray_helperJs2['default'])([centerLatLng.lat, centerLatLng.lng], [gmC.lat(), gmC.lng()], kEPS)) {
+ console.info('GoogleMap center not eq:', [centerLatLng.lat, centerLatLng.lng], [gmC.lat(), gmC.lng()]); // eslint-disable-line no-console
+ }
+
+ if (!(0, _utilsArray_helperJs2['default'])(bounds, [ne.lat(), sw.lng(), sw.lat(), ne.lng()], kEPS)) {
+ // this is normal if this message occured on resize
+ console.info('GoogleMap bounds not eq:', '\n', bounds, '\n', [ne.lat(), sw.lng(), sw.lat(), ne.lng()]); // eslint-disable-line no-console
+ }
+ }
+ }
+ }
+ };
+
+ this._onMouseMove = function (e) {
+ if (!_this.mouseInMap_) return;
+
+ var currTime = new Date().getTime();
+ var K_RECALC_CLIENT_RECT_MS = 3000;
+
+ if (currTime - _this.mouseMoveTime_ > K_RECALC_CLIENT_RECT_MS) {
+ _this.boundingRect_ = e.currentTarget.getBoundingClientRect();
+ }
+ _this.mouseMoveTime_ = currTime;
+
+ var mousePosX = e.clientX - _this.boundingRect_.left;
+ var mousePosY = e.clientY - _this.boundingRect_.top;
+
+ if (!_this.mouse_) {
+ _this.mouse_ = { x: 0, y: 0, lat: 0, lng: 0 };
+ }
+ var K_IDLE_TIMEOUT = 100;
+
+ _this.mouse_.x = mousePosX;
+ _this.mouse_.y = mousePosY;
+
+ var latLng = _this.geoService_.unproject(_this.mouse_, true);
+ _this.mouse_.lat = latLng.lat;
+ _this.mouse_.lng = latLng.lng;
+
+ if (currTime - _this.dragTime_ < K_IDLE_TIMEOUT) {
+ _this.fireMouseEventOnIdle_ = true;
+ } else {
+ _this.markersDispatcher_.emit('kON_MOUSE_POSITION_CHANGE');
+ _this.fireMouseEventOnIdle_ = false;
+ }
+ };
+
+ this._onMapClick = function () {
+ if (_this.markersDispatcher_) {
+ var K_IDLE_TIMEOUT = 100;
+ var currTime = new Date().getTime();
+ if (currTime - _this.dragTime_ > K_IDLE_TIMEOUT) {
+ _this.markersDispatcher_.emit('kON_CLICK');
+ }
+ }
+ };
+
+ this._isCenterDefined = function (center) {
+ return center && center.length === 2 && (0, _lodashIsnumber2['default'])(center[0]) && (0, _lodashIsnumber2['default'])(center[1]);
+ };
+
+ this.mounted_ = false;
+
+ this.map_ = null;
+ this.maps_ = null;
+ this.prevBounds_ = null;
+
+ this.mouse_ = null;
+ this.mouseMoveTime_ = 0;
+ this.boundingRect_ = null;
+ this.mouseInMap_ = true;
+
+ this.dragTime_ = 0;
+ this.fireMouseEventOnIdle_ = false;
+ this.updateCounter_ = 0;
+
+ this.markersDispatcher_ = new _marker_dispatcherJs2['default'](this);
+ this.geoService_ = new _utilsGeoJs2['default'](K_GOOGLE_TILE_SIZE);
+ if (this._isCenterDefined(this.props.center)) {
+ this.geoService_.setView(this.props.center, this.props.zoom, 0);
+ }
+
+ this.state = {
+ overlayCreated: false
+ };
+ }
+
+ _inherits(GoogleMap, _Component);
+
+ _createClass(GoogleMap, [{
+ key: 'componentDidMount',
+ value: function componentDidMount() {
+ var _this2 = this;
+
+ this.mounted_ = true;
+ window.addEventListener('resize', this._onWindowResize);
+
+ setTimeout(function () {
+ // to detect size
+ _this2._setViewSize();
+ if (_this2._isCenterDefined(_this2.props.center)) {
+ _this2._initMap();
+ } else {
+ _this2.props.googleMapLoader(_this2.props.apiKey); // начать подгружать можно уже сейчас
+ }
+ }, 0, this);
+ }
+ }, {
+ key: 'componentWillUnmount',
+ value: function componentWillUnmount() {
+ this.mounted_ = false;
+
+ window.removeEventListener('resize', this._onWindowResize);
+
+ if (this.maps_ && this.map_) {
+ this.maps_.event.clearInstanceListeners(this.map_);
+ }
+
+ this.map_ = null;
+ this.maps_ = null;
+ this.markersDispatcher_.dispose();
+
+ this.resetSizeOnIdle_ = false;
+
+ delete this.map_;
+ delete this.markersDispatcher_;
+ }
+ }, {
+ key: 'componentWillReceiveProps',
+ value: function componentWillReceiveProps(nextProps) {
+ var _this3 = this;
+
+ if (!this._isCenterDefined(this.props.center) && this._isCenterDefined(nextProps.center)) {
+ setTimeout(function () {
+ return _this3._initMap();
+ }, 0);
+ }
+
+ if (this.map_) {
+ var centerLatLng = this.geoService_.getCenter();
+ if (nextProps.center) {
+ if (Math.abs(nextProps.center[0] - centerLatLng.lat) + Math.abs(nextProps.center[1] - centerLatLng.lng) > kEPS) {
+ this.map_.panTo({ lat: nextProps.center[0], lng: nextProps.center[1] });
+ }
+ }
+
+ // if zoom chaged by user
+ if (Math.abs(nextProps.zoom - this.props.zoom) > 0) {
+ this.map_.setZoom(nextProps.zoom);
+ }
+ }
+ }
+ }, {
+ key: 'componentDidUpdate',
+ value: function componentDidUpdate() {
+ this.markersDispatcher_.emit('kON_CHANGE');
+ }
+ }, {
+ key: 'render',
+ value: function render() {
+ var mapMarkerPrerender = !this.state.overlayCreated ? _react2['default'].createElement(_google_map_markers_prerenderJs2['default'], {
+ onChildClick: this._onChildClick,
+ onChildMouseEnter: this._onChildMouseEnter,
+ onChildMouseLeave: this._onChildMouseLeave,
+ geoService: this.geoService_,
+ projectFromLeftTop: false,
+ distanceToMouse: this.props.distanceToMouse,
+ hoverDistance: this.props.hoverDistance,
+ dispatcher: this.markersDispatcher_ }) : null;
+
+ return _react2['default'].createElement(
+ 'div',
+ { style: style, onMouseMove: this._onMouseMove, onClick: this._onMapClick },
+ _react2['default'].createElement(_google_map_mapJs2['default'], { ref: 'google_map_dom' }),
+ mapMarkerPrerender
+ );
+ }
+ }], [{
+ key: 'propTypes',
+ value: {
+ apiKey: _react.PropTypes.string,
+ center: _react.PropTypes.array.isRequired,
+ zoom: _react.PropTypes.number.isRequired,
+ onBoundsChange: _react.PropTypes.func,
+ onChildClick: _react.PropTypes.func,
+ onChildMouseEnter: _react.PropTypes.func,
+ onChildMouseLeave: _react.PropTypes.func,
+ options: _react.PropTypes.any,
+ distanceToMouse: _react.PropTypes.func,
+ hoverDistance: _react.PropTypes.number,
+ debounced: _react.PropTypes.bool,
+ margin: _react.PropTypes.array,
+ googleMapLoader: _react.PropTypes.any
+ },
+ enumerable: true
+ }, {
+ key: 'defaultProps',
+ value: {
+ distanceToMouse: function distanceToMouse(pt, mousePos /*, markerProps*/) {
+ var x = pt.x;
+ var y = pt.y; // - 20;
+ return Math.sqrt((x - mousePos.x) * (x - mousePos.x) + (y - mousePos.y) * (y - mousePos.y));
+ },
+ hoverDistance: 30,
+ debounced: true,
+ options: defaultOptions_,
+ googleMapLoader: _utilsLoadersGoogle_map_loaderJs2['default']
+ },
+ enumerable: true
+ }]);
+
+ return GoogleMap;
+})(_react.Component);
+
+exports['default'] = GoogleMap;
+module.exports = exports['default'];
+/*maps*/ /*render markers before map load done*/
+}).call(this,require('_process'))
+
+},{"./google_map_map.js":9,"./google_map_markers.js":10,"./google_map_markers_prerender.js":11,"./marker_dispatcher.js":13,"./utils/array_helper.js":14,"./utils/detect.js":15,"./utils/geo.js":16,"./utils/loaders/google_map_loader.js":20,"_process":7,"lodash.assign":22,"lodash.isfunction":33,"lodash.isnumber":34,"lodash.isplainobject":35,"lodash.pick":41,"react":357,"react-pure-render/function":54}],9:[function(require,module,exports){
+'use strict';
+
+Object.defineProperty(exports, '__esModule', {
+ value: true
+});
+
+var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
+
+var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
+
+var _react = require('react');
+
+var _react2 = _interopRequireDefault(_react);
+
+var style = {
+ width: '100%',
+ height: '100%',
+ left: 0,
+ top: 0,
+ margin: 0,
+ padding: 0,
+ position: 'absolute'
+};
+
+var GoogleMapMap = (function (_Component) {
+ function GoogleMapMap(props) {
+ _classCallCheck(this, GoogleMapMap);
+
+ _get(Object.getPrototypeOf(GoogleMapMap.prototype), 'constructor', this).call(this, props);
+ }
+
+ _inherits(GoogleMapMap, _Component);
+
+ _createClass(GoogleMapMap, [{
+ key: 'shouldComponentUpdate',
+ value: function shouldComponentUpdate() {
+ return false; // disable react on this div
+ }
+ }, {
+ key: 'render',
+ value: function render() {
+ return _react2['default'].createElement('div', { style: style });
+ }
+ }]);
+
+ return GoogleMapMap;
+})(_react.Component);
+
+exports['default'] = GoogleMapMap;
+module.exports = exports['default'];
+},{"react":357}],10:[function(require,module,exports){
+'use strict';
+
+Object.defineProperty(exports, '__esModule', {
+ value: true
+});
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
+
+var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
+
+var _react = require('react');
+
+var _react2 = _interopRequireDefault(_react);
+
+var _reactPureRenderFunction = require('react-pure-render/function');
+
+var _reactPureRenderFunction2 = _interopRequireDefault(_reactPureRenderFunction);
+
+var mainStyle = {
+ width: '100%',
+ height: '100%',
+ left: 0,
+ top: 0,
+ margin: 0,
+ padding: 0,
+ position: 'absolute'
+};
+
+var style = {
+ width: 0,
+ height: 0,
+ left: 0,
+ top: 0,
+ backgroundColor: 'transparent',
+ position: 'absolute'
+};
+
+var GoogleMapMarkers = (function (_Component) {
+ function GoogleMapMarkers(props) {
+ var _this = this;
+
+ _classCallCheck(this, GoogleMapMarkers);
+
+ _get(Object.getPrototypeOf(GoogleMapMarkers.prototype), 'constructor', this).call(this, props);
+ this.shouldComponentUpdate = _reactPureRenderFunction2['default'];
+
+ this._getState = function () {
+ return {
+ children: _this.props.dispatcher.getChildren(),
+ updateCounter: _this.props.dispatcher.getUpdateCounter()
+ };
+ };
+
+ this._onChangeHandler = function () {
+ if (!_this.dimesionsCache_) {
+ return;
+ }
+
+ var state = _this._getState();
+ _this.setState(state);
+ };
+
+ this._onChildClick = function () {
+ if (_this.props.onChildClick) {
+ if (_this.hoverChildProps_) {
+ var hoverKey = _this.hoverKey_;
+ var childProps = _this.hoverChildProps_;
+ // click works only on hovered item
+ _this.props.onChildClick(hoverKey, childProps);
+ }
+ }
+ };
+
+ this._onChildMouseEnter = function (hoverKey, childProps) {
+ if (!_this.dimesionsCache_) {
+ return;
+ }
+
+ if (_this.props.onChildMouseEnter) {
+ _this.props.onChildMouseEnter(hoverKey, childProps);
+ }
+
+ _this.hoverChildProps_ = childProps;
+ _this.hoverKey_ = hoverKey;
+ _this.setState({ hoverKey: hoverKey });
+ };
+
+ this._onChildMouseLeave = function () {
+ if (!_this.dimesionsCache_) {
+ return;
+ }
+
+ var hoverKey = _this.hoverKey_;
+ var childProps = _this.hoverChildProps_;
+
+ if (hoverKey !== undefined && hoverKey !== null) {
+ if (_this.props.onChildMouseLeave) {
+ _this.props.onChildMouseLeave(hoverKey, childProps);
+ }
+
+ _this.hoverKey_ = null;
+ _this.hoverChildProps_ = null;
+ _this.setState({ hoverKey: null });
+ }
+ };
+
+ this._onMouseAllow = function (value) {
+ if (!value) {
+ _this._onChildMouseLeave();
+ }
+
+ _this.allowMouse_ = value;
+ };
+
+ this._onMouseChangeHandler = function () {
+ if (_this.allowMouse_) {
+ _this._onMouseChangeHandler_raf();
+ }
+ };
+
+ this._onMouseChangeHandler_raf = function () {
+ if (!_this.dimesionsCache_) {
+ return;
+ }
+
+ var mp = _this.props.dispatcher.getMousePosition();
+
+ if (mp) {
+ (function () {
+ var distances = [];
+
+ _react2['default'].Children.forEach(_this.state.children, function (child, childIndex) {
+ var childKey = child.key !== undefined && child.key !== null ? child.key : childIndex;
+ var dist = _this.props.distanceToMouse(_this.dimesionsCache_[childKey], mp, child.props);
+ if (dist < _this.props.hoverDistance) {
+ distances.push({
+ key: childKey,
+ dist: dist,
+ props: child.props
+ });
+ }
+ });
+
+ if (distances.length) {
+ distances.sort(function (a, b) {
+ return a.dist - b.dist;
+ });
+ var hoverKey = distances[0].key;
+ var childProps = distances[0].props;
+
+ if (_this.hoverKey_ !== hoverKey) {
+ _this._onChildMouseLeave();
+
+ _this._onChildMouseEnter(hoverKey, childProps);
+ }
+ } else {
+ _this._onChildMouseLeave();
+ }
+ })();
+ } else {
+ _this._onChildMouseLeave();
+ }
+ };
+
+ this._getDimensions = function (key) {
+ var childKey = key;
+ return _this.dimesionsCache_[childKey];
+ };
+
+ this.props.dispatcher.on('kON_CHANGE', this._onChangeHandler);
+ this.props.dispatcher.on('kON_MOUSE_POSITION_CHANGE', this._onMouseChangeHandler);
+ this.props.dispatcher.on('kON_CLICK', this._onChildClick);
+
+ this.dimesionsCache_ = {};
+ this.hoverKey_ = null;
+ this.hoverChildProps_ = null;
+ this.allowMouse_ = true;
+
+ this.state = _extends({}, this._getState(), { hoverKey: null });
+ }
+
+ _inherits(GoogleMapMarkers, _Component);
+
+ _createClass(GoogleMapMarkers, [{
+ key: 'componentWillUnmount',
+ value: function componentWillUnmount() {
+ this.props.dispatcher.removeListener('kON_CHANGE', this._onChangeHandler);
+ this.props.dispatcher.removeListener('kON_MOUSE_POSITION_CHANGE', this._onMouseChangeHandler);
+ this.props.dispatcher.removeListener('kON_CLICK', this._onChildClick);
+
+ this.dimesionsCache_ = null;
+ }
+ }, {
+ key: 'render',
+ value: function render() {
+ var _this2 = this;
+
+ var mainElementStyle = this.props.style || mainStyle;
+
+ this.dimesionsCache_ = {};
+
+ var markers = _react2['default'].Children.map(this.state.children, function (child, childIndex) {
+ var pt = _this2.props.geoService.project({ lat: child.props.lat, lng: child.props.lng }, _this2.props.projectFromLeftTop);
+ var stylePtPos = {
+ left: pt.x,
+ top: pt.y
+ };
+
+ var dx = 0;
+ var dy = 0;
+
+ if (!_this2.props.projectFromLeftTop) {
+ // center projection
+ if (_this2.props.geoService.hasSize()) {
+ dx = _this2.props.geoService.getWidth() / 2;
+ dy = _this2.props.geoService.getHeight() / 2;
+ }
+ }
+
+ // to prevent rerender on child element i need to pass const params $getDimensions and $dimensionKey instead of dimension object
+ var childKey = child.key !== undefined && child.key !== null ? child.key : childIndex;
+ _this2.dimesionsCache_[childKey] = { x: pt.x + dx, y: pt.y + dy, lat: child.props.lat, lng: child.props.lng };
+
+ return _react2['default'].createElement(
+ 'div',
+ { key: childKey, style: _extends({}, style, stylePtPos) },
+ _react2['default'].cloneElement(child, {
+ $hover: childKey === _this2.state.hoverKey,
+ $getDimensions: _this2._getDimensions,
+ $dimensionKey: childKey,
+ $geoService: _this2.props.geoService,
+ $onMouseAllow: _this2._onMouseAllow
+ })
+ );
+ });
+
+ return _react2['default'].createElement(
+ 'div',
+ { style: mainElementStyle },
+ markers
+ );
+ }
+ }], [{
+ key: 'propTypes',
+ value: {
+ geoService: _react.PropTypes.any,
+ style: _react.PropTypes.any,
+ distanceToMouse: _react.PropTypes.func,
+ dispatcher: _react.PropTypes.any,
+ onChildClick: _react.PropTypes.func,
+ onChildMouseLeave: _react.PropTypes.func,
+ onChildMouseEnter: _react.PropTypes.func,
+ hoverDistance: _react.PropTypes.number,
+ projectFromLeftTop: _react.PropTypes.bool
+ },
+ enumerable: true
+ }, {
+ key: 'defaultProps',
+ value: {
+ projectFromLeftTop: false
+ },
+ enumerable: true
+ }]);
+
+ return GoogleMapMarkers;
+})(_react.Component);
+
+exports['default'] = GoogleMapMarkers;
+module.exports = exports['default'];
+},{"react":357,"react-pure-render/function":54}],11:[function(require,module,exports){
+'use strict';
+
+Object.defineProperty(exports, '__esModule', {
+ value: true
+});
+
+var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
+
+var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
+
+var _react = require('react');
+
+var _react2 = _interopRequireDefault(_react);
+
+var _google_map_markersJs = require('./google_map_markers.js');
+
+var _google_map_markersJs2 = _interopRequireDefault(_google_map_markersJs);
+
+var style = {
+ width: '50%',
+ height: '50%',
+ left: '50%',
+ top: '50%',
+ // backgroundColor: 'red',
+ margin: 0,
+ padding: 0,
+ position: 'absolute'
+ // opacity: 0.3
+};
+
+var GoogleMapMarkersPrerender = (function (_Component) {
+ function GoogleMapMarkersPrerender(props) {
+ _classCallCheck(this, GoogleMapMarkersPrerender);
+
+ _get(Object.getPrototypeOf(GoogleMapMarkersPrerender.prototype), 'constructor', this).call(this, props);
+ }
+
+ _inherits(GoogleMapMarkersPrerender, _Component);
+
+ _createClass(GoogleMapMarkersPrerender, [{
+ key: 'render',
+ value: function render() {
+ return _react2['default'].createElement(
+ 'div',
+ { style: style },
+ _react2['default'].createElement(_google_map_markersJs2['default'], this.props)
+ );
+ }
+ }]);
+
+ return GoogleMapMarkersPrerender;
+})(_react.Component);
+
+exports['default'] = GoogleMapMarkersPrerender;
+module.exports = exports['default'];
+},{"./google_map_markers.js":10,"react":357}],12:[function(require,module,exports){
+'use strict';
+
+Object.defineProperty(exports, '__esModule', {
+ value: true
+});
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
+
+function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
+
+var _google_mapJs = require('./google_map.js');
+
+_defaults(exports, _interopRequireWildcard(_google_mapJs));
+},{"./google_map.js":8}],13:[function(require,module,exports){
+'use strict';
+
+Object.defineProperty(exports, '__esModule', {
+ value: true
+});
+
+var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
+
+var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
+
+var _eventemitter3 = require('eventemitter3');
+
+var _eventemitter32 = _interopRequireDefault(_eventemitter3);
+
+var MarkerDispatcher = (function (_EventEmitter) {
+ function MarkerDispatcher(gmapInstance) {
+ _classCallCheck(this, MarkerDispatcher);
+
+ _get(Object.getPrototypeOf(MarkerDispatcher.prototype), 'constructor', this).call(this);
+ this.gmapInstance = gmapInstance;
+ }
+
+ _inherits(MarkerDispatcher, _EventEmitter);
+
+ _createClass(MarkerDispatcher, [{
+ key: 'getChildren',
+ value: function getChildren() {
+ return this.gmapInstance.props.children;
+ }
+ }, {
+ key: 'getMousePosition',
+ value: function getMousePosition() {
+ return this.gmapInstance.mouse_;
+ }
+ }, {
+ key: 'getUpdateCounter',
+ value: function getUpdateCounter() {
+ return this.gmapInstance.updateCounter_;
+ }
+ }, {
+ key: 'dispose',
+ value: function dispose() {
+ this.gmapInstance = null;
+ this.removeAllListeners();
+ }
+ }]);
+
+ return MarkerDispatcher;
+})(_eventemitter32['default']);
+
+exports['default'] = MarkerDispatcher;
+module.exports = exports['default'];
+},{"eventemitter3":21}],14:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports["default"] = isArraysEqualEps;
+
+function isArraysEqualEps(arrayA, arrayB, eps) {
+ if (arrayA && arrayB) {
+ for (var i = 0; i !== arrayA.length; ++i) {
+ if (Math.abs(arrayA[i] - arrayB[i]) > eps) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+}
+
+module.exports = exports["default"];
+},{}],15:[function(require,module,exports){
+// code here http://stackoverflow.com/questions/5899783/detect-safari-chrome-ie-firefox-opera-with-user-agent
+'use strict';
+
+Object.defineProperty(exports, '__esModule', {
+ value: true
+});
+exports['default'] = detectBrowser;
+var detectBrowserResult_ = null;
+
+function detectBrowser() {
+ if (detectBrowserResult_) {
+ return detectBrowserResult_;
+ }
+
+ if (typeof navigator !== 'undefined') {
+ var isExplorer = navigator.userAgent.indexOf('MSIE') > -1;
+ var isFirefox = navigator.userAgent.indexOf('Firefox') > -1;
+ var isOpera = navigator.userAgent.toLowerCase().indexOf('op') > -1;
+
+ var isChrome = navigator.userAgent.indexOf('Chrome') > -1;
+ var isSafari = navigator.userAgent.indexOf('Safari') > -1;
+
+ if (isChrome && isSafari) {
+ isSafari = false;
+ }
+
+ if (isChrome && isOpera) {
+ isChrome = false;
+ }
+
+ detectBrowserResult_ = { isExplorer: isExplorer, isFirefox: isFirefox, isOpera: isOpera, isChrome: isChrome, isSafari: isSafari };
+ return detectBrowserResult_;
+ }
+
+ detectBrowserResult_ = { isChrome: true, isExplorer: false, isFirefox: false, isOpera: false, isSafari: false };
+ return detectBrowserResult_;
+}
+
+module.exports = exports['default'];
+},{}],16:[function(require,module,exports){
+'use strict';
+
+Object.defineProperty(exports, '__esModule', {
+ value: true
+});
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+var _lib_geoLat_lngJs = require('./lib_geo/lat_lng.js');
+
+var _lib_geoLat_lngJs2 = _interopRequireDefault(_lib_geoLat_lngJs);
+
+var _pointGeometry = require('point-geometry');
+
+var _pointGeometry2 = _interopRequireDefault(_pointGeometry);
+
+var _lib_geoTransformJs = require('./lib_geo/transform.js');
+
+var _lib_geoTransformJs2 = _interopRequireDefault(_lib_geoTransformJs);
+
+var Geo = (function () {
+ function Geo(tileSize) {
+ _classCallCheck(this, Geo);
+
+ // left_top view пользует гугл
+ // super();
+ this.hasSize_ = false;
+ this.hasView_ = false;
+ this.transform_ = new _lib_geoTransformJs2['default'](tileSize || 512);
+ }
+
+ _createClass(Geo, [{
+ key: 'setView',
+ value: function setView(center, zoom, bearing) {
+ this.transform_.center = _lib_geoLat_lngJs2['default'].convert(center);
+ this.transform_.zoom = +zoom;
+ this.transform_.bearing = +bearing;
+ this.hasView_ = true;
+ }
+ }, {
+ key: 'setViewSize',
+ value: function setViewSize(width, height) {
+ this.transform_.width = width;
+ this.transform_.height = height;
+ this.hasSize_ = true;
+ }
+ }, {
+ key: 'canProject',
+ value: function canProject() {
+ return this.hasSize_ && this.hasView_;
+ }
+ }, {
+ key: 'hasSize',
+ value: function hasSize() {
+ return this.hasSize_;
+ }
+ }, {
+ key: 'unproject',
+ value: function unproject(ptXY, viewFromLeftTop) {
+ var ptRes = undefined;
+ if (viewFromLeftTop) {
+ var ptxy = _extends({}, ptXY);
+ ptxy.x -= this.transform_.width / 2;
+ ptxy.y -= this.transform_.height / 2;
+ ptRes = this.transform_.pointLocation(_pointGeometry2['default'].convert(ptxy));
+ } else {
+ ptRes = this.transform_.pointLocation(_pointGeometry2['default'].convert(ptXY));
+ }
+
+ ptRes.lng -= 360 * Math.round(ptRes.lng / 360); // convert 2 google format
+ return ptRes;
+ }
+ }, {
+ key: 'project',
+ value: function project(ptLatLng, viewFromLeftTop) {
+ if (viewFromLeftTop) {
+ var pt = this.transform_.locationPoint(_lib_geoLat_lngJs2['default'].convert(ptLatLng));
+ pt.x -= this.transform_.worldSize * Math.round(pt.x / this.transform_.worldSize);
+
+ pt.x += this.transform_.width / 2;
+ pt.y += this.transform_.height / 2;
+
+ return pt;
+ }
+
+ return this.transform_.locationPoint(_lib_geoLat_lngJs2['default'].convert(ptLatLng));
+ }
+ }, {
+ key: 'getWidth',
+ value: function getWidth() {
+ return this.transform_.width;
+ }
+ }, {
+ key: 'getHeight',
+ value: function getHeight() {
+ return this.transform_.height;
+ }
+ }, {
+ key: 'getZoom',
+ value: function getZoom() {
+ return this.transform_.zoom;
+ }
+ }, {
+ key: 'getCenter',
+ value: function getCenter() {
+ var ptRes = this.transform_.pointLocation({ x: 0, y: 0 });
+
+ return ptRes;
+ }
+ }, {
+ key: 'getBounds',
+ value: function getBounds(margins, roundFactor) {
+ var bndT = margins && margins[0] || 0;
+ var bndR = margins && margins[1] || 0;
+ var bndB = margins && margins[2] || 0;
+ var bndL = margins && margins[3] || 0;
+
+ if (this.getWidth() - bndR - bndL > 0 && this.getHeight() - bndT - bndB > 0) {
+ var topLeftCorner = this.unproject({ x: bndL - this.getWidth() / 2, y: bndT - this.getHeight() / 2 });
+ var bottomRightCorner = this.unproject({ x: this.getWidth() / 2 - bndR, y: this.getHeight() / 2 - bndB });
+
+ var res = [topLeftCorner.lat, topLeftCorner.lng, bottomRightCorner.lat, bottomRightCorner.lng];
+
+ if (roundFactor) {
+ res = res.map(function (r) {
+ return Math.round(r * roundFactor) / roundFactor;
+ });
+ }
+ return res;
+ }
+
+ return [0, 0, 0, 0];
+ }
+ }]);
+
+ return Geo;
+})();
+
+exports['default'] = Geo;
+module.exports = exports['default'];
+},{"./lib_geo/lat_lng.js":17,"./lib_geo/transform.js":18,"point-geometry":53}],17:[function(require,module,exports){
+'use strict';
+
+module.exports = LatLng;
+
+var wrap = require('./wrap.js').wrap;
+
+function LatLng(lat, lng) {
+ if (isNaN(lat) || isNaN(lng)) {
+ throw new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')');
+ }
+ this.lat = +lat;
+ this.lng = +lng;
+}
+
+LatLng.prototype.wrap = function () {
+ return new LatLng(this.lat, wrap(this.lng, -180, 180));
+};
+
+// constructs LatLng from an array if necessary
+
+LatLng.convert = function (a) {
+ if (a instanceof LatLng) {
+ return a;
+ }
+ if (Array.isArray(a)) {
+ return new LatLng(a[0], a[1]);
+ }
+ return a;
+};
+},{"./wrap.js":19}],18:[function(require,module,exports){
+'use strict';
+
+var LatLng = require('./lat_lng');
+var Point = require('point-geometry');
+var wrap = require('./wrap.js').wrap;
+
+// A single transform, generally used for a single tile to be scaled, rotated, and zoomed.
+
+function Transform(tileSize, minZoom, maxZoom) {
+ this.tileSize = tileSize || 512; // constant
+
+ this._minZoom = minZoom || 0;
+ this._maxZoom = maxZoom || 52;
+
+ this.latRange = [-85.05113, 85.05113];
+
+ this.width = 0;
+ this.height = 0;
+ this.zoom = 0;
+ this.center = new LatLng(0, 0);
+ this.angle = 0;
+}
+
+Transform.prototype = Object.defineProperties({
+
+ zoomScale: function zoomScale(zoom) {
+ return Math.pow(2, zoom);
+ },
+ scaleZoom: function scaleZoom(scale) {
+ return Math.log(scale) / Math.LN2;
+ },
+
+ project: function project(latlng, worldSize) {
+ return new Point(this.lngX(latlng.lng, worldSize), this.latY(latlng.lat, worldSize));
+ },
+
+ unproject: function unproject(point, worldSize) {
+ return new LatLng(this.yLat(point.y, worldSize), this.xLng(point.x, worldSize));
+ },
+
+ // lat/lon <-> absolute pixel coords convertion
+ lngX: function lngX(lon, worldSize) {
+ return (180 + lon) * (worldSize || this.worldSize) / 360;
+ },
+ // latitude to absolute y coord
+ latY: function latY(lat, worldSize) {
+ var y = 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360));
+ return (180 - y) * (worldSize || this.worldSize) / 360;
+ },
+
+ xLng: function xLng(x, worldSize) {
+ return x * 360 / (worldSize || this.worldSize) - 180;
+ },
+ yLat: function yLat(y, worldSize) {
+ var y2 = 180 - y * 360 / (worldSize || this.worldSize);
+ return 360 / Math.PI * Math.atan(Math.exp(y2 * Math.PI / 180)) - 90;
+ },
+
+ locationPoint: function locationPoint(latlng) {
+ var p = this.project(latlng);
+ return this.centerPoint._sub(this.point._sub(p)._rotate(this.angle));
+ },
+
+ pointLocation: function pointLocation(p) {
+ var p2 = this.centerPoint._sub(p)._rotate(-this.angle);
+ return this.unproject(this.point.sub(p2));
+ }
+
+}, {
+ minZoom: {
+ get: function () {
+ return this._minZoom;
+ },
+ set: function (zoom) {
+ this._minZoom = zoom;
+ this.zoom = Math.max(this.zoom, zoom);
+ },
+ configurable: true,
+ enumerable: true
+ },
+ maxZoom: {
+ get: function () {
+ return this._maxZoom;
+ },
+ set: function (zoom) {
+ this._maxZoom = zoom;
+ this.zoom = Math.min(this.zoom, zoom);
+ },
+ configurable: true,
+ enumerable: true
+ },
+ worldSize: {
+ get: function () {
+ return this.tileSize * this.scale;
+ },
+ configurable: true,
+ enumerable: true
+ },
+ centerPoint: {
+ get: function () {
+ return new Point(0, 0); // this.size._div(2);
+ },
+ configurable: true,
+ enumerable: true
+ },
+ size: {
+ get: function () {
+ return new Point(this.width, this.height);
+ },
+ configurable: true,
+ enumerable: true
+ },
+ bearing: {
+ get: function () {
+ return -this.angle / Math.PI * 180;
+ },
+ set: function (bearing) {
+ this.angle = -wrap(bearing, -180, 180) * Math.PI / 180;
+ },
+ configurable: true,
+ enumerable: true
+ },
+ zoom: {
+ get: function () {
+ return this._zoom;
+ },
+ set: function (zoom) {
+ zoom = Math.min(Math.max(zoom, this.minZoom), this.maxZoom);
+ this._zoom = zoom;
+ this.scale = this.zoomScale(zoom);
+ this.tileZoom = Math.floor(zoom);
+ this.zoomFraction = zoom - this.tileZoom;
+ },
+ configurable: true,
+ enumerable: true
+ },
+ x: {
+ get: function () {
+ return this.lngX(this.center.lng);
+ },
+ configurable: true,
+ enumerable: true
+ },
+ y: {
+ get: function () {
+ return this.latY(this.center.lat);
+ },
+ configurable: true,
+ enumerable: true
+ },
+ point: {
+ get: function () {
+ return new Point(this.x, this.y);
+ },
+ configurable: true,
+ enumerable: true
+ }
+});
+
+module.exports = Transform;
+},{"./lat_lng":17,"./wrap.js":19,"point-geometry":53}],19:[function(require,module,exports){
+'use strict';
+
+exports.wrap = function (n, min, max) {
+ var d = max - min;
+ return n === max ? n : ((n - min) % d + d) % d + min;
+};
+},{}],20:[function(require,module,exports){
+'use strict';
+
+var $script_ = null;
+
+var _loadPromise = undefined;
+
+// TODO add libraries language and other map options
+module.exports = function googleMapLoader(apiKey) {
+ if (!$script_) {
+ $script_ = require('scriptjs');
+ }
+
+ if (_loadPromise) {
+ return _loadPromise;
+ }
+
+ _loadPromise = new Promise(function (resolve, reject) {
+ if (typeof window === 'undefined') {
+ reject(new Error('google map cannot be loaded outside browser env'));
+ return;
+ }
+
+ if (window.google && window.google.maps) {
+ resolve(window.google.maps);
+ return;
+ }
+
+ if (typeof window._$_google_map_initialize_$_ !== 'undefined') {
+ reject(new Error('google map initialization error'));
+ }
+
+ window._$_google_map_initialize_$_ = function () {
+ delete window._$_google_map_initialize_$_;
+ resolve(window.google.maps);
+ };
+
+ var apiKeyString = apiKey ? '&key=' + apiKey : '';
+
+ $script_('https://maps.googleapis.com/maps/api/js?callback=_$_google_map_initialize_$_' + apiKeyString, function () {
+ if (typeof window.google === 'undefined') {
+ reject(new Error('google map initialization error (not loaded)'));
+ }
+ });
+ });
+
+ return _loadPromise;
+};
+},{"scriptjs":56}],21:[function(require,module,exports){
+'use strict';
+
+//
+// We store our EE objects in a plain object whose properties are event names.
+// If `Object.create(null)` is not supported we prefix the event names with a
+// `~` to make sure that the built-in object properties are not overridden or
+// used as an attack vector.
+// We also assume that `Object.create(null)` is available when the event name
+// is an ES6 Symbol.
+//
+var prefix = typeof Object.create !== 'function' ? '~' : false;
+
+/**
+ * Representation of a single EventEmitter function.
+ *
+ * @param {Function} fn Event handler to be called.
+ * @param {Mixed} context Context for function execution.
+ * @param {Boolean} once Only emit once
+ * @api private
+ */
+function EE(fn, context, once) {
+ this.fn = fn;
+ this.context = context;
+ this.once = once || false;
+}
+
+/**
+ * Minimal EventEmitter interface that is molded against the Node.js
+ * EventEmitter interface.
+ *
+ * @constructor
+ * @api public
+ */
+function EventEmitter() { /* Nothing to set */ }
+
+/**
+ * Holds the assigned EventEmitters by name.
+ *
+ * @type {Object}
+ * @private
+ */
+EventEmitter.prototype._events = undefined;
+
+/**
+ * Return a list of assigned event listeners.
+ *
+ * @param {String} event The events that should be listed.
+ * @param {Boolean} exists We only need to know if there are listeners.
+ * @returns {Array|Boolean}
+ * @api public
+ */
+EventEmitter.prototype.listeners = function listeners(event, exists) {
+ var evt = prefix ? prefix + event : event
+ , available = this._events && this._events[evt];
+
+ if (exists) return !!available;
+ if (!available) return [];
+ if (available.fn) return [available.fn];
+
+ for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
+ ee[i] = available[i].fn;
+ }
+
+ return ee;
+};
+
+/**
+ * Emit an event to all registered event listeners.
+ *
+ * @param {String} event The name of the event.
+ * @returns {Boolean} Indication if we've emitted an event.
+ * @api public
+ */
+EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
+ var evt = prefix ? prefix + event : event;
+
+ if (!this._events || !this._events[evt]) return false;
+
+ var listeners = this._events[evt]
+ , len = arguments.length
+ , args
+ , i;
+
+ if ('function' === typeof listeners.fn) {
+ if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
+
+ switch (len) {
+ case 1: return listeners.fn.call(listeners.context), true;
+ case 2: return listeners.fn.call(listeners.context, a1), true;
+ case 3: return listeners.fn.call(listeners.context, a1, a2), true;
+ case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
+ case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
+ case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
+ }
+
+ for (i = 1, args = new Array(len -1); i < len; i++) {
+ args[i - 1] = arguments[i];
+ }
+
+ listeners.fn.apply(listeners.context, args);
+ } else {
+ var length = listeners.length
+ , j;
+
+ for (i = 0; i < length; i++) {
+ if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
+
+ switch (len) {
+ case 1: listeners[i].fn.call(listeners[i].context); break;
+ case 2: listeners[i].fn.call(listeners[i].context, a1); break;
+ case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
+ default:
+ if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
+ args[j - 1] = arguments[j];
+ }
+
+ listeners[i].fn.apply(listeners[i].context, args);
+ }
+ }
+ }
+
+ return true;
+};
+
+/**
+ * Register a new EventListener for the given event.
+ *
+ * @param {String} event Name of the event.
+ * @param {Functon} fn Callback function.
+ * @param {Mixed} context The context of the function.
+ * @api public
+ */
+EventEmitter.prototype.on = function on(event, fn, context) {
+ var listener = new EE(fn, context || this)
+ , evt = prefix ? prefix + event : event;
+
+ if (!this._events) this._events = prefix ? {} : Object.create(null);
+ if (!this._events[evt]) this._events[evt] = listener;
+ else {
+ if (!this._events[evt].fn) this._events[evt].push(listener);
+ else this._events[evt] = [
+ this._events[evt], listener
+ ];
+ }
+
+ return this;
+};
+
+/**
+ * Add an EventListener that's only called once.
+ *
+ * @param {String} event Name of the event.
+ * @param {Function} fn Callback function.
+ * @param {Mixed} context The context of the function.
+ * @api public
+ */
+EventEmitter.prototype.once = function once(event, fn, context) {
+ var listener = new EE(fn, context || this, true)
+ , evt = prefix ? prefix + event : event;
+
+ if (!this._events) this._events = prefix ? {} : Object.create(null);
+ if (!this._events[evt]) this._events[evt] = listener;
+ else {
+ if (!this._events[evt].fn) this._events[evt].push(listener);
+ else this._events[evt] = [
+ this._events[evt], listener
+ ];
+ }
+
+ return this;
+};
+
+/**
+ * Remove event listeners.
+ *
+ * @param {String} event The event we want to remove.
+ * @param {Function} fn The listener that we need to find.
+ * @param {Mixed} context Only remove listeners matching this context.
+ * @param {Boolean} once Only remove once listeners.
+ * @api public
+ */
+EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
+ var evt = prefix ? prefix + event : event;
+
+ if (!this._events || !this._events[evt]) return this;
+
+ var listeners = this._events[evt]
+ , events = [];
+
+ if (fn) {
+ if (listeners.fn) {
+ if (
+ listeners.fn !== fn
+ || (once && !listeners.once)
+ || (context && listeners.context !== context)
+ ) {
+ events.push(listeners);
+ }
+ } else {
+ for (var i = 0, length = listeners.length; i < length; i++) {
+ if (
+ listeners[i].fn !== fn
+ || (once && !listeners[i].once)
+ || (context && listeners[i].context !== context)
+ ) {
+ events.push(listeners[i]);
+ }
+ }
+ }
+ }
+
+ //
+ // Reset the array, or remove it completely if we have no more listeners.
+ //
+ if (events.length) {
+ this._events[evt] = events.length === 1 ? events[0] : events;
+ } else {
+ delete this._events[evt];
+ }
+
+ return this;
+};
+
+/**
+ * Remove all listeners or only the listeners for the specified event.
+ *
+ * @param {String} event The event want to remove all listeners for.
+ * @api public
+ */
+EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
+ if (!this._events) return this;
+
+ if (event) delete this._events[prefix ? prefix + event : event];
+ else this._events = prefix ? {} : Object.create(null);
+
+ return this;
+};
+
+//
+// Alias methods names because people roll like that.
+//
+EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
+EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+
+//
+// This function doesn't apply anymore.
+//
+EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
+ return this;
+};
+
+//
+// Expose the prefix.
+//
+EventEmitter.prefixed = prefix;
+
+//
+// Expose the module.
+//
+if ('undefined' !== typeof module) {
+ module.exports = EventEmitter;
+}
+
+},{}],22:[function(require,module,exports){
+/**
+ * lodash 3.2.0 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+var baseAssign = require('lodash._baseassign'),
+ createAssigner = require('lodash._createassigner'),
+ keys = require('lodash.keys');
+
+/**
+ * A specialized version of `_.assign` for customizing assigned values without
+ * support for argument juggling, multiple sources, and `this` binding `customizer`
+ * functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} customizer The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ */
+function assignWith(object, source, customizer) {
+ var index = -1,
+ props = keys(source),
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index],
+ value = object[key],
+ result = customizer(value, source[key], key, object, source);
+
+ if ((result === result ? (result !== value) : (value === value)) ||
+ (value === undefined && !(key in object))) {
+ object[key] = result;
+ }
+ }
+ return object;
+}
+
+/**
+ * Assigns own enumerable properties of source object(s) to the destination
+ * object. Subsequent sources overwrite property assignments of previous sources.
+ * If `customizer` is provided it is invoked to produce the assigned values.
+ * The `customizer` is bound to `thisArg` and invoked with five arguments:
+ * (objectValue, sourceValue, key, object, source).
+ *
+ * **Note:** This method mutates `object` and is based on
+ * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).
+ *
+ * @static
+ * @memberOf _
+ * @alias extend
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
+ * // => { 'user': 'fred', 'age': 40 }
+ *
+ * // using a customizer callback
+ * var defaults = _.partialRight(_.assign, function(value, other) {
+ * return _.isUndefined(value) ? other : value;
+ * });
+ *
+ * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+var assign = createAssigner(function(object, source, customizer) {
+ return customizer
+ ? assignWith(object, source, customizer)
+ : baseAssign(object, source);
+});
+
+module.exports = assign;
+
+},{"lodash._baseassign":23,"lodash._createassigner":25,"lodash.keys":29}],23:[function(require,module,exports){
+/**
+ * lodash 3.2.0 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+var baseCopy = require('lodash._basecopy'),
+ keys = require('lodash.keys');
+
+/**
+ * The base implementation of `_.assign` without support for argument juggling,
+ * multiple sources, and `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+function baseAssign(object, source) {
+ return source == null
+ ? object
+ : baseCopy(source, keys(source), object);
+}
+
+module.exports = baseAssign;
+
+},{"lodash._basecopy":24,"lodash.keys":29}],24:[function(require,module,exports){
+/**
+ * lodash 3.0.1 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property names to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @returns {Object} Returns `object`.
+ */
+function baseCopy(source, props, object) {
+ object || (object = {});
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ object[key] = source[key];
+ }
+ return object;
+}
+
+module.exports = baseCopy;
+
+},{}],25:[function(require,module,exports){
+/**
+ * lodash 3.1.1 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+var bindCallback = require('lodash._bindcallback'),
+ isIterateeCall = require('lodash._isiterateecall'),
+ restParam = require('lodash.restparam');
+
+/**
+ * Creates a function that assigns properties of source object(s) to a given
+ * destination object.
+ *
+ * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`.
+ *
+ * @private
+ * @param {Function} assigner The function to assign values.
+ * @returns {Function} Returns the new assigner function.
+ */
+function createAssigner(assigner) {
+ return restParam(function(object, sources) {
+ var index = -1,
+ length = object == null ? 0 : sources.length,
+ customizer = length > 2 ? sources[length - 2] : undefined,
+ guard = length > 2 ? sources[2] : undefined,
+ thisArg = length > 1 ? sources[length - 1] : undefined;
+
+ if (typeof customizer == 'function') {
+ customizer = bindCallback(customizer, thisArg, 5);
+ length -= 2;
+ } else {
+ customizer = typeof thisArg == 'function' ? thisArg : undefined;
+ length -= (customizer ? 1 : 0);
+ }
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
+ customizer = length < 3 ? undefined : customizer;
+ length = 1;
+ }
+ while (++index < length) {
+ var source = sources[index];
+ if (source) {
+ assigner(object, source, customizer);
+ }
+ }
+ return object;
+ });
+}
+
+module.exports = createAssigner;
+
+},{"lodash._bindcallback":26,"lodash._isiterateecall":27,"lodash.restparam":28}],26:[function(require,module,exports){
+/**
+ * lodash 3.0.1 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/**
+ * A specialized version of `baseCallback` which only supports `this` binding
+ * and specifying the number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function bindCallback(func, thisArg, argCount) {
+ if (typeof func != 'function') {
+ return identity;
+ }
+ if (thisArg === undefined) {
+ return func;
+ }
+ switch (argCount) {
+ case 1: return function(value) {
+ return func.call(thisArg, value);
+ };
+ case 3: return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ case 4: return function(accumulator, value, index, collection) {
+ return func.call(thisArg, accumulator, value, index, collection);
+ };
+ case 5: return function(value, other, key, object, source) {
+ return func.call(thisArg, value, other, key, object, source);
+ };
+ }
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+}
+
+/**
+ * This method returns the first argument provided to it.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.identity(object) === object;
+ * // => true
+ */
+function identity(value) {
+ return value;
+}
+
+module.exports = bindCallback;
+
+},{}],27:[function(require,module,exports){
+/**
+ * lodash 3.0.9 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/** Used to detect unsigned integer values. */
+var reIsUint = /^\d+$/;
+
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+}
+
+/**
+ * Gets the "length" property value of `object`.
+ *
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {*} Returns the "length" value.
+ */
+var getLength = baseProperty('length');
+
+/**
+ * Checks if `value` is array-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ */
+function isArrayLike(value) {
+ return value != null && isLength(getLength(value));
+}
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return value > -1 && value % 1 == 0 && value < length;
+}
+
+/**
+ * Checks if the provided arguments are from an iteratee call.
+ *
+ * @private
+ * @param {*} value The potential iteratee value argument.
+ * @param {*} index The potential iteratee index or key argument.
+ * @param {*} object The potential iteratee object argument.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
+ */
+function isIterateeCall(value, index, object) {
+ if (!isObject(object)) {
+ return false;
+ }
+ var type = typeof index;
+ if (type == 'number'
+ ? (isArrayLike(object) && isIndex(index, object.length))
+ : (type == 'string' && index in object)) {
+ var other = object[index];
+ return value === value ? (value === other) : (other !== other);
+ }
+ return false;
+}
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+module.exports = isIterateeCall;
+
+},{}],28:[function(require,module,exports){
+/**
+ * lodash 3.6.1 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of the
+ * created function and arguments from `start` and beyond provided as an array.
+ *
+ * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.restParam(function(what, names) {
+ * return what + ' ' + _.initial(names).join(', ') +
+ * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
+ * });
+ *
+ * say('hello', 'fred', 'barney', 'pebbles');
+ * // => 'hello fred, barney, & pebbles'
+ */
+function restParam(func, start) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
+ return function() {
+ var args = arguments,
+ index = -1,
+ length = nativeMax(args.length - start, 0),
+ rest = Array(length);
+
+ while (++index < length) {
+ rest[index] = args[start + index];
+ }
+ switch (start) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, args[0], rest);
+ case 2: return func.call(this, args[0], args[1], rest);
+ }
+ var otherArgs = Array(start + 1);
+ index = -1;
+ while (++index < start) {
+ otherArgs[index] = args[index];
+ }
+ otherArgs[start] = rest;
+ return func.apply(this, otherArgs);
+ };
+}
+
+module.exports = restParam;
+
+},{}],29:[function(require,module,exports){
+/**
+ * lodash 3.1.1 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+var getNative = require('lodash._getnative'),
+ isArguments = require('lodash.isarguments'),
+ isArray = require('lodash.isarray');
+
+/** Used to detect unsigned integer values. */
+var reIsUint = /^\d+$/;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeKeys = getNative(Object, 'keys');
+
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+}
+
+/**
+ * Gets the "length" property value of `object`.
+ *
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {*} Returns the "length" value.
+ */
+var getLength = baseProperty('length');
+
+/**
+ * Checks if `value` is array-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ */
+function isArrayLike(value) {
+ return value != null && isLength(getLength(value));
+}
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return value > -1 && value % 1 == 0 && value < length;
+}
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+/**
+ * A fallback implementation of `Object.keys` which creates an array of the
+ * own enumerable property names of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function shimKeys(object) {
+ var props = keysIn(object),
+ propsLength = props.length,
+ length = propsLength && object.length;
+
+ var allowIndexes = !!length && isLength(length) &&
+ (isArray(object) || isArguments(object));
+
+ var index = -1,
+ result = [];
+
+ while (++index < propsLength) {
+ var key = props[index];
+ if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+/**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+var keys = !nativeKeys ? shimKeys : function(object) {
+ var Ctor = object == null ? null : object.constructor;
+ if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
+ (typeof object != 'function' && isArrayLike(object))) {
+ return shimKeys(object);
+ }
+ return isObject(object) ? nativeKeys(object) : [];
+};
+
+/**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+function keysIn(object) {
+ if (object == null) {
+ return [];
+ }
+ if (!isObject(object)) {
+ object = Object(object);
+ }
+ var length = object.length;
+ length = (length && isLength(length) &&
+ (isArray(object) || isArguments(object)) && length) || 0;
+
+ var Ctor = object.constructor,
+ index = -1,
+ isProto = typeof Ctor == 'function' && Ctor.prototype === object,
+ result = Array(length),
+ skipIndexes = length > 0;
+
+ while (++index < length) {
+ result[index] = (index + '');
+ }
+ for (var key in object) {
+ if (!(skipIndexes && isIndex(key, length)) &&
+ !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = keys;
+
+},{"lodash._getnative":30,"lodash.isarguments":31,"lodash.isarray":32}],30:[function(require,module,exports){
+/**
+ * lodash 3.9.0 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]';
+
+/**
+ * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).
+ * In addition to special characters the forward slash is escaped to allow for
+ * easier `eval` use and `Function` compilation.
+ */
+var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g,
+ reHasRegExpChars = RegExp(reRegExpChars.source);
+
+/** Used to detect host constructors (Safari > 5). */
+var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` or `undefined` values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ if (typeof value == 'string') {
+ return value;
+ }
+ return value == null ? '' : (value + '');
+}
+
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to resolve the decompiled source of functions. */
+var fnToString = Function.prototype.toString;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Used to detect if a method is native. */
+var reIsNative = RegExp('^' +
+ escapeRegExp(fnToString.call(hasOwnProperty))
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+);
+
+/**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+function getNative(object, key) {
+ var value = object == null ? undefined : object[key];
+ return isNative(value) ? value : undefined;
+}
+
+/**
+ * Checks if `value` is a native function.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
+ * @example
+ *
+ * _.isNative(Array.prototype.push);
+ * // => true
+ *
+ * _.isNative(_);
+ * // => false
+ */
+function isNative(value) {
+ if (value == null) {
+ return false;
+ }
+ if (objToString.call(value) == funcTag) {
+ return reIsNative.test(fnToString.call(value));
+ }
+ return isObjectLike(value) && reIsHostCtor.test(value);
+}
+
+/**
+ * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
+ * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escapeRegExp('[lodash](https://lodash.com/)');
+ * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
+ */
+function escapeRegExp(string) {
+ string = baseToString(string);
+ return (string && reHasRegExpChars.test(string))
+ ? string.replace(reRegExpChars, '\\$&')
+ : string;
+}
+
+module.exports = getNative;
+
+},{}],31:[function(require,module,exports){
+/**
+ * lodash 3.0.3 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]';
+
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+}
+
+/**
+ * Gets the "length" property value of `object`.
+ *
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {*} Returns the "length" value.
+ */
+var getLength = baseProperty('length');
+
+/**
+ * Checks if `value` is array-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ */
+function isArrayLike(value) {
+ return value != null && isLength(getLength(value));
+}
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+/**
+ * Checks if `value` is classified as an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+function isArguments(value) {
+ return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag;
+}
+
+module.exports = isArguments;
+
+},{}],32:[function(require,module,exports){
+/**
+ * lodash 3.0.3 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/** `Object#toString` result references. */
+var arrayTag = '[object Array]',
+ funcTag = '[object Function]';
+
+/**
+ * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).
+ * In addition to special characters the forward slash is escaped to allow for
+ * easier `eval` use and `Function` compilation.
+ */
+var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g,
+ reHasRegExpChars = RegExp(reRegExpChars.source);
+
+/** Used to detect host constructors (Safari > 5). */
+var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` or `undefined` values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ if (typeof value == 'string') {
+ return value;
+ }
+ return value == null ? '' : (value + '');
+}
+
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to resolve the decompiled source of functions. */
+var fnToString = Function.prototype.toString;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Used to detect if a method is native. */
+var reIsNative = RegExp('^' +
+ escapeRegExp(fnToString.call(hasOwnProperty))
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+);
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsArray = getNative(Array, 'isArray');
+
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+function getNative(object, key) {
+ var value = object == null ? undefined : object[key];
+ return isNative(value) ? value : undefined;
+}
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(function() { return arguments; }());
+ * // => false
+ */
+var isArray = nativeIsArray || function(value) {
+ return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
+};
+
+/**
+ * Checks if `value` is a native function.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
+ * @example
+ *
+ * _.isNative(Array.prototype.push);
+ * // => true
+ *
+ * _.isNative(_);
+ * // => false
+ */
+function isNative(value) {
+ if (value == null) {
+ return false;
+ }
+ if (objToString.call(value) == funcTag) {
+ return reIsNative.test(fnToString.call(value));
+ }
+ return isObjectLike(value) && reIsHostCtor.test(value);
+}
+
+/**
+ * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
+ * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escapeRegExp('[lodash](https://lodash.com/)');
+ * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
+ */
+function escapeRegExp(string) {
+ string = baseToString(string);
+ return (string && reHasRegExpChars.test(string))
+ ? string.replace(reRegExpChars, '\\$&')
+ : string;
+}
+
+module.exports = isArray;
+
+},{}],33:[function(require,module,exports){
+(function (global){
+/**
+ * lodash 3.0.5 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]';
+
+/**
+ * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).
+ * In addition to special characters the forward slash is escaped to allow for
+ * easier `eval` use and `Function` compilation.
+ */
+var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g,
+ reHasRegExpChars = RegExp(reRegExpChars.source);
+
+/** Used to detect host constructors (Safari > 5). */
+var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+/**
+ * The base implementation of `_.isFunction` without support for environments
+ * with incorrect `typeof` results.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ */
+function baseIsFunction(value) {
+ // Avoid a Chakra JIT bug in compatibility modes of IE 11.
+ // See https://github.com/jashkenas/underscore/issues/1621 for more details.
+ return typeof value == 'function' || false;
+}
+
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` or `undefined` values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ if (typeof value == 'string') {
+ return value;
+ }
+ return value == null ? '' : (value + '');
+}
+
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to resolve the decompiled source of functions. */
+var fnToString = Function.prototype.toString;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Used to detect if a method is native. */
+var reIsNative = RegExp('^' +
+ escapeRegExp(fnToString.call(hasOwnProperty))
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+);
+
+/** Native method references. */
+var Uint8Array = getNative(global, 'Uint8Array');
+
+/**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+function getNative(object, key) {
+ var value = object == null ? undefined : object[key];
+ return isNative(value) ? value : undefined;
+}
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in older versions of Chrome and Safari which return 'function' for regexes
+ // and Safari 8 equivalents which return 'object' for typed array constructors.
+ return objToString.call(value) == funcTag;
+};
+
+/**
+ * Checks if `value` is a native function.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
+ * @example
+ *
+ * _.isNative(Array.prototype.push);
+ * // => true
+ *
+ * _.isNative(_);
+ * // => false
+ */
+function isNative(value) {
+ if (value == null) {
+ return false;
+ }
+ if (objToString.call(value) == funcTag) {
+ return reIsNative.test(fnToString.call(value));
+ }
+ return isObjectLike(value) && reIsHostCtor.test(value);
+}
+
+/**
+ * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
+ * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escapeRegExp('[lodash](https://lodash.com/)');
+ * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
+ */
+function escapeRegExp(string) {
+ string = baseToString(string);
+ return (string && reHasRegExpChars.test(string))
+ ? string.replace(reRegExpChars, '\\$&')
+ : string;
+}
+
+module.exports = isFunction;
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+
+},{}],34:[function(require,module,exports){
+/**
+ * lodash 3.0.1 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.2
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/** `Object#toString` result references. */
+var numberTag = '[object Number]';
+
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `Number` primitive or object.
+ *
+ * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
+ * as numbers, use the `_.isFinite` method.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isNumber(8.4);
+ * // => true
+ *
+ * _.isNumber(NaN);
+ * // => true
+ *
+ * _.isNumber('8.4');
+ * // => false
+ */
+function isNumber(value) {
+ return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
+}
+
+module.exports = isNumber;
+
+},{}],35:[function(require,module,exports){
+/**
+ * lodash 3.1.0 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+var baseFor = require('lodash._basefor'),
+ getNative = require('lodash._getnative'),
+ keysIn = require('lodash.keysin');
+
+/** `Object#toString` result references. */
+var objectTag = '[object Object]';
+
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Native method references. */
+var getPrototypeOf = getNative(Object, 'getPrototypeOf');
+
+/**
+ * The base implementation of `_.forIn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForIn(object, iteratee) {
+ return baseFor(object, iteratee, keysIn);
+}
+
+/**
+ * A fallback implementation of `_.isPlainObject` which checks if `value`
+ * is an object created by the `Object` constructor or has a `[[Prototype]]`
+ * of `null`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ */
+function shimIsPlainObject(value) {
+ var Ctor;
+
+ // Exit early for non `Object` objects.
+ if (!(isObjectLike(value) && objToString.call(value) == objectTag) ||
+ (!hasOwnProperty.call(value, 'constructor') &&
+ (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
+ return false;
+ }
+ // IE < 9 iterates inherited properties before own properties. If the first
+ // iterated property is an object's own property then there are no inherited
+ // enumerable properties.
+ var result;
+ // In most environments an object's own properties are iterated before
+ // its inherited properties. If the last iterated property is an object's
+ // own property then there are no inherited enumerable properties.
+ baseForIn(value, function(subValue, key) {
+ result = key;
+ });
+ return result === undefined || hasOwnProperty.call(value, result);
+}
+
+/**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * **Note:** This method assumes objects created by the `Object` constructor
+ * have no inherited enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */
+var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {
+ if (!(value && objToString.call(value) == objectTag)) {
+ return false;
+ }
+ var valueOf = getNative(value, 'valueOf'),
+ objProto = valueOf && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
+
+ return objProto
+ ? (value == objProto || getPrototypeOf(value) == objProto)
+ : shimIsPlainObject(value);
+};
+
+module.exports = isPlainObject;
+
+},{"lodash._basefor":36,"lodash._getnative":37,"lodash.keysin":38}],36:[function(require,module,exports){
+/**
+ * lodash 3.0.2 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/**
+ * The base implementation of `baseForIn` and `baseForOwn` which iterates
+ * over `object` properties returned by `keysFunc` invoking `iteratee` for
+ * each property. Iteratee functions may exit iteration early by explicitly
+ * returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+var baseFor = createBaseFor();
+
+/**
+ * Creates a base function for `_.forIn` or `_.forInRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var iterable = toObject(object),
+ props = keysFunc(object),
+ length = props.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var key = props[index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+}
+
+/**
+ * Converts `value` to an object if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Object} Returns the object.
+ */
+function toObject(value) {
+ return isObject(value) ? value : Object(value);
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+module.exports = baseFor;
+
+},{}],37:[function(require,module,exports){
+arguments[4][30][0].apply(exports,arguments)
+},{"dup":30}],38:[function(require,module,exports){
+/**
+ * lodash 3.0.8 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+var isArguments = require('lodash.isarguments'),
+ isArray = require('lodash.isarray');
+
+/** Used to detect unsigned integer values. */
+var reIsUint = /^\d+$/;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return value > -1 && value % 1 == 0 && value < length;
+}
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+/**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+function keysIn(object) {
+ if (object == null) {
+ return [];
+ }
+ if (!isObject(object)) {
+ object = Object(object);
+ }
+ var length = object.length;
+ length = (length && isLength(length) &&
+ (isArray(object) || isArguments(object)) && length) || 0;
+
+ var Ctor = object.constructor,
+ index = -1,
+ isProto = typeof Ctor == 'function' && Ctor.prototype === object,
+ result = Array(length),
+ skipIndexes = length > 0;
+
+ while (++index < length) {
+ result[index] = (index + '');
+ }
+ for (var key in object) {
+ if (!(skipIndexes && isIndex(key, length)) &&
+ !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = keysIn;
+
+},{"lodash.isarguments":39,"lodash.isarray":40}],39:[function(require,module,exports){
+arguments[4][31][0].apply(exports,arguments)
+},{"dup":31}],40:[function(require,module,exports){
+arguments[4][32][0].apply(exports,arguments)
+},{"dup":32}],41:[function(require,module,exports){
+/**
+ * lodash 3.1.0 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.2
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+var baseFlatten = require('lodash._baseflatten'),
+ bindCallback = require('lodash._bindcallback'),
+ pickByArray = require('lodash._pickbyarray'),
+ pickByCallback = require('lodash._pickbycallback'),
+ restParam = require('lodash.restparam');
+
+/**
+ * Creates an object composed of the picked `object` properties. Property
+ * names may be specified as individual arguments or as arrays of property
+ * names. If `predicate` is provided it is invoked for each property of `object`
+ * picking the properties `predicate` returns truthy for. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, key, object).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to pick, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.pick(object, 'user');
+ * // => { 'user': 'fred' }
+ *
+ * _.pick(object, _.isString);
+ * // => { 'user': 'fred' }
+ */
+var pick = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ return typeof props[0] == 'function'
+ ? pickByCallback(object, bindCallback(props[0], props[1], 3))
+ : pickByArray(object, baseFlatten(props));
+});
+
+module.exports = pick;
+
+},{"lodash._baseflatten":42,"lodash._bindcallback":45,"lodash._pickbyarray":46,"lodash._pickbycallback":47,"lodash.restparam":52}],42:[function(require,module,exports){
+/**
+ * lodash 3.1.3 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+var isArguments = require('lodash.isarguments'),
+ isArray = require('lodash.isarray');
+
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * The base implementation of `_.flatten` with added support for restricting
+ * flattening and specifying the start index.
+ *
+ * @private
+ * @param {Array} array The array to flatten.
+ * @param {boolean} [isDeep] Specify a deep flatten.
+ * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
+ * @returns {Array} Returns the new flattened array.
+ */
+function baseFlatten(array, isDeep, isStrict) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (isObjectLike(value) && isArrayLike(value) &&
+ (isStrict || isArray(value) || isArguments(value))) {
+ if (isDeep) {
+ // Recursively flatten arrays (susceptible to call stack limits).
+ value = baseFlatten(value, isDeep, isStrict);
+ }
+ var valIndex = -1,
+ valLength = value.length;
+
+ while (++valIndex < valLength) {
+ result[++resIndex] = value[valIndex];
+ }
+ } else if (!isStrict) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+}
+
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+}
+
+/**
+ * Gets the "length" property value of `object`.
+ *
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {*} Returns the "length" value.
+ */
+var getLength = baseProperty('length');
+
+/**
+ * Checks if `value` is array-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ */
+function isArrayLike(value) {
+ return value != null && isLength(getLength(value));
+}
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+module.exports = baseFlatten;
+
+},{"lodash.isarguments":43,"lodash.isarray":44}],43:[function(require,module,exports){
+arguments[4][31][0].apply(exports,arguments)
+},{"dup":31}],44:[function(require,module,exports){
+arguments[4][32][0].apply(exports,arguments)
+},{"dup":32}],45:[function(require,module,exports){
+arguments[4][26][0].apply(exports,arguments)
+},{"dup":26}],46:[function(require,module,exports){
+/**
+ * lodash 3.0.2 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.8.3
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+
+/**
+ * A specialized version of `_.pick` which picks `object` properties specified
+ * by `props`.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {string[]} props The property names to pick.
+ * @returns {Object} Returns the new object.
+ */
+function pickByArray(object, props) {
+ object = toObject(object);
+
+ var index = -1,
+ length = props.length,
+ result = {};
+
+ while (++index < length) {
+ var key = props[index];
+ if (key in object) {
+ result[key] = object[key];
+ }
+ }
+ return result;
+}
+
+/**
+ * Converts `value` to an object if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Object} Returns the object.
+ */
+function toObject(value) {
+ return isObject(value) ? value : Object(value);
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+module.exports = pickByArray;
+
+},{}],47:[function(require,module,exports){
+/**
+ * lodash 3.0.0 (Custom Build)
+ * Build: `lodash modern modularize exports="npm" -o ./`
+ * Copyright 2012-2015 The Dojo Foundation
+ * Based on Underscore.js 1.7.0
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license
+ */
+var baseFor = require('lodash._basefor'),
+ keysIn = require('lodash.keysin');
+
+/**
+ * The base implementation of `_.forIn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForIn(object, iteratee) {
+ return baseFor(object, iteratee, keysIn);
+}
+
+/**
+ * A specialized version of `_.pick` that picks `object` properties `predicate`
+ * returns truthy for.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Object} Returns the new object.
+ */
+function pickByCallback(object, predicate) {
+ var result = {};
+ baseForIn(object, function(value, key, object) {
+ if (predicate(value, key, object)) {
+ result[key] = value;
+ }
+ });
+ return result;
+}
+
+module.exports = pickByCallback;
+
+},{"lodash._basefor":48,"lodash.keysin":49}],48:[function(require,module,exports){
+arguments[4][36][0].apply(exports,arguments)
+},{"dup":36}],49:[function(require,module,exports){
+arguments[4][38][0].apply(exports,arguments)
+},{"dup":38,"lodash.isarguments":50,"lodash.isarray":51}],50:[function(require,module,exports){
+arguments[4][31][0].apply(exports,arguments)
+},{"dup":31}],51:[function(require,module,exports){
+arguments[4][32][0].apply(exports,arguments)
+},{"dup":32}],52:[function(require,module,exports){
+arguments[4][28][0].apply(exports,arguments)
+},{"dup":28}],53:[function(require,module,exports){
+'use strict';
+
+module.exports = Point;
+
+function Point(x, y) {
+ this.x = x;
+ this.y = y;
+}
+
+Point.prototype = {
+ clone: function() { return new Point(this.x, this.y); },
+
+ add: function(p) { return this.clone()._add(p); },
+ sub: function(p) { return this.clone()._sub(p); },
+ mult: function(k) { return this.clone()._mult(k); },
+ div: function(k) { return this.clone()._div(k); },
+ rotate: function(a) { return this.clone()._rotate(a); },
+ matMult: function(m) { return this.clone()._matMult(m); },
+ unit: function() { return this.clone()._unit(); },
+ perp: function() { return this.clone()._perp(); },
+ round: function() { return this.clone()._round(); },
+
+ mag: function() {
+ return Math.sqrt(this.x * this.x + this.y * this.y);
+ },
+
+ equals: function(p) {
+ return this.x === p.x &&
+ this.y === p.y;
+ },
+
+ dist: function(p) {
+ return Math.sqrt(this.distSqr(p));
+ },
+
+ distSqr: function(p) {
+ var dx = p.x - this.x,
+ dy = p.y - this.y;
+ return dx * dx + dy * dy;
+ },
+
+ angle: function() {
+ return Math.atan2(this.y, this.x);
+ },
+
+ angleTo: function(b) {
+ return Math.atan2(this.y - b.y, this.x - b.x);
+ },
+
+ angleWith: function(b) {
+ return this.angleWithSep(b.x, b.y);
+ },
+
+ // Find the angle of the two vectors, solving the formula for the cross product a x b = |a||b|sin(θ) for θ.
+ angleWithSep: function(x, y) {
+ return Math.atan2(
+ this.x * y - this.y * x,
+ this.x * x + this.y * y);
+ },
+
+ _matMult: function(m) {
+ var x = m[0] * this.x + m[1] * this.y,
+ y = m[2] * this.x + m[3] * this.y;
+ this.x = x;
+ this.y = y;
+ return this;
+ },
+
+ _add: function(p) {
+ this.x += p.x;
+ this.y += p.y;
+ return this;
+ },
+
+ _sub: function(p) {
+ this.x -= p.x;
+ this.y -= p.y;
+ return this;
+ },
+
+ _mult: function(k) {
+ this.x *= k;
+ this.y *= k;
+ return this;
+ },
+
+ _div: function(k) {
+ this.x /= k;
+ this.y /= k;
+ return this;
+ },
+
+ _unit: function() {
+ this._div(this.mag());
+ return this;
+ },
+
+ _perp: function() {
+ var y = this.y;
+ this.y = this.x;
+ this.x = -y;
+ return this;
+ },
+
+ _rotate: function(angle) {
+ var cos = Math.cos(angle),
+ sin = Math.sin(angle),
+ x = cos * this.x - sin * this.y,
+ y = sin * this.x + cos * this.y;
+ this.x = x;
+ this.y = y;
+ return this;
+ },
+
+ _round: function() {
+ this.x = Math.round(this.x);
+ this.y = Math.round(this.y);
+ return this;
+ }
+};
+
+// constructs Point from an array if necessary
+Point.convert = function (a) {
+ if (a instanceof Point) {
+ return a;
+ }
+ if (Array.isArray(a)) {
+ return new Point(a[0], a[1]);
+ }
+ return a;
+};
+
+},{}],54:[function(require,module,exports){
+'use strict';
+
+exports.__esModule = true;
+exports['default'] = shouldPureComponentUpdate;
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+var _shallowEqual = require('./shallowEqual');
+
+var _shallowEqual2 = _interopRequireDefault(_shallowEqual);
+
+function shouldPureComponentUpdate(nextProps, nextState) {
+ return !(0, _shallowEqual2['default'])(this.props, nextProps) || !(0, _shallowEqual2['default'])(this.state, nextState);
+}
+
+module.exports = exports['default'];
+},{"./shallowEqual":55}],55:[function(require,module,exports){
+'use strict';
+
+exports.__esModule = true;
+exports['default'] = shallowEqual;
+
+function shallowEqual(objA, objB) {
+ if (objA === objB) {
+ return true;
+ }
+
+ if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
+ return false;
+ }
+
+ var keysA = Object.keys(objA);
+ var keysB = Object.keys(objB);
+
+ if (keysA.length !== keysB.length) {
+ return false;
+ }
+
+ // Test for A's keys different from B.
+ var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
+ for (var i = 0; i < keysA.length; i++) {
+ if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+module.exports = exports['default'];
+},{}],56:[function(require,module,exports){
+/*!
+ * $script.js JS loader & dependency manager
+ * https://github.com/ded/script.js
+ * (c) Dustin Diaz 2014 | License MIT
+ */
+
+(function (name, definition) {
+ if (typeof module != 'undefined' && module.exports) module.exports = definition()
+ else if (typeof define == 'function' && define.amd) define(definition)
+ else this[name] = definition()
+})('$script', function () {
+ var doc = document
+ , head = doc.getElementsByTagName('head')[0]
+ , s = 'string'
+ , f = false
+ , push = 'push'
+ , readyState = 'readyState'
+ , onreadystatechange = 'onreadystatechange'
+ , list = {}
+ , ids = {}
+ , delay = {}
+ , scripts = {}
+ , scriptpath
+ , urlArgs
+
+ function every(ar, fn) {
+ for (var i = 0, j = ar.length; i < j; ++i) if (!fn(ar[i])) return f
+ return 1
+ }
+ function each(ar, fn) {
+ every(ar, function (el) {
+ return !fn(el)
+ })
+ }
+
+ function $script(paths, idOrDone, optDone) {
+ paths = paths[push] ? paths : [paths]
+ var idOrDoneIsDone = idOrDone && idOrDone.call
+ , done = idOrDoneIsDone ? idOrDone : optDone
+ , id = idOrDoneIsDone ? paths.join('') : idOrDone
+ , queue = paths.length
+ function loopFn(item) {
+ return item.call ? item() : list[item]
+ }
+ function callback() {
+ if (!--queue) {
+ list[id] = 1
+ done && done()
+ for (var dset in delay) {
+ every(dset.split('|'), loopFn) && !each(delay[dset], loopFn) && (delay[dset] = [])
+ }
+ }
+ }
+ setTimeout(function () {
+ each(paths, function loading(path, force) {
+ if (path === null) return callback()
+ path = !force && path.indexOf('.js') === -1 && !/^https?:\/\//.test(path) && scriptpath ? scriptpath + path + '.js' : path
+ if (scripts[path]) {
+ if (id) ids[id] = 1
+ return (scripts[path] == 2) ? callback() : setTimeout(function () { loading(path, true) }, 0)
+ }
+
+ scripts[path] = 1
+ if (id) ids[id] = 1
+ create(path, callback)
+ })
+ }, 0)
+ return $script
+ }
+
+ function create(path, fn) {
+ var el = doc.createElement('script'), loaded
+ el.onload = el.onerror = el[onreadystatechange] = function () {
+ if ((el[readyState] && !(/^c|loade/.test(el[readyState]))) || loaded) return;
+ el.onload = el[onreadystatechange] = null
+ loaded = 1
+ scripts[path] = 2
+ fn()
+ }
+ el.async = 1
+ el.src = urlArgs ? path + (path.indexOf('?') === -1 ? '?' : '&') + urlArgs : path;
+ head.insertBefore(el, head.lastChild)
+ }
+
+ $script.get = create
+
+ $script.order = function (scripts, id, done) {
+ (function callback(s) {
+ s = scripts.shift()
+ !scripts.length ? $script(s, id, done) : $script(s, callback)
+ }())
+ }
+
+ $script.path = function (p) {
+ scriptpath = p
+ }
+ $script.urlArgs = function (str) {
+ urlArgs = str;
+ }
+ $script.ready = function (deps, ready, req) {
+ deps = deps[push] ? deps : [deps]
+ var missing = [];
+ !each(deps, function (dep) {
+ list[dep] || missing[push](dep);
+ }) && every(deps, function (dep) {return list[dep]}) ?
+ ready() : !function (key) {
+ delay[key] = delay[key] || []
+ delay[key][push](ready)
+ req && req(missing)
+ }(deps.join('|'))
+ return $script
+ }
+
+ $script.done = function (idOrDone) {
+ $script([null], idOrDone)
+ }
+
+ return $script
+});
+
+},{}],57:[function(require,module,exports){
+(function (process){
+'use strict';
+
+var React = require('react');
+var StylePropable = require('./mixins/style-propable');
+var Typography = require('./styles/typography');
+var IconButton = require('./icon-button');
+var NavigationMenu = require('./svg-icons/navigation-menu');
+var Paper = require('./paper');
+
+var AppBar = React.createClass({
+ displayName: 'AppBar',
+
+ mixins: [StylePropable],
+
+ contextTypes: {
+ muiTheme: React.PropTypes.object
+ },
+
+ propTypes: {
+ onLeftIconButtonTouchTap: React.PropTypes.func,
+ onRightIconButtonTouchTap: React.PropTypes.func,
+ showMenuIconButton: React.PropTypes.bool,
+ iconClassNameLeft: React.PropTypes.string,
+ iconClassNameRight: React.PropTypes.string,
+ iconElementLeft: React.PropTypes.element,
+ iconElementRight: React.PropTypes.element,
+ iconStyleRight: React.PropTypes.object,
+ title: React.PropTypes.node,
+ zDepth: React.PropTypes.number
+ },
+
+ getDefaultProps: function getDefaultProps() {
+ return {
+ showMenuIconButton: true,
+ title: '',
+ zDepth: 1
+ };
+ },
+
+ componentDidMount: function componentDidMount() {
+ if (process.env.NODE_ENV !== 'production' && this.props.iconElementLeft && this.props.iconClassNameLeft) {
+
+ console.warn('Properties iconClassNameLeft and iconElementLeft cannot be simultaneously ' + 'defined. Please use one or the other.');
+ }
+ },
+
+ getStyles: function getStyles() {
+ var spacing = this.context.muiTheme.spacing;
+ var themeVariables = this.context.muiTheme.component.appBar;
+ var iconButtonSize = this.context.muiTheme.component.button.iconButtonSize;
+ var styles = {
+ root: {
+ zIndex: 5,
+ width: '100%',
+ display: '-webkit-box; display: flex',
+ minHeight: themeVariables.height,
+ backgroundColor: themeVariables.color,
+ paddingLeft: spacing.desktopGutter,
+ paddingRight: spacing.desktopGutter
+ },
+ title: {
+ whiteSpace: 'nowrap',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ margin: 0,
+ paddingTop: 0,
+ letterSpacing: 0,
+ fontSize: 24,
+ fontWeight: Typography.fontWeightNormal,
+ color: themeVariables.textColor,
+ lineHeight: themeVariables.height + 'px'
+ },
+ mainElement: {
+ boxFlex: 1,
+ flex: '1'
+ },
+ iconButton: {
+ style: {
+ marginTop: (themeVariables.height - iconButtonSize) / 2,
+ marginRight: 8,
+ marginLeft: -16
+ },
+ iconStyle: {
+ fill: themeVariables.textColor,
+ color: themeVariables.textColor
+ }
+ }
+ };
+ return styles;
+ },
+
+ render: function render() {
+ var styles = this.getStyles();
+
+ var iconRightStyle = this.mergeAndPrefix(styles.iconButton.style, {
+ marginRight: -16,
+ marginLeft: 'auto'
+ }, this.props.iconStyleRight);
+
+ var title = this.props.title;
+
+ var titleElement;
+ var menuElementLeft;
+ var menuElementRight;
+
+ if (title) {
+ // If the title is a string, wrap in an h1 tag.
+ // If not, just use it as a node.
+ titleElement = typeof title === 'string' || title instanceof String ? React.createElement(
+ 'h1',
+ { style: this.mergeAndPrefix(styles.title, styles.mainElement) },
+ title
+ ) : React.createElement(
+ 'div',
+ { style: this.mergeAndPrefix(styles.mainElement) },
+ title
+ );
+ }
+
+ if (this.props.showMenuIconButton) {
+ if (this.props.iconElementLeft) {
+ menuElementLeft = React.createElement(
+ 'div',
+ { style: styles.iconButton.style },
+ this.props.iconElementLeft
+ );
+ } else {
+ var child = this.props.iconClassNameLeft ? '' : React.createElement(NavigationMenu, { style: this.mergeAndPrefix(styles.iconButton.iconStyle) });
+ menuElementLeft = React.createElement(
+ IconButton,
+ {
+ style: this.mergeAndPrefix(styles.iconButton.style),
+ iconStyle: this.mergeAndPrefix(styles.iconButton.iconStyle),
+ iconClassName: this.props.iconClassNameLeft,
+ onTouchTap: this._onLeftIconButtonTouchTap },
+ child
+ );
+ }
+
+ if (this.props.iconElementRight) {
+ menuElementRight = React.createElement(
+ 'div',
+ { style: iconRightStyle },
+ this.props.iconElementRight
+ );
+ } else if (this.props.iconClassNameRight) {
+ menuElementRight = React.createElement(IconButton, {
+ style: iconRightStyle,
+ iconStyle: this.mergeAndPrefix(styles.iconButton.iconStyle),
+ iconClassName: this.props.iconClassNameRight,
+ onTouchTap: this._onRightIconButtonTouchTap });
+ }
+ }
+
+ return React.createElement(
+ Paper,
+ {
+ rounded: false,
+ className: this.props.className,
+ style: this.mergeAndPrefix(styles.root, this.props.style),
+ zDepth: this.props.zDepth },
+ menuElementLeft,
+ titleElement,
+ menuElementRight,
+ this.props.children
+ );
+ },
+
+ _onLeftIconButtonTouchTap: function _onLeftIconButtonTouchTap(event) {
+ if (this.props.onLeftIconButtonTouchTap) {
+ this.props.onLeftIconButtonTouchTap(event);
+ }
+ },
+
+ _onRightIconButtonTouchTap: function _onRightIconButtonTouchTap(event) {
+ if (this.props.onRightIconButtonTouchTap) {
+ this.props.onRightIconButtonTouchTap(event);
+ }
+ }
+
+});
+
+module.exports = AppBar;
+}).call(this,require('_process'))
+
+},{"./icon-button":89,"./mixins/style-propable":103,"./paper":107,"./styles/typography":125,"./svg-icons/navigation-menu":132,"_process":7,"react":357}],58:[function(require,module,exports){
+'use strict';
+
+var React = require('react');
+
+var AppCanvas = React.createClass({
+ displayName: 'AppCanvas',
+
+ contextTypes: {
+ muiTheme: React.PropTypes.object
+ },
+
+ render: function render() {
+
+ var styles = {
+ height: '100%',
+ backgroundColor: this.context.muiTheme.palette.canvasColor,
+ WebkitFontSmoothing: 'antialiased'
+ };
+
+ var newChildren = React.Children.map(this.props.children, function (currentChild) {
+ if (!currentChild) {
+ // If undefined, skip it
+ return;
+ }
+
+ switch (currentChild.type.displayName) {
+ case 'AppBar':
+ return React.cloneElement(currentChild, {
+ style: {
+ position: 'fixed'
+ }
+ });
+ default:
+ return currentChild;
+ }
+ }, this);
+
+ return React.createElement(
+ 'div',
+ { style: styles },
+ newChildren
+ );
+ }
+
+});
+
+module.exports = AppCanvas;
+},{"react":357}],59:[function(require,module,exports){
+'use strict';
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
+
+var React = require('react/addons');
+var StylePropable = require('./mixins/style-propable');
+var Colors = require('./styles/colors');
+var Typography = require('./styles/typography');
+
+var SvgIcon = React.createClass({
+ displayName: 'SvgIcon',
+
+ mixins: [StylePropable],
+
+ contextTypes: {
+ muiTheme: React.PropTypes.object
+ },
+
+ propTypes: {
+ icon: React.PropTypes.element,
+ backgroundColor: React.PropTypes.string,
+ color: React.PropTypes.string,
+ src: React.PropTypes.string
+ },
+
+ getDefaultProps: function getDefaultProps() {
+ return {
+ backgroundColor: Colors.grey400,
+ color: Colors.white
+ };
+ },
+
+ render: function render() {
+ var _props = this.props;
+ var icon = _props.icon;
+ var backgroundColor = _props.backgroundColor;
+ var color = _props.color;
+ var src = _props.src;
+ var style = _props.style;
+
+ var other = _objectWithoutProperties(_props, ['icon', 'backgroundColor', 'color', 'src', 'style']);
+
+ var styles = {
+ root: {
+ height: src ? 38 : 40,
+ width: src ? 38 : 40,
+ userSelect: 'none',
+ backgroundColor: backgroundColor,
+ borderRadius: '50%',
+ border: src ? 'solid 1px' : 'none',
+ borderColor: this.context.muiTheme.palette.borderColor,
+ display: 'inline-block',
+
+ //Needed for letter avatars
+ textAlign: 'center',
+ lineHeight: '40px',
+ fontSize: 24,
+ color: color
+ },
+
+ iconStyles: {
+ margin: 8
+ }
+ };
+
+ var mergedRootStyles = this.mergeAndPrefix(styles.root, style);
+ var mergedIconStyles = icon ? this.mergeStyles(styles.iconStyles, icon.props.style) : null;
+
+ var iconElement = icon ? React.cloneElement(icon, {
+ color: color,
+ style: mergedIconStyles
+ }) : null;
+
+ return src ? React.createElement('img', _extends({}, other, { src: src, style: mergedRootStyles })) : React.createElement(
+ 'div',
+ _extends({}, other, { style: mergedRootStyles }),
+ iconElement,
+ this.props.children
+ );
+ }
+});
+
+module.exports = SvgIcon;
+},{"./mixins/style-propable":103,"./styles/colors":118,"./styles/typography":125,"react/addons":185}],60:[function(require,module,exports){
+'use strict';
+
+function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
+
+var React = require('react');
+var StylePropable = require('./mixins/style-propable');
+var AutoPrefix = require('./styles/auto-prefix');
+
+/**
+ * BeforeAfterWrapper
+ * An alternative for the ::before and ::after css pseudo-elements for
+ * components whose styles are defined in javascript instead of css.
+ *
+ * Usage: For the element that we want to apply before and after elements to,
+ * wrap its children with BeforeAfterWrapper. For example:
+ *
+ *
+ *
// See notice
+ * renders // before element
+ * [children of paper] ------> [children of paper]
+ * // after element
+ *
+ *
+ *
+ * Notice: Notice that this div bundles together our elements. If the element
+ * that we want to apply before and after elements is a HTML tag (i.e. a
+ * div, p, or button tag), we can avoid this extra nesting by passing using
+ * the BeforeAfterWrapper in place of said tag like so:
+ *
+ *
+ * do this instead
+ * [children of p] ------> [children of p]
+ *
+ *
+ *
+ * );
+ * }
+ * });
+ * ```
+ */
+ handle: React.PropTypes.string,
+
+ /**
+ * `cancel` specifies a selector to be used to prevent drag initialization.
+ *
+ * Example:
+ *
+ * ```jsx
+ * var App = React.createClass({
+ * render: function () {
+ * return(
+ *
+ *
+ *
You can't drag from here
+ *
Dragging here works fine
+ *
+ *
+ * );
+ * }
+ * });
+ * ```
+ */
+ cancel: React.PropTypes.string,
+
+ /**
+ * `bound` determines whether to bound the movement to the parent box.
+ *
+ * The property takes a list of space-separated strings. The Draggable
+ * is bounded by the nearest DOMNode.offsetParent. To set the offset
+ * parent, give it a position value other than 'static'.
+ *
+ * Optionally choose one or more bounds from:
+ * 'top' bounds movement to the top edge of the parent box.
+ * 'right' bounds movement to the right edge of the parent box.
+ * 'bottom' bounds movement to the bottom edge of the parent box.
+ * 'left' bounds movement to the left edge of the parent box.
+ * 'all' bounds movement to all edges (default if not specified).
+ *
+ * Optionally choose one anchor from:
+ * 'point' to constrain only the top-left corner.
+ * 'box' to constrain the entire box (default if not specified).
+ *
+ * You may use more than one bound, e.g. 'top left point'. Set to a
+ * falsy value to disable.
+ *
+ * Defaults to 'all box'.
+ */
+ bound: React.PropTypes.string,
+
+ /**
+ * `grid` specifies the x and y that dragging should snap to.
+ *
+ * Example:
+ *
+ * ```jsx
+ * var App = React.createClass({
+ * render: function () {
+ * return (
+ *
+ *
+ *
+ * );
+ * }
+ * });
+ * ```
+ */
+ zIndex: React.PropTypes.number,
+
+ /**
+ * `useChild` determines whether to use the first child as root.
+ *
+ * If false, a div is created. This option is required if any children
+ * have a ref.
+ *
+ * Defaults to true.
+ */
+ useChild: React.PropTypes.bool,
+
+ /**
+ * Called when dragging starts.
+ *
+ * Example:
+ *
+ * ```js
+ * function (event, ui) {}
+ * ```
+ *
+ * `event` is the Event that was triggered.
+ * `ui` is an object:
+ *
+ * ```js
+ * {
+ * position: {top: 0, left: 0}
+ * }
+ * ```
+ */
+ onStart: React.PropTypes.func,
+
+ /**
+ * Called while dragging.
+ *
+ * Example:
+ *
+ * ```js
+ * function (event, ui) {}
+ * ```
+ *
+ * `event` is the Event that was triggered.
+ * `ui` is an object:
+ *
+ * ```js
+ * {
+ * position: {top: 0, left: 0}
+ * }
+ * ```
+ */
+ onDrag: React.PropTypes.func,
+
+ /**
+ * Called when dragging stops.
+ *
+ * Example:
+ *
+ * ```js
+ * function (event, ui) {}
+ * ```
+ *
+ * `event` is the Event that was triggered.
+ * `ui` is an object:
+ *
+ * ```js
+ * {
+ * position: {top: 0, left: 0}
+ * }
+ * ```
+ */
+ onStop: React.PropTypes.func,
+
+ /**
+ * A workaround option which can be passed if onMouseDown needs to be accessed, since it'll always be blocked (due to that there's internal use of onMouseDown)
+ *
+ */
+ onMouseDown: React.PropTypes.func
+ },
+
+ getDefaultProps: function () {
+ return {
+ axis: 'both',
+ bound: null,
+ handle: null,
+ cancel: null,
+ grid: null,
+ start: {},
+ zIndex: NaN,
+ useChild: true,
+ onStart: emptyFunction,
+ onDrag: emptyFunction,
+ onStop: emptyFunction,
+ onMouseDown: emptyFunction
+ };
+ },
+
+ getInitialState: function () {
+ var state = {
+ // Whether or not currently dragging
+ dragging: false,
+
+ // Pointer offset on screen
+ clientX: 0, clientY: 0,
+
+ // DOMNode offset relative to parent
+ offsetLeft: this.props.start.x || 0, offsetTop: this.props.start.y || 0
+ };
+
+ updateBoundState(state, this.props.bound);
+
+ return state;
+ },
+
+ componentWillReceiveProps: function (nextProps) {
+ var state = updateBoundState({}, nextProps.bound);
+ if (nextProps.start) {
+ if (nextProps.start.x != null) {
+ state.offsetLeft = nextProps.start.x || 0;
+ }
+ if (nextProps.start.y != null) {
+ state.offsetTop = nextProps.start.y || 0;
+ }
+ }
+ this.setState(state);
+ },
+
+ componentWillUnmount: function() {
+ // Remove any leftover event handlers
+ removeEvent(root, dragEventFor['move'], this.handleDrag);
+ removeEvent(root, dragEventFor['end'], this.handleDragEnd);
+ },
+
+ handleDragStart: function (e) {
+ // todo: write right implementation to prevent multitouch drag
+ // prevent multi-touch events
+ // if (isMultiTouch(e)) {
+ // this.handleDragEnd.apply(e, arguments);
+ // return
+ // }
+
+ // Make it possible to attach event handlers on top of this one
+ this.props.onMouseDown(e);
+
+ // Short circuit if handle or cancel prop was provided and selector doesn't match
+ if ((this.props.handle && !matchesSelector(e.target, this.props.handle)) ||
+ (this.props.cancel && matchesSelector(e.target, this.props.cancel))) {
+ return;
+ }
+
+ var dragPoint = getControlPosition(e);
+
+ // Initiate dragging
+ this.setState({
+ dragging: true,
+ clientX: dragPoint.clientX,
+ clientY: dragPoint.clientY
+ });
+
+ // Call event handler
+ this.props.onStart(e, createUIEvent(this));
+
+ // Add event handlers
+ addEvent(root, dragEventFor['move'], this.handleDrag);
+ addEvent(root, dragEventFor['end'], this.handleDragEnd);
+
+ // Add dragging class to body element
+ if (bodyElement) bodyElement.className += ' react-draggable-dragging';
+ },
+
+ handleDragEnd: function (e) {
+ // Short circuit if not currently dragging
+ if (!this.state.dragging) {
+ return;
+ }
+
+ // Turn off dragging
+ this.setState({
+ dragging: false
+ });
+
+ // Call event handler
+ this.props.onStop(e, createUIEvent(this));
+
+ // Remove event handlers
+ removeEvent(root, dragEventFor['move'], this.handleDrag);
+ removeEvent(root, dragEventFor['end'], this.handleDragEnd);
+
+ // Remove dragging class from body element
+ if (bodyElement) {
+ var className = bodyElement.className;
+ bodyElement.className =
+ className.replace(/(?:^|\s+)react-draggable-dragging\b/, ' ');
+ }
+ },
+
+ handleDrag: function (e) {
+ var dragPoint = getControlPosition(e);
+ var offsetLeft = this._toPixels(this.state.offsetLeft);
+ var offsetTop = this._toPixels(this.state.offsetTop);
+
+ var state = {
+ offsetLeft: offsetLeft,
+ offsetTop: offsetTop
+ };
+
+ // Get parent DOM node
+ var node = this.getDOMNode();
+ var offsetParent = node.offsetParent;
+ var offset, boundingValue;
+
+ if (canDragX(this)) {
+ // Calculate updated position
+ offset = offsetLeft + dragPoint.clientX - this.state.clientX;
+
+ // Bound movement to parent box
+ if (this.state.boundLeft) {
+ boundingValue = state.offsetLeft - node.offsetLeft;
+ if (offset < boundingValue) {
+ offset = boundingValue;
+ }
+ }
+ if (this.state.boundRight) {
+ boundingValue += offsetParent.clientWidth;
+ if (this.state.boundBox) {
+ boundingValue -= node.offsetWidth;
+ }
+ if (offset > boundingValue) {
+ offset = boundingValue;
+ }
+ }
+ // Update left
+ state.offsetLeft = offset;
+ }
+
+ if (canDragY(this)) {
+ // Calculate updated position
+ offset = offsetTop + dragPoint.clientY - this.state.clientY;
+ // Bound movement to parent box
+ if (this.state.boundTop) {
+ boundingValue = state.offsetTop - node.offsetTop;
+ if (offset < boundingValue) {
+ offset = boundingValue;
+ }
+ }
+ if (this.state.boundBottom) {
+ boundingValue += offsetParent.clientHeight;
+ if (this.state.boundBox) {
+ boundingValue -= node.offsetHeight;
+ }
+ if (offset > boundingValue) {
+ offset = boundingValue;
+ }
+ }
+ // Update top
+ state.offsetTop = offset;
+ }
+
+ var constrain = this.props.constrain;
+ var grid = this.props.grid;
+
+ // Backwards-compatibility for snap to grid
+ if (!constrain && Array.isArray(grid)) {
+ var constrainOffset = function (offset, prev, snap) {
+ var delta = offset - prev;
+ if (Math.abs(delta) >= snap) {
+ return prev + parseInt(delta / snap, 10) * snap;
+ }
+ return prev;
+ };
+ constrain = function (pos) {
+ return {
+ left: constrainOffset(pos.left, pos.prevLeft, grid[0]),
+ top: constrainOffset(pos.top, pos.prevTop, grid[1])
+ };
+ };
+ }
+
+ // Constrain if function has been provided
+ var positions;
+ if (constrain) {
+ // Constrain positions
+ positions = constrain({
+ prevLeft: this.state.offsetLeft,
+ prevTop: this.state.offsetTop,
+ left: state.offsetLeft,
+ top: state.offsetTop
+ });
+ if (positions) {
+ // Update left
+ if ('left' in positions && !isNaN(positions.left)) {
+ state.offsetLeft = positions.left;
+ }
+ // Update top
+ if ('top' in positions && !isNaN(positions.top)) {
+ state.offsetTop = positions.top;
+ }
+ }
+ }
+
+ // Save new state
+ state.clientX = this.state.clientX + (state.offsetLeft - offsetLeft);
+ state.clientY = this.state.clientY + (state.offsetTop - offsetTop);
+ this.setState(state);
+
+ // Call event handler
+ this.props.onDrag(e, createUIEvent(this));
+ },
+
+ onTouchStart: function (e) {
+ e.preventDefault(); // prevent for scroll
+ return this.handleDragStart.apply(this, arguments);
+ },
+
+ render: function () {
+ var style = {
+ top: this.state.offsetTop,
+ left: this.state.offsetLeft
+ };
+
+ // Set zIndex if currently dragging and prop has been provided
+ if (this.state.dragging && !isNaN(this.props.zIndex)) {
+ style.zIndex = this.props.zIndex;
+ }
+
+ var props = {
+ style: style,
+ className: 'react-draggable',
+
+ onMouseDown: this.handleDragStart,
+ onTouchStart: this.onTouchStart,
+
+ onMouseUp: this.handleDragEnd,
+ onTouchEnd: this.handleDragEnd
+ };
+
+ // Reuse the child provided
+ // This makes it flexible to use whatever element is wanted (div, ul, etc)
+ if (this.props.useChild) {
+ return React.addons.cloneWithProps(React.Children.only(this.props.children), props);
+ }
+
+ return React.DOM.div(props, this.props.children);
+ },
+
+ _toPixels: function (value) {
+
+ // Support percentages
+ if (typeof value == 'string' && value.slice(-1) == '%') {
+ return parseInt((+value.replace('%', '') / 100) *
+ this.getDOMNode().offsetParent.clientWidth, 10) || 0;
+ }
+
+ // Invalid values become zero
+ var i = parseInt(value, 10);
+ if (isNaN(i) || !isFinite(i)) return 0;
+
+ return i;
+ }
+
+});
+
+},{"react/addons":185}],178:[function(require,module,exports){
+'use strict';
+
+exports.__esModule = true;
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
+
+var _function = require('./function');
+
+var _function2 = _interopRequireDefault(_function);
+
+var _react = require('react');
+
+var PureComponent = (function (_Component) {
+ function PureComponent() {
+ _classCallCheck(this, PureComponent);
+
+ if (_Component != null) {
+ _Component.apply(this, arguments);
+ }
+ }
+
+ _inherits(PureComponent, _Component);
+
+ return PureComponent;
+})(_react.Component);
+
+exports['default'] = PureComponent;
+
+PureComponent.prototype.shouldComponentUpdate = _function2['default'];
+module.exports = exports['default'];
+},{"./function":179,"react":357}],179:[function(require,module,exports){
+arguments[4][54][0].apply(exports,arguments)
+},{"./shallowEqual":180,"dup":54}],180:[function(require,module,exports){
+arguments[4][55][0].apply(exports,arguments)
+},{"dup":55}],181:[function(require,module,exports){
+/**
+ * Copyright 2013-2014, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule ResponderEventPlugin
+ */
+
+"use strict";
+
+var EventConstants = require('react/lib/EventConstants');
+var EventPluginUtils = require('react/lib/EventPluginUtils');
+var EventPropagators = require('react/lib/EventPropagators');
+var SyntheticEvent = require('react/lib/SyntheticEvent');
+
+var accumulateInto = require('react/lib/accumulateInto');
+var keyOf = require('react/lib/keyOf');
+
+var isStartish = EventPluginUtils.isStartish;
+var isMoveish = EventPluginUtils.isMoveish;
+var isEndish = EventPluginUtils.isEndish;
+var executeDirectDispatch = EventPluginUtils.executeDirectDispatch;
+var hasDispatches = EventPluginUtils.hasDispatches;
+var executeDispatchesInOrderStopAtTrue =
+ EventPluginUtils.executeDispatchesInOrderStopAtTrue;
+
+/**
+ * ID of element that should respond to touch/move types of interactions, as
+ * indicated explicitly by relevant callbacks.
+ */
+var responderID = null;
+var isPressing = false;
+
+var eventTypes = {
+ /**
+ * On a `touchStart`/`mouseDown`, is it desired that this element become the
+ * responder?
+ */
+ startShouldSetResponder: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onStartShouldSetResponder: null}),
+ captured: keyOf({onStartShouldSetResponderCapture: null})
+ }
+ },
+
+ /**
+ * On a `scroll`, is it desired that this element become the responder? This
+ * is usually not needed, but should be used to retroactively infer that a
+ * `touchStart` had occured during momentum scroll. During a momentum scroll,
+ * a touch start will be immediately followed by a scroll event if the view is
+ * currently scrolling.
+ */
+ scrollShouldSetResponder: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onScrollShouldSetResponder: null}),
+ captured: keyOf({onScrollShouldSetResponderCapture: null})
+ }
+ },
+
+ /**
+ * On a `touchMove`/`mouseMove`, is it desired that this element become the
+ * responder?
+ */
+ moveShouldSetResponder: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onMoveShouldSetResponder: null}),
+ captured: keyOf({onMoveShouldSetResponderCapture: null})
+ }
+ },
+
+ /**
+ * Direct responder events dispatched directly to responder. Do not bubble.
+ */
+ responderMove: {registrationName: keyOf({onResponderMove: null})},
+ responderRelease: {registrationName: keyOf({onResponderRelease: null})},
+ responderTerminationRequest: {
+ registrationName: keyOf({onResponderTerminationRequest: null})
+ },
+ responderGrant: {registrationName: keyOf({onResponderGrant: null})},
+ responderReject: {registrationName: keyOf({onResponderReject: null})},
+ responderTerminate: {registrationName: keyOf({onResponderTerminate: null})}
+};
+
+/**
+ * Performs negotiation between any existing/current responder, checks to see if
+ * any new entity is interested in becoming responder, performs that handshake
+ * and returns any events that must be emitted to notify the relevant parties.
+ *
+ * A note about event ordering in the `EventPluginHub`.
+ *
+ * Suppose plugins are injected in the following order:
+ *
+ * `[R, S, C]`
+ *
+ * To help illustrate the example, assume `S` is `SimpleEventPlugin` (for
+ * `onClick` etc) and `R` is `ResponderEventPlugin`.
+ *
+ * "Deferred-Dispatched Events":
+ *
+ * - The current event plugin system will traverse the list of injected plugins,
+ * in order, and extract events by collecting the plugin's return value of
+ * `extractEvents()`.
+ * - These events that are returned from `extractEvents` are "deferred
+ * dispatched events".
+ * - When returned from `extractEvents`, deferred-dispatched events contain an
+ * "accumulation" of deferred dispatches.
+ * - These deferred dispatches are accumulated/collected before they are
+ * returned, but processed at a later time by the `EventPluginHub` (hence the
+ * name deferred).
+ *
+ * In the process of returning their deferred-dispatched events, event plugins
+ * themselves can dispatch events on-demand without returning them from
+ * `extractEvents`. Plugins might want to do this, so that they can use event
+ * dispatching as a tool that helps them decide which events should be extracted
+ * in the first place.
+ *
+ * "On-Demand-Dispatched Events":
+ *
+ * - On-demand-dispatched events are not returned from `extractEvents`.
+ * - On-demand-dispatched events are dispatched during the process of returning
+ * the deferred-dispatched events.
+ * - They should not have side effects.
+ * - They should be avoided, and/or eventually be replaced with another
+ * abstraction that allows event plugins to perform multiple "rounds" of event
+ * extraction.
+ *
+ * Therefore, the sequence of event dispatches becomes:
+ *
+ * - `R`s on-demand events (if any) (dispatched by `R` on-demand)
+ * - `S`s on-demand events (if any) (dispatched by `S` on-demand)
+ * - `C`s on-demand events (if any) (dispatched by `C` on-demand)
+ * - `R`s extracted events (if any) (dispatched by `EventPluginHub`)
+ * - `S`s extracted events (if any) (dispatched by `EventPluginHub`)
+ * - `C`s extracted events (if any) (dispatched by `EventPluginHub`)
+ *
+ * In the case of `ResponderEventPlugin`: If the `startShouldSetResponder`
+ * on-demand dispatch returns `true` (and some other details are satisfied) the
+ * `onResponderGrant` deferred dispatched event is returned from
+ * `extractEvents`. The sequence of dispatch executions in this case
+ * will appear as follows:
+ *
+ * - `startShouldSetResponder` (`ResponderEventPlugin` dispatches on-demand)
+ * - `touchStartCapture` (`EventPluginHub` dispatches as usual)
+ * - `touchStart` (`EventPluginHub` dispatches as usual)
+ * - `responderGrant/Reject` (`EventPluginHub` dispatches as usual)
+ *
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {string} topLevelTargetID ID of deepest React rendered element.
+ * @param {object} nativeEvent Native browser event.
+ * @return {*} An accumulation of synthetic events.
+ */
+function setResponderAndExtractTransfer(
+ topLevelType,
+ topLevelTargetID,
+ nativeEvent) {
+ var shouldSetEventType =
+ isStartish(topLevelType) ? eventTypes.startShouldSetResponder :
+ isMoveish(topLevelType) ? eventTypes.moveShouldSetResponder :
+ eventTypes.scrollShouldSetResponder;
+
+ var bubbleShouldSetFrom = responderID || topLevelTargetID;
+ var shouldSetEvent = SyntheticEvent.getPooled(
+ shouldSetEventType,
+ bubbleShouldSetFrom,
+ nativeEvent
+ );
+ EventPropagators.accumulateTwoPhaseDispatches(shouldSetEvent);
+ var wantsResponderID = executeDispatchesInOrderStopAtTrue(shouldSetEvent);
+ if (!shouldSetEvent.isPersistent()) {
+ shouldSetEvent.constructor.release(shouldSetEvent);
+ }
+
+ if (!wantsResponderID || wantsResponderID === responderID) {
+ return null;
+ }
+ var extracted;
+ var grantEvent = SyntheticEvent.getPooled(
+ eventTypes.responderGrant,
+ wantsResponderID,
+ nativeEvent
+ );
+
+ EventPropagators.accumulateDirectDispatches(grantEvent);
+ if (responderID) {
+ var terminationRequestEvent = SyntheticEvent.getPooled(
+ eventTypes.responderTerminationRequest,
+ responderID,
+ nativeEvent
+ );
+ EventPropagators.accumulateDirectDispatches(terminationRequestEvent);
+ var shouldSwitch = !hasDispatches(terminationRequestEvent) ||
+ executeDirectDispatch(terminationRequestEvent);
+ if (!terminationRequestEvent.isPersistent()) {
+ terminationRequestEvent.constructor.release(terminationRequestEvent);
+ }
+
+ if (shouldSwitch) {
+ var terminateType = eventTypes.responderTerminate;
+ var terminateEvent = SyntheticEvent.getPooled(
+ terminateType,
+ responderID,
+ nativeEvent
+ );
+ EventPropagators.accumulateDirectDispatches(terminateEvent);
+ extracted = accumulateInto(extracted, [grantEvent, terminateEvent]);
+ responderID = wantsResponderID;
+ } else {
+ var rejectEvent = SyntheticEvent.getPooled(
+ eventTypes.responderReject,
+ wantsResponderID,
+ nativeEvent
+ );
+ EventPropagators.accumulateDirectDispatches(rejectEvent);
+ extracted = accumulateInto(extracted, rejectEvent);
+ }
+ } else {
+ extracted = accumulateInto(extracted, grantEvent);
+ responderID = wantsResponderID;
+ }
+ return extracted;
+}
+
+/**
+ * A transfer is a negotiation between a currently set responder and the next
+ * element to claim responder status. Any start event could trigger a transfer
+ * of responderID. Any move event could trigger a transfer, so long as there is
+ * currently a responder set (in other words as long as the user is pressing
+ * down).
+ *
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @return {boolean} True if a transfer of responder could possibly occur.
+ */
+function canTriggerTransfer(topLevelType) {
+ return topLevelType === EventConstants.topLevelTypes.topScroll ||
+ isStartish(topLevelType) ||
+ (isPressing && isMoveish(topLevelType));
+}
+
+/**
+ * Event plugin for formalizing the negotiation between claiming locks on
+ * receiving touches.
+ */
+var ResponderEventPlugin = {
+
+ getResponderID: function() {
+ return responderID;
+ },
+
+ eventTypes: eventTypes,
+
+ /**
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {DOMEventTarget} topLevelTarget The listening component root node.
+ * @param {string} topLevelTargetID ID of `topLevelTarget`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {*} An accumulation of synthetic events.
+ * @see {EventPluginHub.extractEvents}
+ */
+ extractEvents: function(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent) {
+ var extracted;
+ // Must have missed an end event - reset the state here.
+ if (responderID && isStartish(topLevelType)) {
+ responderID = null;
+ }
+ if (isStartish(topLevelType)) {
+ isPressing = true;
+ } else if (isEndish(topLevelType)) {
+ isPressing = false;
+ }
+ if (canTriggerTransfer(topLevelType)) {
+ var transfer = setResponderAndExtractTransfer(
+ topLevelType,
+ topLevelTargetID,
+ nativeEvent
+ );
+ if (transfer) {
+ extracted = accumulateInto(extracted, transfer);
+ }
+ }
+ // Now that we know the responder is set correctly, we can dispatch
+ // responder type events (directly to the responder).
+ var type = isMoveish(topLevelType) ? eventTypes.responderMove :
+ isEndish(topLevelType) ? eventTypes.responderRelease :
+ isStartish(topLevelType) ? eventTypes.responderStart : null;
+ if (type) {
+ var gesture = SyntheticEvent.getPooled(
+ type,
+ responderID || '',
+ nativeEvent
+ );
+ EventPropagators.accumulateDirectDispatches(gesture);
+ extracted = accumulateInto(extracted, gesture);
+ }
+ if (type === eventTypes.responderRelease) {
+ responderID = null;
+ }
+ return extracted;
+ }
+
+};
+
+module.exports = ResponderEventPlugin;
+
+},{"react/lib/EventConstants":200,"react/lib/EventPluginUtils":204,"react/lib/EventPropagators":205,"react/lib/SyntheticEvent":293,"react/lib/accumulateInto":303,"react/lib/keyOf":342}],182:[function(require,module,exports){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule TapEventPlugin
+ * @typechecks static-only
+ */
+
+"use strict";
+
+var EventConstants = require('react/lib/EventConstants');
+var EventPluginUtils = require('react/lib/EventPluginUtils');
+var EventPropagators = require('react/lib/EventPropagators');
+var SyntheticUIEvent = require('react/lib/SyntheticUIEvent');
+var TouchEventUtils = require('./TouchEventUtils');
+var ViewportMetrics = require('react/lib/ViewportMetrics');
+
+var keyOf = require('react/lib/keyOf');
+var topLevelTypes = EventConstants.topLevelTypes;
+
+var isStartish = EventPluginUtils.isStartish;
+var isEndish = EventPluginUtils.isEndish;
+
+var isTouch = function(topLevelType) {
+ var touchTypes = [
+ topLevelTypes.topTouchCancel,
+ topLevelTypes.topTouchEnd,
+ topLevelTypes.topTouchStart,
+ topLevelTypes.topTouchMove
+ ];
+ return touchTypes.indexOf(topLevelType) >= 0;
+}
+
+/**
+ * Number of pixels that are tolerated in between a `touchStart` and `touchEnd`
+ * in order to still be considered a 'tap' event.
+ */
+var tapMoveThreshold = 10;
+var ignoreMouseThreshold = 750;
+var startCoords = {x: null, y: null};
+var lastTouchEvent = null;
+
+var Axis = {
+ x: {page: 'pageX', client: 'clientX', envScroll: 'currentPageScrollLeft'},
+ y: {page: 'pageY', client: 'clientY', envScroll: 'currentPageScrollTop'}
+};
+
+function getAxisCoordOfEvent(axis, nativeEvent) {
+ var singleTouch = TouchEventUtils.extractSingleTouch(nativeEvent);
+ if (singleTouch) {
+ return singleTouch[axis.page];
+ }
+ return axis.page in nativeEvent ?
+ nativeEvent[axis.page] :
+ nativeEvent[axis.client] + ViewportMetrics[axis.envScroll];
+}
+
+function getDistance(coords, nativeEvent) {
+ var pageX = getAxisCoordOfEvent(Axis.x, nativeEvent);
+ var pageY = getAxisCoordOfEvent(Axis.y, nativeEvent);
+ return Math.pow(
+ Math.pow(pageX - coords.x, 2) + Math.pow(pageY - coords.y, 2),
+ 0.5
+ );
+}
+
+var dependencies = [
+ topLevelTypes.topMouseDown,
+ topLevelTypes.topMouseMove,
+ topLevelTypes.topMouseUp
+];
+
+if (EventPluginUtils.useTouchEvents) {
+ dependencies.push(
+ topLevelTypes.topTouchEnd,
+ topLevelTypes.topTouchStart,
+ topLevelTypes.topTouchMove
+ );
+}
+
+var eventTypes = {
+ touchTap: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onTouchTap: null}),
+ captured: keyOf({onTouchTapCapture: null})
+ },
+ dependencies: dependencies
+ }
+};
+
+var now = function() {
+ if (Date.now) {
+ return Date.now();
+ } else {
+ // IE8 support: http://stackoverflow.com/questions/9430357/please-explain-why-and-how-new-date-works-as-workaround-for-date-now-in
+ return +new Date;
+ }
+}
+
+var TapEventPlugin = {
+
+ tapMoveThreshold: tapMoveThreshold,
+
+ ignoreMouseThreshold: ignoreMouseThreshold,
+
+ eventTypes: eventTypes,
+
+ /**
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {DOMEventTarget} topLevelTarget The listening component root node.
+ * @param {string} topLevelTargetID ID of `topLevelTarget`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {*} An accumulation of synthetic events.
+ * @see {EventPluginHub.extractEvents}
+ */
+ extractEvents: function(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent) {
+
+ if (isTouch(topLevelType)) {
+ lastTouchEvent = now();
+ } else {
+ if (lastTouchEvent && (now() - lastTouchEvent) < ignoreMouseThreshold) {
+ return null;
+ }
+ }
+
+ if (!isStartish(topLevelType) && !isEndish(topLevelType)) {
+ return null;
+ }
+ var event = null;
+ var distance = getDistance(startCoords, nativeEvent);
+ if (isEndish(topLevelType) && distance < tapMoveThreshold) {
+ event = SyntheticUIEvent.getPooled(
+ eventTypes.touchTap,
+ topLevelTargetID,
+ nativeEvent
+ );
+ }
+ if (isStartish(topLevelType)) {
+ startCoords.x = getAxisCoordOfEvent(Axis.x, nativeEvent);
+ startCoords.y = getAxisCoordOfEvent(Axis.y, nativeEvent);
+ } else if (isEndish(topLevelType)) {
+ startCoords.x = 0;
+ startCoords.y = 0;
+ }
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+ return event;
+ }
+
+};
+
+module.exports = TapEventPlugin;
+
+},{"./TouchEventUtils":183,"react/lib/EventConstants":200,"react/lib/EventPluginUtils":204,"react/lib/EventPropagators":205,"react/lib/SyntheticUIEvent":299,"react/lib/ViewportMetrics":302,"react/lib/keyOf":342}],183:[function(require,module,exports){
+/**
+ * Copyright 2013-2014 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @providesModule TouchEventUtils
+ */
+
+var TouchEventUtils = {
+ /**
+ * Utility function for common case of extracting out the primary touch from a
+ * touch event.
+ * - `touchEnd` events usually do not have the `touches` property.
+ * http://stackoverflow.com/questions/3666929/
+ * mobile-sarai-touchend-event-not-firing-when-last-touch-is-removed
+ *
+ * @param {Event} nativeEvent Native event that may or may not be a touch.
+ * @return {TouchesObject?} an object with pageX and pageY or null.
+ */
+ extractSingleTouch: function(nativeEvent) {
+ var touches = nativeEvent.touches;
+ var changedTouches = nativeEvent.changedTouches;
+ var hasTouches = touches && touches.length > 0;
+ var hasChangedTouches = changedTouches && changedTouches.length > 0;
+
+ return !hasTouches && hasChangedTouches ? changedTouches[0] :
+ hasTouches ? touches[0] :
+ nativeEvent;
+ }
+};
+
+module.exports = TouchEventUtils;
+
+},{}],184:[function(require,module,exports){
+module.exports = function injectTapEventPlugin () {
+ var React = require("react");
+ React.initializeTouchEvents(true);
+
+ require('react/lib/EventPluginHub').injection.injectEventPluginsByName({
+ "ResponderEventPlugin": require('./ResponderEventPlugin.js'),
+ "TapEventPlugin": require('./TapEventPlugin.js')
+ });
+};
+
+},{"./ResponderEventPlugin.js":181,"./TapEventPlugin.js":182,"react":357,"react/lib/EventPluginHub":202}],185:[function(require,module,exports){
+module.exports = require('./lib/ReactWithAddons');
+
+},{"./lib/ReactWithAddons":285}],186:[function(require,module,exports){
+/**
+ * Copyright 2013-2015, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule AutoFocusMixin
+ * @typechecks static-only
+ */
+
+'use strict';
+
+var focusNode = require("./focusNode");
+
+var AutoFocusMixin = {
+ componentDidMount: function() {
+ if (this.props.autoFocus) {
+ focusNode(this.getDOMNode());
+ }
+ }
+};
+
+module.exports = AutoFocusMixin;
+
+},{"./focusNode":319}],187:[function(require,module,exports){
+/**
+ * Copyright 2013-2015 Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule BeforeInputEventPlugin
+ * @typechecks static-only
+ */
+
+'use strict';
+
+var EventConstants = require("./EventConstants");
+var EventPropagators = require("./EventPropagators");
+var ExecutionEnvironment = require("./ExecutionEnvironment");
+var FallbackCompositionState = require("./FallbackCompositionState");
+var SyntheticCompositionEvent = require("./SyntheticCompositionEvent");
+var SyntheticInputEvent = require("./SyntheticInputEvent");
+
+var keyOf = require("./keyOf");
+
+var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
+var START_KEYCODE = 229;
+
+var canUseCompositionEvent = (
+ ExecutionEnvironment.canUseDOM &&
+ 'CompositionEvent' in window
+);
+
+var documentMode = null;
+if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
+ documentMode = document.documentMode;
+}
+
+// Webkit offers a very useful `textInput` event that can be used to
+// directly represent `beforeInput`. The IE `textinput` event is not as
+// useful, so we don't use it.
+var canUseTextInputEvent = (
+ ExecutionEnvironment.canUseDOM &&
+ 'TextEvent' in window &&
+ !documentMode &&
+ !isPresto()
+);
+
+// In IE9+, we have access to composition events, but the data supplied
+// by the native compositionend event may be incorrect. Japanese ideographic
+// spaces, for instance (\u3000) are not recorded correctly.
+var useFallbackCompositionData = (
+ ExecutionEnvironment.canUseDOM &&
+ (
+ (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11)
+ )
+);
+
+/**
+ * Opera <= 12 includes TextEvent in window, but does not fire
+ * text input events. Rely on keypress instead.
+ */
+function isPresto() {
+ var opera = window.opera;
+ return (
+ typeof opera === 'object' &&
+ typeof opera.version === 'function' &&
+ parseInt(opera.version(), 10) <= 12
+ );
+}
+
+var SPACEBAR_CODE = 32;
+var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
+
+var topLevelTypes = EventConstants.topLevelTypes;
+
+// Events and their corresponding property names.
+var eventTypes = {
+ beforeInput: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onBeforeInput: null}),
+ captured: keyOf({onBeforeInputCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topCompositionEnd,
+ topLevelTypes.topKeyPress,
+ topLevelTypes.topTextInput,
+ topLevelTypes.topPaste
+ ]
+ },
+ compositionEnd: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onCompositionEnd: null}),
+ captured: keyOf({onCompositionEndCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topBlur,
+ topLevelTypes.topCompositionEnd,
+ topLevelTypes.topKeyDown,
+ topLevelTypes.topKeyPress,
+ topLevelTypes.topKeyUp,
+ topLevelTypes.topMouseDown
+ ]
+ },
+ compositionStart: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onCompositionStart: null}),
+ captured: keyOf({onCompositionStartCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topBlur,
+ topLevelTypes.topCompositionStart,
+ topLevelTypes.topKeyDown,
+ topLevelTypes.topKeyPress,
+ topLevelTypes.topKeyUp,
+ topLevelTypes.topMouseDown
+ ]
+ },
+ compositionUpdate: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onCompositionUpdate: null}),
+ captured: keyOf({onCompositionUpdateCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topBlur,
+ topLevelTypes.topCompositionUpdate,
+ topLevelTypes.topKeyDown,
+ topLevelTypes.topKeyPress,
+ topLevelTypes.topKeyUp,
+ topLevelTypes.topMouseDown
+ ]
+ }
+};
+
+// Track whether we've ever handled a keypress on the space key.
+var hasSpaceKeypress = false;
+
+/**
+ * Return whether a native keypress event is assumed to be a command.
+ * This is required because Firefox fires `keypress` events for key commands
+ * (cut, copy, select-all, etc.) even though no character is inserted.
+ */
+function isKeypressCommand(nativeEvent) {
+ return (
+ (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
+ // ctrlKey && altKey is equivalent to AltGr, and is not a command.
+ !(nativeEvent.ctrlKey && nativeEvent.altKey)
+ );
+}
+
+
+/**
+ * Translate native top level events into event types.
+ *
+ * @param {string} topLevelType
+ * @return {object}
+ */
+function getCompositionEventType(topLevelType) {
+ switch (topLevelType) {
+ case topLevelTypes.topCompositionStart:
+ return eventTypes.compositionStart;
+ case topLevelTypes.topCompositionEnd:
+ return eventTypes.compositionEnd;
+ case topLevelTypes.topCompositionUpdate:
+ return eventTypes.compositionUpdate;
+ }
+}
+
+/**
+ * Does our fallback best-guess model think this event signifies that
+ * composition has begun?
+ *
+ * @param {string} topLevelType
+ * @param {object} nativeEvent
+ * @return {boolean}
+ */
+function isFallbackCompositionStart(topLevelType, nativeEvent) {
+ return (
+ topLevelType === topLevelTypes.topKeyDown &&
+ nativeEvent.keyCode === START_KEYCODE
+ );
+}
+
+/**
+ * Does our fallback mode think that this event is the end of composition?
+ *
+ * @param {string} topLevelType
+ * @param {object} nativeEvent
+ * @return {boolean}
+ */
+function isFallbackCompositionEnd(topLevelType, nativeEvent) {
+ switch (topLevelType) {
+ case topLevelTypes.topKeyUp:
+ // Command keys insert or clear IME input.
+ return (END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1);
+ case topLevelTypes.topKeyDown:
+ // Expect IME keyCode on each keydown. If we get any other
+ // code we must have exited earlier.
+ return (nativeEvent.keyCode !== START_KEYCODE);
+ case topLevelTypes.topKeyPress:
+ case topLevelTypes.topMouseDown:
+ case topLevelTypes.topBlur:
+ // Events are not possible without cancelling IME.
+ return true;
+ default:
+ return false;
+ }
+}
+
+/**
+ * Google Input Tools provides composition data via a CustomEvent,
+ * with the `data` property populated in the `detail` object. If this
+ * is available on the event object, use it. If not, this is a plain
+ * composition event and we have nothing special to extract.
+ *
+ * @param {object} nativeEvent
+ * @return {?string}
+ */
+function getDataFromCustomEvent(nativeEvent) {
+ var detail = nativeEvent.detail;
+ if (typeof detail === 'object' && 'data' in detail) {
+ return detail.data;
+ }
+ return null;
+}
+
+// Track the current IME composition fallback object, if any.
+var currentComposition = null;
+
+/**
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {DOMEventTarget} topLevelTarget The listening component root node.
+ * @param {string} topLevelTargetID ID of `topLevelTarget`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {?object} A SyntheticCompositionEvent.
+ */
+function extractCompositionEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent
+) {
+ var eventType;
+ var fallbackData;
+
+ if (canUseCompositionEvent) {
+ eventType = getCompositionEventType(topLevelType);
+ } else if (!currentComposition) {
+ if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
+ eventType = eventTypes.compositionStart;
+ }
+ } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
+ eventType = eventTypes.compositionEnd;
+ }
+
+ if (!eventType) {
+ return null;
+ }
+
+ if (useFallbackCompositionData) {
+ // The current composition is stored statically and must not be
+ // overwritten while composition continues.
+ if (!currentComposition && eventType === eventTypes.compositionStart) {
+ currentComposition = FallbackCompositionState.getPooled(topLevelTarget);
+ } else if (eventType === eventTypes.compositionEnd) {
+ if (currentComposition) {
+ fallbackData = currentComposition.getData();
+ }
+ }
+ }
+
+ var event = SyntheticCompositionEvent.getPooled(
+ eventType,
+ topLevelTargetID,
+ nativeEvent
+ );
+
+ if (fallbackData) {
+ // Inject data generated from fallback path into the synthetic event.
+ // This matches the property of native CompositionEventInterface.
+ event.data = fallbackData;
+ } else {
+ var customData = getDataFromCustomEvent(nativeEvent);
+ if (customData !== null) {
+ event.data = customData;
+ }
+ }
+
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+ return event;
+}
+
+/**
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {?string} The string corresponding to this `beforeInput` event.
+ */
+function getNativeBeforeInputChars(topLevelType, nativeEvent) {
+ switch (topLevelType) {
+ case topLevelTypes.topCompositionEnd:
+ return getDataFromCustomEvent(nativeEvent);
+ case topLevelTypes.topKeyPress:
+ /**
+ * If native `textInput` events are available, our goal is to make
+ * use of them. However, there is a special case: the spacebar key.
+ * In Webkit, preventing default on a spacebar `textInput` event
+ * cancels character insertion, but it *also* causes the browser
+ * to fall back to its default spacebar behavior of scrolling the
+ * page.
+ *
+ * Tracking at:
+ * https://code.google.com/p/chromium/issues/detail?id=355103
+ *
+ * To avoid this issue, use the keypress event as if no `textInput`
+ * event is available.
+ */
+ var which = nativeEvent.which;
+ if (which !== SPACEBAR_CODE) {
+ return null;
+ }
+
+ hasSpaceKeypress = true;
+ return SPACEBAR_CHAR;
+
+ case topLevelTypes.topTextInput:
+ // Record the characters to be added to the DOM.
+ var chars = nativeEvent.data;
+
+ // If it's a spacebar character, assume that we have already handled
+ // it at the keypress level and bail immediately. Android Chrome
+ // doesn't give us keycodes, so we need to blacklist it.
+ if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
+ return null;
+ }
+
+ return chars;
+
+ default:
+ // For other native event types, do nothing.
+ return null;
+ }
+}
+
+/**
+ * For browsers that do not provide the `textInput` event, extract the
+ * appropriate string to use for SyntheticInputEvent.
+ *
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {?string} The fallback string for this `beforeInput` event.
+ */
+function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
+ // If we are currently composing (IME) and using a fallback to do so,
+ // try to extract the composed characters from the fallback object.
+ if (currentComposition) {
+ if (
+ topLevelType === topLevelTypes.topCompositionEnd ||
+ isFallbackCompositionEnd(topLevelType, nativeEvent)
+ ) {
+ var chars = currentComposition.getData();
+ FallbackCompositionState.release(currentComposition);
+ currentComposition = null;
+ return chars;
+ }
+ return null;
+ }
+
+ switch (topLevelType) {
+ case topLevelTypes.topPaste:
+ // If a paste event occurs after a keypress, throw out the input
+ // chars. Paste events should not lead to BeforeInput events.
+ return null;
+ case topLevelTypes.topKeyPress:
+ /**
+ * As of v27, Firefox may fire keypress events even when no character
+ * will be inserted. A few possibilities:
+ *
+ * - `which` is `0`. Arrow keys, Esc key, etc.
+ *
+ * - `which` is the pressed key code, but no char is available.
+ * Ex: 'AltGr + d` in Polish. There is no modified character for
+ * this key combination and no character is inserted into the
+ * document, but FF fires the keypress for char code `100` anyway.
+ * No `input` event will occur.
+ *
+ * - `which` is the pressed key code, but a command combination is
+ * being used. Ex: `Cmd+C`. No character is inserted, and no
+ * `input` event will occur.
+ */
+ if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
+ return String.fromCharCode(nativeEvent.which);
+ }
+ return null;
+ case topLevelTypes.topCompositionEnd:
+ return useFallbackCompositionData ? null : nativeEvent.data;
+ default:
+ return null;
+ }
+}
+
+/**
+ * Extract a SyntheticInputEvent for `beforeInput`, based on either native
+ * `textInput` or fallback behavior.
+ *
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {DOMEventTarget} topLevelTarget The listening component root node.
+ * @param {string} topLevelTargetID ID of `topLevelTarget`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {?object} A SyntheticInputEvent.
+ */
+function extractBeforeInputEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent
+) {
+ var chars;
+
+ if (canUseTextInputEvent) {
+ chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
+ } else {
+ chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
+ }
+
+ // If no characters are being inserted, no BeforeInput event should
+ // be fired.
+ if (!chars) {
+ return null;
+ }
+
+ var event = SyntheticInputEvent.getPooled(
+ eventTypes.beforeInput,
+ topLevelTargetID,
+ nativeEvent
+ );
+
+ event.data = chars;
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+ return event;
+}
+
+/**
+ * Create an `onBeforeInput` event to match
+ * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
+ *
+ * This event plugin is based on the native `textInput` event
+ * available in Chrome, Safari, Opera, and IE. This event fires after
+ * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
+ *
+ * `beforeInput` is spec'd but not implemented in any browsers, and
+ * the `input` event does not provide any useful information about what has
+ * actually been added, contrary to the spec. Thus, `textInput` is the best
+ * available event to identify the characters that have actually been inserted
+ * into the target node.
+ *
+ * This plugin is also responsible for emitting `composition` events, thus
+ * allowing us to share composition fallback code for both `beforeInput` and
+ * `composition` event types.
+ */
+var BeforeInputEventPlugin = {
+
+ eventTypes: eventTypes,
+
+ /**
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {DOMEventTarget} topLevelTarget The listening component root node.
+ * @param {string} topLevelTargetID ID of `topLevelTarget`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {*} An accumulation of synthetic events.
+ * @see {EventPluginHub.extractEvents}
+ */
+ extractEvents: function(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent
+ ) {
+ return [
+ extractCompositionEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent
+ ),
+ extractBeforeInputEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent
+ )
+ ];
+ }
+};
+
+module.exports = BeforeInputEventPlugin;
+
+},{"./EventConstants":200,"./EventPropagators":205,"./ExecutionEnvironment":206,"./FallbackCompositionState":207,"./SyntheticCompositionEvent":291,"./SyntheticInputEvent":295,"./keyOf":342}],188:[function(require,module,exports){
+(function (process){
+/**
+ * Copyright 2013-2015, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule CSSCore
+ * @typechecks
+ */
+
+var invariant = require("./invariant");
+
+/**
+ * The CSSCore module specifies the API (and implements most of the methods)
+ * that should be used when dealing with the display of elements (via their
+ * CSS classes and visibility on screen. It is an API focused on mutating the
+ * display and not reading it as no logical state should be encoded in the
+ * display of elements.
+ */
+
+var CSSCore = {
+
+ /**
+ * Adds the class passed in to the element if it doesn't already have it.
+ *
+ * @param {DOMElement} element the element to set the class on
+ * @param {string} className the CSS className
+ * @return {DOMElement} the element passed in
+ */
+ addClass: function(element, className) {
+ ("production" !== process.env.NODE_ENV ? invariant(
+ !/\s/.test(className),
+ 'CSSCore.addClass takes only a single class name. "%s" contains ' +
+ 'multiple classes.', className
+ ) : invariant(!/\s/.test(className)));
+
+ if (className) {
+ if (element.classList) {
+ element.classList.add(className);
+ } else if (!CSSCore.hasClass(element, className)) {
+ element.className = element.className + ' ' + className;
+ }
+ }
+ return element;
+ },
+
+ /**
+ * Removes the class passed in from the element
+ *
+ * @param {DOMElement} element the element to set the class on
+ * @param {string} className the CSS className
+ * @return {DOMElement} the element passed in
+ */
+ removeClass: function(element, className) {
+ ("production" !== process.env.NODE_ENV ? invariant(
+ !/\s/.test(className),
+ 'CSSCore.removeClass takes only a single class name. "%s" contains ' +
+ 'multiple classes.', className
+ ) : invariant(!/\s/.test(className)));
+
+ if (className) {
+ if (element.classList) {
+ element.classList.remove(className);
+ } else if (CSSCore.hasClass(element, className)) {
+ element.className = element.className
+ .replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1')
+ .replace(/\s+/g, ' ') // multiple spaces to one
+ .replace(/^\s*|\s*$/g, ''); // trim the ends
+ }
+ }
+ return element;
+ },
+
+ /**
+ * Helper to add or remove a class from an element based on a condition.
+ *
+ * @param {DOMElement} element the element to set the class on
+ * @param {string} className the CSS className
+ * @param {*} bool condition to whether to add or remove the class
+ * @return {DOMElement} the element passed in
+ */
+ conditionClass: function(element, className, bool) {
+ return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className);
+ },
+
+ /**
+ * Tests whether the element has the class specified.
+ *
+ * @param {DOMNode|DOMWindow} element the element to set the class on
+ * @param {string} className the CSS className
+ * @return {boolean} true if the element has the class, false if not
+ */
+ hasClass: function(element, className) {
+ ("production" !== process.env.NODE_ENV ? invariant(
+ !/\s/.test(className),
+ 'CSS.hasClass takes only a single class name.'
+ ) : invariant(!/\s/.test(className)));
+ if (element.classList) {
+ return !!className && element.classList.contains(className);
+ }
+ return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
+ }
+
+};
+
+module.exports = CSSCore;
+
+}).call(this,require('_process'))
+
+},{"./invariant":335,"_process":7}],189:[function(require,module,exports){
+/**
+ * Copyright 2013-2015, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule CSSProperty
+ */
+
+'use strict';
+
+/**
+ * CSS properties which accept numbers but are not in units of "px".
+ */
+var isUnitlessNumber = {
+ boxFlex: true,
+ boxFlexGroup: true,
+ columnCount: true,
+ flex: true,
+ flexGrow: true,
+ flexPositive: true,
+ flexShrink: true,
+ flexNegative: true,
+ fontWeight: true,
+ lineClamp: true,
+ lineHeight: true,
+ opacity: true,
+ order: true,
+ orphans: true,
+ widows: true,
+ zIndex: true,
+ zoom: true,
+
+ // SVG-related properties
+ fillOpacity: true,
+ strokeDashoffset: true,
+ strokeOpacity: true,
+ strokeWidth: true
+};
+
+/**
+ * @param {string} prefix vendor-specific prefix, eg: Webkit
+ * @param {string} key style name, eg: transitionDuration
+ * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
+ * WebkitTransitionDuration
+ */
+function prefixKey(prefix, key) {
+ return prefix + key.charAt(0).toUpperCase() + key.substring(1);
+}
+
+/**
+ * Support style names that may come passed in prefixed by adding permutations
+ * of vendor prefixes.
+ */
+var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
+
+// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
+// infinite loop, because it iterates over the newly added props too.
+Object.keys(isUnitlessNumber).forEach(function(prop) {
+ prefixes.forEach(function(prefix) {
+ isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
+ });
+});
+
+/**
+ * Most style properties can be unset by doing .style[prop] = '' but IE8
+ * doesn't like doing that with shorthand properties so for the properties that
+ * IE8 breaks on, which are listed here, we instead unset each of the
+ * individual properties. See http://bugs.jquery.com/ticket/12385.
+ * The 4-value 'clock' properties like margin, padding, border-width seem to
+ * behave without any problems. Curiously, list-style works too without any
+ * special prodding.
+ */
+var shorthandPropertyExpansions = {
+ background: {
+ backgroundImage: true,
+ backgroundPosition: true,
+ backgroundRepeat: true,
+ backgroundColor: true
+ },
+ border: {
+ borderWidth: true,
+ borderStyle: true,
+ borderColor: true
+ },
+ borderBottom: {
+ borderBottomWidth: true,
+ borderBottomStyle: true,
+ borderBottomColor: true
+ },
+ borderLeft: {
+ borderLeftWidth: true,
+ borderLeftStyle: true,
+ borderLeftColor: true
+ },
+ borderRight: {
+ borderRightWidth: true,
+ borderRightStyle: true,
+ borderRightColor: true
+ },
+ borderTop: {
+ borderTopWidth: true,
+ borderTopStyle: true,
+ borderTopColor: true
+ },
+ font: {
+ fontStyle: true,
+ fontVariant: true,
+ fontWeight: true,
+ fontSize: true,
+ lineHeight: true,
+ fontFamily: true
+ }
+};
+
+var CSSProperty = {
+ isUnitlessNumber: isUnitlessNumber,
+ shorthandPropertyExpansions: shorthandPropertyExpansions
+};
+
+module.exports = CSSProperty;
+
+},{}],190:[function(require,module,exports){
+(function (process){
+/**
+ * Copyright 2013-2015, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule CSSPropertyOperations
+ * @typechecks static-only
+ */
+
+'use strict';
+
+var CSSProperty = require("./CSSProperty");
+var ExecutionEnvironment = require("./ExecutionEnvironment");
+
+var camelizeStyleName = require("./camelizeStyleName");
+var dangerousStyleValue = require("./dangerousStyleValue");
+var hyphenateStyleName = require("./hyphenateStyleName");
+var memoizeStringOnly = require("./memoizeStringOnly");
+var warning = require("./warning");
+
+var processStyleName = memoizeStringOnly(function(styleName) {
+ return hyphenateStyleName(styleName);
+});
+
+var styleFloatAccessor = 'cssFloat';
+if (ExecutionEnvironment.canUseDOM) {
+ // IE8 only supports accessing cssFloat (standard) as styleFloat
+ if (document.documentElement.style.cssFloat === undefined) {
+ styleFloatAccessor = 'styleFloat';
+ }
+}
+
+if ("production" !== process.env.NODE_ENV) {
+ // 'msTransform' is correct, but the other prefixes should be capitalized
+ var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
+
+ // style values shouldn't contain a semicolon
+ var badStyleValueWithSemicolonPattern = /;\s*$/;
+
+ var warnedStyleNames = {};
+ var warnedStyleValues = {};
+
+ var warnHyphenatedStyleName = function(name) {
+ if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
+ return;
+ }
+
+ warnedStyleNames[name] = true;
+ ("production" !== process.env.NODE_ENV ? warning(
+ false,
+ 'Unsupported style property %s. Did you mean %s?',
+ name,
+ camelizeStyleName(name)
+ ) : null);
+ };
+
+ var warnBadVendoredStyleName = function(name) {
+ if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
+ return;
+ }
+
+ warnedStyleNames[name] = true;
+ ("production" !== process.env.NODE_ENV ? warning(
+ false,
+ 'Unsupported vendor-prefixed style property %s. Did you mean %s?',
+ name,
+ name.charAt(0).toUpperCase() + name.slice(1)
+ ) : null);
+ };
+
+ var warnStyleValueWithSemicolon = function(name, value) {
+ if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
+ return;
+ }
+
+ warnedStyleValues[value] = true;
+ ("production" !== process.env.NODE_ENV ? warning(
+ false,
+ 'Style property values shouldn\'t contain a semicolon. ' +
+ 'Try "%s: %s" instead.',
+ name,
+ value.replace(badStyleValueWithSemicolonPattern, '')
+ ) : null);
+ };
+
+ /**
+ * @param {string} name
+ * @param {*} value
+ */
+ var warnValidStyle = function(name, value) {
+ if (name.indexOf('-') > -1) {
+ warnHyphenatedStyleName(name);
+ } else if (badVendoredStyleNamePattern.test(name)) {
+ warnBadVendoredStyleName(name);
+ } else if (badStyleValueWithSemicolonPattern.test(value)) {
+ warnStyleValueWithSemicolon(name, value);
+ }
+ };
+}
+
+/**
+ * Operations for dealing with CSS properties.
+ */
+var CSSPropertyOperations = {
+
+ /**
+ * Serializes a mapping of style properties for use as inline styles:
+ *
+ * > createMarkupForStyles({width: '200px', height: 0})
+ * "width:200px;height:0;"
+ *
+ * Undefined values are ignored so that declarative programming is easier.
+ * The result should be HTML-escaped before insertion into the DOM.
+ *
+ * @param {object} styles
+ * @return {?string}
+ */
+ createMarkupForStyles: function(styles) {
+ var serialized = '';
+ for (var styleName in styles) {
+ if (!styles.hasOwnProperty(styleName)) {
+ continue;
+ }
+ var styleValue = styles[styleName];
+ if ("production" !== process.env.NODE_ENV) {
+ warnValidStyle(styleName, styleValue);
+ }
+ if (styleValue != null) {
+ serialized += processStyleName(styleName) + ':';
+ serialized += dangerousStyleValue(styleName, styleValue) + ';';
+ }
+ }
+ return serialized || null;
+ },
+
+ /**
+ * Sets the value for multiple styles on a node. If a value is specified as
+ * '' (empty string), the corresponding style property will be unset.
+ *
+ * @param {DOMElement} node
+ * @param {object} styles
+ */
+ setValueForStyles: function(node, styles) {
+ var style = node.style;
+ for (var styleName in styles) {
+ if (!styles.hasOwnProperty(styleName)) {
+ continue;
+ }
+ if ("production" !== process.env.NODE_ENV) {
+ warnValidStyle(styleName, styles[styleName]);
+ }
+ var styleValue = dangerousStyleValue(styleName, styles[styleName]);
+ if (styleName === 'float') {
+ styleName = styleFloatAccessor;
+ }
+ if (styleValue) {
+ style[styleName] = styleValue;
+ } else {
+ var expansion = CSSProperty.shorthandPropertyExpansions[styleName];
+ if (expansion) {
+ // Shorthand property that IE8 won't like unsetting, so unset each
+ // component to placate it
+ for (var individualStyleName in expansion) {
+ style[individualStyleName] = '';
+ }
+ } else {
+ style[styleName] = '';
+ }
+ }
+ }
+ }
+
+};
+
+module.exports = CSSPropertyOperations;
+
+}).call(this,require('_process'))
+
+},{"./CSSProperty":189,"./ExecutionEnvironment":206,"./camelizeStyleName":306,"./dangerousStyleValue":313,"./hyphenateStyleName":333,"./memoizeStringOnly":344,"./warning":356,"_process":7}],191:[function(require,module,exports){
+(function (process){
+/**
+ * Copyright 2013-2015, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule CallbackQueue
+ */
+
+'use strict';
+
+var PooledClass = require("./PooledClass");
+
+var assign = require("./Object.assign");
+var invariant = require("./invariant");
+
+/**
+ * A specialized pseudo-event module to help keep track of components waiting to
+ * be notified when their DOM representations are available for use.
+ *
+ * This implements `PooledClass`, so you should never need to instantiate this.
+ * Instead, use `CallbackQueue.getPooled()`.
+ *
+ * @class ReactMountReady
+ * @implements PooledClass
+ * @internal
+ */
+function CallbackQueue() {
+ this._callbacks = null;
+ this._contexts = null;
+}
+
+assign(CallbackQueue.prototype, {
+
+ /**
+ * Enqueues a callback to be invoked when `notifyAll` is invoked.
+ *
+ * @param {function} callback Invoked when `notifyAll` is invoked.
+ * @param {?object} context Context to call `callback` with.
+ * @internal
+ */
+ enqueue: function(callback, context) {
+ this._callbacks = this._callbacks || [];
+ this._contexts = this._contexts || [];
+ this._callbacks.push(callback);
+ this._contexts.push(context);
+ },
+
+ /**
+ * Invokes all enqueued callbacks and clears the queue. This is invoked after
+ * the DOM representation of a component has been created or updated.
+ *
+ * @internal
+ */
+ notifyAll: function() {
+ var callbacks = this._callbacks;
+ var contexts = this._contexts;
+ if (callbacks) {
+ ("production" !== process.env.NODE_ENV ? invariant(
+ callbacks.length === contexts.length,
+ 'Mismatched list of contexts in callback queue'
+ ) : invariant(callbacks.length === contexts.length));
+ this._callbacks = null;
+ this._contexts = null;
+ for (var i = 0, l = callbacks.length; i < l; i++) {
+ callbacks[i].call(contexts[i]);
+ }
+ callbacks.length = 0;
+ contexts.length = 0;
+ }
+ },
+
+ /**
+ * Resets the internal queue.
+ *
+ * @internal
+ */
+ reset: function() {
+ this._callbacks = null;
+ this._contexts = null;
+ },
+
+ /**
+ * `PooledClass` looks for this.
+ */
+ destructor: function() {
+ this.reset();
+ }
+
+});
+
+PooledClass.addPoolingTo(CallbackQueue);
+
+module.exports = CallbackQueue;
+
+}).call(this,require('_process'))
+
+},{"./Object.assign":213,"./PooledClass":214,"./invariant":335,"_process":7}],192:[function(require,module,exports){
+/**
+ * Copyright 2013-2015, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule ChangeEventPlugin
+ */
+
+'use strict';
+
+var EventConstants = require("./EventConstants");
+var EventPluginHub = require("./EventPluginHub");
+var EventPropagators = require("./EventPropagators");
+var ExecutionEnvironment = require("./ExecutionEnvironment");
+var ReactUpdates = require("./ReactUpdates");
+var SyntheticEvent = require("./SyntheticEvent");
+
+var isEventSupported = require("./isEventSupported");
+var isTextInputElement = require("./isTextInputElement");
+var keyOf = require("./keyOf");
+
+var topLevelTypes = EventConstants.topLevelTypes;
+
+var eventTypes = {
+ change: {
+ phasedRegistrationNames: {
+ bubbled: keyOf({onChange: null}),
+ captured: keyOf({onChangeCapture: null})
+ },
+ dependencies: [
+ topLevelTypes.topBlur,
+ topLevelTypes.topChange,
+ topLevelTypes.topClick,
+ topLevelTypes.topFocus,
+ topLevelTypes.topInput,
+ topLevelTypes.topKeyDown,
+ topLevelTypes.topKeyUp,
+ topLevelTypes.topSelectionChange
+ ]
+ }
+};
+
+/**
+ * For IE shims
+ */
+var activeElement = null;
+var activeElementID = null;
+var activeElementValue = null;
+var activeElementValueProp = null;
+
+/**
+ * SECTION: handle `change` event
+ */
+function shouldUseChangeEvent(elem) {
+ return (
+ elem.nodeName === 'SELECT' ||
+ (elem.nodeName === 'INPUT' && elem.type === 'file')
+ );
+}
+
+var doesChangeEventBubble = false;
+if (ExecutionEnvironment.canUseDOM) {
+ // See `handleChange` comment below
+ doesChangeEventBubble = isEventSupported('change') && (
+ (!('documentMode' in document) || document.documentMode > 8)
+ );
+}
+
+function manualDispatchChangeEvent(nativeEvent) {
+ var event = SyntheticEvent.getPooled(
+ eventTypes.change,
+ activeElementID,
+ nativeEvent
+ );
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+
+ // If change and propertychange bubbled, we'd just bind to it like all the
+ // other events and have it go through ReactBrowserEventEmitter. Since it
+ // doesn't, we manually listen for the events and so we have to enqueue and
+ // process the abstract event manually.
+ //
+ // Batching is necessary here in order to ensure that all event handlers run
+ // before the next rerender (including event handlers attached to ancestor
+ // elements instead of directly on the input). Without this, controlled
+ // components don't work properly in conjunction with event bubbling because
+ // the component is rerendered and the value reverted before all the event
+ // handlers can run. See https://github.com/facebook/react/issues/708.
+ ReactUpdates.batchedUpdates(runEventInBatch, event);
+}
+
+function runEventInBatch(event) {
+ EventPluginHub.enqueueEvents(event);
+ EventPluginHub.processEventQueue();
+}
+
+function startWatchingForChangeEventIE8(target, targetID) {
+ activeElement = target;
+ activeElementID = targetID;
+ activeElement.attachEvent('onchange', manualDispatchChangeEvent);
+}
+
+function stopWatchingForChangeEventIE8() {
+ if (!activeElement) {
+ return;
+ }
+ activeElement.detachEvent('onchange', manualDispatchChangeEvent);
+ activeElement = null;
+ activeElementID = null;
+}
+
+function getTargetIDForChangeEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID) {
+ if (topLevelType === topLevelTypes.topChange) {
+ return topLevelTargetID;
+ }
+}
+function handleEventsForChangeEventIE8(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID) {
+ if (topLevelType === topLevelTypes.topFocus) {
+ // stopWatching() should be a noop here but we call it just in case we
+ // missed a blur event somehow.
+ stopWatchingForChangeEventIE8();
+ startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID);
+ } else if (topLevelType === topLevelTypes.topBlur) {
+ stopWatchingForChangeEventIE8();
+ }
+}
+
+
+/**
+ * SECTION: handle `input` event
+ */
+var isInputEventSupported = false;
+if (ExecutionEnvironment.canUseDOM) {
+ // IE9 claims to support the input event but fails to trigger it when
+ // deleting text, so we ignore its input events
+ isInputEventSupported = isEventSupported('input') && (
+ (!('documentMode' in document) || document.documentMode > 9)
+ );
+}
+
+/**
+ * (For old IE.) Replacement getter/setter for the `value` property that gets
+ * set on the active element.
+ */
+var newValueProp = {
+ get: function() {
+ return activeElementValueProp.get.call(this);
+ },
+ set: function(val) {
+ // Cast to a string so we can do equality checks.
+ activeElementValue = '' + val;
+ activeElementValueProp.set.call(this, val);
+ }
+};
+
+/**
+ * (For old IE.) Starts tracking propertychange events on the passed-in element
+ * and override the value property so that we can distinguish user events from
+ * value changes in JS.
+ */
+function startWatchingForValueChange(target, targetID) {
+ activeElement = target;
+ activeElementID = targetID;
+ activeElementValue = target.value;
+ activeElementValueProp = Object.getOwnPropertyDescriptor(
+ target.constructor.prototype,
+ 'value'
+ );
+
+ Object.defineProperty(activeElement, 'value', newValueProp);
+ activeElement.attachEvent('onpropertychange', handlePropertyChange);
+}
+
+/**
+ * (For old IE.) Removes the event listeners from the currently-tracked element,
+ * if any exists.
+ */
+function stopWatchingForValueChange() {
+ if (!activeElement) {
+ return;
+ }
+
+ // delete restores the original property definition
+ delete activeElement.value;
+ activeElement.detachEvent('onpropertychange', handlePropertyChange);
+
+ activeElement = null;
+ activeElementID = null;
+ activeElementValue = null;
+ activeElementValueProp = null;
+}
+
+/**
+ * (For old IE.) Handles a propertychange event, sending a `change` event if
+ * the value of the active element has changed.
+ */
+function handlePropertyChange(nativeEvent) {
+ if (nativeEvent.propertyName !== 'value') {
+ return;
+ }
+ var value = nativeEvent.srcElement.value;
+ if (value === activeElementValue) {
+ return;
+ }
+ activeElementValue = value;
+
+ manualDispatchChangeEvent(nativeEvent);
+}
+
+/**
+ * If a `change` event should be fired, returns the target's ID.
+ */
+function getTargetIDForInputEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID) {
+ if (topLevelType === topLevelTypes.topInput) {
+ // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
+ // what we want so fall through here and trigger an abstract event
+ return topLevelTargetID;
+ }
+}
+
+// For IE8 and IE9.
+function handleEventsForInputEventIE(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID) {
+ if (topLevelType === topLevelTypes.topFocus) {
+ // In IE8, we can capture almost all .value changes by adding a
+ // propertychange handler and looking for events with propertyName
+ // equal to 'value'
+ // In IE9, propertychange fires for most input events but is buggy and
+ // doesn't fire when text is deleted, but conveniently, selectionchange
+ // appears to fire in all of the remaining cases so we catch those and
+ // forward the event if the value has changed
+ // In either case, we don't want to call the event handler if the value
+ // is changed from JS so we redefine a setter for `.value` that updates
+ // our activeElementValue variable, allowing us to ignore those changes
+ //
+ // stopWatching() should be a noop here but we call it just in case we
+ // missed a blur event somehow.
+ stopWatchingForValueChange();
+ startWatchingForValueChange(topLevelTarget, topLevelTargetID);
+ } else if (topLevelType === topLevelTypes.topBlur) {
+ stopWatchingForValueChange();
+ }
+}
+
+// For IE8 and IE9.
+function getTargetIDForInputEventIE(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID) {
+ if (topLevelType === topLevelTypes.topSelectionChange ||
+ topLevelType === topLevelTypes.topKeyUp ||
+ topLevelType === topLevelTypes.topKeyDown) {
+ // On the selectionchange event, the target is just document which isn't
+ // helpful for us so just check activeElement instead.
+ //
+ // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
+ // propertychange on the first input event after setting `value` from a
+ // script and fires only keydown, keypress, keyup. Catching keyup usually
+ // gets it and catching keydown lets us fire an event for the first
+ // keystroke if user does a key repeat (it'll be a little delayed: right
+ // before the second keystroke). Other input methods (e.g., paste) seem to
+ // fire selectionchange normally.
+ if (activeElement && activeElement.value !== activeElementValue) {
+ activeElementValue = activeElement.value;
+ return activeElementID;
+ }
+ }
+}
+
+
+/**
+ * SECTION: handle `click` event
+ */
+function shouldUseClickEvent(elem) {
+ // Use the `click` event to detect changes to checkbox and radio inputs.
+ // This approach works across all browsers, whereas `change` does not fire
+ // until `blur` in IE8.
+ return (
+ elem.nodeName === 'INPUT' &&
+ (elem.type === 'checkbox' || elem.type === 'radio')
+ );
+}
+
+function getTargetIDForClickEvent(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID) {
+ if (topLevelType === topLevelTypes.topClick) {
+ return topLevelTargetID;
+ }
+}
+
+/**
+ * This plugin creates an `onChange` event that normalizes change events
+ * across form elements. This event fires at a time when it's possible to
+ * change the element's value without seeing a flicker.
+ *
+ * Supported elements are:
+ * - input (see `isTextInputElement`)
+ * - textarea
+ * - select
+ */
+var ChangeEventPlugin = {
+
+ eventTypes: eventTypes,
+
+ /**
+ * @param {string} topLevelType Record from `EventConstants`.
+ * @param {DOMEventTarget} topLevelTarget The listening component root node.
+ * @param {string} topLevelTargetID ID of `topLevelTarget`.
+ * @param {object} nativeEvent Native browser event.
+ * @return {*} An accumulation of synthetic events.
+ * @see {EventPluginHub.extractEvents}
+ */
+ extractEvents: function(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID,
+ nativeEvent) {
+
+ var getTargetIDFunc, handleEventFunc;
+ if (shouldUseChangeEvent(topLevelTarget)) {
+ if (doesChangeEventBubble) {
+ getTargetIDFunc = getTargetIDForChangeEvent;
+ } else {
+ handleEventFunc = handleEventsForChangeEventIE8;
+ }
+ } else if (isTextInputElement(topLevelTarget)) {
+ if (isInputEventSupported) {
+ getTargetIDFunc = getTargetIDForInputEvent;
+ } else {
+ getTargetIDFunc = getTargetIDForInputEventIE;
+ handleEventFunc = handleEventsForInputEventIE;
+ }
+ } else if (shouldUseClickEvent(topLevelTarget)) {
+ getTargetIDFunc = getTargetIDForClickEvent;
+ }
+
+ if (getTargetIDFunc) {
+ var targetID = getTargetIDFunc(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID
+ );
+ if (targetID) {
+ var event = SyntheticEvent.getPooled(
+ eventTypes.change,
+ targetID,
+ nativeEvent
+ );
+ EventPropagators.accumulateTwoPhaseDispatches(event);
+ return event;
+ }
+ }
+
+ if (handleEventFunc) {
+ handleEventFunc(
+ topLevelType,
+ topLevelTarget,
+ topLevelTargetID
+ );
+ }
+ }
+
+};
+
+module.exports = ChangeEventPlugin;
+
+},{"./EventConstants":200,"./EventPluginHub":202,"./EventPropagators":205,"./ExecutionEnvironment":206,"./ReactUpdates":284,"./SyntheticEvent":293,"./isEventSupported":336,"./isTextInputElement":338,"./keyOf":342}],193:[function(require,module,exports){
+/**
+ * Copyright 2013-2015, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule ClientReactRootIndex
+ * @typechecks
+ */
+
+'use strict';
+
+var nextReactRootIndex = 0;
+
+var ClientReactRootIndex = {
+ createReactRootIndex: function() {
+ return nextReactRootIndex++;
+ }
+};
+
+module.exports = ClientReactRootIndex;
+
+},{}],194:[function(require,module,exports){
+(function (process){
+/**
+ * Copyright 2013-2015, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ * @providesModule DOMChildrenOperations
+ * @typechecks static-only
+ */
+
+'use strict';
+
+var Danger = require("./Danger");
+var ReactMultiChildUpdateTypes = require("./ReactMultiChildUpdateTypes");
+
+var setTextContent = require("./setTextContent");
+var invariant = require("./invariant");
+
+/**
+ * Inserts `childNode` as a child of `parentNode` at the `index`.
+ *
+ * @param {DOMElement} parentNode Parent node in which to insert.
+ * @param {DOMElement} childNode Child node to insert.
+ * @param {number} index Index at which to insert the child.
+ * @internal
+ */
+function insertChildAt(parentNode, childNode, index) {
+ // By exploiting arrays returning `undefined` for an undefined index, we can
+ // rely exclusively on `insertBefore(node, null)` instead of also using
+ // `appendChild(node)`. However, using `undefined` is not allowed by all
+ // browsers so we must replace it with `null`.
+ parentNode.insertBefore(
+ childNode,
+ parentNode.childNodes[index] || null
+ );
+}
+
+/**
+ * Operations for updating with DOM children.
+ */
+var DOMChildrenOperations = {
+
+ dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
+
+ updateTextContent: setTextContent,
+
+ /**
+ * Updates a component's children by processing a series of updates. The
+ * update configurations are each expected to have a `parentNode` property.
+ *
+ * @param {array