LocalCDN-Firefox-Chrome-Brave/resources/react-redux/8.0.5/react-redux.min.jsm

19 lines
15 KiB
JavaScript

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRedux={},e.React,e.ReactDOM)}(this,(function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t);function u(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},r.exports),r.exports}var c="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=o.default.useState,a=o.default.useEffect,i=o.default.useLayoutEffect,f=o.default.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!c(e,r)}catch(e){return!0}}var p="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=s({inst:{value:r,getSnapshot:t}}),o=n[0].inst,u=n[1];return i((function(){o.value=r,o.getSnapshot=t,l(o)&&u({inst:o})}),[e,r,t]),a((function(){return l(o)&&u({inst:o}),e((function(){l(o)&&u({inst:o})}))}),[e]),f(r),r},d={useSyncExternalStore:void 0!==o.default.useSyncExternalStore?o.default.useSyncExternalStore:p},y=u((function(e){e.exports=d}));var m="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},S=y.useSyncExternalStore,b=o.default.useRef,v=o.default.useEffect,g=o.default.useMemo,h=o.default.useDebugValue,P={useSyncExternalStoreWithSelector:function(e,t,r,n,o){var u=b(null);if(null===u.current){var c={hasValue:!1,value:null};u.current=c}else c=u.current;u=g((function(){function e(e){if(!a){if(a=!0,u=e,e=n(e),void 0!==o&&c.hasValue){var t=c.value;if(o(t,e))return s=t}return s=e}if(t=s,m(u,e))return t;var r=n(e);return void 0!==o&&o(t,r)?t:(u=e,s=r)}var u,s,a=!1,i=void 0===r?null:r;return[function(){return e(t())},null===i?void 0:function(){return e(i())}]}),[t,r,n,o]);var s=S(e,u[0],u[1]);return v((function(){c.hasValue=!0,c.value=s}),[s]),h(s),s}},w=u((function(e){e.exports=P}));let x=function(e){e()};const $=()=>x,O=t.createContext(null);function E(){return t.useContext(O)}const M=()=>{throw Error("uSES not initialized!")};let C=M;const j=(e,t)=>e===t;function R(e=O){const r=e===O?E:()=>t.useContext(e);return function(e,n=j){const{store:o,subscription:u,getServerState:c}=r(),s=C(u.addNestedSub,o.getState,c||o.getState,e,n);return t.useDebugValue(s),s}}const T=R();function N(){return(N=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function q(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;u.length>n;n++)0>t.indexOf(r=u[n])&&(o[r]=e[r]);return o}
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var D="function"==typeof Symbol&&Symbol.for,F=D?Symbol.for("react.element"):60103,_=D?Symbol.for("react.portal"):60106,k=D?Symbol.for("react.fragment"):60107,L=D?Symbol.for("react.strict_mode"):60108,V=D?Symbol.for("react.profiler"):60114,z=D?Symbol.for("react.provider"):60109,W=D?Symbol.for("react.context"):60110,U=D?Symbol.for("react.async_mode"):60111,H=D?Symbol.for("react.concurrent_mode"):60111,A=D?Symbol.for("react.forward_ref"):60112,I=D?Symbol.for("react.suspense"):60113,B=D?Symbol.for("react.suspense_list"):60120,G=D?Symbol.for("react.memo"):60115,J=D?Symbol.for("react.lazy"):60116,K=D?Symbol.for("react.block"):60121,Q=D?Symbol.for("react.fundamental"):60117,X=D?Symbol.for("react.responder"):60118,Y=D?Symbol.for("react.scope"):60119;function Z(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case F:switch(e=e.type){case U:case H:case k:case V:case L:case I:return e;default:switch(e=e&&e.$$typeof){case W:case A:case J:case G:case z:return e;default:return t}}case _:return t}}}function ee(e){return Z(e)===H}var te={AsyncMode:U,ConcurrentMode:H,ContextConsumer:W,ContextProvider:z,Element:F,ForwardRef:A,Fragment:k,Lazy:J,Memo:G,Portal:_,Profiler:V,StrictMode:L,Suspense:I,isAsyncMode:function(e){return ee(e)||Z(e)===U},isConcurrentMode:ee,isContextConsumer:function(e){return Z(e)===W},isContextProvider:function(e){return Z(e)===z},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===F},isForwardRef:function(e){return Z(e)===A},isFragment:function(e){return Z(e)===k},isLazy:function(e){return Z(e)===J},isMemo:function(e){return Z(e)===G},isPortal:function(e){return Z(e)===_},isProfiler:function(e){return Z(e)===V},isStrictMode:function(e){return Z(e)===L},isSuspense:function(e){return Z(e)===I},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===k||e===H||e===V||e===L||e===I||e===B||"object"==typeof e&&null!==e&&(e.$$typeof===J||e.$$typeof===G||e.$$typeof===z||e.$$typeof===W||e.$$typeof===A||e.$$typeof===Q||e.$$typeof===X||e.$$typeof===Y||e.$$typeof===K)},typeOf:Z},re=u((function(e){e.exports=te})),ne={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},oe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},ue={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ce={};function se(e){return re.isMemo(e)?ue:ce[e.$$typeof]||ne}ce[re.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ce[re.Memo]=ue;var ae=Object.defineProperty,ie=Object.getOwnPropertyNames,fe=Object.getOwnPropertySymbols,le=Object.getOwnPropertyDescriptor,pe=Object.getPrototypeOf,de=Object.prototype;var ye=function e(t,r,n){if("string"!=typeof r){if(de){var o=pe(r);o&&o!==de&&e(t,o,n)}var u=ie(r);fe&&(u=u.concat(fe(r)));for(var c=se(t),s=se(r),a=0;u.length>a;++a){var i=u[a];if(!(oe[i]||n&&n[i]||s&&s[i]||c&&c[i])){var f=le(r,i);try{ae(t,i,f)}catch(e){}}}}return t},me=Symbol.for("react.element"),Se=Symbol.for("react.portal"),be=Symbol.for("react.fragment"),ve=Symbol.for("react.strict_mode"),ge=Symbol.for("react.profiler"),he=Symbol.for("react.provider"),Pe=Symbol.for("react.context"),we=Symbol.for("react.server_context"),xe=Symbol.for("react.forward_ref"),$e=Symbol.for("react.suspense"),Oe=Symbol.for("react.suspense_list"),Ee=Symbol.for("react.memo"),Me=Symbol.for("react.lazy"),Ce=Symbol.for("react.offscreen"),je=Symbol.for("react.module.reference");
/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/function Re(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case me:switch(e=e.type){case be:case ge:case ve:case $e:case Oe:return e;default:switch(e=e&&e.$$typeof){case we:case Pe:case xe:case Me:case Ee:case he:return e;default:return t}}case Se:return t}}}var Te={ContextConsumer:Pe,ContextProvider:he,Element:me,ForwardRef:xe,Fragment:be,Lazy:Me,Memo:Ee,Portal:Se,Profiler:ge,StrictMode:ve,Suspense:$e,SuspenseList:Oe,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return Re(e)===Pe},isContextProvider:function(e){return Re(e)===he},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===me},isForwardRef:function(e){return Re(e)===xe},isFragment:function(e){return Re(e)===be},isLazy:function(e){return Re(e)===Me},isMemo:function(e){return Re(e)===Ee},isPortal:function(e){return Re(e)===Se},isProfiler:function(e){return Re(e)===ge},isStrictMode:function(e){return Re(e)===ve},isSuspense:function(e){return Re(e)===$e},isSuspenseList:function(e){return Re(e)===Oe},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===be||e===ge||e===ve||e===$e||e===Oe||e===Ce||"object"==typeof e&&null!==e&&(e.$$typeof===Me||e.$$typeof===Ee||e.$$typeof===he||e.$$typeof===Pe||e.$$typeof===xe||e.$$typeof===je||void 0!==e.getModuleId)},typeOf:Re},Ne=u((function(e){e.exports=Te}));const qe=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function De(e,t,r,n,{areStatesEqual:o,areOwnPropsEqual:u,areStatePropsEqual:c}){let s,a,i,f,l,p=!1;function d(p,d){const y=!u(d,a),m=!o(p,s,d,a);return s=p,a=d,y&&m?(i=e(s,a),t.dependsOnOwnProps&&(f=t(n,a)),l=r(i,f,a),l):y?(e.dependsOnOwnProps&&(i=e(s,a)),t.dependsOnOwnProps&&(f=t(n,a)),l=r(i,f,a),l):m?function(){const t=e(s,a),n=!c(t,i);return i=t,n&&(l=r(i,f,a)),l}():l}return function(o,u){return p?d(o,u):(s=o,a=u,i=e(s,a),f=t(n,a),l=r(i,f,a),p=!0,l)}}function Fe(e){return function(t){const r=e(t);function n(){return r}return n.dependsOnOwnProps=!1,n}}function _e(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function ke(e,t){return function(t,{}){const r=function(e,t){return r.mapToProps(e,r.dependsOnOwnProps?t:void 0)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=_e(e);let o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=_e(o),o=r(t,n)),o},r}}function Le(e,t){return(r,n)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${n.wrappedComponentName}.`)}}function Ve(e,t,r){return N({},r,e,t)}const ze={notify(){},get:()=>[]};function We(e,t){let r,n=ze;function o(){c.onStateChange&&c.onStateChange()}function u(){r||(r=t?t.addNestedSub(o):e.subscribe(o),n=function(){const e=$();let t=null,r=null;return{clear(){t=null,r=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],r=t;for(;r;)e.push(r),r=r.next;return e},subscribe(e){let n=!0,o=r={callback:e,next:null,prev:r};return o.prev?o.prev.next=o:t=o,function(){n&&null!==t&&(n=!1,o.next?o.next.prev=o.prev:r=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}const c={addNestedSub:function(e){return u(),n.subscribe(e)},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:o,isSubscribed:function(){return!!r},trySubscribe:u,tryUnsubscribe:function(){r&&(r(),r=void 0,n.clear(),n=ze)},getListeners:()=>n};return c}const Ue=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?t.useLayoutEffect:t.useEffect;function He(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Ae(e,t){if(He(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;r.length>n;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!He(e[r[n]],t[r[n]]))return!1;return!0}const Ie=["reactReduxForwardedRef"];let Be=M;const Ge=[null,null];function Je(e,t,r,n,o,u){e.current=n,r.current=!1,o.current&&(o.current=null,u())}function Ke(e,t){return e===t}function Qe(e=O){const r=e===O?E:()=>t.useContext(e);return function(){const{store:e}=r();return e}}const Xe=Qe();function Ye(e=O){const t=e===O?Xe:Qe(e);return function(){return t().dispatch}}const Ze=Ye();C=w.useSyncExternalStoreWithSelector,(e=>{Be=e})(y.useSyncExternalStore),x=r.unstable_batchedUpdates,Object.defineProperty(e,"batch",{enumerable:!0,get:function(){return r.unstable_batchedUpdates}}),e.Provider=function({store:e,context:r,children:n,serverState:u}){const c=t.useMemo((()=>{const t=We(e);return{store:e,subscription:t,getServerState:u?()=>u:void 0}}),[e,u]),s=t.useMemo((()=>e.getState()),[e]);return Ue((()=>{const{subscription:t}=c;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),s!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[c,s]),o.default.createElement((r||O).Provider,{value:c},n)},e.ReactReduxContext=O,e.connect=function(e,r,n,{areStatesEqual:u=Ke,areOwnPropsEqual:c=Ae,areStatePropsEqual:s=Ae,areMergedPropsEqual:a=Ae,forwardRef:i=!1,context:f=O}={}){const l=f,p=function(e){return e?"function"==typeof e?ke(e):Le(e,"mapStateToProps"):Fe((()=>({})))}(e),d=function(e){return e&&"object"==typeof e?Fe((t=>function(e,t){const r={};for(const n in e){const o=e[n];"function"==typeof o&&(r[n]=(...e)=>t(o(...e)))}return r}(e,t))):e?"function"==typeof e?ke(e):Le(e,"mapDispatchToProps"):Fe((e=>({dispatch:e})))}(r),y=function(e){return e?"function"==typeof e?function(e){return function(t,{areMergedPropsEqual:r}){let n,o=!1;return function(t,u,c){const s=e(t,u,c);return o?r(s,n)||(n=s):(o=!0,n=s),n}}}(e):Le(e,"mergeProps"):()=>Ve}(n),m=!!e;return e=>{const r=e.displayName||e.name||"Component",n=`Connect(${r})`,f={shouldHandleStateChanges:m,displayName:n,wrappedComponentName:r,WrappedComponent:e,initMapStateToProps:p,initMapDispatchToProps:d,initMergeProps:y,areStatesEqual:u,areStatePropsEqual:s,areOwnPropsEqual:c,areMergedPropsEqual:a};function S(r){const[n,u,c]=t.useMemo((()=>{const{reactReduxForwardedRef:e}=r,t=q(r,Ie);return[r.context,e,t]}),[r]),s=t.useMemo((()=>n&&n.Consumer&&Ne.isContextConsumer(o.default.createElement(n.Consumer,null))?n:l),[n,l]),a=t.useContext(s),i=!!r.store&&!!r.store.getState&&!!r.store.dispatch,p=i?r.store:a.store,d=!!a&&!!a.store?a.getServerState:p.getState,y=t.useMemo((()=>function(e,t){let{initMapStateToProps:r,initMapDispatchToProps:n,initMergeProps:o}=t,u=q(t,qe);return De(r(e,u),n(e,u),o(e,u),e,u)}(p.dispatch,f)),[p]),[S,b]=t.useMemo((()=>{if(!m)return Ge;const e=We(p,i?void 0:a.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[p,i,a]),v=t.useMemo((()=>i?a:N({},a,{subscription:S})),[i,a,S]),g=t.useRef(),h=t.useRef(c),P=t.useRef(),w=t.useRef(!1);t.useRef(!1);const x=t.useRef(!1),$=t.useRef();Ue((()=>(x.current=!0,()=>{x.current=!1})),[]);const O=t.useMemo((()=>()=>P.current&&c===h.current?P.current:y(p.getState(),c)),[p,c]),E=t.useMemo((()=>e=>S?function(e,t,r,n,o,u,c,s,a,i,f){if(!e)return()=>{};let l=!1,p=null;const d=()=>{if(l||!s.current)return;const e=t.getState();let r,d;try{r=n(e,o.current)}catch(e){d=e,p=e}d||(p=null),r===u.current?c.current||i():(u.current=r,a.current=r,c.current=!0,f())};return r.onStateChange=d,r.trySubscribe(),d(),()=>{if(l=!0,r.tryUnsubscribe(),r.onStateChange=null,p)throw p}}(m,p,S,y,h,g,w,x,P,b,e):()=>{}),[S]);var M,C,j;let R;M=Je,C=[h,g,w,c,P,b],Ue((()=>M(...C)),j);try{R=Be(E,O,d?()=>y(d(),c):O)}catch(e){throw $.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${$.current.stack}\n\n`),e}Ue((()=>{$.current=void 0,P.current=void 0,g.current=R}));const T=t.useMemo((()=>o.default.createElement(e,N({},R,{ref:u}))),[u,e,R]);return t.useMemo((()=>m?o.default.createElement(s.Provider,{value:v},T):T),[s,T,v])}const b=o.default.memo(S);if(b.WrappedComponent=e,b.displayName=S.displayName=n,i){const t=o.default.forwardRef((function(e,t){return o.default.createElement(b,N({},e,{reactReduxForwardedRef:t}))}));return t.displayName=n,t.WrappedComponent=e,ye(t,e)}return ye(b,e)}},e.createDispatchHook=Ye,e.createSelectorHook=R,e.createStoreHook=Qe,e.shallowEqual=Ae,e.useDispatch=Ze,e.useSelector=T,e.useStore=Xe,Object.defineProperty(e,"__esModule",{value:!0})}));