-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathreact-redux-5.1.0.min.js
1 lines (1 loc) · 15.3 KB
/
react-redux-5.1.0.min.js
1
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("redux")):"function"==typeof define&&define.amd?define(["exports","react","redux"],e):e(t.ReactRedux={},t.React,t.Redux)}(this,function(t,e,n){"use strict";var r="default"in e?e.default:e;function o(t){return function(){return t}}var i=function(){};i.thatReturns=o,i.thatReturnsFalse=o(!1),i.thatReturnsTrue=o(!0),i.thatReturnsNull=o(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(t){return t};var s=i,a=function(t){};var p,u=function(t,e,n,r,o,i,s,p){if(a(e),!t){var u;if(void 0===e)u=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,s,p],l=0;(u=Error(e.replace(/%s/g,function(){return c[l++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},c="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",l=(function(t){t.exports=function(){function t(t,e,n,r,o,i){i!==c&&u(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=s,n.PropTypes=n,n}()}(p={exports:{}},p.exports),p.exports),d=l.shape({trySubscribe:l.func.isRequired,tryUnsubscribe:l.func.isRequired,notifyNestedSubs:l.func.isRequired,isSubscribed:l.func.isRequired}),f=l.shape({subscribe:l.func.isRequired,dispatch:l.func.isRequired,getState:l.func.isRequired}),h=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},y=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},v=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)},b=function(t,e){var n={};for(var r in t)0>e.indexOf(r)&&Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},m=function(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};function P(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"store",r=n+"Subscription",o=function(t){function o(e,r){h(this,o);var i=m(this,t.call(this,e,r));return i[n]=e.store,i}return v(o,t),o.prototype.getChildContext=function(){var t;return(t={})[n]=this[n],t[r]=null,t},o.prototype.render=function(){return e.Children.only(this.props.children)},o}(e.Component);return o.propTypes={store:f.isRequired,children:l.element.isRequired},o.childContextTypes=((t={})[n]=f.isRequired,t[r]=d,t),o}var S=P(),g={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},O={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},w=Object.defineProperty,C=Object.getOwnPropertyNames,R=Object.getOwnPropertySymbols,N=Object.getOwnPropertyDescriptor,T=Object.getPrototypeOf,E=T&&T(Object);var _=function t(e,n,r){if("string"!=typeof n){if(E){var o=T(n);o&&o!==E&&t(e,o,r)}var i=C(n);R&&(i=i.concat(R(n)));for(var s=0;i.length>s;++s){var a=i[s];if(!(g[a]||O[a]||r&&r[a])){var p=N(n,a);try{w(e,a,p)}catch(t){}}}return e}return e},x=function(t,e,n,r,o,i,s,a){if(!t){var p;if(void 0===e)p=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,i,s,a],c=0;(p=Error(e.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw p.framesToPop=1,p}};function U(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==t&&void 0!==t&&this.setState(t)}function q(t){this.setState(function(e){var n=this.constructor.getDerivedStateFromProps(t,e);return null!==n&&void 0!==n?n:null}.bind(this))}function D(t,e){try{var n=this.props,r=this.state;this.props=t,this.state=e,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}U.__suppressDeprecationWarning=!0,q.__suppressDeprecationWarning=!0,D.__suppressDeprecationWarning=!0;var M=Object.prototype.hasOwnProperty;function W(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function F(t,e){if(W(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(var r=0;n.length>r;r++)if(!M.call(e,n[r])||!W(t[n[r]],e[n[r]]))return!1;return!0}var j=null,I={notify:function(){}};function A(){var t=[],e=[];return{clear:function(){e=j,t=j},notify:function(){for(var n=t=e,r=0;n.length>r;r++)n[r]()},get:function(){return e},subscribe:function(n){var r=!0;return e===t&&(e=t.slice()),e.push(n),function(){r&&t!==j&&(r=!1,e===t&&(e=t.slice()),e.splice(e.indexOf(n),1))}}}}var k=function(){function t(e,n,r){h(this,t),this.store=e,this.parentSub=n,this.onStateChange=r,this.unsubscribe=null,this.listeners=I,this.loaded=!1}return t.prototype.markReady=function(){this.loaded=!0},t.prototype.hydrate=function(){this.loaded||this.markReady(),this.trySubscribe()},t.prototype.isReady=function(){return this.loaded},t.prototype.addNestedSub=function(t){return this.trySubscribe(),this.listeners.subscribe(t)},t.prototype.notifyNestedSubs=function(){this.listeners.notify()},t.prototype.isSubscribed=function(){return!!this.unsubscribe},t.prototype.subscribeToParent=function(){this.unsubscribe=this.parentSub.addNestedSub(this.onStateChange),this.listeners=A()},t.prototype.trySubscribe=function(){if(!this.unsubscribe)if(this.parentSub){if(this.parentSub.isReady())return this.subscribeToParent()}else this.unsubscribe=this.store.subscribe(this.onStateChange),this.listeners=A()},t.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=I)},t}(),B=0;function H(){}function K(t){var n,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=i.getDisplayName,a=void 0===s?function(t){return"ConnectAdvanced("+t+")"}:s,p=i.methodName,u=void 0===p?"connectAdvanced":p,c=i.renderCountProp,l=void 0===c?void 0:c,P=i.shouldHandleStateChanges,S=void 0===P||P,g=i.storeKey,O=void 0===g?"store":g,w=i.withRef,C=void 0!==w&&w,R=b(i,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),N=O+"Subscription",T=B++,E=((n={})[O]=f,n[N]=d,n),M=((o={})[N]=d,o);return function(n){x("function"==typeof n,"You must pass a component to the function returned by "+u+". Instead received "+JSON.stringify(n));var o=n.displayName||n.name||"Component",i=a(o),s=y({},R,{getDisplayName:a,methodName:u,renderCountProp:l,shouldHandleStateChanges:S,storeKey:O,withRef:C,displayName:i,wrappedComponentName:o,WrappedComponent:n}),p=function(o){function a(t,e){h(this,a);var n=m(this,o.call(this,t,e));n.version=T,n.renderCount=0;var r=t[O]||e[O];n.propsMode=!!t[O],n.setWrappedInstance=n.setWrappedInstance.bind(n),x(r,'Could not find "'+O+'" in either the context or props of "'+i+'". Either wrap the root component in a <Provider>, or explicitly pass "'+O+'" as a prop to "'+i+'".');var s=r.getState(),p=n.propsMode?null:e[N],u=n.createChildSelector(r);return n.state={props:t,childPropsSelector:u,childProps:{},store:r,storeState:s,error:null,subscription:new k(r,p,n.updateChildPropsFromReduxStore.bind(n)),lastNotify:H,notifyNestedSubs:H},n.state=y({},n.state,a.getChildPropsState(t,n.state)),n}return v(a,o),a.getChildPropsState=function(t,e){try{var n=e.childPropsSelector(e.store.getState(),t);return n===e.childProps?null:{childProps:n}}catch(t){return{error:t}}},a.getDerivedStateFromProps=function(t,e){var n,o=null;if(!(16>+(n=r.version.split("."))[0]||16>=+n[0]&&4>+n[1])&&e.lastNotify!==e.notifyNestedSubs&&(o={lastNotify:e.notifyNestedSubs},F(t,e.props)||e.error))return o;if(R.pure&&F(t,e.props)||e.error)return o;var i=a.getChildPropsState(t,e);return y({},o,i,{props:t})},a.prototype.getChildContext=function(){var t;return(t={})[N]=(this.propsMode?null:this.state.subscription)||this.context[N],t},a.prototype.componentDidMount=function(){return this.updateSubscription()},a.prototype.shouldComponentUpdate=function(t,e){return!R.pure||(e.childProps!==this.state.childProps||e.error)},a.prototype.componentWillUnmount=function(){this.state.subscription&&this.state.subscription.tryUnsubscribe(),this.isUnmounted=!0,this.setState({store:null,notifyNestedSubs:H})},a.prototype.updateSubscription=function(t){var e=this;S&&this.setState(function(n){return n.subscription.isReady()&&!t?null:(e.state.subscription.hydrate(),{notifyNestedSubs:n.subscription.notifyNestedSubs.bind(e.state.subscription),lastNotify:n.notifyNestedSubs})},function(){t&&t(),e.updateChildPropsFromReduxStore(!1)})},a.prototype.getWrappedInstance=function(){return x(C,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+u+"() call."),this.wrappedInstance},a.prototype.setWrappedInstance=function(t){this.wrappedInstance=t},a.prototype.createChildSelector=function(){return t((arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.store).dispatch,s)},a.prototype.updateChildPropsFromReduxStore=function(){var t=this,e=0>=arguments.length||void 0===arguments[0]||arguments[0];this.isUnmounted||this.setState(function(n){var r=t.state.store.getState();if(r===n.storeState)return null;var o=a.getChildPropsState(t.props,y({},t.state,{storeState:r})),i=y({storeState:r},o);return e&&null===o&&t.state.notifyNestedSubs(),i},function(){e&&t.state.notifyNestedSubs()})},a.prototype.isSubscribed=function(){return!!this.state.subscription&&this.state.subscription.isSubscribed()},a.prototype.addExtraProps=function(t){if(!(C||l||this.propsMode&&this.state.subscription))return t;var e=y({},t);return C&&(e.ref=this.setWrappedInstance),l&&(e[l]=this.renderCount++),this.propsMode&&this.state.subscription&&(e[N]=this.state.subscription),e},a.prototype.render=function(){if(this.state.error)throw this.state.error;return e.createElement(n,this.addExtraProps(this.state.childProps))},a}(e.Component);return p.WrappedComponent=n,p.displayName=i,p.childContextTypes=M,p.contextTypes=E,p.propTypes=E,function(t){var e=t.prototype;if(!e||!e.isReactComponent)throw Error("Can only polyfill class components");if("function"!=typeof t.getDerivedStateFromProps&&"function"!=typeof e.getSnapshotBeforeUpdate)return t;var n=null,r=null,o=null;if("function"==typeof e.componentWillMount?n="componentWillMount":"function"==typeof e.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof e.componentWillReceiveProps?r="componentWillReceiveProps":"function"==typeof e.UNSAFE_componentWillReceiveProps&&(r="UNSAFE_componentWillReceiveProps"),"function"==typeof e.componentWillUpdate?o="componentWillUpdate":"function"==typeof e.UNSAFE_componentWillUpdate&&(o="UNSAFE_componentWillUpdate"),null!==n||null!==r||null!==o)throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+(t.displayName||t.name)+" uses "+("function"==typeof t.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()")+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==r?"\n "+r:"")+(null!==o?"\n "+o:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks");if("function"==typeof t.getDerivedStateFromProps&&(e.componentWillMount=U,e.componentWillReceiveProps=q),"function"==typeof e.getSnapshotBeforeUpdate){if("function"!=typeof e.componentDidUpdate)throw Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=D;var i=e.componentDidUpdate;e.componentDidUpdate=function(t,e,n){i.call(this,t,e,this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n)}}}(p),_(p,n)}}function L(t){return function(e,n){var r=t(e,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function V(t){return null!==t.dependsOnOwnProps&&void 0!==t.dependsOnOwnProps?!!t.dependsOnOwnProps:1!==t.length}function Y(t,e){return function(e,n){var r=function(t,e){return r.dependsOnOwnProps?r.mapToProps(t,e):r.mapToProps(t)};return r.dependsOnOwnProps=!0,r.mapToProps=function(e,n){r.mapToProps=t,r.dependsOnOwnProps=V(t);var o=r(e,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=V(o),o=r(e,n)),o},r}}var J=[function(t){return"function"==typeof t?Y(t):void 0},function(t){return t?void 0:L(function(t){return{dispatch:t}})},function(t){return t&&"object"==typeof t?L(function(e){return n.bindActionCreators(t,e)}):void 0}];var z=[function(t){return"function"==typeof t?Y(t):void 0},function(t){return t?void 0:L(function(){return{}})}];function G(t,e,n){return y({},n,t,e)}var Q=[function(t){return"function"==typeof t?function(t){return function(e,n){var r=n.pure,o=n.areMergedPropsEqual,i=!1,s=void 0;return function(e,n,a){var p=t(e,n,a);return i?r&&o(p,s)||(s=p):(i=!0,s=p),s}}}(t):void 0},function(t){return t?void 0:function(){return G}}];function X(t,e,n,r){return function(o,i){return n(t(o,i),e(r,i),i)}}function Z(t,e,n,r,o){var i=o.areStatesEqual,s=o.areOwnPropsEqual,a=o.areStatePropsEqual,p=!1,u=void 0,c=void 0,l=void 0,d=void 0,f=void 0;function h(o,p){var h,y,v=!s(p,c),b=!i(o,u);return u=o,c=p,v&&b?(l=t(u,c),e.dependsOnOwnProps&&(d=e(r,c)),f=n(l,d,c)):v?(t.dependsOnOwnProps&&(l=t(u,c)),e.dependsOnOwnProps&&(d=e(r,c)),f=n(l,d,c)):b?(h=t(u,c),y=!a(h,l),l=h,y&&(f=n(l,d,c)),f):f}return function(o,i){return p?h(o,i):(l=t(u=o,c=i),d=e(r,c),f=n(l,d,c),p=!0,f)}}function $(t,e){var n=e.initMapStateToProps,r=e.initMapDispatchToProps,o=e.initMergeProps,i=b(e,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),s=n(t,i),a=r(t,i),p=o(t,i);return(i.pure?Z:X)(s,a,p,t,i)}function tt(t,e,n){for(var r=e.length-1;r>=0;r--){var o=e[r](t);if(o)return o}return function(e,r){throw Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function et(t,e){return t===e}var nt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.connectHOC,n=void 0===e?K:e,r=t.mapStateToPropsFactories,o=void 0===r?z:r,i=t.mapDispatchToPropsFactories,s=void 0===i?J:i,a=t.mergePropsFactories,p=void 0===a?Q:a,u=t.selectorFactory,c=void 0===u?$:u;return function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=i.pure,u=void 0===a||a,l=i.areStatesEqual,d=void 0===l?et:l,f=i.areOwnPropsEqual,h=void 0===f?F:f,v=i.areStatePropsEqual,m=void 0===v?F:v,P=i.areMergedPropsEqual,S=void 0===P?F:P,g=b(i,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),O=tt(t,o,"mapStateToProps"),w=tt(e,s,"mapDispatchToProps"),C=tt(r,p,"mergeProps");return n(c,y({methodName:"connect",getDisplayName:function(t){return"Connect("+t+")"},shouldHandleStateChanges:!!t,initMapStateToProps:O,initMapDispatchToProps:w,initMergeProps:C,pure:u,areStatesEqual:d,areOwnPropsEqual:h,areStatePropsEqual:m,areMergedPropsEqual:S},g))}}();t.Provider=S,t.createProvider=P,t.connectAdvanced=K,t.connect=nt,Object.defineProperty(t,"__esModule",{value:!0})});