'use strict';

var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

(function webpackUniversalModuleDefinition(root, factory) {
	if ((typeof exports === 'undefined' ? 'undefined' : _typeof2(exports)) === 'object' && (typeof module === 'undefined' ? 'undefined' : _typeof2(module)) === 'object') module.exports = factory();else if (typeof define === 'function' && define.amd) define([], factory);else if ((typeof exports === 'undefined' ? 'undefined' : _typeof2(exports)) === 'object') exports["History"] = factory();else root["History"] = factory();
})(undefined, function () {
	return (/******/function (modules) {
			// webpackBootstrap
			/******/ // The module cache
			/******/var installedModules = {};

			/******/ // The require function
			/******/function __webpack_require__(moduleId) {

				/******/ // Check if module is in cache
				/******/if (installedModules[moduleId])
					/******/return installedModules[moduleId].exports;

				/******/ // Create a new module (and put it into the cache)
				/******/var module = installedModules[moduleId] = {
					/******/exports: {},
					/******/id: moduleId,
					/******/loaded: false
					/******/ };

				/******/ // Execute the module function
				/******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

				/******/ // Flag the module as loaded
				/******/module.loaded = true;

				/******/ // Return the exports of the module
				/******/return module.exports;
				/******/
			}

			/******/ // expose the modules object (__webpack_modules__)
			/******/__webpack_require__.m = modules;

			/******/ // expose the module cache
			/******/__webpack_require__.c = installedModules;

			/******/ // __webpack_public_path__
			/******/__webpack_require__.p = "";

			/******/ // Load entry module and return exports
			/******/return __webpack_require__(0);
			/******/
		}(
		/************************************************************************/
		/******/[
		/* 0 */
		/***/function (module, exports, __webpack_require__) {

			'use strict';

			exports.__esModule = true;
			exports.createPath = exports.parsePath = exports.locationsAreEqual = exports.createMemoryHistory = exports.createHashHistory = exports.createBrowserHistory = undefined;

			var _LocationUtils = __webpack_require__(1);

			Object.defineProperty(exports, 'locationsAreEqual', {
				enumerable: true,
				get: function get() {
					return _LocationUtils.locationsAreEqual;
				}
			});

			var _PathUtils = __webpack_require__(3);

			Object.defineProperty(exports, 'parsePath', {
				enumerable: true,
				get: function get() {
					return _PathUtils.parsePath;
				}
			});
			Object.defineProperty(exports, 'createPath', {
				enumerable: true,
				get: function get() {
					return _PathUtils.createPath;
				}
			});

			var _createBrowserHistory2 = __webpack_require__(4);

			var _createBrowserHistory3 = _interopRequireDefault(_createBrowserHistory2);

			var _createHashHistory2 = __webpack_require__(9);

			var _createHashHistory3 = _interopRequireDefault(_createHashHistory2);

			var _createMemoryHistory2 = __webpack_require__(10);

			var _createMemoryHistory3 = _interopRequireDefault(_createMemoryHistory2);

			function _interopRequireDefault(obj) {
				return obj && obj.__esModule ? obj : { default: obj };
			}

			exports.createBrowserHistory = _createBrowserHistory3.default;
			exports.createHashHistory = _createHashHistory3.default;
			exports.createMemoryHistory = _createMemoryHistory3.default;

			/***/
		},
		/* 1 */
		/***/function (module, exports, __webpack_require__) {

			'use strict';

			exports.__esModule = true;
			exports.locationsAreEqual = exports.createLocation = undefined;

			var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) {
				return typeof obj === 'undefined' ? 'undefined' : _typeof2(obj);
			} : function (obj) {
				return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj === 'undefined' ? 'undefined' : _typeof2(obj);
			};

			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 _warning = __webpack_require__(2);

			var _warning2 = _interopRequireDefault(_warning);

			var _PathUtils = __webpack_require__(3);

			function _interopRequireDefault(obj) {
				return obj && obj.__esModule ? obj : { default: obj };
			}

			// A private helper function used to create location
			// objects from the args to push/replace.
			var createLocation = exports.createLocation = function createLocation(path, state, key) {
				var location = void 0;
				if (typeof path === 'string') {
					// Two-arg form: push(path, state)
					location = (0, _PathUtils.parsePath)(path);
					location.state = state;
				} else {
					// One-arg form: push(location)
					location = _extends({}, path);

					if (state !== undefined) {
						if (location.state === undefined) {
							location.state = state;
						} else {
							false ? (0, _warning2.default)(false, 'When providing a location-like object with state as the first argument to push/replace ' + 'you should avoid providing a second "state" argument; it is ignored') : void 0;
						}
					}
				}

				location.key = key;

				return location;
			};

			var looseEqual = function looseEqual(a, b) {
				if (a == null) return a == b;

				var typeofA = typeof a === 'undefined' ? 'undefined' : _typeof(a);
				var typeofB = typeof b === 'undefined' ? 'undefined' : _typeof(b);

				if (typeofA !== typeofB) return false;

				if (Array.isArray(a)) {
					if (!Array.isArray(b) || a.length !== b.length) return false;

					return a.every(function (item, index) {
						return looseEqual(item, b[index]);
					});
				} else if (typeofA === 'object') {
					var keysOfA = Object.keys(a);
					var keysOfB = Object.keys(b);

					if (keysOfA.length !== keysOfB.length) return false;

					return keysOfA.every(function (key) {
						return looseEqual(a[key], b[key]);
					});
				}

				return a === b;
			};

			var locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) {
				return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && looseEqual(a.state, b.state);
			};

			/***/
		},
		/* 2 */
		/***/function (module, exports, __webpack_require__) {

			/**
    * 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 warning() {};

			if (false) {
				warning = function warning(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;

			/***/
		},
		/* 3 */
		/***/function (module, exports) {

			'use strict';

			exports.__esModule = true;
			var addLeadingSlash = exports.addLeadingSlash = function addLeadingSlash(path) {
				return path.charAt(0) === '/' ? path : '/' + path;
			};

			var stripLeadingSlash = exports.stripLeadingSlash = function stripLeadingSlash(path) {
				return path.charAt(0) === '/' ? path.substr(1) : path;
			};

			var stripPrefix = exports.stripPrefix = function stripPrefix(path, prefix) {
				return path.indexOf(prefix) === 0 ? path.substr(prefix.length) : path;
			};

			var parsePath = exports.parsePath = function parsePath(path) {
				var pathname = path;
				var search = '';
				var hash = '';

				var hashIndex = pathname.indexOf('#');
				if (hashIndex !== -1) {
					hash = pathname.substr(hashIndex);
					pathname = pathname.substr(0, hashIndex);
				}

				var searchIndex = pathname.indexOf('?');
				if (searchIndex !== -1) {
					search = pathname.substr(searchIndex);
					pathname = pathname.substr(0, searchIndex);
				}

				return {
					pathname: pathname,
					search: search === '?' ? '' : search,
					hash: hash === '#' ? '' : hash
				};
			};

			var createPath = exports.createPath = function createPath(location) {
				var pathname = location.pathname;
				var search = location.search;
				var hash = location.hash;

				var path = pathname || '/';

				if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search;

				if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash;

				return path;
			};

			/***/
		},
		/* 4 */
		/***/function (module, exports, __webpack_require__) {

			'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;
			};

			var _warning = __webpack_require__(2);

			var _warning2 = _interopRequireDefault(_warning);

			var _invariant = __webpack_require__(5);

			var _invariant2 = _interopRequireDefault(_invariant);

			var _LocationUtils = __webpack_require__(1);

			var _PathUtils = __webpack_require__(3);

			var _createTransitionManager = __webpack_require__(6);

			var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);

			var _ExecutionEnvironment = __webpack_require__(7);

			var _DOMUtils = __webpack_require__(8);

			function _interopRequireDefault(obj) {
				return obj && obj.__esModule ? obj : { default: obj };
			}

			var PopStateEvent = 'popstate';
			var HashChangeEvent = 'hashchange';

			var getHistoryState = function getHistoryState() {
				try {
					return window.history.state || {};
				} catch (e) {
					// IE 11 sometimes throws when accessing window.history.state
					// See https://github.com/mjackson/history/pull/289
					return {};
				}
			};

			/**
    * Creates a history object that uses the HTML5 history API including
    * pushState, replaceState, and the popstate event.
    */
			var createBrowserHistory = function createBrowserHistory() {
				var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

				!_ExecutionEnvironment.canUseDOM ? false ? (0, _invariant2.default)(false, 'Browser history needs a DOM') : (0, _invariant2.default)(false) : void 0;

				var globalHistory = window.history;
				var canUseHistory = (0, _DOMUtils.supportsHistory)();
				var needsHashChangeListener = !(0, _DOMUtils.supportsPopStateOnHashChange)();

				var _props$basename = props.basename;
				var basename = _props$basename === undefined ? '' : _props$basename;
				var _props$forceRefresh = props.forceRefresh;
				var forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh;
				var _props$getUserConfirm = props.getUserConfirmation;
				var getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm;
				var _props$keyLength = props.keyLength;
				var keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;

				var getDOMLocation = function getDOMLocation(historyState) {
					var _ref = historyState || {};

					var key = _ref.key;
					var state = _ref.state;
					var _window$location = window.location;
					var pathname = _window$location.pathname;
					var search = _window$location.search;
					var hash = _window$location.hash;

					var path = pathname + search + hash;

					if (basename) path = (0, _PathUtils.stripPrefix)(path, basename);

					return _extends({}, (0, _PathUtils.parsePath)(path), {
						state: state,
						key: key
					});
				};

				var createKey = function createKey() {
					return Math.random().toString(36).substr(2, keyLength);
				};

				var transitionManager = (0, _createTransitionManager2.default)();

				var setState = function setState(nextState) {
					_extends(history, nextState);

					history.length = globalHistory.length;

					transitionManager.notifyListeners(history.location, history.action);
				};

				var handlePopState = function handlePopState(event) {
					if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.

					handlePop(getDOMLocation(event.state));
				};

				var handleHashChange = function handleHashChange() {
					handlePop(getDOMLocation(getHistoryState()));
				};

				var forceNextPop = false;

				var handlePop = function handlePop(location) {
					if (forceNextPop) {
						forceNextPop = false;
						setState();
					} else {
						(function () {
							var action = 'POP';

							transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
								if (ok) {
									setState({ action: action, location: location });
								} else {
									revertPop(location);
								}
							});
						})();
					}
				};

				var revertPop = function revertPop(fromLocation) {
					var toLocation = history.location;

					// TODO: We could probably make this more reliable by
					// keeping a list of keys we've seen in sessionStorage.
					// Instead, we just default to 0 for keys we don't know.

					var toIndex = allKeys.indexOf(toLocation.key);

					if (toIndex === -1) toIndex = 0;

					var fromIndex = allKeys.indexOf(fromLocation.key);

					if (fromIndex === -1) fromIndex = 0;

					var delta = toIndex - fromIndex;

					if (delta) {
						forceNextPop = true;
						go(delta);
					}
				};

				var initialLocation = getDOMLocation(getHistoryState());
				var allKeys = [initialLocation.key];

				// Public interface

				var push = function push(path, state) {
					var action = 'PUSH';
					var location = (0, _LocationUtils.createLocation)(path, state, createKey());

					transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
						if (!ok) return;

						var url = basename + (0, _PathUtils.createPath)(location);
						var key = location.key;
						var state = location.state;

						if (canUseHistory) {
							globalHistory.pushState({ key: key, state: state }, null, url);

							if (forceRefresh) {
								window.location.href = url;
							} else {
								var prevIndex = allKeys.indexOf(history.location.key);
								var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);

								nextKeys.push(location.key);
								allKeys = nextKeys;

								setState({ action: action, location: location });
							}
						} else {
							false ? (0, _warning2.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;

							window.location.href = url;
						}
					});
				};

				var replace = function replace(path, state) {
					var action = 'REPLACE';
					var location = (0, _LocationUtils.createLocation)(path, state, createKey());

					transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
						if (!ok) return;

						var url = basename + (0, _PathUtils.createPath)(location);
						var key = location.key;
						var state = location.state;

						if (canUseHistory) {
							globalHistory.replaceState({ key: key, state: state }, null, url);

							if (forceRefresh) {
								window.location.replace(url);
							} else {
								var prevIndex = allKeys.indexOf(history.location.key);

								if (prevIndex !== -1) allKeys[prevIndex] = location.key;

								setState({ action: action, location: location });
							}
						} else {
							false ? (0, _warning2.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;

							window.location.replace(url);
						}
					});
				};

				var go = function go(n) {
					globalHistory.go(n);
				};

				var goBack = function goBack() {
					return go(-1);
				};

				var goForward = function goForward() {
					return go(1);
				};

				var listenerCount = 0;

				var checkDOMListeners = function checkDOMListeners(delta) {
					listenerCount += delta;

					if (listenerCount === 1) {
						(0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState);

						if (needsHashChangeListener) (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);
					} else if (listenerCount === 0) {
						(0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState);

						if (needsHashChangeListener) (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);
					}
				};

				var isBlocked = false;

				var block = function block() {
					var prompt = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];

					var unblock = transitionManager.setPrompt(prompt);

					if (!isBlocked) {
						checkDOMListeners(1);
						isBlocked = true;
					}

					return function () {
						if (isBlocked) {
							isBlocked = false;
							checkDOMListeners(-1);
						}

						return unblock();
					};
				};

				var listen = function listen(listener) {
					var unlisten = transitionManager.appendListener(listener);
					checkDOMListeners(1);

					return function () {
						checkDOMListeners(-1);
						return unlisten();
					};
				};

				var history = {
					length: globalHistory.length,
					action: 'POP',
					location: initialLocation,
					push: push,
					replace: replace,
					go: go,
					goBack: goBack,
					goForward: goForward,
					block: block,
					listen: listen
				};

				return history;
			};

			exports.default = createBrowserHistory;

			/***/
		},
		/* 5 */
		/***/function (module, exports, __webpack_require__) {

			/**
    * 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';

			/**
    * 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 invariant(condition, format, a, b, c, d, e, f) {
				if (false) {
					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(format.replace(/%s/g, function () {
							return args[argIndex++];
						}));
						error.name = 'Invariant Violation';
					}

					error.framesToPop = 1; // we don't care about invariant's own frame
					throw error;
				}
			};

			module.exports = invariant;

			/***/
		},
		/* 6 */
		/***/function (module, exports, __webpack_require__) {

			'use strict';

			exports.__esModule = true;

			var _warning = __webpack_require__(2);

			var _warning2 = _interopRequireDefault(_warning);

			function _interopRequireDefault(obj) {
				return obj && obj.__esModule ? obj : { default: obj };
			}

			var createTransitionManager = function createTransitionManager() {
				var prompt = null;

				var setPrompt = function setPrompt(nextPrompt) {
					false ? (0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time') : void 0;

					prompt = nextPrompt;

					return function () {
						if (prompt === nextPrompt) prompt = null;
					};
				};

				var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) {
					// TODO: If another transition starts while we're still confirming
					// the previous one, we may end up in a weird state. Figure out the
					// best way to handle this.
					if (prompt != null) {
						var result = typeof prompt === 'function' ? prompt(location, action) : prompt;

						if (typeof result === 'string') {
							if (typeof getUserConfirmation === 'function') {
								getUserConfirmation(result, callback);
							} else {
								false ? (0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;

								callback(true);
							}
						} else {
							// Return false from a transition hook to cancel the transition.
							callback(result !== false);
						}
					} else {
						callback(true);
					}
				};

				var listeners = [];

				var appendListener = function appendListener(listener) {
					listeners.push(listener);

					return function () {
						listeners = listeners.filter(function (item) {
							return item !== listener;
						});
					};
				};

				var notifyListeners = function notifyListeners() {
					for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
						args[_key] = arguments[_key];
					}

					return listeners.forEach(function (listener) {
						return listener.apply(undefined, args);
					});
				};

				return {
					setPrompt: setPrompt,
					confirmTransitionTo: confirmTransitionTo,
					appendListener: appendListener,
					notifyListeners: notifyListeners
				};
			};

			exports.default = createTransitionManager;

			/***/
		},
		/* 7 */
		/***/function (module, exports) {

			'use strict';

			exports.__esModule = true;
			var canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);

			/***/
		},
		/* 8 */
		/***/function (module, exports) {

			'use strict';

			exports.__esModule = true;
			var addEventListener = exports.addEventListener = function addEventListener(node, event, listener) {
				return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener);
			};

			var removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) {
				return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener);
			};

			var getConfirmation = exports.getConfirmation = function getConfirmation(message, callback) {
				return callback(window.confirm(message));
			}; // eslint-disable-line no-alert

			/**
    * 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/reactjs/react-router/issues/586
    */
			var supportsHistory = exports.supportsHistory = function supportsHistory() {
				var ua = window.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 true if browser fires popstate on hash change.
    * IE10 and IE11 do not.
    */
			var supportsPopStateOnHashChange = exports.supportsPopStateOnHashChange = function supportsPopStateOnHashChange() {
				return window.navigator.userAgent.indexOf('Trident') === -1;
			};

			/**
    * Returns false if using go(n) with hash history causes a full page reload.
    */
			var supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {
				return window.navigator.userAgent.indexOf('Firefox') === -1;
			};

			/***/
		},
		/* 9 */
		/***/function (module, exports, __webpack_require__) {

			'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;
			};

			var _warning = __webpack_require__(2);

			var _warning2 = _interopRequireDefault(_warning);

			var _invariant = __webpack_require__(5);

			var _invariant2 = _interopRequireDefault(_invariant);

			var _LocationUtils = __webpack_require__(1);

			var _PathUtils = __webpack_require__(3);

			var _createTransitionManager = __webpack_require__(6);

			var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);

			var _ExecutionEnvironment = __webpack_require__(7);

			var _DOMUtils = __webpack_require__(8);

			function _interopRequireDefault(obj) {
				return obj && obj.__esModule ? obj : { default: obj };
			}

			var HashChangeEvent = 'hashchange';

			var HashPathCoders = {
				hashbang: {
					encodePath: function encodePath(path) {
						return path.charAt(0) === '!' ? path : '!/' + (0, _PathUtils.stripLeadingSlash)(path);
					},
					decodePath: function decodePath(path) {
						return path.charAt(0) === '!' ? path.substr(1) : path;
					}
				},
				noslash: {
					encodePath: _PathUtils.stripLeadingSlash,
					decodePath: _PathUtils.addLeadingSlash
				},
				slash: {
					encodePath: _PathUtils.addLeadingSlash,
					decodePath: _PathUtils.addLeadingSlash
				}
			};

			var getHashPath = function getHashPath() {
				// We can't use window.location.hash here because it's not
				// consistent across browsers - Firefox will pre-decode it!
				var href = window.location.href;
				var hashIndex = href.indexOf('#');
				return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
			};

			var pushHashPath = function pushHashPath(path) {
				return window.location.hash = path;
			};

			var replaceHashPath = function replaceHashPath(path) {
				var hashIndex = window.location.href.indexOf('#');

				window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);
			};

			var createHashHistory = function createHashHistory() {
				var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

				!_ExecutionEnvironment.canUseDOM ? false ? (0, _invariant2.default)(false, 'Hash history needs a DOM') : (0, _invariant2.default)(false) : void 0;

				var globalHistory = window.history;
				var canGoWithoutReload = (0, _DOMUtils.supportsGoWithoutReloadUsingHash)();

				var _props$basename = props.basename;
				var basename = _props$basename === undefined ? '' : _props$basename;
				var _props$getUserConfirm = props.getUserConfirmation;
				var getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm;
				var _props$hashType = props.hashType;
				var hashType = _props$hashType === undefined ? 'slash' : _props$hashType;
				var _HashPathCoders$hashT = HashPathCoders[hashType];
				var encodePath = _HashPathCoders$hashT.encodePath;
				var decodePath = _HashPathCoders$hashT.decodePath;

				var getDOMLocation = function getDOMLocation() {
					var path = decodePath(getHashPath());

					if (basename) path = (0, _PathUtils.stripPrefix)(path, basename);

					return (0, _PathUtils.parsePath)(path);
				};

				var transitionManager = (0, _createTransitionManager2.default)();

				var setState = function setState(nextState) {
					_extends(history, nextState);

					history.length = globalHistory.length;

					transitionManager.notifyListeners(history.location, history.action);
				};

				var forceNextPop = false;
				var ignorePath = null;

				var handleHashChange = function handleHashChange() {
					var path = getHashPath();
					var encodedPath = encodePath(path);

					if (path !== encodedPath) {
						// Ensure we always have a properly-encoded hash.
						replaceHashPath(encodedPath);
					} else {
						var location = getDOMLocation();
						var prevLocation = history.location;

						if (!forceNextPop && (0, _LocationUtils.locationsAreEqual)(prevLocation, location)) return; // A hashchange doesn't always == location change.

						if (ignorePath === (0, _PathUtils.createPath)(location)) return; // Ignore this change; we already setState in push/replace.

						ignorePath = null;

						handlePop(location);
					}
				};

				var handlePop = function handlePop(location) {
					if (forceNextPop) {
						forceNextPop = false;
						setState();
					} else {
						(function () {
							var action = 'POP';

							transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
								if (ok) {
									setState({ action: action, location: location });
								} else {
									revertPop(location);
								}
							});
						})();
					}
				};

				var revertPop = function revertPop(fromLocation) {
					var toLocation = history.location;

					// TODO: We could probably make this more reliable by
					// keeping a list of paths we've seen in sessionStorage.
					// Instead, we just default to 0 for paths we don't know.

					var toIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(toLocation));

					if (toIndex === -1) toIndex = 0;

					var fromIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(fromLocation));

					if (fromIndex === -1) fromIndex = 0;

					var delta = toIndex - fromIndex;

					if (delta) {
						forceNextPop = true;
						go(delta);
					}
				};

				// Ensure the hash is encoded properly before doing anything else.
				var path = getHashPath();
				var encodedPath = encodePath(path);

				if (path !== encodedPath) replaceHashPath(encodedPath);

				var initialLocation = getDOMLocation();
				var allPaths = [(0, _PathUtils.createPath)(initialLocation)];

				// Public interface

				var push = function push(path, state) {
					false ? (0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;

					var action = 'PUSH';
					var location = (0, _LocationUtils.createLocation)(path);

					transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
						if (!ok) return;

						var path = (0, _PathUtils.createPath)(location);
						var encodedPath = encodePath(basename + path);
						var hashChanged = getHashPath() !== encodedPath;

						if (hashChanged) {
							// We cannot tell if a hashchange was caused by a PUSH, so we'd
							// rather setState here and ignore the hashchange. The caveat here
							// is that other hash histories in the page will consider it a POP.
							ignorePath = path;
							pushHashPath(encodedPath);

							var prevIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(history.location));
							var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);

							nextPaths.push(path);
							allPaths = nextPaths;

							setState({ action: action, location: location });
						} else {
							false ? (0, _warning2.default)(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0;

							setState();
						}
					});
				};

				var replace = function replace(path, state) {
					false ? (0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;

					var action = 'REPLACE';
					var location = (0, _LocationUtils.createLocation)(path);

					transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
						if (!ok) return;

						var path = (0, _PathUtils.createPath)(location);
						var encodedPath = encodePath(basename + path);
						var hashChanged = getHashPath() !== encodedPath;

						if (hashChanged) {
							// We cannot tell if a hashchange was caused by a REPLACE, so we'd
							// rather setState here and ignore the hashchange. The caveat here
							// is that other hash histories in the page will consider it a POP.
							ignorePath = path;
							replaceHashPath(encodedPath);
						}

						var prevIndex = allPaths.indexOf((0, _PathUtils.createPath)(history.location));

						if (prevIndex !== -1) allPaths[prevIndex] = path;

						setState({ action: action, location: location });
					});
				};

				var go = function go(n) {
					false ? (0, _warning2.default)(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;

					globalHistory.go(n);
				};

				var goBack = function goBack() {
					return go(-1);
				};

				var goForward = function goForward() {
					return go(1);
				};

				var listenerCount = 0;

				var checkDOMListeners = function checkDOMListeners(delta) {
					listenerCount += delta;

					if (listenerCount === 1) {
						(0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);
					} else if (listenerCount === 0) {
						(0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);
					}
				};

				var isBlocked = false;

				var block = function block() {
					var prompt = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];

					var unblock = transitionManager.setPrompt(prompt);

					if (!isBlocked) {
						checkDOMListeners(1);
						isBlocked = true;
					}

					return function () {
						if (isBlocked) {
							isBlocked = false;
							checkDOMListeners(-1);
						}

						return unblock();
					};
				};

				var listen = function listen(listener) {
					var unlisten = transitionManager.appendListener(listener);
					checkDOMListeners(1);

					return function () {
						checkDOMListeners(-1);
						return unlisten();
					};
				};

				var history = {
					length: globalHistory.length,
					action: 'POP',
					location: initialLocation,
					push: push,
					replace: replace,
					go: go,
					goBack: goBack,
					goForward: goForward,
					block: block,
					listen: listen
				};

				return history;
			};

			exports.default = createHashHistory;

			/***/
		},
		/* 10 */
		/***/function (module, exports, __webpack_require__) {

			'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;
			};

			var _LocationUtils = __webpack_require__(1);

			var _createTransitionManager = __webpack_require__(6);

			var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager);

			function _interopRequireDefault(obj) {
				return obj && obj.__esModule ? obj : { default: obj };
			}

			var clamp = function clamp(n, lowerBound, upperBound) {
				return Math.min(Math.max(n, lowerBound), upperBound);
			};

			/**
    * Creates a history object that stores locations in memory.
    */
			var createMemoryHistory = function createMemoryHistory() {
				var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
				var getUserConfirmation = props.getUserConfirmation;
				var _props$initialEntries = props.initialEntries;
				var initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries;
				var _props$initialIndex = props.initialIndex;
				var initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex;
				var _props$keyLength = props.keyLength;
				var keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;

				var transitionManager = (0, _createTransitionManager2.default)();

				var setState = function setState(nextState) {
					_extends(history, nextState);

					history.length = history.entries.length;

					transitionManager.notifyListeners(history.location, history.action);
				};

				var createKey = function createKey() {
					return Math.random().toString(36).substr(2, keyLength);
				};

				var index = clamp(initialIndex, 0, initialEntries.length - 1);
				var entries = initialEntries.map(function (entry, index) {
					return typeof entry === 'string' ? (0, _LocationUtils.createLocation)(entry, index ? createKey() : undefined) : entry;
				});

				// Public interface

				var push = function push(path, state) {
					var action = 'PUSH';
					var location = (0, _LocationUtils.createLocation)(path, state, createKey());

					transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
						if (!ok) return;

						var prevIndex = history.index;
						var nextIndex = prevIndex + 1;

						var nextEntries = history.entries.slice(0);
						if (nextEntries.length > nextIndex) {
							nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
						} else {
							nextEntries.push(location);
						}

						setState({
							action: action,
							location: location,
							index: nextIndex,
							entries: nextEntries
						});
					});
				};

				var replace = function replace(path, state) {
					var action = 'REPLACE';
					var location = (0, _LocationUtils.createLocation)(path, state, createKey());

					transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
						if (!ok) return;

						history.entries[history.index] = location;

						setState({ action: action, location: location });
					});
				};

				var go = function go(n) {
					var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);

					var action = 'POP';
					var location = history.entries[nextIndex];

					transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
						if (ok) {
							setState({
								action: action,
								location: location,
								index: nextIndex
							});
						} else {
							// Mimic the behavior of DOM histories by
							// causing a render after a cancelled POP.
							setState();
						}
					});
				};

				var goBack = function goBack() {
					return go(-1);
				};

				var goForward = function goForward() {
					return go(1);
				};

				var canGo = function canGo(n) {
					var nextIndex = history.index + n;
					return nextIndex >= 0 && nextIndex < history.entries.length;
				};

				var block = function block() {
					var prompt = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];
					return transitionManager.setPrompt(prompt);
				};

				var listen = function listen(listener) {
					return transitionManager.appendListener(listener);
				};

				var history = {
					length: entries.length,
					action: 'POP',
					location: entries[index],
					index: index,
					entries: entries,
					push: push,
					replace: replace,
					go: go,
					goBack: goBack,
					goForward: goForward,
					canGo: canGo,
					block: block,
					listen: listen
				};

				return history;
			};

			exports.default = createMemoryHistory;

			/***/
		}
		/******/])
	);
});
;