UNPKG

react-router

Version:

A complete routing library for React.js

1 lines • 28.3 kB
!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}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(17),i=r(o);t.Router=i["default"];var a=n(13),u=r(a);t.Link=u["default"];var s=n(15),c=r(s);t.Redirect=c["default"];var l=n(16),f=r(l);t.Route=f["default"];var p=n(14),d=r(p);t.Navigation=d["default"];var h=n(23),y=r(h);t.TransitionHook=y["default"];var m=n(21),v=r(m);t.State=v["default"];var g=n(3);Object.defineProperty(t,"createRoutesFromReactChildren",{enumerable:!0,get:function(){return g.createRoutesFromReactChildren}});var b=n(4),P=r(b);t.PropTypes=P["default"];var R=r(o);t["default"]=R["default"]},function(t){t.exports=e},function(e){"use strict";var t=function(e,t,n,r,o,i,a,u){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,i,a,u],l=0;s=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return c[l++]}))}throw s.framesToPop=1,s}};e.exports=t},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return null==e||f.isValidElement(e)}function i(e){return o(e)||Array.isArray(e)&&e.every(o)}function a(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&&h["default"](!1,o.message)}}function u(e){var t=e.type,n=l({},t.defaultProps,e.props);return t.propTypes&&a(t.displayName||t.name,t.propTypes,n),n.children&&(n.childRoutes=s(n.children),delete n.children),n}function s(e){var t=[];return p["default"].Children.forEach(e,function(e){f.isValidElement(e)&&t.push(e.type.createRouteFromReactElement?e.type.createRouteFromReactElement(e):u(e))}),t}function c(e){return i(e)?e=s(e):Array.isArray(e)||(e=[e]),e}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.isReactChildren=i,t.createRouteFromReactElement=u,t.createRoutesFromReactChildren=s,t.createRoutes=c;var f=n(1),p=r(f),d=n(7),h=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return e[t]?new Error("<"+n+'> should not have a "'+t+'" prop'):void 0}var i=n(1),a=r(i),u=n(5),s=r(u),c=n(12),l=r(c),f=a["default"].PropTypes,p=f.func,d=f.object,h=f.arrayOf,y=f.instanceOf,m=f.oneOfType,v=f.element,g=p,b=m([g,d]),P=y(l["default"]),R=y(s["default"]),O=m([d,v]),_=m([O,h(O)]);e.exports={falsy:o,component:g,components:b,history:P,location:R,route:O,routes:_}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(9),u=r(a),s=function(){function e(){var t=void 0===arguments[0]?"/":arguments[0],n=void 0===arguments[1]?null:arguments[1],r=void 0===arguments[2]?null:arguments[2],i=void 0===arguments[3]?u["default"].POP:arguments[3];o(this,e),this.pathname=t,this.query=n,this.state=r,this.navigationType=i}return i(e,null,[{key:"isLocation",value:function(t){return t instanceof e}}]),e}();t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return m["default"].stringify(e,{arrayFormat:"brackets"})}function i(e){return e.replace(g,"")}function a(e){var t=e.match(g);return t?t[1]:""}function u(e){return e?e.replace(/^\/+/,""):""}function s(e){return"string"==typeof e&&"/"===e.charAt(0)}function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(e){return c(e).replace(/\/+/g,"/+")}function f(e){for(var t,n="",r=[],o=[],i=0,a=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*|\(|\)/g;t=a.exec(e);)t.index!==i&&(o.push(e.slice(i,t.index)),n+=l(e.slice(i,t.index))),t[1]?(n+="([^/?#]+)",r.push(t[1])):"*"===t[0]?(n+="(.*?)",r.push("splat")):"("===t[0]?n+="(?:":")"===t[0]&&(n+=")?"),o.push(t[0]),i=a.lastIndex;return i!==e.length&&(o.push(e.slice(i,e.length)),n+=l(e.slice(i,e.length))),{pattern:e,regexpSource:n,paramNames:r,tokens:o}}function p(e){return e in b||(b[e]=f(e)),b[e]}function d(e,t){var n=p(u(e)),r=n.regexpSource,o=n.paramNames,i=n.tokens;r+="/*";var a="*"!==i[i.length-1];a&&(r+="(.*?)");var s,c,l=t.match(new RegExp("^"+r+"$","i"));return null!=l&&(c=Array.prototype.slice.call(l,1),s=a?c.pop():t.replace(l[0],"")),{remainingPathname:s,paramNames:o,paramValues:c}}function h(e){return p(e).paramNames}Object.defineProperty(t,"__esModule",{value:!0}),t.stringifyQuery=o,t.getPathname=i,t.getQueryString=a,t.stripLeadingSlashes=u,t.isAbsolutePath=s,t.compilePattern=p,t.matchPattern=d,t.getParamNames=h;var y=n(25),m=r(y),v=m["default"].parse;t.parseQueryString=v;var g=/\?(.*)$/,b={}},function(e){"use strict";var t=!1,n=function(){};t&&(n=function(e,t,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var o=2;r>o;o++)n[o-2]=arguments[o];if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(!e){var i=0,a="Warning: "+t.replace(/%s/g,function(){n[i++]});"undefined"!=typeof console&&console.error(a);try{throw new Error(a)}catch(u){}}}),e.exports=n},function(e,t){"use strict";function n(e,t,n){function r(){a=!0,n.apply(this,arguments)}function o(){a||(e>i?(i+=1,t.call(this,i-1,o,r)):r.apply(this,arguments))}var i=0,a=!1;o()}function r(e,t,n){function r(e,t,r){a||(t?(a=!0,n(t)):(i[e]=r,a=++u===o,a&&n(null,i)))}var o=e.length,i=[];if(0===o)return n(null,i);var a=!1,u=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}function o(e,t,n){var o=Object.keys(e);r(o,function(n,r,o){t(e[n],o)},function(e,t){if(e)n(e);else{var r=t.reduce(function(e,t,n){return e[o[n]]=t,e},{});n(null,r)}})}Object.defineProperty(t,"__esModule",{value:!0}),t.loopAsync=n,t.mapAsync=r,t.hashAsync=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(24),i=r(o),a=i["default"]({PUSH:null,REPLACE:null,POP:null});t["default"]=a,e.exports=t["default"]},function(e,t){t.arrayToObject=function(e){for(var t={},n=0,r=e.length;r>n;++n)"undefined"!=typeof e[n]&&(t[n]=e[n]);return t},t.merge=function(e,n){if(!n)return e;if("object"!=typeof n)return Array.isArray(e)?e.push(n):e[n]=!0,e;if("object"!=typeof e)return e=[e].concat(n);Array.isArray(e)&&!Array.isArray(n)&&(e=t.arrayToObject(e));for(var r=Object.keys(n),o=0,i=r.length;i>o;++o){var a=r[o],u=n[a];e[a]=e[a]?t.merge(e[a],u):u}return e},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.compact=function(e,n){if("object"!=typeof e||null===e)return e;n=n||[];var r=n.indexOf(e);if(-1!==r)return n[r];if(n.push(e),Array.isArray(e)){for(var o=[],i=0,a=e.length;a>i;++i)"undefined"!=typeof e[i]&&o.push(e[i]);return o}var u=Object.keys(e);for(i=0,a=u.length;a>i;++i){var s=u[i];e[s]=t.compact(e[s],n)}return e},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t){"use strict";function n(){return decodeURI(window.location.href.split("#")[1]||"")}function r(e){window.location.replace(window.location.pathname+window.location.search+"#"+e)}function o(){return decodeURI(window.location.pathname+window.location.search)}function i(){return{scrollX:window.pageXOffset||document.documentElement.scrollLeft,scrollY:window.pageYOffset||document.documentElement.scrollTop}}function a(e,t){window.scrollTo(e,t)}function u(){var e=navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}Object.defineProperty(t,"__esModule",{value:!0}),t.getHashPath=n,t.replaceHashPath=r,t.getWindowPath=o,t.getWindowScrollPosition=i,t.setWindowScrollPosition=a,t.supportsHistory=u;var s=!("undefined"==typeof window||!window.document||!window.document.createElement);t.canUseDOM=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){return Math.random().toString(36).substr(2)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(2),s=r(u),c=n(6),l=n(5),f=r(l),p=["pushState","replaceState","go"],d=function(){function e(){var t=void 0===arguments[0]?{}:arguments[0];o(this,e),p.forEach(function(e){s["default"]("function"==typeof this[e],'%s needs a "%s" method',this.constructor.name,e)},this),this.parseQueryString=t.parseQueryString||c.parseQueryString,this.changeListeners=[],this.location=null}return a(e,[{key:"_notifyChange",value:function(){for(var e=0,t=this.changeListeners.length;t>e;++e)this.changeListeners[e].call(this)}},{key:"addChangeListener",value:function(e){this.changeListeners.push(e)}},{key:"removeChangeListener",value:function(e){this.changeListeners=this.changeListeners.filter(function(t){return t!==e})}},{key:"back",value:function(){this.go(-1)}},{key:"forward",value:function(){this.go(1)}},{key:"_createState",value:function(e){return e=e||{},e.key||(e.key=i()),e}},{key:"createLocation",value:function(e,t,n){var r=c.getPathname(e),o=c.getQueryString(e),i=o?this.parseQueryString(o):null;return new f["default"](r,i,t,n)}}]),e}();t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return 0===e.button}function i(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(1),s=r(u),c=s["default"].PropTypes,l=c.object,f=c.string,p=c.func,d=s["default"].createClass({displayName:"Link",contextTypes:{router:l},propTypes:{activeStyle:l,activeClassName:f,to:f.isRequired,query:l,state:l,onClick:p},getDefaultProps:function(){return{className:"",activeClassName:"active",style:{}}},handleClick:function(e){var t,n=!0;this.props.onClick&&(t=this.props.onClick(e)),!i(e)&&o(e)&&((t===!1||e.defaultPrevented===!0)&&(n=!1),e.preventDefault(),n&&this.context.router.transitionTo(this.props.to,this.props.query,this.props.state))},render:function(){var e=this.context.router,t=this.props,n=t.to,r=t.query,o=a({},this.props,{href:e.makeHref(n,r),onClick:this.handleClick});return e&&e.isActive(n,r)&&(o.activeClassName&&(o.className+=" "+o.activeClassName),o.activeStyle&&a(o.style,o.activeStyle)),s["default"].createElement("a",o)}});t.Link=d,t["default"]=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=i["default"].PropTypes.object,u={contextTypes:{router:a.isRequired}},s=["makePath","makeHref","transitionTo","replaceWith","go","goBack","goForward"];s.forEach(function(e){u[e]=function(){var t=this.context.router;return t[e].apply(t,arguments)}}),t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=n(2),u=r(a),s=n(3),c=n(4),l=i["default"].PropTypes.string,f=i["default"].createClass({displayName:"Redirect",statics:{createRouteFromReactElement:function(e){var t=s.createRouteFromReactElement(e);return t.from&&(t.path=t.from),t.onEnter=function(e,n){n.replaceWith(t.to,e.query)},t}},propTypes:{from:l,to:l.isRequired,onEnter:c.falsy,children:c.falsy},render:function(){u["default"](!1,"<Redirect> elements are for router configuration only and should not be rendered")}});t.Redirect=f,t["default"]=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=n(2),u=r(a),s=n(3),c=n(4),l=i["default"].PropTypes,f=l.string,p=l.bool,d=l.func,h=i["default"].createClass({displayName:"Route",statics:{createRouteFromReactElement:function(e){var t=s.createRouteFromReactElement(e);return t.handler&&(warning(!1,"<Route handler> is deprecated, use <Route component> instead"),t.component=t.handler,delete t.handler),t}},propTypes:{path:f,ignoreScrollBehavior:p,handler:c.component,component:c.component,components:c.components,getComponents:d},render:function(){u["default"](!1,"<Route> elements are for router configuration only and should not be rendered")}});t.Route=h,t["default"]=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n,r,o){var i=new O["default"];h.getState(t,n,function(t,a){if(t||null==a||i.isCancelled)o(t,null,i);else{a.location=n;var u=h.getTransitionHooks(e,a);Array.isArray(r)&&u.unshift.apply(u,r),p.loopAsync(u.length,function(e,t,n){u[e](a,i,function(e){e||i.isCancelled?n(e):t()})},function(e){e||i.isCancelled?o(e,null,i):h.getComponents(a.branch,function(e,t){e||i.isCancelled?o(e,null,i):(a.components=t,o(null,a,i))})})}})}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),u=r(a),s=n(7),c=r(s),l=n(2),f=r(l),p=n(8),d=n(3),h=n(19),y=n(4),m=n(18),v=r(m),g=n(20),b=r(g),P=n(5),R=n(22),O=r(R),_=u["default"].PropTypes,w=_.arrayOf,x=_.func,k=_.object,j=u["default"].createClass({displayName:"Router",mixins:[v["default"],b["default"]],statics:{run:function(e,t,n,r){"function"==typeof n&&(r=n,n=null),f["default"]("function"==typeof r,"Router.run needs a callback"),o(null,e,t,n,r)}},propTypes:{createElement:x.isRequired,onAbort:x,onError:x,onUpdate:x,history:y.history,routes:y.routes,children:y.routes,location:y.location,branch:y.routes,params:k,components:w(y.components)},getDefaultProps:function(){return{createElement:a.createElement}},getInitialState:function(){return{isTransitioning:!1,location:null,branch:null,params:null,components:null}},_updateState:function(e){var t=this;f["default"](P.isLocation(e),"A <Router> needs a valid Location");var n=this.transitionHooks;n&&(n=n.map(function(e){return h.createTransitionHook(e,t)})),this.setState({isTransitioning:!0}),o(this.state,this.routes,e,n,function(n,r,o){if(n)t.handleError(n);else if(o.isCancelled)if(o.redirectInfo){var i=o.redirectInfo,a=i.pathname,u=i.query,r=i.state;t.replaceWith(a,u,r)}else f["default"](t.state.location,"You may not abort the initial transition"),t.handleAbort(reason);else null==r?c["default"](!1,'Location "%s" did not match any routes',e.pathname):t.setState(r,t.props.onUpdate);t.setState({isTransitioning:!1})})},addTransitionHook:function(e){this.transitionHooks||(this.transitionHooks=[]),this.transitionHooks.push(e)},removeTransitionHook:function(e){this.transitionHooks&&(this.transitionHooks=this.transitionHooks.filter(function(t){return t!==e}))},handleAbort:function(e){this.props.onAbort?this.props.onAbort.call(this,e):(this._ignoreNextHistoryChange=!0,this.goBack())},handleError:function(e){if(!this.props.onError)throw e;this.props.onError.call(this,e)},handleHistoryChange:function(){this._ignoreNextHistoryChange?this._ignoreNextHistoryChange=!1:this._updateState(this.props.history.location)},componentWillMount:function(){var e=this.props,t=e.history,n=e.routes,r=e.children,o=e.location,i=e.branch,a=e.params,u=e.components;t?(f["default"](n||r,"Client-side <Router>s need routes. Try using <Router routes> or passing your routes as nested <Route> children"),this.routes=d.createRoutes(n||r),"function"==typeof t.setup&&t.setup(),t.addChangeListener&&t.addChangeListener(this.handleHistoryChange),this._updateState(t.location)):(f["default"](o&&i&&a&&u,"Server-side <Router>s need location, branch, params, and components props. Try using Router.run to get all the props you need"),this.setState({location:o,branch:i,params:a,components:u}))},componentWillReceiveProps:function(e){if(f["default"](this.props.history===e.history,"<Router history> may not be changed"),e.history){var t=this.props.routes||this.props.children,n=e.routes||e.children;t!==n&&(this.routes=d.createRoutes(n),e.history.location&&this._updateState(e.history.location))}},componentWillUnmount:function(){var e=this.props.history;e&&e.removeChangeListener&&e.removeChangeListener(this.handleHistoryChange)},_createElement:function(e,t){return"function"==typeof e?this.props.createElement(e,t):null},render:function(){var e=this,t=this.state,n=t.location,r=t.branch,o=t.params,u=t.components,s=t.isTransitioning,c=null;return u&&(c=u.reduceRight(function(t,u,c){if(null==u)return t;var l=r[c],f=h.getRouteParams(l,o),p={location:n,params:o,route:l,routeParams:f,isTransitioning:s};if(a.isValidElement(t)?p.children=t:t&&i(p,t),"object"==typeof u){var d={};for(var y in u)u.hasOwnProperty(y)&&(d[y]=e._createElement(u[y],p));return d}return e._createElement(u,p)},c)),f["default"](null===c||c===!1||a.isValidElement(c),"The root route must render a single element"),c}});t["default"]=j,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 0===l.stripLeadingSlashes(t).indexOf(l.stripLeadingSlashes(e))?!0:!1}function i(e,t){if(null==t)return null==e;if(null==e)return!0;for(var n in e)if(e.hasOwnProperty(n)&&String(e[n])!==String(t[n]))return!1;return!0}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),u=r(a),s=n(2),c=r(s),l=n(6),f=u["default"].PropTypes,p=f.func,d=f.object,h={propTypes:{stringifyQuery:p.isRequired},getDefaultProps:function(){return{stringifyQuery:l.stringifyQuery}},childContextTypes:{router:d.isRequired},getChildContext:function(){return{router:this}},makePath:function(e,t){return t&&("string"!=typeof t&&(t=this.props.stringifyQuery(t)),""!==t)?e+"?"+t:e},makeHref:function(e,t){return this.makePath(e,t)},transitionTo:function(e,t){var n=void 0===arguments[2]?null:arguments[2],r=this.props.history;c["default"](r,"Router#transitionTo is client-side only (needs history)"),r.pushState(n,this.makePath(e,t))},replaceWith:function(e,t){var n=void 0===arguments[2]?null:arguments[2],r=this.props.history;c["default"](r,"Router#replaceWith is client-side only (needs history)"),r.replaceState(n,this.makePath(e,t))},go:function(e){var t=this.props.history;c["default"](t,"Router#go is client-side only (needs history)"),t.go(e)},goBack:function(){this.go(-1)},goForward:function(){this.go(1)},isActive:function(e,t){var n=this.state.location;return null==n?!1:o(e,n.pathname)&&i(t,n.query)}};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){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(s){o=!0,i=s}finally{try{!r&&u["return"]&&u["return"]()}finally{if(o)throw i}}return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")}function i(e,t,n){e.childRoutes?n(null,e.childRoutes):e.getChildRoutes?e.getChildRoutes(t,n):n()}function a(e,t,n){e.indexRoute?n(null,e.indexRoute):e.getIndexRoute?e.getIndexRoute(n,t):n()}function u(e,t,n){return t.reduceRight(function(e,t,r){var o=n[r];return Array.isArray(e[t])?e[t].unshift(o):e[t]=t in e?[o,e[t]]:o,e},e)}function s(e,t){return u({},e,t)}function c(e,t,n,r){var o=O.matchPattern(e.path,t),c=o.remainingPathname,f=o.paramNames,p=o.paramValues,d=""===c;if(d&&e.path){var h=s(f,p),y=[e];a(e,n,function(e,t){e?r(e):(t&&y.push(t),r(null,{params:h,branch:y}))})}else null!=c?i(e,n,function(t,o){t?r(t):o?l(o,c,n,function(t,n){t?r(t):n?(u(n.params,f,p),n.branch.unshift(e),r(null,n)):r()}):r()}):r()}function l(e,t,n,r){e=R.createRoutes(e),_.loopAsync(e.length,function(r,o,i){c(e[r],t,n,function(e,t){e||t?i(e,t):o()})},r)}function f(e,t,n){l(e,O.stripLeadingSlashes(t.pathname),t.state,n)}function p(e,t,n){if(!e.path)return!1;var r=O.getParamNames(e.path);return r.some(function(e){return t.params[e]!==n.params[e]})}function d(e,t){var n,r,o=e&&e.branch,i=t.branch;return o?(n=o.filter(function(n){return-1===i.indexOf(n)||p(n,e,t)}),n.reverse(),r=i.filter(function(e){return-1===o.indexOf(e)||-1!==n.indexOf(e)})):(n=[],r=i),[n,r]}function h(e,t){return function(n,r,o){e.length>2?e.call(t,n,r,o):(e.call(t,n,r),o())}}function y(e,t){return e.reduce(function(e,n){return n[t]&&e.push(h(n[t],n)),e},[])}function m(e,t){var n=d(e,t),r=o(n,2),i=r[0],a=r[1],u=y(i,"onLeave");return u.push.apply(u,y(a,"onEnter")),u}function v(e,t){e.component||e.components?t(null,e.component||e.components):e.getComponents?e.getComponents(t):t()}function g(e,t){_.mapAsync(e,function(e,t,n){v(e,n)},t)}function b(e,t){var n={};if(!e.path)return n;var r=O.getParamNames(e.path);for(var o in t)t.hasOwnProperty(o)&&-1!==r.indexOf(o)&&(n[o]=t[o]);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.getState=f,t.createTransitionHook=h,t.getTransitionHooks=m,t.getComponents=g,t.getRouteParams=b;var P=n(2),R=(r(P),n(3)),O=n(6),_=n(8)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return e.filter(function(e){return-1!==t.indexOf(e)})}function i(e,t){var n=e.location,r=e.branch,i=t.location,a=t.branch;if(n.pathname===i.pathname)return!1;var u=o(r,a);return u.some(function(e){return e.ignoreScrollBehavior})?!1:!0}function a(e,t,n){c.canUseDOM&&(e===f["default"].POP?c.setWindowScrollPosition(t,n):c.setWindowScrollPosition(0,0))}Object.defineProperty(t,"__esModule",{value:!0});var u=n(1),s=r(u),c=n(11),l=n(9),f=r(l),p=s["default"].PropTypes.func,d={propTypes:{shouldUpdateScrollPosition:p.isRequired,updateScrollPosition:p.isRequired},getDefaultProps:function(){return{shouldUpdateScrollPosition:i,updateScrollPosition:a}},componentDidUpdate:function(e,t){var n=this.state.location,r=n&&n.state;if(r&&this.props.shouldUpdateScrollPosition(this.state,t)){var o=r.scrollX,i=r.scrollY;null!=o&&null!=i&&this.props.updateScrollPosition(n.navigationType,o,i)}}};t["default"]=d,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=i["default"].PropTypes.object,u={contextTypes:{router:a.isRequired}},s=["isActive"];s.forEach(function(e){u[e]=function(){var t=this.context.router;return t[e].apply(t,arguments)}}),t["default"]=u,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(){function e(){n(this,e),this.isCancelled=!1,this.redirectInfo=null,this.abortReason=null}return r(e,[{key:"to",value:function(e,t,n){this.redirectInfo={pathname:e,query:t,state:n},this.isCancelled=!0}},{key:"abort",value:function(e){this.abortReason=e,this.isCancelled=!0}}]),e}();t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=r(o),a=n(7),u=r(a),s=i["default"].PropTypes.object,c={contextTypes:{router:s.isRequired},componentDidMount:function(){u["default"]("function"==typeof this.routerWillLeave,"Components that mixin TransitionHook should have a routerWillLeave method, check %s",this.constructor.displayName||this.constructor.name),this.routerWillLeave&&this.context.router.addTransitionHook(this.routerWillLeave)},componentWillUnmount:function(){this.routerWillLeave&&this.context.router.removeTransitionHook(this.routerWillLeave)}};t["default"]=c,e.exports=t["default"]},function(e){"use strict";var t=function(e){var t,n={};if(!(e instanceof Object)||Array.isArray(e))throw new Error("keyMirror(...): Argument must be an object.");for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=t},function(e,t,n){e.exports=n(26)},function(e,t,n){var r=n(28),o=n(27);e.exports={stringify:r,parse:o}},function(e,t,n){var r=n(10),o={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3};o.parseValues=function(e,t){for(var n={},o=e.split(t.delimiter,1/0===t.parameterLimit?void 0:t.parameterLimit),i=0,a=o.length;a>i;++i){var u=o[i],s=-1===u.indexOf("]=")?u.indexOf("="):u.indexOf("]=")+1;if(-1===s)n[r.decode(u)]="";else{var c=r.decode(u.slice(0,s)),l=r.decode(u.slice(s+1));if(Object.prototype.hasOwnProperty(c))continue;n[c]=n.hasOwnProperty(c)?[].concat(n[c]).concat(l):l}}return n},o.parseObject=function(e,t,n){if(!e.length)return t;var r=e.shift(),i={};if("[]"===r)i=[],i=i.concat(o.parseObject(e,t,n));else{var a="["===r[0]&&"]"===r[r.length-1]?r.slice(1,r.length-1):r,u=parseInt(a,10),s=""+u;!isNaN(u)&&r!==a&&s===a&&u>=0&&u<=n.arrayLimit?(i=[],i[u]=o.parseObject(e,t,n)):i[a]=o.parseObject(e,t,n)}return i},o.parseKeys=function(e,t,n){if(e){var r=/^([^\[\]]*)/,i=/(\[[^\[\]]*\])/g,a=r.exec(e);if(!Object.prototype.hasOwnProperty(a[1])){var u=[];a[1]&&u.push(a[1]);for(var s=0;null!==(a=i.exec(e))&&s<n.depth;)++s,Object.prototype.hasOwnProperty(a[1].replace(/\[|\]/g,""))||u.push(a[1]);return a&&u.push("["+e.slice(a.index)+"]"),o.parseObject(u,t,n)}}},e.exports=function(e,t){if(""===e||null===e||"undefined"==typeof e)return{};t=t||{},t.delimiter="string"==typeof t.delimiter||r.isRegExp(t.delimiter)?t.delimiter:o.delimiter,t.depth="number"==typeof t.depth?t.depth:o.depth,t.arrayLimit="number"==typeof t.arrayLimit?t.arrayLimit:o.arrayLimit,t.parameterLimit="number"==typeof t.parameterLimit?t.parameterLimit:o.parameterLimit;for(var n="string"==typeof e?o.parseValues(e,t):e,i={},a=Object.keys(n),u=0,s=a.length;s>u;++u){var c=a[u],l=o.parseKeys(c,n[c],t);i=r.merge(i,l)}return r.compact(i)}},function(e,t,n){var r=n(10),o={delimiter:"&",arrayPrefixGenerators:{brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}}};o.stringify=function(e,t,n){if(r.isBuffer(e)?e=e.toString():e instanceof Date?e=e.toISOString():null===e&&(e=""),"string"==typeof e||"number"==typeof e||"boolean"==typeof e)return[encodeURIComponent(t)+"="+encodeURIComponent(e)];var i=[];if("undefined"==typeof e)return i;for(var a=Object.keys(e),u=0,s=a.length;s>u;++u){var c=a[u];i=i.concat(Array.isArray(e)?o.stringify(e[c],n(t,c),n):o.stringify(e[c],t+"["+c+"]",n))}return i},e.exports=function(e,t){t=t||{};var n="undefined"==typeof t.delimiter?o.delimiter:t.delimiter,r=[];if("object"!=typeof e||null===e)return"";var i;i=t.arrayFormat in o.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";for(var a=o.arrayPrefixGenerators[i],u=Object.keys(e),s=0,c=u.length;c>s;++s){var l=u[s];r=r.concat(o.stringify(e[l],l,a))}return r.join(n)}}])});