From 70af4fae46a9b74feb2fd04f370ebce13d5450b0 Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 2 Mar 2016 21:21:41 +0800 Subject: [web] StoreView.index -> indexOf --- mitmproxy/web/static/app.js | 8 +- mitmproxy/web/static/vendor.js | 7478 ++++++++++++++++++------------------ web/src/js/components/flowtable.js | 2 +- web/src/js/store/view.js | 6 +- 4 files changed, 3747 insertions(+), 3747 deletions(-) diff --git a/mitmproxy/web/static/app.js b/mitmproxy/web/static/app.js index 4299f749..3537d355 100644 --- a/mitmproxy/web/static/app.js +++ b/mitmproxy/web/static/app.js @@ -1580,7 +1580,7 @@ var FlowTable = _react2.default.createClass({ this.forceUpdate(); }, scrollIntoView: function scrollIntoView(flow) { - this.scrollRowIntoView(this.context.view.index(flow), _reactDom2.default.findDOMNode(this.refs.body).offsetTop); + this.scrollRowIntoView(this.context.view.indexOf(flow), _reactDom2.default.findDOMNode(this.refs.body).offsetTop); }, renderRow: function renderRow(flow) { var selected = flow === this.props.selected; @@ -6317,12 +6317,12 @@ _lodash2.default.extend(StoreView.prototype, _events.EventEmitter.prototype, { }); this.emit("recalculate"); }, - index: function index(elem) { - return _lodash2.default.sortedIndexBy(this.list, elem, this.sortfun); + indexOf: function indexOf(elem) { + return this.list.indexOf(elem, _lodash2.default.sortedIndexBy(this.list, elem, this.sortfun)); }, add: function add(elem) { if (this.filt(elem)) { - var idx = this.index(elem); + var idx = _lodash2.default.sortedIndexBy(this.list, elem, this.sortfun); if (idx === this.list.length) { //happens often, .push is way faster. this.list.push(elem); diff --git a/mitmproxy/web/static/vendor.js b/mitmproxy/web/static/vendor.js index cc631d27..6bb4b947 100644 --- a/mitmproxy/web/static/vendor.js +++ b/mitmproxy/web/static/vendor.js @@ -1,97 +1,186 @@ require=(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 0 && typeof x[0] !== 'number') return false; + return true; } -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } +function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; +} + +},{"./lib/is_arguments.js":2,"./lib/keys.js":3}],2:[function(require,module,exports){ +var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) +})() == '[object Arguments]'; + +exports = module.exports = supportsArgumentsClass ? supported : unsupported; + +exports.supported = supported; +function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; }; -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); +exports.unsupported = unsupported; +function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; }; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; -function noop() {} +},{}],3:[function(require,module,exports){ +exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; +exports.shim = shim; +function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; +},{}],4:[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 invariant + */ -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); +"use strict"; + +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + +var invariant = function (condition, format, a, b, c, d, e, f) { + if (process.env.NODE_ENV !== 'production') { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + } + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error('Invariant Violation: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + })); + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } }; -process.umask = function() { return 0; }; -},{}],2:[function(require,module,exports){ +module.exports = invariant; +}).call(this,require('_process')) + +},{"_process":23}],5:[function(require,module,exports){ (function (process){ /** * Copyright (c) 2014-2015, Facebook, Inc. @@ -326,422 +415,456 @@ var Dispatcher = (function () { module.exports = Dispatcher; }).call(this,require('_process')) -},{"_process":1,"fbjs/lib/invariant":3}],3:[function(require,module,exports){ -(function (process){ +},{"_process":23,"fbjs/lib/invariant":4}],6:[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 invariant + * Indicates that navigation was caused by a call to history.push. */ +'use strict'; -"use strict"; +exports.__esModule = true; +var PUSH = 'PUSH'; +exports.PUSH = PUSH; /** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. + * Indicates that navigation was caused by a call to history.replace. */ +var REPLACE = 'REPLACE'; -var invariant = function (condition, format, a, b, c, d, e, f) { - if (process.env.NODE_ENV !== 'production') { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } - - if (!condition) { - var error; - if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error('Invariant Violation: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - })); - } +exports.REPLACE = REPLACE; +/** + * Indicates that navigation was caused by some other action such + * as using a browser's back/forward buttons and/or manually manipulating + * the URL in a browser's location bar. This is the default. + * + * See https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate + * for more information. + */ +var POP = 'POP'; - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } +exports.POP = POP; +exports['default'] = { + PUSH: PUSH, + REPLACE: REPLACE, + POP: POP }; - -module.exports = invariant; -}).call(this,require('_process')) - -},{"_process":1}],4:[function(require,module,exports){ +},{}],7:[function(require,module,exports){ "use strict"; exports.__esModule = true; -var _slice = Array.prototype.slice; exports.loopAsync = loopAsync; -exports.mapAsync = mapAsync; function loopAsync(turns, work, callback) { - var currentTurn = 0, - isDone = false; - var sync = false, - hasNext = false, - doneArgs = undefined; + var currentTurn = 0; + var isDone = false; function done() { isDone = true; - if (sync) { - // Iterate instead of recursing if possible. - doneArgs = [].concat(_slice.call(arguments)); - return; - } - callback.apply(this, arguments); } function next() { - if (isDone) { - return; - } - - hasNext = true; - if (sync) { - // Iterate instead of recursing if possible. - return; - } - - sync = true; + if (isDone) return; - while (!isDone && currentTurn < turns && hasNext) { - hasNext = false; + if (currentTurn < turns) { work.call(this, currentTurn++, next, done); - } - - sync = false; - - if (isDone) { - // This means the loop finished synchronously. - callback.apply(this, doneArgs); - return; - } - - if (currentTurn >= turns && hasNext) { - isDone = true; - callback(); + } else { + done.apply(this, arguments); } } next(); } +},{}],8:[function(require,module,exports){ +(function (process){ +/*eslint-disable no-empty */ +'use strict'; -function mapAsync(array, work, callback) { - var length = array.length; - var values = []; - - if (length === 0) return callback(null, values); +exports.__esModule = true; +exports.saveState = saveState; +exports.readState = readState; - var isDone = false, - doneCount = 0; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - function done(index, error, value) { - if (isDone) return; +var _warning = require('warning'); - if (error) { - isDone = true; - callback(error); - } else { - values[index] = value; +var _warning2 = _interopRequireDefault(_warning); - isDone = ++doneCount === length; +var KeyPrefix = '@@History/'; +var QuotaExceededErrors = ['QuotaExceededError', 'QUOTA_EXCEEDED_ERR']; - if (isDone) callback(null, values); - } - } +var SecurityError = 'SecurityError'; - array.forEach(function (item, index) { - work(item, index, function (error, value) { - done(index, error, value); - }); - }); +function createKey(key) { + return KeyPrefix + key; } -},{}],5:[function(require,module,exports){ -(function (process){ -'use strict'; - -exports.__esModule = true; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +function saveState(key, state) { + try { + if (state == null) { + window.sessionStorage.removeItem(createKey(key)); + } else { + window.sessionStorage.setItem(createKey(key), JSON.stringify(state)); + } + } catch (error) { + if (error.name === SecurityError) { + // Blocking cookies in Chrome/Firefox/Safari throws SecurityError on any + // attempt to access window.sessionStorage. + process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '[history] Unable to save state; sessionStorage is not available due to security settings') : undefined; -var _routerWarning = require('./routerWarning'); + return; + } -var _routerWarning2 = _interopRequireDefault(_routerWarning); + if (QuotaExceededErrors.indexOf(error.name) >= 0 && window.sessionStorage.length === 0) { + // Safari "private mode" throws QuotaExceededError. + process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '[history] Unable to save state; sessionStorage is not available in Safari private mode') : undefined; -var _PropTypes = require('./PropTypes'); + return; + } -/** - * A mixin that adds the "history" instance variable to components. - */ -var History = { + throw error; + } +} - contextTypes: { - history: _PropTypes.history - }, +function readState(key) { + var json = undefined; + try { + json = window.sessionStorage.getItem(createKey(key)); + } catch (error) { + if (error.name === SecurityError) { + // Blocking cookies in Chrome/Firefox/Safari throws SecurityError on any + // attempt to access window.sessionStorage. + process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '[history] Unable to read state; sessionStorage is not available due to security settings') : undefined; - componentWillMount: function componentWillMount() { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'the `History` mixin is deprecated, please access `context.router` with your own `contextTypes`. http://tiny.cc/router-historymixin') : undefined; - this.history = this.context.history; + return null; + } } -}; + if (json) { + try { + return JSON.parse(json); + } catch (error) { + // Ignore invalid JSON. + } + } -exports['default'] = History; -module.exports = exports['default']; + return null; +} }).call(this,require('_process')) -},{"./PropTypes":12,"./routerWarning":34,"_process":1}],6:[function(require,module,exports){ +},{"_process":23,"warning":232}],9:[function(require,module,exports){ 'use strict'; exports.__esModule = true; +exports.addEventListener = addEventListener; +exports.removeEventListener = removeEventListener; +exports.getHashPath = getHashPath; +exports.replaceHashPath = replaceHashPath; +exports.getWindowPath = getWindowPath; +exports.go = go; +exports.getUserConfirmation = getUserConfirmation; +exports.supportsHistory = supportsHistory; +exports.supportsGoWithoutReloadUsingHash = supportsGoWithoutReloadUsingHash; -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 addEventListener(node, event, listener) { + if (node.addEventListener) { + node.addEventListener(event, listener, false); + } else { + node.attachEvent('on' + event, listener); + } +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +function removeEventListener(node, event, listener) { + if (node.removeEventListener) { + node.removeEventListener(event, listener, false); + } else { + node.detachEvent('on' + event, listener); + } +} -var _react = require('react'); +function getHashPath() { + // We can't use window.location.hash here because it's not + // consistent across browsers - Firefox will pre-decode it! + return window.location.href.split('#')[1] || ''; +} -var _react2 = _interopRequireDefault(_react); +function replaceHashPath(path) { + window.location.replace(window.location.pathname + window.location.search + '#' + path); +} -var _Link = require('./Link'); +function getWindowPath() { + return window.location.pathname + window.location.search + window.location.hash; +} -var _Link2 = _interopRequireDefault(_Link); +function go(n) { + if (n) window.history.go(n); +} + +function getUserConfirmation(message, callback) { + callback(window.confirm(message)); +} /** - * An is used to link to an . + * Returns true if the HTML5 history API is supported. Taken from Modernizr. + * + * https://github.com/Modernizr/Modernizr/blob/master/LICENSE + * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js + * changed to avoid false negatives for Windows Phones: https://github.com/rackt/react-router/issues/586 */ -var IndexLink = _react2['default'].createClass({ - displayName: 'IndexLink', - render: function render() { - return _react2['default'].createElement(_Link2['default'], _extends({}, this.props, { onlyActiveOnIndex: true })); +function supportsHistory() { + var ua = navigator.userAgent; + if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) { + return false; } + return window.history && 'pushState' in window.history; +} -}); +/** + * Returns false if using go(n) with hash history causes a full page reload. + */ -exports['default'] = IndexLink; -module.exports = exports['default']; -},{"./Link":10,"react":"react"}],7:[function(require,module,exports){ +function supportsGoWithoutReloadUsingHash() { + var ua = navigator.userAgent; + return ua.indexOf('Firefox') === -1; +} +},{}],10:[function(require,module,exports){ +'use strict'; + +exports.__esModule = true; +var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); +exports.canUseDOM = canUseDOM; +},{}],11:[function(require,module,exports){ (function (process){ 'use strict'; exports.__esModule = true; +exports.extractPath = extractPath; +exports.parsePath = parsePath; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _routerWarning = require('./routerWarning'); - -var _routerWarning2 = _interopRequireDefault(_routerWarning); - -var _invariant = require('invariant'); - -var _invariant2 = _interopRequireDefault(_invariant); - -var _Redirect = require('./Redirect'); - -var _Redirect2 = _interopRequireDefault(_Redirect); +var _warning = require('warning'); -var _PropTypes = require('./PropTypes'); +var _warning2 = _interopRequireDefault(_warning); -var _React$PropTypes = _react2['default'].PropTypes; -var string = _React$PropTypes.string; -var object = _React$PropTypes.object; +function extractPath(string) { + var match = string.match(/^https?:\/\/[^\/]*/); -/** - * An is used to redirect from an indexRoute. - */ -var IndexRedirect = _react2['default'].createClass({ - displayName: 'IndexRedirect', + if (match == null) return string; - statics: { + return string.substring(match[0].length); +} - createRouteFromReactElement: function createRouteFromReactElement(element, parentRoute) { - /* istanbul ignore else: sanity check */ - if (parentRoute) { - parentRoute.indexRoute = _Redirect2['default'].createRouteFromReactElement(element); - } else { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'An does not make sense at the root of your route config') : undefined; - } - } +function parsePath(path) { + var pathname = extractPath(path); + var search = ''; + var hash = ''; - }, + process.env.NODE_ENV !== 'production' ? _warning2['default'](path === pathname, 'A path must be pathname + search + hash only, not a fully qualified URL like "%s"', path) : undefined; - propTypes: { - to: string.isRequired, - query: object, - state: object, - onEnter: _PropTypes.falsy, - children: _PropTypes.falsy - }, + var hashIndex = pathname.indexOf('#'); + if (hashIndex !== -1) { + hash = pathname.substring(hashIndex); + pathname = pathname.substring(0, hashIndex); + } - /* istanbul ignore next: sanity check */ - render: function render() { - !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, ' elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined; + var searchIndex = pathname.indexOf('?'); + if (searchIndex !== -1) { + search = pathname.substring(searchIndex); + pathname = pathname.substring(0, searchIndex); } -}); + if (pathname === '') pathname = '/'; -exports['default'] = IndexRedirect; -module.exports = exports['default']; + return { + pathname: pathname, + search: search, + hash: hash + }; +} }).call(this,require('_process')) -},{"./PropTypes":12,"./Redirect":13,"./routerWarning":34,"_process":1,"invariant":58,"react":"react"}],8:[function(require,module,exports){ +},{"_process":23,"warning":232}],12:[function(require,module,exports){ (function (process){ 'use strict'; exports.__esModule = 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; }; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _react = require('react'); +var _invariant = require('invariant'); -var _react2 = _interopRequireDefault(_react); +var _invariant2 = _interopRequireDefault(_invariant); -var _routerWarning = require('./routerWarning'); +var _Actions = require('./Actions'); -var _routerWarning2 = _interopRequireDefault(_routerWarning); +var _PathUtils = require('./PathUtils'); -var _invariant = require('invariant'); +var _ExecutionEnvironment = require('./ExecutionEnvironment'); -var _invariant2 = _interopRequireDefault(_invariant); +var _DOMUtils = require('./DOMUtils'); -var _RouteUtils = require('./RouteUtils'); +var _DOMStateStorage = require('./DOMStateStorage'); -var _PropTypes = require('./PropTypes'); +var _createDOMHistory = require('./createDOMHistory'); -var func = _react2['default'].PropTypes.func; +var _createDOMHistory2 = _interopRequireDefault(_createDOMHistory); /** - * An is used to specify its parent's in - * a JSX route config. + * Creates and returns a history object that uses HTML5's history API + * (pushState, replaceState, and the popstate event) to manage history. + * This is the recommended method of managing history in browsers because + * it provides the cleanest URLs. + * + * Note: In browsers that do not support the HTML5 history API full + * page reloads will be used to preserve URLs. */ -var IndexRoute = _react2['default'].createClass({ - displayName: 'IndexRoute', +function createBrowserHistory() { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - statics: { + !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined; - createRouteFromReactElement: function createRouteFromReactElement(element, parentRoute) { - /* istanbul ignore else: sanity check */ - if (parentRoute) { - parentRoute.indexRoute = _RouteUtils.createRouteFromReactElement(element); - } else { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'An does not make sense at the root of your route config') : undefined; - } - } + var forceRefresh = options.forceRefresh; - }, + var isSupported = _DOMUtils.supportsHistory(); + var useRefresh = !isSupported || forceRefresh; - propTypes: { - path: _PropTypes.falsy, - component: _PropTypes.component, - components: _PropTypes.components, - getComponent: func, - getComponents: func - }, + function getCurrentLocation(historyState) { + historyState = historyState || window.history.state || {}; - /* istanbul ignore next: sanity check */ - render: function render() { - !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, ' elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined; + var path = _DOMUtils.getWindowPath(); + var _historyState = historyState; + var key = _historyState.key; + + var state = undefined; + if (key) { + state = _DOMStateStorage.readState(key); + } else { + state = null; + key = history.createKey(); + + if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path); + } + + var location = _PathUtils.parsePath(path); + + return history.createLocation(_extends({}, location, { state: state }), undefined, key); } -}); + function startPopStateListener(_ref) { + var transitionTo = _ref.transitionTo; -exports['default'] = IndexRoute; -module.exports = exports['default']; -}).call(this,require('_process')) + function popStateListener(event) { + if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit. -},{"./PropTypes":12,"./RouteUtils":16,"./routerWarning":34,"_process":1,"invariant":58,"react":"react"}],9:[function(require,module,exports){ -(function (process){ -'use strict'; + transitionTo(getCurrentLocation(event.state)); + } -exports.__esModule = true; + _DOMUtils.addEventListener(window, 'popstate', popStateListener); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + return function () { + _DOMUtils.removeEventListener(window, 'popstate', popStateListener); + }; + } -var _routerWarning = require('./routerWarning'); + function finishTransition(location) { + var basename = location.basename; + var pathname = location.pathname; + var search = location.search; + var hash = location.hash; + var state = location.state; + var action = location.action; + var key = location.key; -var _routerWarning2 = _interopRequireDefault(_routerWarning); + if (action === _Actions.POP) return; // Nothing to do. -var _react = require('react'); + _DOMStateStorage.saveState(key, state); -var _react2 = _interopRequireDefault(_react); + var path = (basename || '') + pathname + search + hash; + var historyState = { + key: key + }; -var _invariant = require('invariant'); + if (action === _Actions.PUSH) { + if (useRefresh) { + window.location.href = path; + return false; // Prevent location update. + } else { + window.history.pushState(historyState, null, path); + } + } else { + // REPLACE + if (useRefresh) { + window.location.replace(path); + return false; // Prevent location update. + } else { + window.history.replaceState(historyState, null, path); + } + } + } -var _invariant2 = _interopRequireDefault(_invariant); + var history = _createDOMHistory2['default'](_extends({}, options, { + getCurrentLocation: getCurrentLocation, + finishTransition: finishTransition, + saveState: _DOMStateStorage.saveState + })); -var object = _react2['default'].PropTypes.object; + var listenerCount = 0, + stopPopStateListener = undefined; -/** - * The Lifecycle mixin adds the routerWillLeave lifecycle method to a - * component that may be used to cancel a transition or prompt the user - * for confirmation. - * - * On standard transitions, routerWillLeave receives a single argument: the - * location we're transitioning to. To cancel the transition, return false. - * To prompt the user for confirmation, return a prompt message (string). - * - * During the beforeunload event (assuming you're using the useBeforeUnload - * history enhancer), routerWillLeave does not receive a location object - * because it isn't possible for us to know the location we're transitioning - * to. In this case routerWillLeave must return a prompt message to prevent - * the user from closing the window/tab. - */ -var Lifecycle = { + function listenBefore(listener) { + if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history); - contextTypes: { - history: object.isRequired, - // Nested children receive the route as context, either - // set by the route component using the RouteContext mixin - // or by some other ancestor. - route: object - }, + var unlisten = history.listenBefore(listener); - propTypes: { - // Route components receive the route object as a prop. - route: object - }, + return function () { + unlisten(); - componentDidMount: function componentDidMount() { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'the `Lifecycle` mixin is deprecated, please use `context.router.setRouteLeaveHook(route, hook)`. http://tiny.cc/router-lifecyclemixin') : undefined; - !this.routerWillLeave ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'The Lifecycle mixin requires you to define a routerWillLeave method') : _invariant2['default'](false) : undefined; + if (--listenerCount === 0) stopPopStateListener(); + }; + } - var route = this.props.route || this.context.route; + function listen(listener) { + if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history); - !route ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'The Lifecycle mixin must be used on either a) a or ' + 'b) a descendant of a that uses the RouteContext mixin') : _invariant2['default'](false) : undefined; + var unlisten = history.listen(listener); - this._unlistenBeforeLeavingRoute = this.context.history.listenBeforeLeavingRoute(route, this.routerWillLeave); - }, + return function () { + unlisten(); - componentWillUnmount: function componentWillUnmount() { - if (this._unlistenBeforeLeavingRoute) this._unlistenBeforeLeavingRoute(); + if (--listenerCount === 0) stopPopStateListener(); + }; } -}; + // deprecated + function registerTransitionHook(hook) { + if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history); -exports['default'] = Lifecycle; + history.registerTransitionHook(hook); + } + + // deprecated + function unregisterTransitionHook(hook) { + history.unregisterTransitionHook(hook); + + if (--listenerCount === 0) stopPopStateListener(); + } + + return _extends({}, history, { + listenBefore: listenBefore, + listen: listen, + registerTransitionHook: registerTransitionHook, + unregisterTransitionHook: unregisterTransitionHook + }); +} + +exports['default'] = createBrowserHistory; module.exports = exports['default']; }).call(this,require('_process')) -},{"./routerWarning":34,"_process":1,"invariant":58,"react":"react"}],10:[function(require,module,exports){ +},{"./Actions":6,"./DOMStateStorage":8,"./DOMUtils":9,"./ExecutionEnvironment":10,"./PathUtils":11,"./createDOMHistory":13,"_process":23,"invariant":22}],13:[function(require,module,exports){ (function (process){ 'use strict'; @@ -751,667 +874,638 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -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 _react2 = _interopRequireDefault(_react); +var _invariant = require('invariant'); -var _routerWarning = require('./routerWarning'); +var _invariant2 = _interopRequireDefault(_invariant); -var _routerWarning2 = _interopRequireDefault(_routerWarning); +var _ExecutionEnvironment = require('./ExecutionEnvironment'); -var _React$PropTypes = _react2['default'].PropTypes; -var bool = _React$PropTypes.bool; -var object = _React$PropTypes.object; -var string = _React$PropTypes.string; -var func = _React$PropTypes.func; -var oneOfType = _React$PropTypes.oneOfType; +var _DOMUtils = require('./DOMUtils'); -function isLeftClickEvent(event) { - return event.button === 0; -} +var _createHistory = require('./createHistory'); -function isModifiedEvent(event) { - return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); -} +var _createHistory2 = _interopRequireDefault(_createHistory); -function isEmptyObject(object) { - for (var p in object) { - if (object.hasOwnProperty(p)) return false; - }return true; -} +function createDOMHistory(options) { + var history = _createHistory2['default'](_extends({ + getUserConfirmation: _DOMUtils.getUserConfirmation + }, options, { + go: _DOMUtils.go + })); -function createLocationDescriptor(to, _ref) { - var query = _ref.query; - var hash = _ref.hash; - var state = _ref.state; + function listen(listener) { + !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'DOM history needs a DOM') : _invariant2['default'](false) : undefined; - if (query || hash || state) { - return { pathname: to, query: query, hash: hash, state: state }; + return history.listen(listener); } - return to; + return _extends({}, history, { + listen: listen + }); } -/** - * A is used to create an element that links to a route. - * When that route is active, the link gets the value of its - * activeClassName prop. - * - * For example, assuming you have the following route: - * - * - * - * You could use the following component to link to that route: - * - * - * - * Links may pass along location state and/or query string parameters - * in the state/query props, respectively. - * - * - */ -var Link = _react2['default'].createClass({ - displayName: 'Link', +exports['default'] = createDOMHistory; +module.exports = exports['default']; +}).call(this,require('_process')) - contextTypes: { - router: object - }, +},{"./DOMUtils":9,"./ExecutionEnvironment":10,"./createHistory":15,"_process":23,"invariant":22}],14:[function(require,module,exports){ +(function (process){ +'use strict'; - propTypes: { - to: oneOfType([string, object]).isRequired, - query: object, - hash: string, - state: object, - activeStyle: object, - activeClassName: string, - onlyActiveOnIndex: bool.isRequired, - onClick: func - }, +exports.__esModule = true; - getDefaultProps: function getDefaultProps() { - return { - onlyActiveOnIndex: false, - className: '', - style: {} - }; - }, +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; }; - handleClick: function handleClick(event) { - var allowTransition = true; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - if (this.props.onClick) this.props.onClick(event); +var _warning = require('warning'); - if (isModifiedEvent(event) || !isLeftClickEvent(event)) return; +var _warning2 = _interopRequireDefault(_warning); - if (event.defaultPrevented === true) allowTransition = false; +var _invariant = require('invariant'); - // If target prop is set (e.g. to "_blank") let browser handle link. - /* istanbul ignore if: untestable with Karma */ - if (this.props.target) { - if (!allowTransition) event.preventDefault(); +var _invariant2 = _interopRequireDefault(_invariant); - return; - } +var _Actions = require('./Actions'); - event.preventDefault(); +var _PathUtils = require('./PathUtils'); - if (allowTransition) { - var _props = this.props; - var to = _props.to; - var query = _props.query; - var hash = _props.hash; - var state = _props.state; +var _ExecutionEnvironment = require('./ExecutionEnvironment'); - var _location = createLocationDescriptor(to, { query: query, hash: hash, state: state }); +var _DOMUtils = require('./DOMUtils'); - this.context.router.push(_location); - } - }, +var _DOMStateStorage = require('./DOMStateStorage'); - render: function render() { - var _props2 = this.props; - var to = _props2.to; - var query = _props2.query; - var hash = _props2.hash; - var state = _props2.state; - var activeClassName = _props2.activeClassName; - var activeStyle = _props2.activeStyle; - var onlyActiveOnIndex = _props2.onlyActiveOnIndex; +var _createDOMHistory = require('./createDOMHistory'); - var props = _objectWithoutProperties(_props2, ['to', 'query', 'hash', 'state', 'activeClassName', 'activeStyle', 'onlyActiveOnIndex']); +var _createDOMHistory2 = _interopRequireDefault(_createDOMHistory); - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](!(query || hash || state), 'the `query`, `hash`, and `state` props on `` are deprecated, use `. http://tiny.cc/router-isActivedeprecated') : undefined; +function isAbsolutePath(path) { + return typeof path === 'string' && path.charAt(0) === '/'; +} - // Ignore if rendered outside the context of router, simplifies unit testing. - var router = this.context.router; +function ensureSlash() { + var path = _DOMUtils.getHashPath(); - if (router) { - var _location2 = createLocationDescriptor(to, { query: query, hash: hash, state: state }); - props.href = router.createHref(_location2); + if (isAbsolutePath(path)) return true; - if (activeClassName || activeStyle != null && !isEmptyObject(activeStyle)) { - if (router.isActive(_location2, onlyActiveOnIndex)) { - if (activeClassName) props.className += props.className === '' ? activeClassName : ' ' + activeClassName; + _DOMUtils.replaceHashPath('/' + path); - if (activeStyle) props.style = _extends({}, props.style, activeStyle); - } - } - } + return false; +} - return _react2['default'].createElement('a', _extends({}, props, { onClick: this.handleClick })); - } +function addQueryStringValueToPath(path, key, value) { + return path + (path.indexOf('?') === -1 ? '?' : '&') + (key + '=' + value); +} -}); +function stripQueryStringValueFromPath(path, key) { + return path.replace(new RegExp('[?&]?' + key + '=[a-zA-Z0-9]+'), ''); +} -exports['default'] = Link; -module.exports = exports['default']; -}).call(this,require('_process')) +function getQueryStringValueFromPath(path, key) { + var match = path.match(new RegExp('\\?.*?\\b' + key + '=(.+?)\\b')); + return match && match[1]; +} -},{"./routerWarning":34,"_process":1,"react":"react"}],11:[function(require,module,exports){ -(function (process){ -'use strict'; +var DefaultQueryKey = '_k'; -exports.__esModule = true; -exports.compilePattern = compilePattern; -exports.matchPattern = matchPattern; -exports.getParamNames = getParamNames; -exports.getParams = getParams; -exports.formatPattern = formatPattern; +function createHashHistory() { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Hash history needs a DOM') : _invariant2['default'](false) : undefined; -var _invariant = require('invariant'); + var queryKey = options.queryKey; -var _invariant2 = _interopRequireDefault(_invariant); + if (queryKey === undefined || !!queryKey) queryKey = typeof queryKey === 'string' ? queryKey : DefaultQueryKey; -function escapeRegExp(string) { - return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); -} + function getCurrentLocation() { + var path = _DOMUtils.getHashPath(); -function escapeSource(string) { - return escapeRegExp(string).replace(/\/+/g, '/+'); -} + var key = undefined, + state = undefined; + if (queryKey) { + key = getQueryStringValueFromPath(path, queryKey); + path = stripQueryStringValueFromPath(path, queryKey); -function _compilePattern(pattern) { - var regexpSource = ''; - var paramNames = []; - var tokens = []; - - var match = undefined, - lastIndex = 0, - matcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*\*|\*|\(|\)/g; - while (match = matcher.exec(pattern)) { - if (match.index !== lastIndex) { - tokens.push(pattern.slice(lastIndex, match.index)); - regexpSource += escapeSource(pattern.slice(lastIndex, match.index)); - } - - if (match[1]) { - regexpSource += '([^/?#]+)'; - paramNames.push(match[1]); - } else if (match[0] === '**') { - regexpSource += '([\\s\\S]*)'; - paramNames.push('splat'); - } else if (match[0] === '*') { - regexpSource += '([\\s\\S]*?)'; - paramNames.push('splat'); - } else if (match[0] === '(') { - regexpSource += '(?:'; - } else if (match[0] === ')') { - regexpSource += ')?'; + if (key) { + state = _DOMStateStorage.readState(key); + } else { + state = null; + key = history.createKey(); + _DOMUtils.replaceHashPath(addQueryStringValueToPath(path, queryKey, key)); + } + } else { + key = state = null; } - tokens.push(match[0]); + var location = _PathUtils.parsePath(path); - lastIndex = matcher.lastIndex; + return history.createLocation(_extends({}, location, { state: state }), undefined, key); } - if (lastIndex !== pattern.length) { - tokens.push(pattern.slice(lastIndex, pattern.length)); - regexpSource += escapeSource(pattern.slice(lastIndex, pattern.length)); + function startHashChangeListener(_ref) { + var transitionTo = _ref.transitionTo; + + function hashChangeListener() { + if (!ensureSlash()) return; // Always make sure hashes are preceeded with a /. + + transitionTo(getCurrentLocation()); + } + + ensureSlash(); + _DOMUtils.addEventListener(window, 'hashchange', hashChangeListener); + + return function () { + _DOMUtils.removeEventListener(window, 'hashchange', hashChangeListener); + }; } - return { - pattern: pattern, - regexpSource: regexpSource, - paramNames: paramNames, - tokens: tokens - }; -} + function finishTransition(location) { + var basename = location.basename; + var pathname = location.pathname; + var search = location.search; + var state = location.state; + var action = location.action; + var key = location.key; -var CompiledPatternsCache = {}; + if (action === _Actions.POP) return; // Nothing to do. -function compilePattern(pattern) { - if (!(pattern in CompiledPatternsCache)) CompiledPatternsCache[pattern] = _compilePattern(pattern); + var path = (basename || '') + pathname + search; - return CompiledPatternsCache[pattern]; -} + if (queryKey) { + path = addQueryStringValueToPath(path, queryKey, key); + _DOMStateStorage.saveState(key, state); + } else { + // Drop key and state. + location.key = location.state = null; + } -/** - * Attempts to match a pattern on the given pathname. Patterns may use - * the following special characters: - * - * - :paramName Matches a URL segment up to the next /, ?, or #. The - * captured string is considered a "param" - * - () Wraps a segment of the URL that is optional - * - * Consumes (non-greedy) all characters up to the next - * character in the pattern, or to the end of the URL if - * there is none - * - ** Consumes (greedy) all characters up to the next character - * in the pattern, or to the end of the URL if there is none - * - * The return value is an object with the following properties: - * - * - remainingPathname - * - paramNames - * - paramValues - */ + var currentHash = _DOMUtils.getHashPath(); -function matchPattern(pattern, pathname) { - // Make leading slashes consistent between pattern and pathname. - if (pattern.charAt(0) !== '/') { - pattern = '/' + pattern; - } - if (pathname.charAt(0) !== '/') { - pathname = '/' + pathname; + if (action === _Actions.PUSH) { + if (currentHash !== path) { + window.location.hash = path; + } else { + process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'You cannot PUSH the same path using hash history') : undefined; + } + } else if (currentHash !== path) { + // REPLACE + _DOMUtils.replaceHashPath(path); + } } - var _compilePattern2 = compilePattern(pattern); + var history = _createDOMHistory2['default'](_extends({}, options, { + getCurrentLocation: getCurrentLocation, + finishTransition: finishTransition, + saveState: _DOMStateStorage.saveState + })); - var regexpSource = _compilePattern2.regexpSource; - var paramNames = _compilePattern2.paramNames; - var tokens = _compilePattern2.tokens; + var listenerCount = 0, + stopHashChangeListener = undefined; - regexpSource += '/*'; // Capture path separators + function listenBefore(listener) { + if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history); - // Special-case patterns like '*' for catch-all routes. - var captureRemaining = tokens[tokens.length - 1] !== '*'; + var unlisten = history.listenBefore(listener); - if (captureRemaining) { - // This will match newlines in the remaining path. - regexpSource += '([\\s\\S]*?)'; + return function () { + unlisten(); + + if (--listenerCount === 0) stopHashChangeListener(); + }; } - var match = pathname.match(new RegExp('^' + regexpSource + '$', 'i')); + function listen(listener) { + if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history); - var remainingPathname = undefined, - paramValues = undefined; - if (match != null) { - if (captureRemaining) { - remainingPathname = match.pop(); - var matchedPath = match[0].substr(0, match[0].length - remainingPathname.length); + var unlisten = history.listen(listener); - // If we didn't match the entire pathname, then make sure that the match - // we did get ends at a path separator (potentially the one we added - // above at the beginning of the path, if the actual match was empty). - if (remainingPathname && matchedPath.charAt(matchedPath.length - 1) !== '/') { - return { - remainingPathname: null, - paramNames: paramNames, - paramValues: null - }; - } - } else { - // If this matched at all, then the match was the entire pathname. - remainingPathname = ''; - } + return function () { + unlisten(); - paramValues = match.slice(1).map(function (v) { - return v != null ? decodeURIComponent(v) : v; - }); - } else { - remainingPathname = paramValues = null; + if (--listenerCount === 0) stopHashChangeListener(); + }; } - return { - remainingPathname: remainingPathname, - paramNames: paramNames, - paramValues: paramValues - }; -} - -function getParamNames(pattern) { - return compilePattern(pattern).paramNames; -} + function push(location) { + process.env.NODE_ENV !== 'production' ? _warning2['default'](queryKey || location.state == null, 'You cannot use state without a queryKey it will be dropped') : undefined; -function getParams(pattern, pathname) { - var _matchPattern = matchPattern(pattern, pathname); + history.push(location); + } - var paramNames = _matchPattern.paramNames; - var paramValues = _matchPattern.paramValues; + function replace(location) { + process.env.NODE_ENV !== 'production' ? _warning2['default'](queryKey || location.state == null, 'You cannot use state without a queryKey it will be dropped') : undefined; - if (paramValues != null) { - return paramNames.reduce(function (memo, paramName, index) { - memo[paramName] = paramValues[index]; - return memo; - }, {}); + history.replace(location); } - return null; -} + var goIsSupportedWithoutReload = _DOMUtils.supportsGoWithoutReloadUsingHash(); -/** - * Returns a version of the given pattern with params interpolated. Throws - * if there is a dynamic segment of the pattern for which there is no param. - */ + function go(n) { + process.env.NODE_ENV !== 'production' ? _warning2['default'](goIsSupportedWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : undefined; -function formatPattern(pattern, params) { - params = params || {}; + history.go(n); + } - var _compilePattern3 = compilePattern(pattern); + function createHref(path) { + return '#' + history.createHref(path); + } - var tokens = _compilePattern3.tokens; + // deprecated + function registerTransitionHook(hook) { + if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history); - var parenCount = 0, - pathname = '', - splatIndex = 0; + history.registerTransitionHook(hook); + } - var token = undefined, - paramName = undefined, - paramValue = undefined; - for (var i = 0, len = tokens.length; i < len; ++i) { - token = tokens[i]; + // deprecated + function unregisterTransitionHook(hook) { + history.unregisterTransitionHook(hook); - if (token === '*' || token === '**') { - paramValue = Array.isArray(params.splat) ? params.splat[splatIndex++] : params.splat; + if (--listenerCount === 0) stopHashChangeListener(); + } - !(paramValue != null || parenCount > 0) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Missing splat #%s for path "%s"', splatIndex, pattern) : _invariant2['default'](false) : undefined; + // deprecated + function pushState(state, path) { + process.env.NODE_ENV !== 'production' ? _warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped') : undefined; - if (paramValue != null) pathname += encodeURI(paramValue); - } else if (token === '(') { - parenCount += 1; - } else if (token === ')') { - parenCount -= 1; - } else if (token.charAt(0) === ':') { - paramName = token.substring(1); - paramValue = params[paramName]; + history.pushState(state, path); + } - !(paramValue != null || parenCount > 0) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Missing "%s" parameter for path "%s"', paramName, pattern) : _invariant2['default'](false) : undefined; + // deprecated + function replaceState(state, path) { + process.env.NODE_ENV !== 'production' ? _warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped') : undefined; - if (paramValue != null) pathname += encodeURIComponent(paramValue); - } else { - pathname += token; - } + history.replaceState(state, path); } - return pathname.replace(/\/+/g, '/'); + return _extends({}, history, { + listenBefore: listenBefore, + listen: listen, + push: push, + replace: replace, + go: go, + createHref: createHref, + + registerTransitionHook: registerTransitionHook, // deprecated - warning is in createHistory + unregisterTransitionHook: unregisterTransitionHook, // deprecated - warning is in createHistory + pushState: pushState, // deprecated - warning is in createHistory + replaceState: replaceState // deprecated - warning is in createHistory + }); } + +exports['default'] = createHashHistory; +module.exports = exports['default']; }).call(this,require('_process')) -},{"_process":1,"invariant":58}],12:[function(require,module,exports){ +},{"./Actions":6,"./DOMStateStorage":8,"./DOMUtils":9,"./ExecutionEnvironment":10,"./PathUtils":11,"./createDOMHistory":13,"_process":23,"invariant":22,"warning":232}],15:[function(require,module,exports){ +(function (process){ 'use strict'; exports.__esModule = true; -exports.falsy = falsy; -var _react = require('react'); +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 func = _react.PropTypes.func; -var object = _react.PropTypes.object; -var arrayOf = _react.PropTypes.arrayOf; -var oneOfType = _react.PropTypes.oneOfType; -var element = _react.PropTypes.element; -var shape = _react.PropTypes.shape; -var string = _react.PropTypes.string; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -function falsy(props, propName, componentName) { - if (props[propName]) return new Error('<' + componentName + '> should not have a "' + propName + '" prop'); -} +var _warning = require('warning'); -var history = shape({ - listen: func.isRequired, - pushState: func.isRequired, - replaceState: func.isRequired, - go: func.isRequired -}); +var _warning2 = _interopRequireDefault(_warning); -exports.history = history; -var location = shape({ - pathname: string.isRequired, - search: string.isRequired, - state: object, - action: string.isRequired, - key: string -}); +var _deepEqual = require('deep-equal'); -exports.location = location; -var component = oneOfType([func, string]); -exports.component = component; -var components = oneOfType([component, object]); -exports.components = components; -var route = oneOfType([object, element]); -exports.route = route; -var routes = oneOfType([route, arrayOf(route)]); +var _deepEqual2 = _interopRequireDefault(_deepEqual); -exports.routes = routes; -exports['default'] = { - falsy: falsy, - history: history, - location: location, - component: component, - components: components, - route: route -}; -},{"react":"react"}],13:[function(require,module,exports){ -(function (process){ -'use strict'; +var _PathUtils = require('./PathUtils'); -exports.__esModule = true; +var _AsyncUtils = require('./AsyncUtils'); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +var _Actions = require('./Actions'); -var _react = require('react'); +var _createLocation2 = require('./createLocation'); -var _react2 = _interopRequireDefault(_react); +var _createLocation3 = _interopRequireDefault(_createLocation2); -var _invariant = require('invariant'); +var _runTransitionHook = require('./runTransitionHook'); -var _invariant2 = _interopRequireDefault(_invariant); +var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook); -var _RouteUtils = require('./RouteUtils'); +var _deprecate = require('./deprecate'); -var _PatternUtils = require('./PatternUtils'); +var _deprecate2 = _interopRequireDefault(_deprecate); -var _PropTypes = require('./PropTypes'); +function createRandomKey(length) { + return Math.random().toString(36).substr(2, length); +} -var _React$PropTypes = _react2['default'].PropTypes; -var string = _React$PropTypes.string; -var object = _React$PropTypes.object; +function locationsAreEqual(a, b) { + return a.pathname === b.pathname && a.search === b.search && + //a.action === b.action && // Different action !== location change. + a.key === b.key && _deepEqual2['default'](a.state, b.state); +} -/** - * A is used to declare another URL path a client should - * be sent to when they request a given URL. - * - * Redirects are placed alongside routes in the route configuration - * and are traversed in the same manner. - */ -var Redirect = _react2['default'].createClass({ - displayName: 'Redirect', +var DefaultKeyLength = 6; - statics: { +function createHistory() { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + var getCurrentLocation = options.getCurrentLocation; + var finishTransition = options.finishTransition; + var saveState = options.saveState; + var go = options.go; + var keyLength = options.keyLength; + var getUserConfirmation = options.getUserConfirmation; - createRouteFromReactElement: function createRouteFromReactElement(element) { - var route = _RouteUtils.createRouteFromReactElement(element); + if (typeof keyLength !== 'number') keyLength = DefaultKeyLength; - if (route.from) route.path = route.from; + var transitionHooks = []; - route.onEnter = function (nextState, replace) { - var location = nextState.location; - var params = nextState.params; + function listenBefore(hook) { + transitionHooks.push(hook); - var pathname = undefined; - if (route.to.charAt(0) === '/') { - pathname = _PatternUtils.formatPattern(route.to, params); - } else if (!route.to) { - pathname = location.pathname; - } else { - var routeIndex = nextState.routes.indexOf(route); - var parentPattern = Redirect.getRoutePattern(nextState.routes, routeIndex - 1); - var pattern = parentPattern.replace(/\/*$/, '/') + route.to; - pathname = _PatternUtils.formatPattern(pattern, params); - } + return function () { + transitionHooks = transitionHooks.filter(function (item) { + return item !== hook; + }); + }; + } - replace({ - pathname: pathname, - query: route.query || location.query, - state: route.state || location.state - }); - }; + var allKeys = []; + var changeListeners = []; + var location = undefined; - return route; - }, + function getCurrent() { + if (pendingLocation && pendingLocation.action === _Actions.POP) { + return allKeys.indexOf(pendingLocation.key); + } else if (location) { + return allKeys.indexOf(location.key); + } else { + return -1; + } + } - getRoutePattern: function getRoutePattern(routes, routeIndex) { - var parentPattern = ''; + function updateLocation(newLocation) { + var current = getCurrent(); - for (var i = routeIndex; i >= 0; i--) { - var route = routes[i]; - var pattern = route.path || ''; + location = newLocation; - parentPattern = pattern.replace(/\/*$/, '/') + parentPattern; + if (location.action === _Actions.PUSH) { + allKeys = [].concat(allKeys.slice(0, current + 1), [location.key]); + } else if (location.action === _Actions.REPLACE) { + allKeys[current] = location.key; + } - if (pattern.indexOf('/') === 0) break; - } + changeListeners.forEach(function (listener) { + listener(location); + }); + } - return '/' + parentPattern; - } + function listen(listener) { + changeListeners.push(listener); - }, + if (location) { + listener(location); + } else { + var _location = getCurrentLocation(); + allKeys = [_location.key]; + updateLocation(_location); + } - propTypes: { - path: string, - from: string, // Alias for path - to: string.isRequired, - query: object, - state: object, - onEnter: _PropTypes.falsy, - children: _PropTypes.falsy - }, + return function () { + changeListeners = changeListeners.filter(function (item) { + return item !== listener; + }); + }; + } - /* istanbul ignore next: sanity check */ - render: function render() { - !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, ' elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined; + function confirmTransitionTo(location, callback) { + _AsyncUtils.loopAsync(transitionHooks.length, function (index, next, done) { + _runTransitionHook2['default'](transitionHooks[index], location, function (result) { + if (result != null) { + done(result); + } else { + next(); + } + }); + }, function (message) { + if (getUserConfirmation && typeof message === 'string') { + getUserConfirmation(message, function (ok) { + callback(ok !== false); + }); + } else { + callback(message !== false); + } + }); } -}); + var pendingLocation = undefined; -exports['default'] = Redirect; -module.exports = exports['default']; -}).call(this,require('_process')) + function transitionTo(nextLocation) { + if (location && locationsAreEqual(location, nextLocation)) return; // Nothing to do. -},{"./PatternUtils":11,"./PropTypes":12,"./RouteUtils":16,"_process":1,"invariant":58,"react":"react"}],14:[function(require,module,exports){ -(function (process){ -'use strict'; + pendingLocation = nextLocation; -exports.__esModule = true; + confirmTransitionTo(nextLocation, function (ok) { + if (pendingLocation !== nextLocation) return; // Transition was interrupted. -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + if (ok) { + // treat PUSH to current path like REPLACE to be consistent with browsers + if (nextLocation.action === _Actions.PUSH) { + var prevPath = createPath(location); + var nextPath = createPath(nextLocation); -var _react = require('react'); + if (nextPath === prevPath && _deepEqual2['default'](location.state, nextLocation.state)) nextLocation.action = _Actions.REPLACE; + } -var _react2 = _interopRequireDefault(_react); + if (finishTransition(nextLocation) !== false) updateLocation(nextLocation); + } else if (location && nextLocation.action === _Actions.POP) { + var prevIndex = allKeys.indexOf(location.key); + var nextIndex = allKeys.indexOf(nextLocation.key); -var _invariant = require('invariant'); + if (prevIndex !== -1 && nextIndex !== -1) go(prevIndex - nextIndex); // Restore the URL. + } + }); + } -var _invariant2 = _interopRequireDefault(_invariant); + function push(location) { + transitionTo(createLocation(location, _Actions.PUSH, createKey())); + } -var _RouteUtils = require('./RouteUtils'); + function replace(location) { + transitionTo(createLocation(location, _Actions.REPLACE, createKey())); + } -var _PropTypes = require('./PropTypes'); + function goBack() { + go(-1); + } -var _React$PropTypes = _react2['default'].PropTypes; -var string = _React$PropTypes.string; -var func = _React$PropTypes.func; + function goForward() { + go(1); + } -/** - * A is used to declare which components are rendered to the - * page when the URL matches a given pattern. - * - * Routes are arranged in a nested tree structure. When a new URL is - * requested, the tree is searched depth-first to find a route whose - * path matches the URL. When one is found, all routes in the tree - * that lead to it are considered "active" and their components are - * rendered into the DOM, nested in the same order as in the tree. - */ -var Route = _react2['default'].createClass({ - displayName: 'Route', + function createKey() { + return createRandomKey(keyLength); + } - statics: { - createRouteFromReactElement: _RouteUtils.createRouteFromReactElement - }, + function createPath(location) { + if (location == null || typeof location === 'string') return location; - propTypes: { - path: string, - component: _PropTypes.component, - components: _PropTypes.components, - getComponent: func, - getComponents: func - }, + var pathname = location.pathname; + var search = location.search; + var hash = location.hash; - /* istanbul ignore next: sanity check */ - render: function render() { - !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, ' elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined; + var result = pathname; + + if (search) result += search; + + if (hash) result += hash; + + return result; } -}); + function createHref(location) { + return createPath(location); + } -exports['default'] = Route; + function createLocation(location, action) { + var key = arguments.length <= 2 || arguments[2] === undefined ? createKey() : arguments[2]; + + if (typeof action === 'object') { + process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'The state (2nd) argument to history.createLocation is deprecated; use a ' + 'location descriptor instead') : undefined; + + if (typeof location === 'string') location = _PathUtils.parsePath(location); + + location = _extends({}, location, { state: action }); + + action = key; + key = arguments[3] || createKey(); + } + + return _createLocation3['default'](location, action, key); + } + + // deprecated + function setState(state) { + if (location) { + updateLocationState(location, state); + updateLocation(location); + } else { + updateLocationState(getCurrentLocation(), state); + } + } + + function updateLocationState(location, state) { + location.state = _extends({}, location.state, state); + saveState(location.key, location.state); + } + + // deprecated + function registerTransitionHook(hook) { + if (transitionHooks.indexOf(hook) === -1) transitionHooks.push(hook); + } + + // deprecated + function unregisterTransitionHook(hook) { + transitionHooks = transitionHooks.filter(function (item) { + return item !== hook; + }); + } + + // deprecated + function pushState(state, path) { + if (typeof path === 'string') path = _PathUtils.parsePath(path); + + push(_extends({ state: state }, path)); + } + + // deprecated + function replaceState(state, path) { + if (typeof path === 'string') path = _PathUtils.parsePath(path); + + replace(_extends({ state: state }, path)); + } + + return { + listenBefore: listenBefore, + listen: listen, + transitionTo: transitionTo, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + createKey: createKey, + createPath: createPath, + createHref: createHref, + createLocation: createLocation, + + setState: _deprecate2['default'](setState, 'setState is deprecated; use location.key to save state instead'), + registerTransitionHook: _deprecate2['default'](registerTransitionHook, 'registerTransitionHook is deprecated; use listenBefore instead'), + unregisterTransitionHook: _deprecate2['default'](unregisterTransitionHook, 'unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead'), + pushState: _deprecate2['default'](pushState, 'pushState is deprecated; use push instead'), + replaceState: _deprecate2['default'](replaceState, 'replaceState is deprecated; use replace instead') + }; +} + +exports['default'] = createHistory; module.exports = exports['default']; }).call(this,require('_process')) -},{"./PropTypes":12,"./RouteUtils":16,"_process":1,"invariant":58,"react":"react"}],15:[function(require,module,exports){ +},{"./Actions":6,"./AsyncUtils":7,"./PathUtils":11,"./createLocation":16,"./deprecate":18,"./runTransitionHook":19,"_process":23,"deep-equal":1,"warning":232}],16:[function(require,module,exports){ (function (process){ 'use strict'; exports.__esModule = 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; }; + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _routerWarning = require('./routerWarning'); +var _warning = require('warning'); -var _routerWarning2 = _interopRequireDefault(_routerWarning); +var _warning2 = _interopRequireDefault(_warning); -var _react = require('react'); +var _Actions = require('./Actions'); -var _react2 = _interopRequireDefault(_react); +var _PathUtils = require('./PathUtils'); -var object = _react2['default'].PropTypes.object; +function createLocation() { + var location = arguments.length <= 0 || arguments[0] === undefined ? '/' : arguments[0]; + var action = arguments.length <= 1 || arguments[1] === undefined ? _Actions.POP : arguments[1]; + var key = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; -/** - * The RouteContext mixin provides a convenient way for route - * components to set the route in context. This is needed for - * routes that render elements that want to use the Lifecycle - * mixin to prevent transitions. - */ -var RouteContext = { + var _fourthArg = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; - propTypes: { - route: object.isRequired - }, + if (typeof location === 'string') location = _PathUtils.parsePath(location); - childContextTypes: { - route: object.isRequired - }, + if (typeof action === 'object') { + process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'The state (2nd) argument to createLocation is deprecated; use a ' + 'location descriptor instead') : undefined; - getChildContext: function getChildContext() { - return { - route: this.props.route - }; - }, + location = _extends({}, location, { state: action }); - componentWillMount: function componentWillMount() { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'The `RouteContext` mixin is deprecated. You can provide `this.props.route` on context with your own `contextTypes`. http://tiny.cc/router-routecontextmixin') : undefined; + action = key || _Actions.POP; + key = _fourthArg; } -}; + var pathname = location.pathname || '/'; + var search = location.search || ''; + var hash = location.hash || ''; + var state = location.state || null; -exports['default'] = RouteContext; + return { + pathname: pathname, + search: search, + hash: hash, + state: state, + action: action, + key: key + }; +} + +exports['default'] = createLocation; module.exports = exports['default']; }).call(this,require('_process')) -},{"./routerWarning":34,"_process":1,"react":"react"}],16:[function(require,module,exports){ +},{"./Actions":6,"./PathUtils":11,"_process":23,"warning":232}],17:[function(require,module,exports){ (function (process){ 'use strict'; @@ -1419,331 +1513,346 @@ exports.__esModule = 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; }; -exports.isReactChildren = isReactChildren; -exports.createRouteFromReactElement = createRouteFromReactElement; -exports.createRoutesFromReactChildren = createRoutesFromReactChildren; -exports.createRoutes = createRoutes; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _react = require('react'); +var _warning = require('warning'); -var _react2 = _interopRequireDefault(_react); +var _warning2 = _interopRequireDefault(_warning); -var _routerWarning = require('./routerWarning'); +var _invariant = require('invariant'); -var _routerWarning2 = _interopRequireDefault(_routerWarning); +var _invariant2 = _interopRequireDefault(_invariant); -function isValidChild(object) { - return object == null || _react2['default'].isValidElement(object); -} +var _PathUtils = require('./PathUtils'); -function isReactChildren(object) { - return isValidChild(object) || Array.isArray(object) && object.every(isValidChild); +var _Actions = require('./Actions'); + +var _createHistory = require('./createHistory'); + +var _createHistory2 = _interopRequireDefault(_createHistory); + +function createStateStorage(entries) { + return entries.filter(function (entry) { + return entry.state; + }).reduce(function (memo, entry) { + memo[entry.key] = entry.state; + return memo; + }, {}); } -function checkPropTypes(componentName, propTypes, props) { - componentName = componentName || 'UnknownComponent'; +function createMemoryHistory() { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - for (var propName in propTypes) { - if (propTypes.hasOwnProperty(propName)) { - var error = propTypes[propName](props, propName, componentName); + if (Array.isArray(options)) { + options = { entries: options }; + } else if (typeof options === 'string') { + options = { entries: [options] }; + } - /* istanbul ignore if: error logging */ - if (error instanceof Error) process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, error.message) : undefined; - } + var history = _createHistory2['default'](_extends({}, options, { + getCurrentLocation: getCurrentLocation, + finishTransition: finishTransition, + saveState: saveState, + go: go + })); + + var _options = options; + var entries = _options.entries; + var current = _options.current; + + if (typeof entries === 'string') { + entries = [entries]; + } else if (!Array.isArray(entries)) { + entries = ['/']; } -} -function createRoute(defaultProps, props) { - return _extends({}, defaultProps, props); -} + entries = entries.map(function (entry) { + var key = history.createKey(); -function createRouteFromReactElement(element) { - var type = element.type; - var route = createRoute(type.defaultProps, element.props); + if (typeof entry === 'string') return { pathname: entry, key: key }; - if (type.propTypes) checkPropTypes(type.displayName || type.name, type.propTypes, route); + if (typeof entry === 'object' && entry) return _extends({}, entry, { key: key }); - if (route.children) { - var childRoutes = createRoutesFromReactChildren(route.children, route); + !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Unable to create history entry from %s', entry) : _invariant2['default'](false) : undefined; + }); - if (childRoutes.length) route.childRoutes = childRoutes; + if (current == null) { + current = entries.length - 1; + } else { + !(current >= 0 && current < entries.length) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Current index must be >= 0 and < %s, was %s', entries.length, current) : _invariant2['default'](false) : undefined; + } - delete route.children; + var storage = createStateStorage(entries); + + function saveState(key, state) { + storage[key] = state; } - return route; -} + function readState(key) { + return storage[key]; + } -/** - * Creates and returns a routes object from the given ReactChildren. JSX - * provides a convenient way to visualize how routes in the hierarchy are - * nested. - * - * import { Route, createRoutesFromReactChildren } from 'react-router' - * - * const routes = createRoutesFromReactChildren( - * - * - * - * - * ) - * - * Note: This method is automatically used when you provide children - * to a component. - */ + function getCurrentLocation() { + var entry = entries[current]; + var key = entry.key; + var basename = entry.basename; + var pathname = entry.pathname; + var search = entry.search; -function createRoutesFromReactChildren(children, parentRoute) { - var routes = []; + var path = (basename || '') + pathname + (search || ''); - _react2['default'].Children.forEach(children, function (element) { - if (_react2['default'].isValidElement(element)) { - // Component classes may have a static create* method. - if (element.type.createRouteFromReactElement) { - var route = element.type.createRouteFromReactElement(element, parentRoute); + var state = undefined; + if (key) { + state = readState(key); + } else { + state = null; + key = history.createKey(); + entry.key = key; + } - if (route) routes.push(route); - } else { - routes.push(createRouteFromReactElement(element)); + var location = _PathUtils.parsePath(path); + + return history.createLocation(_extends({}, location, { state: state }), undefined, key); + } + + function canGo(n) { + var index = current + n; + return index >= 0 && index < entries.length; + } + + function go(n) { + if (n) { + if (!canGo(n)) { + process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'Cannot go(%s) there is not enough history', n) : undefined; + return; } + + current += n; + + var currentLocation = getCurrentLocation(); + + // change action to POP + history.transitionTo(_extends({}, currentLocation, { action: _Actions.POP })); } - }); + } - return routes; -} + function finishTransition(location) { + switch (location.action) { + case _Actions.PUSH: + current += 1; -/** - * Creates and returns an array of routes from the given object which - * may be a JSX route, a plain object route, or an array of either. - */ + // if we are not on the top of stack + // remove rest and push new + if (current < entries.length) entries.splice(current); -function createRoutes(routes) { - if (isReactChildren(routes)) { - routes = createRoutesFromReactChildren(routes); - } else if (routes && !Array.isArray(routes)) { - routes = [routes]; + entries.push(location); + saveState(location.key, location.state); + break; + case _Actions.REPLACE: + entries[current] = location; + saveState(location.key, location.state); + break; + } } - return routes; + return history; } + +exports['default'] = createMemoryHistory; +module.exports = exports['default']; }).call(this,require('_process')) -},{"./routerWarning":34,"_process":1,"react":"react"}],17:[function(require,module,exports){ +},{"./Actions":6,"./PathUtils":11,"./createHistory":15,"_process":23,"invariant":22,"warning":232}],18:[function(require,module,exports){ (function (process){ 'use strict'; exports.__esModule = 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; }; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -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 _warning = require('warning'); -var _historyLibCreateHashHistory = require('history/lib/createHashHistory'); +var _warning2 = _interopRequireDefault(_warning); -var _historyLibCreateHashHistory2 = _interopRequireDefault(_historyLibCreateHashHistory); +function deprecate(fn, message) { + return function () { + process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '[history] ' + message) : undefined; + return fn.apply(this, arguments); + }; +} -var _historyLibUseQueries = require('history/lib/useQueries'); +exports['default'] = deprecate; +module.exports = exports['default']; +}).call(this,require('_process')) -var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries); +},{"_process":23,"warning":232}],19:[function(require,module,exports){ +(function (process){ +'use strict'; -var _react = require('react'); +exports.__esModule = true; -var _react2 = _interopRequireDefault(_react); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _createTransitionManager = require('./createTransitionManager'); +var _warning = require('warning'); -var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); +var _warning2 = _interopRequireDefault(_warning); -var _PropTypes = require('./PropTypes'); +function runTransitionHook(hook, location, callback) { + var result = hook(location, callback); -var _RouterContext = require('./RouterContext'); + if (hook.length < 2) { + // Assume the hook runs synchronously and automatically + // call the callback with the return value. + callback(result); + } else { + process.env.NODE_ENV !== 'production' ? _warning2['default'](result === undefined, 'You should not "return" in a transition hook with a callback argument; call the callback instead') : undefined; + } +} -var _RouterContext2 = _interopRequireDefault(_RouterContext); +exports['default'] = runTransitionHook; +module.exports = exports['default']; +}).call(this,require('_process')) -var _RouteUtils = require('./RouteUtils'); +},{"_process":23,"warning":232}],20:[function(require,module,exports){ +'use strict'; -var _RouterUtils = require('./RouterUtils'); +exports.__esModule = true; -var _routerWarning = require('./routerWarning'); +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 _routerWarning2 = _interopRequireDefault(_routerWarning); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -function isDeprecatedHistory(history) { - return !history || !history.__v2_compatible__; -} +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$PropTypes = _react2['default'].PropTypes; -var func = _React$PropTypes.func; -var object = _React$PropTypes.object; +var _ExecutionEnvironment = require('./ExecutionEnvironment'); -/** - * A is a high-level API for automatically setting up - * a router that renders a with all the props - * it needs each time the URL changes. - */ -var Router = _react2['default'].createClass({ - displayName: 'Router', +var _PathUtils = require('./PathUtils'); - propTypes: { - history: object, - children: _PropTypes.routes, - routes: _PropTypes.routes, // alias for children - render: func, - createElement: func, - onError: func, - onUpdate: func, +var _runTransitionHook = require('./runTransitionHook'); - // PRIVATE: For client-side rehydration of server match. - matchContext: object - }, +var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook); - getDefaultProps: function getDefaultProps() { - return { - render: function render(props) { - return _react2['default'].createElement(_RouterContext2['default'], props); - } - }; - }, +var _deprecate = require('./deprecate'); - getInitialState: function getInitialState() { - return { - location: null, - routes: null, - params: null, - components: null - }; - }, +var _deprecate2 = _interopRequireDefault(_deprecate); - handleError: function handleError(error) { - if (this.props.onError) { - this.props.onError.call(this, error); - } else { - // Throw errors by default so we don't silently swallow them! - throw error; // This error probably occurred in getChildRoutes or getComponents. - } - }, +function useBasename(createHistory) { + return function () { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + var basename = options.basename; - componentWillMount: function componentWillMount() { - var _this = this; + var historyOptions = _objectWithoutProperties(options, ['basename']); - var _props = this.props; - var parseQueryString = _props.parseQueryString; - var stringifyQuery = _props.stringifyQuery; + var history = createHistory(historyOptions); - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](!(parseQueryString || stringifyQuery), '`parseQueryString` and `stringifyQuery` are deprecated. Please create a custom history. http://tiny.cc/router-customquerystring') : undefined; + // Automatically use the value of in HTML + // documents as basename if it's not explicitly given. + if (basename == null && _ExecutionEnvironment.canUseDOM) { + var base = document.getElementsByTagName('base')[0]; - var _createRouterObjects = this.createRouterObjects(); + if (base) basename = _PathUtils.extractPath(base.href); + } - var history = _createRouterObjects.history; - var transitionManager = _createRouterObjects.transitionManager; - var router = _createRouterObjects.router; + function addBasename(location) { + if (basename && location.basename == null) { + if (location.pathname.indexOf(basename) === 0) { + location.pathname = location.pathname.substring(basename.length); + location.basename = basename; - this._unlisten = transitionManager.listen(function (error, state) { - if (error) { - _this.handleError(error); - } else { - _this.setState(state, _this.props.onUpdate); + if (location.pathname === '') location.pathname = '/'; + } else { + location.basename = ''; + } } - }); - this.history = history; - this.router = router; - }, + return location; + } - createRouterObjects: function createRouterObjects() { - var matchContext = this.props.matchContext; + function prependBasename(location) { + if (!basename) return location; - if (matchContext) { - return matchContext; - } + if (typeof location === 'string') location = _PathUtils.parsePath(location); - var history = this.props.history; - var _props2 = this.props; - var routes = _props2.routes; - var children = _props2.children; + var pname = location.pathname; + var normalizedBasename = basename.slice(-1) === '/' ? basename : basename + '/'; + var normalizedPathname = pname.charAt(0) === '/' ? pname.slice(1) : pname; + var pathname = normalizedBasename + normalizedPathname; - if (isDeprecatedHistory(history)) { - history = this.wrapDeprecatedHistory(history); + return _extends({}, location, { + pathname: pathname + }); } - var transitionManager = _createTransitionManager2['default'](history, _RouteUtils.createRoutes(routes || children)); - var router = _RouterUtils.createRouterObject(history, transitionManager); - var routingHistory = _RouterUtils.createRoutingHistory(history, transitionManager); + // Override all read methods with basename-aware versions. + function listenBefore(hook) { + return history.listenBefore(function (location, callback) { + _runTransitionHook2['default'](hook, addBasename(location), callback); + }); + } - return { history: routingHistory, transitionManager: transitionManager, router: router }; - }, + function listen(listener) { + return history.listen(function (location) { + listener(addBasename(location)); + }); + } - wrapDeprecatedHistory: function wrapDeprecatedHistory(history) { - var _props3 = this.props; - var parseQueryString = _props3.parseQueryString; - var stringifyQuery = _props3.stringifyQuery; + // Override all write methods with basename-aware versions. + function push(location) { + history.push(prependBasename(location)); + } - var createHistory = undefined; - if (history) { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'It appears you have provided a deprecated history object to ``, please use a history provided by ' + 'React Router with `import { browserHistory } from \'react-router\'` or `import { hashHistory } from \'react-router\'`. ' + 'If you are using a custom history please create it with `useRouterHistory`, see http://tiny.cc/router-usinghistory for details.') : undefined; - createHistory = function () { - return history; - }; - } else { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`Router` no longer defaults the history prop to hash history. Please use the `hashHistory` singleton instead. http://tiny.cc/router-defaulthistory') : undefined; - createHistory = _historyLibCreateHashHistory2['default']; + function replace(location) { + history.replace(prependBasename(location)); } - return _historyLibUseQueries2['default'](createHistory)({ parseQueryString: parseQueryString, stringifyQuery: stringifyQuery }); - }, + function createPath(location) { + return history.createPath(prependBasename(location)); + } - /* istanbul ignore next: sanity check */ - componentWillReceiveProps: function componentWillReceiveProps(nextProps) { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](nextProps.history === this.props.history, 'You cannot change ; it will be ignored') : undefined; + function createHref(location) { + return history.createHref(prependBasename(location)); + } - process.env.NODE_ENV !== 'production' ? _routerWarning2['default']((nextProps.routes || nextProps.children) === (this.props.routes || this.props.children), 'You cannot change ; it will be ignored') : undefined; - }, + function createLocation(location) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - componentWillUnmount: function componentWillUnmount() { - if (this._unlisten) this._unlisten(); - }, + return addBasename(history.createLocation.apply(history, [prependBasename(location)].concat(args))); + } - render: function render() { - var _state = this.state; - var location = _state.location; - var routes = _state.routes; - var params = _state.params; - var components = _state.components; - var _props4 = this.props; - var createElement = _props4.createElement; - var render = _props4.render; + // deprecated + function pushState(state, path) { + if (typeof path === 'string') path = _PathUtils.parsePath(path); - var props = _objectWithoutProperties(_props4, ['createElement', 'render']); + push(_extends({ state: state }, path)); + } - if (location == null) return null; // Async match + // deprecated + function replaceState(state, path) { + if (typeof path === 'string') path = _PathUtils.parsePath(path); - // Only forward non-Router-specific props to routing context, as those are - // the only ones that might be custom routing context props. - Object.keys(Router.propTypes).forEach(function (propType) { - return delete props[propType]; - }); + replace(_extends({ state: state }, path)); + } - return render(_extends({}, props, { - history: this.history, - router: this.router, - location: location, - routes: routes, - params: params, - components: components, - createElement: createElement - })); - } + return _extends({}, history, { + listenBefore: listenBefore, + listen: listen, + push: push, + replace: replace, + createPath: createPath, + createHref: createHref, + createLocation: createLocation, -}); + pushState: _deprecate2['default'](pushState, 'pushState is deprecated; use push instead'), + replaceState: _deprecate2['default'](replaceState, 'replaceState is deprecated; use replace instead') + }); + }; +} -exports['default'] = Router; +exports['default'] = useBasename; module.exports = exports['default']; -}).call(this,require('_process')) - -},{"./PropTypes":12,"./RouteUtils":16,"./RouterContext":18,"./RouterUtils":19,"./createTransitionManager":26,"./routerWarning":34,"_process":1,"history/lib/createHashHistory":45,"history/lib/useQueries":52,"react":"react"}],18:[function(require,module,exports){ +},{"./ExecutionEnvironment":10,"./PathUtils":11,"./deprecate":18,"./runTransitionHook":19}],21:[function(require,module,exports){ (function (process){ 'use strict'; @@ -1753,1684 +1862,1547 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _invariant = require('invariant'); +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 _invariant2 = _interopRequireDefault(_invariant); +var _warning = require('warning'); -var _react = require('react'); +var _warning2 = _interopRequireDefault(_warning); -var _react2 = _interopRequireDefault(_react); +var _queryString = require('query-string'); -var _deprecateObjectProperties = require('./deprecateObjectProperties'); +var _runTransitionHook = require('./runTransitionHook'); -var _deprecateObjectProperties2 = _interopRequireDefault(_deprecateObjectProperties); +var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook); -var _getRouteParams = require('./getRouteParams'); +var _PathUtils = require('./PathUtils'); -var _getRouteParams2 = _interopRequireDefault(_getRouteParams); +var _deprecate = require('./deprecate'); -var _RouteUtils = require('./RouteUtils'); +var _deprecate2 = _interopRequireDefault(_deprecate); -var _routerWarning = require('./routerWarning'); +var SEARCH_BASE_KEY = '$searchBase'; -var _routerWarning2 = _interopRequireDefault(_routerWarning); +function defaultStringifyQuery(query) { + return _queryString.stringify(query).replace(/%20/g, '+'); +} -var _React$PropTypes = _react2['default'].PropTypes; -var array = _React$PropTypes.array; -var func = _React$PropTypes.func; -var object = _React$PropTypes.object; +var defaultParseQueryString = _queryString.parse; + +function isNestedObject(object) { + for (var p in object) { + if (object.hasOwnProperty(p) && typeof object[p] === 'object' && !Array.isArray(object[p]) && object[p] !== null) return true; + }return false; +} /** - * A renders the component tree for a given router state - * and sets the history object and the current location in context. + * Returns a new createHistory function that may be used to create + * history objects that know how to handle URL queries. */ -var RouterContext = _react2['default'].createClass({ - displayName: 'RouterContext', +function useQueries(createHistory) { + return function () { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + var stringifyQuery = options.stringifyQuery; + var parseQueryString = options.parseQueryString; - propTypes: { - history: object, - router: object.isRequired, - location: object.isRequired, - routes: array.isRequired, - params: object.isRequired, - components: array.isRequired, - createElement: func.isRequired - }, + var historyOptions = _objectWithoutProperties(options, ['stringifyQuery', 'parseQueryString']); - getDefaultProps: function getDefaultProps() { - return { - createElement: _react2['default'].createElement - }; - }, + var history = createHistory(historyOptions); - childContextTypes: { - history: object, - location: object.isRequired, - router: object.isRequired - }, + if (typeof stringifyQuery !== 'function') stringifyQuery = defaultStringifyQuery; - getChildContext: function getChildContext() { - var _props = this.props; - var router = _props.router; - var history = _props.history; - var location = _props.location; + if (typeof parseQueryString !== 'function') parseQueryString = defaultParseQueryString; - if (!router) { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`` expects a `router` rather than a `history`') : undefined; + function addQuery(location) { + if (location.query == null) { + var search = location.search; - router = _extends({}, history, { - setRouteLeaveHook: history.listenBeforeLeavingRoute - }); - delete router.listenBeforeLeavingRoute; - } + location.query = parseQueryString(search.substring(1)); + location[SEARCH_BASE_KEY] = { search: search, searchBase: '' }; + } - if (process.env.NODE_ENV !== 'production') { - location = _deprecateObjectProperties2['default'](location, '`context.location` is deprecated, please use a route component\'s `props.location` instead. http://tiny.cc/router-accessinglocation'); - } + // TODO: Instead of all the book-keeping here, this should just strip the + // stringified query from the search. - return { history: history, location: location, router: router }; - }, + return location; + } - createElement: function createElement(component, props) { - return component == null ? null : this.props.createElement(component, props); - }, + function appendQuery(location, query) { + var _extends2; - render: function render() { - var _this = this; + var searchBaseSpec = location[SEARCH_BASE_KEY]; + var queryString = query ? stringifyQuery(query) : ''; + if (!searchBaseSpec && !queryString) { + return location; + } - var _props2 = this.props; - var history = _props2.history; - var location = _props2.location; - var routes = _props2.routes; - var params = _props2.params; - var components = _props2.components; + process.env.NODE_ENV !== 'production' ? _warning2['default'](stringifyQuery !== defaultStringifyQuery || !isNestedObject(query), 'useQueries does not stringify nested query objects by default; ' + 'use a custom stringifyQuery function') : undefined; - var element = null; + if (typeof location === 'string') location = _PathUtils.parsePath(location); - if (components) { - element = components.reduceRight(function (element, components, index) { - if (components == null) return element; // Don't create new children; use the grandchildren. + var searchBase = undefined; + if (searchBaseSpec && location.search === searchBaseSpec.search) { + searchBase = searchBaseSpec.searchBase; + } else { + searchBase = location.search || ''; + } - var route = routes[index]; - var routeParams = _getRouteParams2['default'](route, params); - var props = { - history: history, - location: location, - params: params, - route: route, - routeParams: routeParams, - routes: routes - }; + var search = searchBase; + if (queryString) { + search += (search ? '&' : '?') + queryString; + } - if (_RouteUtils.isReactChildren(element)) { - props.children = element; - } else if (element) { - for (var prop in element) { - if (element.hasOwnProperty(prop)) props[prop] = element[prop]; - } - } + return _extends({}, location, (_extends2 = { + search: search + }, _extends2[SEARCH_BASE_KEY] = { search: search, searchBase: searchBase }, _extends2)); + } - if (typeof components === 'object') { - var elements = {}; + // Override all read methods with query-aware versions. + function listenBefore(hook) { + return history.listenBefore(function (location, callback) { + _runTransitionHook2['default'](hook, addQuery(location), callback); + }); + } - for (var key in components) { - if (components.hasOwnProperty(key)) { - // Pass through the key as a prop to createElement to allow - // custom createElement functions to know which named component - // they're rendering, for e.g. matching up to fetched data. - elements[key] = _this.createElement(components[key], _extends({ - key: key }, props)); - } - } + function listen(listener) { + return history.listen(function (location) { + listener(addQuery(location)); + }); + } - return elements; - } + // Override all write methods with query-aware versions. + function push(location) { + history.push(appendQuery(location, location.query)); + } - return _this.createElement(components, props); - }, element); + function replace(location) { + history.replace(appendQuery(location, location.query)); } - !(element === null || element === false || _react2['default'].isValidElement(element)) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'The root route must render a single element') : _invariant2['default'](false) : undefined; + function createPath(location, query) { + process.env.NODE_ENV !== 'production' ? _warning2['default'](!query, 'the query argument to createPath is deprecated; use a location descriptor instead') : undefined; - return element; - } + return history.createPath(appendQuery(location, query || location.query)); + } -}); + function createHref(location, query) { + process.env.NODE_ENV !== 'production' ? _warning2['default'](!query, 'the query argument to createHref is deprecated; use a location descriptor instead') : undefined; -exports['default'] = RouterContext; -module.exports = exports['default']; -}).call(this,require('_process')) + return history.createHref(appendQuery(location, query || location.query)); + } -},{"./RouteUtils":16,"./deprecateObjectProperties":27,"./getRouteParams":29,"./routerWarning":34,"_process":1,"invariant":58,"react":"react"}],19:[function(require,module,exports){ -(function (process){ -'use strict'; + function createLocation(location) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } -exports.__esModule = true; + var fullLocation = history.createLocation.apply(history, [appendQuery(location, location.query)].concat(args)); + if (location.query) { + fullLocation.query = location.query; + } + return addQuery(fullLocation); + } -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; }; + // deprecated + function pushState(state, path, query) { + if (typeof path === 'string') path = _PathUtils.parsePath(path); -exports.createRouterObject = createRouterObject; -exports.createRoutingHistory = createRoutingHistory; + push(_extends({ state: state }, path, { query: query })); + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + // deprecated + function replaceState(state, path, query) { + if (typeof path === 'string') path = _PathUtils.parsePath(path); -var _deprecateObjectProperties = require('./deprecateObjectProperties'); + replace(_extends({ state: state }, path, { query: query })); + } -var _deprecateObjectProperties2 = _interopRequireDefault(_deprecateObjectProperties); + return _extends({}, history, { + listenBefore: listenBefore, + listen: listen, + push: push, + replace: replace, + createPath: createPath, + createHref: createHref, + createLocation: createLocation, -function createRouterObject(history, transitionManager) { - return _extends({}, history, { - setRouteLeaveHook: transitionManager.listenBeforeLeavingRoute, - isActive: transitionManager.isActive - }); + pushState: _deprecate2['default'](pushState, 'pushState is deprecated; use push instead'), + replaceState: _deprecate2['default'](replaceState, 'replaceState is deprecated; use replace instead') + }); + }; } -// deprecated - -function createRoutingHistory(history, transitionManager) { - history = _extends({}, history, transitionManager); - - if (process.env.NODE_ENV !== 'production') { - history = _deprecateObjectProperties2['default'](history, '`props.history` and `context.history` are deprecated. Please use `context.router`. http://tiny.cc/router-contextchanges'); - } - - return history; -} +exports['default'] = useQueries; +module.exports = exports['default']; }).call(this,require('_process')) -},{"./deprecateObjectProperties":27,"_process":1}],20:[function(require,module,exports){ +},{"./PathUtils":11,"./deprecate":18,"./runTransitionHook":19,"_process":23,"query-string":24,"warning":232}],22:[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. + */ + 'use strict'; -exports.__esModule = true; +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +var invariant = function(condition, format, a, b, c, d, e, f) { + if (process.env.NODE_ENV !== 'production') { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + } -var _react = require('react'); + if (!condition) { + var error; + if (format === undefined) { + error = new Error( + 'Minified exception occurred; use the non-minified dev environment ' + + 'for the full error message and additional helpful warnings.' + ); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error( + format.replace(/%s/g, function() { return args[argIndex++]; }) + ); + error.name = 'Invariant Violation'; + } -var _react2 = _interopRequireDefault(_react); + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +}; -var _RouterContext = require('./RouterContext'); +module.exports = invariant; -var _RouterContext2 = _interopRequireDefault(_RouterContext); +}).call(this,require('_process')) -var _routerWarning = require('./routerWarning'); +},{"_process":23}],23:[function(require,module,exports){ +// shim for using process in browser -var _routerWarning2 = _interopRequireDefault(_routerWarning); +var process = module.exports = {}; +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; -var RoutingContext = _react2['default'].createClass({ - displayName: 'RoutingContext', +function cleanUpNextTick() { + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} - componentWillMount: function componentWillMount() { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`RoutingContext` has been renamed to `RouterContext`. Please use `import { RouterContext } from \'react-router\'`. http://tiny.cc/router-routercontext') : undefined; - }, +function drainQueue() { + if (draining) { + return; + } + var timeout = setTimeout(cleanUpNextTick); + draining = true; - render: function render() { - return _react2['default'].createElement(_RouterContext2['default'], this.props); - } -}); + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + clearTimeout(timeout); +} -exports['default'] = RoutingContext; -module.exports = exports['default']; -}).call(this,require('_process')) +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 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); + } +}; -},{"./RouterContext":18,"./routerWarning":34,"_process":1,"react":"react"}],21:[function(require,module,exports){ -(function (process){ +// 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'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + +},{}],24:[function(require,module,exports){ 'use strict'; +var strictUriEncode = require('strict-uri-encode'); -exports.__esModule = true; -exports.runEnterHooks = runEnterHooks; -exports.runLeaveHooks = runLeaveHooks; +exports.extract = function (str) { + return str.split('?')[1] || ''; +}; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +exports.parse = function (str) { + if (typeof str !== 'string') { + return {}; + } -var _AsyncUtils = require('./AsyncUtils'); + str = str.trim().replace(/^(\?|#|&)/, ''); -var _routerWarning = require('./routerWarning'); + if (!str) { + return {}; + } -var _routerWarning2 = _interopRequireDefault(_routerWarning); + return str.split('&').reduce(function (ret, param) { + var parts = param.replace(/\+/g, ' ').split('='); + // Firefox (pre 40) decodes `%3D` to `=` + // https://github.com/sindresorhus/query-string/pull/37 + var key = parts.shift(); + var val = parts.length > 0 ? parts.join('=') : undefined; -function createEnterHook(hook, route) { - return function (a, b, callback) { - hook.apply(route, arguments); + key = decodeURIComponent(key); - if (hook.length < 3) { - // Assume hook executes synchronously and - // automatically call the callback. - callback(); - } - }; -} + // missing `=` should be `null`: + // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters + val = val === undefined ? null : decodeURIComponent(val); -function getEnterHooks(routes) { - return routes.reduce(function (hooks, route) { - if (route.onEnter) hooks.push(createEnterHook(route.onEnter, route)); + if (!ret.hasOwnProperty(key)) { + ret[key] = val; + } else if (Array.isArray(ret[key])) { + ret[key].push(val); + } else { + ret[key] = [ret[key], val]; + } - return hooks; - }, []); -} + return ret; + }, {}); +}; -/** - * Runs all onEnter hooks in the given array of routes in order - * with onEnter(nextState, replace, callback) and calls - * callback(error, redirectInfo) when finished. The first hook - * to use replace short-circuits the loop. - * - * If a hook needs to run asynchronously, it may use the callback - * function. However, doing so will cause the transition to pause, - * which could lead to a non-responsive UI if the hook is slow. - */ +exports.stringify = function (obj) { + return obj ? Object.keys(obj).sort().map(function (key) { + var val = obj[key]; -function runEnterHooks(routes, nextState, callback) { - var hooks = getEnterHooks(routes); + if (val === undefined) { + return ''; + } - if (!hooks.length) { - callback(); - return; - } + if (val === null) { + return key; + } - var redirectInfo = undefined; - function replace(location, deprecatedPathname, deprecatedQuery) { - if (deprecatedPathname) { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined; - redirectInfo = { - pathname: deprecatedPathname, - query: deprecatedQuery, - state: location - }; + if (Array.isArray(val)) { + return val.slice().sort().map(function (val2) { + return strictUriEncode(key) + '=' + strictUriEncode(val2); + }).join('&'); + } + + return strictUriEncode(key) + '=' + strictUriEncode(val); + }).filter(function (x) { + return x.length > 0; + }).join('&') : ''; +}; + +},{"strict-uri-encode":231}],25:[function(require,module,exports){ +"use strict"; + +exports.__esModule = true; +var _slice = Array.prototype.slice; +exports.loopAsync = loopAsync; +exports.mapAsync = mapAsync; + +function loopAsync(turns, work, callback) { + var currentTurn = 0, + isDone = false; + var sync = false, + hasNext = false, + doneArgs = undefined; + function done() { + isDone = true; + if (sync) { + // Iterate instead of recursing if possible. + doneArgs = [].concat(_slice.call(arguments)); return; } - redirectInfo = location; + callback.apply(this, arguments); } - _AsyncUtils.loopAsync(hooks.length, function (index, next, done) { - hooks[index](nextState, replace, function (error) { - if (error || redirectInfo) { - done(error, redirectInfo); // No need to continue. - } else { - next(); - } - }); - }, callback); -} + function next() { + if (isDone) { + return; + } -/** - * Runs all onLeave hooks in the given array of routes in order. - */ + hasNext = true; + if (sync) { + // Iterate instead of recursing if possible. + return; + } -function runLeaveHooks(routes) { - for (var i = 0, len = routes.length; i < len; ++i) { - if (routes[i].onLeave) routes[i].onLeave.call(routes[i]); + sync = true; + + while (!isDone && currentTurn < turns && hasNext) { + hasNext = false; + work.call(this, currentTurn++, next, done); + } + + sync = false; + + if (isDone) { + // This means the loop finished synchronously. + callback.apply(this, doneArgs); + return; + } + + if (currentTurn >= turns && hasNext) { + isDone = true; + callback(); + } } + + next(); } -}).call(this,require('_process')) -},{"./AsyncUtils":4,"./routerWarning":34,"_process":1}],22:[function(require,module,exports){ -'use strict'; +function mapAsync(array, work, callback) { + var length = array.length; + var values = []; -exports.__esModule = true; + if (length === 0) return callback(null, values); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + var isDone = false, + doneCount = 0; -var _historyLibCreateBrowserHistory = require('history/lib/createBrowserHistory'); + function done(index, error, value) { + if (isDone) return; -var _historyLibCreateBrowserHistory2 = _interopRequireDefault(_historyLibCreateBrowserHistory); + if (error) { + isDone = true; + callback(error); + } else { + values[index] = value; -var _createRouterHistory = require('./createRouterHistory'); + isDone = ++doneCount === length; -var _createRouterHistory2 = _interopRequireDefault(_createRouterHistory); + if (isDone) callback(null, values); + } + } -exports['default'] = _createRouterHistory2['default'](_historyLibCreateBrowserHistory2['default']); -module.exports = exports['default']; -},{"./createRouterHistory":25,"history/lib/createBrowserHistory":43}],23:[function(require,module,exports){ + array.forEach(function (item, index) { + work(item, index, function (error, value) { + done(index, error, value); + }); + }); +} +},{}],26:[function(require,module,exports){ +(function (process){ 'use strict'; exports.__esModule = true; -var _PatternUtils = require('./PatternUtils'); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -function routeParamsChanged(route, prevState, nextState) { - if (!route.path) return false; +var _routerWarning = require('./routerWarning'); - var paramNames = _PatternUtils.getParamNames(route.path); +var _routerWarning2 = _interopRequireDefault(_routerWarning); - return paramNames.some(function (paramName) { - return prevState.params[paramName] !== nextState.params[paramName]; - }); -} +var _PropTypes = require('./PropTypes'); /** - * Returns an object of { leaveRoutes, enterRoutes } determined by - * the change from prevState to nextState. We leave routes if either - * 1) they are not in the next state or 2) they are in the next state - * but their params have changed (i.e. /users/123 => /users/456). - * - * leaveRoutes are ordered starting at the leaf route of the tree - * we're leaving up to the common parent route. enterRoutes are ordered - * from the top of the tree we're entering down to the leaf route. + * A mixin that adds the "history" instance variable to components. */ -function computeChangedRoutes(prevState, nextState) { - var prevRoutes = prevState && prevState.routes; - var nextRoutes = nextState.routes; - - var leaveRoutes = undefined, - enterRoutes = undefined; - if (prevRoutes) { - leaveRoutes = prevRoutes.filter(function (route) { - return nextRoutes.indexOf(route) === -1 || routeParamsChanged(route, prevState, nextState); - }); +var History = { - // onLeave hooks start at the leaf route. - leaveRoutes.reverse(); + contextTypes: { + history: _PropTypes.history + }, - enterRoutes = nextRoutes.filter(function (route) { - return prevRoutes.indexOf(route) === -1 || leaveRoutes.indexOf(route) !== -1; - }); - } else { - leaveRoutes = []; - enterRoutes = nextRoutes; + componentWillMount: function componentWillMount() { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'the `History` mixin is deprecated, please access `context.router` with your own `contextTypes`. http://tiny.cc/router-historymixin') : undefined; + this.history = this.context.history; } - return { - leaveRoutes: leaveRoutes, - enterRoutes: enterRoutes - }; -} +}; -exports['default'] = computeChangedRoutes; +exports['default'] = History; module.exports = exports['default']; -},{"./PatternUtils":11}],24:[function(require,module,exports){ +}).call(this,require('_process')) + +},{"./PropTypes":33,"./routerWarning":55,"_process":23}],27:[function(require,module,exports){ 'use strict'; exports.__esModule = true; -exports['default'] = createMemoryHistory; + +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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _historyLibUseQueries = require('history/lib/useQueries'); +var _react = require('react'); -var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries); +var _react2 = _interopRequireDefault(_react); -var _historyLibUseBasename = require('history/lib/useBasename'); +var _Link = require('./Link'); -var _historyLibUseBasename2 = _interopRequireDefault(_historyLibUseBasename); +var _Link2 = _interopRequireDefault(_Link); -var _historyLibCreateMemoryHistory = require('history/lib/createMemoryHistory'); +/** + * An is used to link to an . + */ +var IndexLink = _react2['default'].createClass({ + displayName: 'IndexLink', -var _historyLibCreateMemoryHistory2 = _interopRequireDefault(_historyLibCreateMemoryHistory); + render: function render() { + return _react2['default'].createElement(_Link2['default'], _extends({}, this.props, { onlyActiveOnIndex: true })); + } -function createMemoryHistory(options) { - // signatures and type checking differ between `useRoutes` and - // `createMemoryHistory`, have to create `memoryHistory` first because - // `useQueries` doesn't understand the signature - var memoryHistory = _historyLibCreateMemoryHistory2['default'](options); - var createHistory = function createHistory() { - return memoryHistory; - }; - var history = _historyLibUseQueries2['default'](_historyLibUseBasename2['default'](createHistory))(options); - history.__v2_compatible__ = true; - return history; -} +}); +exports['default'] = IndexLink; module.exports = exports['default']; -},{"history/lib/createMemoryHistory":48,"history/lib/useBasename":51,"history/lib/useQueries":52}],25:[function(require,module,exports){ +},{"./Link":31,"react":"react"}],28:[function(require,module,exports){ +(function (process){ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _useRouterHistory = require('./useRouterHistory'); - -var _useRouterHistory2 = _interopRequireDefault(_useRouterHistory); +var _react = require('react'); -var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); +var _react2 = _interopRequireDefault(_react); -exports['default'] = function (createHistory) { - var history = undefined; - if (canUseDOM) history = _useRouterHistory2['default'](createHistory)(); - return history; -}; +var _routerWarning = require('./routerWarning'); -module.exports = exports['default']; -},{"./useRouterHistory":35}],26:[function(require,module,exports){ -(function (process){ -'use strict'; +var _routerWarning2 = _interopRequireDefault(_routerWarning); -exports.__esModule = true; +var _invariant = require('invariant'); -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 _invariant2 = _interopRequireDefault(_invariant); -exports['default'] = createTransitionManager; +var _Redirect = require('./Redirect'); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +var _Redirect2 = _interopRequireDefault(_Redirect); -var _routerWarning = require('./routerWarning'); +var _PropTypes = require('./PropTypes'); -var _routerWarning2 = _interopRequireDefault(_routerWarning); +var _React$PropTypes = _react2['default'].PropTypes; +var string = _React$PropTypes.string; +var object = _React$PropTypes.object; -var _historyLibActions = require('history/lib/Actions'); +/** + * An is used to redirect from an indexRoute. + */ +var IndexRedirect = _react2['default'].createClass({ + displayName: 'IndexRedirect', -var _computeChangedRoutes2 = require('./computeChangedRoutes'); + statics: { -var _computeChangedRoutes3 = _interopRequireDefault(_computeChangedRoutes2); + createRouteFromReactElement: function createRouteFromReactElement(element, parentRoute) { + /* istanbul ignore else: sanity check */ + if (parentRoute) { + parentRoute.indexRoute = _Redirect2['default'].createRouteFromReactElement(element); + } else { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'An does not make sense at the root of your route config') : undefined; + } + } -var _TransitionUtils = require('./TransitionUtils'); + }, -var _isActive2 = require('./isActive'); + propTypes: { + to: string.isRequired, + query: object, + state: object, + onEnter: _PropTypes.falsy, + children: _PropTypes.falsy + }, -var _isActive3 = _interopRequireDefault(_isActive2); + /* istanbul ignore next: sanity check */ + render: function render() { + !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, ' elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined; + } -var _getComponents = require('./getComponents'); +}); -var _getComponents2 = _interopRequireDefault(_getComponents); +exports['default'] = IndexRedirect; +module.exports = exports['default']; +}).call(this,require('_process')) -var _matchRoutes = require('./matchRoutes'); +},{"./PropTypes":33,"./Redirect":34,"./routerWarning":55,"_process":23,"invariant":22,"react":"react"}],29:[function(require,module,exports){ +(function (process){ +'use strict'; -var _matchRoutes2 = _interopRequireDefault(_matchRoutes); +exports.__esModule = true; -function hasAnyProperties(object) { - for (var p in object) { - if (object.hasOwnProperty(p)) return true; - }return false; -} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -function createTransitionManager(history, routes) { - var state = {}; +var _react = require('react'); - // Signature should be (location, indexOnly), but needs to support (path, - // query, indexOnly) - function isActive(location) { - var indexOnlyOrDeprecatedQuery = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; - var deprecatedIndexOnly = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; +var _react2 = _interopRequireDefault(_react); - var indexOnly = undefined; - if (indexOnlyOrDeprecatedQuery && indexOnlyOrDeprecatedQuery !== true || deprecatedIndexOnly !== null) { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`isActive(pathname, query, indexOnly) is deprecated; use `isActive(location, indexOnly)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined; - location = { pathname: location, query: indexOnlyOrDeprecatedQuery }; - indexOnly = deprecatedIndexOnly || false; - } else { - location = history.createLocation(location); - indexOnly = indexOnlyOrDeprecatedQuery; - } +var _routerWarning = require('./routerWarning'); - return _isActive3['default'](location, indexOnly, state.location, state.routes, state.params); - } +var _routerWarning2 = _interopRequireDefault(_routerWarning); - function createLocationFromRedirectInfo(location) { - return history.createLocation(location, _historyLibActions.REPLACE); - } +var _invariant = require('invariant'); - var partialNextState = undefined; +var _invariant2 = _interopRequireDefault(_invariant); - function match(location, callback) { - if (partialNextState && partialNextState.location === location) { - // Continue from where we left off. - finishMatch(partialNextState, callback); - } else { - _matchRoutes2['default'](routes, location, function (error, nextState) { - if (error) { - callback(error); - } else if (nextState) { - finishMatch(_extends({}, nextState, { location: location }), callback); - } else { - callback(); - } - }); - } - } +var _RouteUtils = require('./RouteUtils'); - function finishMatch(nextState, callback) { - var _computeChangedRoutes = _computeChangedRoutes3['default'](state, nextState); +var _PropTypes = require('./PropTypes'); - var leaveRoutes = _computeChangedRoutes.leaveRoutes; - var enterRoutes = _computeChangedRoutes.enterRoutes; +var func = _react2['default'].PropTypes.func; - _TransitionUtils.runLeaveHooks(leaveRoutes); +/** + * An is used to specify its parent's in + * a JSX route config. + */ +var IndexRoute = _react2['default'].createClass({ + displayName: 'IndexRoute', - // Tear down confirmation hooks for left routes - leaveRoutes.forEach(removeListenBeforeHooksForRoute); + statics: { - _TransitionUtils.runEnterHooks(enterRoutes, nextState, function (error, redirectInfo) { - if (error) { - callback(error); - } else if (redirectInfo) { - callback(null, createLocationFromRedirectInfo(redirectInfo)); + createRouteFromReactElement: function createRouteFromReactElement(element, parentRoute) { + /* istanbul ignore else: sanity check */ + if (parentRoute) { + parentRoute.indexRoute = _RouteUtils.createRouteFromReactElement(element); } else { - // TODO: Fetch components after state is updated. - _getComponents2['default'](nextState, function (error, components) { - if (error) { - callback(error); - } else { - // TODO: Make match a pure function and have some other API - // for "match and update state". - callback(null, null, state = _extends({}, nextState, { components: components })); - } - }); + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'An does not make sense at the root of your route config') : undefined; } - }); - } - - var RouteGuid = 1; - - function getRouteID(route) { - var create = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1]; + } - return route.__id__ || create && (route.__id__ = RouteGuid++); - } + }, - var RouteHooks = {}; + propTypes: { + path: _PropTypes.falsy, + component: _PropTypes.component, + components: _PropTypes.components, + getComponent: func, + getComponents: func + }, - function getRouteHooksForRoutes(routes) { - return routes.reduce(function (hooks, route) { - hooks.push.apply(hooks, RouteHooks[getRouteID(route)]); - return hooks; - }, []); + /* istanbul ignore next: sanity check */ + render: function render() { + !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, ' elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined; } - function transitionHook(location, callback) { - _matchRoutes2['default'](routes, location, function (error, nextState) { - if (nextState == null) { - // TODO: We didn't actually match anything, but hang - // onto error/nextState so we don't have to matchRoutes - // again in the listen callback. - callback(); - return; - } - - // Cache some state here so we don't have to - // matchRoutes() again in the listen callback. - partialNextState = _extends({}, nextState, { location: location }); - - var hooks = getRouteHooksForRoutes(_computeChangedRoutes3['default'](state, partialNextState).leaveRoutes); - - var result = undefined; - for (var i = 0, len = hooks.length; result == null && i < len; ++i) { - // Passing the location arg here indicates to - // the user that this is a transition hook. - result = hooks[i](location); - } +}); - callback(result); - }); - } +exports['default'] = IndexRoute; +module.exports = exports['default']; +}).call(this,require('_process')) - /* istanbul ignore next: untestable with Karma */ - function beforeUnloadHook() { - // Synchronously check to see if any route hooks want - // to prevent the current window/tab from closing. - if (state.routes) { - var hooks = getRouteHooksForRoutes(state.routes); +},{"./PropTypes":33,"./RouteUtils":37,"./routerWarning":55,"_process":23,"invariant":22,"react":"react"}],30:[function(require,module,exports){ +(function (process){ +'use strict'; - var message = undefined; - for (var i = 0, len = hooks.length; typeof message !== 'string' && i < len; ++i) { - // Passing no args indicates to the user that this is a - // beforeunload hook. We don't know the next location. - message = hooks[i](); - } +exports.__esModule = true; - return message; - } - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var unlistenBefore = undefined, - unlistenBeforeUnload = undefined; +var _routerWarning = require('./routerWarning'); - function removeListenBeforeHooksForRoute(route) { - var routeID = getRouteID(route, false); - if (!routeID) { - return; - } +var _routerWarning2 = _interopRequireDefault(_routerWarning); - delete RouteHooks[routeID]; +var _react = require('react'); - if (!hasAnyProperties(RouteHooks)) { - // teardown transition & beforeunload hooks - if (unlistenBefore) { - unlistenBefore(); - unlistenBefore = null; - } +var _react2 = _interopRequireDefault(_react); - if (unlistenBeforeUnload) { - unlistenBeforeUnload(); - unlistenBeforeUnload = null; - } - } - } +var _invariant = require('invariant'); - /** - * Registers the given hook function to run before leaving the given route. - * - * During a normal transition, the hook function receives the next location - * as its only argument and must return either a) a prompt message to show - * the user, to make sure they want to leave the page or b) false, to prevent - * the transition. - * - * During the beforeunload event (in browsers) the hook receives no arguments. - * In this case it must return a prompt message to prevent the transition. - * - * Returns a function that may be used to unbind the listener. - */ - function listenBeforeLeavingRoute(route, hook) { - // TODO: Warn if they register for a route that isn't currently - // active. They're probably doing something wrong, like re-creating - // route objects on every location change. - var routeID = getRouteID(route); - var hooks = RouteHooks[routeID]; +var _invariant2 = _interopRequireDefault(_invariant); - if (!hooks) { - var thereWereNoRouteHooks = !hasAnyProperties(RouteHooks); +var object = _react2['default'].PropTypes.object; - RouteHooks[routeID] = [hook]; +/** + * The Lifecycle mixin adds the routerWillLeave lifecycle method to a + * component that may be used to cancel a transition or prompt the user + * for confirmation. + * + * On standard transitions, routerWillLeave receives a single argument: the + * location we're transitioning to. To cancel the transition, return false. + * To prompt the user for confirmation, return a prompt message (string). + * + * During the beforeunload event (assuming you're using the useBeforeUnload + * history enhancer), routerWillLeave does not receive a location object + * because it isn't possible for us to know the location we're transitioning + * to. In this case routerWillLeave must return a prompt message to prevent + * the user from closing the window/tab. + */ +var Lifecycle = { - if (thereWereNoRouteHooks) { - // setup transition & beforeunload hooks - unlistenBefore = history.listenBefore(transitionHook); + contextTypes: { + history: object.isRequired, + // Nested children receive the route as context, either + // set by the route component using the RouteContext mixin + // or by some other ancestor. + route: object + }, - if (history.listenBeforeUnload) unlistenBeforeUnload = history.listenBeforeUnload(beforeUnloadHook); - } - } else { - if (hooks.indexOf(hook) === -1) { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'adding multiple leave hooks for the same route is deprecated; manage multiple confirmations in your own code instead') : undefined; + propTypes: { + // Route components receive the route object as a prop. + route: object + }, - hooks.push(hook); - } - } + componentDidMount: function componentDidMount() { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'the `Lifecycle` mixin is deprecated, please use `context.router.setRouteLeaveHook(route, hook)`. http://tiny.cc/router-lifecyclemixin') : undefined; + !this.routerWillLeave ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'The Lifecycle mixin requires you to define a routerWillLeave method') : _invariant2['default'](false) : undefined; - return function () { - var hooks = RouteHooks[routeID]; + var route = this.props.route || this.context.route; - if (hooks) { - var newHooks = hooks.filter(function (item) { - return item !== hook; - }); + !route ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'The Lifecycle mixin must be used on either a) a or ' + 'b) a descendant of a that uses the RouteContext mixin') : _invariant2['default'](false) : undefined; - if (newHooks.length === 0) { - removeListenBeforeHooksForRoute(route); - } else { - RouteHooks[routeID] = newHooks; - } - } - }; - } + this._unlistenBeforeLeavingRoute = this.context.history.listenBeforeLeavingRoute(route, this.routerWillLeave); + }, - /** - * This is the API for stateful environments. As the location - * changes, we update state and call the listener. We can also - * gracefully handle errors and redirects. - */ - function listen(listener) { - // TODO: Only use a single history listener. Otherwise we'll - // end up with multiple concurrent calls to match. - return history.listen(function (location) { - if (state.location === location) { - listener(null, state); - } else { - match(location, function (error, redirectLocation, nextState) { - if (error) { - listener(error); - } else if (redirectLocation) { - history.transitionTo(redirectLocation); - } else if (nextState) { - listener(null, nextState); - } else { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'Location "%s" did not match any routes', location.pathname + location.search + location.hash) : undefined; - } - }); - } - }); + componentWillUnmount: function componentWillUnmount() { + if (this._unlistenBeforeLeavingRoute) this._unlistenBeforeLeavingRoute(); } - return { - isActive: isActive, - match: match, - listenBeforeLeavingRoute: listenBeforeLeavingRoute, - listen: listen - }; -} +}; -//export default useRoutes +exports['default'] = Lifecycle; module.exports = exports['default']; }).call(this,require('_process')) -},{"./TransitionUtils":21,"./computeChangedRoutes":23,"./getComponents":28,"./isActive":31,"./matchRoutes":33,"./routerWarning":34,"_process":1,"history/lib/Actions":37}],27:[function(require,module,exports){ +},{"./routerWarning":55,"_process":23,"invariant":22,"react":"react"}],31:[function(require,module,exports){ (function (process){ -/*eslint no-empty: 0*/ 'use strict'; exports.__esModule = true; -exports['default'] = deprecateObjectProperties; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var _routerWarning = require('./routerWarning'); -var _routerWarning2 = _interopRequireDefault(_routerWarning); +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 useMembrane = false; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -if (process.env.NODE_ENV !== 'production') { - try { - if (Object.defineProperty({}, 'x', { get: function get() { - return true; - } }).x) { - useMembrane = true; - } - } catch (e) {} -} +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; } -// wraps an object in a membrane to warn about deprecated property access +var _react = require('react'); -function deprecateObjectProperties(object, message) { - if (!useMembrane) return object; +var _react2 = _interopRequireDefault(_react); - var membrane = {}; +var _routerWarning = require('./routerWarning'); - var _loop = function (prop) { - if (typeof object[prop] === 'function') { - membrane[prop] = function () { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, message) : undefined; - return object[prop].apply(object, arguments); - }; - } else { - Object.defineProperty(membrane, prop, { - configurable: false, - enumerable: false, - get: function get() { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, message) : undefined; - return object[prop]; - } - }); - } - }; +var _routerWarning2 = _interopRequireDefault(_routerWarning); - for (var prop in object) { - _loop(prop); - } +var _React$PropTypes = _react2['default'].PropTypes; +var bool = _React$PropTypes.bool; +var object = _React$PropTypes.object; +var string = _React$PropTypes.string; +var func = _React$PropTypes.func; +var oneOfType = _React$PropTypes.oneOfType; - return membrane; +function isLeftClickEvent(event) { + return event.button === 0; } -module.exports = exports['default']; -}).call(this,require('_process')) - -},{"./routerWarning":34,"_process":1}],28:[function(require,module,exports){ -'use strict'; +function isModifiedEvent(event) { + return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); +} -exports.__esModule = true; +function isEmptyObject(object) { + for (var p in object) { + if (object.hasOwnProperty(p)) return false; + }return true; +} -var _AsyncUtils = require('./AsyncUtils'); +function createLocationDescriptor(to, _ref) { + var query = _ref.query; + var hash = _ref.hash; + var state = _ref.state; -function getComponentsForRoute(location, route, callback) { - if (route.component || route.components) { - callback(null, route.component || route.components); - } else if (route.getComponent) { - route.getComponent(location, callback); - } else if (route.getComponents) { - route.getComponents(location, callback); - } else { - callback(); + if (query || hash || state) { + return { pathname: to, query: query, hash: hash, state: state }; } + + return to; } /** - * Asynchronously fetches all components needed for the given router - * state and calls callback(error, components) when finished. + * A is used to create an element that links to a route. + * When that route is active, the link gets the value of its + * activeClassName prop. * - * Note: This operation may finish synchronously if no routes have an - * asynchronous getComponents method. + * For example, assuming you have the following route: + * + * + * + * You could use the following component to link to that route: + * + * + * + * Links may pass along location state and/or query string parameters + * in the state/query props, respectively. + * + * */ -function getComponents(nextState, callback) { - _AsyncUtils.mapAsync(nextState.routes, function (route, index, callback) { - getComponentsForRoute(nextState.location, route, callback); - }, callback); -} - -exports['default'] = getComponents; -module.exports = exports['default']; -},{"./AsyncUtils":4}],29:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; +var Link = _react2['default'].createClass({ + displayName: 'Link', -var _PatternUtils = require('./PatternUtils'); + contextTypes: { + router: object + }, -/** - * Extracts an object of params the given route cares about from - * the given params object. - */ -function getRouteParams(route, params) { - var routeParams = {}; + propTypes: { + to: oneOfType([string, object]).isRequired, + query: object, + hash: string, + state: object, + activeStyle: object, + activeClassName: string, + onlyActiveOnIndex: bool.isRequired, + onClick: func + }, - if (!route.path) return routeParams; + getDefaultProps: function getDefaultProps() { + return { + onlyActiveOnIndex: false, + className: '', + style: {} + }; + }, - var paramNames = _PatternUtils.getParamNames(route.path); + handleClick: function handleClick(event) { + var allowTransition = true; - for (var p in params) { - if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p]; - }return routeParams; -} + if (this.props.onClick) this.props.onClick(event); -exports['default'] = getRouteParams; -module.exports = exports['default']; -},{"./PatternUtils":11}],30:[function(require,module,exports){ -'use strict'; + if (isModifiedEvent(event) || !isLeftClickEvent(event)) return; -exports.__esModule = true; + if (event.defaultPrevented === true) allowTransition = false; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + // If target prop is set (e.g. to "_blank") let browser handle link. + /* istanbul ignore if: untestable with Karma */ + if (this.props.target) { + if (!allowTransition) event.preventDefault(); -var _historyLibCreateHashHistory = require('history/lib/createHashHistory'); + return; + } -var _historyLibCreateHashHistory2 = _interopRequireDefault(_historyLibCreateHashHistory); + event.preventDefault(); -var _createRouterHistory = require('./createRouterHistory'); + if (allowTransition) { + var _props = this.props; + var to = _props.to; + var query = _props.query; + var hash = _props.hash; + var state = _props.state; -var _createRouterHistory2 = _interopRequireDefault(_createRouterHistory); + var _location = createLocationDescriptor(to, { query: query, hash: hash, state: state }); -exports['default'] = _createRouterHistory2['default'](_historyLibCreateHashHistory2['default']); -module.exports = exports['default']; -},{"./createRouterHistory":25,"history/lib/createHashHistory":45}],31:[function(require,module,exports){ -'use strict'; + this.context.router.push(_location); + } + }, -exports.__esModule = true; -exports['default'] = isActive; + render: function render() { + var _props2 = this.props; + var to = _props2.to; + var query = _props2.query; + var hash = _props2.hash; + var state = _props2.state; + var activeClassName = _props2.activeClassName; + var activeStyle = _props2.activeStyle; + var onlyActiveOnIndex = _props2.onlyActiveOnIndex; -var _PatternUtils = require('./PatternUtils'); + var props = _objectWithoutProperties(_props2, ['to', 'query', 'hash', 'state', 'activeClassName', 'activeStyle', 'onlyActiveOnIndex']); -function deepEqual(a, b) { - if (a == b) return true; + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](!(query || hash || state), 'the `query`, `hash`, and `state` props on `` are deprecated, use `. http://tiny.cc/router-isActivedeprecated') : undefined; - if (a == null || b == null) return false; + // Ignore if rendered outside the context of router, simplifies unit testing. + var router = this.context.router; - if (Array.isArray(a)) { - return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { - return deepEqual(item, b[index]); - }); - } + if (router) { + var _location2 = createLocationDescriptor(to, { query: query, hash: hash, state: state }); + props.href = router.createHref(_location2); - if (typeof a === 'object') { - for (var p in a) { - if (!a.hasOwnProperty(p)) { - continue; - } + if (activeClassName || activeStyle != null && !isEmptyObject(activeStyle)) { + if (router.isActive(_location2, onlyActiveOnIndex)) { + if (activeClassName) props.className += props.className === '' ? activeClassName : ' ' + activeClassName; - if (a[p] === undefined) { - if (b[p] !== undefined) { - return false; + if (activeStyle) props.style = _extends({}, props.style, activeStyle); } - } else if (!b.hasOwnProperty(p)) { - return false; - } else if (!deepEqual(a[p], b[p])) { - return false; } } - return true; + return _react2['default'].createElement('a', _extends({}, props, { onClick: this.handleClick })); } - return String(a) === String(b); -} +}); -function paramsAreActive(paramNames, paramValues, activeParams) { - // FIXME: This doesn't work on repeated params in activeParams. - return paramNames.every(function (paramName, index) { - return String(paramValues[index]) === String(activeParams[paramName]); - }); -} +exports['default'] = Link; +module.exports = exports['default']; +}).call(this,require('_process')) -function getMatchingRouteIndex(pathname, activeRoutes, activeParams) { - var remainingPathname = pathname, - paramNames = [], - paramValues = []; +},{"./routerWarning":55,"_process":23,"react":"react"}],32:[function(require,module,exports){ +(function (process){ +'use strict'; - for (var i = 0, len = activeRoutes.length; i < len; ++i) { - var route = activeRoutes[i]; - var pattern = route.path || ''; +exports.__esModule = true; +exports.compilePattern = compilePattern; +exports.matchPattern = matchPattern; +exports.getParamNames = getParamNames; +exports.getParams = getParams; +exports.formatPattern = formatPattern; - if (pattern.charAt(0) === '/') { - remainingPathname = pathname; - paramNames = []; - paramValues = []; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - if (remainingPathname !== null) { - var matched = _PatternUtils.matchPattern(pattern, remainingPathname); - remainingPathname = matched.remainingPathname; - paramNames = [].concat(paramNames, matched.paramNames); - paramValues = [].concat(paramValues, matched.paramValues); - } +var _invariant = require('invariant'); - if (remainingPathname === '' && route.path && paramsAreActive(paramNames, paramValues, activeParams)) return i; - } +var _invariant2 = _interopRequireDefault(_invariant); - return null; +function escapeRegExp(string) { + return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } -/** - * Returns true if the given pathname matches the active routes - * and params. - */ -function routeIsActive(pathname, routes, params, indexOnly) { - var i = getMatchingRouteIndex(pathname, routes, params); - - if (i === null) { - // No match. - return false; - } else if (!indexOnly) { - // Any match is good enough. - return true; - } - - // If any remaining routes past the match index have paths, then we can't - // be on the index route. - return routes.slice(i + 1).every(function (route) { - return !route.path; - }); +function escapeSource(string) { + return escapeRegExp(string).replace(/\/+/g, '/+'); } -/** - * Returns true if all key/value pairs in the given query are - * currently active. - */ -function queryIsActive(query, activeQuery) { - if (activeQuery == null) return query == null; - - if (query == null) return true; +function _compilePattern(pattern) { + var regexpSource = ''; + var paramNames = []; + var tokens = []; - return deepEqual(query, activeQuery); -} + var match = undefined, + lastIndex = 0, + matcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*\*|\*|\(|\)/g; + while (match = matcher.exec(pattern)) { + if (match.index !== lastIndex) { + tokens.push(pattern.slice(lastIndex, match.index)); + regexpSource += escapeSource(pattern.slice(lastIndex, match.index)); + } -/** - * Returns true if a to the given pathname/query combination is - * currently active. - */ + if (match[1]) { + regexpSource += '([^/?#]+)'; + paramNames.push(match[1]); + } else if (match[0] === '**') { + regexpSource += '([\\s\\S]*)'; + paramNames.push('splat'); + } else if (match[0] === '*') { + regexpSource += '([\\s\\S]*?)'; + paramNames.push('splat'); + } else if (match[0] === '(') { + regexpSource += '(?:'; + } else if (match[0] === ')') { + regexpSource += ')?'; + } -function isActive(_ref, indexOnly, currentLocation, routes, params) { - var pathname = _ref.pathname; - var query = _ref.query; + tokens.push(match[0]); - if (currentLocation == null) return false; + lastIndex = matcher.lastIndex; + } - if (!routeIsActive(pathname, routes, params, indexOnly)) return false; + if (lastIndex !== pattern.length) { + tokens.push(pattern.slice(lastIndex, pattern.length)); + regexpSource += escapeSource(pattern.slice(lastIndex, pattern.length)); + } - return queryIsActive(query, currentLocation.query); + return { + pattern: pattern, + regexpSource: regexpSource, + paramNames: paramNames, + tokens: tokens + }; } -module.exports = exports['default']; -},{"./PatternUtils":11}],32:[function(require,module,exports){ -(function (process){ -'use strict'; +var CompiledPatternsCache = {}; -exports.__esModule = true; +function compilePattern(pattern) { + if (!(pattern in CompiledPatternsCache)) CompiledPatternsCache[pattern] = _compilePattern(pattern); -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; }; + return CompiledPatternsCache[pattern]; +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +/** + * Attempts to match a pattern on the given pathname. Patterns may use + * the following special characters: + * + * - :paramName Matches a URL segment up to the next /, ?, or #. The + * captured string is considered a "param" + * - () Wraps a segment of the URL that is optional + * - * Consumes (non-greedy) all characters up to the next + * character in the pattern, or to the end of the URL if + * there is none + * - ** Consumes (greedy) all characters up to the next character + * in the pattern, or to the end of the URL if there is none + * + * The return value is an object with the following properties: + * + * - remainingPathname + * - paramNames + * - paramValues + */ -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; } +function matchPattern(pattern, pathname) { + // Make leading slashes consistent between pattern and pathname. + if (pattern.charAt(0) !== '/') { + pattern = '/' + pattern; + } + if (pathname.charAt(0) !== '/') { + pathname = '/' + pathname; + } -var _invariant = require('invariant'); + var _compilePattern2 = compilePattern(pattern); -var _invariant2 = _interopRequireDefault(_invariant); + var regexpSource = _compilePattern2.regexpSource; + var paramNames = _compilePattern2.paramNames; + var tokens = _compilePattern2.tokens; -var _createMemoryHistory = require('./createMemoryHistory'); + regexpSource += '/*'; // Capture path separators -var _createMemoryHistory2 = _interopRequireDefault(_createMemoryHistory); + // Special-case patterns like '*' for catch-all routes. + var captureRemaining = tokens[tokens.length - 1] !== '*'; -var _createTransitionManager = require('./createTransitionManager'); + if (captureRemaining) { + // This will match newlines in the remaining path. + regexpSource += '([\\s\\S]*?)'; + } -var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); + var match = pathname.match(new RegExp('^' + regexpSource + '$', 'i')); -var _RouteUtils = require('./RouteUtils'); + var remainingPathname = undefined, + paramValues = undefined; + if (match != null) { + if (captureRemaining) { + remainingPathname = match.pop(); + var matchedPath = match[0].substr(0, match[0].length - remainingPathname.length); -var _RouterUtils = require('./RouterUtils'); + // If we didn't match the entire pathname, then make sure that the match + // we did get ends at a path separator (potentially the one we added + // above at the beginning of the path, if the actual match was empty). + if (remainingPathname && matchedPath.charAt(matchedPath.length - 1) !== '/') { + return { + remainingPathname: null, + paramNames: paramNames, + paramValues: null + }; + } + } else { + // If this matched at all, then the match was the entire pathname. + remainingPathname = ''; + } -/** - * A high-level API to be used for server-side rendering. - * - * This function matches a location to a set of routes and calls - * callback(error, redirectLocation, renderProps) when finished. - * - * Note: You probably don't want to use this in a browser unless you're using - * server-side rendering with async routes. - */ -function match(_ref, callback) { - var history = _ref.history; - var routes = _ref.routes; - var location = _ref.location; + paramValues = match.slice(1).map(function (v) { + return v != null ? decodeURIComponent(v) : v; + }); + } else { + remainingPathname = paramValues = null; + } - var options = _objectWithoutProperties(_ref, ['history', 'routes', 'location']); + return { + remainingPathname: remainingPathname, + paramNames: paramNames, + paramValues: paramValues + }; +} - !(history || location) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'match needs a history or a location') : _invariant2['default'](false) : undefined; +function getParamNames(pattern) { + return compilePattern(pattern).paramNames; +} - history = history ? history : _createMemoryHistory2['default'](options); - var transitionManager = _createTransitionManager2['default'](history, _RouteUtils.createRoutes(routes)); +function getParams(pattern, pathname) { + var _matchPattern = matchPattern(pattern, pathname); - var unlisten = undefined; + var paramNames = _matchPattern.paramNames; + var paramValues = _matchPattern.paramValues; - if (location) { - // Allow match({ location: '/the/path', ... }) - location = history.createLocation(location); - } else { - // Pick up the location from the history via synchronous history.listen - // call if needed. - unlisten = history.listen(function (historyLocation) { - location = historyLocation; - }); + if (paramValues != null) { + return paramNames.reduce(function (memo, paramName, index) { + memo[paramName] = paramValues[index]; + return memo; + }, {}); } - var router = _RouterUtils.createRouterObject(history, transitionManager); - history = _RouterUtils.createRoutingHistory(history, transitionManager); - - transitionManager.match(location, function (error, redirectLocation, nextState) { - callback(error, redirectLocation, nextState && _extends({}, nextState, { - history: history, - router: router, - matchContext: { history: history, transitionManager: transitionManager, router: router } - })); - - // Defer removing the listener to here to prevent DOM histories from having - // to unwind DOM event listeners unnecessarily, in case callback renders a - // and attaches another history listener. - if (unlisten) { - unlisten(); - } - }); + return null; } -exports['default'] = match; -module.exports = exports['default']; -}).call(this,require('_process')) +/** + * Returns a version of the given pattern with params interpolated. Throws + * if there is a dynamic segment of the pattern for which there is no param. + */ -},{"./RouteUtils":16,"./RouterUtils":19,"./createMemoryHistory":24,"./createTransitionManager":26,"_process":1,"invariant":58}],33:[function(require,module,exports){ -(function (process){ -'use strict'; +function formatPattern(pattern, params) { + params = params || {}; -exports.__esModule = true; + var _compilePattern3 = compilePattern(pattern); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + var tokens = _compilePattern3.tokens; -var _routerWarning = require('./routerWarning'); + var parenCount = 0, + pathname = '', + splatIndex = 0; -var _routerWarning2 = _interopRequireDefault(_routerWarning); + var token = undefined, + paramName = undefined, + paramValue = undefined; + for (var i = 0, len = tokens.length; i < len; ++i) { + token = tokens[i]; -var _AsyncUtils = require('./AsyncUtils'); + if (token === '*' || token === '**') { + paramValue = Array.isArray(params.splat) ? params.splat[splatIndex++] : params.splat; -var _PatternUtils = require('./PatternUtils'); + !(paramValue != null || parenCount > 0) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Missing splat #%s for path "%s"', splatIndex, pattern) : _invariant2['default'](false) : undefined; -var _RouteUtils = require('./RouteUtils'); + if (paramValue != null) pathname += encodeURI(paramValue); + } else if (token === '(') { + parenCount += 1; + } else if (token === ')') { + parenCount -= 1; + } else if (token.charAt(0) === ':') { + paramName = token.substring(1); + paramValue = params[paramName]; -function getChildRoutes(route, location, callback) { - if (route.childRoutes) { - return [null, route.childRoutes]; - } - if (!route.getChildRoutes) { - return []; + !(paramValue != null || parenCount > 0) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Missing "%s" parameter for path "%s"', paramName, pattern) : _invariant2['default'](false) : undefined; + + if (paramValue != null) pathname += encodeURIComponent(paramValue); + } else { + pathname += token; + } } - var sync = true, - result = undefined; + return pathname.replace(/\/+/g, '/'); +} +}).call(this,require('_process')) - route.getChildRoutes(location, function (error, childRoutes) { - childRoutes = !error && _RouteUtils.createRoutes(childRoutes); - if (sync) { - result = [error, childRoutes]; - return; - } +},{"_process":23,"invariant":22}],33:[function(require,module,exports){ +'use strict'; - callback(error, childRoutes); - }); +exports.__esModule = true; +exports.falsy = falsy; - sync = false; - return result; // Might be undefined. -} +var _react = require('react'); -function getIndexRoute(route, location, callback) { - if (route.indexRoute) { - callback(null, route.indexRoute); - } else if (route.getIndexRoute) { - route.getIndexRoute(location, function (error, indexRoute) { - callback(error, !error && _RouteUtils.createRoutes(indexRoute)[0]); - }); - } else if (route.childRoutes) { - (function () { - var pathless = route.childRoutes.filter(function (obj) { - return !obj.hasOwnProperty('path'); - }); +var func = _react.PropTypes.func; +var object = _react.PropTypes.object; +var arrayOf = _react.PropTypes.arrayOf; +var oneOfType = _react.PropTypes.oneOfType; +var element = _react.PropTypes.element; +var shape = _react.PropTypes.shape; +var string = _react.PropTypes.string; - _AsyncUtils.loopAsync(pathless.length, function (index, next, done) { - getIndexRoute(pathless[index], location, function (error, indexRoute) { - if (error || indexRoute) { - var routes = [pathless[index]].concat(Array.isArray(indexRoute) ? indexRoute : [indexRoute]); - done(error, routes); - } else { - next(); - } - }); - }, function (err, routes) { - callback(null, routes); - }); - })(); - } else { - callback(); - } +function falsy(props, propName, componentName) { + if (props[propName]) return new Error('<' + componentName + '> should not have a "' + propName + '" prop'); } -function assignParams(params, paramNames, paramValues) { - return paramNames.reduce(function (params, paramName, index) { - var paramValue = paramValues && paramValues[index]; +var history = shape({ + listen: func.isRequired, + pushState: func.isRequired, + replaceState: func.isRequired, + go: func.isRequired +}); - if (Array.isArray(params[paramName])) { - params[paramName].push(paramValue); - } else if (paramName in params) { - params[paramName] = [params[paramName], paramValue]; - } else { - params[paramName] = paramValue; - } +exports.history = history; +var location = shape({ + pathname: string.isRequired, + search: string.isRequired, + state: object, + action: string.isRequired, + key: string +}); - return params; - }, params); -} +exports.location = location; +var component = oneOfType([func, string]); +exports.component = component; +var components = oneOfType([component, object]); +exports.components = components; +var route = oneOfType([object, element]); +exports.route = route; +var routes = oneOfType([route, arrayOf(route)]); -function createParams(paramNames, paramValues) { - return assignParams({}, paramNames, paramValues); -} +exports.routes = routes; +exports['default'] = { + falsy: falsy, + history: history, + location: location, + component: component, + components: components, + route: route +}; +},{"react":"react"}],34:[function(require,module,exports){ +(function (process){ +'use strict'; -function matchRouteDeep(route, location, remainingPathname, paramNames, paramValues, callback) { - var pattern = route.path || ''; +exports.__esModule = true; - if (pattern.charAt(0) === '/') { - remainingPathname = location.pathname; - paramNames = []; - paramValues = []; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - if (remainingPathname !== null) { - var matched = _PatternUtils.matchPattern(pattern, remainingPathname); - remainingPathname = matched.remainingPathname; - paramNames = [].concat(paramNames, matched.paramNames); - paramValues = [].concat(paramValues, matched.paramValues); +var _react = require('react'); - if (remainingPathname === '' && route.path) { - var _ret2 = (function () { - var match = { - routes: [route], - params: createParams(paramNames, paramValues) - }; +var _react2 = _interopRequireDefault(_react); - getIndexRoute(route, location, function (error, indexRoute) { - if (error) { - callback(error); - } else { - if (Array.isArray(indexRoute)) { - var _match$routes; +var _invariant = require('invariant'); - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](indexRoute.every(function (route) { - return !route.path; - }), 'Index routes should not have paths') : undefined; - (_match$routes = match.routes).push.apply(_match$routes, indexRoute); - } else if (indexRoute) { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](!indexRoute.path, 'Index routes should not have paths') : undefined; - match.routes.push(indexRoute); - } +var _invariant2 = _interopRequireDefault(_invariant); - callback(null, match); - } - }); - return { - v: undefined - }; - })(); +var _RouteUtils = require('./RouteUtils'); - if (typeof _ret2 === 'object') return _ret2.v; - } - } +var _PatternUtils = require('./PatternUtils'); - if (remainingPathname != null || route.childRoutes) { - // Either a) this route matched at least some of the path or b) - // we don't have to load this route's children asynchronously. In - // either case continue checking for matches in the subtree. - var onChildRoutes = function onChildRoutes(error, childRoutes) { - if (error) { - callback(error); - } else if (childRoutes) { - // Check the child routes to see if any of them match. - matchRoutes(childRoutes, location, function (error, match) { - if (error) { - callback(error); - } else if (match) { - // A child route matched! Augment the match and pass it up the stack. - match.routes.unshift(route); - callback(null, match); - } else { - callback(); - } - }, remainingPathname, paramNames, paramValues); - } else { - callback(); - } - }; +var _PropTypes = require('./PropTypes'); - var result = getChildRoutes(route, location, onChildRoutes); - if (result) { - onChildRoutes.apply(undefined, result); - } - } else { - callback(); - } -} +var _React$PropTypes = _react2['default'].PropTypes; +var string = _React$PropTypes.string; +var object = _React$PropTypes.object; /** - * Asynchronously matches the given location to a set of routes and calls - * callback(error, state) when finished. The state object will have the - * following properties: - * - * - routes An array of routes that matched, in hierarchical order - * - params An object of URL parameters + * A is used to declare another URL path a client should + * be sent to when they request a given URL. * - * Note: This operation may finish synchronously if no routes have an - * asynchronous getChildRoutes method. + * Redirects are placed alongside routes in the route configuration + * and are traversed in the same manner. */ -function matchRoutes(routes, location, callback) { - var remainingPathname = arguments.length <= 3 || arguments[3] === undefined ? location.pathname : arguments[3]; - var paramNames = arguments.length <= 4 || arguments[4] === undefined ? [] : arguments[4]; - var paramValues = arguments.length <= 5 || arguments[5] === undefined ? [] : arguments[5]; - return (function () { - _AsyncUtils.loopAsync(routes.length, function (index, next, done) { - matchRouteDeep(routes[index], location, remainingPathname, paramNames, paramValues, function (error, match) { - if (error || match) { - done(error, match); - } else { - next(); - } - }); - }, callback); - })(); -} - -exports['default'] = matchRoutes; -module.exports = exports['default']; -}).call(this,require('_process')) - -},{"./AsyncUtils":4,"./PatternUtils":11,"./RouteUtils":16,"./routerWarning":34,"_process":1}],34:[function(require,module,exports){ -(function (process){ -'use strict'; +var Redirect = _react2['default'].createClass({ + displayName: 'Redirect', -exports.__esModule = true; -exports['default'] = routerWarning; + statics: { -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + createRouteFromReactElement: function createRouteFromReactElement(element) { + var route = _RouteUtils.createRouteFromReactElement(element); -var _warning = require('warning'); + if (route.from) route.path = route.from; -var _warning2 = _interopRequireDefault(_warning); + route.onEnter = function (nextState, replace) { + var location = nextState.location; + var params = nextState.params; -function routerWarning(falseToWarn, message) { - message = '[react-router] ' + message; + var pathname = undefined; + if (route.to.charAt(0) === '/') { + pathname = _PatternUtils.formatPattern(route.to, params); + } else if (!route.to) { + pathname = location.pathname; + } else { + var routeIndex = nextState.routes.indexOf(route); + var parentPattern = Redirect.getRoutePattern(nextState.routes, routeIndex - 1); + var pattern = parentPattern.replace(/\/*$/, '/') + route.to; + pathname = _PatternUtils.formatPattern(pattern, params); + } - for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } + replace({ + pathname: pathname, + query: route.query || location.query, + state: route.state || location.state + }); + }; - process.env.NODE_ENV !== 'production' ? _warning2['default'].apply(undefined, [falseToWarn, message].concat(args)) : undefined; -} + return route; + }, -module.exports = exports['default']; -}).call(this,require('_process')) + getRoutePattern: function getRoutePattern(routes, routeIndex) { + var parentPattern = ''; -},{"_process":1,"warning":59}],35:[function(require,module,exports){ -'use strict'; + for (var i = routeIndex; i >= 0; i--) { + var route = routes[i]; + var pattern = route.path || ''; -exports.__esModule = true; -exports['default'] = useRouterHistory; + parentPattern = pattern.replace(/\/*$/, '/') + parentPattern; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + if (pattern.indexOf('/') === 0) break; + } -var _historyLibUseQueries = require('history/lib/useQueries'); + return '/' + parentPattern; + } -var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries); + }, -var _historyLibUseBasename = require('history/lib/useBasename'); + propTypes: { + path: string, + from: string, // Alias for path + to: string.isRequired, + query: object, + state: object, + onEnter: _PropTypes.falsy, + children: _PropTypes.falsy + }, -var _historyLibUseBasename2 = _interopRequireDefault(_historyLibUseBasename); + /* istanbul ignore next: sanity check */ + render: function render() { + !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, ' elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined; + } -function useRouterHistory(createHistory) { - return function (options) { - var history = _historyLibUseQueries2['default'](_historyLibUseBasename2['default'](createHistory))(options); - history.__v2_compatible__ = true; - return history; - }; -} +}); +exports['default'] = Redirect; module.exports = exports['default']; -},{"history/lib/useBasename":51,"history/lib/useQueries":52}],36:[function(require,module,exports){ +}).call(this,require('_process')) + +},{"./PatternUtils":32,"./PropTypes":33,"./RouteUtils":37,"_process":23,"invariant":22,"react":"react"}],35:[function(require,module,exports){ (function (process){ 'use strict'; exports.__esModule = 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; }; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -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 _historyLibUseQueries = require('history/lib/useQueries'); +var _react2 = _interopRequireDefault(_react); -var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries); +var _invariant = require('invariant'); -var _createTransitionManager = require('./createTransitionManager'); +var _invariant2 = _interopRequireDefault(_invariant); -var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); +var _RouteUtils = require('./RouteUtils'); -var _routerWarning = require('./routerWarning'); +var _PropTypes = require('./PropTypes'); -var _routerWarning2 = _interopRequireDefault(_routerWarning); +var _React$PropTypes = _react2['default'].PropTypes; +var string = _React$PropTypes.string; +var func = _React$PropTypes.func; /** - * Returns a new createHistory function that may be used to create - * history objects that know about routing. - * - * Enhances history objects with the following methods: + * A is used to declare which components are rendered to the + * page when the URL matches a given pattern. * - * - listen((error, nextState) => {}) - * - listenBeforeLeavingRoute(route, (nextLocation) => {}) - * - match(location, (error, redirectLocation, nextState) => {}) - * - isActive(pathname, query, indexOnly=false) + * Routes are arranged in a nested tree structure. When a new URL is + * requested, the tree is searched depth-first to find a route whose + * path matches the URL. When one is found, all routes in the tree + * that lead to it are considered "active" and their components are + * rendered into the DOM, nested in the same order as in the tree. */ -function useRoutes(createHistory) { - process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`useRoutes` is deprecated. Please use `createTransitionManager` instead.') : undefined; +var Route = _react2['default'].createClass({ + displayName: 'Route', - return function () { - var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + statics: { + createRouteFromReactElement: _RouteUtils.createRouteFromReactElement + }, - var routes = _ref.routes; + propTypes: { + path: string, + component: _PropTypes.component, + components: _PropTypes.components, + getComponent: func, + getComponents: func + }, - var options = _objectWithoutProperties(_ref, ['routes']); + /* istanbul ignore next: sanity check */ + render: function render() { + !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, ' elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined; + } - var history = _historyLibUseQueries2['default'](createHistory)(options); - var transitionManager = _createTransitionManager2['default'](history, routes); - return _extends({}, history, transitionManager); - }; -} +}); -exports['default'] = useRoutes; +exports['default'] = Route; module.exports = exports['default']; }).call(this,require('_process')) -},{"./createTransitionManager":26,"./routerWarning":34,"_process":1,"history/lib/useQueries":52}],37:[function(require,module,exports){ -/** - * Indicates that navigation was caused by a call to history.push. - */ -'use strict'; - -exports.__esModule = true; -var PUSH = 'PUSH'; - -exports.PUSH = PUSH; -/** - * Indicates that navigation was caused by a call to history.replace. - */ -var REPLACE = 'REPLACE'; - -exports.REPLACE = REPLACE; -/** - * Indicates that navigation was caused by some other action such - * as using a browser's back/forward buttons and/or manually manipulating - * the URL in a browser's location bar. This is the default. - * - * See https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate - * for more information. - */ -var POP = 'POP'; - -exports.POP = POP; -exports['default'] = { - PUSH: PUSH, - REPLACE: REPLACE, - POP: POP -}; -},{}],38:[function(require,module,exports){ -"use strict"; - -exports.__esModule = true; -exports.loopAsync = loopAsync; - -function loopAsync(turns, work, callback) { - var currentTurn = 0; - var isDone = false; - - function done() { - isDone = true; - callback.apply(this, arguments); - } - - function next() { - if (isDone) return; - - if (currentTurn < turns) { - work.call(this, currentTurn++, next, done); - } else { - done.apply(this, arguments); - } - } - - next(); -} -},{}],39:[function(require,module,exports){ +},{"./PropTypes":33,"./RouteUtils":37,"_process":23,"invariant":22,"react":"react"}],36:[function(require,module,exports){ (function (process){ -/*eslint-disable no-empty */ 'use strict'; exports.__esModule = true; -exports.saveState = saveState; -exports.readState = readState; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _warning = require('warning'); - -var _warning2 = _interopRequireDefault(_warning); - -var KeyPrefix = '@@History/'; -var QuotaExceededErrors = ['QuotaExceededError', 'QUOTA_EXCEEDED_ERR']; +var _routerWarning = require('./routerWarning'); -var SecurityError = 'SecurityError'; +var _routerWarning2 = _interopRequireDefault(_routerWarning); -function createKey(key) { - return KeyPrefix + key; -} +var _react = require('react'); -function saveState(key, state) { - try { - if (state == null) { - window.sessionStorage.removeItem(createKey(key)); - } else { - window.sessionStorage.setItem(createKey(key), JSON.stringify(state)); - } - } catch (error) { - if (error.name === SecurityError) { - // Blocking cookies in Chrome/Firefox/Safari throws SecurityError on any - // attempt to access window.sessionStorage. - process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '[history] Unable to save state; sessionStorage is not available due to security settings') : undefined; +var _react2 = _interopRequireDefault(_react); - return; - } +var object = _react2['default'].PropTypes.object; - if (QuotaExceededErrors.indexOf(error.name) >= 0 && window.sessionStorage.length === 0) { - // Safari "private mode" throws QuotaExceededError. - process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '[history] Unable to save state; sessionStorage is not available in Safari private mode') : undefined; +/** + * The RouteContext mixin provides a convenient way for route + * components to set the route in context. This is needed for + * routes that render elements that want to use the Lifecycle + * mixin to prevent transitions. + */ +var RouteContext = { - return; - } + propTypes: { + route: object.isRequired + }, - throw error; - } -} + childContextTypes: { + route: object.isRequired + }, -function readState(key) { - var json = undefined; - try { - json = window.sessionStorage.getItem(createKey(key)); - } catch (error) { - if (error.name === SecurityError) { - // Blocking cookies in Chrome/Firefox/Safari throws SecurityError on any - // attempt to access window.sessionStorage. - process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '[history] Unable to read state; sessionStorage is not available due to security settings') : undefined; + getChildContext: function getChildContext() { + return { + route: this.props.route + }; + }, - return null; - } + componentWillMount: function componentWillMount() { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'The `RouteContext` mixin is deprecated. You can provide `this.props.route` on context with your own `contextTypes`. http://tiny.cc/router-routecontextmixin') : undefined; } - if (json) { - try { - return JSON.parse(json); - } catch (error) { - // Ignore invalid JSON. - } - } +}; - return null; -} +exports['default'] = RouteContext; +module.exports = exports['default']; }).call(this,require('_process')) -},{"_process":1,"warning":59}],40:[function(require,module,exports){ +},{"./routerWarning":55,"_process":23,"react":"react"}],37:[function(require,module,exports){ +(function (process){ 'use strict'; exports.__esModule = true; -exports.addEventListener = addEventListener; -exports.removeEventListener = removeEventListener; -exports.getHashPath = getHashPath; -exports.replaceHashPath = replaceHashPath; -exports.getWindowPath = getWindowPath; -exports.go = go; -exports.getUserConfirmation = getUserConfirmation; -exports.supportsHistory = supportsHistory; -exports.supportsGoWithoutReloadUsingHash = supportsGoWithoutReloadUsingHash; -function addEventListener(node, event, listener) { - if (node.addEventListener) { - node.addEventListener(event, listener, false); - } else { - node.attachEvent('on' + event, listener); - } -} +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 removeEventListener(node, event, listener) { - if (node.removeEventListener) { - node.removeEventListener(event, listener, false); - } else { - node.detachEvent('on' + event, listener); - } -} +exports.isReactChildren = isReactChildren; +exports.createRouteFromReactElement = createRouteFromReactElement; +exports.createRoutesFromReactChildren = createRoutesFromReactChildren; +exports.createRoutes = createRoutes; -function getHashPath() { - // We can't use window.location.hash here because it's not - // consistent across browsers - Firefox will pre-decode it! - return window.location.href.split('#')[1] || ''; -} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -function replaceHashPath(path) { - window.location.replace(window.location.pathname + window.location.search + '#' + path); -} +var _react = require('react'); -function getWindowPath() { - return window.location.pathname + window.location.search + window.location.hash; -} +var _react2 = _interopRequireDefault(_react); -function go(n) { - if (n) window.history.go(n); +var _routerWarning = require('./routerWarning'); + +var _routerWarning2 = _interopRequireDefault(_routerWarning); + +function isValidChild(object) { + return object == null || _react2['default'].isValidElement(object); } -function getUserConfirmation(message, callback) { - callback(window.confirm(message)); +function isReactChildren(object) { + return isValidChild(object) || Array.isArray(object) && object.every(isValidChild); } -/** - * Returns true if the HTML5 history API is supported. Taken from Modernizr. - * - * https://github.com/Modernizr/Modernizr/blob/master/LICENSE - * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js - * changed to avoid false negatives for Windows Phones: https://github.com/rackt/react-router/issues/586 - */ +function checkPropTypes(componentName, propTypes, props) { + componentName = componentName || 'UnknownComponent'; -function supportsHistory() { - var ua = navigator.userAgent; - if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) { - return false; + for (var propName in propTypes) { + if (propTypes.hasOwnProperty(propName)) { + var error = propTypes[propName](props, propName, componentName); + + /* istanbul ignore if: error logging */ + if (error instanceof Error) process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, error.message) : undefined; + } } - return window.history && 'pushState' in window.history; } -/** - * Returns false if using go(n) with hash history causes a full page reload. - */ - -function supportsGoWithoutReloadUsingHash() { - var ua = navigator.userAgent; - return ua.indexOf('Firefox') === -1; +function createRoute(defaultProps, props) { + return _extends({}, defaultProps, props); } -},{}],41:[function(require,module,exports){ -'use strict'; -exports.__esModule = true; -var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); -exports.canUseDOM = canUseDOM; -},{}],42:[function(require,module,exports){ -(function (process){ -'use strict'; +function createRouteFromReactElement(element) { + var type = element.type; + var route = createRoute(type.defaultProps, element.props); -exports.__esModule = true; -exports.extractPath = extractPath; -exports.parsePath = parsePath; + if (type.propTypes) checkPropTypes(type.displayName || type.name, type.propTypes, route); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + if (route.children) { + var childRoutes = createRoutesFromReactChildren(route.children, route); -var _warning = require('warning'); + if (childRoutes.length) route.childRoutes = childRoutes; -var _warning2 = _interopRequireDefault(_warning); + delete route.children; + } -function extractPath(string) { - var match = string.match(/^https?:\/\/[^\/]*/); + return route; +} - if (match == null) return string; +/** + * Creates and returns a routes object from the given ReactChildren. JSX + * provides a convenient way to visualize how routes in the hierarchy are + * nested. + * + * import { Route, createRoutesFromReactChildren } from 'react-router' + * + * const routes = createRoutesFromReactChildren( + * + * + * + * + * ) + * + * Note: This method is automatically used when you provide children + * to a component. + */ - return string.substring(match[0].length); -} +function createRoutesFromReactChildren(children, parentRoute) { + var routes = []; -function parsePath(path) { - var pathname = extractPath(path); - var search = ''; - var hash = ''; + _react2['default'].Children.forEach(children, function (element) { + if (_react2['default'].isValidElement(element)) { + // Component classes may have a static create* method. + if (element.type.createRouteFromReactElement) { + var route = element.type.createRouteFromReactElement(element, parentRoute); - process.env.NODE_ENV !== 'production' ? _warning2['default'](path === pathname, 'A path must be pathname + search + hash only, not a fully qualified URL like "%s"', path) : undefined; + if (route) routes.push(route); + } else { + routes.push(createRouteFromReactElement(element)); + } + } + }); - var hashIndex = pathname.indexOf('#'); - if (hashIndex !== -1) { - hash = pathname.substring(hashIndex); - pathname = pathname.substring(0, hashIndex); - } + return routes; +} - var searchIndex = pathname.indexOf('?'); - if (searchIndex !== -1) { - search = pathname.substring(searchIndex); - pathname = pathname.substring(0, searchIndex); - } +/** + * Creates and returns an array of routes from the given object which + * may be a JSX route, a plain object route, or an array of either. + */ - if (pathname === '') pathname = '/'; +function createRoutes(routes) { + if (isReactChildren(routes)) { + routes = createRoutesFromReactChildren(routes); + } else if (routes && !Array.isArray(routes)) { + routes = [routes]; + } - return { - pathname: pathname, - search: search, - hash: hash - }; + return routes; } }).call(this,require('_process')) -},{"_process":1,"warning":59}],43:[function(require,module,exports){ +},{"./routerWarning":55,"_process":23,"react":"react"}],38:[function(require,module,exports){ (function (process){ 'use strict'; @@ -3440,177 +3412,211 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _invariant = require('invariant'); - -var _invariant2 = _interopRequireDefault(_invariant); +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 _Actions = require('./Actions'); +var _historyLibCreateHashHistory = require('history/lib/createHashHistory'); -var _PathUtils = require('./PathUtils'); +var _historyLibCreateHashHistory2 = _interopRequireDefault(_historyLibCreateHashHistory); -var _ExecutionEnvironment = require('./ExecutionEnvironment'); +var _historyLibUseQueries = require('history/lib/useQueries'); -var _DOMUtils = require('./DOMUtils'); +var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries); -var _DOMStateStorage = require('./DOMStateStorage'); +var _react = require('react'); -var _createDOMHistory = require('./createDOMHistory'); +var _react2 = _interopRequireDefault(_react); -var _createDOMHistory2 = _interopRequireDefault(_createDOMHistory); +var _createTransitionManager = require('./createTransitionManager'); -/** - * Creates and returns a history object that uses HTML5's history API - * (pushState, replaceState, and the popstate event) to manage history. - * This is the recommended method of managing history in browsers because - * it provides the cleanest URLs. - * - * Note: In browsers that do not support the HTML5 history API full - * page reloads will be used to preserve URLs. - */ -function createBrowserHistory() { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; +var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); - !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined; +var _PropTypes = require('./PropTypes'); - var forceRefresh = options.forceRefresh; +var _RouterContext = require('./RouterContext'); - var isSupported = _DOMUtils.supportsHistory(); - var useRefresh = !isSupported || forceRefresh; +var _RouterContext2 = _interopRequireDefault(_RouterContext); - function getCurrentLocation(historyState) { - historyState = historyState || window.history.state || {}; +var _RouteUtils = require('./RouteUtils'); - var path = _DOMUtils.getWindowPath(); - var _historyState = historyState; - var key = _historyState.key; +var _RouterUtils = require('./RouterUtils'); - var state = undefined; - if (key) { - state = _DOMStateStorage.readState(key); - } else { - state = null; - key = history.createKey(); +var _routerWarning = require('./routerWarning'); - if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path); - } +var _routerWarning2 = _interopRequireDefault(_routerWarning); - var location = _PathUtils.parsePath(path); +function isDeprecatedHistory(history) { + return !history || !history.__v2_compatible__; +} - return history.createLocation(_extends({}, location, { state: state }), undefined, key); - } +var _React$PropTypes = _react2['default'].PropTypes; +var func = _React$PropTypes.func; +var object = _React$PropTypes.object; - function startPopStateListener(_ref) { - var transitionTo = _ref.transitionTo; +/** + * A is a high-level API for automatically setting up + * a router that renders a with all the props + * it needs each time the URL changes. + */ +var Router = _react2['default'].createClass({ + displayName: 'Router', - function popStateListener(event) { - if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit. + propTypes: { + history: object, + children: _PropTypes.routes, + routes: _PropTypes.routes, // alias for children + render: func, + createElement: func, + onError: func, + onUpdate: func, - transitionTo(getCurrentLocation(event.state)); - } + // PRIVATE: For client-side rehydration of server match. + matchContext: object + }, - _DOMUtils.addEventListener(window, 'popstate', popStateListener); + getDefaultProps: function getDefaultProps() { + return { + render: function render(props) { + return _react2['default'].createElement(_RouterContext2['default'], props); + } + }; + }, - return function () { - _DOMUtils.removeEventListener(window, 'popstate', popStateListener); + getInitialState: function getInitialState() { + return { + location: null, + routes: null, + params: null, + components: null }; - } + }, - function finishTransition(location) { - var basename = location.basename; - var pathname = location.pathname; - var search = location.search; - var hash = location.hash; - var state = location.state; - var action = location.action; - var key = location.key; + handleError: function handleError(error) { + if (this.props.onError) { + this.props.onError.call(this, error); + } else { + // Throw errors by default so we don't silently swallow them! + throw error; // This error probably occurred in getChildRoutes or getComponents. + } + }, - if (action === _Actions.POP) return; // Nothing to do. + componentWillMount: function componentWillMount() { + var _this = this; - _DOMStateStorage.saveState(key, state); + var _props = this.props; + var parseQueryString = _props.parseQueryString; + var stringifyQuery = _props.stringifyQuery; - var path = (basename || '') + pathname + search + hash; - var historyState = { - key: key - }; + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](!(parseQueryString || stringifyQuery), '`parseQueryString` and `stringifyQuery` are deprecated. Please create a custom history. http://tiny.cc/router-customquerystring') : undefined; - if (action === _Actions.PUSH) { - if (useRefresh) { - window.location.href = path; - return false; // Prevent location update. - } else { - window.history.pushState(historyState, null, path); - } - } else { - // REPLACE - if (useRefresh) { - window.location.replace(path); - return false; // Prevent location update. + var _createRouterObjects = this.createRouterObjects(); + + var history = _createRouterObjects.history; + var transitionManager = _createRouterObjects.transitionManager; + var router = _createRouterObjects.router; + + this._unlisten = transitionManager.listen(function (error, state) { + if (error) { + _this.handleError(error); } else { - window.history.replaceState(historyState, null, path); - } + _this.setState(state, _this.props.onUpdate); + } + }); + + this.history = history; + this.router = router; + }, + + createRouterObjects: function createRouterObjects() { + var matchContext = this.props.matchContext; + + if (matchContext) { + return matchContext; } - } - var history = _createDOMHistory2['default'](_extends({}, options, { - getCurrentLocation: getCurrentLocation, - finishTransition: finishTransition, - saveState: _DOMStateStorage.saveState - })); + var history = this.props.history; + var _props2 = this.props; + var routes = _props2.routes; + var children = _props2.children; - var listenerCount = 0, - stopPopStateListener = undefined; + if (isDeprecatedHistory(history)) { + history = this.wrapDeprecatedHistory(history); + } - function listenBefore(listener) { - if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history); + var transitionManager = _createTransitionManager2['default'](history, _RouteUtils.createRoutes(routes || children)); + var router = _RouterUtils.createRouterObject(history, transitionManager); + var routingHistory = _RouterUtils.createRoutingHistory(history, transitionManager); - var unlisten = history.listenBefore(listener); + return { history: routingHistory, transitionManager: transitionManager, router: router }; + }, - return function () { - unlisten(); + wrapDeprecatedHistory: function wrapDeprecatedHistory(history) { + var _props3 = this.props; + var parseQueryString = _props3.parseQueryString; + var stringifyQuery = _props3.stringifyQuery; - if (--listenerCount === 0) stopPopStateListener(); - }; - } + var createHistory = undefined; + if (history) { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'It appears you have provided a deprecated history object to ``, please use a history provided by ' + 'React Router with `import { browserHistory } from \'react-router\'` or `import { hashHistory } from \'react-router\'`. ' + 'If you are using a custom history please create it with `useRouterHistory`, see http://tiny.cc/router-usinghistory for details.') : undefined; + createHistory = function () { + return history; + }; + } else { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`Router` no longer defaults the history prop to hash history. Please use the `hashHistory` singleton instead. http://tiny.cc/router-defaulthistory') : undefined; + createHistory = _historyLibCreateHashHistory2['default']; + } - function listen(listener) { - if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history); + return _historyLibUseQueries2['default'](createHistory)({ parseQueryString: parseQueryString, stringifyQuery: stringifyQuery }); + }, - var unlisten = history.listen(listener); + /* istanbul ignore next: sanity check */ + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](nextProps.history === this.props.history, 'You cannot change ; it will be ignored') : undefined; - return function () { - unlisten(); + process.env.NODE_ENV !== 'production' ? _routerWarning2['default']((nextProps.routes || nextProps.children) === (this.props.routes || this.props.children), 'You cannot change ; it will be ignored') : undefined; + }, - if (--listenerCount === 0) stopPopStateListener(); - }; - } + componentWillUnmount: function componentWillUnmount() { + if (this._unlisten) this._unlisten(); + }, - // deprecated - function registerTransitionHook(hook) { - if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history); + render: function render() { + var _state = this.state; + var location = _state.location; + var routes = _state.routes; + var params = _state.params; + var components = _state.components; + var _props4 = this.props; + var createElement = _props4.createElement; + var render = _props4.render; - history.registerTransitionHook(hook); - } + var props = _objectWithoutProperties(_props4, ['createElement', 'render']); - // deprecated - function unregisterTransitionHook(hook) { - history.unregisterTransitionHook(hook); + if (location == null) return null; // Async match - if (--listenerCount === 0) stopPopStateListener(); + // Only forward non-Router-specific props to routing context, as those are + // the only ones that might be custom routing context props. + Object.keys(Router.propTypes).forEach(function (propType) { + return delete props[propType]; + }); + + return render(_extends({}, props, { + history: this.history, + router: this.router, + location: location, + routes: routes, + params: params, + components: components, + createElement: createElement + })); } - return _extends({}, history, { - listenBefore: listenBefore, - listen: listen, - registerTransitionHook: registerTransitionHook, - unregisterTransitionHook: unregisterTransitionHook - }); -} +}); -exports['default'] = createBrowserHistory; +exports['default'] = Router; module.exports = exports['default']; }).call(this,require('_process')) -},{"./Actions":37,"./DOMStateStorage":39,"./DOMUtils":40,"./ExecutionEnvironment":41,"./PathUtils":42,"./createDOMHistory":44,"_process":1,"invariant":58}],44:[function(require,module,exports){ +},{"./PropTypes":33,"./RouteUtils":37,"./RouterContext":39,"./RouterUtils":40,"./createTransitionManager":47,"./routerWarning":55,"_process":23,"history/lib/createHashHistory":14,"history/lib/useQueries":21,"react":"react"}],39:[function(require,module,exports){ (function (process){ 'use strict'; @@ -3624,981 +3630,1010 @@ var _invariant = require('invariant'); var _invariant2 = _interopRequireDefault(_invariant); -var _ExecutionEnvironment = require('./ExecutionEnvironment'); - -var _DOMUtils = require('./DOMUtils'); - -var _createHistory = require('./createHistory'); +var _react = require('react'); -var _createHistory2 = _interopRequireDefault(_createHistory); +var _react2 = _interopRequireDefault(_react); -function createDOMHistory(options) { - var history = _createHistory2['default'](_extends({ - getUserConfirmation: _DOMUtils.getUserConfirmation - }, options, { - go: _DOMUtils.go - })); +var _deprecateObjectProperties = require('./deprecateObjectProperties'); - function listen(listener) { - !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'DOM history needs a DOM') : _invariant2['default'](false) : undefined; +var _deprecateObjectProperties2 = _interopRequireDefault(_deprecateObjectProperties); - return history.listen(listener); - } +var _getRouteParams = require('./getRouteParams'); - return _extends({}, history, { - listen: listen - }); -} +var _getRouteParams2 = _interopRequireDefault(_getRouteParams); -exports['default'] = createDOMHistory; -module.exports = exports['default']; -}).call(this,require('_process')) +var _RouteUtils = require('./RouteUtils'); -},{"./DOMUtils":40,"./ExecutionEnvironment":41,"./createHistory":46,"_process":1,"invariant":58}],45:[function(require,module,exports){ -(function (process){ -'use strict'; +var _routerWarning = require('./routerWarning'); -exports.__esModule = true; +var _routerWarning2 = _interopRequireDefault(_routerWarning); -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 _React$PropTypes = _react2['default'].PropTypes; +var array = _React$PropTypes.array; +var func = _React$PropTypes.func; +var object = _React$PropTypes.object; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +/** + * A renders the component tree for a given router state + * and sets the history object and the current location in context. + */ +var RouterContext = _react2['default'].createClass({ + displayName: 'RouterContext', -var _warning = require('warning'); + propTypes: { + history: object, + router: object.isRequired, + location: object.isRequired, + routes: array.isRequired, + params: object.isRequired, + components: array.isRequired, + createElement: func.isRequired + }, -var _warning2 = _interopRequireDefault(_warning); + getDefaultProps: function getDefaultProps() { + return { + createElement: _react2['default'].createElement + }; + }, -var _invariant = require('invariant'); + childContextTypes: { + history: object, + location: object.isRequired, + router: object.isRequired + }, -var _invariant2 = _interopRequireDefault(_invariant); + getChildContext: function getChildContext() { + var _props = this.props; + var router = _props.router; + var history = _props.history; + var location = _props.location; -var _Actions = require('./Actions'); + if (!router) { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`` expects a `router` rather than a `history`') : undefined; -var _PathUtils = require('./PathUtils'); + router = _extends({}, history, { + setRouteLeaveHook: history.listenBeforeLeavingRoute + }); + delete router.listenBeforeLeavingRoute; + } -var _ExecutionEnvironment = require('./ExecutionEnvironment'); + if (process.env.NODE_ENV !== 'production') { + location = _deprecateObjectProperties2['default'](location, '`context.location` is deprecated, please use a route component\'s `props.location` instead. http://tiny.cc/router-accessinglocation'); + } -var _DOMUtils = require('./DOMUtils'); + return { history: history, location: location, router: router }; + }, -var _DOMStateStorage = require('./DOMStateStorage'); + createElement: function createElement(component, props) { + return component == null ? null : this.props.createElement(component, props); + }, -var _createDOMHistory = require('./createDOMHistory'); + render: function render() { + var _this = this; -var _createDOMHistory2 = _interopRequireDefault(_createDOMHistory); + var _props2 = this.props; + var history = _props2.history; + var location = _props2.location; + var routes = _props2.routes; + var params = _props2.params; + var components = _props2.components; -function isAbsolutePath(path) { - return typeof path === 'string' && path.charAt(0) === '/'; -} + var element = null; -function ensureSlash() { - var path = _DOMUtils.getHashPath(); + if (components) { + element = components.reduceRight(function (element, components, index) { + if (components == null) return element; // Don't create new children; use the grandchildren. - if (isAbsolutePath(path)) return true; + var route = routes[index]; + var routeParams = _getRouteParams2['default'](route, params); + var props = { + history: history, + location: location, + params: params, + route: route, + routeParams: routeParams, + routes: routes + }; - _DOMUtils.replaceHashPath('/' + path); + if (_RouteUtils.isReactChildren(element)) { + props.children = element; + } else if (element) { + for (var prop in element) { + if (element.hasOwnProperty(prop)) props[prop] = element[prop]; + } + } - return false; -} + if (typeof components === 'object') { + var elements = {}; -function addQueryStringValueToPath(path, key, value) { - return path + (path.indexOf('?') === -1 ? '?' : '&') + (key + '=' + value); -} + for (var key in components) { + if (components.hasOwnProperty(key)) { + // Pass through the key as a prop to createElement to allow + // custom createElement functions to know which named component + // they're rendering, for e.g. matching up to fetched data. + elements[key] = _this.createElement(components[key], _extends({ + key: key }, props)); + } + } -function stripQueryStringValueFromPath(path, key) { - return path.replace(new RegExp('[?&]?' + key + '=[a-zA-Z0-9]+'), ''); -} + return elements; + } -function getQueryStringValueFromPath(path, key) { - var match = path.match(new RegExp('\\?.*?\\b' + key + '=(.+?)\\b')); - return match && match[1]; -} + return _this.createElement(components, props); + }, element); + } -var DefaultQueryKey = '_k'; + !(element === null || element === false || _react2['default'].isValidElement(element)) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'The root route must render a single element') : _invariant2['default'](false) : undefined; -function createHashHistory() { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + return element; + } - !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Hash history needs a DOM') : _invariant2['default'](false) : undefined; +}); - var queryKey = options.queryKey; +exports['default'] = RouterContext; +module.exports = exports['default']; +}).call(this,require('_process')) - if (queryKey === undefined || !!queryKey) queryKey = typeof queryKey === 'string' ? queryKey : DefaultQueryKey; +},{"./RouteUtils":37,"./deprecateObjectProperties":48,"./getRouteParams":50,"./routerWarning":55,"_process":23,"invariant":22,"react":"react"}],40:[function(require,module,exports){ +(function (process){ +'use strict'; - function getCurrentLocation() { - var path = _DOMUtils.getHashPath(); +exports.__esModule = true; - var key = undefined, - state = undefined; - if (queryKey) { - key = getQueryStringValueFromPath(path, queryKey); - path = stripQueryStringValueFromPath(path, queryKey); +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; }; - if (key) { - state = _DOMStateStorage.readState(key); - } else { - state = null; - key = history.createKey(); - _DOMUtils.replaceHashPath(addQueryStringValueToPath(path, queryKey, key)); - } - } else { - key = state = null; - } +exports.createRouterObject = createRouterObject; +exports.createRoutingHistory = createRoutingHistory; - var location = _PathUtils.parsePath(path); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - return history.createLocation(_extends({}, location, { state: state }), undefined, key); - } +var _deprecateObjectProperties = require('./deprecateObjectProperties'); - function startHashChangeListener(_ref) { - var transitionTo = _ref.transitionTo; +var _deprecateObjectProperties2 = _interopRequireDefault(_deprecateObjectProperties); - function hashChangeListener() { - if (!ensureSlash()) return; // Always make sure hashes are preceeded with a /. +function createRouterObject(history, transitionManager) { + return _extends({}, history, { + setRouteLeaveHook: transitionManager.listenBeforeLeavingRoute, + isActive: transitionManager.isActive + }); +} - transitionTo(getCurrentLocation()); - } +// deprecated - ensureSlash(); - _DOMUtils.addEventListener(window, 'hashchange', hashChangeListener); +function createRoutingHistory(history, transitionManager) { + history = _extends({}, history, transitionManager); - return function () { - _DOMUtils.removeEventListener(window, 'hashchange', hashChangeListener); - }; + if (process.env.NODE_ENV !== 'production') { + history = _deprecateObjectProperties2['default'](history, '`props.history` and `context.history` are deprecated. Please use `context.router`. http://tiny.cc/router-contextchanges'); } - function finishTransition(location) { - var basename = location.basename; - var pathname = location.pathname; - var search = location.search; - var state = location.state; - var action = location.action; - var key = location.key; + return history; +} +}).call(this,require('_process')) - if (action === _Actions.POP) return; // Nothing to do. +},{"./deprecateObjectProperties":48,"_process":23}],41:[function(require,module,exports){ +(function (process){ +'use strict'; - var path = (basename || '') + pathname + search; +exports.__esModule = true; - if (queryKey) { - path = addQueryStringValueToPath(path, queryKey, key); - _DOMStateStorage.saveState(key, state); - } else { - // Drop key and state. - location.key = location.state = null; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var currentHash = _DOMUtils.getHashPath(); +var _react = require('react'); - if (action === _Actions.PUSH) { - if (currentHash !== path) { - window.location.hash = path; - } else { - process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'You cannot PUSH the same path using hash history') : undefined; - } - } else if (currentHash !== path) { - // REPLACE - _DOMUtils.replaceHashPath(path); - } - } +var _react2 = _interopRequireDefault(_react); - var history = _createDOMHistory2['default'](_extends({}, options, { - getCurrentLocation: getCurrentLocation, - finishTransition: finishTransition, - saveState: _DOMStateStorage.saveState - })); +var _RouterContext = require('./RouterContext'); - var listenerCount = 0, - stopHashChangeListener = undefined; +var _RouterContext2 = _interopRequireDefault(_RouterContext); - function listenBefore(listener) { - if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history); +var _routerWarning = require('./routerWarning'); - var unlisten = history.listenBefore(listener); +var _routerWarning2 = _interopRequireDefault(_routerWarning); - return function () { - unlisten(); +var RoutingContext = _react2['default'].createClass({ + displayName: 'RoutingContext', - if (--listenerCount === 0) stopHashChangeListener(); - }; + componentWillMount: function componentWillMount() { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`RoutingContext` has been renamed to `RouterContext`. Please use `import { RouterContext } from \'react-router\'`. http://tiny.cc/router-routercontext') : undefined; + }, + + render: function render() { + return _react2['default'].createElement(_RouterContext2['default'], this.props); } +}); - function listen(listener) { - if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history); +exports['default'] = RoutingContext; +module.exports = exports['default']; +}).call(this,require('_process')) - var unlisten = history.listen(listener); +},{"./RouterContext":39,"./routerWarning":55,"_process":23,"react":"react"}],42:[function(require,module,exports){ +(function (process){ +'use strict'; - return function () { - unlisten(); +exports.__esModule = true; +exports.runEnterHooks = runEnterHooks; +exports.runLeaveHooks = runLeaveHooks; - if (--listenerCount === 0) stopHashChangeListener(); - }; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - function push(location) { - process.env.NODE_ENV !== 'production' ? _warning2['default'](queryKey || location.state == null, 'You cannot use state without a queryKey it will be dropped') : undefined; +var _AsyncUtils = require('./AsyncUtils'); - history.push(location); - } +var _routerWarning = require('./routerWarning'); - function replace(location) { - process.env.NODE_ENV !== 'production' ? _warning2['default'](queryKey || location.state == null, 'You cannot use state without a queryKey it will be dropped') : undefined; +var _routerWarning2 = _interopRequireDefault(_routerWarning); - history.replace(location); - } +function createEnterHook(hook, route) { + return function (a, b, callback) { + hook.apply(route, arguments); - var goIsSupportedWithoutReload = _DOMUtils.supportsGoWithoutReloadUsingHash(); + if (hook.length < 3) { + // Assume hook executes synchronously and + // automatically call the callback. + callback(); + } + }; +} - function go(n) { - process.env.NODE_ENV !== 'production' ? _warning2['default'](goIsSupportedWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : undefined; +function getEnterHooks(routes) { + return routes.reduce(function (hooks, route) { + if (route.onEnter) hooks.push(createEnterHook(route.onEnter, route)); - history.go(n); - } + return hooks; + }, []); +} - function createHref(path) { - return '#' + history.createHref(path); - } +/** + * Runs all onEnter hooks in the given array of routes in order + * with onEnter(nextState, replace, callback) and calls + * callback(error, redirectInfo) when finished. The first hook + * to use replace short-circuits the loop. + * + * If a hook needs to run asynchronously, it may use the callback + * function. However, doing so will cause the transition to pause, + * which could lead to a non-responsive UI if the hook is slow. + */ - // deprecated - function registerTransitionHook(hook) { - if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history); +function runEnterHooks(routes, nextState, callback) { + var hooks = getEnterHooks(routes); - history.registerTransitionHook(hook); + if (!hooks.length) { + callback(); + return; } - // deprecated - function unregisterTransitionHook(hook) { - history.unregisterTransitionHook(hook); - - if (--listenerCount === 0) stopHashChangeListener(); - } + var redirectInfo = undefined; + function replace(location, deprecatedPathname, deprecatedQuery) { + if (deprecatedPathname) { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`replaceState(state, pathname, query) is deprecated; use `replace(location)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined; + redirectInfo = { + pathname: deprecatedPathname, + query: deprecatedQuery, + state: location + }; - // deprecated - function pushState(state, path) { - process.env.NODE_ENV !== 'production' ? _warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped') : undefined; + return; + } - history.pushState(state, path); + redirectInfo = location; } - // deprecated - function replaceState(state, path) { - process.env.NODE_ENV !== 'production' ? _warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped') : undefined; - - history.replaceState(state, path); - } + _AsyncUtils.loopAsync(hooks.length, function (index, next, done) { + hooks[index](nextState, replace, function (error) { + if (error || redirectInfo) { + done(error, redirectInfo); // No need to continue. + } else { + next(); + } + }); + }, callback); +} - return _extends({}, history, { - listenBefore: listenBefore, - listen: listen, - push: push, - replace: replace, - go: go, - createHref: createHref, +/** + * Runs all onLeave hooks in the given array of routes in order. + */ - registerTransitionHook: registerTransitionHook, // deprecated - warning is in createHistory - unregisterTransitionHook: unregisterTransitionHook, // deprecated - warning is in createHistory - pushState: pushState, // deprecated - warning is in createHistory - replaceState: replaceState // deprecated - warning is in createHistory - }); +function runLeaveHooks(routes) { + for (var i = 0, len = routes.length; i < len; ++i) { + if (routes[i].onLeave) routes[i].onLeave.call(routes[i]); + } } - -exports['default'] = createHashHistory; -module.exports = exports['default']; }).call(this,require('_process')) -},{"./Actions":37,"./DOMStateStorage":39,"./DOMUtils":40,"./ExecutionEnvironment":41,"./PathUtils":42,"./createDOMHistory":44,"_process":1,"invariant":58,"warning":59}],46:[function(require,module,exports){ -(function (process){ +},{"./AsyncUtils":25,"./routerWarning":55,"_process":23}],43:[function(require,module,exports){ 'use strict'; exports.__esModule = 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; }; - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _warning = require('warning'); +var _historyLibCreateBrowserHistory = require('history/lib/createBrowserHistory'); -var _warning2 = _interopRequireDefault(_warning); +var _historyLibCreateBrowserHistory2 = _interopRequireDefault(_historyLibCreateBrowserHistory); -var _deepEqual = require('deep-equal'); +var _createRouterHistory = require('./createRouterHistory'); -var _deepEqual2 = _interopRequireDefault(_deepEqual); +var _createRouterHistory2 = _interopRequireDefault(_createRouterHistory); -var _PathUtils = require('./PathUtils'); +exports['default'] = _createRouterHistory2['default'](_historyLibCreateBrowserHistory2['default']); +module.exports = exports['default']; +},{"./createRouterHistory":46,"history/lib/createBrowserHistory":12}],44:[function(require,module,exports){ +'use strict'; -var _AsyncUtils = require('./AsyncUtils'); +exports.__esModule = true; -var _Actions = require('./Actions'); +var _PatternUtils = require('./PatternUtils'); -var _createLocation2 = require('./createLocation'); +function routeParamsChanged(route, prevState, nextState) { + if (!route.path) return false; -var _createLocation3 = _interopRequireDefault(_createLocation2); + var paramNames = _PatternUtils.getParamNames(route.path); -var _runTransitionHook = require('./runTransitionHook'); + return paramNames.some(function (paramName) { + return prevState.params[paramName] !== nextState.params[paramName]; + }); +} -var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook); +/** + * Returns an object of { leaveRoutes, enterRoutes } determined by + * the change from prevState to nextState. We leave routes if either + * 1) they are not in the next state or 2) they are in the next state + * but their params have changed (i.e. /users/123 => /users/456). + * + * leaveRoutes are ordered starting at the leaf route of the tree + * we're leaving up to the common parent route. enterRoutes are ordered + * from the top of the tree we're entering down to the leaf route. + */ +function computeChangedRoutes(prevState, nextState) { + var prevRoutes = prevState && prevState.routes; + var nextRoutes = nextState.routes; -var _deprecate = require('./deprecate'); + var leaveRoutes = undefined, + enterRoutes = undefined; + if (prevRoutes) { + leaveRoutes = prevRoutes.filter(function (route) { + return nextRoutes.indexOf(route) === -1 || routeParamsChanged(route, prevState, nextState); + }); -var _deprecate2 = _interopRequireDefault(_deprecate); + // onLeave hooks start at the leaf route. + leaveRoutes.reverse(); -function createRandomKey(length) { - return Math.random().toString(36).substr(2, length); -} + enterRoutes = nextRoutes.filter(function (route) { + return prevRoutes.indexOf(route) === -1 || leaveRoutes.indexOf(route) !== -1; + }); + } else { + leaveRoutes = []; + enterRoutes = nextRoutes; + } -function locationsAreEqual(a, b) { - return a.pathname === b.pathname && a.search === b.search && - //a.action === b.action && // Different action !== location change. - a.key === b.key && _deepEqual2['default'](a.state, b.state); + return { + leaveRoutes: leaveRoutes, + enterRoutes: enterRoutes + }; } -var DefaultKeyLength = 6; - -function createHistory() { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - var getCurrentLocation = options.getCurrentLocation; - var finishTransition = options.finishTransition; - var saveState = options.saveState; - var go = options.go; - var keyLength = options.keyLength; - var getUserConfirmation = options.getUserConfirmation; - - if (typeof keyLength !== 'number') keyLength = DefaultKeyLength; - - var transitionHooks = []; +exports['default'] = computeChangedRoutes; +module.exports = exports['default']; +},{"./PatternUtils":32}],45:[function(require,module,exports){ +'use strict'; - function listenBefore(hook) { - transitionHooks.push(hook); +exports.__esModule = true; +exports['default'] = createMemoryHistory; - return function () { - transitionHooks = transitionHooks.filter(function (item) { - return item !== hook; - }); - }; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var allKeys = []; - var changeListeners = []; - var location = undefined; +var _historyLibUseQueries = require('history/lib/useQueries'); - function getCurrent() { - if (pendingLocation && pendingLocation.action === _Actions.POP) { - return allKeys.indexOf(pendingLocation.key); - } else if (location) { - return allKeys.indexOf(location.key); - } else { - return -1; - } - } +var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries); - function updateLocation(newLocation) { - var current = getCurrent(); +var _historyLibUseBasename = require('history/lib/useBasename'); - location = newLocation; +var _historyLibUseBasename2 = _interopRequireDefault(_historyLibUseBasename); - if (location.action === _Actions.PUSH) { - allKeys = [].concat(allKeys.slice(0, current + 1), [location.key]); - } else if (location.action === _Actions.REPLACE) { - allKeys[current] = location.key; - } +var _historyLibCreateMemoryHistory = require('history/lib/createMemoryHistory'); - changeListeners.forEach(function (listener) { - listener(location); - }); - } +var _historyLibCreateMemoryHistory2 = _interopRequireDefault(_historyLibCreateMemoryHistory); - function listen(listener) { - changeListeners.push(listener); +function createMemoryHistory(options) { + // signatures and type checking differ between `useRoutes` and + // `createMemoryHistory`, have to create `memoryHistory` first because + // `useQueries` doesn't understand the signature + var memoryHistory = _historyLibCreateMemoryHistory2['default'](options); + var createHistory = function createHistory() { + return memoryHistory; + }; + var history = _historyLibUseQueries2['default'](_historyLibUseBasename2['default'](createHistory))(options); + history.__v2_compatible__ = true; + return history; +} - if (location) { - listener(location); - } else { - var _location = getCurrentLocation(); - allKeys = [_location.key]; - updateLocation(_location); - } +module.exports = exports['default']; +},{"history/lib/createMemoryHistory":17,"history/lib/useBasename":20,"history/lib/useQueries":21}],46:[function(require,module,exports){ +'use strict'; - return function () { - changeListeners = changeListeners.filter(function (item) { - return item !== listener; - }); - }; - } +exports.__esModule = true; - function confirmTransitionTo(location, callback) { - _AsyncUtils.loopAsync(transitionHooks.length, function (index, next, done) { - _runTransitionHook2['default'](transitionHooks[index], location, function (result) { - if (result != null) { - done(result); - } else { - next(); - } - }); - }, function (message) { - if (getUserConfirmation && typeof message === 'string') { - getUserConfirmation(message, function (ok) { - callback(ok !== false); - }); - } else { - callback(message !== false); - } - }); - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var pendingLocation = undefined; +var _useRouterHistory = require('./useRouterHistory'); - function transitionTo(nextLocation) { - if (location && locationsAreEqual(location, nextLocation)) return; // Nothing to do. +var _useRouterHistory2 = _interopRequireDefault(_useRouterHistory); - pendingLocation = nextLocation; +var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); - confirmTransitionTo(nextLocation, function (ok) { - if (pendingLocation !== nextLocation) return; // Transition was interrupted. +exports['default'] = function (createHistory) { + var history = undefined; + if (canUseDOM) history = _useRouterHistory2['default'](createHistory)(); + return history; +}; - if (ok) { - // treat PUSH to current path like REPLACE to be consistent with browsers - if (nextLocation.action === _Actions.PUSH) { - var prevPath = createPath(location); - var nextPath = createPath(nextLocation); +module.exports = exports['default']; +},{"./useRouterHistory":56}],47:[function(require,module,exports){ +(function (process){ +'use strict'; - if (nextPath === prevPath && _deepEqual2['default'](location.state, nextLocation.state)) nextLocation.action = _Actions.REPLACE; - } +exports.__esModule = true; - if (finishTransition(nextLocation) !== false) updateLocation(nextLocation); - } else if (location && nextLocation.action === _Actions.POP) { - var prevIndex = allKeys.indexOf(location.key); - var nextIndex = allKeys.indexOf(nextLocation.key); +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; }; - if (prevIndex !== -1 && nextIndex !== -1) go(prevIndex - nextIndex); // Restore the URL. - } - }); - } +exports['default'] = createTransitionManager; - function push(location) { - transitionTo(createLocation(location, _Actions.PUSH, createKey())); - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - function replace(location) { - transitionTo(createLocation(location, _Actions.REPLACE, createKey())); - } +var _routerWarning = require('./routerWarning'); - function goBack() { - go(-1); - } +var _routerWarning2 = _interopRequireDefault(_routerWarning); - function goForward() { - go(1); - } +var _historyLibActions = require('history/lib/Actions'); - function createKey() { - return createRandomKey(keyLength); - } +var _computeChangedRoutes2 = require('./computeChangedRoutes'); - function createPath(location) { - if (location == null || typeof location === 'string') return location; +var _computeChangedRoutes3 = _interopRequireDefault(_computeChangedRoutes2); - var pathname = location.pathname; - var search = location.search; - var hash = location.hash; +var _TransitionUtils = require('./TransitionUtils'); - var result = pathname; +var _isActive2 = require('./isActive'); - if (search) result += search; +var _isActive3 = _interopRequireDefault(_isActive2); - if (hash) result += hash; +var _getComponents = require('./getComponents'); - return result; - } +var _getComponents2 = _interopRequireDefault(_getComponents); - function createHref(location) { - return createPath(location); - } +var _matchRoutes = require('./matchRoutes'); - function createLocation(location, action) { - var key = arguments.length <= 2 || arguments[2] === undefined ? createKey() : arguments[2]; +var _matchRoutes2 = _interopRequireDefault(_matchRoutes); - if (typeof action === 'object') { - process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'The state (2nd) argument to history.createLocation is deprecated; use a ' + 'location descriptor instead') : undefined; +function hasAnyProperties(object) { + for (var p in object) { + if (object.hasOwnProperty(p)) return true; + }return false; +} - if (typeof location === 'string') location = _PathUtils.parsePath(location); +function createTransitionManager(history, routes) { + var state = {}; - location = _extends({}, location, { state: action }); + // Signature should be (location, indexOnly), but needs to support (path, + // query, indexOnly) + function isActive(location) { + var indexOnlyOrDeprecatedQuery = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + var deprecatedIndexOnly = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - action = key; - key = arguments[3] || createKey(); + var indexOnly = undefined; + if (indexOnlyOrDeprecatedQuery && indexOnlyOrDeprecatedQuery !== true || deprecatedIndexOnly !== null) { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`isActive(pathname, query, indexOnly) is deprecated; use `isActive(location, indexOnly)` with a location descriptor instead. http://tiny.cc/router-isActivedeprecated') : undefined; + location = { pathname: location, query: indexOnlyOrDeprecatedQuery }; + indexOnly = deprecatedIndexOnly || false; + } else { + location = history.createLocation(location); + indexOnly = indexOnlyOrDeprecatedQuery; } - return _createLocation3['default'](location, action, key); + return _isActive3['default'](location, indexOnly, state.location, state.routes, state.params); } - // deprecated - function setState(state) { - if (location) { - updateLocationState(location, state); - updateLocation(location); + function createLocationFromRedirectInfo(location) { + return history.createLocation(location, _historyLibActions.REPLACE); + } + + var partialNextState = undefined; + + function match(location, callback) { + if (partialNextState && partialNextState.location === location) { + // Continue from where we left off. + finishMatch(partialNextState, callback); } else { - updateLocationState(getCurrentLocation(), state); + _matchRoutes2['default'](routes, location, function (error, nextState) { + if (error) { + callback(error); + } else if (nextState) { + finishMatch(_extends({}, nextState, { location: location }), callback); + } else { + callback(); + } + }); } } - function updateLocationState(location, state) { - location.state = _extends({}, location.state, state); - saveState(location.key, location.state); - } + function finishMatch(nextState, callback) { + var _computeChangedRoutes = _computeChangedRoutes3['default'](state, nextState); - // deprecated - function registerTransitionHook(hook) { - if (transitionHooks.indexOf(hook) === -1) transitionHooks.push(hook); - } + var leaveRoutes = _computeChangedRoutes.leaveRoutes; + var enterRoutes = _computeChangedRoutes.enterRoutes; - // deprecated - function unregisterTransitionHook(hook) { - transitionHooks = transitionHooks.filter(function (item) { - return item !== hook; + _TransitionUtils.runLeaveHooks(leaveRoutes); + + // Tear down confirmation hooks for left routes + leaveRoutes.forEach(removeListenBeforeHooksForRoute); + + _TransitionUtils.runEnterHooks(enterRoutes, nextState, function (error, redirectInfo) { + if (error) { + callback(error); + } else if (redirectInfo) { + callback(null, createLocationFromRedirectInfo(redirectInfo)); + } else { + // TODO: Fetch components after state is updated. + _getComponents2['default'](nextState, function (error, components) { + if (error) { + callback(error); + } else { + // TODO: Make match a pure function and have some other API + // for "match and update state". + callback(null, null, state = _extends({}, nextState, { components: components })); + } + }); + } }); } - // deprecated - function pushState(state, path) { - if (typeof path === 'string') path = _PathUtils.parsePath(path); + var RouteGuid = 1; - push(_extends({ state: state }, path)); + function getRouteID(route) { + var create = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1]; + + return route.__id__ || create && (route.__id__ = RouteGuid++); } - // deprecated - function replaceState(state, path) { - if (typeof path === 'string') path = _PathUtils.parsePath(path); + var RouteHooks = {}; - replace(_extends({ state: state }, path)); + function getRouteHooksForRoutes(routes) { + return routes.reduce(function (hooks, route) { + hooks.push.apply(hooks, RouteHooks[getRouteID(route)]); + return hooks; + }, []); } - return { - listenBefore: listenBefore, - listen: listen, - transitionTo: transitionTo, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - createKey: createKey, - createPath: createPath, - createHref: createHref, - createLocation: createLocation, + function transitionHook(location, callback) { + _matchRoutes2['default'](routes, location, function (error, nextState) { + if (nextState == null) { + // TODO: We didn't actually match anything, but hang + // onto error/nextState so we don't have to matchRoutes + // again in the listen callback. + callback(); + return; + } - setState: _deprecate2['default'](setState, 'setState is deprecated; use location.key to save state instead'), - registerTransitionHook: _deprecate2['default'](registerTransitionHook, 'registerTransitionHook is deprecated; use listenBefore instead'), - unregisterTransitionHook: _deprecate2['default'](unregisterTransitionHook, 'unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead'), - pushState: _deprecate2['default'](pushState, 'pushState is deprecated; use push instead'), - replaceState: _deprecate2['default'](replaceState, 'replaceState is deprecated; use replace instead') - }; -} + // Cache some state here so we don't have to + // matchRoutes() again in the listen callback. + partialNextState = _extends({}, nextState, { location: location }); -exports['default'] = createHistory; -module.exports = exports['default']; -}).call(this,require('_process')) + var hooks = getRouteHooksForRoutes(_computeChangedRoutes3['default'](state, partialNextState).leaveRoutes); -},{"./Actions":37,"./AsyncUtils":38,"./PathUtils":42,"./createLocation":47,"./deprecate":49,"./runTransitionHook":50,"_process":1,"deep-equal":53,"warning":59}],47:[function(require,module,exports){ -(function (process){ -'use strict'; + var result = undefined; + for (var i = 0, len = hooks.length; result == null && i < len; ++i) { + // Passing the location arg here indicates to + // the user that this is a transition hook. + result = hooks[i](location); + } -exports.__esModule = true; + callback(result); + }); + } -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; }; + /* istanbul ignore next: untestable with Karma */ + function beforeUnloadHook() { + // Synchronously check to see if any route hooks want + // to prevent the current window/tab from closing. + if (state.routes) { + var hooks = getRouteHooksForRoutes(state.routes); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + var message = undefined; + for (var i = 0, len = hooks.length; typeof message !== 'string' && i < len; ++i) { + // Passing no args indicates to the user that this is a + // beforeunload hook. We don't know the next location. + message = hooks[i](); + } -var _warning = require('warning'); + return message; + } + } -var _warning2 = _interopRequireDefault(_warning); + var unlistenBefore = undefined, + unlistenBeforeUnload = undefined; -var _Actions = require('./Actions'); + function removeListenBeforeHooksForRoute(route) { + var routeID = getRouteID(route, false); + if (!routeID) { + return; + } -var _PathUtils = require('./PathUtils'); + delete RouteHooks[routeID]; -function createLocation() { - var location = arguments.length <= 0 || arguments[0] === undefined ? '/' : arguments[0]; - var action = arguments.length <= 1 || arguments[1] === undefined ? _Actions.POP : arguments[1]; - var key = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + if (!hasAnyProperties(RouteHooks)) { + // teardown transition & beforeunload hooks + if (unlistenBefore) { + unlistenBefore(); + unlistenBefore = null; + } - var _fourthArg = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; + if (unlistenBeforeUnload) { + unlistenBeforeUnload(); + unlistenBeforeUnload = null; + } + } + } - if (typeof location === 'string') location = _PathUtils.parsePath(location); + /** + * Registers the given hook function to run before leaving the given route. + * + * During a normal transition, the hook function receives the next location + * as its only argument and must return either a) a prompt message to show + * the user, to make sure they want to leave the page or b) false, to prevent + * the transition. + * + * During the beforeunload event (in browsers) the hook receives no arguments. + * In this case it must return a prompt message to prevent the transition. + * + * Returns a function that may be used to unbind the listener. + */ + function listenBeforeLeavingRoute(route, hook) { + // TODO: Warn if they register for a route that isn't currently + // active. They're probably doing something wrong, like re-creating + // route objects on every location change. + var routeID = getRouteID(route); + var hooks = RouteHooks[routeID]; - if (typeof action === 'object') { - process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'The state (2nd) argument to createLocation is deprecated; use a ' + 'location descriptor instead') : undefined; + if (!hooks) { + var thereWereNoRouteHooks = !hasAnyProperties(RouteHooks); - location = _extends({}, location, { state: action }); + RouteHooks[routeID] = [hook]; - action = key || _Actions.POP; - key = _fourthArg; + if (thereWereNoRouteHooks) { + // setup transition & beforeunload hooks + unlistenBefore = history.listenBefore(transitionHook); + + if (history.listenBeforeUnload) unlistenBeforeUnload = history.listenBeforeUnload(beforeUnloadHook); + } + } else { + if (hooks.indexOf(hook) === -1) { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'adding multiple leave hooks for the same route is deprecated; manage multiple confirmations in your own code instead') : undefined; + + hooks.push(hook); + } + } + + return function () { + var hooks = RouteHooks[routeID]; + + if (hooks) { + var newHooks = hooks.filter(function (item) { + return item !== hook; + }); + + if (newHooks.length === 0) { + removeListenBeforeHooksForRoute(route); + } else { + RouteHooks[routeID] = newHooks; + } + } + }; } - var pathname = location.pathname || '/'; - var search = location.search || ''; - var hash = location.hash || ''; - var state = location.state || null; + /** + * This is the API for stateful environments. As the location + * changes, we update state and call the listener. We can also + * gracefully handle errors and redirects. + */ + function listen(listener) { + // TODO: Only use a single history listener. Otherwise we'll + // end up with multiple concurrent calls to match. + return history.listen(function (location) { + if (state.location === location) { + listener(null, state); + } else { + match(location, function (error, redirectLocation, nextState) { + if (error) { + listener(error); + } else if (redirectLocation) { + history.transitionTo(redirectLocation); + } else if (nextState) { + listener(null, nextState); + } else { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, 'Location "%s" did not match any routes', location.pathname + location.search + location.hash) : undefined; + } + }); + } + }); + } return { - pathname: pathname, - search: search, - hash: hash, - state: state, - action: action, - key: key + isActive: isActive, + match: match, + listenBeforeLeavingRoute: listenBeforeLeavingRoute, + listen: listen }; } -exports['default'] = createLocation; +//export default useRoutes module.exports = exports['default']; }).call(this,require('_process')) -},{"./Actions":37,"./PathUtils":42,"_process":1,"warning":59}],48:[function(require,module,exports){ +},{"./TransitionUtils":42,"./computeChangedRoutes":44,"./getComponents":49,"./isActive":52,"./matchRoutes":54,"./routerWarning":55,"_process":23,"history/lib/Actions":6}],48:[function(require,module,exports){ (function (process){ +/*eslint no-empty: 0*/ 'use strict'; exports.__esModule = 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; }; +exports['default'] = deprecateObjectProperties; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _warning = require('warning'); - -var _warning2 = _interopRequireDefault(_warning); - -var _invariant = require('invariant'); - -var _invariant2 = _interopRequireDefault(_invariant); - -var _PathUtils = require('./PathUtils'); - -var _Actions = require('./Actions'); +var _routerWarning = require('./routerWarning'); -var _createHistory = require('./createHistory'); +var _routerWarning2 = _interopRequireDefault(_routerWarning); -var _createHistory2 = _interopRequireDefault(_createHistory); +var useMembrane = false; -function createStateStorage(entries) { - return entries.filter(function (entry) { - return entry.state; - }).reduce(function (memo, entry) { - memo[entry.key] = entry.state; - return memo; - }, {}); +if (process.env.NODE_ENV !== 'production') { + try { + if (Object.defineProperty({}, 'x', { get: function get() { + return true; + } }).x) { + useMembrane = true; + } + } catch (e) {} } -function createMemoryHistory() { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - - if (Array.isArray(options)) { - options = { entries: options }; - } else if (typeof options === 'string') { - options = { entries: [options] }; - } - - var history = _createHistory2['default'](_extends({}, options, { - getCurrentLocation: getCurrentLocation, - finishTransition: finishTransition, - saveState: saveState, - go: go - })); - - var _options = options; - var entries = _options.entries; - var current = _options.current; - - if (typeof entries === 'string') { - entries = [entries]; - } else if (!Array.isArray(entries)) { - entries = ['/']; - } - - entries = entries.map(function (entry) { - var key = history.createKey(); - - if (typeof entry === 'string') return { pathname: entry, key: key }; - - if (typeof entry === 'object' && entry) return _extends({}, entry, { key: key }); - - !false ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Unable to create history entry from %s', entry) : _invariant2['default'](false) : undefined; - }); - - if (current == null) { - current = entries.length - 1; - } else { - !(current >= 0 && current < entries.length) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Current index must be >= 0 and < %s, was %s', entries.length, current) : _invariant2['default'](false) : undefined; - } - - var storage = createStateStorage(entries); - - function saveState(key, state) { - storage[key] = state; - } - - function readState(key) { - return storage[key]; - } +// wraps an object in a membrane to warn about deprecated property access - function getCurrentLocation() { - var entry = entries[current]; - var key = entry.key; - var basename = entry.basename; - var pathname = entry.pathname; - var search = entry.search; +function deprecateObjectProperties(object, message) { + if (!useMembrane) return object; - var path = (basename || '') + pathname + (search || ''); + var membrane = {}; - var state = undefined; - if (key) { - state = readState(key); + var _loop = function (prop) { + if (typeof object[prop] === 'function') { + membrane[prop] = function () { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, message) : undefined; + return object[prop].apply(object, arguments); + }; } else { - state = null; - key = history.createKey(); - entry.key = key; + Object.defineProperty(membrane, prop, { + configurable: false, + enumerable: false, + get: function get() { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, message) : undefined; + return object[prop]; + } + }); } + }; - var location = _PathUtils.parsePath(path); - - return history.createLocation(_extends({}, location, { state: state }), undefined, key); - } - - function canGo(n) { - var index = current + n; - return index >= 0 && index < entries.length; + for (var prop in object) { + _loop(prop); } - function go(n) { - if (n) { - if (!canGo(n)) { - process.env.NODE_ENV !== 'production' ? _warning2['default'](false, 'Cannot go(%s) there is not enough history', n) : undefined; - return; - } - - current += n; + return membrane; +} - var currentLocation = getCurrentLocation(); +module.exports = exports['default']; +}).call(this,require('_process')) - // change action to POP - history.transitionTo(_extends({}, currentLocation, { action: _Actions.POP })); - } - } +},{"./routerWarning":55,"_process":23}],49:[function(require,module,exports){ +'use strict'; - function finishTransition(location) { - switch (location.action) { - case _Actions.PUSH: - current += 1; +exports.__esModule = true; - // if we are not on the top of stack - // remove rest and push new - if (current < entries.length) entries.splice(current); +var _AsyncUtils = require('./AsyncUtils'); - entries.push(location); - saveState(location.key, location.state); - break; - case _Actions.REPLACE: - entries[current] = location; - saveState(location.key, location.state); - break; - } +function getComponentsForRoute(location, route, callback) { + if (route.component || route.components) { + callback(null, route.component || route.components); + } else if (route.getComponent) { + route.getComponent(location, callback); + } else if (route.getComponents) { + route.getComponents(location, callback); + } else { + callback(); } +} - return history; +/** + * Asynchronously fetches all components needed for the given router + * state and calls callback(error, components) when finished. + * + * Note: This operation may finish synchronously if no routes have an + * asynchronous getComponents method. + */ +function getComponents(nextState, callback) { + _AsyncUtils.mapAsync(nextState.routes, function (route, index, callback) { + getComponentsForRoute(nextState.location, route, callback); + }, callback); } -exports['default'] = createMemoryHistory; +exports['default'] = getComponents; module.exports = exports['default']; -}).call(this,require('_process')) - -},{"./Actions":37,"./PathUtils":42,"./createHistory":46,"_process":1,"invariant":58,"warning":59}],49:[function(require,module,exports){ -(function (process){ +},{"./AsyncUtils":25}],50:[function(require,module,exports){ 'use strict'; exports.__esModule = true; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +var _PatternUtils = require('./PatternUtils'); -var _warning = require('warning'); +/** + * Extracts an object of params the given route cares about from + * the given params object. + */ +function getRouteParams(route, params) { + var routeParams = {}; -var _warning2 = _interopRequireDefault(_warning); + if (!route.path) return routeParams; -function deprecate(fn, message) { - return function () { - process.env.NODE_ENV !== 'production' ? _warning2['default'](false, '[history] ' + message) : undefined; - return fn.apply(this, arguments); - }; + var paramNames = _PatternUtils.getParamNames(route.path); + + for (var p in params) { + if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p]; + }return routeParams; } -exports['default'] = deprecate; +exports['default'] = getRouteParams; module.exports = exports['default']; -}).call(this,require('_process')) - -},{"_process":1,"warning":59}],50:[function(require,module,exports){ -(function (process){ +},{"./PatternUtils":32}],51:[function(require,module,exports){ 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _warning = require('warning'); +var _historyLibCreateHashHistory = require('history/lib/createHashHistory'); -var _warning2 = _interopRequireDefault(_warning); +var _historyLibCreateHashHistory2 = _interopRequireDefault(_historyLibCreateHashHistory); -function runTransitionHook(hook, location, callback) { - var result = hook(location, callback); +var _createRouterHistory = require('./createRouterHistory'); - if (hook.length < 2) { - // Assume the hook runs synchronously and automatically - // call the callback with the return value. - callback(result); - } else { - process.env.NODE_ENV !== 'production' ? _warning2['default'](result === undefined, 'You should not "return" in a transition hook with a callback argument; call the callback instead') : undefined; - } -} +var _createRouterHistory2 = _interopRequireDefault(_createRouterHistory); -exports['default'] = runTransitionHook; +exports['default'] = _createRouterHistory2['default'](_historyLibCreateHashHistory2['default']); module.exports = exports['default']; -}).call(this,require('_process')) - -},{"_process":1,"warning":59}],51:[function(require,module,exports){ +},{"./createRouterHistory":46,"history/lib/createHashHistory":14}],52:[function(require,module,exports){ 'use strict'; exports.__esModule = true; +exports['default'] = isActive; -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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -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 _ExecutionEnvironment = require('./ExecutionEnvironment'); - -var _PathUtils = require('./PathUtils'); - -var _runTransitionHook = require('./runTransitionHook'); - -var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook); - -var _deprecate = require('./deprecate'); - -var _deprecate2 = _interopRequireDefault(_deprecate); - -function useBasename(createHistory) { - return function () { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - var basename = options.basename; - - var historyOptions = _objectWithoutProperties(options, ['basename']); +var _PatternUtils = require('./PatternUtils'); - var history = createHistory(historyOptions); +function deepEqual(a, b) { + if (a == b) return true; - // Automatically use the value of in HTML - // documents as basename if it's not explicitly given. - if (basename == null && _ExecutionEnvironment.canUseDOM) { - var base = document.getElementsByTagName('base')[0]; + if (a == null || b == null) return false; - if (base) basename = _PathUtils.extractPath(base.href); - } + if (Array.isArray(a)) { + return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { + return deepEqual(item, b[index]); + }); + } - function addBasename(location) { - if (basename && location.basename == null) { - if (location.pathname.indexOf(basename) === 0) { - location.pathname = location.pathname.substring(basename.length); - location.basename = basename; + if (typeof a === 'object') { + for (var p in a) { + if (!a.hasOwnProperty(p)) { + continue; + } - if (location.pathname === '') location.pathname = '/'; - } else { - location.basename = ''; + if (a[p] === undefined) { + if (b[p] !== undefined) { + return false; } + } else if (!b.hasOwnProperty(p)) { + return false; + } else if (!deepEqual(a[p], b[p])) { + return false; } - - return location; } - function prependBasename(location) { - if (!basename) return location; + return true; + } - if (typeof location === 'string') location = _PathUtils.parsePath(location); + return String(a) === String(b); +} - var pname = location.pathname; - var normalizedBasename = basename.slice(-1) === '/' ? basename : basename + '/'; - var normalizedPathname = pname.charAt(0) === '/' ? pname.slice(1) : pname; - var pathname = normalizedBasename + normalizedPathname; +function paramsAreActive(paramNames, paramValues, activeParams) { + // FIXME: This doesn't work on repeated params in activeParams. + return paramNames.every(function (paramName, index) { + return String(paramValues[index]) === String(activeParams[paramName]); + }); +} - return _extends({}, location, { - pathname: pathname - }); - } +function getMatchingRouteIndex(pathname, activeRoutes, activeParams) { + var remainingPathname = pathname, + paramNames = [], + paramValues = []; - // Override all read methods with basename-aware versions. - function listenBefore(hook) { - return history.listenBefore(function (location, callback) { - _runTransitionHook2['default'](hook, addBasename(location), callback); - }); - } + for (var i = 0, len = activeRoutes.length; i < len; ++i) { + var route = activeRoutes[i]; + var pattern = route.path || ''; - function listen(listener) { - return history.listen(function (location) { - listener(addBasename(location)); - }); + if (pattern.charAt(0) === '/') { + remainingPathname = pathname; + paramNames = []; + paramValues = []; } - // Override all write methods with basename-aware versions. - function push(location) { - history.push(prependBasename(location)); + if (remainingPathname !== null) { + var matched = _PatternUtils.matchPattern(pattern, remainingPathname); + remainingPathname = matched.remainingPathname; + paramNames = [].concat(paramNames, matched.paramNames); + paramValues = [].concat(paramValues, matched.paramValues); } - function replace(location) { - history.replace(prependBasename(location)); - } + if (remainingPathname === '' && route.path && paramsAreActive(paramNames, paramValues, activeParams)) return i; + } - function createPath(location) { - return history.createPath(prependBasename(location)); - } + return null; +} - function createHref(location) { - return history.createHref(prependBasename(location)); - } +/** + * Returns true if the given pathname matches the active routes + * and params. + */ +function routeIsActive(pathname, routes, params, indexOnly) { + var i = getMatchingRouteIndex(pathname, routes, params); - function createLocation(location) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } + if (i === null) { + // No match. + return false; + } else if (!indexOnly) { + // Any match is good enough. + return true; + } - return addBasename(history.createLocation.apply(history, [prependBasename(location)].concat(args))); - } + // If any remaining routes past the match index have paths, then we can't + // be on the index route. + return routes.slice(i + 1).every(function (route) { + return !route.path; + }); +} - // deprecated - function pushState(state, path) { - if (typeof path === 'string') path = _PathUtils.parsePath(path); +/** + * Returns true if all key/value pairs in the given query are + * currently active. + */ +function queryIsActive(query, activeQuery) { + if (activeQuery == null) return query == null; - push(_extends({ state: state }, path)); - } + if (query == null) return true; - // deprecated - function replaceState(state, path) { - if (typeof path === 'string') path = _PathUtils.parsePath(path); + return deepEqual(query, activeQuery); +} - replace(_extends({ state: state }, path)); - } +/** + * Returns true if a to the given pathname/query combination is + * currently active. + */ - return _extends({}, history, { - listenBefore: listenBefore, - listen: listen, - push: push, - replace: replace, - createPath: createPath, - createHref: createHref, - createLocation: createLocation, +function isActive(_ref, indexOnly, currentLocation, routes, params) { + var pathname = _ref.pathname; + var query = _ref.query; - pushState: _deprecate2['default'](pushState, 'pushState is deprecated; use push instead'), - replaceState: _deprecate2['default'](replaceState, 'replaceState is deprecated; use replace instead') - }); - }; + if (currentLocation == null) return false; + + if (!routeIsActive(pathname, routes, params, indexOnly)) return false; + + return queryIsActive(query, currentLocation.query); } -exports['default'] = useBasename; module.exports = exports['default']; -},{"./ExecutionEnvironment":41,"./PathUtils":42,"./deprecate":49,"./runTransitionHook":50}],52:[function(require,module,exports){ +},{"./PatternUtils":32}],53:[function(require,module,exports){ (function (process){ 'use strict'; @@ -4610,504 +4645,396 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'd 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 _warning = require('warning'); - -var _warning2 = _interopRequireDefault(_warning); - -var _queryString = require('query-string'); - -var _runTransitionHook = require('./runTransitionHook'); - -var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook); +var _invariant = require('invariant'); -var _PathUtils = require('./PathUtils'); +var _invariant2 = _interopRequireDefault(_invariant); -var _deprecate = require('./deprecate'); +var _createMemoryHistory = require('./createMemoryHistory'); -var _deprecate2 = _interopRequireDefault(_deprecate); +var _createMemoryHistory2 = _interopRequireDefault(_createMemoryHistory); -var SEARCH_BASE_KEY = '$searchBase'; +var _createTransitionManager = require('./createTransitionManager'); -function defaultStringifyQuery(query) { - return _queryString.stringify(query).replace(/%20/g, '+'); -} +var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); -var defaultParseQueryString = _queryString.parse; +var _RouteUtils = require('./RouteUtils'); -function isNestedObject(object) { - for (var p in object) { - if (object.hasOwnProperty(p) && typeof object[p] === 'object' && !Array.isArray(object[p]) && object[p] !== null) return true; - }return false; -} +var _RouterUtils = require('./RouterUtils'); /** - * Returns a new createHistory function that may be used to create - * history objects that know how to handle URL queries. + * A high-level API to be used for server-side rendering. + * + * This function matches a location to a set of routes and calls + * callback(error, redirectLocation, renderProps) when finished. + * + * Note: You probably don't want to use this in a browser unless you're using + * server-side rendering with async routes. */ -function useQueries(createHistory) { - return function () { - var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; - var stringifyQuery = options.stringifyQuery; - var parseQueryString = options.parseQueryString; - - var historyOptions = _objectWithoutProperties(options, ['stringifyQuery', 'parseQueryString']); - - var history = createHistory(historyOptions); - - if (typeof stringifyQuery !== 'function') stringifyQuery = defaultStringifyQuery; - - if (typeof parseQueryString !== 'function') parseQueryString = defaultParseQueryString; - - function addQuery(location) { - if (location.query == null) { - var search = location.search; - - location.query = parseQueryString(search.substring(1)); - location[SEARCH_BASE_KEY] = { search: search, searchBase: '' }; - } - - // TODO: Instead of all the book-keeping here, this should just strip the - // stringified query from the search. - - return location; - } - - function appendQuery(location, query) { - var _extends2; +function match(_ref, callback) { + var history = _ref.history; + var routes = _ref.routes; + var location = _ref.location; - var searchBaseSpec = location[SEARCH_BASE_KEY]; - var queryString = query ? stringifyQuery(query) : ''; - if (!searchBaseSpec && !queryString) { - return location; - } + var options = _objectWithoutProperties(_ref, ['history', 'routes', 'location']); - process.env.NODE_ENV !== 'production' ? _warning2['default'](stringifyQuery !== defaultStringifyQuery || !isNestedObject(query), 'useQueries does not stringify nested query objects by default; ' + 'use a custom stringifyQuery function') : undefined; + !(history || location) ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'match needs a history or a location') : _invariant2['default'](false) : undefined; - if (typeof location === 'string') location = _PathUtils.parsePath(location); + history = history ? history : _createMemoryHistory2['default'](options); + var transitionManager = _createTransitionManager2['default'](history, _RouteUtils.createRoutes(routes)); - var searchBase = undefined; - if (searchBaseSpec && location.search === searchBaseSpec.search) { - searchBase = searchBaseSpec.searchBase; - } else { - searchBase = location.search || ''; - } + var unlisten = undefined; - var search = searchBase; - if (queryString) { - search += (search ? '&' : '?') + queryString; - } + if (location) { + // Allow match({ location: '/the/path', ... }) + location = history.createLocation(location); + } else { + // Pick up the location from the history via synchronous history.listen + // call if needed. + unlisten = history.listen(function (historyLocation) { + location = historyLocation; + }); + } - return _extends({}, location, (_extends2 = { - search: search - }, _extends2[SEARCH_BASE_KEY] = { search: search, searchBase: searchBase }, _extends2)); - } + var router = _RouterUtils.createRouterObject(history, transitionManager); + history = _RouterUtils.createRoutingHistory(history, transitionManager); - // Override all read methods with query-aware versions. - function listenBefore(hook) { - return history.listenBefore(function (location, callback) { - _runTransitionHook2['default'](hook, addQuery(location), callback); - }); - } + transitionManager.match(location, function (error, redirectLocation, nextState) { + callback(error, redirectLocation, nextState && _extends({}, nextState, { + history: history, + router: router, + matchContext: { history: history, transitionManager: transitionManager, router: router } + })); - function listen(listener) { - return history.listen(function (location) { - listener(addQuery(location)); - }); + // Defer removing the listener to here to prevent DOM histories from having + // to unwind DOM event listeners unnecessarily, in case callback renders a + // and attaches another history listener. + if (unlisten) { + unlisten(); } + }); +} - // Override all write methods with query-aware versions. - function push(location) { - history.push(appendQuery(location, location.query)); - } +exports['default'] = match; +module.exports = exports['default']; +}).call(this,require('_process')) - function replace(location) { - history.replace(appendQuery(location, location.query)); - } +},{"./RouteUtils":37,"./RouterUtils":40,"./createMemoryHistory":45,"./createTransitionManager":47,"_process":23,"invariant":22}],54:[function(require,module,exports){ +(function (process){ +'use strict'; - function createPath(location, query) { - process.env.NODE_ENV !== 'production' ? _warning2['default'](!query, 'the query argument to createPath is deprecated; use a location descriptor instead') : undefined; +exports.__esModule = true; - return history.createPath(appendQuery(location, query || location.query)); - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - function createHref(location, query) { - process.env.NODE_ENV !== 'production' ? _warning2['default'](!query, 'the query argument to createHref is deprecated; use a location descriptor instead') : undefined; +var _routerWarning = require('./routerWarning'); - return history.createHref(appendQuery(location, query || location.query)); - } +var _routerWarning2 = _interopRequireDefault(_routerWarning); - function createLocation(location) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } +var _AsyncUtils = require('./AsyncUtils'); - var fullLocation = history.createLocation.apply(history, [appendQuery(location, location.query)].concat(args)); - if (location.query) { - fullLocation.query = location.query; - } - return addQuery(fullLocation); - } +var _PatternUtils = require('./PatternUtils'); - // deprecated - function pushState(state, path, query) { - if (typeof path === 'string') path = _PathUtils.parsePath(path); +var _RouteUtils = require('./RouteUtils'); - push(_extends({ state: state }, path, { query: query })); - } +function getChildRoutes(route, location, callback) { + if (route.childRoutes) { + return [null, route.childRoutes]; + } + if (!route.getChildRoutes) { + return []; + } - // deprecated - function replaceState(state, path, query) { - if (typeof path === 'string') path = _PathUtils.parsePath(path); + var sync = true, + result = undefined; - replace(_extends({ state: state }, path, { query: query })); + route.getChildRoutes(location, function (error, childRoutes) { + childRoutes = !error && _RouteUtils.createRoutes(childRoutes); + if (sync) { + result = [error, childRoutes]; + return; } - return _extends({}, history, { - listenBefore: listenBefore, - listen: listen, - push: push, - replace: replace, - createPath: createPath, - createHref: createHref, - createLocation: createLocation, + callback(error, childRoutes); + }); - pushState: _deprecate2['default'](pushState, 'pushState is deprecated; use push instead'), - replaceState: _deprecate2['default'](replaceState, 'replaceState is deprecated; use replace instead') - }); - }; + sync = false; + return result; // Might be undefined. } -exports['default'] = useQueries; -module.exports = exports['default']; -}).call(this,require('_process')) - -},{"./PathUtils":42,"./deprecate":49,"./runTransitionHook":50,"_process":1,"query-string":56,"warning":59}],53:[function(require,module,exports){ -var pSlice = Array.prototype.slice; -var objectKeys = require('./lib/keys.js'); -var isArguments = require('./lib/is_arguments.js'); +function getIndexRoute(route, location, callback) { + if (route.indexRoute) { + callback(null, route.indexRoute); + } else if (route.getIndexRoute) { + route.getIndexRoute(location, function (error, indexRoute) { + callback(error, !error && _RouteUtils.createRoutes(indexRoute)[0]); + }); + } else if (route.childRoutes) { + (function () { + var pathless = route.childRoutes.filter(function (obj) { + return !obj.hasOwnProperty('path'); + }); -var deepEqual = module.exports = function (actual, expected, opts) { - if (!opts) opts = {}; - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; + _AsyncUtils.loopAsync(pathless.length, function (index, next, done) { + getIndexRoute(pathless[index], location, function (error, indexRoute) { + if (error || indexRoute) { + var routes = [pathless[index]].concat(Array.isArray(indexRoute) ? indexRoute : [indexRoute]); + done(error, routes); + } else { + next(); + } + }); + }, function (err, routes) { + callback(null, routes); + }); + })(); + } else { + callback(); + } +} - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); +function assignParams(params, paramNames, paramValues) { + return paramNames.reduce(function (params, paramName, index) { + var paramValue = paramValues && paramValues[index]; - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { - return opts.strict ? actual === expected : actual == expected; + if (Array.isArray(params[paramName])) { + params[paramName].push(paramValue); + } else if (paramName in params) { + params[paramName] = [params[paramName], paramValue]; + } else { + params[paramName] = paramValue; + } - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected, opts); - } + return params; + }, params); } -function isUndefinedOrNull(value) { - return value === null || value === undefined; +function createParams(paramNames, paramValues) { + return assignParams({}, paramNames, paramValues); } -function isBuffer (x) { - if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; - if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { - return false; +function matchRouteDeep(route, location, remainingPathname, paramNames, paramValues, callback) { + var pattern = route.path || ''; + + if (pattern.charAt(0) === '/') { + remainingPathname = location.pathname; + paramNames = []; + paramValues = []; } - if (x.length > 0 && typeof x[0] !== 'number') return false; - return true; -} -function objEquiv(a, b, opts) { - var i, key; - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; + if (remainingPathname !== null) { + var matched = _PatternUtils.matchPattern(pattern, remainingPathname); + remainingPathname = matched.remainingPathname; + paramNames = [].concat(paramNames, matched.paramNames); + paramValues = [].concat(paramValues, matched.paramValues); + + if (remainingPathname === '' && route.path) { + var _ret2 = (function () { + var match = { + routes: [route], + params: createParams(paramNames, paramValues) + }; + + getIndexRoute(route, location, function (error, indexRoute) { + if (error) { + callback(error); + } else { + if (Array.isArray(indexRoute)) { + var _match$routes; + + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](indexRoute.every(function (route) { + return !route.path; + }), 'Index routes should not have paths') : undefined; + (_match$routes = match.routes).push.apply(_match$routes, indexRoute); + } else if (indexRoute) { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](!indexRoute.path, 'Index routes should not have paths') : undefined; + match.routes.push(indexRoute); + } + + callback(null, match); + } + }); + return { + v: undefined + }; + })(); + + if (typeof _ret2 === 'object') return _ret2.v; } - a = pSlice.call(a); - b = pSlice.call(b); - return deepEqual(a, b, opts); } - if (isBuffer(a)) { - if (!isBuffer(b)) { - return false; - } - if (a.length !== b.length) return false; - for (i = 0; i < a.length; i++) { - if (a[i] !== b[i]) return false; + + if (remainingPathname != null || route.childRoutes) { + // Either a) this route matched at least some of the path or b) + // we don't have to load this route's children asynchronously. In + // either case continue checking for matches in the subtree. + var onChildRoutes = function onChildRoutes(error, childRoutes) { + if (error) { + callback(error); + } else if (childRoutes) { + // Check the child routes to see if any of them match. + matchRoutes(childRoutes, location, function (error, match) { + if (error) { + callback(error); + } else if (match) { + // A child route matched! Augment the match and pass it up the stack. + match.routes.unshift(route); + callback(null, match); + } else { + callback(); + } + }, remainingPathname, paramNames, paramValues); + } else { + callback(); + } + }; + + var result = getChildRoutes(route, location, onChildRoutes); + if (result) { + onChildRoutes.apply(undefined, result); } - return true; - } - try { - var ka = objectKeys(a), - kb = objectKeys(b); - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!deepEqual(a[key], b[key], opts)) return false; + } else { + callback(); } - return typeof a === typeof b; } -},{"./lib/is_arguments.js":54,"./lib/keys.js":55}],54:[function(require,module,exports){ -var supportsArgumentsClass = (function(){ - return Object.prototype.toString.call(arguments) -})() == '[object Arguments]'; - -exports = module.exports = supportsArgumentsClass ? supported : unsupported; - -exports.supported = supported; -function supported(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -}; +/** + * Asynchronously matches the given location to a set of routes and calls + * callback(error, state) when finished. The state object will have the + * following properties: + * + * - routes An array of routes that matched, in hierarchical order + * - params An object of URL parameters + * + * Note: This operation may finish synchronously if no routes have an + * asynchronous getChildRoutes method. + */ +function matchRoutes(routes, location, callback) { + var remainingPathname = arguments.length <= 3 || arguments[3] === undefined ? location.pathname : arguments[3]; + var paramNames = arguments.length <= 4 || arguments[4] === undefined ? [] : arguments[4]; + var paramValues = arguments.length <= 5 || arguments[5] === undefined ? [] : arguments[5]; + return (function () { + _AsyncUtils.loopAsync(routes.length, function (index, next, done) { + matchRouteDeep(routes[index], location, remainingPathname, paramNames, paramValues, function (error, match) { + if (error || match) { + done(error, match); + } else { + next(); + } + }); + }, callback); + })(); +} -exports.unsupported = unsupported; -function unsupported(object){ - return object && - typeof object == 'object' && - typeof object.length == 'number' && - Object.prototype.hasOwnProperty.call(object, 'callee') && - !Object.prototype.propertyIsEnumerable.call(object, 'callee') || - false; -}; +exports['default'] = matchRoutes; +module.exports = exports['default']; +}).call(this,require('_process')) -},{}],55:[function(require,module,exports){ -exports = module.exports = typeof Object.keys === 'function' - ? Object.keys : shim; +},{"./AsyncUtils":25,"./PatternUtils":32,"./RouteUtils":37,"./routerWarning":55,"_process":23}],55:[function(require,module,exports){ +(function (process){ +'use strict'; -exports.shim = shim; -function shim (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -} +exports.__esModule = true; +exports['default'] = routerWarning; -},{}],56:[function(require,module,exports){ -'use strict'; -var strictUriEncode = require('strict-uri-encode'); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -exports.extract = function (str) { - return str.split('?')[1] || ''; -}; +var _warning = require('warning'); -exports.parse = function (str) { - if (typeof str !== 'string') { - return {}; - } +var _warning2 = _interopRequireDefault(_warning); - str = str.trim().replace(/^(\?|#|&)/, ''); +function routerWarning(falseToWarn, message) { + message = '[react-router] ' + message; - if (!str) { - return {}; - } + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } - return str.split('&').reduce(function (ret, param) { - var parts = param.replace(/\+/g, ' ').split('='); - // Firefox (pre 40) decodes `%3D` to `=` - // https://github.com/sindresorhus/query-string/pull/37 - var key = parts.shift(); - var val = parts.length > 0 ? parts.join('=') : undefined; + process.env.NODE_ENV !== 'production' ? _warning2['default'].apply(undefined, [falseToWarn, message].concat(args)) : undefined; +} - key = decodeURIComponent(key); +module.exports = exports['default']; +}).call(this,require('_process')) - // missing `=` should be `null`: - // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters - val = val === undefined ? null : decodeURIComponent(val); +},{"_process":23,"warning":232}],56:[function(require,module,exports){ +'use strict'; - if (!ret.hasOwnProperty(key)) { - ret[key] = val; - } else if (Array.isArray(ret[key])) { - ret[key].push(val); - } else { - ret[key] = [ret[key], val]; - } +exports.__esModule = true; +exports['default'] = useRouterHistory; - return ret; - }, {}); -}; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -exports.stringify = function (obj) { - return obj ? Object.keys(obj).sort().map(function (key) { - var val = obj[key]; +var _historyLibUseQueries = require('history/lib/useQueries'); - if (val === undefined) { - return ''; - } +var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries); - if (val === null) { - return key; - } +var _historyLibUseBasename = require('history/lib/useBasename'); - if (Array.isArray(val)) { - return val.slice().sort().map(function (val2) { - return strictUriEncode(key) + '=' + strictUriEncode(val2); - }).join('&'); - } +var _historyLibUseBasename2 = _interopRequireDefault(_historyLibUseBasename); - return strictUriEncode(key) + '=' + strictUriEncode(val); - }).filter(function (x) { - return x.length > 0; - }).join('&') : ''; -}; +function useRouterHistory(createHistory) { + return function (options) { + var history = _historyLibUseQueries2['default'](_historyLibUseBasename2['default'](createHistory))(options); + history.__v2_compatible__ = true; + return history; + }; +} -},{"strict-uri-encode":57}],57:[function(require,module,exports){ +module.exports = exports['default']; +},{"history/lib/useBasename":20,"history/lib/useQueries":21}],57:[function(require,module,exports){ +(function (process){ 'use strict'; -module.exports = function (str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase(); - }); -}; -},{}],58:[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. - */ +exports.__esModule = true; -'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; }; -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var invariant = function(condition, format, a, b, c, d, e, f) { - if (process.env.NODE_ENV !== 'production') { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } +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; } - if (!condition) { - var error; - if (format === undefined) { - error = new Error( - 'Minified exception occurred; use the non-minified dev environment ' + - 'for the full error message and additional helpful warnings.' - ); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error( - format.replace(/%s/g, function() { return args[argIndex++]; }) - ); - error.name = 'Invariant Violation'; - } +var _historyLibUseQueries = require('history/lib/useQueries'); - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -}; +var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries); -module.exports = invariant; +var _createTransitionManager = require('./createTransitionManager'); -}).call(this,require('_process')) +var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); -},{"_process":1}],59:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2014-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. - */ +var _routerWarning = require('./routerWarning'); -'use strict'; +var _routerWarning2 = _interopRequireDefault(_routerWarning); /** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. + * Returns a new createHistory function that may be used to create + * history objects that know about routing. + * + * Enhances history objects with the following methods: + * + * - listen((error, nextState) => {}) + * - listenBeforeLeavingRoute(route, (nextLocation) => {}) + * - match(location, (error, redirectLocation, nextState) => {}) + * - isActive(pathname, query, indexOnly=false) */ +function useRoutes(createHistory) { + process.env.NODE_ENV !== 'production' ? _routerWarning2['default'](false, '`useRoutes` is deprecated. Please use `createTransitionManager` instead.') : undefined; -var warning = function() {}; + return function () { + var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; -if (process.env.NODE_ENV !== 'production') { - warning = function(condition, format, args) { - var len = arguments.length; - args = new Array(len > 2 ? len - 2 : 0); - for (var key = 2; key < len; key++) { - args[key - 2] = arguments[key]; - } - if (format === undefined) { - throw new Error( - '`warning(condition, format, ...args)` requires a warning ' + - 'message argument' - ); - } + var routes = _ref.routes; - if (format.length < 10 || (/^[s\W]*$/).test(format)) { - throw new Error( - 'The warning format should be able to uniquely identify this ' + - 'warning. Please, use a more descriptive format than: ' + format - ); - } + var options = _objectWithoutProperties(_ref, ['routes']); - if (!condition) { - var argIndex = 0; - var message = 'Warning: ' + - format.replace(/%s/g, function() { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch(x) {} - } + var history = _historyLibUseQueries2['default'](createHistory)(options); + var transitionManager = _createTransitionManager2['default'](history, routes); + return _extends({}, history, transitionManager); }; } -module.exports = warning; - +exports['default'] = useRoutes; +module.exports = exports['default']; }).call(this,require('_process')) -},{"_process":1}],60:[function(require,module,exports){ +},{"./createTransitionManager":47,"./routerWarning":55,"_process":23,"history/lib/useQueries":21}],58:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -5144,7 +5071,7 @@ var AutoFocusUtils = { }; module.exports = AutoFocusUtils; -},{"./ReactMount":130,"./findDOMNode":181,"fbjs/lib/focusNode":214}],61:[function(require,module,exports){ +},{"./ReactMount":128,"./findDOMNode":179,"fbjs/lib/focusNode":212}],59:[function(require,module,exports){ /** * Copyright 2013-2015 Facebook, Inc. * All rights reserved. @@ -5550,7 +5477,7 @@ var BeforeInputEventPlugin = { }; module.exports = BeforeInputEventPlugin; -},{"./EventConstants":73,"./EventPropagators":77,"./FallbackCompositionState":78,"./SyntheticCompositionEvent":162,"./SyntheticInputEvent":166,"fbjs/lib/ExecutionEnvironment":206,"fbjs/lib/keyOf":225}],62:[function(require,module,exports){ +},{"./EventConstants":71,"./EventPropagators":75,"./FallbackCompositionState":76,"./SyntheticCompositionEvent":160,"./SyntheticInputEvent":164,"fbjs/lib/ExecutionEnvironment":204,"fbjs/lib/keyOf":223}],60:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -5690,7 +5617,7 @@ var CSSProperty = { }; module.exports = CSSProperty; -},{}],63:[function(require,module,exports){ +},{}],61:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -5869,7 +5796,7 @@ ReactPerf.measureMethods(CSSPropertyOperations, 'CSSPropertyOperations', { module.exports = CSSPropertyOperations; }).call(this,require('_process')) -},{"./CSSProperty":62,"./ReactPerf":136,"./dangerousStyleValue":178,"_process":1,"fbjs/lib/ExecutionEnvironment":206,"fbjs/lib/camelizeStyleName":208,"fbjs/lib/hyphenateStyleName":219,"fbjs/lib/memoizeStringOnly":227,"fbjs/lib/warning":232}],64:[function(require,module,exports){ +},{"./CSSProperty":60,"./ReactPerf":134,"./dangerousStyleValue":176,"_process":23,"fbjs/lib/ExecutionEnvironment":204,"fbjs/lib/camelizeStyleName":206,"fbjs/lib/hyphenateStyleName":217,"fbjs/lib/memoizeStringOnly":225,"fbjs/lib/warning":230}],62:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -5966,7 +5893,7 @@ PooledClass.addPoolingTo(CallbackQueue); module.exports = CallbackQueue; }).call(this,require('_process')) -},{"./Object.assign":82,"./PooledClass":83,"_process":1,"fbjs/lib/invariant":220}],65:[function(require,module,exports){ +},{"./Object.assign":80,"./PooledClass":81,"_process":23,"fbjs/lib/invariant":218}],63:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -6288,7 +6215,7 @@ var ChangeEventPlugin = { }; module.exports = ChangeEventPlugin; -},{"./EventConstants":73,"./EventPluginHub":74,"./EventPropagators":77,"./ReactUpdates":154,"./SyntheticEvent":164,"./getEventTarget":187,"./isEventSupported":192,"./isTextInputElement":193,"fbjs/lib/ExecutionEnvironment":206,"fbjs/lib/keyOf":225}],66:[function(require,module,exports){ +},{"./EventConstants":71,"./EventPluginHub":72,"./EventPropagators":75,"./ReactUpdates":152,"./SyntheticEvent":162,"./getEventTarget":185,"./isEventSupported":190,"./isTextInputElement":191,"fbjs/lib/ExecutionEnvironment":204,"fbjs/lib/keyOf":223}],64:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -6312,7 +6239,7 @@ var ClientReactRootIndex = { }; module.exports = ClientReactRootIndex; -},{}],67:[function(require,module,exports){ +},{}],65:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -6445,7 +6372,7 @@ ReactPerf.measureMethods(DOMChildrenOperations, 'DOMChildrenOperations', { module.exports = DOMChildrenOperations; }).call(this,require('_process')) -},{"./Danger":70,"./ReactMultiChildUpdateTypes":132,"./ReactPerf":136,"./setInnerHTML":197,"./setTextContent":198,"_process":1,"fbjs/lib/invariant":220}],68:[function(require,module,exports){ +},{"./Danger":68,"./ReactMultiChildUpdateTypes":130,"./ReactPerf":134,"./setInnerHTML":195,"./setTextContent":196,"_process":23,"fbjs/lib/invariant":218}],66:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -6683,7 +6610,7 @@ var DOMProperty = { module.exports = DOMProperty; }).call(this,require('_process')) -},{"_process":1,"fbjs/lib/invariant":220}],69:[function(require,module,exports){ +},{"_process":23,"fbjs/lib/invariant":218}],67:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -6912,7 +6839,7 @@ ReactPerf.measureMethods(DOMPropertyOperations, 'DOMPropertyOperations', { module.exports = DOMPropertyOperations; }).call(this,require('_process')) -},{"./DOMProperty":68,"./ReactPerf":136,"./quoteAttributeValueForBrowser":195,"_process":1,"fbjs/lib/warning":232}],70:[function(require,module,exports){ +},{"./DOMProperty":66,"./ReactPerf":134,"./quoteAttributeValueForBrowser":193,"_process":23,"fbjs/lib/warning":230}],68:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -7061,7 +6988,7 @@ var Danger = { module.exports = Danger; }).call(this,require('_process')) -},{"_process":1,"fbjs/lib/ExecutionEnvironment":206,"fbjs/lib/createNodesFromMarkup":211,"fbjs/lib/emptyFunction":212,"fbjs/lib/getMarkupWrap":216,"fbjs/lib/invariant":220}],71:[function(require,module,exports){ +},{"_process":23,"fbjs/lib/ExecutionEnvironment":204,"fbjs/lib/createNodesFromMarkup":209,"fbjs/lib/emptyFunction":210,"fbjs/lib/getMarkupWrap":214,"fbjs/lib/invariant":218}],69:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -7089,7 +7016,7 @@ var keyOf = require('fbjs/lib/keyOf'); var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })]; module.exports = DefaultEventPluginOrder; -},{"fbjs/lib/keyOf":225}],72:[function(require,module,exports){ +},{"fbjs/lib/keyOf":223}],70:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -7214,7 +7141,7 @@ var EnterLeaveEventPlugin = { }; module.exports = EnterLeaveEventPlugin; -},{"./EventConstants":73,"./EventPropagators":77,"./ReactMount":130,"./SyntheticMouseEvent":168,"fbjs/lib/keyOf":225}],73:[function(require,module,exports){ +},{"./EventConstants":71,"./EventPropagators":75,"./ReactMount":128,"./SyntheticMouseEvent":166,"fbjs/lib/keyOf":223}],71:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -7307,7 +7234,7 @@ var EventConstants = { }; module.exports = EventConstants; -},{"fbjs/lib/keyMirror":224}],74:[function(require,module,exports){ +},{"fbjs/lib/keyMirror":222}],72:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -7590,7 +7517,7 @@ var EventPluginHub = { module.exports = EventPluginHub; }).call(this,require('_process')) -},{"./EventPluginRegistry":75,"./EventPluginUtils":76,"./ReactErrorUtils":119,"./accumulateInto":174,"./forEachAccumulated":183,"_process":1,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],75:[function(require,module,exports){ +},{"./EventPluginRegistry":73,"./EventPluginUtils":74,"./ReactErrorUtils":117,"./accumulateInto":172,"./forEachAccumulated":181,"_process":23,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],73:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -7814,7 +7741,7 @@ var EventPluginRegistry = { module.exports = EventPluginRegistry; }).call(this,require('_process')) -},{"_process":1,"fbjs/lib/invariant":220}],76:[function(require,module,exports){ +},{"_process":23,"fbjs/lib/invariant":218}],74:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -8020,7 +7947,7 @@ var EventPluginUtils = { module.exports = EventPluginUtils; }).call(this,require('_process')) -},{"./EventConstants":73,"./ReactErrorUtils":119,"_process":1,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],77:[function(require,module,exports){ +},{"./EventConstants":71,"./ReactErrorUtils":117,"_process":23,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],75:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -8159,7 +8086,7 @@ var EventPropagators = { module.exports = EventPropagators; }).call(this,require('_process')) -},{"./EventConstants":73,"./EventPluginHub":74,"./accumulateInto":174,"./forEachAccumulated":183,"_process":1,"fbjs/lib/warning":232}],78:[function(require,module,exports){ +},{"./EventConstants":71,"./EventPluginHub":72,"./accumulateInto":172,"./forEachAccumulated":181,"_process":23,"fbjs/lib/warning":230}],76:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -8255,7 +8182,7 @@ assign(FallbackCompositionState.prototype, { PooledClass.addPoolingTo(FallbackCompositionState); module.exports = FallbackCompositionState; -},{"./Object.assign":82,"./PooledClass":83,"./getTextContentAccessor":190}],79:[function(require,module,exports){ +},{"./Object.assign":80,"./PooledClass":81,"./getTextContentAccessor":188}],77:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -8486,7 +8413,7 @@ var HTMLDOMPropertyConfig = { }; module.exports = HTMLDOMPropertyConfig; -},{"./DOMProperty":68,"fbjs/lib/ExecutionEnvironment":206}],80:[function(require,module,exports){ +},{"./DOMProperty":66,"fbjs/lib/ExecutionEnvironment":204}],78:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -8523,7 +8450,7 @@ var LinkedStateMixin = { }; module.exports = LinkedStateMixin; -},{"./ReactLink":128,"./ReactStateSetters":148}],81:[function(require,module,exports){ +},{"./ReactLink":126,"./ReactStateSetters":146}],79:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -8661,7 +8588,7 @@ var LinkedValueUtils = { module.exports = LinkedValueUtils; }).call(this,require('_process')) -},{"./ReactPropTypeLocations":139,"./ReactPropTypes":140,"_process":1,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],82:[function(require,module,exports){ +},{"./ReactPropTypeLocations":137,"./ReactPropTypes":138,"_process":23,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],80:[function(require,module,exports){ /** * Copyright 2014-2015, Facebook, Inc. * All rights reserved. @@ -8709,7 +8636,7 @@ function assign(target, sources) { } module.exports = assign; -},{}],83:[function(require,module,exports){ +},{}],81:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -8832,7 +8759,7 @@ var PooledClass = { module.exports = PooledClass; }).call(this,require('_process')) -},{"_process":1,"fbjs/lib/invariant":220}],84:[function(require,module,exports){ +},{"_process":23,"fbjs/lib/invariant":218}],82:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -8873,7 +8800,7 @@ React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOM; React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOMServer; module.exports = React; -},{"./Object.assign":82,"./ReactDOM":98,"./ReactDOMServer":108,"./ReactIsomorphic":127,"./deprecated":179}],85:[function(require,module,exports){ +},{"./Object.assign":80,"./ReactDOM":96,"./ReactDOMServer":106,"./ReactIsomorphic":125,"./deprecated":177}],83:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -8913,7 +8840,7 @@ var ReactBrowserComponentMixin = { module.exports = ReactBrowserComponentMixin; }).call(this,require('_process')) -},{"./ReactInstanceMap":126,"./findDOMNode":181,"_process":1,"fbjs/lib/warning":232}],86:[function(require,module,exports){ +},{"./ReactInstanceMap":124,"./findDOMNode":179,"_process":23,"fbjs/lib/warning":230}],84:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -9238,7 +9165,7 @@ ReactPerf.measureMethods(ReactBrowserEventEmitter, 'ReactBrowserEventEmitter', { }); module.exports = ReactBrowserEventEmitter; -},{"./EventConstants":73,"./EventPluginHub":74,"./EventPluginRegistry":75,"./Object.assign":82,"./ReactEventEmitterMixin":120,"./ReactPerf":136,"./ViewportMetrics":173,"./isEventSupported":192}],87:[function(require,module,exports){ +},{"./EventConstants":71,"./EventPluginHub":72,"./EventPluginRegistry":73,"./Object.assign":80,"./ReactEventEmitterMixin":118,"./ReactPerf":134,"./ViewportMetrics":171,"./isEventSupported":190}],85:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -9322,7 +9249,7 @@ var ReactCSSTransitionGroup = React.createClass({ }); module.exports = ReactCSSTransitionGroup; -},{"./Object.assign":82,"./React":84,"./ReactCSSTransitionGroupChild":88,"./ReactTransitionGroup":152}],88:[function(require,module,exports){ +},{"./Object.assign":80,"./React":82,"./ReactCSSTransitionGroupChild":86,"./ReactTransitionGroup":150}],86:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -9488,7 +9415,7 @@ var ReactCSSTransitionGroupChild = React.createClass({ }); module.exports = ReactCSSTransitionGroupChild; -},{"./React":84,"./ReactDOM":98,"./ReactTransitionEvents":151,"./onlyChild":194,"fbjs/lib/CSSCore":204}],89:[function(require,module,exports){ +},{"./React":82,"./ReactDOM":96,"./ReactTransitionEvents":149,"./onlyChild":192,"fbjs/lib/CSSCore":202}],87:[function(require,module,exports){ (function (process){ /** * Copyright 2014-2015, Facebook, Inc. @@ -9614,7 +9541,7 @@ var ReactChildReconciler = { module.exports = ReactChildReconciler; }).call(this,require('_process')) -},{"./ReactReconciler":142,"./instantiateReactComponent":191,"./shouldUpdateReactComponent":200,"./traverseAllChildren":201,"_process":1,"fbjs/lib/warning":232}],90:[function(require,module,exports){ +},{"./ReactReconciler":140,"./instantiateReactComponent":189,"./shouldUpdateReactComponent":198,"./traverseAllChildren":199,"_process":23,"fbjs/lib/warning":230}],88:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -9797,7 +9724,7 @@ var ReactChildren = { }; module.exports = ReactChildren; -},{"./PooledClass":83,"./ReactElement":115,"./traverseAllChildren":201,"fbjs/lib/emptyFunction":212}],91:[function(require,module,exports){ +},{"./PooledClass":81,"./ReactElement":113,"./traverseAllChildren":199,"fbjs/lib/emptyFunction":210}],89:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -10572,7 +10499,7 @@ var ReactClass = { module.exports = ReactClass; }).call(this,require('_process')) -},{"./Object.assign":82,"./ReactComponent":92,"./ReactElement":115,"./ReactNoopUpdateQueue":134,"./ReactPropTypeLocationNames":138,"./ReactPropTypeLocations":139,"_process":1,"fbjs/lib/emptyObject":213,"fbjs/lib/invariant":220,"fbjs/lib/keyMirror":224,"fbjs/lib/keyOf":225,"fbjs/lib/warning":232}],92:[function(require,module,exports){ +},{"./Object.assign":80,"./ReactComponent":90,"./ReactElement":113,"./ReactNoopUpdateQueue":132,"./ReactPropTypeLocationNames":136,"./ReactPropTypeLocations":137,"_process":23,"fbjs/lib/emptyObject":211,"fbjs/lib/invariant":218,"fbjs/lib/keyMirror":222,"fbjs/lib/keyOf":223,"fbjs/lib/warning":230}],90:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -10698,7 +10625,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = ReactComponent; }).call(this,require('_process')) -},{"./ReactNoopUpdateQueue":134,"./canDefineProperty":176,"_process":1,"fbjs/lib/emptyObject":213,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],93:[function(require,module,exports){ +},{"./ReactNoopUpdateQueue":132,"./canDefineProperty":174,"_process":23,"fbjs/lib/emptyObject":211,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],91:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -10740,7 +10667,7 @@ var ReactComponentBrowserEnvironment = { }; module.exports = ReactComponentBrowserEnvironment; -},{"./ReactDOMIDOperations":103,"./ReactMount":130}],94:[function(require,module,exports){ +},{"./ReactDOMIDOperations":101,"./ReactMount":128}],92:[function(require,module,exports){ (function (process){ /** * Copyright 2014-2015, Facebook, Inc. @@ -10795,7 +10722,7 @@ var ReactComponentEnvironment = { module.exports = ReactComponentEnvironment; }).call(this,require('_process')) -},{"_process":1,"fbjs/lib/invariant":220}],95:[function(require,module,exports){ +},{"_process":23,"fbjs/lib/invariant":218}],93:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -10842,7 +10769,7 @@ var ReactComponentWithPureRenderMixin = { }; module.exports = ReactComponentWithPureRenderMixin; -},{"./shallowCompare":199}],96:[function(require,module,exports){ +},{"./shallowCompare":197}],94:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -11540,7 +11467,7 @@ var ReactCompositeComponent = { module.exports = ReactCompositeComponent; }).call(this,require('_process')) -},{"./Object.assign":82,"./ReactComponentEnvironment":94,"./ReactCurrentOwner":97,"./ReactElement":115,"./ReactInstanceMap":126,"./ReactPerf":136,"./ReactPropTypeLocationNames":138,"./ReactPropTypeLocations":139,"./ReactReconciler":142,"./ReactUpdateQueue":153,"./shouldUpdateReactComponent":200,"_process":1,"fbjs/lib/emptyObject":213,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],97:[function(require,module,exports){ +},{"./Object.assign":80,"./ReactComponentEnvironment":92,"./ReactCurrentOwner":95,"./ReactElement":113,"./ReactInstanceMap":124,"./ReactPerf":134,"./ReactPropTypeLocationNames":136,"./ReactPropTypeLocations":137,"./ReactReconciler":140,"./ReactUpdateQueue":151,"./shouldUpdateReactComponent":198,"_process":23,"fbjs/lib/emptyObject":211,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],95:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -11571,7 +11498,7 @@ var ReactCurrentOwner = { }; module.exports = ReactCurrentOwner; -},{}],98:[function(require,module,exports){ +},{}],96:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -11667,7 +11594,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = React; }).call(this,require('_process')) -},{"./ReactCurrentOwner":97,"./ReactDOMTextComponent":109,"./ReactDefaultInjection":112,"./ReactInstanceHandles":125,"./ReactMount":130,"./ReactPerf":136,"./ReactReconciler":142,"./ReactUpdates":154,"./ReactVersion":155,"./findDOMNode":181,"./renderSubtreeIntoContainer":196,"_process":1,"fbjs/lib/ExecutionEnvironment":206,"fbjs/lib/warning":232}],99:[function(require,module,exports){ +},{"./ReactCurrentOwner":95,"./ReactDOMTextComponent":107,"./ReactDefaultInjection":110,"./ReactInstanceHandles":123,"./ReactMount":128,"./ReactPerf":134,"./ReactReconciler":140,"./ReactUpdates":152,"./ReactVersion":153,"./findDOMNode":179,"./renderSubtreeIntoContainer":194,"_process":23,"fbjs/lib/ExecutionEnvironment":204,"fbjs/lib/warning":230}],97:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -11718,7 +11645,7 @@ var ReactDOMButton = { }; module.exports = ReactDOMButton; -},{}],100:[function(require,module,exports){ +},{}],98:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -12684,7 +12611,7 @@ assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mix module.exports = ReactDOMComponent; }).call(this,require('_process')) -},{"./AutoFocusUtils":60,"./CSSPropertyOperations":63,"./DOMProperty":68,"./DOMPropertyOperations":69,"./EventConstants":73,"./Object.assign":82,"./ReactBrowserEventEmitter":86,"./ReactComponentBrowserEnvironment":93,"./ReactDOMButton":99,"./ReactDOMInput":104,"./ReactDOMOption":105,"./ReactDOMSelect":106,"./ReactDOMTextarea":110,"./ReactMount":130,"./ReactMultiChild":131,"./ReactPerf":136,"./ReactUpdateQueue":153,"./canDefineProperty":176,"./escapeTextContentForBrowser":180,"./isEventSupported":192,"./setInnerHTML":197,"./setTextContent":198,"./validateDOMNesting":203,"_process":1,"fbjs/lib/invariant":220,"fbjs/lib/keyOf":225,"fbjs/lib/shallowEqual":230,"fbjs/lib/warning":232}],101:[function(require,module,exports){ +},{"./AutoFocusUtils":58,"./CSSPropertyOperations":61,"./DOMProperty":66,"./DOMPropertyOperations":67,"./EventConstants":71,"./Object.assign":80,"./ReactBrowserEventEmitter":84,"./ReactComponentBrowserEnvironment":91,"./ReactDOMButton":97,"./ReactDOMInput":102,"./ReactDOMOption":103,"./ReactDOMSelect":104,"./ReactDOMTextarea":108,"./ReactMount":128,"./ReactMultiChild":129,"./ReactPerf":134,"./ReactUpdateQueue":151,"./canDefineProperty":174,"./escapeTextContentForBrowser":178,"./isEventSupported":190,"./setInnerHTML":195,"./setTextContent":196,"./validateDOMNesting":201,"_process":23,"fbjs/lib/invariant":218,"fbjs/lib/keyOf":223,"fbjs/lib/shallowEqual":228,"fbjs/lib/warning":230}],99:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -12865,7 +12792,7 @@ var ReactDOMFactories = mapObject({ module.exports = ReactDOMFactories; }).call(this,require('_process')) -},{"./ReactElement":115,"./ReactElementValidator":116,"_process":1,"fbjs/lib/mapObject":226}],102:[function(require,module,exports){ +},{"./ReactElement":113,"./ReactElementValidator":114,"_process":23,"fbjs/lib/mapObject":224}],100:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -12884,7 +12811,7 @@ var ReactDOMFeatureFlags = { }; module.exports = ReactDOMFeatureFlags; -},{}],103:[function(require,module,exports){ +},{}],101:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -12982,7 +12909,7 @@ ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', { module.exports = ReactDOMIDOperations; }).call(this,require('_process')) -},{"./DOMChildrenOperations":67,"./DOMPropertyOperations":69,"./ReactMount":130,"./ReactPerf":136,"_process":1,"fbjs/lib/invariant":220}],104:[function(require,module,exports){ +},{"./DOMChildrenOperations":65,"./DOMPropertyOperations":67,"./ReactMount":128,"./ReactPerf":134,"_process":23,"fbjs/lib/invariant":218}],102:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -13139,7 +13066,7 @@ function _handleChange(event) { module.exports = ReactDOMInput; }).call(this,require('_process')) -},{"./LinkedValueUtils":81,"./Object.assign":82,"./ReactDOMIDOperations":103,"./ReactMount":130,"./ReactUpdates":154,"_process":1,"fbjs/lib/invariant":220}],105:[function(require,module,exports){ +},{"./LinkedValueUtils":79,"./Object.assign":80,"./ReactDOMIDOperations":101,"./ReactMount":128,"./ReactUpdates":152,"_process":23,"fbjs/lib/invariant":218}],103:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -13232,7 +13159,7 @@ var ReactDOMOption = { module.exports = ReactDOMOption; }).call(this,require('_process')) -},{"./Object.assign":82,"./ReactChildren":90,"./ReactDOMSelect":106,"_process":1,"fbjs/lib/warning":232}],106:[function(require,module,exports){ +},{"./Object.assign":80,"./ReactChildren":88,"./ReactDOMSelect":104,"_process":23,"fbjs/lib/warning":230}],104:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -13424,7 +13351,7 @@ function _handleChange(event) { module.exports = ReactDOMSelect; }).call(this,require('_process')) -},{"./LinkedValueUtils":81,"./Object.assign":82,"./ReactMount":130,"./ReactUpdates":154,"_process":1,"fbjs/lib/warning":232}],107:[function(require,module,exports){ +},{"./LinkedValueUtils":79,"./Object.assign":80,"./ReactMount":128,"./ReactUpdates":152,"_process":23,"fbjs/lib/warning":230}],105:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -13637,7 +13564,7 @@ var ReactDOMSelection = { }; module.exports = ReactDOMSelection; -},{"./getNodeForCharacterOffset":189,"./getTextContentAccessor":190,"fbjs/lib/ExecutionEnvironment":206}],108:[function(require,module,exports){ +},{"./getNodeForCharacterOffset":187,"./getTextContentAccessor":188,"fbjs/lib/ExecutionEnvironment":204}],106:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -13664,7 +13591,7 @@ var ReactDOMServer = { }; module.exports = ReactDOMServer; -},{"./ReactDefaultInjection":112,"./ReactServerRendering":146,"./ReactVersion":155}],109:[function(require,module,exports){ +},{"./ReactDefaultInjection":110,"./ReactServerRendering":144,"./ReactVersion":153}],107:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -13795,7 +13722,7 @@ assign(ReactDOMTextComponent.prototype, { module.exports = ReactDOMTextComponent; }).call(this,require('_process')) -},{"./DOMChildrenOperations":67,"./DOMPropertyOperations":69,"./Object.assign":82,"./ReactComponentBrowserEnvironment":93,"./ReactMount":130,"./escapeTextContentForBrowser":180,"./setTextContent":198,"./validateDOMNesting":203,"_process":1}],110:[function(require,module,exports){ +},{"./DOMChildrenOperations":65,"./DOMPropertyOperations":67,"./Object.assign":80,"./ReactComponentBrowserEnvironment":91,"./ReactMount":128,"./escapeTextContentForBrowser":178,"./setTextContent":196,"./validateDOMNesting":201,"_process":23}],108:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -13912,7 +13839,7 @@ function _handleChange(event) { module.exports = ReactDOMTextarea; }).call(this,require('_process')) -},{"./LinkedValueUtils":81,"./Object.assign":82,"./ReactDOMIDOperations":103,"./ReactUpdates":154,"_process":1,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],111:[function(require,module,exports){ +},{"./LinkedValueUtils":79,"./Object.assign":80,"./ReactDOMIDOperations":101,"./ReactUpdates":152,"_process":23,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],109:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -13980,7 +13907,7 @@ var ReactDefaultBatchingStrategy = { }; module.exports = ReactDefaultBatchingStrategy; -},{"./Object.assign":82,"./ReactUpdates":154,"./Transaction":172,"fbjs/lib/emptyFunction":212}],112:[function(require,module,exports){ +},{"./Object.assign":80,"./ReactUpdates":152,"./Transaction":170,"fbjs/lib/emptyFunction":210}],110:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -14081,7 +14008,7 @@ module.exports = { }; }).call(this,require('_process')) -},{"./BeforeInputEventPlugin":61,"./ChangeEventPlugin":65,"./ClientReactRootIndex":66,"./DefaultEventPluginOrder":71,"./EnterLeaveEventPlugin":72,"./HTMLDOMPropertyConfig":79,"./ReactBrowserComponentMixin":85,"./ReactComponentBrowserEnvironment":93,"./ReactDOMComponent":100,"./ReactDOMTextComponent":109,"./ReactDefaultBatchingStrategy":111,"./ReactDefaultPerf":113,"./ReactEventListener":121,"./ReactInjection":123,"./ReactInstanceHandles":125,"./ReactMount":130,"./ReactReconcileTransaction":141,"./SVGDOMPropertyConfig":157,"./SelectEventPlugin":158,"./ServerReactRootIndex":159,"./SimpleEventPlugin":160,"_process":1,"fbjs/lib/ExecutionEnvironment":206}],113:[function(require,module,exports){ +},{"./BeforeInputEventPlugin":59,"./ChangeEventPlugin":63,"./ClientReactRootIndex":64,"./DefaultEventPluginOrder":69,"./EnterLeaveEventPlugin":70,"./HTMLDOMPropertyConfig":77,"./ReactBrowserComponentMixin":83,"./ReactComponentBrowserEnvironment":91,"./ReactDOMComponent":98,"./ReactDOMTextComponent":107,"./ReactDefaultBatchingStrategy":109,"./ReactDefaultPerf":111,"./ReactEventListener":119,"./ReactInjection":121,"./ReactInstanceHandles":123,"./ReactMount":128,"./ReactReconcileTransaction":139,"./SVGDOMPropertyConfig":155,"./SelectEventPlugin":156,"./ServerReactRootIndex":157,"./SimpleEventPlugin":158,"_process":23,"fbjs/lib/ExecutionEnvironment":204}],111:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -14319,7 +14246,7 @@ var ReactDefaultPerf = { }; module.exports = ReactDefaultPerf; -},{"./DOMProperty":68,"./ReactDefaultPerfAnalysis":114,"./ReactMount":130,"./ReactPerf":136,"fbjs/lib/performanceNow":229}],114:[function(require,module,exports){ +},{"./DOMProperty":66,"./ReactDefaultPerfAnalysis":112,"./ReactMount":128,"./ReactPerf":134,"fbjs/lib/performanceNow":227}],112:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -14521,7 +14448,7 @@ var ReactDefaultPerfAnalysis = { }; module.exports = ReactDefaultPerfAnalysis; -},{"./Object.assign":82}],115:[function(require,module,exports){ +},{"./Object.assign":80}],113:[function(require,module,exports){ (function (process){ /** * Copyright 2014-2015, Facebook, Inc. @@ -14772,7 +14699,7 @@ ReactElement.isValidElement = function (object) { module.exports = ReactElement; }).call(this,require('_process')) -},{"./Object.assign":82,"./ReactCurrentOwner":97,"./canDefineProperty":176,"_process":1}],116:[function(require,module,exports){ +},{"./Object.assign":80,"./ReactCurrentOwner":95,"./canDefineProperty":174,"_process":23}],114:[function(require,module,exports){ (function (process){ /** * Copyright 2014-2015, Facebook, Inc. @@ -15057,7 +14984,7 @@ var ReactElementValidator = { module.exports = ReactElementValidator; }).call(this,require('_process')) -},{"./ReactCurrentOwner":97,"./ReactElement":115,"./ReactPropTypeLocationNames":138,"./ReactPropTypeLocations":139,"./canDefineProperty":176,"./getIteratorFn":188,"_process":1,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],117:[function(require,module,exports){ +},{"./ReactCurrentOwner":95,"./ReactElement":113,"./ReactPropTypeLocationNames":136,"./ReactPropTypeLocations":137,"./canDefineProperty":174,"./getIteratorFn":186,"_process":23,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],115:[function(require,module,exports){ /** * Copyright 2014-2015, Facebook, Inc. * All rights reserved. @@ -15109,7 +15036,7 @@ assign(ReactEmptyComponent.prototype, { ReactEmptyComponent.injection = ReactEmptyComponentInjection; module.exports = ReactEmptyComponent; -},{"./Object.assign":82,"./ReactElement":115,"./ReactEmptyComponentRegistry":118,"./ReactReconciler":142}],118:[function(require,module,exports){ +},{"./Object.assign":80,"./ReactElement":113,"./ReactEmptyComponentRegistry":116,"./ReactReconciler":140}],116:[function(require,module,exports){ /** * Copyright 2014-2015, Facebook, Inc. * All rights reserved. @@ -15158,7 +15085,7 @@ var ReactEmptyComponentRegistry = { }; module.exports = ReactEmptyComponentRegistry; -},{}],119:[function(require,module,exports){ +},{}],117:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -15239,7 +15166,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = ReactErrorUtils; }).call(this,require('_process')) -},{"_process":1}],120:[function(require,module,exports){ +},{"_process":23}],118:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -15278,7 +15205,7 @@ var ReactEventEmitterMixin = { }; module.exports = ReactEventEmitterMixin; -},{"./EventPluginHub":74}],121:[function(require,module,exports){ +},{"./EventPluginHub":72}],119:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -15490,7 +15417,7 @@ var ReactEventListener = { }; module.exports = ReactEventListener; -},{"./Object.assign":82,"./PooledClass":83,"./ReactInstanceHandles":125,"./ReactMount":130,"./ReactUpdates":154,"./getEventTarget":187,"fbjs/lib/EventListener":205,"fbjs/lib/ExecutionEnvironment":206,"fbjs/lib/getUnboundedScrollPosition":217}],122:[function(require,module,exports){ +},{"./Object.assign":80,"./PooledClass":81,"./ReactInstanceHandles":123,"./ReactMount":128,"./ReactUpdates":152,"./getEventTarget":185,"fbjs/lib/EventListener":203,"fbjs/lib/ExecutionEnvironment":204,"fbjs/lib/getUnboundedScrollPosition":215}],120:[function(require,module,exports){ (function (process){ /** * Copyright 2015, Facebook, Inc. @@ -15558,7 +15485,7 @@ var ReactFragment = { module.exports = ReactFragment; }).call(this,require('_process')) -},{"./ReactChildren":90,"./ReactElement":115,"_process":1,"fbjs/lib/emptyFunction":212,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],123:[function(require,module,exports){ +},{"./ReactChildren":88,"./ReactElement":113,"_process":23,"fbjs/lib/emptyFunction":210,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],121:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -15597,7 +15524,7 @@ var ReactInjection = { }; module.exports = ReactInjection; -},{"./DOMProperty":68,"./EventPluginHub":74,"./ReactBrowserEventEmitter":86,"./ReactClass":91,"./ReactComponentEnvironment":94,"./ReactEmptyComponent":117,"./ReactNativeComponent":133,"./ReactPerf":136,"./ReactRootIndex":144,"./ReactUpdates":154}],124:[function(require,module,exports){ +},{"./DOMProperty":66,"./EventPluginHub":72,"./ReactBrowserEventEmitter":84,"./ReactClass":89,"./ReactComponentEnvironment":92,"./ReactEmptyComponent":115,"./ReactNativeComponent":131,"./ReactPerf":134,"./ReactRootIndex":142,"./ReactUpdates":152}],122:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -15722,7 +15649,7 @@ var ReactInputSelection = { }; module.exports = ReactInputSelection; -},{"./ReactDOMSelection":107,"fbjs/lib/containsNode":209,"fbjs/lib/focusNode":214,"fbjs/lib/getActiveElement":215}],125:[function(require,module,exports){ +},{"./ReactDOMSelection":105,"fbjs/lib/containsNode":207,"fbjs/lib/focusNode":212,"fbjs/lib/getActiveElement":213}],123:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -16028,7 +15955,7 @@ var ReactInstanceHandles = { module.exports = ReactInstanceHandles; }).call(this,require('_process')) -},{"./ReactRootIndex":144,"_process":1,"fbjs/lib/invariant":220}],126:[function(require,module,exports){ +},{"./ReactRootIndex":142,"_process":23,"fbjs/lib/invariant":218}],124:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -16076,7 +16003,7 @@ var ReactInstanceMap = { }; module.exports = ReactInstanceMap; -},{}],127:[function(require,module,exports){ +},{}],125:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -16154,7 +16081,7 @@ var React = { module.exports = React; }).call(this,require('_process')) -},{"./Object.assign":82,"./ReactChildren":90,"./ReactClass":91,"./ReactComponent":92,"./ReactDOMFactories":101,"./ReactElement":115,"./ReactElementValidator":116,"./ReactPropTypes":140,"./ReactVersion":155,"./onlyChild":194,"_process":1}],128:[function(require,module,exports){ +},{"./Object.assign":80,"./ReactChildren":88,"./ReactClass":89,"./ReactComponent":90,"./ReactDOMFactories":99,"./ReactElement":113,"./ReactElementValidator":114,"./ReactPropTypes":138,"./ReactVersion":153,"./onlyChild":192,"_process":23}],126:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -16224,7 +16151,7 @@ ReactLink.PropTypes = { }; module.exports = ReactLink; -},{"./React":84}],129:[function(require,module,exports){ +},{"./React":82}],127:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -16270,7 +16197,7 @@ var ReactMarkupChecksum = { }; module.exports = ReactMarkupChecksum; -},{"./adler32":175}],130:[function(require,module,exports){ +},{"./adler32":173}],128:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -17124,7 +17051,7 @@ ReactPerf.measureMethods(ReactMount, 'ReactMount', { module.exports = ReactMount; }).call(this,require('_process')) -},{"./DOMProperty":68,"./Object.assign":82,"./ReactBrowserEventEmitter":86,"./ReactCurrentOwner":97,"./ReactDOMFeatureFlags":102,"./ReactElement":115,"./ReactEmptyComponentRegistry":118,"./ReactInstanceHandles":125,"./ReactInstanceMap":126,"./ReactMarkupChecksum":129,"./ReactPerf":136,"./ReactReconciler":142,"./ReactUpdateQueue":153,"./ReactUpdates":154,"./instantiateReactComponent":191,"./setInnerHTML":197,"./shouldUpdateReactComponent":200,"./validateDOMNesting":203,"_process":1,"fbjs/lib/containsNode":209,"fbjs/lib/emptyObject":213,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],131:[function(require,module,exports){ +},{"./DOMProperty":66,"./Object.assign":80,"./ReactBrowserEventEmitter":84,"./ReactCurrentOwner":95,"./ReactDOMFeatureFlags":100,"./ReactElement":113,"./ReactEmptyComponentRegistry":116,"./ReactInstanceHandles":123,"./ReactInstanceMap":124,"./ReactMarkupChecksum":127,"./ReactPerf":134,"./ReactReconciler":140,"./ReactUpdateQueue":151,"./ReactUpdates":152,"./instantiateReactComponent":189,"./setInnerHTML":195,"./shouldUpdateReactComponent":198,"./validateDOMNesting":201,"_process":23,"fbjs/lib/containsNode":207,"fbjs/lib/emptyObject":211,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],129:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -17624,7 +17551,7 @@ var ReactMultiChild = { module.exports = ReactMultiChild; }).call(this,require('_process')) -},{"./ReactChildReconciler":89,"./ReactComponentEnvironment":94,"./ReactCurrentOwner":97,"./ReactMultiChildUpdateTypes":132,"./ReactReconciler":142,"./flattenChildren":182,"_process":1}],132:[function(require,module,exports){ +},{"./ReactChildReconciler":87,"./ReactComponentEnvironment":92,"./ReactCurrentOwner":95,"./ReactMultiChildUpdateTypes":130,"./ReactReconciler":140,"./flattenChildren":180,"_process":23}],130:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -17657,7 +17584,7 @@ var ReactMultiChildUpdateTypes = keyMirror({ }); module.exports = ReactMultiChildUpdateTypes; -},{"fbjs/lib/keyMirror":224}],133:[function(require,module,exports){ +},{"fbjs/lib/keyMirror":222}],131:[function(require,module,exports){ (function (process){ /** * Copyright 2014-2015, Facebook, Inc. @@ -17755,7 +17682,7 @@ var ReactNativeComponent = { module.exports = ReactNativeComponent; }).call(this,require('_process')) -},{"./Object.assign":82,"_process":1,"fbjs/lib/invariant":220}],134:[function(require,module,exports){ +},{"./Object.assign":80,"_process":23,"fbjs/lib/invariant":218}],132:[function(require,module,exports){ (function (process){ /** * Copyright 2015, Facebook, Inc. @@ -17877,7 +17804,7 @@ var ReactNoopUpdateQueue = { module.exports = ReactNoopUpdateQueue; }).call(this,require('_process')) -},{"_process":1,"fbjs/lib/warning":232}],135:[function(require,module,exports){ +},{"_process":23,"fbjs/lib/warning":230}],133:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -17972,7 +17899,7 @@ var ReactOwner = { module.exports = ReactOwner; }).call(this,require('_process')) -},{"_process":1,"fbjs/lib/invariant":220}],136:[function(require,module,exports){ +},{"_process":23,"fbjs/lib/invariant":218}],134:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -18072,7 +17999,7 @@ function _noMeasure(objName, fnName, func) { module.exports = ReactPerf; }).call(this,require('_process')) -},{"_process":1}],137:[function(require,module,exports){ +},{"_process":23}],135:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -18181,7 +18108,7 @@ var ReactPropTransferer = { }; module.exports = ReactPropTransferer; -},{"./Object.assign":82,"fbjs/lib/emptyFunction":212,"fbjs/lib/joinClasses":223}],138:[function(require,module,exports){ +},{"./Object.assign":80,"fbjs/lib/emptyFunction":210,"fbjs/lib/joinClasses":221}],136:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -18209,7 +18136,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = ReactPropTypeLocationNames; }).call(this,require('_process')) -},{"_process":1}],139:[function(require,module,exports){ +},{"_process":23}],137:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -18232,7 +18159,7 @@ var ReactPropTypeLocations = keyMirror({ }); module.exports = ReactPropTypeLocations; -},{"fbjs/lib/keyMirror":224}],140:[function(require,module,exports){ +},{"fbjs/lib/keyMirror":222}],138:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -18589,7 +18516,7 @@ function getClassName(propValue) { } module.exports = ReactPropTypes; -},{"./ReactElement":115,"./ReactPropTypeLocationNames":138,"./getIteratorFn":188,"fbjs/lib/emptyFunction":212}],141:[function(require,module,exports){ +},{"./ReactElement":113,"./ReactPropTypeLocationNames":136,"./getIteratorFn":186,"fbjs/lib/emptyFunction":210}],139:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -18741,7 +18668,7 @@ assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin); PooledClass.addPoolingTo(ReactReconcileTransaction); module.exports = ReactReconcileTransaction; -},{"./CallbackQueue":64,"./Object.assign":82,"./PooledClass":83,"./ReactBrowserEventEmitter":86,"./ReactDOMFeatureFlags":102,"./ReactInputSelection":124,"./Transaction":172}],142:[function(require,module,exports){ +},{"./CallbackQueue":62,"./Object.assign":80,"./PooledClass":81,"./ReactBrowserEventEmitter":84,"./ReactDOMFeatureFlags":100,"./ReactInputSelection":122,"./Transaction":170}],140:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -18849,7 +18776,7 @@ var ReactReconciler = { }; module.exports = ReactReconciler; -},{"./ReactRef":143}],143:[function(require,module,exports){ +},{"./ReactRef":141}],141:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -18928,7 +18855,7 @@ ReactRef.detachRefs = function (instance, element) { }; module.exports = ReactRef; -},{"./ReactOwner":135}],144:[function(require,module,exports){ +},{"./ReactOwner":133}],142:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -18958,7 +18885,7 @@ var ReactRootIndex = { }; module.exports = ReactRootIndex; -},{}],145:[function(require,module,exports){ +},{}],143:[function(require,module,exports){ /** * Copyright 2014-2015, Facebook, Inc. * All rights reserved. @@ -18982,7 +18909,7 @@ var ReactServerBatchingStrategy = { }; module.exports = ReactServerBatchingStrategy; -},{}],146:[function(require,module,exports){ +},{}],144:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -19069,7 +18996,7 @@ module.exports = { }; }).call(this,require('_process')) -},{"./ReactDefaultBatchingStrategy":111,"./ReactElement":115,"./ReactInstanceHandles":125,"./ReactMarkupChecksum":129,"./ReactServerBatchingStrategy":145,"./ReactServerRenderingTransaction":147,"./ReactUpdates":154,"./instantiateReactComponent":191,"_process":1,"fbjs/lib/emptyObject":213,"fbjs/lib/invariant":220}],147:[function(require,module,exports){ +},{"./ReactDefaultBatchingStrategy":109,"./ReactElement":113,"./ReactInstanceHandles":123,"./ReactMarkupChecksum":127,"./ReactServerBatchingStrategy":143,"./ReactServerRenderingTransaction":145,"./ReactUpdates":152,"./instantiateReactComponent":189,"_process":23,"fbjs/lib/emptyObject":211,"fbjs/lib/invariant":218}],145:[function(require,module,exports){ /** * Copyright 2014-2015, Facebook, Inc. * All rights reserved. @@ -19157,7 +19084,7 @@ assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin); PooledClass.addPoolingTo(ReactServerRenderingTransaction); module.exports = ReactServerRenderingTransaction; -},{"./CallbackQueue":64,"./Object.assign":82,"./PooledClass":83,"./Transaction":172,"fbjs/lib/emptyFunction":212}],148:[function(require,module,exports){ +},{"./CallbackQueue":62,"./Object.assign":80,"./PooledClass":81,"./Transaction":170,"fbjs/lib/emptyFunction":210}],146:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -19262,7 +19189,7 @@ ReactStateSetters.Mixin = { }; module.exports = ReactStateSetters; -},{}],149:[function(require,module,exports){ +},{}],147:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -19743,7 +19670,7 @@ Object.keys(topLevelTypes).forEach(function (eventType) { module.exports = ReactTestUtils; }).call(this,require('_process')) -},{"./EventConstants":73,"./EventPluginHub":74,"./EventPropagators":77,"./Object.assign":82,"./React":84,"./ReactBrowserEventEmitter":86,"./ReactCompositeComponent":96,"./ReactDOM":98,"./ReactElement":115,"./ReactInstanceHandles":125,"./ReactInstanceMap":126,"./ReactMount":130,"./ReactUpdates":154,"./SyntheticEvent":164,"./findDOMNode":181,"_process":1,"fbjs/lib/emptyObject":213,"fbjs/lib/invariant":220}],150:[function(require,module,exports){ +},{"./EventConstants":71,"./EventPluginHub":72,"./EventPropagators":75,"./Object.assign":80,"./React":82,"./ReactBrowserEventEmitter":84,"./ReactCompositeComponent":94,"./ReactDOM":96,"./ReactElement":113,"./ReactInstanceHandles":123,"./ReactInstanceMap":124,"./ReactMount":128,"./ReactUpdates":152,"./SyntheticEvent":162,"./findDOMNode":179,"_process":23,"fbjs/lib/emptyObject":211,"fbjs/lib/invariant":218}],148:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -19842,7 +19769,7 @@ var ReactTransitionChildMapping = { }; module.exports = ReactTransitionChildMapping; -},{"./flattenChildren":182}],151:[function(require,module,exports){ +},{"./flattenChildren":180}],149:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -19952,7 +19879,7 @@ var ReactTransitionEvents = { }; module.exports = ReactTransitionEvents; -},{"fbjs/lib/ExecutionEnvironment":206}],152:[function(require,module,exports){ +},{"fbjs/lib/ExecutionEnvironment":204}],150:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -20158,7 +20085,7 @@ var ReactTransitionGroup = React.createClass({ }); module.exports = ReactTransitionGroup; -},{"./Object.assign":82,"./React":84,"./ReactTransitionChildMapping":150,"fbjs/lib/emptyFunction":212}],153:[function(require,module,exports){ +},{"./Object.assign":80,"./React":82,"./ReactTransitionChildMapping":148,"fbjs/lib/emptyFunction":210}],151:[function(require,module,exports){ (function (process){ /** * Copyright 2015, Facebook, Inc. @@ -20419,7 +20346,7 @@ var ReactUpdateQueue = { module.exports = ReactUpdateQueue; }).call(this,require('_process')) -},{"./Object.assign":82,"./ReactCurrentOwner":97,"./ReactElement":115,"./ReactInstanceMap":126,"./ReactUpdates":154,"_process":1,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],154:[function(require,module,exports){ +},{"./Object.assign":80,"./ReactCurrentOwner":95,"./ReactElement":113,"./ReactInstanceMap":124,"./ReactUpdates":152,"_process":23,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],152:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -20646,7 +20573,7 @@ var ReactUpdates = { module.exports = ReactUpdates; }).call(this,require('_process')) -},{"./CallbackQueue":64,"./Object.assign":82,"./PooledClass":83,"./ReactPerf":136,"./ReactReconciler":142,"./Transaction":172,"_process":1,"fbjs/lib/invariant":220}],155:[function(require,module,exports){ +},{"./CallbackQueue":62,"./Object.assign":80,"./PooledClass":81,"./ReactPerf":134,"./ReactReconciler":140,"./Transaction":170,"_process":23,"fbjs/lib/invariant":218}],153:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -20661,7 +20588,7 @@ module.exports = ReactUpdates; 'use strict'; module.exports = '0.14.7'; -},{}],156:[function(require,module,exports){ +},{}],154:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -20725,7 +20652,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = React; }).call(this,require('_process')) -},{"./LinkedStateMixin":80,"./React":84,"./ReactCSSTransitionGroup":87,"./ReactComponentWithPureRenderMixin":95,"./ReactDefaultPerf":113,"./ReactFragment":122,"./ReactTestUtils":149,"./ReactTransitionGroup":152,"./ReactUpdates":154,"./cloneWithProps":177,"./shallowCompare":199,"./update":202,"_process":1,"fbjs/lib/warning":232}],157:[function(require,module,exports){ +},{"./LinkedStateMixin":78,"./React":82,"./ReactCSSTransitionGroup":85,"./ReactComponentWithPureRenderMixin":93,"./ReactDefaultPerf":111,"./ReactFragment":120,"./ReactTestUtils":147,"./ReactTransitionGroup":150,"./ReactUpdates":152,"./cloneWithProps":175,"./shallowCompare":197,"./update":200,"_process":23,"fbjs/lib/warning":230}],155:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -20853,7 +20780,7 @@ var SVGDOMPropertyConfig = { }; module.exports = SVGDOMPropertyConfig; -},{"./DOMProperty":68}],158:[function(require,module,exports){ +},{"./DOMProperty":66}],156:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -21055,7 +20982,7 @@ var SelectEventPlugin = { }; module.exports = SelectEventPlugin; -},{"./EventConstants":73,"./EventPropagators":77,"./ReactInputSelection":124,"./SyntheticEvent":164,"./isTextInputElement":193,"fbjs/lib/ExecutionEnvironment":206,"fbjs/lib/getActiveElement":215,"fbjs/lib/keyOf":225,"fbjs/lib/shallowEqual":230}],159:[function(require,module,exports){ +},{"./EventConstants":71,"./EventPropagators":75,"./ReactInputSelection":122,"./SyntheticEvent":162,"./isTextInputElement":191,"fbjs/lib/ExecutionEnvironment":204,"fbjs/lib/getActiveElement":213,"fbjs/lib/keyOf":223,"fbjs/lib/shallowEqual":228}],157:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -21085,7 +21012,7 @@ var ServerReactRootIndex = { }; module.exports = ServerReactRootIndex; -},{}],160:[function(require,module,exports){ +},{}],158:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -21676,7 +21603,7 @@ var SimpleEventPlugin = { module.exports = SimpleEventPlugin; }).call(this,require('_process')) -},{"./EventConstants":73,"./EventPropagators":77,"./ReactMount":130,"./SyntheticClipboardEvent":161,"./SyntheticDragEvent":163,"./SyntheticEvent":164,"./SyntheticFocusEvent":165,"./SyntheticKeyboardEvent":167,"./SyntheticMouseEvent":168,"./SyntheticTouchEvent":169,"./SyntheticUIEvent":170,"./SyntheticWheelEvent":171,"./getEventCharCode":184,"_process":1,"fbjs/lib/EventListener":205,"fbjs/lib/emptyFunction":212,"fbjs/lib/invariant":220,"fbjs/lib/keyOf":225}],161:[function(require,module,exports){ +},{"./EventConstants":71,"./EventPropagators":75,"./ReactMount":128,"./SyntheticClipboardEvent":159,"./SyntheticDragEvent":161,"./SyntheticEvent":162,"./SyntheticFocusEvent":163,"./SyntheticKeyboardEvent":165,"./SyntheticMouseEvent":166,"./SyntheticTouchEvent":167,"./SyntheticUIEvent":168,"./SyntheticWheelEvent":169,"./getEventCharCode":182,"_process":23,"fbjs/lib/EventListener":203,"fbjs/lib/emptyFunction":210,"fbjs/lib/invariant":218,"fbjs/lib/keyOf":223}],159:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -21716,7 +21643,7 @@ function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, na SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); module.exports = SyntheticClipboardEvent; -},{"./SyntheticEvent":164}],162:[function(require,module,exports){ +},{"./SyntheticEvent":162}],160:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -21754,7 +21681,7 @@ function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface); module.exports = SyntheticCompositionEvent; -},{"./SyntheticEvent":164}],163:[function(require,module,exports){ +},{"./SyntheticEvent":162}],161:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -21792,7 +21719,7 @@ function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeE SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface); module.exports = SyntheticDragEvent; -},{"./SyntheticMouseEvent":168}],164:[function(require,module,exports){ +},{"./SyntheticMouseEvent":166}],162:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -21976,7 +21903,7 @@ PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler); module.exports = SyntheticEvent; }).call(this,require('_process')) -},{"./Object.assign":82,"./PooledClass":83,"_process":1,"fbjs/lib/emptyFunction":212,"fbjs/lib/warning":232}],165:[function(require,module,exports){ +},{"./Object.assign":80,"./PooledClass":81,"_process":23,"fbjs/lib/emptyFunction":210,"fbjs/lib/warning":230}],163:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -22014,7 +21941,7 @@ function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); module.exports = SyntheticFocusEvent; -},{"./SyntheticUIEvent":170}],166:[function(require,module,exports){ +},{"./SyntheticUIEvent":168}],164:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -22053,7 +21980,7 @@ function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface); module.exports = SyntheticInputEvent; -},{"./SyntheticEvent":164}],167:[function(require,module,exports){ +},{"./SyntheticEvent":162}],165:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -22139,7 +22066,7 @@ function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nat SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); module.exports = SyntheticKeyboardEvent; -},{"./SyntheticUIEvent":170,"./getEventCharCode":184,"./getEventKey":185,"./getEventModifierState":186}],168:[function(require,module,exports){ +},{"./SyntheticUIEvent":168,"./getEventCharCode":182,"./getEventKey":183,"./getEventModifierState":184}],166:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -22213,7 +22140,7 @@ function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); module.exports = SyntheticMouseEvent; -},{"./SyntheticUIEvent":170,"./ViewportMetrics":173,"./getEventModifierState":186}],169:[function(require,module,exports){ +},{"./SyntheticUIEvent":168,"./ViewportMetrics":171,"./getEventModifierState":184}],167:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -22260,7 +22187,7 @@ function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); module.exports = SyntheticTouchEvent; -},{"./SyntheticUIEvent":170,"./getEventModifierState":186}],170:[function(require,module,exports){ +},{"./SyntheticUIEvent":168,"./getEventModifierState":184}],168:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -22321,7 +22248,7 @@ function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEve SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); module.exports = SyntheticUIEvent; -},{"./SyntheticEvent":164,"./getEventTarget":187}],171:[function(require,module,exports){ +},{"./SyntheticEvent":162,"./getEventTarget":185}],169:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -22377,7 +22304,7 @@ function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); module.exports = SyntheticWheelEvent; -},{"./SyntheticMouseEvent":168}],172:[function(require,module,exports){ +},{"./SyntheticMouseEvent":166}],170:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -22612,7 +22539,7 @@ var Transaction = { module.exports = Transaction; }).call(this,require('_process')) -},{"_process":1,"fbjs/lib/invariant":220}],173:[function(require,module,exports){ +},{"_process":23,"fbjs/lib/invariant":218}],171:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -22640,7 +22567,7 @@ var ViewportMetrics = { }; module.exports = ViewportMetrics; -},{}],174:[function(require,module,exports){ +},{}],172:[function(require,module,exports){ (function (process){ /** * Copyright 2014-2015, Facebook, Inc. @@ -22703,7 +22630,7 @@ function accumulateInto(current, next) { module.exports = accumulateInto; }).call(this,require('_process')) -},{"_process":1,"fbjs/lib/invariant":220}],175:[function(require,module,exports){ +},{"_process":23,"fbjs/lib/invariant":218}],173:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -22746,7 +22673,7 @@ function adler32(data) { } module.exports = adler32; -},{}],176:[function(require,module,exports){ +},{}],174:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -22774,7 +22701,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = canDefineProperty; }).call(this,require('_process')) -},{"_process":1}],177:[function(require,module,exports){ +},{"_process":23}],175:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -22832,7 +22759,7 @@ function cloneWithProps(child, props) { module.exports = cloneWithProps; }).call(this,require('_process')) -},{"./ReactElement":115,"./ReactPropTransferer":137,"_process":1,"fbjs/lib/keyOf":225,"fbjs/lib/warning":232}],178:[function(require,module,exports){ +},{"./ReactElement":113,"./ReactPropTransferer":135,"_process":23,"fbjs/lib/keyOf":223,"fbjs/lib/warning":230}],176:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -22888,7 +22815,7 @@ function dangerousStyleValue(name, value) { } module.exports = dangerousStyleValue; -},{"./CSSProperty":62}],179:[function(require,module,exports){ +},{"./CSSProperty":60}],177:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -22940,7 +22867,7 @@ function deprecated(fnName, newModule, newPackage, ctx, fn) { module.exports = deprecated; }).call(this,require('_process')) -},{"./Object.assign":82,"_process":1,"fbjs/lib/warning":232}],180:[function(require,module,exports){ +},{"./Object.assign":80,"_process":23,"fbjs/lib/warning":230}],178:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -22979,7 +22906,7 @@ function escapeTextContentForBrowser(text) { } module.exports = escapeTextContentForBrowser; -},{}],181:[function(require,module,exports){ +},{}],179:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -23032,7 +22959,7 @@ function findDOMNode(componentOrElement) { module.exports = findDOMNode; }).call(this,require('_process')) -},{"./ReactCurrentOwner":97,"./ReactInstanceMap":126,"./ReactMount":130,"_process":1,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],182:[function(require,module,exports){ +},{"./ReactCurrentOwner":95,"./ReactInstanceMap":124,"./ReactMount":128,"_process":23,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],180:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -23084,7 +23011,7 @@ function flattenChildren(children) { module.exports = flattenChildren; }).call(this,require('_process')) -},{"./traverseAllChildren":201,"_process":1,"fbjs/lib/warning":232}],183:[function(require,module,exports){ +},{"./traverseAllChildren":199,"_process":23,"fbjs/lib/warning":230}],181:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23114,7 +23041,7 @@ var forEachAccumulated = function (arr, cb, scope) { }; module.exports = forEachAccumulated; -},{}],184:[function(require,module,exports){ +},{}],182:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23165,7 +23092,7 @@ function getEventCharCode(nativeEvent) { } module.exports = getEventCharCode; -},{}],185:[function(require,module,exports){ +},{}],183:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23269,7 +23196,7 @@ function getEventKey(nativeEvent) { } module.exports = getEventKey; -},{"./getEventCharCode":184}],186:[function(require,module,exports){ +},{"./getEventCharCode":182}],184:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23314,7 +23241,7 @@ function getEventModifierState(nativeEvent) { } module.exports = getEventModifierState; -},{}],187:[function(require,module,exports){ +},{}],185:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23344,7 +23271,7 @@ function getEventTarget(nativeEvent) { } module.exports = getEventTarget; -},{}],188:[function(require,module,exports){ +},{}],186:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23385,7 +23312,7 @@ function getIteratorFn(maybeIterable) { } module.exports = getIteratorFn; -},{}],189:[function(require,module,exports){ +},{}],187:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23459,7 +23386,7 @@ function getNodeForCharacterOffset(root, offset) { } module.exports = getNodeForCharacterOffset; -},{}],190:[function(require,module,exports){ +},{}],188:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23493,7 +23420,7 @@ function getTextContentAccessor() { } module.exports = getTextContentAccessor; -},{"fbjs/lib/ExecutionEnvironment":206}],191:[function(require,module,exports){ +},{"fbjs/lib/ExecutionEnvironment":204}],189:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -23609,7 +23536,7 @@ function instantiateReactComponent(node) { module.exports = instantiateReactComponent; }).call(this,require('_process')) -},{"./Object.assign":82,"./ReactCompositeComponent":96,"./ReactEmptyComponent":117,"./ReactNativeComponent":133,"_process":1,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],192:[function(require,module,exports){ +},{"./Object.assign":80,"./ReactCompositeComponent":94,"./ReactEmptyComponent":115,"./ReactNativeComponent":131,"_process":23,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],190:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23670,7 +23597,7 @@ function isEventSupported(eventNameSuffix, capture) { } module.exports = isEventSupported; -},{"fbjs/lib/ExecutionEnvironment":206}],193:[function(require,module,exports){ +},{"fbjs/lib/ExecutionEnvironment":204}],191:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23711,7 +23638,7 @@ function isTextInputElement(elem) { } module.exports = isTextInputElement; -},{}],194:[function(require,module,exports){ +},{}],192:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -23748,7 +23675,7 @@ function onlyChild(children) { module.exports = onlyChild; }).call(this,require('_process')) -},{"./ReactElement":115,"_process":1,"fbjs/lib/invariant":220}],195:[function(require,module,exports){ +},{"./ReactElement":113,"_process":23,"fbjs/lib/invariant":218}],193:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23775,7 +23702,7 @@ function quoteAttributeValueForBrowser(value) { } module.exports = quoteAttributeValueForBrowser; -},{"./escapeTextContentForBrowser":180}],196:[function(require,module,exports){ +},{"./escapeTextContentForBrowser":178}],194:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23792,7 +23719,7 @@ module.exports = quoteAttributeValueForBrowser; var ReactMount = require('./ReactMount'); module.exports = ReactMount.renderSubtreeIntoContainer; -},{"./ReactMount":130}],197:[function(require,module,exports){ +},{"./ReactMount":128}],195:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23883,7 +23810,7 @@ if (ExecutionEnvironment.canUseDOM) { } module.exports = setInnerHTML; -},{"fbjs/lib/ExecutionEnvironment":206}],198:[function(require,module,exports){ +},{"fbjs/lib/ExecutionEnvironment":204}],196:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23924,7 +23851,7 @@ if (ExecutionEnvironment.canUseDOM) { } module.exports = setTextContent; -},{"./escapeTextContentForBrowser":180,"./setInnerHTML":197,"fbjs/lib/ExecutionEnvironment":206}],199:[function(require,module,exports){ +},{"./escapeTextContentForBrowser":178,"./setInnerHTML":195,"fbjs/lib/ExecutionEnvironment":204}],197:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23949,7 +23876,7 @@ function shallowCompare(instance, nextProps, nextState) { } module.exports = shallowCompare; -},{"fbjs/lib/shallowEqual":230}],200:[function(require,module,exports){ +},{"fbjs/lib/shallowEqual":228}],198:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -23993,7 +23920,7 @@ function shouldUpdateReactComponent(prevElement, nextElement) { } module.exports = shouldUpdateReactComponent; -},{}],201:[function(require,module,exports){ +},{}],199:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -24186,7 +24113,7 @@ function traverseAllChildren(children, callback, traverseContext) { module.exports = traverseAllChildren; }).call(this,require('_process')) -},{"./ReactCurrentOwner":97,"./ReactElement":115,"./ReactInstanceHandles":125,"./getIteratorFn":188,"_process":1,"fbjs/lib/invariant":220,"fbjs/lib/warning":232}],202:[function(require,module,exports){ +},{"./ReactCurrentOwner":95,"./ReactElement":113,"./ReactInstanceHandles":123,"./getIteratorFn":186,"_process":23,"fbjs/lib/invariant":218,"fbjs/lib/warning":230}],200:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -24297,7 +24224,7 @@ function update(value, spec) { module.exports = update; }).call(this,require('_process')) -},{"./Object.assign":82,"_process":1,"fbjs/lib/invariant":220,"fbjs/lib/keyOf":225}],203:[function(require,module,exports){ +},{"./Object.assign":80,"_process":23,"fbjs/lib/invariant":218,"fbjs/lib/keyOf":223}],201:[function(require,module,exports){ (function (process){ /** * Copyright 2015, Facebook, Inc. @@ -24664,7 +24591,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = validateDOMNesting; }).call(this,require('_process')) -},{"./Object.assign":82,"_process":1,"fbjs/lib/emptyFunction":212,"fbjs/lib/warning":232}],204:[function(require,module,exports){ +},{"./Object.assign":80,"_process":23,"fbjs/lib/emptyFunction":210,"fbjs/lib/warning":230}],202:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -24765,7 +24692,7 @@ var CSSCore = { module.exports = CSSCore; }).call(this,require('_process')) -},{"./invariant":220,"_process":1}],205:[function(require,module,exports){ +},{"./invariant":218,"_process":23}],203:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -24853,7 +24780,7 @@ var EventListener = { module.exports = EventListener; }).call(this,require('_process')) -},{"./emptyFunction":212,"_process":1}],206:[function(require,module,exports){ +},{"./emptyFunction":210,"_process":23}],204:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -24890,7 +24817,7 @@ var ExecutionEnvironment = { }; module.exports = ExecutionEnvironment; -},{}],207:[function(require,module,exports){ +},{}],205:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -24923,7 +24850,7 @@ function camelize(string) { } module.exports = camelize; -},{}],208:[function(require,module,exports){ +},{}],206:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -24964,7 +24891,7 @@ function camelizeStyleName(string) { } module.exports = camelizeStyleName; -},{"./camelize":207}],209:[function(require,module,exports){ +},{"./camelize":205}],207:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25020,7 +24947,7 @@ function containsNode(_x, _x2) { } module.exports = containsNode; -},{"./isTextNode":222}],210:[function(require,module,exports){ +},{"./isTextNode":220}],208:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25106,7 +25033,7 @@ function createArrayFromMixed(obj) { } module.exports = createArrayFromMixed; -},{"./toArray":231}],211:[function(require,module,exports){ +},{"./toArray":229}],209:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -25194,7 +25121,7 @@ function createNodesFromMarkup(markup, handleScript) { module.exports = createNodesFromMarkup; }).call(this,require('_process')) -},{"./ExecutionEnvironment":206,"./createArrayFromMixed":210,"./getMarkupWrap":216,"./invariant":220,"_process":1}],212:[function(require,module,exports){ +},{"./ExecutionEnvironment":204,"./createArrayFromMixed":208,"./getMarkupWrap":214,"./invariant":218,"_process":23}],210:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25233,7 +25160,7 @@ emptyFunction.thatReturnsArgument = function (arg) { }; module.exports = emptyFunction; -},{}],213:[function(require,module,exports){ +},{}],211:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -25257,7 +25184,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = emptyObject; }).call(this,require('_process')) -},{"_process":1}],214:[function(require,module,exports){ +},{"_process":23}],212:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25284,7 +25211,7 @@ function focusNode(node) { } module.exports = focusNode; -},{}],215:[function(require,module,exports){ +},{}],213:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25320,7 +25247,7 @@ function getActiveElement() /*?DOMElement*/{ } module.exports = getActiveElement; -},{}],216:[function(require,module,exports){ +},{}],214:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -25419,7 +25346,7 @@ function getMarkupWrap(nodeName) { module.exports = getMarkupWrap; }).call(this,require('_process')) -},{"./ExecutionEnvironment":206,"./invariant":220,"_process":1}],217:[function(require,module,exports){ +},{"./ExecutionEnvironment":204,"./invariant":218,"_process":23}],215:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25458,7 +25385,7 @@ function getUnboundedScrollPosition(scrollable) { } module.exports = getUnboundedScrollPosition; -},{}],218:[function(require,module,exports){ +},{}],216:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25492,7 +25419,7 @@ function hyphenate(string) { } module.exports = hyphenate; -},{}],219:[function(require,module,exports){ +},{}],217:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25532,7 +25459,7 @@ function hyphenateStyleName(string) { } module.exports = hyphenateStyleName; -},{"./hyphenate":218}],220:[function(require,module,exports){ +},{"./hyphenate":216}],218:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -25586,7 +25513,7 @@ function invariant(condition, format, a, b, c, d, e, f) { module.exports = invariant; }).call(this,require('_process')) -},{"_process":1}],221:[function(require,module,exports){ +},{"_process":23}],219:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25610,7 +25537,7 @@ function isNode(object) { } module.exports = isNode; -},{}],222:[function(require,module,exports){ +},{}],220:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25636,7 +25563,7 @@ function isTextNode(object) { } module.exports = isTextNode; -},{"./isNode":221}],223:[function(require,module,exports){ +},{"./isNode":219}],221:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25676,7 +25603,7 @@ function joinClasses(className /*, ... */) { } module.exports = joinClasses; -},{}],224:[function(require,module,exports){ +},{}],222:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -25728,7 +25655,7 @@ var keyMirror = function (obj) { module.exports = keyMirror; }).call(this,require('_process')) -},{"./invariant":220,"_process":1}],225:[function(require,module,exports){ +},{"./invariant":218,"_process":23}],223:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25764,7 +25691,7 @@ var keyOf = function (oneKeyObj) { }; module.exports = keyOf; -},{}],226:[function(require,module,exports){ +},{}],224:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25816,7 +25743,7 @@ function mapObject(object, callback, context) { } module.exports = mapObject; -},{}],227:[function(require,module,exports){ +},{}],225:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25848,7 +25775,7 @@ function memoizeStringOnly(callback) { } module.exports = memoizeStringOnly; -},{}],228:[function(require,module,exports){ +},{}],226:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25872,7 +25799,7 @@ if (ExecutionEnvironment.canUseDOM) { } module.exports = performance || {}; -},{"./ExecutionEnvironment":206}],229:[function(require,module,exports){ +},{"./ExecutionEnvironment":204}],227:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25907,7 +25834,7 @@ if (performance.now) { } module.exports = performanceNow; -},{"./performance":228}],230:[function(require,module,exports){ +},{"./performance":226}],228:[function(require,module,exports){ /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. @@ -25958,7 +25885,7 @@ function shallowEqual(objA, objB) { } module.exports = shallowEqual; -},{}],231:[function(require,module,exports){ +},{}],229:[function(require,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -26019,7 +25946,7 @@ function toArray(obj) { module.exports = toArray; }).call(this,require('_process')) -},{"./invariant":220,"_process":1}],232:[function(require,module,exports){ +},{"./invariant":218,"_process":23}],230:[function(require,module,exports){ (function (process){ /** * Copyright 2014-2015, Facebook, Inc. @@ -26080,7 +26007,80 @@ if (process.env.NODE_ENV !== 'production') { module.exports = warning; }).call(this,require('_process')) -},{"./emptyFunction":212,"_process":1}],"flux":[function(require,module,exports){ +},{"./emptyFunction":210,"_process":23}],231:[function(require,module,exports){ +'use strict'; +module.exports = function (str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase(); + }); +}; + +},{}],232:[function(require,module,exports){ +(function (process){ +/** + * Copyright 2014-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. + */ + +'use strict'; + +/** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var warning = function() {}; + +if (process.env.NODE_ENV !== 'production') { + warning = function(condition, format, args) { + var len = arguments.length; + args = new Array(len > 2 ? len - 2 : 0); + for (var key = 2; key < len; key++) { + args[key - 2] = arguments[key]; + } + if (format === undefined) { + throw new Error( + '`warning(condition, format, ...args)` requires a warning ' + + 'message argument' + ); + } + + if (format.length < 10 || (/^[s\W]*$/).test(format)) { + throw new Error( + 'The warning format should be able to uniquely identify this ' + + 'warning. Please, use a more descriptive format than: ' + format + ); + } + + if (!condition) { + var argIndex = 0; + var message = 'Warning: ' + + format.replace(/%s/g, function() { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch(x) {} + } + }; +} + +module.exports = warning; + +}).call(this,require('_process')) + +},{"_process":23}],"flux":[function(require,module,exports){ /** * Copyright (c) 2014-2015, Facebook, Inc. * All rights reserved. @@ -26092,7 +26092,7 @@ module.exports = warning; module.exports.Dispatcher = require('./lib/Dispatcher'); -},{"./lib/Dispatcher":2}],"jquery":[function(require,module,exports){ +},{"./lib/Dispatcher":5}],"jquery":[function(require,module,exports){ /*! * jQuery JavaScript Library v2.2.1 * http://jquery.com/ @@ -50868,7 +50868,7 @@ return jQuery; module.exports = require('react/lib/ReactDOM'); -},{"react/lib/ReactDOM":98}],"react-router":[function(require,module,exports){ +},{"react/lib/ReactDOM":96}],"react-router":[function(require,module,exports){ /* components */ 'use strict'; @@ -51005,7 +51005,7 @@ var _createMemoryHistory2 = require('./createMemoryHistory'); var _createMemoryHistory3 = _interopRequireDefault(_createMemoryHistory2); exports.createMemoryHistory = _createMemoryHistory3['default']; -},{"./History":5,"./IndexLink":6,"./IndexRedirect":7,"./IndexRoute":8,"./Lifecycle":9,"./Link":10,"./PatternUtils":11,"./PropTypes":12,"./Redirect":13,"./Route":14,"./RouteContext":15,"./RouteUtils":16,"./Router":17,"./RouterContext":18,"./RoutingContext":20,"./browserHistory":22,"./createMemoryHistory":24,"./hashHistory":30,"./match":32,"./useRouterHistory":35,"./useRoutes":36}],"react/addons":[function(require,module,exports){ +},{"./History":26,"./IndexLink":27,"./IndexRedirect":28,"./IndexRoute":29,"./Lifecycle":30,"./Link":31,"./PatternUtils":32,"./PropTypes":33,"./Redirect":34,"./Route":35,"./RouteContext":36,"./RouteUtils":37,"./Router":38,"./RouterContext":39,"./RoutingContext":41,"./browserHistory":43,"./createMemoryHistory":45,"./hashHistory":51,"./match":53,"./useRouterHistory":56,"./useRoutes":57}],"react/addons":[function(require,module,exports){ 'use strict'; var warning = require('fbjs/lib/warning'); @@ -51020,12 +51020,12 @@ warning( module.exports = require('./lib/ReactWithAddons'); -},{"./lib/ReactWithAddons":156,"fbjs/lib/warning":232}],"react":[function(require,module,exports){ +},{"./lib/ReactWithAddons":154,"fbjs/lib/warning":230}],"react":[function(require,module,exports){ 'use strict'; module.exports = require('./lib/React'); -},{"./lib/React":84}]},{},[]) +},{"./lib/React":82}]},{},[]) //# sourceMappingURL=vendor.js.map diff --git a/web/src/js/components/flowtable.js b/web/src/js/components/flowtable.js index 1d99c318..988d1895 100644 --- a/web/src/js/components/flowtable.js +++ b/web/src/js/components/flowtable.js @@ -143,7 +143,7 @@ var FlowTable = React.createClass({ }, scrollIntoView: function (flow) { this.scrollRowIntoView( - this.context.view.index(flow), + this.context.view.indexOf(flow), ReactDOM.findDOMNode(this.refs.body).offsetTop ); }, diff --git a/web/src/js/store/view.js b/web/src/js/store/view.js index 3ec337a1..d8aeba60 100644 --- a/web/src/js/store/view.js +++ b/web/src/js/store/view.js @@ -59,12 +59,12 @@ _.extend(StoreView.prototype, EventEmitter.prototype, { }); this.emit("recalculate"); }, - index: function (elem) { - return _.sortedIndexBy(this.list, elem, this.sortfun); + indexOf: function (elem) { + return this.list.indexOf(elem, _.sortedIndexBy(this.list, elem, this.sortfun)); }, add: function (elem) { if (this.filt(elem)) { - var idx = this.index(elem); + var idx = _.sortedIndexBy(this.list, elem, this.sortfun); if (idx === this.list.length) { //happens often, .push is way faster. this.list.push(elem); } else { -- cgit v1.2.3