diff --git a/public/app.html b/public/app.html new file mode 100644 index 000000000..708859714 --- /dev/null +++ b/public/app.html @@ -0,0 +1,16 @@ + + + + react js + + + + + + + +
+ + + + \ No newline at end of file diff --git a/public/javascripts/wechat/ReactRouter.js b/public/javascripts/wechat/ReactRouter.js new file mode 100644 index 000000000..810fd7ddc --- /dev/null +++ b/public/javascripts/wechat/ReactRouter.js @@ -0,0 +1,5064 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("react")); + else if(typeof define === 'function' && define.amd) + define(["react"], factory); + else if(typeof exports === 'object') + exports["ReactRouter"] = factory(require("react")); + else + root["ReactRouter"] = factory(root["React"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) { +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__) { + + /* components */ + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _Router2 = __webpack_require__(37); + + var _Router3 = _interopRequireDefault(_Router2); + + exports.Router = _Router3['default']; + + var _Link2 = __webpack_require__(18); + + var _Link3 = _interopRequireDefault(_Link2); + + exports.Link = _Link3['default']; + + var _IndexLink2 = __webpack_require__(31); + + var _IndexLink3 = _interopRequireDefault(_IndexLink2); + + exports.IndexLink = _IndexLink3['default']; + + /* components (configuration) */ + + var _IndexRedirect2 = __webpack_require__(32); + + var _IndexRedirect3 = _interopRequireDefault(_IndexRedirect2); + + exports.IndexRedirect = _IndexRedirect3['default']; + + var _IndexRoute2 = __webpack_require__(33); + + var _IndexRoute3 = _interopRequireDefault(_IndexRoute2); + + exports.IndexRoute = _IndexRoute3['default']; + + var _Redirect2 = __webpack_require__(19); + + var _Redirect3 = _interopRequireDefault(_Redirect2); + + exports.Redirect = _Redirect3['default']; + + var _Route2 = __webpack_require__(35); + + var _Route3 = _interopRequireDefault(_Route2); + + exports.Route = _Route3['default']; + + /* mixins */ + + var _History2 = __webpack_require__(30); + + var _History3 = _interopRequireDefault(_History2); + + exports.History = _History3['default']; + + var _Lifecycle2 = __webpack_require__(34); + + var _Lifecycle3 = _interopRequireDefault(_Lifecycle2); + + exports.Lifecycle = _Lifecycle3['default']; + + var _RouteContext2 = __webpack_require__(36); + + var _RouteContext3 = _interopRequireDefault(_RouteContext2); + + exports.RouteContext = _RouteContext3['default']; + + /* utils */ + + var _useRoutes2 = __webpack_require__(48); + + var _useRoutes3 = _interopRequireDefault(_useRoutes2); + + exports.useRoutes = _useRoutes3['default']; + + var _RouteUtils = __webpack_require__(5); + + exports.createRoutes = _RouteUtils.createRoutes; + + var _RouterContext2 = __webpack_require__(13); + + var _RouterContext3 = _interopRequireDefault(_RouterContext2); + + exports.RouterContext = _RouterContext3['default']; + + var _RoutingContext2 = __webpack_require__(38); + + var _RoutingContext3 = _interopRequireDefault(_RoutingContext2); + + exports.RoutingContext = _RoutingContext3['default']; + + var _PropTypes2 = __webpack_require__(6); + + var _PropTypes3 = _interopRequireDefault(_PropTypes2); + + exports.PropTypes = _PropTypes3['default']; + + var _match2 = __webpack_require__(46); + + var _match3 = _interopRequireDefault(_match2); + + exports.match = _match3['default']; + + var _useRouterHistory2 = __webpack_require__(24); + + var _useRouterHistory3 = _interopRequireDefault(_useRouterHistory2); + + exports.useRouterHistory = _useRouterHistory3['default']; + + var _PatternUtils = __webpack_require__(8); + + exports.formatPattern = _PatternUtils.formatPattern; + + /* histories */ + + var _browserHistory2 = __webpack_require__(40); + + var _browserHistory3 = _interopRequireDefault(_browserHistory2); + + exports.browserHistory = _browserHistory3['default']; + + var _hashHistory2 = __webpack_require__(44); + + var _hashHistory3 = _interopRequireDefault(_hashHistory2); + + exports.hashHistory = _hashHistory3['default']; + + var _createMemoryHistory2 = __webpack_require__(21); + + var _createMemoryHistory3 = _interopRequireDefault(_createMemoryHistory2); + + exports.createMemoryHistory = _createMemoryHistory3['default']; + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = routerWarning; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _warning = __webpack_require__(4); + + var _warning2 = _interopRequireDefault(_warning); + + function routerWarning(falseToWarn, message) { + message = '[react-router] ' + message; + + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + false ? _warning2['default'].apply(undefined, [falseToWarn, message].concat(args)) : undefined; + } + + module.exports = exports['default']; + +/***/ }, +/* 2 */ +/***/ function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_2__; + +/***/ }, +/* 3 */ +/***/ 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(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; + + +/***/ }, +/* 4 */ +/***/ 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() {}; + + if (false) { + 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; + + +/***/ }, +/* 5 */ +/***/ 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; }; + + exports.isReactChildren = isReactChildren; + exports.createRouteFromReactElement = createRouteFromReactElement; + exports.createRoutesFromReactChildren = createRoutesFromReactChildren; + exports.createRoutes = createRoutes; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + function isValidChild(object) { + return object == null || _react2['default'].isValidElement(object); + } + + function isReactChildren(object) { + return isValidChild(object) || Array.isArray(object) && object.every(isValidChild); + } + + function checkPropTypes(componentName, propTypes, props) { + componentName = componentName || 'UnknownComponent'; + + 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) false ? _routerWarning2['default'](false, error.message) : undefined; + } + } + } + + function createRoute(defaultProps, props) { + return _extends({}, defaultProps, props); + } + + function createRouteFromReactElement(element) { + var type = element.type; + var route = createRoute(type.defaultProps, element.props); + + if (type.propTypes) checkPropTypes(type.displayName || type.name, type.propTypes, route); + + if (route.children) { + var childRoutes = createRoutesFromReactChildren(route.children, route); + + if (childRoutes.length) route.childRoutes = childRoutes; + + delete route.children; + } + + return route; + } + + /** + * 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 createRoutesFromReactChildren(children, parentRoute) { + var routes = []; + + _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); + + if (route) routes.push(route); + } else { + routes.push(createRouteFromReactElement(element)); + } + } + }); + + return routes; + } + + /** + * 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. + */ + + function createRoutes(routes) { + if (isReactChildren(routes)) { + routes = createRoutesFromReactChildren(routes); + } else if (routes && !Array.isArray(routes)) { + routes = [routes]; + } + + return routes; + } + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports.falsy = falsy; + + var _react = __webpack_require__(2); + + 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 falsy(props, propName, componentName) { + if (props[propName]) return new Error('<' + componentName + '> should not have a "' + propName + '" prop'); + } + + var history = shape({ + listen: func.isRequired, + pushState: func.isRequired, + replaceState: func.isRequired, + go: func.isRequired + }); + + exports.history = history; + var location = shape({ + pathname: string.isRequired, + search: string.isRequired, + state: object, + action: string.isRequired, + key: string + }); + + 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)]); + + exports.routes = routes; + exports['default'] = { + falsy: falsy, + history: history, + location: location, + component: component, + components: components, + route: route + }; + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports.extractPath = extractPath; + exports.parsePath = parsePath; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _warning = __webpack_require__(4); + + var _warning2 = _interopRequireDefault(_warning); + + function extractPath(string) { + var match = string.match(/^https?:\/\/[^\/]*/); + + if (match == null) return string; + + return string.substring(match[0].length); + } + + function parsePath(path) { + var pathname = extractPath(path); + var search = ''; + var hash = ''; + + false ? _warning2['default'](path === pathname, 'A path must be pathname + search + hash only, not a fully qualified URL like "%s"', path) : undefined; + + var hashIndex = pathname.indexOf('#'); + if (hashIndex !== -1) { + hash = pathname.substring(hashIndex); + pathname = pathname.substring(0, hashIndex); + } + + var searchIndex = pathname.indexOf('?'); + if (searchIndex !== -1) { + search = pathname.substring(searchIndex); + pathname = pathname.substring(0, searchIndex); + } + + if (pathname === '') pathname = '/'; + + return { + pathname: pathname, + search: search, + hash: hash + }; + } + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports.compilePattern = compilePattern; + exports.matchPattern = matchPattern; + exports.getParamNames = getParamNames; + exports.getParams = getParams; + exports.formatPattern = formatPattern; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _invariant = __webpack_require__(3); + + var _invariant2 = _interopRequireDefault(_invariant); + + function escapeRegExp(string) { + return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + } + + function escapeSource(string) { + return escapeRegExp(string).replace(/\/+/g, '/+'); + } + + 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 += ')?'; + } + + tokens.push(match[0]); + + lastIndex = matcher.lastIndex; + } + + if (lastIndex !== pattern.length) { + tokens.push(pattern.slice(lastIndex, pattern.length)); + regexpSource += escapeSource(pattern.slice(lastIndex, pattern.length)); + } + + return { + pattern: pattern, + regexpSource: regexpSource, + paramNames: paramNames, + tokens: tokens + }; + } + + var CompiledPatternsCache = {}; + + function compilePattern(pattern) { + if (!(pattern in CompiledPatternsCache)) CompiledPatternsCache[pattern] = _compilePattern(pattern); + + return CompiledPatternsCache[pattern]; + } + + /** + * 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 matchPattern(pattern, pathname) { + // Make leading slashes consistent between pattern and pathname. + if (pattern.charAt(0) !== '/') { + pattern = '/' + pattern; + } + if (pathname.charAt(0) !== '/') { + pathname = '/' + pathname; + } + + var _compilePattern2 = compilePattern(pattern); + + var regexpSource = _compilePattern2.regexpSource; + var paramNames = _compilePattern2.paramNames; + var tokens = _compilePattern2.tokens; + + regexpSource += '/*'; // Capture path separators + + // Special-case patterns like '*' for catch-all routes. + var captureRemaining = tokens[tokens.length - 1] !== '*'; + + if (captureRemaining) { + // This will match newlines in the remaining path. + regexpSource += '([\\s\\S]*?)'; + } + + var match = pathname.match(new RegExp('^' + regexpSource + '$', 'i')); + + var remainingPathname = undefined, + paramValues = undefined; + if (match != null) { + if (captureRemaining) { + remainingPathname = match.pop(); + var matchedPath = match[0].substr(0, match[0].length - remainingPathname.length); + + // 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 = ''; + } + + paramValues = match.slice(1).map(function (v) { + return v != null ? decodeURIComponent(v) : v; + }); + } else { + remainingPathname = paramValues = null; + } + + return { + remainingPathname: remainingPathname, + paramNames: paramNames, + paramValues: paramValues + }; + } + + function getParamNames(pattern) { + return compilePattern(pattern).paramNames; + } + + function getParams(pattern, pathname) { + var _matchPattern = matchPattern(pattern, pathname); + + var paramNames = _matchPattern.paramNames; + var paramValues = _matchPattern.paramValues; + + if (paramValues != null) { + return paramNames.reduce(function (memo, paramName, index) { + memo[paramName] = paramValues[index]; + return memo; + }, {}); + } + + return null; + } + + /** + * 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 formatPattern(pattern, params) { + params = params || {}; + + var _compilePattern3 = compilePattern(pattern); + + var tokens = _compilePattern3.tokens; + + var parenCount = 0, + pathname = '', + splatIndex = 0; + + var token = undefined, + paramName = undefined, + paramValue = undefined; + for (var i = 0, len = tokens.length; i < len; ++i) { + token = tokens[i]; + + if (token === '*' || token === '**') { + paramValue = Array.isArray(params.splat) ? params.splat[splatIndex++] : params.splat; + + !(paramValue != null || parenCount > 0) ? false ? _invariant2['default'](false, 'Missing splat #%s for path "%s"', splatIndex, pattern) : _invariant2['default'](false) : 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]; + + !(paramValue != null || parenCount > 0) ? false ? _invariant2['default'](false, 'Missing "%s" parameter for path "%s"', paramName, pattern) : _invariant2['default'](false) : undefined; + + if (paramValue != null) pathname += encodeURIComponent(paramValue); + } else { + pathname += token; + } + } + + return pathname.replace(/\/+/g, '/'); + } + +/***/ }, +/* 9 */ +/***/ function(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 + }; + +/***/ }, +/* 10 */ +/***/ function(module, exports) { + + 'use strict'; + + exports.__esModule = true; + var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + exports.canUseDOM = canUseDOM; + +/***/ }, +/* 11 */ +/***/ 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; }; + + 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 = __webpack_require__(4); + + var _warning2 = _interopRequireDefault(_warning); + + var _queryString = __webpack_require__(56); + + var _runTransitionHook = __webpack_require__(17); + + var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook); + + var _PathUtils = __webpack_require__(7); + + var _deprecate = __webpack_require__(16); + + var _deprecate2 = _interopRequireDefault(_deprecate); + + var SEARCH_BASE_KEY = '$searchBase'; + + function defaultStringifyQuery(query) { + return _queryString.stringify(query).replace(/%20/g, '+'); + } + + 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; + } + + /** + * Returns a new createHistory function that may be used to create + * history objects that know how to handle URL queries. + */ + 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; + + var searchBaseSpec = location[SEARCH_BASE_KEY]; + var queryString = query ? stringifyQuery(query) : ''; + if (!searchBaseSpec && !queryString) { + return location; + } + + false ? _warning2['default'](stringifyQuery !== defaultStringifyQuery || !isNestedObject(query), 'useQueries does not stringify nested query objects by default; ' + 'use a custom stringifyQuery function') : undefined; + + if (typeof location === 'string') location = _PathUtils.parsePath(location); + + var searchBase = undefined; + if (searchBaseSpec && location.search === searchBaseSpec.search) { + searchBase = searchBaseSpec.searchBase; + } else { + searchBase = location.search || ''; + } + + var search = searchBase; + if (queryString) { + search += (search ? '&' : '?') + queryString; + } + + return _extends({}, location, (_extends2 = { + search: search + }, _extends2[SEARCH_BASE_KEY] = { search: search, searchBase: searchBase }, _extends2)); + } + + // Override all read methods with query-aware versions. + function listenBefore(hook) { + return history.listenBefore(function (location, callback) { + _runTransitionHook2['default'](hook, addQuery(location), callback); + }); + } + + function listen(listener) { + return history.listen(function (location) { + listener(addQuery(location)); + }); + } + + // Override all write methods with query-aware versions. + function push(location) { + history.push(appendQuery(location, location.query)); + } + + function replace(location) { + history.replace(appendQuery(location, location.query)); + } + + function createPath(location, query) { + false ? _warning2['default'](!query, 'the query argument to createPath is deprecated; use a location descriptor instead') : undefined; + + return history.createPath(appendQuery(location, query || location.query)); + } + + function createHref(location, query) { + false ? _warning2['default'](!query, 'the query argument to createHref is deprecated; use a location descriptor instead') : undefined; + + return history.createHref(appendQuery(location, query || location.query)); + } + + 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 fullLocation = history.createLocation.apply(history, [appendQuery(location, location.query)].concat(args)); + if (location.query) { + fullLocation.query = location.query; + } + return addQuery(fullLocation); + } + + // deprecated + function pushState(state, path, query) { + if (typeof path === 'string') path = _PathUtils.parsePath(path); + + push(_extends({ state: state }, path, { query: query })); + } + + // deprecated + function replaceState(state, path, query) { + if (typeof path === 'string') path = _PathUtils.parsePath(path); + + replace(_extends({ state: state }, path, { query: query })); + } + + 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'] = useQueries; + module.exports = exports['default']; + +/***/ }, +/* 12 */ +/***/ function(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; + } + + callback.apply(this, arguments); + } + + function next() { + if (isDone) { + return; + } + + hasNext = true; + if (sync) { + // Iterate instead of recursing if possible. + return; + } + + 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(); + } + + function mapAsync(array, work, callback) { + var length = array.length; + var values = []; + + if (length === 0) return callback(null, values); + + var isDone = false, + doneCount = 0; + + function done(index, error, value) { + if (isDone) return; + + if (error) { + isDone = true; + callback(error); + } else { + values[index] = value; + + isDone = ++doneCount === length; + + if (isDone) callback(null, values); + } + } + + array.forEach(function (item, index) { + work(item, index, function (error, value) { + done(index, error, value); + }); + }); + } + +/***/ }, +/* 13 */ +/***/ 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; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _invariant = __webpack_require__(3); + + var _invariant2 = _interopRequireDefault(_invariant); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _deprecateObjectProperties = __webpack_require__(23); + + var _deprecateObjectProperties2 = _interopRequireDefault(_deprecateObjectProperties); + + var _getRouteParams = __webpack_require__(43); + + var _getRouteParams2 = _interopRequireDefault(_getRouteParams); + + var _RouteUtils = __webpack_require__(5); + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + var _React$PropTypes = _react2['default'].PropTypes; + var array = _React$PropTypes.array; + var func = _React$PropTypes.func; + var object = _React$PropTypes.object; + + /** + * 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', + + propTypes: { + history: object, + router: object.isRequired, + location: object.isRequired, + routes: array.isRequired, + params: object.isRequired, + components: array.isRequired, + createElement: func.isRequired + }, + + getDefaultProps: function getDefaultProps() { + return { + createElement: _react2['default'].createElement + }; + }, + + childContextTypes: { + history: object, + location: object.isRequired, + router: object.isRequired + }, + + getChildContext: function getChildContext() { + var _props = this.props; + var router = _props.router; + var history = _props.history; + var location = _props.location; + + if (!router) { + false ? _routerWarning2['default'](false, '`` expects a `router` rather than a `history`') : undefined; + + router = _extends({}, history, { + setRouteLeaveHook: history.listenBeforeLeavingRoute + }); + delete router.listenBeforeLeavingRoute; + } + + if (false) { + location = _deprecateObjectProperties2['default'](location, '`context.location` is deprecated, please use a route component\'s `props.location` instead. http://tiny.cc/router-accessinglocation'); + } + + return { history: history, location: location, router: router }; + }, + + createElement: function createElement(component, props) { + return component == null ? null : this.props.createElement(component, props); + }, + + render: function render() { + var _this = this; + + var _props2 = this.props; + var history = _props2.history; + var location = _props2.location; + var routes = _props2.routes; + var params = _props2.params; + var components = _props2.components; + + var element = null; + + if (components) { + element = components.reduceRight(function (element, components, index) { + if (components == null) return element; // Don't create new children; use the grandchildren. + + var route = routes[index]; + var routeParams = _getRouteParams2['default'](route, params); + var props = { + history: history, + location: location, + params: params, + route: route, + routeParams: routeParams, + routes: routes + }; + + if (_RouteUtils.isReactChildren(element)) { + props.children = element; + } else if (element) { + for (var prop in element) { + if (element.hasOwnProperty(prop)) props[prop] = element[prop]; + } + } + + if (typeof components === 'object') { + var elements = {}; + + 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)); + } + } + + return elements; + } + + return _this.createElement(components, props); + }, element); + } + + !(element === null || element === false || _react2['default'].isValidElement(element)) ? false ? _invariant2['default'](false, 'The root route must render a single element') : _invariant2['default'](false) : undefined; + + return element; + } + + }); + + exports['default'] = RouterContext; + module.exports = exports['default']; + +/***/ }, +/* 14 */ +/***/ 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; }; + + exports['default'] = createTransitionManager; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + var _historyLibActions = __webpack_require__(9); + + var _computeChangedRoutes2 = __webpack_require__(41); + + var _computeChangedRoutes3 = _interopRequireDefault(_computeChangedRoutes2); + + var _TransitionUtils = __webpack_require__(39); + + var _isActive2 = __webpack_require__(45); + + var _isActive3 = _interopRequireDefault(_isActive2); + + var _getComponents = __webpack_require__(42); + + var _getComponents2 = _interopRequireDefault(_getComponents); + + var _matchRoutes = __webpack_require__(47); + + var _matchRoutes2 = _interopRequireDefault(_matchRoutes); + + function hasAnyProperties(object) { + for (var p in object) { + if (object.hasOwnProperty(p)) return true; + }return false; + } + + function createTransitionManager(history, routes) { + var state = {}; + + // 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 indexOnly = undefined; + if (indexOnlyOrDeprecatedQuery && indexOnlyOrDeprecatedQuery !== true || deprecatedIndexOnly !== null) { + false ? _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 _isActive3['default'](location, indexOnly, state.location, state.routes, state.params); + } + + 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 { + _matchRoutes2['default'](routes, location, function (error, nextState) { + if (error) { + callback(error); + } else if (nextState) { + finishMatch(_extends({}, nextState, { location: location }), callback); + } else { + callback(); + } + }); + } + } + + function finishMatch(nextState, callback) { + var _computeChangedRoutes = _computeChangedRoutes3['default'](state, nextState); + + var leaveRoutes = _computeChangedRoutes.leaveRoutes; + var enterRoutes = _computeChangedRoutes.enterRoutes; + + _TransitionUtils.runLeaveHooks(leaveRoutes); + + // Tear down confirmation hooks for left routes + leaveRoutes.filter(function (route) { + return enterRoutes.indexOf(route) === -1; + }).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 })); + } + }); + } + }); + } + + 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 = {}; + + function getRouteHooksForRoutes(routes) { + return routes.reduce(function (hooks, route) { + hooks.push.apply(hooks, RouteHooks[getRouteID(route)]); + return hooks; + }, []); + } + + 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); + }); + } + + /* 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); + + 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](); + } + + return message; + } + } + + var unlistenBefore = undefined, + unlistenBeforeUnload = undefined; + + function removeListenBeforeHooksForRoute(route) { + var routeID = getRouteID(route, false); + if (!routeID) { + return; + } + + delete RouteHooks[routeID]; + + if (!hasAnyProperties(RouteHooks)) { + // teardown transition & beforeunload hooks + if (unlistenBefore) { + unlistenBefore(); + unlistenBefore = null; + } + + if (unlistenBeforeUnload) { + unlistenBeforeUnload(); + unlistenBeforeUnload = null; + } + } + } + + /** + * 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 (!hooks) { + var thereWereNoRouteHooks = !hasAnyProperties(RouteHooks); + + RouteHooks[routeID] = [hook]; + + if (thereWereNoRouteHooks) { + // setup transition & beforeunload hooks + unlistenBefore = history.listenBefore(transitionHook); + + if (history.listenBeforeUnload) unlistenBeforeUnload = history.listenBeforeUnload(beforeUnloadHook); + } + } else { + if (hooks.indexOf(hook) === -1) { + false ? _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; + } + } + }; + } + + /** + * 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 { + false ? _routerWarning2['default'](false, 'Location "%s" did not match any routes', location.pathname + location.search + location.hash) : undefined; + } + }); + } + }); + } + + return { + isActive: isActive, + match: match, + listenBeforeLeavingRoute: listenBeforeLeavingRoute, + listen: listen + }; + } + + //export default useRoutes + module.exports = exports['default']; + +/***/ }, +/* 15 */ +/***/ function(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; + + function addEventListener(node, event, listener) { + if (node.addEventListener) { + node.addEventListener(event, listener, false); + } else { + node.attachEvent('on' + event, listener); + } + } + + function removeEventListener(node, event, listener) { + if (node.removeEventListener) { + node.removeEventListener(event, listener, false); + } else { + node.detachEvent('on' + event, listener); + } + } + + 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 replaceHashPath(path) { + window.location.replace(window.location.pathname + window.location.search + '#' + path); + } + + function getWindowPath() { + return window.location.pathname + window.location.search + window.location.hash; + } + + function go(n) { + if (n) window.history.go(n); + } + + function getUserConfirmation(message, callback) { + callback(window.confirm(message)); + } + + /** + * 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 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. + */ + + function supportsGoWithoutReloadUsingHash() { + var ua = navigator.userAgent; + return ua.indexOf('Firefox') === -1; + } + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _warning = __webpack_require__(4); + + var _warning2 = _interopRequireDefault(_warning); + + function deprecate(fn, message) { + return function () { + false ? _warning2['default'](false, '[history] ' + message) : undefined; + return fn.apply(this, arguments); + }; + } + + exports['default'] = deprecate; + module.exports = exports['default']; + +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _warning = __webpack_require__(4); + + var _warning2 = _interopRequireDefault(_warning); + + function runTransitionHook(hook, location, callback) { + var result = hook(location, callback); + + if (hook.length < 2) { + // Assume the hook runs synchronously and automatically + // call the callback with the return value. + callback(result); + } else { + false ? _warning2['default'](result === undefined, 'You should not "return" in a transition hook with a callback argument; call the callback instead') : undefined; + } + } + + exports['default'] = runTransitionHook; + module.exports = exports['default']; + +/***/ }, +/* 18 */ +/***/ 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; }; + + 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 = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + 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; + + function isLeftClickEvent(event) { + return event.button === 0; + } + + function isModifiedEvent(event) { + return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); + } + + function isEmptyObject(object) { + for (var p in object) { + if (object.hasOwnProperty(p)) return false; + }return true; + } + + function createLocationDescriptor(to, _ref) { + var query = _ref.query; + var hash = _ref.hash; + var state = _ref.state; + + if (query || hash || state) { + return { pathname: to, query: query, hash: hash, state: state }; + } + + return to; + } + + /** + * 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', + + contextTypes: { + router: object + }, + + propTypes: { + to: oneOfType([string, object]).isRequired, + query: object, + hash: string, + state: object, + activeStyle: object, + activeClassName: string, + onlyActiveOnIndex: bool.isRequired, + onClick: func + }, + + getDefaultProps: function getDefaultProps() { + return { + onlyActiveOnIndex: false, + className: '', + style: {} + }; + }, + + handleClick: function handleClick(event) { + var allowTransition = true; + + if (this.props.onClick) this.props.onClick(event); + + if (isModifiedEvent(event) || !isLeftClickEvent(event)) return; + + if (event.defaultPrevented === true) allowTransition = false; + + // 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(); + + return; + } + + event.preventDefault(); + + if (allowTransition) { + var _props = this.props; + var to = _props.to; + var query = _props.query; + var hash = _props.hash; + var state = _props.state; + + var _location = createLocationDescriptor(to, { query: query, hash: hash, state: state }); + + this.context.router.push(_location); + } + }, + + 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 props = _objectWithoutProperties(_props2, ['to', 'query', 'hash', 'state', 'activeClassName', 'activeStyle', 'onlyActiveOnIndex']); + + false ? _routerWarning2['default'](!(query || hash || state), 'the `query`, `hash`, and `state` props on `` are deprecated, use `. http://tiny.cc/router-isActivedeprecated') : undefined; + + // Ignore if rendered outside the context of router, simplifies unit testing. + var router = this.context.router; + + if (router) { + var _location2 = createLocationDescriptor(to, { query: query, hash: hash, state: state }); + props.href = router.createHref(_location2); + + if (activeClassName || activeStyle != null && !isEmptyObject(activeStyle)) { + if (router.isActive(_location2, onlyActiveOnIndex)) { + if (activeClassName) props.className += props.className === '' ? activeClassName : ' ' + activeClassName; + + if (activeStyle) props.style = _extends({}, props.style, activeStyle); + } + } + } + + return _react2['default'].createElement('a', _extends({}, props, { onClick: this.handleClick })); + } + + }); + + exports['default'] = Link; + module.exports = exports['default']; + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _invariant = __webpack_require__(3); + + var _invariant2 = _interopRequireDefault(_invariant); + + var _RouteUtils = __webpack_require__(5); + + var _PatternUtils = __webpack_require__(8); + + var _PropTypes = __webpack_require__(6); + + var _React$PropTypes = _react2['default'].PropTypes; + var string = _React$PropTypes.string; + var object = _React$PropTypes.object; + + /** + * 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', + + statics: { + + createRouteFromReactElement: function createRouteFromReactElement(element) { + var route = _RouteUtils.createRouteFromReactElement(element); + + if (route.from) route.path = route.from; + + route.onEnter = function (nextState, replace) { + var location = nextState.location; + var params = nextState.params; + + 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); + } + + replace({ + pathname: pathname, + query: route.query || location.query, + state: route.state || location.state + }); + }; + + return route; + }, + + getRoutePattern: function getRoutePattern(routes, routeIndex) { + var parentPattern = ''; + + for (var i = routeIndex; i >= 0; i--) { + var route = routes[i]; + var pattern = route.path || ''; + + parentPattern = pattern.replace(/\/*$/, '/') + parentPattern; + + if (pattern.indexOf('/') === 0) break; + } + + return '/' + parentPattern; + } + + }, + + propTypes: { + path: string, + from: string, // Alias for path + to: string.isRequired, + query: object, + state: object, + onEnter: _PropTypes.falsy, + children: _PropTypes.falsy + }, + + /* istanbul ignore next: sanity check */ + render: function render() { + true ? false ? _invariant2['default'](false, ' elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined; + } + + }); + + exports['default'] = Redirect; + module.exports = exports['default']; + +/***/ }, +/* 20 */ +/***/ 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; }; + + exports.createRouterObject = createRouterObject; + exports.createRoutingHistory = createRoutingHistory; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _deprecateObjectProperties = __webpack_require__(23); + + var _deprecateObjectProperties2 = _interopRequireDefault(_deprecateObjectProperties); + + function createRouterObject(history, transitionManager) { + return _extends({}, history, { + setRouteLeaveHook: transitionManager.listenBeforeLeavingRoute, + isActive: transitionManager.isActive + }); + } + + // deprecated + + function createRoutingHistory(history, transitionManager) { + history = _extends({}, history, transitionManager); + + if (false) { + history = _deprecateObjectProperties2['default'](history, '`props.history` and `context.history` are deprecated. Please use `context.router`. http://tiny.cc/router-contextchanges'); + } + + return history; + } + +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = createMemoryHistory; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _historyLibUseQueries = __webpack_require__(11); + + var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries); + + var _historyLibUseBasename = __webpack_require__(29); + + var _historyLibUseBasename2 = _interopRequireDefault(_historyLibUseBasename); + + var _historyLibCreateMemoryHistory = __webpack_require__(55); + + var _historyLibCreateMemoryHistory2 = _interopRequireDefault(_historyLibCreateMemoryHistory); + + 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; + } + + module.exports = exports['default']; + +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _useRouterHistory = __webpack_require__(24); + + var _useRouterHistory2 = _interopRequireDefault(_useRouterHistory); + + var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + + exports['default'] = function (createHistory) { + var history = undefined; + if (canUseDOM) history = _useRouterHistory2['default'](createHistory)(); + return history; + }; + + module.exports = exports['default']; + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + /*eslint no-empty: 0*/ + 'use strict'; + + exports.__esModule = true; + exports['default'] = deprecateObjectProperties; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + var useMembrane = false; + + if (false) { + try { + if (Object.defineProperty({}, 'x', { get: function get() { + return true; + } }).x) { + useMembrane = true; + } + } catch (e) {} + } + + // wraps an object in a membrane to warn about deprecated property access + + function deprecateObjectProperties(object, message) { + if (!useMembrane) return object; + + var membrane = {}; + + var _loop = function (prop) { + if (typeof object[prop] === 'function') { + membrane[prop] = function () { + false ? _routerWarning2['default'](false, message) : undefined; + return object[prop].apply(object, arguments); + }; + } else { + Object.defineProperty(membrane, prop, { + configurable: false, + enumerable: false, + get: function get() { + false ? _routerWarning2['default'](false, message) : undefined; + return object[prop]; + } + }); + } + }; + + for (var prop in object) { + _loop(prop); + } + + return membrane; + } + + module.exports = exports['default']; + +/***/ }, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = useRouterHistory; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _historyLibUseQueries = __webpack_require__(11); + + var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries); + + var _historyLibUseBasename = __webpack_require__(29); + + var _historyLibUseBasename2 = _interopRequireDefault(_historyLibUseBasename); + + function useRouterHistory(createHistory) { + return function (options) { + var history = _historyLibUseQueries2['default'](_historyLibUseBasename2['default'](createHistory))(options); + history.__v2_compatible__ = true; + return history; + }; + } + + module.exports = exports['default']; + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + /*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 = __webpack_require__(4); + + var _warning2 = _interopRequireDefault(_warning); + + var KeyPrefix = '@@History/'; + var QuotaExceededErrors = ['QuotaExceededError', 'QUOTA_EXCEEDED_ERR']; + + var SecurityError = 'SecurityError'; + + function createKey(key) { + return KeyPrefix + key; + } + + 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. + false ? _warning2['default'](false, '[history] Unable to save state; sessionStorage is not available due to security settings') : undefined; + + return; + } + + if (QuotaExceededErrors.indexOf(error.name) >= 0 && window.sessionStorage.length === 0) { + // Safari "private mode" throws QuotaExceededError. + false ? _warning2['default'](false, '[history] Unable to save state; sessionStorage is not available in Safari private mode') : undefined; + + return; + } + + throw error; + } + } + + 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. + false ? _warning2['default'](false, '[history] Unable to read state; sessionStorage is not available due to security settings') : undefined; + + return null; + } + } + + if (json) { + try { + return JSON.parse(json); + } catch (error) { + // Ignore invalid JSON. + } + } + + return null; + } + +/***/ }, +/* 26 */ +/***/ 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; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _invariant = __webpack_require__(3); + + var _invariant2 = _interopRequireDefault(_invariant); + + var _ExecutionEnvironment = __webpack_require__(10); + + var _DOMUtils = __webpack_require__(15); + + var _createHistory = __webpack_require__(28); + + var _createHistory2 = _interopRequireDefault(_createHistory); + + function createDOMHistory(options) { + var history = _createHistory2['default'](_extends({ + getUserConfirmation: _DOMUtils.getUserConfirmation + }, options, { + go: _DOMUtils.go + })); + + function listen(listener) { + !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'DOM history needs a DOM') : _invariant2['default'](false) : undefined; + + return history.listen(listener); + } + + return _extends({}, history, { + listen: listen + }); + } + + exports['default'] = createDOMHistory; + module.exports = exports['default']; + +/***/ }, +/* 27 */ +/***/ 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; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _warning = __webpack_require__(4); + + var _warning2 = _interopRequireDefault(_warning); + + var _invariant = __webpack_require__(3); + + var _invariant2 = _interopRequireDefault(_invariant); + + var _Actions = __webpack_require__(9); + + var _PathUtils = __webpack_require__(7); + + var _ExecutionEnvironment = __webpack_require__(10); + + var _DOMUtils = __webpack_require__(15); + + var _DOMStateStorage = __webpack_require__(25); + + var _createDOMHistory = __webpack_require__(26); + + var _createDOMHistory2 = _interopRequireDefault(_createDOMHistory); + + function isAbsolutePath(path) { + return typeof path === 'string' && path.charAt(0) === '/'; + } + + function ensureSlash() { + var path = _DOMUtils.getHashPath(); + + if (isAbsolutePath(path)) return true; + + _DOMUtils.replaceHashPath('/' + path); + + return false; + } + + 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]+'), ''); + } + + function getQueryStringValueFromPath(path, key) { + var match = path.match(new RegExp('\\?.*?\\b' + key + '=(.+?)\\b')); + return match && match[1]; + } + + var DefaultQueryKey = '_k'; + + function createHashHistory() { + var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Hash history needs a DOM') : _invariant2['default'](false) : undefined; + + var queryKey = options.queryKey; + + if (queryKey === undefined || !!queryKey) queryKey = typeof queryKey === 'string' ? queryKey : DefaultQueryKey; + + function getCurrentLocation() { + var path = _DOMUtils.getHashPath(); + + var key = undefined, + state = undefined; + if (queryKey) { + key = getQueryStringValueFromPath(path, queryKey); + path = stripQueryStringValueFromPath(path, queryKey); + + if (key) { + state = _DOMStateStorage.readState(key); + } else { + state = null; + key = history.createKey(); + _DOMUtils.replaceHashPath(addQueryStringValueToPath(path, queryKey, key)); + } + } else { + key = state = null; + } + + var location = _PathUtils.parsePath(path); + + return history.createLocation(_extends({}, location, { state: state }), undefined, key); + } + + 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); + }; + } + + 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; + + if (action === _Actions.POP) return; // Nothing to do. + + var path = (basename || '') + pathname + search; + + if (queryKey) { + path = addQueryStringValueToPath(path, queryKey, key); + _DOMStateStorage.saveState(key, state); + } else { + // Drop key and state. + location.key = location.state = null; + } + + var currentHash = _DOMUtils.getHashPath(); + + if (action === _Actions.PUSH) { + if (currentHash !== path) { + window.location.hash = path; + } else { + false ? _warning2['default'](false, 'You cannot PUSH the same path using hash history') : undefined; + } + } else if (currentHash !== path) { + // REPLACE + _DOMUtils.replaceHashPath(path); + } + } + + var history = _createDOMHistory2['default'](_extends({}, options, { + getCurrentLocation: getCurrentLocation, + finishTransition: finishTransition, + saveState: _DOMStateStorage.saveState + })); + + var listenerCount = 0, + stopHashChangeListener = undefined; + + function listenBefore(listener) { + if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history); + + var unlisten = history.listenBefore(listener); + + return function () { + unlisten(); + + if (--listenerCount === 0) stopHashChangeListener(); + }; + } + + function listen(listener) { + if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history); + + var unlisten = history.listen(listener); + + return function () { + unlisten(); + + if (--listenerCount === 0) stopHashChangeListener(); + }; + } + + function push(location) { + false ? _warning2['default'](queryKey || location.state == null, 'You cannot use state without a queryKey it will be dropped') : undefined; + + history.push(location); + } + + function replace(location) { + false ? _warning2['default'](queryKey || location.state == null, 'You cannot use state without a queryKey it will be dropped') : undefined; + + history.replace(location); + } + + var goIsSupportedWithoutReload = _DOMUtils.supportsGoWithoutReloadUsingHash(); + + function go(n) { + false ? _warning2['default'](goIsSupportedWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : undefined; + + history.go(n); + } + + function createHref(path) { + return '#' + history.createHref(path); + } + + // deprecated + function registerTransitionHook(hook) { + if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history); + + history.registerTransitionHook(hook); + } + + // deprecated + function unregisterTransitionHook(hook) { + history.unregisterTransitionHook(hook); + + if (--listenerCount === 0) stopHashChangeListener(); + } + + // deprecated + function pushState(state, path) { + false ? _warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped') : undefined; + + history.pushState(state, path); + } + + // deprecated + function replaceState(state, path) { + false ? _warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped') : undefined; + + history.replaceState(state, path); + } + + 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']; + +/***/ }, +/* 28 */ +/***/ 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; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _warning = __webpack_require__(4); + + var _warning2 = _interopRequireDefault(_warning); + + var _deepEqual = __webpack_require__(49); + + var _deepEqual2 = _interopRequireDefault(_deepEqual); + + var _PathUtils = __webpack_require__(7); + + var _AsyncUtils = __webpack_require__(52); + + var _Actions = __webpack_require__(9); + + var _createLocation2 = __webpack_require__(54); + + var _createLocation3 = _interopRequireDefault(_createLocation2); + + var _runTransitionHook = __webpack_require__(17); + + var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook); + + var _deprecate = __webpack_require__(16); + + var _deprecate2 = _interopRequireDefault(_deprecate); + + function createRandomKey(length) { + return Math.random().toString(36).substr(2, length); + } + + 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); + } + + 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 = []; + + function listenBefore(hook) { + transitionHooks.push(hook); + + return function () { + transitionHooks = transitionHooks.filter(function (item) { + return item !== hook; + }); + }; + } + + var allKeys = []; + var changeListeners = []; + var location = undefined; + + function getCurrent() { + if (pendingLocation && pendingLocation.action === _Actions.POP) { + return allKeys.indexOf(pendingLocation.key); + } else if (location) { + return allKeys.indexOf(location.key); + } else { + return -1; + } + } + + function updateLocation(newLocation) { + var current = getCurrent(); + + location = newLocation; + + if (location.action === _Actions.PUSH) { + allKeys = [].concat(allKeys.slice(0, current + 1), [location.key]); + } else if (location.action === _Actions.REPLACE) { + allKeys[current] = location.key; + } + + changeListeners.forEach(function (listener) { + listener(location); + }); + } + + function listen(listener) { + changeListeners.push(listener); + + if (location) { + listener(location); + } else { + var _location = getCurrentLocation(); + allKeys = [_location.key]; + updateLocation(_location); + } + + return function () { + changeListeners = changeListeners.filter(function (item) { + return item !== listener; + }); + }; + } + + 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; + + function transitionTo(nextLocation) { + if (location && locationsAreEqual(location, nextLocation)) return; // Nothing to do. + + pendingLocation = nextLocation; + + confirmTransitionTo(nextLocation, function (ok) { + if (pendingLocation !== nextLocation) return; // Transition was interrupted. + + 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); + + if (nextPath === prevPath && _deepEqual2['default'](location.state, nextLocation.state)) nextLocation.action = _Actions.REPLACE; + } + + 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); + + if (prevIndex !== -1 && nextIndex !== -1) go(prevIndex - nextIndex); // Restore the URL. + } + }); + } + + function push(location) { + transitionTo(createLocation(location, _Actions.PUSH, createKey())); + } + + function replace(location) { + transitionTo(createLocation(location, _Actions.REPLACE, createKey())); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + function createKey() { + return createRandomKey(keyLength); + } + + function createPath(location) { + if (location == null || typeof location === 'string') return location; + + var pathname = location.pathname; + var search = location.search; + var hash = location.hash; + + var result = pathname; + + if (search) result += search; + + if (hash) result += hash; + + return result; + } + + function createHref(location) { + return createPath(location); + } + + function createLocation(location, action) { + var key = arguments.length <= 2 || arguments[2] === undefined ? createKey() : arguments[2]; + + if (typeof action === 'object') { + false ? _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']; + +/***/ }, +/* 29 */ +/***/ 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; }; + + 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 = __webpack_require__(10); + + var _PathUtils = __webpack_require__(7); + + var _runTransitionHook = __webpack_require__(17); + + var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook); + + var _deprecate = __webpack_require__(16); + + 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 history = createHistory(historyOptions); + + // 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 (base) basename = _PathUtils.extractPath(base.href); + } + + 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 (location.pathname === '') location.pathname = '/'; + } else { + location.basename = ''; + } + } + + return location; + } + + function prependBasename(location) { + if (!basename) return location; + + if (typeof location === 'string') location = _PathUtils.parsePath(location); + + var pname = location.pathname; + var normalizedBasename = basename.slice(-1) === '/' ? basename : basename + '/'; + var normalizedPathname = pname.charAt(0) === '/' ? pname.slice(1) : pname; + var pathname = normalizedBasename + normalizedPathname; + + return _extends({}, location, { + pathname: pathname + }); + } + + // Override all read methods with basename-aware versions. + function listenBefore(hook) { + return history.listenBefore(function (location, callback) { + _runTransitionHook2['default'](hook, addBasename(location), callback); + }); + } + + function listen(listener) { + return history.listen(function (location) { + listener(addBasename(location)); + }); + } + + // Override all write methods with basename-aware versions. + function push(location) { + history.push(prependBasename(location)); + } + + function replace(location) { + history.replace(prependBasename(location)); + } + + function createPath(location) { + return history.createPath(prependBasename(location)); + } + + function createHref(location) { + return history.createHref(prependBasename(location)); + } + + 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]; + } + + return addBasename(history.createLocation.apply(history, [prependBasename(location)].concat(args))); + } + + // 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 _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'] = useBasename; + module.exports = exports['default']; + +/***/ }, +/* 30 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + var _PropTypes = __webpack_require__(6); + + /** + * A mixin that adds the "history" instance variable to components. + */ + var History = { + + contextTypes: { + history: _PropTypes.history + }, + + componentWillMount: function componentWillMount() { + false ? _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; + } + + }; + + exports['default'] = History; + module.exports = exports['default']; + +/***/ }, +/* 31 */ +/***/ 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; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _Link = __webpack_require__(18); + + var _Link2 = _interopRequireDefault(_Link); + + /** + * An is used to link to an . + */ + var IndexLink = _react2['default'].createClass({ + displayName: 'IndexLink', + + render: function render() { + return _react2['default'].createElement(_Link2['default'], _extends({}, this.props, { onlyActiveOnIndex: true })); + } + + }); + + exports['default'] = IndexLink; + module.exports = exports['default']; + +/***/ }, +/* 32 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + var _invariant = __webpack_require__(3); + + var _invariant2 = _interopRequireDefault(_invariant); + + var _Redirect = __webpack_require__(19); + + var _Redirect2 = _interopRequireDefault(_Redirect); + + var _PropTypes = __webpack_require__(6); + + var _React$PropTypes = _react2['default'].PropTypes; + var string = _React$PropTypes.string; + var object = _React$PropTypes.object; + + /** + * An is used to redirect from an indexRoute. + */ + var IndexRedirect = _react2['default'].createClass({ + displayName: 'IndexRedirect', + + statics: { + + createRouteFromReactElement: function createRouteFromReactElement(element, parentRoute) { + /* istanbul ignore else: sanity check */ + if (parentRoute) { + parentRoute.indexRoute = _Redirect2['default'].createRouteFromReactElement(element); + } else { + false ? _routerWarning2['default'](false, 'An does not make sense at the root of your route config') : undefined; + } + } + + }, + + propTypes: { + to: string.isRequired, + query: object, + state: object, + onEnter: _PropTypes.falsy, + children: _PropTypes.falsy + }, + + /* istanbul ignore next: sanity check */ + render: function render() { + true ? false ? _invariant2['default'](false, ' elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined; + } + + }); + + exports['default'] = IndexRedirect; + module.exports = exports['default']; + +/***/ }, +/* 33 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + var _invariant = __webpack_require__(3); + + var _invariant2 = _interopRequireDefault(_invariant); + + var _RouteUtils = __webpack_require__(5); + + var _PropTypes = __webpack_require__(6); + + var func = _react2['default'].PropTypes.func; + + /** + * An is used to specify its parent's in + * a JSX route config. + */ + var IndexRoute = _react2['default'].createClass({ + displayName: 'IndexRoute', + + statics: { + + createRouteFromReactElement: function createRouteFromReactElement(element, parentRoute) { + /* istanbul ignore else: sanity check */ + if (parentRoute) { + parentRoute.indexRoute = _RouteUtils.createRouteFromReactElement(element); + } else { + false ? _routerWarning2['default'](false, 'An does not make sense at the root of your route config') : undefined; + } + } + + }, + + propTypes: { + path: _PropTypes.falsy, + component: _PropTypes.component, + components: _PropTypes.components, + getComponent: func, + getComponents: func + }, + + /* istanbul ignore next: sanity check */ + render: function render() { + true ? false ? _invariant2['default'](false, ' elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined; + } + + }); + + exports['default'] = IndexRoute; + module.exports = exports['default']; + +/***/ }, +/* 34 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _invariant = __webpack_require__(3); + + var _invariant2 = _interopRequireDefault(_invariant); + + var object = _react2['default'].PropTypes.object; + + /** + * 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 = { + + 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 + }, + + propTypes: { + // Route components receive the route object as a prop. + route: object + }, + + componentDidMount: function componentDidMount() { + false ? _routerWarning2['default'](false, 'the `Lifecycle` mixin is deprecated, please use `context.router.setRouteLeaveHook(route, hook)`. http://tiny.cc/router-lifecyclemixin') : undefined; + !this.routerWillLeave ? false ? _invariant2['default'](false, 'The Lifecycle mixin requires you to define a routerWillLeave method') : _invariant2['default'](false) : undefined; + + var route = this.props.route || this.context.route; + + !route ? false ? _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; + + this._unlistenBeforeLeavingRoute = this.context.history.listenBeforeLeavingRoute(route, this.routerWillLeave); + }, + + componentWillUnmount: function componentWillUnmount() { + if (this._unlistenBeforeLeavingRoute) this._unlistenBeforeLeavingRoute(); + } + + }; + + exports['default'] = Lifecycle; + module.exports = exports['default']; + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _invariant = __webpack_require__(3); + + var _invariant2 = _interopRequireDefault(_invariant); + + var _RouteUtils = __webpack_require__(5); + + var _PropTypes = __webpack_require__(6); + + var _React$PropTypes = _react2['default'].PropTypes; + var string = _React$PropTypes.string; + var func = _React$PropTypes.func; + + /** + * 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', + + statics: { + createRouteFromReactElement: _RouteUtils.createRouteFromReactElement + }, + + propTypes: { + path: string, + component: _PropTypes.component, + components: _PropTypes.components, + getComponent: func, + getComponents: func + }, + + /* istanbul ignore next: sanity check */ + render: function render() { + true ? false ? _invariant2['default'](false, ' elements are for router configuration only and should not be rendered') : _invariant2['default'](false) : undefined; + } + + }); + + exports['default'] = Route; + module.exports = exports['default']; + +/***/ }, +/* 36 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var object = _react2['default'].PropTypes.object; + + /** + * 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 = { + + propTypes: { + route: object.isRequired + }, + + childContextTypes: { + route: object.isRequired + }, + + getChildContext: function getChildContext() { + return { + route: this.props.route + }; + }, + + componentWillMount: function componentWillMount() { + false ? _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; + } + + }; + + exports['default'] = RouteContext; + module.exports = exports['default']; + +/***/ }, +/* 37 */ +/***/ 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; }; + + 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 _historyLibCreateHashHistory = __webpack_require__(27); + + var _historyLibCreateHashHistory2 = _interopRequireDefault(_historyLibCreateHashHistory); + + var _historyLibUseQueries = __webpack_require__(11); + + var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries); + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _createTransitionManager = __webpack_require__(14); + + var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); + + var _PropTypes = __webpack_require__(6); + + var _RouterContext = __webpack_require__(13); + + var _RouterContext2 = _interopRequireDefault(_RouterContext); + + var _RouteUtils = __webpack_require__(5); + + var _RouterUtils = __webpack_require__(20); + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + function isDeprecatedHistory(history) { + return !history || !history.__v2_compatible__; + } + + var _React$PropTypes = _react2['default'].PropTypes; + var func = _React$PropTypes.func; + var object = _React$PropTypes.object; + + /** + * 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', + + propTypes: { + history: object, + children: _PropTypes.routes, + routes: _PropTypes.routes, // alias for children + render: func, + createElement: func, + onError: func, + onUpdate: func, + + // PRIVATE: For client-side rehydration of server match. + matchContext: object + }, + + getDefaultProps: function getDefaultProps() { + return { + render: function render(props) { + return _react2['default'].createElement(_RouterContext2['default'], props); + } + }; + }, + + getInitialState: function getInitialState() { + return { + location: null, + routes: null, + params: null, + components: null + }; + }, + + 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. + } + }, + + componentWillMount: function componentWillMount() { + var _this = this; + + var _props = this.props; + var parseQueryString = _props.parseQueryString; + var stringifyQuery = _props.stringifyQuery; + + false ? _routerWarning2['default'](!(parseQueryString || stringifyQuery), '`parseQueryString` and `stringifyQuery` are deprecated. Please create a custom history. http://tiny.cc/router-customquerystring') : undefined; + + 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 { + _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 = this.props.history; + var _props2 = this.props; + var routes = _props2.routes; + var children = _props2.children; + + if (isDeprecatedHistory(history)) { + history = this.wrapDeprecatedHistory(history); + } + + var transitionManager = _createTransitionManager2['default'](history, _RouteUtils.createRoutes(routes || children)); + var router = _RouterUtils.createRouterObject(history, transitionManager); + var routingHistory = _RouterUtils.createRoutingHistory(history, transitionManager); + + return { history: routingHistory, transitionManager: transitionManager, router: router }; + }, + + wrapDeprecatedHistory: function wrapDeprecatedHistory(history) { + var _props3 = this.props; + var parseQueryString = _props3.parseQueryString; + var stringifyQuery = _props3.stringifyQuery; + + var createHistory = undefined; + if (history) { + false ? _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 { + false ? _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']; + } + + return _historyLibUseQueries2['default'](createHistory)({ parseQueryString: parseQueryString, stringifyQuery: stringifyQuery }); + }, + + /* istanbul ignore next: sanity check */ + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + false ? _routerWarning2['default'](nextProps.history === this.props.history, 'You cannot change ; it will be ignored') : undefined; + + false ? _routerWarning2['default']((nextProps.routes || nextProps.children) === (this.props.routes || this.props.children), 'You cannot change ; it will be ignored') : undefined; + }, + + componentWillUnmount: function componentWillUnmount() { + if (this._unlisten) this._unlisten(); + }, + + 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; + + var props = _objectWithoutProperties(_props4, ['createElement', 'render']); + + if (location == null) return null; // Async match + + // 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 + })); + } + + }); + + exports['default'] = Router; + module.exports = exports['default']; + +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _react = __webpack_require__(2); + + var _react2 = _interopRequireDefault(_react); + + var _RouterContext = __webpack_require__(13); + + var _RouterContext2 = _interopRequireDefault(_RouterContext); + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + var RoutingContext = _react2['default'].createClass({ + displayName: 'RoutingContext', + + componentWillMount: function componentWillMount() { + false ? _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); + } + }); + + exports['default'] = RoutingContext; + module.exports = exports['default']; + +/***/ }, +/* 39 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports.runEnterHooks = runEnterHooks; + exports.runLeaveHooks = runLeaveHooks; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _AsyncUtils = __webpack_require__(12); + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + function createEnterHook(hook, route) { + return function (a, b, callback) { + hook.apply(route, arguments); + + if (hook.length < 3) { + // Assume hook executes synchronously and + // automatically call the callback. + callback(); + } + }; + } + + function getEnterHooks(routes) { + return routes.reduce(function (hooks, route) { + if (route.onEnter) hooks.push(createEnterHook(route.onEnter, route)); + + return hooks; + }, []); + } + + /** + * 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. + */ + + function runEnterHooks(routes, nextState, callback) { + var hooks = getEnterHooks(routes); + + if (!hooks.length) { + callback(); + return; + } + + var redirectInfo = undefined; + function replace(location, deprecatedPathname, deprecatedQuery) { + if (deprecatedPathname) { + false ? _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 + }; + + return; + } + + redirectInfo = location; + } + + _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); + } + + /** + * Runs all onLeave hooks in the given array of routes in order. + */ + + function runLeaveHooks(routes) { + for (var i = 0, len = routes.length; i < len; ++i) { + if (routes[i].onLeave) routes[i].onLeave.call(routes[i]); + } + } + +/***/ }, +/* 40 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _historyLibCreateBrowserHistory = __webpack_require__(53); + + var _historyLibCreateBrowserHistory2 = _interopRequireDefault(_historyLibCreateBrowserHistory); + + var _createRouterHistory = __webpack_require__(22); + + var _createRouterHistory2 = _interopRequireDefault(_createRouterHistory); + + exports['default'] = _createRouterHistory2['default'](_historyLibCreateBrowserHistory2['default']); + module.exports = exports['default']; + +/***/ }, +/* 41 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + var _PatternUtils = __webpack_require__(8); + + function routeParamsChanged(route, prevState, nextState) { + if (!route.path) return false; + + var paramNames = _PatternUtils.getParamNames(route.path); + + return paramNames.some(function (paramName) { + return prevState.params[paramName] !== nextState.params[paramName]; + }); + } + + /** + * 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 leaveRoutes = undefined, + enterRoutes = undefined; + if (prevRoutes) { + (function () { + var parentIsLeaving = false; + leaveRoutes = prevRoutes.filter(function (route) { + if (parentIsLeaving) { + return true; + } else { + var isLeaving = nextRoutes.indexOf(route) === -1 || routeParamsChanged(route, prevState, nextState); + if (isLeaving) parentIsLeaving = true; + return isLeaving; + } + }); + + // onLeave hooks start at the leaf route. + leaveRoutes.reverse(); + + enterRoutes = nextRoutes.filter(function (route) { + return prevRoutes.indexOf(route) === -1 || leaveRoutes.indexOf(route) !== -1; + }); + })(); + } else { + leaveRoutes = []; + enterRoutes = nextRoutes; + } + + return { + leaveRoutes: leaveRoutes, + enterRoutes: enterRoutes + }; + } + + exports['default'] = computeChangedRoutes; + module.exports = exports['default']; + +/***/ }, +/* 42 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + var _AsyncUtils = __webpack_require__(12); + + 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(); + } + } + + /** + * 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'] = getComponents; + module.exports = exports['default']; + +/***/ }, +/* 43 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + var _PatternUtils = __webpack_require__(8); + + /** + * Extracts an object of params the given route cares about from + * the given params object. + */ + function getRouteParams(route, params) { + var routeParams = {}; + + if (!route.path) return routeParams; + + 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'] = getRouteParams; + module.exports = exports['default']; + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _historyLibCreateHashHistory = __webpack_require__(27); + + var _historyLibCreateHashHistory2 = _interopRequireDefault(_historyLibCreateHashHistory); + + var _createRouterHistory = __webpack_require__(22); + + var _createRouterHistory2 = _interopRequireDefault(_createRouterHistory); + + exports['default'] = _createRouterHistory2['default'](_historyLibCreateHashHistory2['default']); + module.exports = exports['default']; + +/***/ }, +/* 45 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = isActive; + + var _PatternUtils = __webpack_require__(8); + + function deepEqual(a, b) { + if (a == b) return true; + + if (a == null || b == null) return false; + + if (Array.isArray(a)) { + return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { + return deepEqual(item, b[index]); + }); + } + + if (typeof a === 'object') { + for (var p in a) { + if (!a.hasOwnProperty(p)) { + continue; + } + + 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 true; + } + + 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]); + }); + } + + function getMatchingRouteIndex(pathname, activeRoutes, activeParams) { + var remainingPathname = pathname, + paramNames = [], + paramValues = []; + + for (var i = 0, len = activeRoutes.length; i < len; ++i) { + var route = activeRoutes[i]; + var pattern = route.path || ''; + + if (pattern.charAt(0) === '/') { + remainingPathname = pathname; + paramNames = []; + paramValues = []; + } + + 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 && paramsAreActive(paramNames, paramValues, activeParams)) return i; + } + + return null; + } + + /** + * 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; + }); + } + + /** + * 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; + + return deepEqual(query, activeQuery); + } + + /** + * Returns true if a to the given pathname/query combination is + * currently active. + */ + + function isActive(_ref, indexOnly, currentLocation, routes, params) { + var pathname = _ref.pathname; + var query = _ref.query; + + if (currentLocation == null) return false; + + if (!routeIsActive(pathname, routes, params, indexOnly)) return false; + + return queryIsActive(query, currentLocation.query); + } + + module.exports = exports['default']; + +/***/ }, +/* 46 */ +/***/ 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; }; + + 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 _invariant = __webpack_require__(3); + + var _invariant2 = _interopRequireDefault(_invariant); + + var _createMemoryHistory = __webpack_require__(21); + + var _createMemoryHistory2 = _interopRequireDefault(_createMemoryHistory); + + var _createTransitionManager = __webpack_require__(14); + + var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); + + var _RouteUtils = __webpack_require__(5); + + var _RouterUtils = __webpack_require__(20); + + /** + * 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; + + var options = _objectWithoutProperties(_ref, ['history', 'routes', 'location']); + + !(history || location) ? false ? _invariant2['default'](false, 'match needs a history or a location') : _invariant2['default'](false) : undefined; + + history = history ? history : _createMemoryHistory2['default'](options); + var transitionManager = _createTransitionManager2['default'](history, _RouteUtils.createRoutes(routes)); + + var unlisten = undefined; + + 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; + }); + } + + 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(); + } + }); + } + + exports['default'] = match; + module.exports = exports['default']; + +/***/ }, +/* 47 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + var _AsyncUtils = __webpack_require__(12); + + var _PatternUtils = __webpack_require__(8); + + var _RouteUtils = __webpack_require__(5); + + function getChildRoutes(route, location, callback) { + if (route.childRoutes) { + return [null, route.childRoutes]; + } + if (!route.getChildRoutes) { + return []; + } + + var sync = true, + result = undefined; + + route.getChildRoutes(location, function (error, childRoutes) { + childRoutes = !error && _RouteUtils.createRoutes(childRoutes); + if (sync) { + result = [error, childRoutes]; + return; + } + + callback(error, childRoutes); + }); + + sync = false; + return result; // Might be undefined. + } + + 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'); + }); + + _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 assignParams(params, paramNames, paramValues) { + return paramNames.reduce(function (params, paramName, index) { + var paramValue = paramValues && paramValues[index]; + + if (Array.isArray(params[paramName])) { + params[paramName].push(paramValue); + } else if (paramName in params) { + params[paramName] = [params[paramName], paramValue]; + } else { + params[paramName] = paramValue; + } + + return params; + }, params); + } + + function createParams(paramNames, paramValues) { + return assignParams({}, paramNames, paramValues); + } + + function matchRouteDeep(route, location, remainingPathname, paramNames, paramValues, callback) { + var pattern = route.path || ''; + + if (pattern.charAt(0) === '/') { + remainingPathname = location.pathname; + paramNames = []; + paramValues = []; + } + + 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; + + false ? _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) { + false ? _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; + } + } + + 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); + } + } else { + callback(); + } + } + + /** + * 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['default'] = matchRoutes; + module.exports = exports['default']; + +/***/ }, +/* 48 */ +/***/ 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; }; + + 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 _historyLibUseQueries = __webpack_require__(11); + + var _historyLibUseQueries2 = _interopRequireDefault(_historyLibUseQueries); + + var _createTransitionManager = __webpack_require__(14); + + var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); + + var _routerWarning = __webpack_require__(1); + + var _routerWarning2 = _interopRequireDefault(_routerWarning); + + /** + * 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) { + false ? _routerWarning2['default'](false, '`useRoutes` is deprecated. Please use `createTransitionManager` instead.') : undefined; + + return function () { + var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + var routes = _ref.routes; + + var options = _objectWithoutProperties(_ref, ['routes']); + + var history = _historyLibUseQueries2['default'](createHistory)(options); + var transitionManager = _createTransitionManager2['default'](history, routes); + return _extends({}, history, transitionManager); + }; + } + + exports['default'] = useRoutes; + module.exports = exports['default']; + +/***/ }, +/* 49 */ +/***/ function(module, exports, __webpack_require__) { + + var pSlice = Array.prototype.slice; + var objectKeys = __webpack_require__(51); + var isArguments = __webpack_require__(50); + + 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; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 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; + + // 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); + } + } + + function isUndefinedOrNull(value) { + return value === null || value === undefined; + } + + 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; + } + 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; + } + 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; + } + + +/***/ }, +/* 50 */ +/***/ function(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]'; + }; + + 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; + }; + + +/***/ }, +/* 51 */ +/***/ function(module, exports) { + + exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + + exports.shim = shim; + function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; + } + + +/***/ }, +/* 52 */ +/***/ function(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(); + } + +/***/ }, +/* 53 */ +/***/ 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; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _invariant = __webpack_require__(3); + + var _invariant2 = _interopRequireDefault(_invariant); + + var _Actions = __webpack_require__(9); + + var _PathUtils = __webpack_require__(7); + + var _ExecutionEnvironment = __webpack_require__(10); + + var _DOMUtils = __webpack_require__(15); + + var _DOMStateStorage = __webpack_require__(25); + + var _createDOMHistory = __webpack_require__(26); + + var _createDOMHistory2 = _interopRequireDefault(_createDOMHistory); + + /** + * 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]; + + !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined; + + var forceRefresh = options.forceRefresh; + + var isSupported = _DOMUtils.supportsHistory(); + var useRefresh = !isSupported || forceRefresh; + + function getCurrentLocation(historyState) { + historyState = historyState || window.history.state || {}; + + 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; + + function popStateListener(event) { + if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit. + + transitionTo(getCurrentLocation(event.state)); + } + + _DOMUtils.addEventListener(window, 'popstate', popStateListener); + + return function () { + _DOMUtils.removeEventListener(window, 'popstate', popStateListener); + }; + } + + 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; + + if (action === _Actions.POP) return; // Nothing to do. + + _DOMStateStorage.saveState(key, state); + + var path = (basename || '') + pathname + search + hash; + var historyState = { + key: key + }; + + 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 history = _createDOMHistory2['default'](_extends({}, options, { + getCurrentLocation: getCurrentLocation, + finishTransition: finishTransition, + saveState: _DOMStateStorage.saveState + })); + + var listenerCount = 0, + stopPopStateListener = undefined; + + function listenBefore(listener) { + if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history); + + var unlisten = history.listenBefore(listener); + + return function () { + unlisten(); + + if (--listenerCount === 0) stopPopStateListener(); + }; + } + + function listen(listener) { + if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history); + + var unlisten = history.listen(listener); + + return function () { + unlisten(); + + if (--listenerCount === 0) stopPopStateListener(); + }; + } + + // deprecated + function registerTransitionHook(hook) { + if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history); + + 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']; + +/***/ }, +/* 54 */ +/***/ 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; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _warning = __webpack_require__(4); + + var _warning2 = _interopRequireDefault(_warning); + + var _Actions = __webpack_require__(9); + + var _PathUtils = __webpack_require__(7); + + 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]; + + var _fourthArg = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; + + if (typeof location === 'string') location = _PathUtils.parsePath(location); + + if (typeof action === 'object') { + false ? _warning2['default'](false, 'The state (2nd) argument to createLocation is deprecated; use a ' + 'location descriptor instead') : undefined; + + location = _extends({}, location, { state: action }); + + action = key || _Actions.POP; + key = _fourthArg; + } + + var pathname = location.pathname || '/'; + var search = location.search || ''; + var hash = location.hash || ''; + var state = location.state || null; + + return { + pathname: pathname, + search: search, + hash: hash, + state: state, + action: action, + key: key + }; + } + + exports['default'] = createLocation; + module.exports = exports['default']; + +/***/ }, +/* 55 */ +/***/ 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; }; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _warning = __webpack_require__(4); + + var _warning2 = _interopRequireDefault(_warning); + + var _invariant = __webpack_require__(3); + + var _invariant2 = _interopRequireDefault(_invariant); + + var _PathUtils = __webpack_require__(7); + + var _Actions = __webpack_require__(9); + + var _createHistory = __webpack_require__(28); + + 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 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 }); + + true ? false ? _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) ? false ? _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]; + } + + function getCurrentLocation() { + var entry = entries[current]; + var key = entry.key; + var basename = entry.basename; + var pathname = entry.pathname; + var search = entry.search; + + var path = (basename || '') + pathname + (search || ''); + + var state = undefined; + if (key) { + state = readState(key); + } else { + state = null; + key = history.createKey(); + entry.key = key; + } + + 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)) { + false ? _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 })); + } + } + + function finishTransition(location) { + switch (location.action) { + case _Actions.PUSH: + current += 1; + + // if we are not on the top of stack + // remove rest and push new + if (current < entries.length) entries.splice(current); + + entries.push(location); + saveState(location.key, location.state); + break; + case _Actions.REPLACE: + entries[current] = location; + saveState(location.key, location.state); + break; + } + } + + return history; + } + + exports['default'] = createMemoryHistory; + module.exports = exports['default']; + +/***/ }, +/* 56 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + var strictUriEncode = __webpack_require__(57); + + exports.extract = function (str) { + return str.split('?')[1] || ''; + }; + + exports.parse = function (str) { + if (typeof str !== 'string') { + return {}; + } + + str = str.trim().replace(/^(\?|#|&)/, ''); + + if (!str) { + return {}; + } + + 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; + + key = decodeURIComponent(key); + + // missing `=` should be `null`: + // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters + val = val === undefined ? null : decodeURIComponent(val); + + if (!ret.hasOwnProperty(key)) { + ret[key] = val; + } else if (Array.isArray(ret[key])) { + ret[key].push(val); + } else { + ret[key] = [ret[key], val]; + } + + return ret; + }, {}); + }; + + exports.stringify = function (obj) { + return obj ? Object.keys(obj).sort().map(function (key) { + var val = obj[key]; + + if (val === undefined) { + return ''; + } + + if (val === null) { + return key; + } + + if (Array.isArray(val)) { + return val.sort().map(function (val2) { + return strictUriEncode(key) + '=' + strictUriEncode(val2); + }).join('&'); + } + + return strictUriEncode(key) + '=' + strictUriEncode(val); + }).filter(function (x) { + return x.length > 0; + }).join('&') : ''; + }; + + +/***/ }, +/* 57 */ +/***/ function(module, exports) { + + 'use strict'; + module.exports = function (str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase(); + }); + }; + + +/***/ } +/******/ ]) +}); +; \ No newline at end of file diff --git a/public/javascripts/wechat/ReactRouter.min.js b/public/javascripts/wechat/ReactRouter.min.js new file mode 100644 index 000000000..af370173e --- /dev/null +++ b/public/javascripts/wechat/ReactRouter.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactRouter=t(require("react")):e.ReactRouter=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(37),a=r(o);t.Router=a["default"];var u=n(18),i=r(u);t.Link=i["default"];var s=n(31),c=r(s);t.IndexLink=c["default"];var f=n(32),l=r(f);t.IndexRedirect=l["default"];var d=n(33),p=r(d);t.IndexRoute=p["default"];var h=n(19),v=r(h);t.Redirect=v["default"];var y=n(35),g=r(y);t.Route=g["default"];var m=n(30),_=r(m);t.History=_["default"];var P=n(34),O=r(P);t.Lifecycle=O["default"];var R=n(36),x=r(R);t.RouteContext=x["default"];var w=n(48),b=r(w);t.useRoutes=b["default"];var M=n(5);t.createRoutes=M.createRoutes;var E=n(13),j=r(E);t.RouterContext=j["default"];var S=n(38),A=r(S);t.RoutingContext=A["default"];var C=n(6),k=r(C);t.PropTypes=k["default"];var T=n(46),H=r(T);t.match=H["default"];var L=n(24),q=r(L);t.useRouterHistory=q["default"];var U=n(8);t.formatPattern=U.formatPattern;var N=n(40),B=r(N);t.browserHistory=B["default"];var I=n(44),D=r(I);t.hashHistory=D["default"];var F=n(21),W=r(F);t.createMemoryHistory=W["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){t="[react-router] "+t;for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;n>o;o++)r[o-2]=arguments[o]}t.__esModule=!0,t["default"]=o;var a=n(4);r(a);e.exports=t["default"]},function(t,n){t.exports=e},function(e,t,n){"use strict";var r=function(e,t,n,r,o,a,u,i){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,u,i],f=0;s=new Error(t.replace(/%s/g,function(){return c[f++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}};e.exports=r},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return null==e||p["default"].isValidElement(e)}function a(e){return o(e)||Array.isArray(e)&&e.every(o)}function u(e,t,n){e=e||"UnknownComponent";for(var r in t)if(t.hasOwnProperty(r)){var o=t[r](n,r,e);o instanceof Error}}function i(e,t){return l({},e,t)}function s(e){var t=e.type,n=i(t.defaultProps,e.props);if(t.propTypes&&u(t.displayName||t.name,t.propTypes,n),n.children){var r=c(n.children,n);r.length&&(n.childRoutes=r),delete n.children}return n}function c(e,t){var n=[];return p["default"].Children.forEach(e,function(e){if(p["default"].isValidElement(e))if(e.type.createRouteFromReactElement){var r=e.type.createRouteFromReactElement(e,t);r&&n.push(r)}else n.push(s(e))}),n}function f(e){return a(e)?e=c(e):e&&!Array.isArray(e)&&(e=[e]),e}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t should not have a "'+t+'" prop'):void 0}t.__esModule=!0,t.falsy=r;var o=n(2),a=o.PropTypes.func,u=o.PropTypes.object,i=o.PropTypes.arrayOf,s=o.PropTypes.oneOfType,c=o.PropTypes.element,f=o.PropTypes.shape,l=o.PropTypes.string,d=f({listen:a.isRequired,pushState:a.isRequired,replaceState:a.isRequired,go:a.isRequired});t.history=d;var p=f({pathname:l.isRequired,search:l.isRequired,state:u,action:l.isRequired,key:l});t.location=p;var h=s([a,l]);t.component=h;var v=s([h,u]);t.components=v;var y=s([u,c]);t.route=y;var g=s([y,i(y)]);t.routes=g,t["default"]={falsy:r,history:d,location:p,component:h,components:v,route:y}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=e.match(/^https?:\/\/[^\/]*/);return null==t?e:e.substring(t[0].length)}function a(e){var t=o(e),n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substring(a),t=t.substring(0,a));var u=t.indexOf("?");return-1!==u&&(n=t.substring(u),t=t.substring(0,u)),""===t&&(t="/"),{pathname:t,search:n,hash:r}}t.__esModule=!0,t.extractPath=o,t.parsePath=a;var u=n(4);r(u)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a(e){return o(e).replace(/\/+/g,"/+")}function u(e){for(var t="",n=[],r=[],o=void 0,u=0,i=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*\*|\*|\(|\)/g;o=i.exec(e);)o.index!==u&&(r.push(e.slice(u,o.index)),t+=a(e.slice(u,o.index))),o[1]?(t+="([^/?#]+)",n.push(o[1])):"**"===o[0]?(t+="([\\s\\S]*)",n.push("splat")):"*"===o[0]?(t+="([\\s\\S]*?)",n.push("splat")):"("===o[0]?t+="(?:":")"===o[0]&&(t+=")?"),r.push(o[0]),u=i.lastIndex;return u!==e.length&&(r.push(e.slice(u,e.length)),t+=a(e.slice(u,e.length))),{pattern:e,regexpSource:t,paramNames:n,tokens:r}}function i(e){return e in h||(h[e]=u(e)),h[e]}function s(e,t){"/"!==e.charAt(0)&&(e="/"+e),"/"!==t.charAt(0)&&(t="/"+t);var n=i(e),r=n.regexpSource,o=n.paramNames,a=n.tokens;r+="/*";var u="*"!==a[a.length-1];u&&(r+="([\\s\\S]*?)");var s=t.match(new RegExp("^"+r+"$","i")),c=void 0,f=void 0;if(null!=s){if(u){c=s.pop();var l=s[0].substr(0,s[0].length-c.length);if(c&&"/"!==l.charAt(l.length-1))return{remainingPathname:null,paramNames:o,paramValues:null}}else c="";f=s.slice(1).map(function(e){return null!=e?decodeURIComponent(e):e})}else c=f=null;return{remainingPathname:c,paramNames:o,paramValues:f}}function c(e){return i(e).paramNames}function f(e,t){var n=s(e,t),r=n.paramNames,o=n.paramValues;return null!=o?r.reduce(function(e,t,n){return e[t]=o[n],e},{}):null}function l(e,t){t=t||{};for(var n=i(e),r=n.tokens,o=0,a="",u=0,s=void 0,c=void 0,f=void 0,l=0,d=r.length;d>l;++l)s=r[l],"*"===s||"**"===s?(f=Array.isArray(t.splat)?t.splat[u++]:t.splat,null!=f||o>0?void 0:p["default"](!1),null!=f&&(a+=encodeURI(f))):"("===s?o+=1:")"===s?o-=1:":"===s.charAt(0)?(c=s.substring(1),f=t[c],null!=f||o>0?void 0:p["default"](!1),null!=f&&(a+=encodeURIComponent(f))):a+=s;return a.replace(/\/+/g,"/")}t.__esModule=!0,t.compilePattern=i,t.matchPattern=s,t.getParamNames=c,t.getParams=f,t.formatPattern=l;var d=n(3),p=r(d),h={}},function(e,t){"use strict";t.__esModule=!0;var n="PUSH";t.PUSH=n;var r="REPLACE";t.REPLACE=r;var o="POP";t.POP=o,t["default"]={PUSH:n,REPLACE:r,POP:o}},function(e,t){"use strict";t.__esModule=!0;var n=!("undefined"==typeof window||!window.document||!window.document.createElement);t.canUseDOM=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return c.stringify(e).replace(/%20/g,"+")}function u(e){return function(){function t(e){if(null==e.query){var t=e.search;e.query=R(t.substring(1)),e[v]={search:t,searchBase:""}}return e}function n(e,t){var n,r=e[v],o=t?O(t):"";if(!r&&!o)return e;"string"==typeof e&&(e=d.parsePath(e));var a=void 0;a=r&&e.search===r.search?r.searchBase:e.search||"";var u=a;return o&&(u+=(u?"&":"?")+o),i({},e,(n={search:u},n[v]={search:u,searchBase:a},n))}function r(e){return w.listenBefore(function(n,r){l["default"](e,t(n),r)})}function u(e){return w.listen(function(n){e(t(n))})}function s(e){w.push(n(e,e.query))}function c(e){w.replace(n(e,e.query))}function f(e,t){return w.createPath(n(e,t||e.query))}function p(e,t){return w.createHref(n(e,t||e.query))}function g(e){for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;r>a;a++)o[a-1]=arguments[a];var u=w.createLocation.apply(w,[n(e,e.query)].concat(o));return e.query&&(u.query=e.query),t(u)}function m(e,t,n){"string"==typeof t&&(t=d.parsePath(t)),s(i({state:e},t,{query:n}))}function _(e,t,n){"string"==typeof t&&(t=d.parsePath(t)),c(i({state:e},t,{query:n}))}var P=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],O=P.stringifyQuery,R=P.parseQueryString,x=o(P,["stringifyQuery","parseQueryString"]),w=e(x);return"function"!=typeof O&&(O=a),"function"!=typeof R&&(R=y),i({},w,{listenBefore:r,listen:u,push:s,replace:c,createPath:f,createHref:p,createLocation:g,pushState:h["default"](m,"pushState is deprecated; use push instead"),replaceState:h["default"](_,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;tu&&c;)c=!1,t.call(this,u++,a,r);return s=!1,i?void n.apply(this,f):void(u>=e&&c&&(i=!0,n()))}}var u=0,i=!1,s=!1,c=!1,f=void 0;a()}function r(e,t,n){function r(e,t,r){u||(t?(u=!0,n(t)):(a[e]=r,u=++i===o,u&&n(null,a)))}var o=e.length,a=[];if(0===o)return n(null,a);var u=!1,i=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}t.__esModule=!0;var o=Array.prototype.slice;t.loopAsync=n,t.mapAsync=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;ti;++i)a=o[i](e);n(a)})}function y(){if(O.routes){for(var e=d(O.routes),t=void 0,n=0,r=e.length;"string"!=typeof t&&r>n;++n)t=e[n]();return t}}function m(e){var t=c(e,!1);t&&(delete w[t],o(w)||(b&&(b(),b=null),M&&(M(),M=null)))}function _(t,n){var r=c(t),a=w[r];if(a)-1===a.indexOf(n)&&a.push(n);else{var u=!o(w);w[r]=[n],u&&(b=e.listenBefore(h),e.listenBeforeUnload&&(M=e.listenBeforeUnload(y)))}return function(){var e=w[r];if(e){var o=e.filter(function(e){return e!==n});0===o.length?m(t):w[r]=o}}}function P(t){return e.listen(function(n){O.location===n?t(null,O):a(n,function(n,r,o){n?t(n):r?e.transitionTo(r):o&&t(null,o)})})}var O={},R=void 0,x=1,w={},b=void 0,M=void 0;return{isActive:n,match:a,listenBeforeLeavingRoute:_,listen:P}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return 0===e.button}function u(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function i(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function s(e,t){var n=t.query,r=t.hash,o=t.state;return n||r||o?{pathname:e,query:n,hash:r,state:o}:e}t.__esModule=!0;var c=Object.assign||function(e){for(var t=1;t=0;r--){var o=e[r],a=o.path||"";if(n=a.replace(/\/*$/,"/")+n,0===a.indexOf("/"))break}return"/"+n}},propTypes:{path:d,from:d,to:d.isRequired,query:p,state:p,onEnter:f.falsy,children:f.falsy},render:function(){i["default"](!1)}});t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return u({},e,{setRouteLeaveHook:t.listenBeforeLeavingRoute,isActive:t.isActive})}function a(e,t){return e=u({},e,t)}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t=0&&0===window.sessionStorage.length)return;throw n}}function u(e){var t=void 0;try{t=window.sessionStorage.getItem(o(e))}catch(n){if(n.name===f)return null}if(t)try{return JSON.parse(t)}catch(n){}return null}t.__esModule=!0,t.saveState=a,t.readState=u;var i=n(4),s=(r(i),"@@History/"),c=["QuotaExceededError","QUOTA_EXCEEDED_ERR"],f="SecurityError"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){function t(e){return s.canUseDOM?void 0:i["default"](!1),n.listen(e)}var n=l["default"](a({getUserConfirmation:c.getUserConfirmation},e,{go:c.go}));return a({},n,{listen:t})}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return function(){function t(e){return _&&null==e.basename&&(0===e.pathname.indexOf(_)?(e.pathname=e.pathname.substring(_.length),e.basename=_,""===e.pathname&&(e.pathname="/")):e.basename=""),e}function n(e){if(!_)return e;"string"==typeof e&&(e=s.parsePath(e));var t=e.pathname,n="/"===_.slice(-1)?_:_+"/",r="/"===t.charAt(0)?t.slice(1):t,o=n+r;return u({},e,{pathname:o})}function r(e){return O.listenBefore(function(n,r){f["default"](e,t(n),r)})}function a(e){return O.listen(function(n){e(t(n))})}function c(e){O.push(n(e))}function l(e){O.replace(n(e))}function p(e){return O.createPath(n(e))}function h(e){return O.createHref(n(e))}function v(e){for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;r>a;a++)o[a-1]=arguments[a];return t(O.createLocation.apply(O,[n(e)].concat(o)))}function y(e,t){"string"==typeof t&&(t=s.parsePath(t)),c(u({state:e},t))}function g(e,t){"string"==typeof t&&(t=s.parsePath(t)),l(u({state:e},t))}var m=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],_=m.basename,P=o(m,["basename"]),O=e(P);if(null==_&&i.canUseDOM){var R=document.getElementsByTagName("base")[0];R&&(_=s.extractPath(R.href))}return u({},O,{listenBefore:r,listen:a,push:c,replace:l,createPath:p,createHref:h,createLocation:v,pushState:d["default"](y,"pushState is deprecated; use push instead"),replaceState:d["default"](g,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return!e||!e.__v2_compatible__}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;tt;++t)e[t].onLeave&&e[t].onLeave.call(e[t])}t.__esModule=!0,t.runEnterHooks=u,t.runLeaveHooks=i;var s=n(12),c=n(1);r(c)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(53),a=r(o),u=n(22),i=r(u);t["default"]=i["default"](a["default"]),e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){if(!e.path)return!1;var r=a.getParamNames(e.path);return r.some(function(e){return t.params[e]!==n.params[e]})}function o(e,t){var n=e&&e.routes,o=t.routes,a=void 0,u=void 0;return n?!function(){var i=!1;a=n.filter(function(n){if(i)return!0;var a=-1===o.indexOf(n)||r(n,e,t);return a&&(i=!0),a}),a.reverse(),u=o.filter(function(e){return-1===n.indexOf(e)||-1!==a.indexOf(e)})}():(a=[],u=o),{leaveRoutes:a,enterRoutes:u}}t.__esModule=!0;var a=n(8);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){t.component||t.components?n(null,t.component||t.components):t.getComponent?t.getComponent(e,n):t.getComponents?t.getComponents(e,n):n()}function o(e,t){a.mapAsync(e.routes,function(t,n,o){r(e.location,t,o)},t)}t.__esModule=!0;var a=n(12);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){var n={};if(!e.path)return n;var r=o.getParamNames(e.path);for(var a in t)t.hasOwnProperty(a)&&-1!==r.indexOf(a)&&(n[a]=t[a]);return n}t.__esModule=!0;var o=n(8);t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(27),a=r(o),u=n(22),i=r(u);t["default"]=i["default"](a["default"]),e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(e==t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return r(e,t[n])});if("object"==typeof e){for(var n in e)if(e.hasOwnProperty(n))if(void 0===e[n]){if(void 0!==t[n])return!1}else{if(!t.hasOwnProperty(n))return!1;if(!r(e[n],t[n]))return!1}return!0}return String(e)===String(t)}function o(e,t,n){return e.every(function(e,r){return String(t[r])===String(n[e])})}function a(e,t,n){for(var r=e,a=[],u=[],i=0,s=t.length;s>i;++i){var f=t[i],l=f.path||"";if("/"===l.charAt(0)&&(r=e,a=[],u=[]),null!==r){var d=c.matchPattern(l,r);r=d.remainingPathname,a=[].concat(a,d.paramNames),u=[].concat(u,d.paramValues)}if(""===r&&f.path&&o(a,u,n))return i}return null}function u(e,t,n,r){var o=a(e,t,n);return null===o?!1:r?t.slice(o+1).every(function(e){return!e.path}):!0}function i(e,t){return null==t?null==e:null==e?!0:r(e,t)}function s(e,t,n,r,o){var a=e.pathname,s=e.query;return null==n?!1:u(a,r,o,t)?i(s,n.query):!1}t.__esModule=!0,t["default"]=s;var c=n(8);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e,t){var n=e.history,r=e.routes,a=e.location,i=o(e,["history","routes","location"]);n||a?void 0:s["default"](!1),n=n?n:f["default"](i);var c=d["default"](n,p.createRoutes(r)),l=void 0;a?a=n.createLocation(a):l=n.listen(function(e){a=e});var v=h.createRouterObject(n,c);n=h.createRoutingHistory(n,c),c.match(a,function(e,r,o){t(e,r,o&&u({},o,{history:n,router:v,matchContext:{history:n,transitionManager:c,router:v}})),l&&l()})}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.routes,r=o(t,["routes"]),a=s["default"](e)(r),i=f["default"](a,n);return u({},a,i)}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t0&&"number"!=typeof e[0]?!1:!0:!1}function a(e,t,n){var a,f;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(s(e))return s(t)?(e=u.call(e),t=u.call(t),c(e,t,n)):!1;if(o(e)){if(!o(t))return!1;if(e.length!==t.length)return!1;for(a=0;a=0;a--)if(l[a]!=d[a])return!1;for(a=l.length-1;a>=0;a--)if(f=l[a],!c(e[f],t[f],n))return!1;return typeof e==typeof t}var u=Array.prototype.slice,i=n(51),s=n(50),c=e.exports=function(e,t,n){return n||(n={}),e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:a(e,t,n)}},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=o?n:r,t.supported=n,t.unsupported=r},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t){"use strict";function n(e,t,n){function r(){u=!0,n.apply(this,arguments)}function o(){u||(e>a?t.call(this,a++,o,r):r.apply(this,arguments))}var a=0,u=!1;o()}t.__esModule=!0,t.loopAsync=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){function e(e){e=e||window.history.state||{};var t=l.getWindowPath(),n=e,r=n.key,o=void 0;r?o=d.readState(r):(o=null,r=_.createKey(),g&&window.history.replaceState(a({},e,{key:r}),null,t));var u=c.parsePath(t);return _.createLocation(a({},u,{state:o}),void 0,r)}function t(t){function n(t){void 0!==t.state&&r(e(t.state))}var r=t.transitionTo;return l.addEventListener(window,"popstate",n),function(){l.removeEventListener(window,"popstate",n)}}function n(e){var t=e.basename,n=e.pathname,r=e.search,o=e.hash,a=e.state,u=e.action,i=e.key;if(u!==s.POP){d.saveState(i,a);var c=(t||"")+n+r+o,f={key:i};if(u===s.PUSH){if(m)return window.location.href=c,!1;window.history.pushState(f,null,c)}else{if(m)return window.location.replace(c),!1;window.history.replaceState(f,null,c)}}}function r(e){1===++P&&(O=t(_));var n=_.listenBefore(e);return function(){n(),0===--P&&O()}}function o(e){1===++P&&(O=t(_));var n=_.listen(e);return function(){n(),0===--P&&O()}}function u(e){1===++P&&(O=t(_)),_.registerTransitionHook(e)}function p(e){_.unregisterTransitionHook(e),0===--P&&O()}var v=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];f.canUseDOM?void 0:i["default"](!1);var y=v.forceRefresh,g=l.supportsHistory(),m=!g||y,_=h["default"](a({},v,{getCurrentLocation:e,finishTransition:n,saveState:d.saveState})),P=0,O=void 0;return a({},_,{listenBefore:r,listen:o,registerTransitionHook:u,unregisterTransitionHook:p})}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t=0&&t=0&&y