Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@reduxjs/toolkit

Package Overview
Dependencies
Maintainers
4
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reduxjs/toolkit - npm Package Compare versions

Comparing version 1.3.0-alpha.7 to 1.3.0-alpha.8

10

dist/redux-toolkit.cjs.development.js

@@ -642,5 +642,11 @@ 'use strict';

var newKeys = {};
updates = updates.filter(function (update) {
return update.id in state.entities;
var updatesPerEntity = {};
updates.forEach(function (update) {
// Only apply updates to entities that currently exist
if (update.id in state.entities) {
// If there are multiple updates to one entity, merge them together
updatesPerEntity[update.id] = _extends({}, updatesPerEntity[update.id], {}, update);
}
});
updates = Object.values(updatesPerEntity);
var didMutateEntities = updates.length > 0;

@@ -647,0 +653,0 @@

2

dist/redux-toolkit.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("redux"),r=require("immer"),n=e(r),i=require("reselect"),o=require("redux-devtools-extension"),a=e(require("redux-thunk"));require("redux-immutable-state-invariant");var u=e(require("nanoid"));function c(){return(c=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}).apply(this,arguments)}function s(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function f(e){return null==e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||Array.isArray(e)||s(e)}function l(e,t,r,n,i){var o;if(void 0===t&&(t=[]),void 0===r&&(r=f),void 0===i&&(i=[]),!r(e))return{keyPath:t.join(".")||"<root>",value:e};if("object"!=typeof e||null===e)return!1;var a=null!=n?n(e):Object.entries(e),u=i.length>0,c=a,s=Array.isArray(c),d=0;for(c=s?c:c[Symbol.iterator]();;){var p;if(s){if(d>=c.length)break;p=c[d++]}else{if((d=c.next()).done)break;p=d.value}var v=p[1],y=t.concat(p[0]);if(!(u&&i.indexOf(y.join("."))>=0)){if(!r(v))return{keyPath:y.join("."),value:v};if("object"==typeof v&&(o=l(v,y,r,n,i)))return o}}return!1}function d(e){void 0===e&&(e={});var t=e.thunk,r=void 0===t||t,n=[];return r&&n.push("boolean"==typeof r?a:a.withExtraArgument(r.extraArgument)),n}function p(e,t){function r(){if(t){var r=t.apply(void 0,arguments);if(!r)throw new Error("prepareAction did not return an object");return c({type:e,payload:r.payload},"meta"in r&&{meta:r.meta},{},"error"in r&&{error:r.error})}return{type:e,payload:arguments.length<=0?void 0:arguments[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(t){return t.type===e},r}function v(e){return["type","payload","error","meta"].indexOf(e)>-1}function y(e){var t={},r={addCase:function(e,n){var i="string"==typeof e?e:e.type;if(i in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[i]=n,r}};return e(r),t}function h(e,t){var r="function"==typeof t?y(t):t;return function(t,i){return void 0===t&&(t=e),n(t,(function(e){var t=r[i.type];return t?t(e,i):void 0}))}}function b(e){return function(t,i){var o=function(t){var r;s(r=i)&&"string"==typeof r.type&&Object.keys(r).every(v)?e(i.payload,t):e(i,t)};return r.isDraft(t)?(o(t),t):n(t,o)}}function m(e,t){return t(e)}function g(e){function t(t,r){var n=m(t,e);n in r.entities||(r.ids.push(n),r.entities[n]=t)}function r(e,r){var n=e,i=Array.isArray(n),o=0;for(n=i?n:n[Symbol.iterator]();;){var a;if(i){if(o>=n.length)break;a=n[o++]}else{if((o=n.next()).done)break;a=o.value}t(a,r)}}function n(e,t){var r=!1;e.forEach((function(e){e in t.entities&&(delete t.entities[e],r=!0)})),r&&(t.ids=t.ids.filter((function(e){return e in t.entities})))}function i(t,r){var n={};(t=t.filter((function(e){return e.id in r.entities}))).length>0&&t.filter((function(t){return function(t,r,n){var i=Object.assign({},n.entities[r.id],r.changes),o=m(i,e),a=o!==r.id;return a&&(t[r.id]=o,delete n.entities[r.id]),n.entities[o]=i,a}(n,t,r)})).length>0&&(r.ids=r.ids.map((function(e){return n[e]||e})))}function o(t,n){var o=[],a=[],u=t,c=Array.isArray(u),s=0;for(u=c?u:u[Symbol.iterator]();;){var f;if(c){if(s>=u.length)break;f=u[s++]}else{if((s=u.next()).done)break;f=s.value}var l=f,d=m(l,e);d in n.entities?a.push({id:d,changes:l}):o.push(l)}i(a,n),r(o,n)}return{removeAll:function(e){return Object.assign({},e,{ids:[],entities:{}})},addOne:b(t),addMany:b(r),setAll:b((function(e,t){t.ids=[],t.entities={},r(e,t)})),updateOne:b((function(e,t){return i([e],t)})),updateMany:b(i),upsertOne:b((function(e,t){return o([e],t)})),upsertMany:b(o),removeOne:b((function(e,t){return n([e],t)})),removeMany:b(n),map:b((function(e,t){return i(t.ids.reduce((function(r,n){var i=e(t.entities[n]);return i!==t.entities[n]&&r.push({id:n,changes:i}),r}),[]).filter((function(e){return e.id in t.entities})),t)}))}}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var S=["name","message","stack","code"],x=function(e){if("object"==typeof e&&null!==e){var t={},r=S,n=Array.isArray(r),i=0;for(r=n?r:r[Symbol.iterator]();;){var o;if(n){if(i>=r.length)break;o=r[i++]}else{if((i=r.next()).done)break;o=i.value}"string"==typeof e[o]&&(t[o]=e[o])}return t}return e};Object.keys(t).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})})),exports.createNextState=n,Object.defineProperty(exports,"createSelector",{enumerable:!0,get:function(){return i.createSelector}}),exports.Dictionary=function(){},exports.configureStore=function(e){var r,n=e||{},i=n.reducer,a=void 0===i?void 0:i,u=n.middleware,f=void 0===u?d():u,l=n.devTools,p=void 0===l||l,v=n.preloadedState,y=void 0===v?void 0:v,h=n.enhancers,b=void 0===h?void 0:h;if("function"==typeof a)r=a;else{if(!s(a))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');r=t.combineReducers(a)}var m=t.applyMiddleware.apply(void 0,f),g=t.compose;p&&(g=o.composeWithDevTools(c({trace:!1},"object"==typeof p&&p)));var S=[m];Array.isArray(b)?S=[m].concat(b):"function"==typeof b&&(S=b(S));var x=g.apply(void 0,S);return t.createStore(r,y,x)},exports.createAction=p,exports.createAsyncThunk=function(e,t){var r=p(e+"/fulfilled",(function(e,t,r){return{payload:e,meta:{arg:r,requestId:t}}})),n=p(e+"/pending",(function(e,t){return{payload:void 0,meta:{arg:t,requestId:e}}})),i=p(e+"/rejected",(function(e,t,r){var n=e&&"AbortError"===e.name;return{payload:void 0,error:x(e),meta:{arg:r,requestId:t,aborted:n}}}));return Object.assign((function(e){return function(o,a,c){var s,f=u(),l=new AbortController,d=new Promise((function(e,t){return l.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:s||"Aborted"})}))})),p=function(){try{var u,s=function(){return o(u),u},p=function(i,s){try{var p=(o(n(f,e)),Promise.resolve(Promise.race([d,Promise.resolve(t(e,{dispatch:o,getState:a,extra:c,requestId:f,signal:l.signal})).then((function(t){return r(t,f,e)}))])).then((function(e){u=e})))}catch(e){return s(e)}return p&&p.then?p.then(void 0,s):p}(0,(function(t){u=i(t,f,e)}));return Promise.resolve(p&&p.then?p.then(s):s())}catch(e){return Promise.reject(e)}}();return Object.assign(p,{abort:function(e){s=e,l.abort()}})}}),{pending:n,rejected:i,fulfilled:r})},exports.createEntityAdapter=function(e){void 0===e&&(e={});var t=c({sortComparer:!1,selectId:function(e){return e.id}},e),r=t.selectId,n=t.sortComparer;return c({selectId:r,sortComparer:n},{getInitialState:function(e){return void 0===e&&(e={}),Object.assign({ids:[],entities:{}},e)}},{},{getSelectors:function(e){var t=function(e){return e.ids},r=function(e){return e.entities},n=i.createSelector(t,r,(function(e,t){return e.map((function(e){return t[e]}))})),o=i.createSelector(t,(function(e){return e.length}));return e?{selectIds:i.createSelector(e,t),selectEntities:i.createSelector(e,r),selectAll:i.createSelector(e,n),selectTotal:i.createSelector(e,o)}:{selectIds:t,selectEntities:r,selectAll:n,selectTotal:o}}},{},n?function(e,t){var r=g(e);function n(t,r){var n=t.filter((function(t){return!(m(t,e)in r.entities)}));0!==n.length&&a(n,r)}function i(t,r){var n=[];t.forEach((function(t){return function(t,r,n){if(!(r.id in n.entities))return!1;var i=Object.assign({},n.entities[r.id],r.changes),o=m(i,e);return delete n.entities[r.id],t.push(i),o!==r.id}(n,t,r)})),0!==n.length&&a(n,r)}function o(t,r){var o=[],a=[],u=t,c=Array.isArray(u),s=0;for(u=c?u:u[Symbol.iterator]();;){var f;if(c){if(s>=u.length)break;f=u[s++]}else{if((s=u.next()).done)break;f=s.value}var l=f,d=m(l,e);d in r.entities?a.push({id:d,changes:l}):o.push(l)}i(a,r),n(o,r)}function a(r,n){r.sort(t),r.forEach((function(t){n.entities[e(t)]=t}));var i=Object.values(n.entities);i.sort(t);var o=i.map(e);(function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(e[r]!==t[r])return!1;return!0})(n.ids,o)||(n.ids=o)}return{removeOne:r.removeOne,removeMany:r.removeMany,removeAll:r.removeAll,addOne:b((function(e,t){return n([e],t)})),updateOne:b((function(e,t){return i([e],t)})),upsertOne:b((function(e,t){return o([e],t)})),setAll:b((function(e,t){t.entities={},t.ids=[],n(e,t)})),addMany:b(n),updateMany:b(i),upsertMany:b(o),map:b((function(e,t){i(t.ids.reduce((function(r,n){var i=e(t.entities[n]);return i!==t.entities[n]&&r.push({id:n,changes:i}),r}),[]),t)}))}}(r,n):g(r))},exports.createReducer=h,exports.createSerializableStateInvariantMiddleware=function(e){void 0===e&&(e={});var t=e.isSerializable,r=void 0===t?f:t,n=e.getEntries,i=e.ignoredActions,o=void 0===i?[]:i,a=e.ignoredPaths,u=void 0===a?[]:a;return function(e){return function(t){return function(i){if(o.length&&-1!==o.indexOf(i.type))return t(i);var a=l(i,[],r,n);a&&console.error("A non-serializable value was detected in an action, in the path: `"+a.keyPath+"`. Value:",a.value,"\nTake a look at the logic that dispatched this action: ",i,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)");var c=t(i),s=l(e.getState(),[],r,n,u);return s&&console.error("A non-serializable value was detected in the state, in the path: `"+s.keyPath+"`. Value:",s.value,"\nTake a look at the reducer(s) handling this action type: "+i.type+".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)"),c}}}},exports.createSlice=function(e){var t=e.name,r=e.initialState;if(!t)throw new Error("`name` is a required option for createSlice");var n=e.reducers||{},i=void 0===e.extraReducers?{}:"function"==typeof e.extraReducers?y(e.extraReducers):e.extraReducers,o=Object.keys(n),a={},u={},s={};o.forEach((function(e){var r,i,o=n[e],c=t+"/"+e;"reducer"in o?(r=o.reducer,i=o.prepare):r=o,a[e]=r,u[c]=r,s[e]=i?p(c,i):p(c)}));var f=h(r,c({},i,{},u));return{name:t,reducer:f,actions:s,caseReducers:a}},exports.findNonSerializableValue=l,exports.getDefaultMiddleware=d,exports.getType=function(e){return""+e},exports.isPlain=f,exports.unwrapResult=function(e){if("error"in e)throw e.error;return e.payload};
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("redux"),r=require("immer"),n=e(r),i=require("reselect"),o=require("redux-devtools-extension"),a=e(require("redux-thunk"));require("redux-immutable-state-invariant");var u=e(require("nanoid"));function c(){return(c=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}).apply(this,arguments)}function s(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function f(e){return null==e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||Array.isArray(e)||s(e)}function l(e,t,r,n,i){var o;if(void 0===t&&(t=[]),void 0===r&&(r=f),void 0===i&&(i=[]),!r(e))return{keyPath:t.join(".")||"<root>",value:e};if("object"!=typeof e||null===e)return!1;var a=null!=n?n(e):Object.entries(e),u=i.length>0,c=a,s=Array.isArray(c),d=0;for(c=s?c:c[Symbol.iterator]();;){var p;if(s){if(d>=c.length)break;p=c[d++]}else{if((d=c.next()).done)break;p=d.value}var v=p[1],y=t.concat(p[0]);if(!(u&&i.indexOf(y.join("."))>=0)){if(!r(v))return{keyPath:y.join("."),value:v};if("object"==typeof v&&(o=l(v,y,r,n,i)))return o}}return!1}function d(e){void 0===e&&(e={});var t=e.thunk,r=void 0===t||t,n=[];return r&&n.push("boolean"==typeof r?a:a.withExtraArgument(r.extraArgument)),n}function p(e,t){function r(){if(t){var r=t.apply(void 0,arguments);if(!r)throw new Error("prepareAction did not return an object");return c({type:e,payload:r.payload},"meta"in r&&{meta:r.meta},{},"error"in r&&{error:r.error})}return{type:e,payload:arguments.length<=0?void 0:arguments[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(t){return t.type===e},r}function v(e){return["type","payload","error","meta"].indexOf(e)>-1}function y(e){var t={},r={addCase:function(e,n){var i="string"==typeof e?e:e.type;if(i in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[i]=n,r}};return e(r),t}function h(e,t){var r="function"==typeof t?y(t):t;return function(t,i){return void 0===t&&(t=e),n(t,(function(e){var t=r[i.type];return t?t(e,i):void 0}))}}function b(e){return function(t,i){var o=function(t){var r;s(r=i)&&"string"==typeof r.type&&Object.keys(r).every(v)?e(i.payload,t):e(i,t)};return r.isDraft(t)?(o(t),t):n(t,o)}}function m(e,t){return t(e)}function g(e){function t(t,r){var n=m(t,e);n in r.entities||(r.ids.push(n),r.entities[n]=t)}function r(e,r){var n=e,i=Array.isArray(n),o=0;for(n=i?n:n[Symbol.iterator]();;){var a;if(i){if(o>=n.length)break;a=n[o++]}else{if((o=n.next()).done)break;a=o.value}t(a,r)}}function n(e,t){var r=!1;e.forEach((function(e){e in t.entities&&(delete t.entities[e],r=!0)})),r&&(t.ids=t.ids.filter((function(e){return e in t.entities})))}function i(t,r){var n={},i={};t.forEach((function(e){e.id in r.entities&&(i[e.id]=c({},i[e.id],{},e))})),(t=Object.values(i)).length>0&&t.filter((function(t){return function(t,r,n){var i=Object.assign({},n.entities[r.id],r.changes),o=m(i,e),a=o!==r.id;return a&&(t[r.id]=o,delete n.entities[r.id]),n.entities[o]=i,a}(n,t,r)})).length>0&&(r.ids=r.ids.map((function(e){return n[e]||e})))}function o(t,n){var o=[],a=[],u=t,c=Array.isArray(u),s=0;for(u=c?u:u[Symbol.iterator]();;){var f;if(c){if(s>=u.length)break;f=u[s++]}else{if((s=u.next()).done)break;f=s.value}var l=f,d=m(l,e);d in n.entities?a.push({id:d,changes:l}):o.push(l)}i(a,n),r(o,n)}return{removeAll:function(e){return Object.assign({},e,{ids:[],entities:{}})},addOne:b(t),addMany:b(r),setAll:b((function(e,t){t.ids=[],t.entities={},r(e,t)})),updateOne:b((function(e,t){return i([e],t)})),updateMany:b(i),upsertOne:b((function(e,t){return o([e],t)})),upsertMany:b(o),removeOne:b((function(e,t){return n([e],t)})),removeMany:b(n),map:b((function(e,t){return i(t.ids.reduce((function(r,n){var i=e(t.entities[n]);return i!==t.entities[n]&&r.push({id:n,changes:i}),r}),[]).filter((function(e){return e.id in t.entities})),t)}))}}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var S=["name","message","stack","code"],x=function(e){if("object"==typeof e&&null!==e){var t={},r=S,n=Array.isArray(r),i=0;for(r=n?r:r[Symbol.iterator]();;){var o;if(n){if(i>=r.length)break;o=r[i++]}else{if((i=r.next()).done)break;o=i.value}"string"==typeof e[o]&&(t[o]=e[o])}return t}return e};Object.keys(t).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})})),exports.createNextState=n,Object.defineProperty(exports,"createSelector",{enumerable:!0,get:function(){return i.createSelector}}),exports.Dictionary=function(){},exports.configureStore=function(e){var r,n=e||{},i=n.reducer,a=void 0===i?void 0:i,u=n.middleware,f=void 0===u?d():u,l=n.devTools,p=void 0===l||l,v=n.preloadedState,y=void 0===v?void 0:v,h=n.enhancers,b=void 0===h?void 0:h;if("function"==typeof a)r=a;else{if(!s(a))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');r=t.combineReducers(a)}var m=t.applyMiddleware.apply(void 0,f),g=t.compose;p&&(g=o.composeWithDevTools(c({trace:!1},"object"==typeof p&&p)));var S=[m];Array.isArray(b)?S=[m].concat(b):"function"==typeof b&&(S=b(S));var x=g.apply(void 0,S);return t.createStore(r,y,x)},exports.createAction=p,exports.createAsyncThunk=function(e,t){var r=p(e+"/fulfilled",(function(e,t,r){return{payload:e,meta:{arg:r,requestId:t}}})),n=p(e+"/pending",(function(e,t){return{payload:void 0,meta:{arg:t,requestId:e}}})),i=p(e+"/rejected",(function(e,t,r){var n=e&&"AbortError"===e.name;return{payload:void 0,error:x(e),meta:{arg:r,requestId:t,aborted:n}}}));return Object.assign((function(e){return function(o,a,c){var s,f=u(),l=new AbortController,d=new Promise((function(e,t){return l.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:s||"Aborted"})}))})),p=function(){try{var u,s=function(){return o(u),u},p=function(i,s){try{var p=(o(n(f,e)),Promise.resolve(Promise.race([d,Promise.resolve(t(e,{dispatch:o,getState:a,extra:c,requestId:f,signal:l.signal})).then((function(t){return r(t,f,e)}))])).then((function(e){u=e})))}catch(e){return s(e)}return p&&p.then?p.then(void 0,s):p}(0,(function(t){u=i(t,f,e)}));return Promise.resolve(p&&p.then?p.then(s):s())}catch(e){return Promise.reject(e)}}();return Object.assign(p,{abort:function(e){s=e,l.abort()}})}}),{pending:n,rejected:i,fulfilled:r})},exports.createEntityAdapter=function(e){void 0===e&&(e={});var t=c({sortComparer:!1,selectId:function(e){return e.id}},e),r=t.selectId,n=t.sortComparer;return c({selectId:r,sortComparer:n},{getInitialState:function(e){return void 0===e&&(e={}),Object.assign({ids:[],entities:{}},e)}},{},{getSelectors:function(e){var t=function(e){return e.ids},r=function(e){return e.entities},n=i.createSelector(t,r,(function(e,t){return e.map((function(e){return t[e]}))})),o=i.createSelector(t,(function(e){return e.length}));return e?{selectIds:i.createSelector(e,t),selectEntities:i.createSelector(e,r),selectAll:i.createSelector(e,n),selectTotal:i.createSelector(e,o)}:{selectIds:t,selectEntities:r,selectAll:n,selectTotal:o}}},{},n?function(e,t){var r=g(e);function n(t,r){var n=t.filter((function(t){return!(m(t,e)in r.entities)}));0!==n.length&&a(n,r)}function i(t,r){var n=[];t.forEach((function(t){return function(t,r,n){if(!(r.id in n.entities))return!1;var i=Object.assign({},n.entities[r.id],r.changes),o=m(i,e);return delete n.entities[r.id],t.push(i),o!==r.id}(n,t,r)})),0!==n.length&&a(n,r)}function o(t,r){var o=[],a=[],u=t,c=Array.isArray(u),s=0;for(u=c?u:u[Symbol.iterator]();;){var f;if(c){if(s>=u.length)break;f=u[s++]}else{if((s=u.next()).done)break;f=s.value}var l=f,d=m(l,e);d in r.entities?a.push({id:d,changes:l}):o.push(l)}i(a,r),n(o,r)}function a(r,n){r.sort(t),r.forEach((function(t){n.entities[e(t)]=t}));var i=Object.values(n.entities);i.sort(t);var o=i.map(e);(function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(e[r]!==t[r])return!1;return!0})(n.ids,o)||(n.ids=o)}return{removeOne:r.removeOne,removeMany:r.removeMany,removeAll:r.removeAll,addOne:b((function(e,t){return n([e],t)})),updateOne:b((function(e,t){return i([e],t)})),upsertOne:b((function(e,t){return o([e],t)})),setAll:b((function(e,t){t.entities={},t.ids=[],n(e,t)})),addMany:b(n),updateMany:b(i),upsertMany:b(o),map:b((function(e,t){i(t.ids.reduce((function(r,n){var i=e(t.entities[n]);return i!==t.entities[n]&&r.push({id:n,changes:i}),r}),[]),t)}))}}(r,n):g(r))},exports.createReducer=h,exports.createSerializableStateInvariantMiddleware=function(e){void 0===e&&(e={});var t=e.isSerializable,r=void 0===t?f:t,n=e.getEntries,i=e.ignoredActions,o=void 0===i?[]:i,a=e.ignoredPaths,u=void 0===a?[]:a;return function(e){return function(t){return function(i){if(o.length&&-1!==o.indexOf(i.type))return t(i);var a=l(i,[],r,n);a&&console.error("A non-serializable value was detected in an action, in the path: `"+a.keyPath+"`. Value:",a.value,"\nTake a look at the logic that dispatched this action: ",i,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)");var c=t(i),s=l(e.getState(),[],r,n,u);return s&&console.error("A non-serializable value was detected in the state, in the path: `"+s.keyPath+"`. Value:",s.value,"\nTake a look at the reducer(s) handling this action type: "+i.type+".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)"),c}}}},exports.createSlice=function(e){var t=e.name,r=e.initialState;if(!t)throw new Error("`name` is a required option for createSlice");var n=e.reducers||{},i=void 0===e.extraReducers?{}:"function"==typeof e.extraReducers?y(e.extraReducers):e.extraReducers,o=Object.keys(n),a={},u={},s={};o.forEach((function(e){var r,i,o=n[e],c=t+"/"+e;"reducer"in o?(r=o.reducer,i=o.prepare):r=o,a[e]=r,u[c]=r,s[e]=i?p(c,i):p(c)}));var f=h(r,c({},i,{},u));return{name:t,reducer:f,actions:s,caseReducers:a}},exports.findNonSerializableValue=l,exports.getDefaultMiddleware=d,exports.getType=function(e){return""+e},exports.isPlain=f,exports.unwrapResult=function(e){if("error"in e)throw e.error;return e.payload};
//# sourceMappingURL=redux-toolkit.cjs.production.min.js.map

@@ -640,5 +640,11 @@ import { combineReducers, applyMiddleware, createStore, compose } from 'redux';

var newKeys = {};
updates = updates.filter(function (update) {
return update.id in state.entities;
var updatesPerEntity = {};
updates.forEach(function (update) {
// Only apply updates to entities that currently exist
if (update.id in state.entities) {
// If there are multiple updates to one entity, merge them together
updatesPerEntity[update.id] = _extends({}, updatesPerEntity[update.id], {}, update);
}
});
updates = Object.values(updatesPerEntity);
var didMutateEntities = updates.length > 0;

@@ -645,0 +651,0 @@

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).RTK={})}(this,(function(e){"use strict";var t=function(e){var t,r=("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")()).Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}(),r=function(){return Math.random().toString(36).substring(7).split("").join(".")},n={INIT:"@@redux/INIT"+r(),REPLACE:"@@redux/REPLACE"+r(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+r()}};function o(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function i(e,r,a){var u;if("function"==typeof r&&"function"==typeof a||"function"==typeof a&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function");if("function"==typeof r&&void 0===a&&(a=r,r=void 0),void 0!==a){if("function"!=typeof a)throw new Error("Expected the enhancer to be a function.");return a(i)(e,r)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var c=e,f=r,s=[],l=s,d=!1;function p(){l===s&&(l=s.slice())}function h(){if(d)throw new 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 f}function y(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(d)throw new 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 t=!0;return p(),l.push(e),function(){if(t){if(d)throw new 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.");t=!1,p();var r=l.indexOf(e);l.splice(r,1)}}}function v(e){if(!o(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,f=c(f,e)}finally{d=!1}for(var t=s=l,r=0;r<t.length;r++)(0,t[r])();return e}function b(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");c=e,v({type:n.REPLACE})}function g(){var e,r=y;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function t(){e.next&&e.next(h())}return t(),{unsubscribe:r(t)}}})[t]=function(){return this},e}return v({type:n.INIT}),(u={dispatch:v,subscribe:y,getState:h,replaceReducer:b})[t]=g,u}function a(e,t){var r=t&&t.type;return"Given "+(r&&'action "'+String(r)+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function u(e){for(var t=Object.keys(e),r={},o=0;o<t.length;o++){var i=t[o];"function"==typeof e[i]&&(r[i]=e[i])}var u,c=Object.keys(r);try{!function(e){Object.keys(e).forEach((function(t){var r=e[t];if(void 0===r(void 0,{type:n.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:n.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+n.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(r)}catch(e){u=e}return function(e,t){if(void 0===e&&(e={}),u)throw u;for(var n=!1,o={},i=0;i<c.length;i++){var f=c[i],s=e[f],l=(0,r[f])(s,t);if(void 0===l){var d=a(f,t);throw new Error(d)}o[f]=l,n=n||l!==s}return n?o:e}}function c(e,t){return function(){return t(e.apply(this,arguments))}}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){f(e,t,r[t])}))}return e}function l(){for(var e=arguments.length,t=new 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))}}))}function d(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),n=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return s({},r,{dispatch:n=l.apply(void 0,i)(r.dispatch)})}}}var p,h=l,y="undefined"!=typeof Symbol?Symbol("immer-nothing"):((p={})["immer-nothing"]=!0,p),v="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("immer-draftable"):"__$immer_draftable",b="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("immer-state"):"__$immer_state";function g(e){return!!e&&!!e[b]}function m(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e))return!0;var t=Object.getPrototypeOf(e);return!t||t===Object.prototype}(e)||!!e[v]||!!e.constructor[v])}var w=Object.assign||function(e,t){for(var r in t)P(t,r)&&(e[r]=t[r]);return e},O="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function j(e,t){if(void 0===t&&(t=!1),Array.isArray(e))return e.slice();var r=Object.create(Object.getPrototypeOf(e));return O(e).forEach((function(n){if(n!==b){var o=Object.getOwnPropertyDescriptor(e,n),i=o.value;if(o.get){if(!t)throw new Error("Immer drafts cannot have computed properties");i=o.get.call(e)}o.enumerable?r[n]=i:Object.defineProperty(r,n,{value:i,writable:!0,configurable:!0})}})),r}function E(e,t){if(Array.isArray(e))for(var r=0;r<e.length;r++)t(r,e[r],e);else O(e).forEach((function(r){return t(r,e[r],e)}))}function A(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!!r&&r.enumerable}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function S(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function x(e){if(!m(e))return e;if(Array.isArray(e))return e.map(x);var t=Object.create(Object.getPrototypeOf(e));for(var r in e)t[r]=x(e[r]);return t}function k(e){if(m(e)&&!g(e)&&!Object.isFrozen(e))if(Object.freeze(e),Array.isArray(e))e.forEach(k);else for(var t in e)k(e[t])}var z=function(e){this.drafts=[],this.parent=e,this.canAutoFreeze=!0,this.patches=null};function _(e){e[b].revoke()}z.prototype.usePatches=function(e){e&&(this.patches=[],this.inversePatches=[],this.patchListener=e)},z.prototype.revoke=function(){this.leave(),this.drafts.forEach(_),this.drafts=null},z.prototype.leave=function(){this===z.current&&(z.current=this.parent)},z.current=null,z.enter=function(){return this.current=new z(this.current)};var I={};function T(){this.revoked=!0}function R(e){return e.copy||e.base}function D(e,t){var r=e[b];if(r&&!r.finalizing){r.finalizing=!0;var n=e[t];return r.finalizing=!1,n}return e[t]}function N(e){e.modified||(e.modified=!0,e.parent&&N(e.parent))}function C(e){e.copy||(e.copy=F(e.base))}function F(e){var t=e&&e[b];if(t){t.finalizing=!0;var r=j(t.draft,!0);return t.finalizing=!1,r}return j(e)}function M(e){if(!0===e.revoked)throw new Error("Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+JSON.stringify(R(e)))}function U(e){for(var t=e.length-1;t>=0;t--){var r=e[t][b];r.modified||(Array.isArray(r.base)?W(r)&&N(r):L(r)&&N(r))}}function L(e){for(var t=e.base,r=e.draft,n=Object.keys(r),o=n.length-1;o>=0;o--){var i=n[o],a=t[i];if(void 0===a&&!P(t,i))return!0;var u=r[i],c=u&&u[b];if(c?c.base!==a:!S(u,a))return!0}return n.length!==Object.keys(t).length}function W(e){var t=e.draft;if(t.length!==e.base.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!r||r.get)}var q=Object.freeze({willFinalize:function(e,t,r){e.drafts.forEach((function(e){e[b].finalizing=!0})),r?g(t)&&t[b].scope===e&&U(e.drafts):(e.patches&&function e(t){if(t&&"object"==typeof t){var r=t[b];if(r){var n=r.base,o=r.draft,i=r.assigned;if(Array.isArray(t)){if(W(r)){if(N(r),i.length=!0,o.length<n.length)for(var a=o.length;a<n.length;a++)i[a]=!1;else for(var u=n.length;u<o.length;u++)i[u]=!0;for(var c=0;c<o.length;c++)void 0===i[c]&&e(o[c])}}else Object.keys(o).forEach((function(t){void 0!==n[t]||P(n,t)?i[t]||e(o[t]):(i[t]=!0,N(r))})),Object.keys(n).forEach((function(e){void 0!==o[e]||P(o,e)||(i[e]=!1,N(r))}))}}}(e.drafts[0]),U(e.drafts))},createProxy:function e(t,r){var n=Array.isArray(t),o=F(t);E(o,(function(r){!function(t,r,n){var o=I[r];o?o.enumerable=n:I[r]=o={configurable:!0,enumerable:n,get:function(){return function(t,r){M(t);var n=D(R(t),r);return t.finalizing?n:n===D(t.base,r)&&m(n)?(C(t),t.copy[r]=e(n,t)):n}(this[b],r)},set:function(e){!function(e,t,r){if(M(e),e.assigned[t]=!0,!e.modified){if(S(r,D(R(e),t)))return;N(e),C(e)}e.copy[t]=r}(this[b],r,e)}},Object.defineProperty(t,r,o)}(o,r,n||A(t,r))}));var i=r?r.scope:z.current;return Object.defineProperty(o,b,{value:{scope:i,modified:!1,finalizing:!1,finalized:!1,assigned:{},parent:r,base:t,draft:o,copy:null,revoke:T,revoked:!1},enumerable:!1,writable:!0}),i.drafts.push(o),o}});function K(e,t){var r=t?t.scope:z.current,n={scope:r,modified:!1,finalized:!1,assigned:{},parent:t,base:e,draft:null,drafts:{},copy:null,revoke:null},o=Array.isArray(e)?Proxy.revocable([n],X):Proxy.revocable(n,V),i=o.revoke,a=o.proxy;return n.draft=a,n.revoke=i,r.drafts.push(a),a}var V={get:function(e,t){if(t===b)return e;var r=e.drafts;if(!e.modified&&P(r,t))return r[t];var n=B(e)[t];if(e.finalized||!m(n))return n;if(e.modified){if(n!==Y(e.base,t))return n;r=e.copy}return r[t]=K(n,e)},has:function(e,t){return t in B(e)},ownKeys:function(e){return Reflect.ownKeys(B(e))},set:function(e,t,r){if(!e.modified){var n=Y(e.base,t);if(r?S(n,r)||r===e.drafts[t]:S(n,r)&&t in e.base)return!0;$(e)}return e.assigned[t]=!0,e.copy[t]=r,!0},deleteProperty:function(e,t){return void 0!==Y(e.base,t)||t in e.base?(e.assigned[t]=!1,$(e)):e.assigned[t]&&delete e.assigned[t],e.copy&&delete e.copy[t],!0},getOwnPropertyDescriptor:function(e,t){var r=B(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&(n.writable=!0,n.configurable=!Array.isArray(r)||"length"!==t),n},defineProperty:function(){throw new Error("Object.defineProperty() cannot be used on an Immer draft")},getPrototypeOf:function(e){return Object.getPrototypeOf(e.base)},setPrototypeOf:function(){throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft")}},X={};function B(e){return e.copy||e.base}function Y(e,t){var r=e[b],n=Reflect.getOwnPropertyDescriptor(r?B(r):e,t);return n&&n.value}function $(e){e.modified||(e.modified=!0,e.copy=w(j(e.base),e.drafts),e.drafts=null,e.parent&&$(e.parent))}E(V,(function(e,t){X[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),X.deleteProperty=function(e,t){if(isNaN(parseInt(t)))throw new Error("Immer only supports deleting array indices");return V.deleteProperty.call(this,e[0],t)},X.set=function(e,t,r){if("length"!==t&&isNaN(parseInt(t)))throw new Error("Immer only supports setting array indices and the 'length' property");return V.set.call(this,e[0],t,r)};var G=Object.freeze({willFinalize:function(){},createProxy:K}),H=function(e,t){for(var r=0,n=t;r<n.length;r+=1){var o=n[r],i=o.path,a=o.op,u=x(o.value);if(!i.length)throw new Error("Illegal state");for(var c=e,f=0;f<i.length-1;f++)if(!(c=c[i[f]])||"object"!=typeof c)throw new Error("Cannot apply patch, path doesn't resolve: "+i.join("/"));var s=i[i.length-1];switch(a){case"replace":c[s]=u;break;case"add":Array.isArray(c)?c.splice(s,0,u):c[s]=u;break;case"remove":Array.isArray(c)?c.splice(s,1):delete c[s];break;default:throw new Error("Unsupported patch operation: "+a)}}return e},J={useProxies:"undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,autoFreeze:"undefined"==typeof process&&"verifyMinified"===function(){}.name,onAssign:null,onDelete:null,onCopy:null},Q=function(e){w(this,J,e),this.setUseProxies(this.useProxies),this.produce=this.produce.bind(this)};Q.prototype.produce=function(e,t,r){var n,o=this;if("function"==typeof e&&"function"!=typeof t){var i=t;t=e;var a=this;return function(e){var r=this;void 0===e&&(e=i);for(var n=[],o=arguments.length-1;o-- >0;)n[o]=arguments[o+1];return a.produce(e,(function(e){return t.call.apply(t,[r,e].concat(n))}))}}if("function"!=typeof t)throw new Error("The first or second argument to `produce` must be a function");if(void 0!==r&&"function"!=typeof r)throw new Error("The third argument to `produce` must be a function or undefined");if(m(e)){var u=z.enter(),c=this.createProxy(e),f=!0;try{n=t(c),f=!1}finally{f?u.revoke():u.leave()}return n instanceof Promise?n.then((function(e){return u.usePatches(r),o.processResult(e,u)}),(function(e){throw u.revoke(),e})):(u.usePatches(r),this.processResult(n,u))}if((n=t(e))!==y)return void 0===n&&(n=e),this.maybeFreeze(n,!0),n},Q.prototype.produceWithPatches=function(e,t,r){var n,o,i=this;if("function"==typeof e)return function(t){for(var r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return i.produceWithPatches(t,(function(t){return e.apply(void 0,[t].concat(r))}))};if(r)throw new Error("A patch listener cannot be passed to produceWithPatches");return[this.produce(e,t,(function(e,t){n=e,o=t})),n,o]},Q.prototype.createDraft=function(e){if(!m(e))throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object");var t=z.enter(),r=this.createProxy(e);return r[b].isManual=!0,t.leave(),r},Q.prototype.finishDraft=function(e,t){var r=e&&e[b];if(!r||!r.isManual)throw new Error("First argument to `finishDraft` must be a draft returned by `createDraft`");if(r.finalized)throw new Error("The given draft is already finalized");var n=r.scope;return n.usePatches(t),this.processResult(void 0,n)},Q.prototype.setAutoFreeze=function(e){this.autoFreeze=e},Q.prototype.setUseProxies=function(e){this.useProxies=e,w(this,e?G:q)},Q.prototype.applyPatches=function(e,t){var r;for(r=t.length-1;r>=0;r--){var n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}return g(e)?H(e,t):this.produce(e,(function(e){return H(e,t.slice(r+1))}))},Q.prototype.processResult=function(e,t){var r=t.drafts[0],n=void 0!==e&&e!==r;if(this.willFinalize(t,e,n),n){if(r[b].modified)throw t.revoke(),new Error("An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.");m(e)&&(e=this.finalize(e,null,t),this.maybeFreeze(e)),t.patches&&(t.patches.push({op:"replace",path:[],value:e}),t.inversePatches.push({op:"replace",path:[],value:r[b].base}))}else e=this.finalize(r,[],t);return t.revoke(),t.patches&&t.patchListener(t.patches,t.inversePatches),e!==y?e:void 0},Q.prototype.finalize=function(e,t,r){var n=this,o=e[b];if(!o)return Object.isFrozen(e)?e:this.finalizeTree(e,null,r);if(o.scope!==r)return e;if(!o.modified)return this.maybeFreeze(o.base,!0),o.base;if(!o.finalized){if(o.finalized=!0,this.finalizeTree(o.draft,t,r),this.onDelete)if(this.useProxies){var i=o.assigned;for(var a in i)i[a]||this.onDelete(o,a)}else{var u=o.copy;E(o.base,(function(e){P(u,e)||n.onDelete(o,e)}))}this.onCopy&&this.onCopy(o),this.autoFreeze&&r.canAutoFreeze&&Object.freeze(o.copy),t&&r.patches&&function(e,t,r,n){Array.isArray(e.base)?function(e,t,r,n){var o,i,a=e.base,u=e.copy,c=e.assigned;u.length<a.length&&(a=(o=[u,a])[0],u=o[1],r=(i=[n,r])[0],n=i[1]);for(var f=u.length-a.length,s=0;a[s]===u[s]&&s<a.length;)++s;for(var l=a.length;l>s&&a[l-1]===u[l+f-1];)--l;for(var d=s;d<l;++d)if(c[d]&&u[d]!==a[d]){var p=t.concat([d]);r.push({op:"replace",path:p,value:u[d]}),n.push({op:"replace",path:p,value:a[d]})}for(var h=r.length,y=l+f-1;y>=l;--y){var v=t.concat([y]);r[h+y-l]={op:"add",path:v,value:u[y]},n.push({op:"remove",path:v})}}(e,t,r,n):function(e,t,r,n){var o=e.base,i=e.copy;E(e.assigned,(function(e,a){var u=o[e],c=i[e],f=a?e in o?"replace":"add":"remove";if(u!==c||"replace"!==f){var s=t.concat(e);r.push("remove"===f?{op:f,path:s}:{op:f,path:s,value:c}),n.push("add"===f?{op:"remove",path:s}:"remove"===f?{op:"add",path:s,value:u}:{op:"replace",path:s,value:u})}}))}(e,t,r,n)}(o,t,r.patches,r.inversePatches)}return o.copy},Q.prototype.finalizeTree=function(e,t,r){var n=this,o=e[b];o&&(this.useProxies||(o.copy=j(o.draft,!0)),e=o.copy);var i=!!t&&!!r.patches,a=function(u,c,f){if(c===f)throw Error("Immer forbids circular references");var s=!!o&&f===e;if(g(c)){var l=s&&i&&!o.assigned[u]?t.concat(u):null;if(g(c=n.finalize(c,l,r))&&(r.canAutoFreeze=!1),Array.isArray(f)||A(f,u)?f[u]=c:Object.defineProperty(f,u,{value:c}),s&&c===o.base[u])return}else{if(s&&S(c,o.base[u]))return;m(c)&&!Object.isFrozen(c)&&(E(c,a),n.maybeFreeze(c))}s&&n.onAssign&&n.onAssign(o,u,c)};return E(e,a),e},Q.prototype.maybeFreeze=function(e,t){void 0===t&&(t=!1),this.autoFreeze&&!g(e)&&(t?k(e):Object.freeze(e))};var Z=new Q,ee=Z.produce;function te(e,t){return e===t}function re(e,t,r){if(null===t||null===r||t.length!==r.length)return!1;for(var n=t.length,o=0;o<n;o++)if(!e(t[o],r[o]))return!1;return!0}function ne(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var r=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+r+"]")}return t}Z.produceWithPatches.bind(Z),Z.setAutoFreeze.bind(Z),Z.setUseProxies.bind(Z),Z.applyPatches.bind(Z),Z.createDraft.bind(Z),Z.finishDraft.bind(Z);var oe=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];var i=0,a=n.pop(),u=ne(n),c=e.apply(void 0,[function(){return i++,a.apply(null,arguments)}].concat(r)),f=e((function(){for(var e=[],t=u.length,r=0;r<t;r++)e.push(u[r].apply(null,arguments));return c.apply(null,e)}));return f.resultFunc=a,f.dependencies=u,f.recomputations=function(){return i},f.resetRecomputations=function(){return i=0},f}}((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:te,r=null,n=null;return function(){return re(t,r,arguments)||(n=e.apply(null,arguments)),r=arguments,n}}));function ie(){return(ie=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}).apply(this,arguments)}var ae,ue=function(e,t){return function(e,t){var r=h;t.__esModule=!0,t.composeWithDevTools="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?r:r.apply(null,arguments)},t.devToolsEnhancer="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}}}(t={exports:{}},t.exports),t.exports}();(ae=ue)&&ae.__esModule&&Object.prototype.hasOwnProperty.call(ae,"default");var ce=ue.composeWithDevTools;function fe(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function se(e){return function(t){var r=t.dispatch,n=t.getState;return function(t){return function(o){return"function"==typeof o?o(r,n,e):t(o)}}}}var le=se();function de(e){return null==e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||Array.isArray(e)||fe(e)}function pe(e,t,r,n,o){var i;if(void 0===t&&(t=[]),void 0===r&&(r=de),void 0===o&&(o=[]),!r(e))return{keyPath:t.join(".")||"<root>",value:e};if("object"!=typeof e||null===e)return!1;var a=null!=n?n(e):Object.entries(e),u=o.length>0,c=a,f=Array.isArray(c),s=0;for(c=f?c:c[Symbol.iterator]();;){var l;if(f){if(s>=c.length)break;l=c[s++]}else{if((s=c.next()).done)break;l=s.value}var d=l[1],p=t.concat(l[0]);if(!(u&&o.indexOf(p.join("."))>=0)){if(!r(d))return{keyPath:p.join("."),value:d};if("object"==typeof d&&(i=pe(d,p,r,n,o)))return i}}return!1}function he(e){void 0===e&&(e={});var t=e.thunk,r=void 0===t||t,n=[];return r&&(function(e){return"boolean"==typeof e}(r)?n.push(le):n.push(le.withExtraArgument(r.extraArgument))),n}function ye(e,t){function r(){if(t){var r=t.apply(void 0,arguments);if(!r)throw new Error("prepareAction did not return an object");return ie({type:e,payload:r.payload},"meta"in r&&{meta:r.meta},{},"error"in r&&{error:r.error})}return{type:e,payload:arguments.length<=0?void 0:arguments[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(t){return t.type===e},r}function ve(e){return["type","payload","error","meta"].indexOf(e)>-1}function be(e){var t={},r={addCase:function(e,n){var o="string"==typeof e?e:e.type;if(o in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[o]=n,r}};return e(r),t}function ge(e,t){var r="function"==typeof t?be(t):t;return function(t,n){return void 0===t&&(t=e),ee(t,(function(e){var t=r[n.type];return t?t(e,n):void 0}))}}function me(e){return function(t,r){var n=function(t){var n;fe(n=r)&&"string"==typeof n.type&&Object.keys(n).every(ve)?e(r.payload,t):e(r,t)};return g(t)?(n(t),t):ee(t,n)}}function we(e,t){return t(e)}function Oe(e){function t(t,r){var n=we(t,e);n in r.entities||(r.ids.push(n),r.entities[n]=t)}function r(e,r){var n=e,o=Array.isArray(n),i=0;for(n=o?n:n[Symbol.iterator]();;){var a;if(o){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}t(a,r)}}function n(e,t){var r=!1;e.forEach((function(e){e in t.entities&&(delete t.entities[e],r=!0)})),r&&(t.ids=t.ids.filter((function(e){return e in t.entities})))}function o(t,r){var n={};(t=t.filter((function(e){return e.id in r.entities}))).length>0&&t.filter((function(t){return function(t,r,n){var o=Object.assign({},n.entities[r.id],r.changes),i=we(o,e),a=i!==r.id;return a&&(t[r.id]=i,delete n.entities[r.id]),n.entities[i]=o,a}(n,t,r)})).length>0&&(r.ids=r.ids.map((function(e){return n[e]||e})))}function i(t,n){var i=[],a=[],u=t,c=Array.isArray(u),f=0;for(u=c?u:u[Symbol.iterator]();;){var s;if(c){if(f>=u.length)break;s=u[f++]}else{if((f=u.next()).done)break;s=f.value}var l=s,d=we(l,e);d in n.entities?a.push({id:d,changes:l}):i.push(l)}o(a,n),r(i,n)}return{removeAll:function(e){return Object.assign({},e,{ids:[],entities:{}})},addOne:me(t),addMany:me(r),setAll:me((function(e,t){t.ids=[],t.entities={},r(e,t)})),updateOne:me((function(e,t){return o([e],t)})),updateMany:me(o),upsertOne:me((function(e,t){return i([e],t)})),upsertMany:me(i),removeOne:me((function(e,t){return n([e],t)})),removeMany:me(n),map:me((function(e,t){return o(t.ids.reduce((function(r,n){var o=e(t.entities[n]);return o!==t.entities[n]&&r.push({id:n,changes:o}),r}),[]).filter((function(e){return e.id in t.entities})),t)}))}}le.withExtraArgument=se,"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));for(var je=self.crypto||self.msCrypto,Ee="-_",Ae=36;Ae--;)Ee+=Ae.toString(36);for(Ae=36;Ae---10;)Ee+=Ae.toString(36).toUpperCase();var Pe=["name","message","stack","code"],Se=function(e){if("object"==typeof e&&null!==e){var t={},r=Pe,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var i;if(n){if(o>=r.length)break;i=r[o++]}else{if((o=r.next()).done)break;i=o.value}"string"==typeof e[i]&&(t[i]=e[i])}return t}return e};e.Dictionary=function(){},e.__DO_NOT_USE__ActionTypes=n,e.applyMiddleware=d,e.bindActionCreators=function(e,t){if("function"==typeof e)return c(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var r=Object.keys(e),n={},o=0;o<r.length;o++){var i=r[o],a=e[i];"function"==typeof a&&(n[i]=c(a,t))}return n},e.combineReducers=u,e.compose=l,e.configureStore=function(e){var t,r=e||{},n=r.reducer,o=void 0===n?void 0:n,a=r.middleware,c=void 0===a?he():a,f=r.devTools,s=void 0===f||f,p=r.preloadedState,h=void 0===p?void 0:p,y=r.enhancers,v=void 0===y?void 0:y;if("function"==typeof o)t=o;else{if(!fe(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=u(o)}var b=d.apply(void 0,c),g=l;s&&(g=ce(ie({trace:!1},"object"==typeof s&&s)));var m=[b];return Array.isArray(v)?m=[b].concat(v):"function"==typeof v&&(m=v(m)),i(t,h,g.apply(void 0,m))},e.createAction=ye,e.createAsyncThunk=function(e,t){var r=ye(e+"/fulfilled",(function(e,t,r){return{payload:e,meta:{arg:r,requestId:t}}})),n=ye(e+"/pending",(function(e,t){return{payload:void 0,meta:{arg:t,requestId:e}}})),o=ye(e+"/rejected",(function(e,t,r){var n=e&&"AbortError"===e.name;return{payload:void 0,error:Se(e),meta:{arg:r,requestId:t,aborted:n}}}));return Object.assign((function(e){return function(i,a,u){var c,f=function(e){var t="",r=je.getRandomValues(new Uint8Array(21));for(Ae=21;Ae--;)t+=Ee[63&r[Ae]];return t}(),s=new AbortController,l=new Promise((function(e,t){return s.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:c||"Aborted"})}))})),d=function(){try{var c,d=function(){return i(c),c},p=function(o,d){try{var p=(i(n(f,e)),Promise.resolve(Promise.race([l,Promise.resolve(t(e,{dispatch:i,getState:a,extra:u,requestId:f,signal:s.signal})).then((function(t){return r(t,f,e)}))])).then((function(e){c=e})))}catch(e){return d(e)}return p&&p.then?p.then(void 0,d):p}(0,(function(t){c=o(t,f,e)}));return Promise.resolve(p&&p.then?p.then(d):d())}catch(e){return Promise.reject(e)}}();return Object.assign(d,{abort:function(e){c=e,s.abort()}})}}),{pending:n,rejected:o,fulfilled:r})},e.createEntityAdapter=function(e){void 0===e&&(e={});var t=ie({sortComparer:!1,selectId:function(e){return e.id}},e),r=t.selectId,n=t.sortComparer;return ie({selectId:r,sortComparer:n},{getInitialState:function(e){return void 0===e&&(e={}),Object.assign({ids:[],entities:{}},e)}},{},{getSelectors:function(e){var t=function(e){return e.ids},r=function(e){return e.entities},n=oe(t,r,(function(e,t){return e.map((function(e){return t[e]}))})),o=oe(t,(function(e){return e.length}));return e?{selectIds:oe(e,t),selectEntities:oe(e,r),selectAll:oe(e,n),selectTotal:oe(e,o)}:{selectIds:t,selectEntities:r,selectAll:n,selectTotal:o}}},{},n?function(e,t){var r=Oe(e);function n(t,r){var n=t.filter((function(t){return!(we(t,e)in r.entities)}));0!==n.length&&a(n,r)}function o(t,r){var n=[];t.forEach((function(t){return function(t,r,n){if(!(r.id in n.entities))return!1;var o=Object.assign({},n.entities[r.id],r.changes),i=we(o,e);return delete n.entities[r.id],t.push(o),i!==r.id}(n,t,r)})),0!==n.length&&a(n,r)}function i(t,r){var i=[],a=[],u=t,c=Array.isArray(u),f=0;for(u=c?u:u[Symbol.iterator]();;){var s;if(c){if(f>=u.length)break;s=u[f++]}else{if((f=u.next()).done)break;s=f.value}var l=s,d=we(l,e);d in r.entities?a.push({id:d,changes:l}):i.push(l)}o(a,r),n(i,r)}function a(r,n){r.sort(t),r.forEach((function(t){n.entities[e(t)]=t}));var o=Object.values(n.entities);o.sort(t);var i=o.map(e);(function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(e[r]!==t[r])return!1;return!0})(n.ids,i)||(n.ids=i)}return{removeOne:r.removeOne,removeMany:r.removeMany,removeAll:r.removeAll,addOne:me((function(e,t){return n([e],t)})),updateOne:me((function(e,t){return o([e],t)})),upsertOne:me((function(e,t){return i([e],t)})),setAll:me((function(e,t){t.entities={},t.ids=[],n(e,t)})),addMany:me(n),updateMany:me(o),upsertMany:me(i),map:me((function(e,t){o(t.ids.reduce((function(r,n){var o=e(t.entities[n]);return o!==t.entities[n]&&r.push({id:n,changes:o}),r}),[]),t)}))}}(r,n):Oe(r))},e.createNextState=ee,e.createReducer=ge,e.createSelector=oe,e.createSerializableStateInvariantMiddleware=function(e){void 0===e&&(e={});var t=e.isSerializable,r=void 0===t?de:t,n=e.getEntries,o=e.ignoredActions,i=void 0===o?[]:o,a=e.ignoredPaths,u=void 0===a?[]:a;return function(e){return function(t){return function(o){if(i.length&&-1!==i.indexOf(o.type))return t(o);var a=pe(o,[],r,n);a&&console.error("A non-serializable value was detected in an action, in the path: `"+a.keyPath+"`. Value:",a.value,"\nTake a look at the logic that dispatched this action: ",o,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)");var c=t(o),f=pe(e.getState(),[],r,n,u);return f&&console.error("A non-serializable value was detected in the state, in the path: `"+f.keyPath+"`. Value:",f.value,"\nTake a look at the reducer(s) handling this action type: "+o.type+".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)"),c}}}},e.createSlice=function(e){var t=e.name,r=e.initialState;if(!t)throw new Error("`name` is a required option for createSlice");var n=e.reducers||{},o=void 0===e.extraReducers?{}:"function"==typeof e.extraReducers?be(e.extraReducers):e.extraReducers,i=Object.keys(n),a={},u={},c={};i.forEach((function(e){var r,o,i=n[e],f=t+"/"+e;"reducer"in i?(r=i.reducer,o=i.prepare):r=i,a[e]=r,u[f]=r,c[e]=o?ye(f,o):ye(f)}));var f=ge(r,ie({},o,{},u));return{name:t,reducer:f,actions:c,caseReducers:a}},e.createStore=i,e.findNonSerializableValue=pe,e.getDefaultMiddleware=he,e.getType=function(e){return""+e},e.isPlain=de,e.unwrapResult=function(e){if("error"in e)throw e.error;return e.payload}}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).RTK={})}(this,(function(e){"use strict";var t=function(e){var t,r=("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")()).Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}(),r=function(){return Math.random().toString(36).substring(7).split("").join(".")},n={INIT:"@@redux/INIT"+r(),REPLACE:"@@redux/REPLACE"+r(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+r()}};function o(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function i(e,r,a){var u;if("function"==typeof r&&"function"==typeof a||"function"==typeof a&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function");if("function"==typeof r&&void 0===a&&(a=r,r=void 0),void 0!==a){if("function"!=typeof a)throw new Error("Expected the enhancer to be a function.");return a(i)(e,r)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var c=e,f=r,s=[],l=s,d=!1;function p(){l===s&&(l=s.slice())}function h(){if(d)throw new 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 f}function y(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(d)throw new 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 t=!0;return p(),l.push(e),function(){if(t){if(d)throw new 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.");t=!1,p();var r=l.indexOf(e);l.splice(r,1)}}}function v(e){if(!o(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,f=c(f,e)}finally{d=!1}for(var t=s=l,r=0;r<t.length;r++)(0,t[r])();return e}function b(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");c=e,v({type:n.REPLACE})}function g(){var e,r=y;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function t(){e.next&&e.next(h())}return t(),{unsubscribe:r(t)}}})[t]=function(){return this},e}return v({type:n.INIT}),(u={dispatch:v,subscribe:y,getState:h,replaceReducer:b})[t]=g,u}function a(e,t){var r=t&&t.type;return"Given "+(r&&'action "'+String(r)+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function u(e){for(var t=Object.keys(e),r={},o=0;o<t.length;o++){var i=t[o];"function"==typeof e[i]&&(r[i]=e[i])}var u,c=Object.keys(r);try{!function(e){Object.keys(e).forEach((function(t){var r=e[t];if(void 0===r(void 0,{type:n.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:n.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+n.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(r)}catch(e){u=e}return function(e,t){if(void 0===e&&(e={}),u)throw u;for(var n=!1,o={},i=0;i<c.length;i++){var f=c[i],s=e[f],l=(0,r[f])(s,t);if(void 0===l){var d=a(f,t);throw new Error(d)}o[f]=l,n=n||l!==s}return n?o:e}}function c(e,t){return function(){return t(e.apply(this,arguments))}}function f(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){f(e,t,r[t])}))}return e}function l(){for(var e=arguments.length,t=new 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))}}))}function d(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),n=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return s({},r,{dispatch:n=l.apply(void 0,i)(r.dispatch)})}}}var p,h=l,y="undefined"!=typeof Symbol?Symbol("immer-nothing"):((p={})["immer-nothing"]=!0,p),v="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("immer-draftable"):"__$immer_draftable",b="undefined"!=typeof Symbol&&Symbol.for?Symbol.for("immer-state"):"__$immer_state";function g(e){return!!e&&!!e[b]}function m(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e))return!0;var t=Object.getPrototypeOf(e);return!t||t===Object.prototype}(e)||!!e[v]||!!e.constructor[v])}var w=Object.assign||function(e,t){for(var r in t)P(t,r)&&(e[r]=t[r]);return e},O="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function j(e,t){if(void 0===t&&(t=!1),Array.isArray(e))return e.slice();var r=Object.create(Object.getPrototypeOf(e));return O(e).forEach((function(n){if(n!==b){var o=Object.getOwnPropertyDescriptor(e,n),i=o.value;if(o.get){if(!t)throw new Error("Immer drafts cannot have computed properties");i=o.get.call(e)}o.enumerable?r[n]=i:Object.defineProperty(r,n,{value:i,writable:!0,configurable:!0})}})),r}function E(e,t){if(Array.isArray(e))for(var r=0;r<e.length;r++)t(r,e[r],e);else O(e).forEach((function(r){return t(r,e[r],e)}))}function A(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!!r&&r.enumerable}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function S(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function x(e){if(!m(e))return e;if(Array.isArray(e))return e.map(x);var t=Object.create(Object.getPrototypeOf(e));for(var r in e)t[r]=x(e[r]);return t}function k(e){if(m(e)&&!g(e)&&!Object.isFrozen(e))if(Object.freeze(e),Array.isArray(e))e.forEach(k);else for(var t in e)k(e[t])}var z=function(e){this.drafts=[],this.parent=e,this.canAutoFreeze=!0,this.patches=null};function _(e){e[b].revoke()}z.prototype.usePatches=function(e){e&&(this.patches=[],this.inversePatches=[],this.patchListener=e)},z.prototype.revoke=function(){this.leave(),this.drafts.forEach(_),this.drafts=null},z.prototype.leave=function(){this===z.current&&(z.current=this.parent)},z.current=null,z.enter=function(){return this.current=new z(this.current)};var I={};function T(){this.revoked=!0}function R(e){return e.copy||e.base}function D(e,t){var r=e[b];if(r&&!r.finalizing){r.finalizing=!0;var n=e[t];return r.finalizing=!1,n}return e[t]}function N(e){e.modified||(e.modified=!0,e.parent&&N(e.parent))}function C(e){e.copy||(e.copy=F(e.base))}function F(e){var t=e&&e[b];if(t){t.finalizing=!0;var r=j(t.draft,!0);return t.finalizing=!1,r}return j(e)}function M(e){if(!0===e.revoked)throw new Error("Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+JSON.stringify(R(e)))}function U(e){for(var t=e.length-1;t>=0;t--){var r=e[t][b];r.modified||(Array.isArray(r.base)?W(r)&&N(r):L(r)&&N(r))}}function L(e){for(var t=e.base,r=e.draft,n=Object.keys(r),o=n.length-1;o>=0;o--){var i=n[o],a=t[i];if(void 0===a&&!P(t,i))return!0;var u=r[i],c=u&&u[b];if(c?c.base!==a:!S(u,a))return!0}return n.length!==Object.keys(t).length}function W(e){var t=e.draft;if(t.length!==e.base.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!r||r.get)}var q=Object.freeze({willFinalize:function(e,t,r){e.drafts.forEach((function(e){e[b].finalizing=!0})),r?g(t)&&t[b].scope===e&&U(e.drafts):(e.patches&&function e(t){if(t&&"object"==typeof t){var r=t[b];if(r){var n=r.base,o=r.draft,i=r.assigned;if(Array.isArray(t)){if(W(r)){if(N(r),i.length=!0,o.length<n.length)for(var a=o.length;a<n.length;a++)i[a]=!1;else for(var u=n.length;u<o.length;u++)i[u]=!0;for(var c=0;c<o.length;c++)void 0===i[c]&&e(o[c])}}else Object.keys(o).forEach((function(t){void 0!==n[t]||P(n,t)?i[t]||e(o[t]):(i[t]=!0,N(r))})),Object.keys(n).forEach((function(e){void 0!==o[e]||P(o,e)||(i[e]=!1,N(r))}))}}}(e.drafts[0]),U(e.drafts))},createProxy:function e(t,r){var n=Array.isArray(t),o=F(t);E(o,(function(r){!function(t,r,n){var o=I[r];o?o.enumerable=n:I[r]=o={configurable:!0,enumerable:n,get:function(){return function(t,r){M(t);var n=D(R(t),r);return t.finalizing?n:n===D(t.base,r)&&m(n)?(C(t),t.copy[r]=e(n,t)):n}(this[b],r)},set:function(e){!function(e,t,r){if(M(e),e.assigned[t]=!0,!e.modified){if(S(r,D(R(e),t)))return;N(e),C(e)}e.copy[t]=r}(this[b],r,e)}},Object.defineProperty(t,r,o)}(o,r,n||A(t,r))}));var i=r?r.scope:z.current;return Object.defineProperty(o,b,{value:{scope:i,modified:!1,finalizing:!1,finalized:!1,assigned:{},parent:r,base:t,draft:o,copy:null,revoke:T,revoked:!1},enumerable:!1,writable:!0}),i.drafts.push(o),o}});function K(e,t){var r=t?t.scope:z.current,n={scope:r,modified:!1,finalized:!1,assigned:{},parent:t,base:e,draft:null,drafts:{},copy:null,revoke:null},o=Array.isArray(e)?Proxy.revocable([n],X):Proxy.revocable(n,V),i=o.revoke,a=o.proxy;return n.draft=a,n.revoke=i,r.drafts.push(a),a}var V={get:function(e,t){if(t===b)return e;var r=e.drafts;if(!e.modified&&P(r,t))return r[t];var n=B(e)[t];if(e.finalized||!m(n))return n;if(e.modified){if(n!==Y(e.base,t))return n;r=e.copy}return r[t]=K(n,e)},has:function(e,t){return t in B(e)},ownKeys:function(e){return Reflect.ownKeys(B(e))},set:function(e,t,r){if(!e.modified){var n=Y(e.base,t);if(r?S(n,r)||r===e.drafts[t]:S(n,r)&&t in e.base)return!0;$(e)}return e.assigned[t]=!0,e.copy[t]=r,!0},deleteProperty:function(e,t){return void 0!==Y(e.base,t)||t in e.base?(e.assigned[t]=!1,$(e)):e.assigned[t]&&delete e.assigned[t],e.copy&&delete e.copy[t],!0},getOwnPropertyDescriptor:function(e,t){var r=B(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&(n.writable=!0,n.configurable=!Array.isArray(r)||"length"!==t),n},defineProperty:function(){throw new Error("Object.defineProperty() cannot be used on an Immer draft")},getPrototypeOf:function(e){return Object.getPrototypeOf(e.base)},setPrototypeOf:function(){throw new Error("Object.setPrototypeOf() cannot be used on an Immer draft")}},X={};function B(e){return e.copy||e.base}function Y(e,t){var r=e[b],n=Reflect.getOwnPropertyDescriptor(r?B(r):e,t);return n&&n.value}function $(e){e.modified||(e.modified=!0,e.copy=w(j(e.base),e.drafts),e.drafts=null,e.parent&&$(e.parent))}E(V,(function(e,t){X[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),X.deleteProperty=function(e,t){if(isNaN(parseInt(t)))throw new Error("Immer only supports deleting array indices");return V.deleteProperty.call(this,e[0],t)},X.set=function(e,t,r){if("length"!==t&&isNaN(parseInt(t)))throw new Error("Immer only supports setting array indices and the 'length' property");return V.set.call(this,e[0],t,r)};var G=Object.freeze({willFinalize:function(){},createProxy:K}),H=function(e,t){for(var r=0,n=t;r<n.length;r+=1){var o=n[r],i=o.path,a=o.op,u=x(o.value);if(!i.length)throw new Error("Illegal state");for(var c=e,f=0;f<i.length-1;f++)if(!(c=c[i[f]])||"object"!=typeof c)throw new Error("Cannot apply patch, path doesn't resolve: "+i.join("/"));var s=i[i.length-1];switch(a){case"replace":c[s]=u;break;case"add":Array.isArray(c)?c.splice(s,0,u):c[s]=u;break;case"remove":Array.isArray(c)?c.splice(s,1):delete c[s];break;default:throw new Error("Unsupported patch operation: "+a)}}return e},J={useProxies:"undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,autoFreeze:"undefined"==typeof process&&"verifyMinified"===function(){}.name,onAssign:null,onDelete:null,onCopy:null},Q=function(e){w(this,J,e),this.setUseProxies(this.useProxies),this.produce=this.produce.bind(this)};Q.prototype.produce=function(e,t,r){var n,o=this;if("function"==typeof e&&"function"!=typeof t){var i=t;t=e;var a=this;return function(e){var r=this;void 0===e&&(e=i);for(var n=[],o=arguments.length-1;o-- >0;)n[o]=arguments[o+1];return a.produce(e,(function(e){return t.call.apply(t,[r,e].concat(n))}))}}if("function"!=typeof t)throw new Error("The first or second argument to `produce` must be a function");if(void 0!==r&&"function"!=typeof r)throw new Error("The third argument to `produce` must be a function or undefined");if(m(e)){var u=z.enter(),c=this.createProxy(e),f=!0;try{n=t(c),f=!1}finally{f?u.revoke():u.leave()}return n instanceof Promise?n.then((function(e){return u.usePatches(r),o.processResult(e,u)}),(function(e){throw u.revoke(),e})):(u.usePatches(r),this.processResult(n,u))}if((n=t(e))!==y)return void 0===n&&(n=e),this.maybeFreeze(n,!0),n},Q.prototype.produceWithPatches=function(e,t,r){var n,o,i=this;if("function"==typeof e)return function(t){for(var r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return i.produceWithPatches(t,(function(t){return e.apply(void 0,[t].concat(r))}))};if(r)throw new Error("A patch listener cannot be passed to produceWithPatches");return[this.produce(e,t,(function(e,t){n=e,o=t})),n,o]},Q.prototype.createDraft=function(e){if(!m(e))throw new Error("First argument to `createDraft` must be a plain object, an array, or an immerable object");var t=z.enter(),r=this.createProxy(e);return r[b].isManual=!0,t.leave(),r},Q.prototype.finishDraft=function(e,t){var r=e&&e[b];if(!r||!r.isManual)throw new Error("First argument to `finishDraft` must be a draft returned by `createDraft`");if(r.finalized)throw new Error("The given draft is already finalized");var n=r.scope;return n.usePatches(t),this.processResult(void 0,n)},Q.prototype.setAutoFreeze=function(e){this.autoFreeze=e},Q.prototype.setUseProxies=function(e){this.useProxies=e,w(this,e?G:q)},Q.prototype.applyPatches=function(e,t){var r;for(r=t.length-1;r>=0;r--){var n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}return g(e)?H(e,t):this.produce(e,(function(e){return H(e,t.slice(r+1))}))},Q.prototype.processResult=function(e,t){var r=t.drafts[0],n=void 0!==e&&e!==r;if(this.willFinalize(t,e,n),n){if(r[b].modified)throw t.revoke(),new Error("An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.");m(e)&&(e=this.finalize(e,null,t),this.maybeFreeze(e)),t.patches&&(t.patches.push({op:"replace",path:[],value:e}),t.inversePatches.push({op:"replace",path:[],value:r[b].base}))}else e=this.finalize(r,[],t);return t.revoke(),t.patches&&t.patchListener(t.patches,t.inversePatches),e!==y?e:void 0},Q.prototype.finalize=function(e,t,r){var n=this,o=e[b];if(!o)return Object.isFrozen(e)?e:this.finalizeTree(e,null,r);if(o.scope!==r)return e;if(!o.modified)return this.maybeFreeze(o.base,!0),o.base;if(!o.finalized){if(o.finalized=!0,this.finalizeTree(o.draft,t,r),this.onDelete)if(this.useProxies){var i=o.assigned;for(var a in i)i[a]||this.onDelete(o,a)}else{var u=o.copy;E(o.base,(function(e){P(u,e)||n.onDelete(o,e)}))}this.onCopy&&this.onCopy(o),this.autoFreeze&&r.canAutoFreeze&&Object.freeze(o.copy),t&&r.patches&&function(e,t,r,n){Array.isArray(e.base)?function(e,t,r,n){var o,i,a=e.base,u=e.copy,c=e.assigned;u.length<a.length&&(a=(o=[u,a])[0],u=o[1],r=(i=[n,r])[0],n=i[1]);for(var f=u.length-a.length,s=0;a[s]===u[s]&&s<a.length;)++s;for(var l=a.length;l>s&&a[l-1]===u[l+f-1];)--l;for(var d=s;d<l;++d)if(c[d]&&u[d]!==a[d]){var p=t.concat([d]);r.push({op:"replace",path:p,value:u[d]}),n.push({op:"replace",path:p,value:a[d]})}for(var h=r.length,y=l+f-1;y>=l;--y){var v=t.concat([y]);r[h+y-l]={op:"add",path:v,value:u[y]},n.push({op:"remove",path:v})}}(e,t,r,n):function(e,t,r,n){var o=e.base,i=e.copy;E(e.assigned,(function(e,a){var u=o[e],c=i[e],f=a?e in o?"replace":"add":"remove";if(u!==c||"replace"!==f){var s=t.concat(e);r.push("remove"===f?{op:f,path:s}:{op:f,path:s,value:c}),n.push("add"===f?{op:"remove",path:s}:"remove"===f?{op:"add",path:s,value:u}:{op:"replace",path:s,value:u})}}))}(e,t,r,n)}(o,t,r.patches,r.inversePatches)}return o.copy},Q.prototype.finalizeTree=function(e,t,r){var n=this,o=e[b];o&&(this.useProxies||(o.copy=j(o.draft,!0)),e=o.copy);var i=!!t&&!!r.patches,a=function(u,c,f){if(c===f)throw Error("Immer forbids circular references");var s=!!o&&f===e;if(g(c)){var l=s&&i&&!o.assigned[u]?t.concat(u):null;if(g(c=n.finalize(c,l,r))&&(r.canAutoFreeze=!1),Array.isArray(f)||A(f,u)?f[u]=c:Object.defineProperty(f,u,{value:c}),s&&c===o.base[u])return}else{if(s&&S(c,o.base[u]))return;m(c)&&!Object.isFrozen(c)&&(E(c,a),n.maybeFreeze(c))}s&&n.onAssign&&n.onAssign(o,u,c)};return E(e,a),e},Q.prototype.maybeFreeze=function(e,t){void 0===t&&(t=!1),this.autoFreeze&&!g(e)&&(t?k(e):Object.freeze(e))};var Z=new Q,ee=Z.produce;function te(e,t){return e===t}function re(e,t,r){if(null===t||null===r||t.length!==r.length)return!1;for(var n=t.length,o=0;o<n;o++)if(!e(t[o],r[o]))return!1;return!0}function ne(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var r=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+r+"]")}return t}Z.produceWithPatches.bind(Z),Z.setAutoFreeze.bind(Z),Z.setUseProxies.bind(Z),Z.applyPatches.bind(Z),Z.createDraft.bind(Z),Z.finishDraft.bind(Z);var oe=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];var i=0,a=n.pop(),u=ne(n),c=e.apply(void 0,[function(){return i++,a.apply(null,arguments)}].concat(r)),f=e((function(){for(var e=[],t=u.length,r=0;r<t;r++)e.push(u[r].apply(null,arguments));return c.apply(null,e)}));return f.resultFunc=a,f.dependencies=u,f.recomputations=function(){return i},f.resetRecomputations=function(){return i=0},f}}((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:te,r=null,n=null;return function(){return re(t,r,arguments)||(n=e.apply(null,arguments)),r=arguments,n}}));function ie(){return(ie=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}).apply(this,arguments)}var ae,ue=function(e,t){return function(e,t){var r=h;t.__esModule=!0,t.composeWithDevTools="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?r:r.apply(null,arguments)},t.devToolsEnhancer="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}}}(t={exports:{}},t.exports),t.exports}();(ae=ue)&&ae.__esModule&&Object.prototype.hasOwnProperty.call(ae,"default");var ce=ue.composeWithDevTools;function fe(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function se(e){return function(t){var r=t.dispatch,n=t.getState;return function(t){return function(o){return"function"==typeof o?o(r,n,e):t(o)}}}}var le=se();function de(e){return null==e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||Array.isArray(e)||fe(e)}function pe(e,t,r,n,o){var i;if(void 0===t&&(t=[]),void 0===r&&(r=de),void 0===o&&(o=[]),!r(e))return{keyPath:t.join(".")||"<root>",value:e};if("object"!=typeof e||null===e)return!1;var a=null!=n?n(e):Object.entries(e),u=o.length>0,c=a,f=Array.isArray(c),s=0;for(c=f?c:c[Symbol.iterator]();;){var l;if(f){if(s>=c.length)break;l=c[s++]}else{if((s=c.next()).done)break;l=s.value}var d=l[1],p=t.concat(l[0]);if(!(u&&o.indexOf(p.join("."))>=0)){if(!r(d))return{keyPath:p.join("."),value:d};if("object"==typeof d&&(i=pe(d,p,r,n,o)))return i}}return!1}function he(e){void 0===e&&(e={});var t=e.thunk,r=void 0===t||t,n=[];return r&&(function(e){return"boolean"==typeof e}(r)?n.push(le):n.push(le.withExtraArgument(r.extraArgument))),n}function ye(e,t){function r(){if(t){var r=t.apply(void 0,arguments);if(!r)throw new Error("prepareAction did not return an object");return ie({type:e,payload:r.payload},"meta"in r&&{meta:r.meta},{},"error"in r&&{error:r.error})}return{type:e,payload:arguments.length<=0?void 0:arguments[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(t){return t.type===e},r}function ve(e){return["type","payload","error","meta"].indexOf(e)>-1}function be(e){var t={},r={addCase:function(e,n){var o="string"==typeof e?e:e.type;if(o in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[o]=n,r}};return e(r),t}function ge(e,t){var r="function"==typeof t?be(t):t;return function(t,n){return void 0===t&&(t=e),ee(t,(function(e){var t=r[n.type];return t?t(e,n):void 0}))}}function me(e){return function(t,r){var n=function(t){var n;fe(n=r)&&"string"==typeof n.type&&Object.keys(n).every(ve)?e(r.payload,t):e(r,t)};return g(t)?(n(t),t):ee(t,n)}}function we(e,t){return t(e)}function Oe(e){function t(t,r){var n=we(t,e);n in r.entities||(r.ids.push(n),r.entities[n]=t)}function r(e,r){var n=e,o=Array.isArray(n),i=0;for(n=o?n:n[Symbol.iterator]();;){var a;if(o){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}t(a,r)}}function n(e,t){var r=!1;e.forEach((function(e){e in t.entities&&(delete t.entities[e],r=!0)})),r&&(t.ids=t.ids.filter((function(e){return e in t.entities})))}function o(t,r){var n={},o={};t.forEach((function(e){e.id in r.entities&&(o[e.id]=ie({},o[e.id],{},e))})),(t=Object.values(o)).length>0&&t.filter((function(t){return function(t,r,n){var o=Object.assign({},n.entities[r.id],r.changes),i=we(o,e),a=i!==r.id;return a&&(t[r.id]=i,delete n.entities[r.id]),n.entities[i]=o,a}(n,t,r)})).length>0&&(r.ids=r.ids.map((function(e){return n[e]||e})))}function i(t,n){var i=[],a=[],u=t,c=Array.isArray(u),f=0;for(u=c?u:u[Symbol.iterator]();;){var s;if(c){if(f>=u.length)break;s=u[f++]}else{if((f=u.next()).done)break;s=f.value}var l=s,d=we(l,e);d in n.entities?a.push({id:d,changes:l}):i.push(l)}o(a,n),r(i,n)}return{removeAll:function(e){return Object.assign({},e,{ids:[],entities:{}})},addOne:me(t),addMany:me(r),setAll:me((function(e,t){t.ids=[],t.entities={},r(e,t)})),updateOne:me((function(e,t){return o([e],t)})),updateMany:me(o),upsertOne:me((function(e,t){return i([e],t)})),upsertMany:me(i),removeOne:me((function(e,t){return n([e],t)})),removeMany:me(n),map:me((function(e,t){return o(t.ids.reduce((function(r,n){var o=e(t.entities[n]);return o!==t.entities[n]&&r.push({id:n,changes:o}),r}),[]).filter((function(e){return e.id in t.entities})),t)}))}}le.withExtraArgument=se,"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));for(var je=self.crypto||self.msCrypto,Ee="-_",Ae=36;Ae--;)Ee+=Ae.toString(36);for(Ae=36;Ae---10;)Ee+=Ae.toString(36).toUpperCase();var Pe=["name","message","stack","code"],Se=function(e){if("object"==typeof e&&null!==e){var t={},r=Pe,n=Array.isArray(r),o=0;for(r=n?r:r[Symbol.iterator]();;){var i;if(n){if(o>=r.length)break;i=r[o++]}else{if((o=r.next()).done)break;i=o.value}"string"==typeof e[i]&&(t[i]=e[i])}return t}return e};e.Dictionary=function(){},e.__DO_NOT_USE__ActionTypes=n,e.applyMiddleware=d,e.bindActionCreators=function(e,t){if("function"==typeof e)return c(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var r=Object.keys(e),n={},o=0;o<r.length;o++){var i=r[o],a=e[i];"function"==typeof a&&(n[i]=c(a,t))}return n},e.combineReducers=u,e.compose=l,e.configureStore=function(e){var t,r=e||{},n=r.reducer,o=void 0===n?void 0:n,a=r.middleware,c=void 0===a?he():a,f=r.devTools,s=void 0===f||f,p=r.preloadedState,h=void 0===p?void 0:p,y=r.enhancers,v=void 0===y?void 0:y;if("function"==typeof o)t=o;else{if(!fe(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=u(o)}var b=d.apply(void 0,c),g=l;s&&(g=ce(ie({trace:!1},"object"==typeof s&&s)));var m=[b];return Array.isArray(v)?m=[b].concat(v):"function"==typeof v&&(m=v(m)),i(t,h,g.apply(void 0,m))},e.createAction=ye,e.createAsyncThunk=function(e,t){var r=ye(e+"/fulfilled",(function(e,t,r){return{payload:e,meta:{arg:r,requestId:t}}})),n=ye(e+"/pending",(function(e,t){return{payload:void 0,meta:{arg:t,requestId:e}}})),o=ye(e+"/rejected",(function(e,t,r){var n=e&&"AbortError"===e.name;return{payload:void 0,error:Se(e),meta:{arg:r,requestId:t,aborted:n}}}));return Object.assign((function(e){return function(i,a,u){var c,f=function(e){var t="",r=je.getRandomValues(new Uint8Array(21));for(Ae=21;Ae--;)t+=Ee[63&r[Ae]];return t}(),s=new AbortController,l=new Promise((function(e,t){return s.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:c||"Aborted"})}))})),d=function(){try{var c,d=function(){return i(c),c},p=function(o,d){try{var p=(i(n(f,e)),Promise.resolve(Promise.race([l,Promise.resolve(t(e,{dispatch:i,getState:a,extra:u,requestId:f,signal:s.signal})).then((function(t){return r(t,f,e)}))])).then((function(e){c=e})))}catch(e){return d(e)}return p&&p.then?p.then(void 0,d):p}(0,(function(t){c=o(t,f,e)}));return Promise.resolve(p&&p.then?p.then(d):d())}catch(e){return Promise.reject(e)}}();return Object.assign(d,{abort:function(e){c=e,s.abort()}})}}),{pending:n,rejected:o,fulfilled:r})},e.createEntityAdapter=function(e){void 0===e&&(e={});var t=ie({sortComparer:!1,selectId:function(e){return e.id}},e),r=t.selectId,n=t.sortComparer;return ie({selectId:r,sortComparer:n},{getInitialState:function(e){return void 0===e&&(e={}),Object.assign({ids:[],entities:{}},e)}},{},{getSelectors:function(e){var t=function(e){return e.ids},r=function(e){return e.entities},n=oe(t,r,(function(e,t){return e.map((function(e){return t[e]}))})),o=oe(t,(function(e){return e.length}));return e?{selectIds:oe(e,t),selectEntities:oe(e,r),selectAll:oe(e,n),selectTotal:oe(e,o)}:{selectIds:t,selectEntities:r,selectAll:n,selectTotal:o}}},{},n?function(e,t){var r=Oe(e);function n(t,r){var n=t.filter((function(t){return!(we(t,e)in r.entities)}));0!==n.length&&a(n,r)}function o(t,r){var n=[];t.forEach((function(t){return function(t,r,n){if(!(r.id in n.entities))return!1;var o=Object.assign({},n.entities[r.id],r.changes),i=we(o,e);return delete n.entities[r.id],t.push(o),i!==r.id}(n,t,r)})),0!==n.length&&a(n,r)}function i(t,r){var i=[],a=[],u=t,c=Array.isArray(u),f=0;for(u=c?u:u[Symbol.iterator]();;){var s;if(c){if(f>=u.length)break;s=u[f++]}else{if((f=u.next()).done)break;s=f.value}var l=s,d=we(l,e);d in r.entities?a.push({id:d,changes:l}):i.push(l)}o(a,r),n(i,r)}function a(r,n){r.sort(t),r.forEach((function(t){n.entities[e(t)]=t}));var o=Object.values(n.entities);o.sort(t);var i=o.map(e);(function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(e[r]!==t[r])return!1;return!0})(n.ids,i)||(n.ids=i)}return{removeOne:r.removeOne,removeMany:r.removeMany,removeAll:r.removeAll,addOne:me((function(e,t){return n([e],t)})),updateOne:me((function(e,t){return o([e],t)})),upsertOne:me((function(e,t){return i([e],t)})),setAll:me((function(e,t){t.entities={},t.ids=[],n(e,t)})),addMany:me(n),updateMany:me(o),upsertMany:me(i),map:me((function(e,t){o(t.ids.reduce((function(r,n){var o=e(t.entities[n]);return o!==t.entities[n]&&r.push({id:n,changes:o}),r}),[]),t)}))}}(r,n):Oe(r))},e.createNextState=ee,e.createReducer=ge,e.createSelector=oe,e.createSerializableStateInvariantMiddleware=function(e){void 0===e&&(e={});var t=e.isSerializable,r=void 0===t?de:t,n=e.getEntries,o=e.ignoredActions,i=void 0===o?[]:o,a=e.ignoredPaths,u=void 0===a?[]:a;return function(e){return function(t){return function(o){if(i.length&&-1!==i.indexOf(o.type))return t(o);var a=pe(o,[],r,n);a&&console.error("A non-serializable value was detected in an action, in the path: `"+a.keyPath+"`. Value:",a.value,"\nTake a look at the logic that dispatched this action: ",o,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)");var c=t(o),f=pe(e.getState(),[],r,n,u);return f&&console.error("A non-serializable value was detected in the state, in the path: `"+f.keyPath+"`. Value:",f.value,"\nTake a look at the reducer(s) handling this action type: "+o.type+".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)"),c}}}},e.createSlice=function(e){var t=e.name,r=e.initialState;if(!t)throw new Error("`name` is a required option for createSlice");var n=e.reducers||{},o=void 0===e.extraReducers?{}:"function"==typeof e.extraReducers?be(e.extraReducers):e.extraReducers,i=Object.keys(n),a={},u={},c={};i.forEach((function(e){var r,o,i=n[e],f=t+"/"+e;"reducer"in i?(r=i.reducer,o=i.prepare):r=i,a[e]=r,u[f]=r,c[e]=o?ye(f,o):ye(f)}));var f=ge(r,ie({},o,{},u));return{name:t,reducer:f,actions:c,caseReducers:a}},e.createStore=i,e.findNonSerializableValue=pe,e.getDefaultMiddleware=he,e.getType=function(e){return""+e},e.isPlain=de,e.unwrapResult=function(e){if("error"in e)throw e.error;return e.payload}}));
//# sourceMappingURL=redux-toolkit.umd.min.js.map

@@ -260,3 +260,3 @@ import { Action } from 'redux';

*/
export declare type Comparer<T> = (a: T, b: T) => EntityId;
export declare type Comparer<T> = (a: T, b: T) => number;

@@ -263,0 +263,0 @@ /**

{
"name": "@reduxjs/toolkit",
"version": "1.3.0-alpha.7",
"version": "1.3.0-alpha.8",
"description": "The official, opinionated, batteries-included toolset for efficient Redux development",

@@ -5,0 +5,0 @@ "repository": "https://github.com/reduxjs/redux-toolkit",

@@ -11,3 +11,3 @@ import { PayloadAction } from '../createAction'

*/
export type Comparer<T> = (a: T, b: T) => EntityId
export type Comparer<T> = (a: T, b: T) => number

@@ -14,0 +14,0 @@ /**

@@ -126,3 +126,3 @@ import { EntityStateAdapter, EntityState, Update } from './models'

const withoutOne = adapter.removeOne(state, TheGreatGatsby.id)
const withoutOne = adapter.removeOne(withOneEntity, TheGreatGatsby.id)

@@ -199,2 +199,26 @@ expect(withoutOne).toEqual({

it('Replaces an existing entity if you change the ID while updating', () => {
const withAdded = adapter.setAll(state, [
{ id: 'a', title: 'First' },
{ id: 'b', title: 'Second' },
{ id: 'c', title: 'Third' }
])
const withUpdated = adapter.updateOne(withAdded, {
id: 'b',
changes: {
id: 'c'
}
})
const { ids, entities } = withUpdated
expect(ids.length).toBe(2)
expect(entities.a).toBeTruthy()
expect(entities.b).not.toBeTruthy()
expect(entities.c).toBeTruthy()
expect(entities.c!.id).toBe('c')
expect(entities.c!.title).toBe('Second')
})
it('should not change ids state if you attempt to update an entity that does not impact sorting', () => {

@@ -201,0 +225,0 @@ const withAll = adapter.setAll(state, [

@@ -221,2 +221,36 @@ import { EntityStateAdapter, EntityState } from './models'

it("doesn't break when multiple renames of one item occur", () => {
const withA = adapter.addOne(state, { id: 'a', title: 'First' })
const withUpdates = adapter.updateMany(withA, [
{ id: 'a', changes: { id: 'b' } },
{ id: 'a', changes: { id: 'c' } }
])
const { ids, entities } = withUpdates
console.log(withUpdates)
/*
Original code failed with a mish-mash of values, like:
{
ids: [ 'c' ],
entities: { b: { id: 'b', title: 'First' }, c: { id: 'c' } }
}
We now expect that only 'c' will be left:
{
ids: [ 'c' ],
entities: { c: { id: 'c', title: 'First' } }
}
*/
expect(ids.length).toBe(1)
expect(ids).toEqual(['c'])
expect(entities.a).toBeFalsy()
expect(entities.b).toBeFalsy()
expect(entities.c).toBeTruthy()
})
it('should let you map over entities in the state', () => {

@@ -223,0 +257,0 @@ const firstChange = { ...TheGreatGatsby, title: 'First change' }

@@ -106,4 +106,19 @@ import {

updates = updates.filter(update => update.id in state.entities)
const updatesPerEntity: { [id: string]: Update<T> } = {}
updates.forEach(update => {
// Only apply updates to entities that currently exist
if (update.id in state.entities) {
// If there are multiple updates to one entity, merge them together
updatesPerEntity[update.id] = {
// Spreads ignore falsy values, so this works even if there isn't
// an existing update already at this key
...updatesPerEntity[update.id],
...update
}
}
})
updates = Object.values(updatesPerEntity)
const didMutateEntities = updates.length > 0

@@ -110,0 +125,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc