import t from"./react.js";import{P as e}from"./common/index-51e65b81.js";var n=function(){};function r(){return(r=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0;f--){var h=a[f];"."===h?i(a,f):".."===h?(i(a,f),l++):l&&(i(a,f),l--)}if(!u)for(;l--;l)a.unshift("..");!u||""===a[0]||a[0]&&o(a[0])||a.unshift("");var y=a.join("/");return n&&"/"!==y.substr(-1)&&(y+="/"),y}function c(t){return t.valueOf?t.valueOf():Object.prototype.valueOf.call(t)}var s="Invariant failed";function u(t,e){if(!t)throw new Error(s)}function p(t){return"/"===t.charAt(0)?t:"/"+t}function l(t){return"/"===t.charAt(0)?t.substr(1):t}function f(t,e){return function(t,e){return 0===t.toLowerCase().indexOf(e.toLowerCase())&&-1!=="/?#".indexOf(t.charAt(e.length))}(t,e)?t.substr(e.length):t}function h(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t}function y(t){var e=t.pathname,n=t.search,r=t.hash,o=e||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function d(t,e,n,o){var i;"string"==typeof t?(i=function(t){var e=t||"/",n="",r="",o=e.indexOf("#");-1!==o&&(r=e.substr(o),e=e.substr(0,o));var i=e.indexOf("?");return-1!==i&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}}(t)).state=e:(void 0===(i=r({},t)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==e&&void 0===i.state&&(i.state=e));try{i.pathname=decodeURI(i.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(i.key=n),o?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=a(i.pathname,o.pathname)):i.pathname=o.pathname:i.pathname||(i.pathname="/"),i}function v(){var t=null;var e=[];return{setPrompt:function(e){return t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,n,r,o){if(null!=t){var i="function"==typeof t?t(e,n):t;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(t){var n=!0;function r(){n&&t.apply(void 0,arguments)}return e.push(r),function(){n=!1,e=e.filter((function(t){return t!==r}))}},notifyListeners:function(){for(var t=arguments.length,n=new Array(t),r=0;r may have only one child element"),this.unlisten=o.listen((function(){e.setState({match:e.computeMatch(o.location.pathname)})}))},r.prototype.componentWillReceiveProps=function(t){n(this.props.history===t.history)},r.prototype.componentWillUnmount=function(){this.unlisten()},r.prototype.render=function(){var e=this.props.children;return e?t.Children.only(e):null},r}(t.Component);A.propTypes={history:e.object.isRequired,children:e.node},A.contextTypes={router:e.object},A.childContextTypes={router:e.object.isRequired};var S=A;function _(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var M=function(e){function r(){var t,n;_(this,r);for(var o=arguments.length,i=Array(o),a=0;a=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(e,["replace","to","innerRef"]);R(this.context.router,"You should not use outside a "),R(void 0!==n,'You must specify the "to" property');var i=this.context.router.history,a="string"==typeof n?d(n,null,null,i.location):n,c=i.createHref(a);return t.createElement("a",N({},o,{onClick:this.handleClick,href:c,ref:r}))},n}(t.Component);Y.propTypes={onClick:e.func,target:e.string,replace:e.bool,to:e.oneOfType([e.string,e.object]).isRequired,innerRef:e.oneOfType([e.string,e.func])},Y.defaultProps={replace:!1},Y.contextTypes={router:e.shape({history:e.shape({push:e.func.isRequired,replace:e.func.isRequired,createHref:e.func.isRequired}).isRequired}).isRequired};var D=Y;function K(t){var e=t.pathname,n=t.search,r=t.hash,o=e||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function J(t,e,n,o){var i;"string"==typeof t?(i=function(t){var e=t||"/",n="",r="",o=e.indexOf("#");-1!==o&&(r=e.substr(o),e=e.substr(0,o));var i=e.indexOf("?");return-1!==i&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}}(t)).state=e:(void 0===(i=r({},t)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==e&&void 0===i.state&&(i.state=e));try{i.pathname=decodeURI(i.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(i.key=n),o?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=a(i.pathname,o.pathname)):i.pathname=o.pathname:i.pathname||(i.pathname="/"),i}function V(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(Array.isArray(e))return Array.isArray(n)&&e.length===n.length&&e.every((function(e,r){return t(e,n[r])}));if("object"==typeof e||"object"==typeof n){var r=c(e),o=c(n);return r!==e||o!==n?t(r,o):Object.keys(Object.assign({},e,n)).every((function(r){return t(e[r],n[r])}))}return!1}(t.state,e.state)}function G(t,e,n){return Math.min(Math.max(t,e),n)}function z(t){void 0===t&&(t={});var e,n,o=t,i=o.getUserConfirmation,a=o.initialEntries,c=void 0===a?["/"]:a,s=o.initialIndex,u=void 0===s?0:s,p=o.keyLength,l=void 0===p?6:p,f=(e=null,n=[],{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(t){var e=!0;function r(){e&&t.apply(void 0,arguments)}return n.push(r),function(){e=!1,n=n.filter((function(t){return t!==r}))}},notifyListeners:function(){for(var t=arguments.length,e=new Array(t),r=0;re?r.splice(e,r.length-e,n):r.push(n),h({action:"PUSH",location:n,index:e,entries:r})}}))},replace:function(t,e){var n=J(t,e,y(),g.location);f.confirmTransitionTo(n,"REPLACE",i,(function(t){t&&(g.entries[g.index]=n,h({action:"REPLACE",location:n}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(t){var e=g.index+t;return e>=0&&e1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];"string"==typeof e&&(e={path:e});var r=e,o=r.path,i=r.exact,a=void 0!==i&&i,c=r.strict,s=void 0!==c&&c,u=r.sensitive,p=void 0!==u&&u;if(null==o)return n;var l=gt(o,{end:a,strict:s,sensitive:p}),f=l.re,h=l.keys,y=f.exec(t);if(!y)return null;var d=y[0],v=y.slice(1),m=t===d;return a&&!m?null:{path:o,url:"/"===o&&""===d?"/":d,isExact:m,params:h.reduce((function(t,e,n){return t[e.name]=v[n],t}),{})}},Ot=Object.assign||function(t){for(var e=1;e or withRouter() outside a ");var s=e.route,u=(r||s.location).pathname;return wt(u,{path:o,strict:i,exact:a,sensitive:c},s.match)},r.prototype.componentWillMount=function(){n(!(this.props.component&&this.props.render)),n(!(this.props.component&&this.props.children&&!jt(this.props.children))),n(!(this.props.render&&this.props.children&&!jt(this.props.children)))},r.prototype.componentWillReceiveProps=function(t,e){n(!(t.location&&!this.props.location)),n(!(!t.location&&this.props.location)),this.setState({match:this.computeMatch(t,e.router)})},r.prototype.render=function(){var e=this.state.match,n=this.props,r=n.children,o=n.component,i=n.render,a=this.context.router,c=a.history,s=a.route,u=a.staticContext,p={match:e,location:this.props.location||s.location,history:c,staticContext:u};return o?e?t.createElement(o,p):null:i?e?i(p):null:"function"==typeof r?r(p):r&&!jt(r)?t.Children.only(r):null},r}(t.Component);Et.propTypes={computedMatch:e.object,path:e.string,exact:e.bool,strict:e.bool,sensitive:e.bool,component:e.func,render:e.func,children:e.oneOfType([e.func,e.node]),location:e.object},Et.contextTypes={router:e.shape({history:e.object.isRequired,route:e.object.isRequired,staticContext:e.object})},Et.childContextTypes={router:e.object.isRequired};var Rt=Et,Tt=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(e,["to","exact","strict","location","activeClassName","className","activeStyle","style","isActive","aria-current"]),h="object"===(void 0===n?"undefined":Ct(n))?n.pathname:n,y=h&&h.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1");return t.createElement(Rt,{path:y,exact:r,strict:o,location:i,children:function(e){var r=e.location,o=e.match,i=!!(p?p(o,r):o);return t.createElement(D,Tt({to:n,className:i?[c,a].filter((function(t){return t})).join(" "):c,style:i?Tt({},u,s):u,"aria-current":i&&l||null},f))}})};kt.propTypes={to:D.propTypes.to,exact:e.bool,strict:e.bool,location:e.object,activeClassName:e.string,className:e.string,activeStyle:e.object,style:e.object,isActive:e.func,"aria-current":e.oneOf(["page","step","location","date","time","true"])},kt.defaultProps={activeClassName:"active","aria-current":"page"};var At=kt;function St(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _t(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var Lt=function(t){function e(){return St(this,e),_t(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.enable=function(t){this.unblock&&this.unblock(),this.unblock=this.context.router.history.block(t)},e.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},e.prototype.componentWillMount=function(){R(this.context.router,"You should not use outside a "),this.props.when&&this.enable(this.props.message)},e.prototype.componentWillReceiveProps=function(t){t.when?this.props.when&&this.props.message===t.message||this.enable(t.message):this.disable()},e.prototype.componentWillUnmount=function(){this.disable()},e.prototype.render=function(){return null},e}(t.Component);Lt.propTypes={when:e.bool,message:e.oneOfType([e.func,e.string]).isRequired},Lt.defaultProps={when:!0},Lt.contextTypes={router:e.shape({history:e.shape({block:e.func.isRequired}).isRequired}).isRequired};var Mt=Lt,Ut={},qt=0,Wt=function(t){var e=t,n=Ut[e]||(Ut[e]={});if(n[t])return n[t];var r=nt.compile(t);return qt<1e4&&(n[t]=r,qt++),r},Ht=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("/"===t)return t;var n=Wt(t);return n(e,{pretty:!0})},It=Object.assign||function(t){for(var e=1;e outside a "),this.isStatic()&&this.perform()},e.prototype.componentDidMount=function(){this.isStatic()||this.perform()},e.prototype.componentDidUpdate=function(t){var e=J(t.to),r=J(this.props.to);V(e,r)?n(!1,"You tried to redirect to the same route you're currently on: \""+r.pathname+r.search+'"'):this.perform()},e.prototype.computeTo=function(t){var e=t.computedMatch,n=t.to;return e?"string"==typeof n?Ht(n,e.params):It({},n,{pathname:Ht(n.pathname,e.params)}):n},e.prototype.perform=function(){var t=this.context.router.history,e=this.props.push,n=this.computeTo(this.props);e?t.push(n):t.replace(n)},e.prototype.render=function(){return null},e}(t.Component);Bt.propTypes={computedMatch:e.object,push:e.bool,from:e.string,to:e.oneOfType([e.string,e.object]).isRequired},Bt.defaultProps={push:!1},Bt.contextTypes={router:e.shape({history:e.shape({push:e.func.isRequired,replace:e.func.isRequired}).isRequired,staticContext:e.object}).isRequired};var Ft=Bt,Yt=Object.assign||function(t){for(var e=1;e",t)}},Xt=function(){},Zt=function(e){function r(){var t,n;Dt(this,r);for(var o=arguments.length,i=Array(o),a=0;a=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(e,["basename","context","location"]),i={createHref:this.createHref,action:"POP",location:Gt(n,J(r)),push:this.handlePush,replace:this.handleReplace,go:Qt("go"),goBack:Qt("goBack"),goForward:Qt("goForward"),listen:this.handleListen,block:this.handleBlock};return t.createElement(S,Yt({},o,{history:i}))},r}(t.Component);Zt.propTypes={basename:e.string,context:e.object.isRequired,location:e.oneOfType([e.string,e.object])},Zt.defaultProps={basename:"",location:"/"},Zt.childContextTypes={router:e.object.isRequired};var te=Zt;function ee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ne(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var re=function(e){function r(){return ee(this,r),ne(this,e.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,e),r.prototype.componentWillMount=function(){R(this.context.router,"You should not use outside a ")},r.prototype.componentWillReceiveProps=function(t){n(!(t.location&&!this.props.location)),n(!(!t.location&&this.props.location))},r.prototype.render=function(){var e=this.context.router.route,n=this.props.children,r=this.props.location||e.location,o=void 0,i=void 0;return t.Children.forEach(n,(function(n){if(null==o&&t.isValidElement(n)){var a=n.props,c=a.path,s=a.exact,u=a.strict,p=a.sensitive,l=a.from,f=c||l;i=n,o=wt(r.pathname,{path:f,exact:s,strict:u,sensitive:p},e.match)}})),o?t.cloneElement(i,{location:r,computedMatch:o}):null},r}(t.Component);re.contextTypes={router:e.shape({route:e.object.isRequired}).isRequired},re.propTypes={children:e.node,location:e.object};var oe=re,ie={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ae={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},ce=Object.defineProperty,se=Object.getOwnPropertyNames,ue=Object.getOwnPropertySymbols,pe=Object.getOwnPropertyDescriptor,le=Object.getPrototypeOf,fe=le&&le(Object);var he=function t(e,n,r){if("string"!=typeof n){if(fe){var o=le(n);o&&o!==fe&&t(e,o,r)}var i=se(n);ue&&(i=i.concat(ue(n)));for(var a=0;a=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(e,["wrappedComponentRef"]);return t.createElement(Rt,{children:function(e){return t.createElement(n,ye({},o,e,{ref:r}))}})};return r.displayName="withRouter("+(n.displayName||n.name)+")",r.WrappedComponent=n,r.propTypes={wrappedComponentRef:e.func},he(r,n)};export{U as BrowserRouter,I as HashRouter,D as Link,tt as MemoryRouter,At as NavLink,Mt as Prompt,Ft as Redirect,Rt as Route,S as Router,te as StaticRouter,oe as Switch,Ht as generatePath,wt as matchPath,de as withRouter}; //# sourceMappingURL=react-router-dom.js.map