UNPKG

react-reffect

Version:

Create components whose prop changes map to a global side effect with the power of redux and new Context API

2 lines (1 loc) 40.3 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.ReactReffect={})}(this,function(e){"use strict";function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e,t){return e(t={exports:{}},t.exports),t.exports}var c=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var l,me=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a<arguments.length;a++){for(var i in r=Object(arguments[a]))s.call(r,i)&&(o[i]=r[i]);if(c){n=c(r);for(var u=0;u<n.length;u++)f.call(r,n[u])&&(o[n[u]]=r[n[u]])}}return o};l=function(e){if(void 0===e)throw Error("invariant requires an error message argument")};var be=function(e,t,r,n,o,a,i,u){if(l(t),!e){var c;if(void 0===t)c=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,a,i,u],f=0;(c=Error(t.replace(/%s/g,function(){return s[f++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}},o={};Object.freeze(o);var ge=o;function a(e){return function(){return e}}var i=function(){};i.thatReturns=a,i.thatReturnsFalse=a(!1),i.thatReturnsTrue=a(!0),i.thatReturnsNull=a(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e};var we=i;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function d(e,t,r){this.props=e,this.context=t,this.refs=ge,this.updater=r||p}function y(){}function v(e,t,r){this.props=e,this.context=t,this.refs=ge,this.updater=r||p}d.prototype.isReactComponent={},d.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&function(e){for(var t=arguments.length-1,r="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=0;n<t;n++)r+="&args[]="+encodeURIComponent(arguments[n+1]);be(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",r)}("85"),this.updater.enqueueSetState(this,e,t,"setState")},d.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=d.prototype;var h=v.prototype=new y;h.constructor=v,me(h,d.prototype),h.isPureReactComponent=!0;var Oe=function(e,t){if(void 0===t)throw Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!=t.indexOf("Failed Composite propType: ")&&!e){for(var r=arguments.length,n=Array(2<r?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];(function(e){for(var t=arguments.length,r=Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=0,a="Warning: "+e.replace(/%s/g,function(){return r[o++]});void 0!==console&&console.error(a);try{throw Error(a)}catch(e){}}).apply(void 0,[t].concat(n))}},m=be,b=Oe,g={};var w,_e=function(e,t,r,n,o){for(var a in e)if(e.hasOwnProperty(a)){var i;try{m("function"==typeof e[a],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",n||"React class",r,a,typeof e[a]),i=e[a](t,a,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){i=e}if(b(!i||i instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",r,a,typeof i),i instanceof Error&&!(i.message in g)){g[i.message]=!0;var u=o?o():"";b(!1,"Failed %s type: %s%s",r,i.message,null!=u?u:"")}}},O=n(function(he){!function(){var y=me,m=be,n=ge,w=Oe,c=we,a=_e,e="function"==typeof Symbol&&Symbol.for,O=e?Symbol.for("react.element"):60103,b=e?Symbol.for("react.portal"):60106,s=e?Symbol.for("react.fragment"):60107,f=e?Symbol.for("react.strict_mode"):60108,l=e?Symbol.for("react.profiler"):60114,p=e?Symbol.for("react.provider"):60109,d=e?Symbol.for("react.context"):60110,v=e?Symbol.for("react.async_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.timeout"):60113,r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";function _(e){if(null==e)return null;var t=r&&e[r]||e[o];return"function"==typeof t?t:null}var i=function(e,t){if(void 0===t)throw Error("`warning(condition, format, ...args)` requires a warning message argument");if(!e){for(var r=arguments.length,n=Array(2<r?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];(function(e){for(var t=arguments.length,r=Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=0,a="Warning: "+e.replace(/%s/g,function(){return r[o++]});void 0!==console&&console.warn(a);try{throw Error(a)}catch(e){}}).apply(void 0,[t].concat(n))}},u={};function S(e,t){var r=e.constructor,n=r&&(r.displayName||r.name)||"ReactClass",o=n+"."+t;u[o]||(w(!1,"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,n),u[o]=!0)}var E={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){S(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){S(e,"replaceState")},enqueueSetState:function(e,t,r,n){S(e,"setState")}};function j(e,t,r){this.props=e,this.context=t,this.refs=n,this.updater=r||E}j.prototype.isReactComponent={},j.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&m(!1,"setState(...): takes an object of state variables to update or a function which returns an object of state variables."),this.updater.enqueueSetState(this,e,t,"setState")},j.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var t={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},x=function(e,t){Object.defineProperty(j.prototype,e,{get:function(){i(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var R in t)t.hasOwnProperty(R)&&x(R,t[R]);function P(){}function k(e,t,r){this.props=e,this.context=t,this.refs=n,this.updater=r||E}P.prototype=j.prototype;var C=k.prototype=new P;C.constructor=k,y(C,j.prototype);var T={current:null},$=Object.prototype.hasOwnProperty,A={key:C.isPureReactComponent=!0,ref:!0,__self:!0,__source:!0},I=void 0,F=void 0;function U(e){if($.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function N(e){if($.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}var M=function(e,t,r,n,o,a,i){var u={$$typeof:O,type:e,key:t,ref:r,props:i,_owner:a,_store:{}};return Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function D(e,t,r){var n=void 0,o={},a=null,i=null,u=null,c=null;if(null!=t)for(n in U(t)&&(i=t.ref),N(t)&&(a=""+t.key),u=void 0===t.__self?null:t.__self,c=void 0===t.__source?null:t.__source,t)$.call(t,n)&&!A.hasOwnProperty(n)&&(o[n]=t[n]);var s,f,l,p,d,y,v=arguments.length-2;if(1===v)o.children=r;else if(1<v){for(var h=Array(v),m=0;m<v;m++)h[m]=arguments[m+2];Object.freeze&&Object.freeze(h),o.children=h}if(e&&e.defaultProps){var b=e.defaultProps;for(n in b)void 0===o[n]&&(o[n]=b[n])}if((a||i)&&(void 0===o.$$typeof||o.$$typeof!==O)){var g="function"==typeof e?e.displayName||e.name||"Unknown":e;a&&(p=o,d=g,(y=function(){I||w(!(I=!0),"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",d)}).isReactWarning=!0,Object.defineProperty(p,"key",{get:y,configurable:!0})),i&&(s=o,f=g,(l=function(){F||w(!(F=!0),"%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",f)}).isReactWarning=!0,Object.defineProperty(s,"ref",{get:l,configurable:!0}))}return M(e,a,i,u,c,T.current,o)}function q(e){return"object"==typeof e&&null!==e&&e.$$typeof===O}var L={getCurrentStack:null,getStackAddendum:function(){var e=L.getCurrentStack;return e?e():null}},W=".",V=":";var B=!1,Y=/\/+/g;function z(e){return(""+e).replace(Y,"$&/")}var H=10,J=[];function G(e,t,r,n){if(J.length){var o=J.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function K(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,J.length<H&&J.push(e)}function Q(e,t,r){return null==e?0:function e(t,r,n,o){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var i=!1;if(null===t)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case O:case b:i=!0}}if(i)return n(o,t,""===r?W+X(t,0):r),1;var u=void 0,c=0,s=""===r?W:r+V;if(Array.isArray(t))for(var f=0;f<t.length;f++)c+=e(u=t[f],s+X(u,f),n,o);else{var l=_(t);if("function"==typeof l){l===t.entries&&(B||w(!1,"Using Maps as children is unsupported and will likely yield unexpected results. Convert it to a sequence/iterable of keyed ReactElements instead.%s",L.getStackAddendum()),B=!0);for(var p=l.call(t),d=void 0,y=0;!(d=p.next()).done;)c+=e(u=d.value,s+X(u,y++),n,o)}else if("object"===a){var v;v=" If you meant to render a collection of children, use an array instead."+L.getStackAddendum();var h=""+t;m(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===h?"object with keys {"+Object.keys(t).join(", ")+"}":h,v)}}return c}(e,"",t,r)}function X(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(r={"=":"=0",":":"=2"},"$"+(""+e.key).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function Z(e,t,r){e.func.call(e.context,t,e.count++)}function ee(e,t,r){var n,o,a=e.result,i=e.keyPrefix,u=e.func.call(e.context,t,e.count++);Array.isArray(u)?te(u,a,r,c.thatReturnsArgument):null!=u&&(q(u)&&(o=i+(!(n=u).key||t&&t.key===u.key?"":z(u.key)+"/")+r,u=M(n.type,o,n.ref,n._self,n._source,n._owner,n.props)),a.push(u))}function te(e,t,r,n,o){var a="";null!=r&&(a=z(r)+"/");var i=G(t,a,n,o);Q(e,ee,i),K(i)}function re(e){var t=e.type;if("function"==typeof t)return t.displayName||t.name;if("string"==typeof t)return t;switch(t){case v:return"AsyncMode";case d:return"Context.Consumer";case s:return"ReactFragment";case b:return"ReactPortal";case l:return"Profiler("+e.pendingProps.id+")";case p:return"Context.Provider";case f:return"StrictMode";case g:return"Timeout"}if("object"==typeof t&&null!==t)switch(t.$$typeof){case h:var r=t.render.displayName||t.render.name||"";return""!==r?"ForwardRef("+r+")":"ForwardRef"}return null}var ne,oe=void 0,ae=void 0,ie=function(){};function ue(){if(T.current){var e=re(T.current);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}oe=null,ae=!1,ne=function(e){if(null==e)return"#empty";if("string"==typeof e||"number"==typeof e)return"#text";if("string"==typeof e.type)return e.type;var t=e.type;if(t===s)return"React.Fragment";if("object"!=typeof t||null===t||t.$$typeof!==h)return t.displayName||t.name||"Unknown";var r=t.render.displayName||t.render.name||"";return""!==r?"ForwardRef("+r+")":"ForwardRef"},ie=function(){var e,t,r,n="";if(oe){var o=ne(oe),a=oe._owner;n+=(e=o,t=oe._source,r=a&&re(a),"\n in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":r?" (created by "+r+")":""))}return n+=L.getStackAddendum()||""};var ce={};function se(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=function(e){var t=ue();if(!t){var r="string"==typeof e?e:e.displayName||e.name;r&&(t="\n\nCheck the top-level render call using <"+r+">.")}return t}(t);if(!ce[r]){ce[r]=!0;var n="";e&&e._owner&&e._owner!==T.current&&(n=" It was passed a child from "+re(e._owner)+"."),oe=e,w(!1,'Each child in an array or iterator should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.%s',r,n,ie()),oe=null}}}function fe(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];q(n)&&se(n,t)}else if(q(e))e._store&&(e._store.validated=!0);else if(e){var o=_(e);if("function"==typeof o&&o!==e.entries)for(var a=o.call(e),i=void 0;!(i=a.next()).done;)q(i.value)&&se(i.value,t)}}function le(e){var t=e.type,r=void 0,n=void 0;if("function"==typeof t)r=t.displayName||t.name,n=t.propTypes;else{if("object"!=typeof t||null===t||t.$$typeof!==h)return;var o=t.render.displayName||t.render.name||"";r=""!==o?"ForwardRef("+o+")":"ForwardRef",n=t.propTypes}n?(a(n,(oe=e).props,"prop",r,ie),oe=null):void 0===t.PropTypes||ae||w(!(ae=!0),"Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",r||"Unknown"),"function"==typeof t.getDefaultProps&&(t.getDefaultProps.isReactClassApproved||w(!1,"getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."))}function pe(e,t,r){var n,o="string"==typeof(n=e)||"function"==typeof n||n===s||n===v||n===l||n===f||n===g||"object"==typeof n&&null!==n&&(n.$$typeof===p||n.$$typeof===d||n.$$typeof===h);if(!o){var a="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var i=function(e){if(null==e||void 0===e.__source)return"";var t=e.__source;return"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+"."}(t);a+=i||ue(),a+=ie()||"";w(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",null===e?"null":Array.isArray(e)?"array":typeof e,a)}var u=D.apply(this,arguments);if(null==u)return u;if(o)for(var c=2;c<arguments.length;c++)fe(arguments[c],e);return e===s?function(e){for(var t=Object.keys((oe=e).props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){w(!1,"Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.%s",n,ie());break}}null!==e.ref&&w(!1,"Invalid attribute `ref` supplied to `React.Fragment`.%s",ie()),oe=null}(u):le(u),u}var de={Children:{map:function(e,t,r){if(null==e)return e;var n=[];return te(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;var n=G(null,null,t,r);Q(e,Z,n),K(n)},count:function(e){return Q(e,c.thatReturnsNull,null)},toArray:function(e){var t=[];return te(e,t,null,c.thatReturnsArgument),t},only:function(e){return q(e)||m(!1,"React.Children.only expected to receive a single React element child."),e}},createRef:function(){var e={current:null};return Object.seal(e),e},Component:j,PureComponent:k,createContext:function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&w(!1,"createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:d,_calculateChangedBits:t,_defaultValue:e,_currentValue:e,_currentValue2:e,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null};return r.Provider={$$typeof:p,_context:r},(r.Consumer=r)._currentRenderer=null,r._currentRenderer2=null,r},forwardRef:function(e){return"function"!=typeof e&&w(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e),null!=e&&(null!=e.defaultProps||null!=e.propTypes)&&w(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:h,render:e}},Fragment:s,StrictMode:f,unstable_AsyncMode:v,unstable_Profiler:l,createElement:pe,cloneElement:function(e,t,r){for(var n=function(e,t,r){null==e&&m(!1,"React.cloneElement(...): The argument must be a React element, but you passed %s.",e);var n=void 0,o=y({},e.props),a=e.key,i=e.ref,u=e._self,c=e._source,s=e._owner;if(null!=t){U(t)&&(i=t.ref,s=T.current),N(t)&&(a=""+t.key);var f=void 0;for(n in e.type&&e.type.defaultProps&&(f=e.type.defaultProps),t)$.call(t,n)&&!A.hasOwnProperty(n)&&(o[n]=void 0===t[n]&&void 0!==f?f[n]:t[n])}var l=arguments.length-2;if(1===l)o.children=r;else if(1<l){for(var p=Array(l),d=0;d<l;d++)p[d]=arguments[d+2];o.children=p}return M(e.type,a,i,u,c,s,o)}.apply(this,arguments),o=2;o<arguments.length;o++)fe(arguments[o],n.type);return le(n),n},createFactory:function(e){var t=pe.bind(null,e);return t.type=e,Object.defineProperty(t,"type",{enumerable:!1,get:function(){return i(!1,"Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},isValidElement:q,version:"16.4.2",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:T,assign:y}};y(de.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,{ReactDebugCurrentFrame:L,ReactComponentTreeHook:{}});var ye=Object.freeze({default:de}),ve=ye&&de||ye;he.exports=ve.default?ve.default:ve}()}),_=n(function(e){e.exports=O});w="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")();var S,E,j=("function"==typeof(E=w.Symbol)?E.observable?S=E.observable:(S=E("observable"),E.observable=S):S="@@observable",S),x={INIT:"@@redux/INIT"+Math.random().toString(36).substring(7).split("").join("."),REPLACE:"@@redux/REPLACE"+Math.random().toString(36).substring(7).split("").join(".")},R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function k(e,t,r){var n;if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw Error("Expected the enhancer to be a function.");return r(k)(e,t)}if("function"!=typeof e)throw Error("Expected the reducer to be a function.");var o=e,a=t,i=[],u=i,c=!1;function s(){u===i&&(u=i.slice())}function f(){if(c)throw Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function l(t){if("function"!=typeof t)throw Error("Expected the listener to be a function.");if(c)throw Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var r=!0;return s(),u.push(t),function(){if(r){if(c)throw Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");r=!1,s();var e=u.indexOf(t);u.splice(e,1)}}}function p(e){if(!function(e){if("object"!==(void 0===e?"undefined":R(e))||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(c)throw Error("Reducers may not dispatch actions.");try{c=!0,a=o(a,e)}finally{c=!1}for(var t=i=u,r=0;r<t.length;r++){(0,t[r])()}return e}return p({type:x.INIT}),(n={dispatch:p,subscribe:l,getState:f,replaceReducer:function(e){if("function"!=typeof e)throw Error("Expected the nextReducer to be a function.");o=e,p({type:x.REPLACE})}})[j]=function(){var e,r=l;return(e={subscribe:function(e){if("object"!==(void 0===e?"undefined":R(e))||null===e)throw new TypeError("Expected the observer to be an object.");function t(){e.next&&e.next(f())}return t(),{unsubscribe:r(t)}}})[j]=function(){return this},e},n}function C(){for(var e=arguments.length,c=Array(e),t=0;t<e;t++)c[t]=arguments[t];return function(u){return function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=u.apply(void 0,t),o=function(){throw Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},a={getState:n.getState,dispatch:function(){return o.apply(void 0,arguments)}},i=c.map(function(e){return e(a)});return o=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}.apply(void 0,i)(n.dispatch),P({},n,{dispatch:o})}}}function T(){}"string"==typeof T.name&&"isCrushed"!==T.name&&function(e){void 0!==console&&"function"==typeof console.error&&console.error(e);try{throw Error(e)}catch(e){}}("You are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) to ensure you have the correct code for your production build.");var $,A="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",I={};$=function(e){var t="Warning: "+e;void 0!==console&&console.error(t);try{throw Error(t)}catch(e){}};var F,U=function(e,t,r,n,o){for(var a in e)if(e.hasOwnProperty(a)){var i;try{if("function"!=typeof e[a]){var u=Error((n||"React class")+": "+r+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.");throw u.name="Invariant Violation",u}i=e[a](t,a,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){i=e}if(!i||i instanceof Error||$((n||"React class")+": type specification of "+r+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in I)){I[i.message]=!0;var c=o?o():"";$("Failed "+r+" type: "+i.message+(null!=c?c:""))}}};function N(){return null}F=function(e){var t="Warning: "+e;void 0!==console&&console.error(t);try{throw Error(t)}catch(e){}};var M=function(u,p){var a="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";var d="<<anonymous>>",e={array:t("array"),bool:t("boolean"),func:t("function"),number:t("number"),object:t("object"),string:t("string"),symbol:t("symbol"),any:r(N),arrayOf:function(s){return r(function(e,t,r,n,o){if("function"!=typeof s)return new y("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=e[t];if(!Array.isArray(a)){var i=v(a);return new y("Invalid "+n+" `"+o+"` of type `"+i+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u<a.length;u++){var c=s(a,u,r,n,o+"["+u+"]",A);if(c instanceof Error)return c}return null})},element:r(function(e,t,r,n,o){var a=e[t];if(u(a))return null;var i=v(a);return new y("Invalid "+n+" `"+o+"` of type `"+i+"` supplied to `"+r+"`, expected a single ReactElement.")}),instanceOf:function(c){return r(function(e,t,r,n,o){if(e[t]instanceof c)return null;var a=c.name||d,i=(u=e[t],u.constructor&&u.constructor.name?u.constructor.name:d);var u;return new y("Invalid "+n+" `"+o+"` of type `"+i+"` supplied to `"+r+"`, expected instance of `"+a+"`.")})},node:r(function(e,t,r,n,o){return c(e[t])?null:new y("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(s){return r(function(e,t,r,n,o){if("function"!=typeof s)return new y("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=e[t],i=v(a);if("object"!==i)return new y("Invalid "+n+" `"+o+"` of type `"+i+"` supplied to `"+r+"`, expected an object.");for(var u in a)if(a.hasOwnProperty(u)){var c=s(a,u,r,n,o+"."+u,A);if(c instanceof Error)return c}return null})},oneOf:function(c){if(!Array.isArray(c))return F("Invalid argument supplied to oneOf, expected an instance of array."),N;return r(function(e,t,r,n,o){for(var a=e[t],i=0;i<c.length;i++)if(s(a,c[i]))return null;var u=JSON.stringify(c);return new y("Invalid "+n+" `"+o+"` of value `"+a+"` supplied to `"+r+"`, expected one of "+u+".")})},oneOfType:function(u){if(!Array.isArray(u))return F("Invalid argument supplied to oneOfType, expected an instance of array."),N;for(var e=0;e<u.length;e++){var t=u[e];if("function"!=typeof t)return F("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+n(t)+" at index "+e+"."),N}return r(function(e,t,r,n,o){for(var a=0;a<u.length;a++){var i=u[a];if(null==i(e,t,r,n,o,A))return null}return new y("Invalid "+n+" `"+o+"` supplied to `"+r+"`.")})},shape:function(f){return r(function(e,t,r,n,o){var a=e[t],i=v(a);if("object"!==i)return new y("Invalid "+n+" `"+o+"` of type `"+i+"` supplied to `"+r+"`, expected `object`.");for(var u in f){var c=f[u];if(c){var s=c(a,u,r,n,o+"."+u,A);if(s)return s}}return null})},exact:function(l){return r(function(e,t,r,n,o){var a=e[t],i=v(a);if("object"!==i)return new y("Invalid "+n+" `"+o+"` of type `"+i+"` supplied to `"+r+"`, expected `object`.");var u=me({},e[t],l);for(var c in u){var s=l[c];if(!s)return new y("Invalid "+n+" `"+o+"` key `"+c+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(e[t],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(l),null," "));var f=s(a,c,r,n,o+"."+c,A);if(f)return f}return null})}};function s(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function y(e){this.message=e,this.stack=""}function r(s){var f={},l=0;function e(e,t,r,n,o,a,i){if(n=n||d,a=a||r,i!==A){if(p){var u=Error("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");throw u.name="Invariant Violation",u}if(void 0!==console){var c=n+":"+r;!f[c]&&l<3&&(F("You are manually calling a React.PropTypes validation function for the `"+a+"` prop on `"+n+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),f[c]=!0,l++)}}return null==t[r]?e?new y(null===t[r]?"The "+o+" `"+a+"` is marked as required in `"+n+"`, but its value is `null`.":"The "+o+" `"+a+"` is marked as required in `"+n+"`, but its value is `undefined`."):null:s(t,r,n,o,a)}var t=e.bind(null,!1);return t.isRequired=e.bind(null,!0),t}function t(u){return r(function(e,t,r,n,o,a){var i=e[t];return v(i)===u?null:new y("Invalid "+n+" `"+o+"` of type `"+f(i)+"` supplied to `"+r+"`, expected `"+u+"`.")})}function c(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(c);if(null===e||u(e))return!0;var t=function(e){var t=e&&(a&&e[a]||e[i]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!c(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!c(o[1]))return!1}return!0;default:return!1}}function v(e){var t,r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":(t=e,"symbol"===r||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol?"symbol":r)}function f(e){if(null==e)return""+e;var t=v(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function n(e){var t=f(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return y.prototype=Error.prototype,e.checkPropTypes=U,e.PropTypes=e},D=n(function(e){var t="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=M(function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},!0)}),q="__global_unique_id__",L=function(){return t[q]=(t[q]||0)+1};function W(e){return function(){return e}}var V=function(){};V.thatReturns=W,V.thatReturnsFalse=W(!1),V.thatReturnsTrue=W(!0),V.thatReturnsNull=W(null),V.thatReturnsThis=function(){return this},V.thatReturnsArgument=function(e){return e};var B=function(e,t){if(void 0===t)throw Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!=t.indexOf("Failed Composite propType: ")&&!e){for(var r=arguments.length,n=Array(2<r?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];(function(e){for(var t=arguments.length,r=Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=0,a="Warning: "+e.replace(/%s/g,function(){return r[o++]});void 0!==console&&console.error(a);try{throw Error(a)}catch(e){}}).apply(void 0,[t].concat(n))}},Y=n(function(e,t){t.__esModule=!0;r(_);var u=r(D),c=r(L),s=r(B);function r(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=1073741823;t.default=function(e,i){var t,r,n="__create-react-context-"+(0,c.default)()+"__",o=function(u){function c(){var e,t,r,n;f(this,c);for(var o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return(e=t=l(this,u.call.apply(u,[this].concat(a)))).emitter=(r=t.props.value,n=[],{on:function(e){n.push(e)},off:function(t){n=n.filter(function(e){return e!==t})},get:function(){return r},set:function(e,t){r=e,n.forEach(function(e){return e(r,t)})}}),l(t,e)}return p(c,u),c.prototype.getChildContext=function(){var e;return(e={})[n]=this.emitter,e},c.prototype.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var t=this.props.value,r=e.value,n=void 0;((o=t)===(a=r)?0!==o||1/o==1/a:o!=o&&a!=a)?n=0:(n="function"==typeof i?i(t,r):d,(0,s.default)((n&d)===n,"calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s",n),0!=(n|=0)&&this.emitter.set(e.value,n))}var o,a},c.prototype.render=function(){return this.props.children},c}(_.Component);o.childContextTypes=((t={})[n]=u.default.object.isRequired,t);var a=function(a){function i(){var e,r;f(this,i);for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return(e=r=l(this,a.call.apply(a,[this].concat(n)))).state={value:r.getValue()},r.onUpdate=function(e,t){0!=((0|r.observedBits)&t)&&r.setState({value:r.getValue()})},l(r,e)}return p(i,a),i.prototype.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?d:t},i.prototype.componentDidMount=function(){this.context[n]&&this.context[n].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?d:e},i.prototype.componentWillUnmount=function(){this.context[n]&&this.context[n].off(this.onUpdate)},i.prototype.getValue=function(){return this.context[n]?this.context[n].get():e},i.prototype.render=function(){return(Array.isArray(e=this.props.children)?e[0]:e)(this.state.value);var e},i}(_.Component);return a.contextTypes=((r={})[n]=u.default.object,r),{Provider:o,Consumer:a}},e.exports=t.default});r(Y);var z=r(n(function(e,t){t.__esModule=!0;var r=o(_),n=o(Y);function o(e){return e&&e.__esModule?e:{default:e}}t.default=r.default.createContext||n.default,e.exports=t.default})),H="effect/ADD",J="effect/REMOVE";function G(e,t){switch(void 0===e&&(e={mountedInstances:[],propsList:[]}),t.type){case H:var r=t.payload,n=r.instance,o=r.props,a=e.mountedInstances.indexOf(n);if(-1===a)return{mountedInstances:e.mountedInstances.concat([n]),propsList:e.propsList.concat([o])};if(e.propsList[a]===o)return e;var i=[].concat(e.propsList);return i[a]=o,{mountedInstances:e.mountedInstances,propsList:i};case J:var u=e.mountedInstances,c=e.propsList,s=u.indexOf(t.payload.instance);return-1===s?e:{mountedInstances:u.slice(0,s).concat(u.slice(s+1)),propsList:c.slice(0,s).concat(c.slice(s+1))};default:return e}}function K(e){return e.displayName||e.name||"Component"}var Q=n(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,i=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,s=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112;function l(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case s:case a:case i:return e;default:switch(e=e&&e.$$typeof){case c:case f:case u:return e;default:return t}}case o:return t}}}t.typeOf=l,t.AsyncMode=s,t.ContextConsumer=c,t.ContextProvider=u,t.Element=n,t.ForwardRef=f,t.Fragment=a,t.Portal=o,t.StrictMode=i,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===s||e===i||"object"==typeof e&&null!==e&&(e.$$typeof===u||e.$$typeof===c||e.$$typeof===f)},t.isAsyncMode=function(e){return l(e)===s},t.isContextConsumer=function(e){return l(e)===c},t.isContextProvider=function(e){return l(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return l(e)===f},t.isFragment=function(e){return l(e)===a},t.isPortal=function(e){return l(e)===o},t.isStrictMode=function(e){return l(e)===i}});r(Q);var X=n(function(e,b){!function(){Object.defineProperty(b,"__esModule",{value:!0});var e="function"==typeof Symbol&&Symbol.for,o=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,u=e?Symbol.for("react.strict_mode"):60108,c=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,f=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112;function t(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:var r=e.type;switch(r){case f:case i:case u:return r;default:var n=r&&r.$$typeof;switch(n){case s:case l:case c:return n;default:return t}}case a:return t}}}var r=f,n=s,p=c,d=o,y=l,v=i,h=a,m=u;b.typeOf=t,b.AsyncMode=r,b.ContextConsumer=n,b.ContextProvider=p,b.Element=d,b.ForwardRef=y,b.Fragment=v,b.Portal=h,b.StrictMode=m,b.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===u||"object"==typeof e&&null!==e&&(e.$$typeof===c||e.$$typeof===s||e.$$typeof===l)},b.isAsyncMode=function(e){return t(e)===f},b.isContextConsumer=function(e){return t(e)===s},b.isContextProvider=function(e){return t(e)===c},b.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},b.isForwardRef=function(e){return t(e)===l},b.isFragment=function(e){return t(e)===i},b.isPortal=function(e){return t(e)===a},b.isStrictMode=function(e){return t(e)===u}}()});r(X);var Z,ee=n(function(e){e.exports=X});function te(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var re={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ne={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},oe=te({},ee.ForwardRef,(te(Z={},"$$typeof",!0),te(Z,"render",!0),Z)),ae=Object.defineProperty,ie=Object.getOwnPropertyNames,ue=Object.getOwnPropertySymbols,ce=Object.getOwnPropertyDescriptor,se=Object.getPrototypeOf,fe=Object.prototype;var le=function e(t,r,n){if("string"==typeof r)return t;if(fe){var o=se(r);o&&o!==fe&&e(t,o,n)}var a=ie(r);ue&&(a=a.concat(ue(r)));for(var i=oe[t.$$typeof]||re,u=oe[r.$$typeof]||re,c=0;c<a.length;++c){var s=a[c];if(!(ne[s]||n&&n[s]||u&&u[s]||i&&i[s])){var f=ce(r,s);try{ae(t,s,f)}catch(e){}}}return t},pe=n(function(e){var t,r;t=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen},e.exports?e.exports=r:window.ExecutionEnvironment=r});function de(a,i){var e=function(r){var e,t;function n(e){var t;return(t=r.call(this,e)||this).renderWithStore=t.renderWithStore.bind(u(u(t))),t}(e=n).prototype=Object.create((t=r).prototype),(e.prototype.constructor=e).__proto__=t;var o=n.prototype;return o.renderWithStore=function(e){return this.store=e,this.store&&this.store.dispatch({type:H,payload:{instance:this,props:this.props},meta:{canUseDOM:n.canUseDOM}}),_.createElement(i,this.props)},o.componentWillUnmount=function(){this.store&&this.store.dispatch({type:J,payload:{instance:this},meta:{canUseDOM:n.canUseDOM}})},o.render=function(){return _.createElement(a.Consumer,null,this.renderWithStore)},n}(_.PureComponent);return le(e,i),e.canUseDOM=pe.canUseDOM,e.displayName="SideEffectConsumer("+K(i)+")",e}var ye=_.createContext||z;e.default=function(u,c){if("function"!=typeof u)throw Error("Expected reducePropsToState to be a function.");if("function"!=typeof c)throw Error("Expected handleStateChangeOnClient to be a function.");var n=C(function(e){var i=e.getState;return function(a){return function(e){if(!e.meta.canUseDOM)return a(e);var t=i(),r=a(e),n=i();if(t!==n){var o=u(n.propsList);c(o)}return r}}})(k);function a(e,t){var r=n(G,e,t);return function(o){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{},t=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),t.forEach(function(e){var t,r,n;n=a[r=e],r in(t=o)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n})}return o}({},r,{peek:function(){return u(r.getState().propsList)}})}return function(e){if("function"!=typeof e)throw Error("Expected WrappedComponent to be a React component.");var n,t,r,o=ye();return{Provider:(n=o,t=e,r=function(e){var t=e.store,r=e.children;if(!t||!t.dispatch||!t.getState)throw Error("Expected store to be a redux store.");return _.createElement(n.Provider,{value:t},r)},r.propTypes={store:D.shape({subscribe:D.func.isRequired,dispatch:D.func.isRequired,getState:D.func.isRequired}).isRequired,children:D.element.isRequired},r.displayName="SideEffectProvider("+K(t)+")",r),Consumer:de(o,e),createStore:a}}},Object.defineProperty(e,"__esModule",{value:!0})});