Files
HSAP/platform/web/node_modules/react-router/cjs/react-router.min.js

3 lines
11 KiB
JavaScript
Raw Normal View History

"use strict";function _interopDefault(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var React=_interopDefault(require("react")),PropTypes=_interopDefault(require("prop-types")),history=require("history");require("tiny-warning");var invariant=_interopDefault(require("tiny-invariant")),pathToRegexp=_interopDefault(require("path-to-regexp"));require("react-is");var hoistStatics=_interopDefault(require("hoist-non-react-statics"));function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),_setPrototypeOf(t.prototype.constructor=t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _objectWithoutPropertiesLoose(t,e){if(null==t)return{};var n,o,r={},i=Object.keys(t);for(o=0;o<i.length;o++)n=i[o],0<=e.indexOf(n)||(r[n]=t[n]);return r}var MAX_SIGNED_31_BIT_INT=1073741823,commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function getUniqueId(){var t="__global_unique_id__";return commonjsGlobal[t]=(commonjsGlobal[t]||0)+1}function objectIs(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function createEventEmitter(n){var o=[];return{on:function(t){o.push(t)},off:function(e){o=o.filter(function(t){return t!==e})},get:function(){return n},set:function(t,e){n=t,o.forEach(function(t){return t(n,e)})}}}function onlyChild(t){return Array.isArray(t)?t[0]:t}function createReactContext(n,i){var t,e,o="__create-react-context-"+getUniqueId()+"__",r=function(r){function t(){for(var t,e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return(t=r.call.apply(r,[this].concat(n))||this).emitter=createEventEmitter(t.props.value),t}_inheritsLoose(t,r);var e=t.prototype;return e.getChildContext=function(){var t;return(t={})[o]=this.emitter,t},e.componentWillReceiveProps=function(t){if(this.props.value!==t.value){var e,n=this.props.value,o=t.value;objectIs(n,o)?e=0:(e="function"==typeof i?i(n,o):MAX_SIGNED_31_BIT_INT,0!==(e|=0)&&this.emitter.set(t.value,e))}},e.render=function(){return this.props.children},t}(React.Component);r.childContextTypes=((t={})[o]=PropTypes.object.isRequired,t);var a=function(r){function t(){for(var n,t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return(n=r.call.apply(r,[this].concat(e))||this).observedBits=void 0,n.state={value:n.getValue()},n.onUpdate=function(t,e){0!=((0|n.observedBits)&e)&&n.setState({value:n.getValue()})},n}_inheritsLoose(t,r);var e=t.prototype;return e.componentWillReceiveProps=function(t){var e=t.observedBits;this.observedBits=null==e?MAX_SIGNED_31_BIT_INT:e},e.componentDidMount=function(){this.context[o]&&this.context[o].on(this.onUpdate);var t=this.props.observedBits;this.observedBits=null==t?MAX_SIGNED_31_BIT_INT:t},e.componentWillUnmount=function(){this.context[o]&&this.context[o].off(this.onUpdate)},e.getValue=function(){return this.context[o]?this.context[o].get():n},e.render=function(){return onlyChild(this.props.children)(this.state.value)},t}(React.Component);return a.contextTypes=((e={})[o]=PropTypes.object,e),{Provider:r,Consumer:a}}var createContext=React.createContext||createReactContext,createNamedContext=function(t){var e=createContext();return e.displayName=t,e},historyContext=createNamedContext("Router-History"),context=createNamedContext("Router"),Router=function(n){function t(t){var e;return(e=n.call(this,t)||this).state={location:t.history.location},e._isMounted=!1,e._pendingLocation=null,t.staticContext||(e.unlisten=t.history.listen(function(t){e._pendingLocation=t})),e}_inheritsLoose(t,n),t.computeRootMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}};var e=t.prototype;return e.componentDidMount=function(){var e=this;this._isMounted=!0,this.unlisten&&this.unlisten(),this.props.staticCont
//# sourceMappingURL=react-router.min.js.map