GoScrobble/web/node_modules/@reduxjs/toolkit/dist/query/rtk-query.umd.min.js

24 lines
49 KiB
JavaScript

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.RTK = {}));
}(this, (function (exports) { 'use strict';
exports.QueryStatus = void 0;var t,n,r,i=undefined&&undefined.__generator||function(e,t){var n,r,i,u,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function o(u){return function(o){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(6===u[0]&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a);}catch(e){u=[6,e],r=0;}finally{n=i=0;}if(5&u[0])throw u[1];return {value:u[0]?u[1]:void 0,done:!0}}([u,o])}}},u=undefined&&undefined.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},a=Object.defineProperty,o=Object.defineProperties,c=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,d=function(e,t,n){return t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},p=function(e,t){for(var n in t||(t={}))f.call(t,n)&&d(e,n,t[n]);if(s)for(var r=0,i=s(t);r<i.length;r++)l.call(t,n=i[r])&&d(e,n,t[n]);return e},v=function(e,t){return o(e,c(t))},h=function(e,t){var n={};for(var r in e)f.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var i=0,u=s(e);i<u.length;i++)t.indexOf(r=u[i])<0&&l.call(e,r)&&(n[r]=e[r]);return n},y=function(e,t,n){return new Promise((function(r,i){var u=function(e){try{o(n.next(e));}catch(e){i(e);}},a=function(e){try{o(n.throw(e));}catch(e){i(e);}},o=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(u,a)};o((n=n.apply(e,t)).next());}))};function m(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return "'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function g(e){return !!e&&!!e[re]}function b(e){return !!e&&(function(e){if(!e||"object"!=typeof e)return !1;var t=Object.getPrototypeOf(e);if(null===t)return !0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return "function"==typeof n&&Function.toString.call(n)===ie}(e)||Array.isArray(e)||!!e[ne]||!!e.constructor[ne]||S(e)||R(e))}function O(e,t,n){void 0===n&&(n=!1),0===w(e)?(n?Object.keys:ue)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e);})):e.forEach((function(n,r){return t(r,n,e)}));}function w(e){var t=e[re];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:S(e)?2:R(e)?3:0}function j(e,t){return 2===w(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function q(e,t){return 2===w(e)?e.get(t):e[t]}function A(e,t,n){var r=w(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n;}function P(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function S(e){return Y&&e instanceof Map}function R(e){return Z&&e instanceof Set}function T(e){return e.o||e.t}function E(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=ae(e);delete t[re];for(var n=ue(t),r=0;r<n.length;r++){var i=n[r],u=t[i];!1===u.writable&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(t[i]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[i]});}return Object.create(Object.getPrototypeOf(e),t)}function I(e,t){return void 0===t&&(t=!1),x(e)||g(e)||!b(e)||(w(e)>1&&(e.set=e.add=e.clear=e.delete=k),Object.freeze(e),t&&O(e,(function(e,t){return I(t,!0)}),!0)),e}function k(){m(2);}function x(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function C(e){var t=oe[e];return t||m(18,e),t}function D(e,t){oe[e]||(oe[e]=t);}function Q(){return r}function N(e,t){t&&(C("Patches"),e.u=[],e.s=[],e.v=t);}function M(e){_(e),e.p.forEach(K),e.p=null;}function _(e){e===r&&(r=e.l);}function F(e){return r={p:[],l:r,h:e,m:!0,_:0}}function K(e){var t=e[re];0===t.i||1===t.i?t.j():t.g=!0;}function z(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.O||C("ES5").S(t,e,r),r?(n[re].P&&(M(t),m(4)),b(e)&&(e=L(t,e),t.l||W(t,e)),t.u&&C("Patches").M(n[re],e,t.u,t.s)):e=L(t,n,[]),M(t),t.u&&t.v(t.u,t.s),e!==te?e:void 0}function L(e,t,n){if(x(t))return t;var r=t[re];if(!r)return O(t,(function(i,u){return U(e,r,t,i,u,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return W(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=4===r.i||5===r.i?r.o=E(r.k):r.o;O(3===r.i?new Set(i):i,(function(t,u){return U(e,r,i,t,u,n)})),W(e,i,!1),n&&e.u&&C("Patches").R(r,n,e.u,e.s);}return r.o}function U(e,t,n,r,i,u){if(g(i)){var a=L(e,i,u&&t&&3!==t.i&&!j(t.D,r)?u.concat(r):void 0);if(A(n,r,a),!g(a))return;e.m=!1;}if(b(i)&&!x(i)){if(!e.h.F&&e._<1)return;L(e,i),t&&t.A.l||W(e,i);}}function W(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&I(t,n);}function V(e,t){var n=e[re];return (n?T(n):e)[t]}function H(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n);}}function J(e){e.P||(e.P=!0,e.l&&J(e.l));}function B(e){e.o||(e.o=E(e.t));}function G(e,t,n){var r=S(t)?C("MapSet").N(t,n):R(t)?C("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:Q(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=r,u=ce;n&&(i=[r],u=se);var a=Proxy.revocable(i,u),o=a.revoke,c=a.proxy;return r.k=c,r.j=o,c}(t,n):C("ES5").J(t,n);return (n?n.A:Q()).p.push(r),r}function $(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return E(e)}(t=exports.QueryStatus||(exports.QueryStatus={})).uninitialized="uninitialized",t.pending="pending",t.fulfilled="fulfilled",t.rejected="rejected";var X="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Y="undefined"!=typeof Map,Z="undefined"!=typeof Set,ee="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,te=X?Symbol.for("immer-nothing"):((n={})["immer-nothing"]=!0,n),ne=X?Symbol.for("immer-draftable"):"__$immer_draftable",re=X?Symbol.for("immer-state"):"__$immer_state",ie=(""+Object.prototype.constructor),ue="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ae=Object.getOwnPropertyDescriptors||function(e){var t={};return ue(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n);})),t},oe={},ce={get:function(e,t){if(t===re)return e;var n,r,i,u=T(e);if(!j(u,t))return n=e,(i=H(u,t))?"value"in i?i.value:null===(r=i.get)||void 0===r?void 0:r.call(n.k):void 0;var a=u[t];return e.I||!b(a)?a:a===V(e.t,t)?(B(e),e.o[t]=G(e.A.h,a,e)):a},has:function(e,t){return t in T(e)},ownKeys:function(e){return Reflect.ownKeys(T(e))},set:function(e,t,n){var r=H(T(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=V(T(e),t),u=null==i?void 0:i[re];if(u&&u.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(P(n,i)&&(void 0!==n||j(e.t,t)))return !0;B(e),J(e);}return e.o[t]===n&&"number"!=typeof n||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==V(e.t,t)||t in e.t?(e.D[t]=!1,B(e),J(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=T(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){m(11);},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){m(12);}},se={};O(ce,(function(e,t){se[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)};})),se.deleteProperty=function(e,t){return ce.deleteProperty.call(this,e[0],t)},se.set=function(e,t,n){return ce.set.call(this,e[0],t,n,e[0])};var fe=new(function(){function e(e){var t=this;this.O=ee,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var i=n;n=e;var u=t;return function(e){var t=this;void 0===e&&(e=i);for(var r=arguments.length,a=Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return u.produce(e,(function(e){var r;return (r=n).call.apply(r,[t,e].concat(a))}))}}var a;if("function"!=typeof n&&m(6),void 0!==r&&"function"!=typeof r&&m(7),b(e)){var o=F(t),c=G(t,e,void 0),s=!0;try{a=n(c),s=!1;}finally{s?M(o):_(o);}return "undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return N(o,r),z(e,o)}),(function(e){throw M(o),e})):(N(o,r),z(a,o))}if(!e||"object"!=typeof e){if((a=n(e))===te)return;return void 0===a&&(a=e),t.F&&I(a,!0),a}m(21,e);},this.produceWithPatches=function(e,n){return "function"==typeof e?function(n){for(var r=arguments.length,i=Array(r>1?r-1:0),u=1;u<r;u++)i[u-1]=arguments[u];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(i))}))}:[t.produce(e,n,(function(e,t){r=e,i=t;})),r,i];var r,i;},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze);}var t=e.prototype;return t.createDraft=function(e){b(e)||m(8),g(e)&&(e=function(e){return g(e)||m(22,e),function e(t){if(!b(t))return t;var n,r=t[re],i=w(t);if(r){if(!r.P&&(r.i<4||!C("ES5").K(r)))return r.t;r.I=!0,n=$(t,i),r.I=!1;}else n=$(t,i);return O(n,(function(t,i){r&&q(r.t,t)===i||A(n,t,e(i));})),3===i?new Set(n):n}(e)}(e));var t=F(this),n=G(this,e,void 0);return n[re].C=!0,_(t),n},t.finishDraft=function(e,t){var n=(e&&e[re]).A;return N(n,t),z(void 0,n)},t.setAutoFreeze=function(e){this.F=e;},t.setUseProxies=function(e){e&&!ee&&m(20),this.O=e;},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}var i=C("Patches").$;return g(e)?i(e,t):this.produce(e,(function(e){return i(e,t.slice(n+1))}))},e}()),le=fe.produce,de=fe.produceWithPatches.bind(fe),pe=(fe.setAutoFreeze.bind(fe),fe.setUseProxies.bind(fe),fe.applyPatches.bind(fe)),ve=(fe.createDraft.bind(fe),fe.finishDraft.bind(fe),le);function he(e){return "Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var ye=function(){return Math.random().toString(36).substring(7).split("").join(".")},me={INIT:"@@redux/INIT"+ye(),REPLACE:"@@redux/REPLACE"+ye(),PROBE_UNKNOWN_ACTION:function(){return "@@redux/PROBE_UNKNOWN_ACTION"+ye()}};function ge(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];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 be(e,t){return e===t}function Oe(e,t,n){if(null===t||null===n||t.length!==n.length)return !1;for(var r=t.length,i=0;i<r;i++)if(!e(t[i],n[i]))return !1;return !0}function we(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return "function"==typeof e}))){var n=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: ["+n+"]")}return t}var je=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];var u=0,a=r.pop(),o=we(r),c=e.apply(void 0,[function(){return u++,a.apply(null,arguments)}].concat(n)),s=e((function(){for(var e=[],t=o.length,n=0;n<t;n++)e.push(o[n].apply(null,arguments));return c.apply(null,e)}));return s.resultFunc=a,s.dependencies=o,s.recomputations=function(){return u},s.resetRecomputations=function(){return u=0},s}}((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:be,n=null,r=null;return function(){return Oe(t,n,arguments)||(r=e.apply(null,arguments)),n=arguments,r}}));function qe(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 Ae(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var i=t.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return p(p({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return {type:e,payload:n[0]}}return n.toString=function(){return ""+e},n.type=e,n.match=function(t){return t.type===e},n}function Pe(e){var t,n={},r=[],i={addCase:function(e,t){var r="string"==typeof e?e:e.type;if(r in n)throw new Error("addCase cannot be called with two reducers for the same action type");return n[r]=t,i},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),i},addDefaultCase:function(e){return t=e,i}};return e(i),[n,r,t]}function Se(e){var t=e.name,n=e.initialState;if(!t)throw new Error("`name` is a required option for createSlice");var r=e.reducers||{},i="function"==typeof e.extraReducers?Pe(e.extraReducers):[e.extraReducers],a=i[0],o=void 0===a?{}:a,c=i[1],s=void 0===c?[]:c,f=i[2],l=void 0===f?void 0:f,d=Object.keys(r),v={},h={},y={};d.forEach((function(e){var n,i,u=r[e],a=t+"/"+e;"reducer"in u?(n=u.reducer,i=u.prepare):n=u,v[e]=n,h[a]=n,y[e]=i?Ae(a,i):Ae(a);}));var m=function(e,t,n,r){void 0===n&&(n=[]);var i="function"==typeof t?Pe(t):[t,n,r],a=i[0],o=i[1],c=i[2],s=ve(e,(function(){}));return function(e,t){void 0===e&&(e=s);var n=u([a[t.type]],o.filter((function(e){return (0, e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return !!e})).length&&(n=[c]),n.reduce((function(e,n){if(n){var r;if(g(e))return void 0===(r=n(e,t))?e:r;if(b(e))return ve(e,(function(e){return n(e,t)}));if(void 0===(r=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}}(n,p(p({},o),h),s,l);return {name:t,reducer:m,actions:y,caseReducers:v}}var Re=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},Te=["name","message","stack","code"],Ee=function(e,t){this.payload=e,this.meta=t;},Ie=function(e,t){this.payload=e,this.meta=t;},ke=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=Te;n<r.length;n++){var i=r[n];"string"==typeof e[i]&&(t[i]=e[i]);}return t}return {message:String(e)}};function xe(e,t,n){var r=Ae(e+"/fulfilled",(function(e,t,n,r){return {payload:e,meta:v(p({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),u=Ae(e+"/pending",(function(e,t,n){return {payload:void 0,meta:v(p({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),a=Ae(e+"/rejected",(function(e,t,r,i,u){return {payload:i,error:(n&&n.serializeError||ke)(e||"Rejected"),meta:v(p({},u||{}),{arg:r,requestId:t,rejectedWithValue:!!i,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),o="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return !1},onabort:function(){},removeEventListener:function(){}};}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(c,s,f){var l,d,p=(null!=(l=null==n?void 0:n.idGenerator)?l:Re)(),v=new o,h=new Promise((function(e,t){return v.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:d||"Aborted"})}))})),m=!1,g=function(){return y(this,null,(function(){var o,l,d;return i(this,(function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),n&&n.condition&&!1===n.condition(e,{getState:s,extra:f}))throw {name:"ConditionError",message:"Aborted due to condition callback returning false."};return m=!0,c(u(p,e,null==(o=null==n?void 0:n.getPendingMeta)?void 0:o.call(n,{requestId:p,arg:e},{getState:s,extra:f}))),[4,Promise.race([h,Promise.resolve(t(e,{dispatch:c,getState:s,extra:f,requestId:p,signal:v.signal,rejectWithValue:function(e,t){return new Ee(e,t)},fulfillWithValue:function(e,t){return new Ie(e,t)}})).then((function(t){if(t instanceof Ee)throw t;return t instanceof Ie?r(t.payload,p,e,t.meta):r(t,p,e)}))])];case 1:return l=i.sent(),[3,3];case 2:return d=i.sent(),l=d instanceof Ee?a(null,p,e,d.payload,d.meta):a(d,p,e),[3,3];case 3:return n&&!n.dispatchConditionRejection&&a.match(l)&&l.meta.condition||c(l),[2,l]}}))}))}();return Object.assign(g,{abort:function(e){m&&(d=e,v.abort());},requestId:p,arg:e,unwrap:function(){return g.then(Ce)}})}}),{pending:u,rejected:a,fulfilled:r,typePrefix:e})}function Ce(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var De=function(e,t){return (n=e)&&"function"==typeof n.match?e.match(t):e(t);var n;};function Qe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.some((function(e){return De(e,t)}))}}function Ne(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.every((function(e){return De(e,t)}))}}function Me(e,t){if(!e||!e.meta)return !1;var n="string"==typeof e.meta.requestId,r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function _e(e){return "function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Fe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return Me(e,["pending"])}:_e(e)?function(t){var n=e.map((function(e){return e.pending}));return Qe.apply(void 0,n)(t)}:Fe()(e[0])}function Ke(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return Me(e,["rejected"])}:_e(e)?function(t){var n=e.map((function(e){return e.rejected}));return Qe.apply(void 0,n)(t)}:Ke()(e[0])}function ze(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return e&&e.meta&&e.meta.rejectedWithValue};return 0===e.length||_e(e)?function(t){return Ne(Ke.apply(void 0,e),n)(t)}:ze()(e[0])}function Le(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return Me(e,["fulfilled"])}:_e(e)?function(t){var n=e.map((function(e){return e.fulfilled}));return Qe.apply(void 0,n)(t)}:Le()(e[0])}function Ue(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?function(e){return Me(e,["pending","fulfilled","rejected"])}:_e(e)?function(t){for(var n=[],r=0,i=e;r<i.length;r++){var u=i[r];n.push(u.pending,u.rejected,u.fulfilled);}return Qe.apply(void 0,n)(t)}:Ue()(e[0])}!function(){function e(e,t){var n=i[e];return n?n.enumerable=t:i[e]=n={configurable:!0,enumerable:t,get:function(){return ce.get(this[re],e)},set:function(t){ce.set(this[re],e,t);}},n}function t(e){for(var t=e.length-1;t>=0;t--){var i=e[t][re];if(!i.P)switch(i.i){case 5:r(i)&&J(i);break;case 4:n(i)&&J(i);}}}function n(e){for(var t=e.t,n=e.k,r=ue(n),i=r.length-1;i>=0;i--){var u=r[i];if(u!==re){var a=t[u];if(void 0===a&&!j(t,u))return !0;var o=n[u],c=o&&o[re];if(c?c.t!==a:!P(o,a))return !0}}var s=!!t[re];return r.length!==ue(t).length+(s?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return !0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);return !(!n||n.get)}var i={};D("ES5",{J:function(t,n){var r=Array.isArray(t),i=function(t,n){if(t){for(var r=Array(n.length),i=0;i<n.length;i++)Object.defineProperty(r,""+i,e(i,!0));return r}var u=ae(n);delete u[re];for(var a=ue(u),o=0;o<a.length;o++){var c=a[o];u[c]=e(c,t||!!u[c].enumerable);}return Object.create(Object.getPrototypeOf(n),u)}(r,t),u={i:r?5:4,A:n?n.A:Q(),P:!1,I:!1,D:{},l:n,t:t,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,re,{value:u,writable:!0}),i},S:function(e,n,i){i?g(n)&&n[re].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[re];if(n){var i=n.t,u=n.k,a=n.D,o=n.i;if(4===o)O(u,(function(t){t!==re&&(void 0!==i[t]||j(i,t)?a[t]||e(u[t]):(a[t]=!0,J(n)));})),O(i,(function(e){void 0!==u[e]||j(u,e)||(a[e]=!1,J(n));}));else if(5===o){if(r(n)&&(J(n),a.length=!0),u.length<i.length)for(var c=u.length;c<i.length;c++)a[c]=!1;else for(var s=i.length;s<u.length;s++)a[s]=!0;for(var f=Math.min(u.length,i.length),l=0;l<f;l++)void 0===a[l]&&e(u[l]);}}}}(e.p[0]),t(e.p));},K:function(e){return 4===e.i?n(e):r(e)}});}();var We=qe;function Ve(e,t){if(e===t||!(We(e)&&We(t)||Array.isArray(e)&&Array.isArray(t)))return t;for(var n=Object.keys(t),r=Object.keys(e),i=n.length===r.length,u=Array.isArray(t)?[]:{},a=0,o=n;a<o.length;a++){var c=o[a];u[c]=Ve(e[c],t[c]),i&&(i=e[c]===u[c]);}return i?e:u}var He=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},Je=function(e){return e.status>=200&&e.status<=299},Be=function(e,t){return y(void 0,null,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return "function"==typeof t?[2,t(e)]:"text"===t?[2,e.text()]:"json"!==t?[3,2]:[4,e.text()];case 1:return [2,(n=r.sent()).length?JSON.parse(n):void 0];case 2:return [2]}}))}))};function Ge(e){if(!qe(e))return e;for(var t=p({},e),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n];void 0===i[1]&&delete t[i[0]];}return t}function $e(e){var t=this;void 0===e&&(e={});var n=e.baseUrl,r=e.prepareHeaders,u=void 0===r?function(e){return e}:r,a=e.fetchFn,o=void 0===a?He:a,c=h(e,["baseUrl","prepareHeaders","fetchFn"]);return "undefined"==typeof fetch&&o===He&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(e,r){return y(t,[e,r],(function(e,t){var r,a,s,f,l,d,y,m,g,b,O,w,j,q,A,P,S,R,T,E,I,k,x,C,D,Q,N,M,_,F,K=t.signal,z=t.getState;return i(this,(function(t){switch(t.label){case 0:return s=(a="string"==typeof e?{url:e}:e).url,l=void 0===(f=a.method)?"GET":f,y=void 0===(d=a.headers)?new Headers({}):d,g=void 0===(m=a.body)?void 0:m,O=void 0===(b=a.params)?void 0:b,j=void 0===(w=a.responseHandler)?"json":w,A=void 0===(q=a.validateStatus)?Je:q,P=h(a,["url","method","headers","body","params","responseHandler","validateStatus"]),S=p(v(p({},c),{method:l,signal:K,body:g}),P),R=S,[4,u(new Headers(Ge(y)),{getState:z})];case 1:R.headers=t.sent(),T=function(e){return "object"==typeof e&&(qe(e)||Array.isArray(e)||"function"==typeof e.toJSON)},!S.headers.has("content-type")&&T(g)&&S.headers.set("content-type","application/json"),g&&function(e){var t,n;return null==(n=null==(t=e.get("content-type"))?void 0:t.trim())?void 0:n.startsWith("application/json")}(S.headers)&&(S.body=JSON.stringify(g)),O&&(E=~s.indexOf("?")?"&":"?",I=new URLSearchParams(Ge(O)),s+=E+I),s=function(e,t){return e?t?function(e){return new RegExp("(^|:)//").test(e)}(t)?t:(e=function(e){return e.replace(/\/$/,"")}(e))+"/"+(t=function(e){return e.replace(/^\//,"")}(t)):e:t}(n,s),k=new Request(s,S),x=k.clone(),r={request:x},t.label=2;case 2:return t.trys.push([2,4,,5]),[4,o(k)];case 3:return C=t.sent(),[3,5];case 4:return D=t.sent(),[2,{error:{status:"FETCH_ERROR",error:String(D)},meta:r}];case 5:Q=C.clone(),r.response=Q,t.label=6;case 6:return t.trys.push([6,8,,10]),[4,Be(C,j)];case 7:return N=t.sent(),[3,10];case 8:return M=t.sent(),_={},F={status:"PARSING_ERROR",originalStatus:C.status},[4,Q.clone().text()];case 9:return [2,(_.error=(F.data=t.sent(),F.error=String(M),F),_.meta=r,_)];case 10:return [2,A(C,N)?{data:N,meta:r}:{error:{status:C.status,data:N},meta:r}]}}))}))}}var Xe=function(e,t){void 0===t&&(t=void 0),this.value=e,this.meta=t;};function Ye(e,t){return void 0===e&&(e=0),void 0===t&&(t=5),y(this,null,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return n=Math.min(e,t),r=~~((Math.random()+.4)*(300<<n)),[4,new Promise((function(e){return setTimeout((function(t){return e(t)}),r)}))];case 1:return i.sent(),[2]}}))}))}var Ze=Object.assign((function(e,t){return function(n,r,u){return y(void 0,null,(function(){var a,o,c,s;return i(this,(function(i){switch(i.label){case 0:a=p(p({maxRetries:5,backoff:Ye},t),u),o=0,i.label=1;case 1:i.label=2;case 2:return i.trys.push([2,4,,6]),[4,e(n,r,u)];case 3:if((c=i.sent()).error)throw new Xe(c);return [2,c];case 4:if(s=i.sent(),o++,s.throwImmediately||o>a.maxRetries){if(s instanceof Xe)return [2,s.value];throw s}return [4,a.backoff(o,a.maxRetries)];case 5:return i.sent(),[3,6];case 6:return [3,1];case 7:return [2]}}))}))}}),{fail:function(e){throw Object.assign(new Xe({error:e}),{throwImmediately:!0})}}),et=Ae("__rtkq/focused"),tt=Ae("__rtkq/unfocused"),nt=Ae("__rtkq/online"),rt=Ae("__rtkq/offline"),it=!1;function ut(e,t){return t?t(e,{onFocus:et,onFocusLost:tt,onOffline:rt,onOnline:nt}):(n=function(){return e(et())},r=function(){return e(nt())},i=function(){return e(rt())},u=function(){"visible"===window.document.visibilityState?n():e(tt());},it||"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("visibilitychange",u,!1),window.addEventListener("focus",n,!1),window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),it=!0),function(){window.removeEventListener("focus",n),window.removeEventListener("visibilitychange",u),window.removeEventListener("online",r),window.removeEventListener("offline",i),it=!1;});var n,r,i,u;}var at,ot,ct=Symbol.for("RTKQ/skipToken"),st=ct,ft={status:exports.QueryStatus.uninitialized},lt=ve(ft,(function(){})),dt=ve(ft,(function(){})),pt=function(e){return e.endpointName+"("+JSON.stringify(e.queryArgs,(function(e,t){return qe(t)?Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{}):t}))+")"};function vt(e,t,n,r,i){return "function"==typeof e?e(t,n,r).map(ht).map(i):Array.isArray(e)?e.map(ht).map(i):[]}function ht(e){return "string"==typeof e?{type:e}:e}function yt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n=v(p({reducerPath:"api",serializeQueryArgs:pt,keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},t),{tagTypes:u([],t.tagTypes||[])}),r={endpointDefinitions:{},batch:function(e){e();},apiUid:Re()},i={injectEndpoints:function(e){for(var t=e.endpoints({query:function(e){return v(p({},e),{type:at.query})},mutation:function(e){return v(p({},e),{type:at.mutation})}}),n=0,u=Object.entries(t);n<u.length;n++){var o=u[n],c=o[0],s=o[1];if(e.overrideExisting||!(c in r.endpointDefinitions)){r.endpointDefinitions[c]=s;for(var f=0,l=a;f<l.length;f++)l[f].injectEndpoint(c,s);}}return i},enhanceEndpoints:function(e){var t=e.addTagTypes,u=e.endpoints;if(t)for(var a=0,o=t;a<o.length;a++){var c=o[a];n.tagTypes.includes(c)||n.tagTypes.push(c);}if(u)for(var s=0,f=Object.entries(u);s<f.length;s++){var l=f[s],d=l[0],p=l[1];"function"==typeof p&&p(r.endpointDefinitions[d]),Object.assign(r.endpointDefinitions[d]||{},p);}return i}},a=e.map((function(e){return e.init(i,n,r)}));return i.injectEndpoints({endpoints:t.endpoints})}}function mt(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}function gt(e){return e}function bt(e,t,n,r){return vt(n[e.meta.arg.endpointName][t],Le(e)?e.payload:void 0,ze(e)?e.payload:void 0,e.meta.arg.originalArgs,r)}function Ot(e,t,n){var r=e[t];r&&n(r);}function wt(e,t,n){var r=e[t.requestId];r&&n(r);}(ot=at||(at={})).query="query",ot.mutation="mutation";var jt={},qt=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=n.internalActions,u=i.removeQueryResult,a=i.unsubscribeQueryResult;return function(e){var i={};return function(o){return function(c){var s,f,l=o(c);if(a.match(c)){var d=e.getState()[t],p=c.payload.queryCacheKey,v=r.endpointDefinitions[null==(s=d.queries[p])?void 0:s.endpointName];!function(e,n,r){var a=i[e];a&&clearTimeout(a),i[e]=setTimeout((function(){var r=n.getState()[t].subscriptions[e];r&&0!==Object.keys(r).length||n.dispatch(u({queryCacheKey:e})),delete i[e];}),1e3*r);}(p,e,null!=(f=null==v?void 0:v.keepUnusedDataFor)?f:d.config.keepUnusedDataFor);}if(n.util.resetApiState.match(c))for(var h=0,y=Object.entries(i);h<y.length;h++){var m=y[h],g=m[0],b=m[1];b&&clearTimeout(b),delete i[g];}return l}}}},At=function(t){var n=t.reducerPath,r=t.context,i=t.context.endpointDefinitions,u=t.mutationThunk,a=t.api,o=t.assertTagType,c=t.refetchQuery,s=a.internalActions.removeQueryResult;return function(e){return function(t){return function(n){var r=t(n);return Qe(Le(u),ze(u))(n)&&f(bt(n,"invalidatesTags",i,o),e),a.util.invalidateTags.match(n)&&f(vt(n.payload,void 0,void 0,void 0,o),e),r}}};function f(t,i){for(var u,a,o=i.getState()[n],f=new Set,l=0,d=t;l<d.length;l++){var p=d[l],v=o.provided[p.type];if(v)for(var h=0,y=null!=(u=void 0!==p.id?v[p.id]:(a=Object.values(v),[].concat.apply([],a)))?u:[];h<y.length;h++)f.add(y[h]);}r.batch((function(){for(var t=0,n=Array.from(f.values());t<n.length;t++){var r=n[t],u=o.queries[r],a=o.subscriptions[r];u&&a&&(0===Object.keys(a).length?i.dispatch(s({queryCacheKey:r})):u.status!==exports.QueryStatus.uninitialized&&i.dispatch(c(u,r)));}}));}},Pt=function(t){var n=t.reducerPath,r=t.queryThunk,i=t.api,u=t.refetchQuery;return function(t){var o={};return function(e){return function(n){var u=e(n);return i.internalActions.updateSubscriptionOptions.match(n)&&s(n.payload,t),(r.pending.match(n)||r.rejected.match(n)&&n.meta.condition)&&s(n.meta.arg,t),(r.fulfilled.match(n)||r.rejected.match(n)&&!n.meta.condition)&&c(n.meta.arg,t),i.util.resetApiState.match(n)&&function(){for(var e=0,t=Object.entries(o);e<t.length;e++){var n=t[e],r=n[0],i=n[1];(null==i?void 0:i.timeout)&&clearTimeout(i.timeout),delete o[r];}}(),u}};function c(t,r){var i=t.queryCacheKey,c=r.getState()[n],s=c.queries[i];if(s&&s.status!==exports.QueryStatus.uninitialized){var f=a(c.subscriptions[i]);if(Number.isFinite(f)){var l=o[i];(null==l?void 0:l.timeout)&&(clearTimeout(l.timeout),l.timeout=void 0);var d=Date.now()+f,p=o[i]={nextPollTimestamp:d,pollingInterval:f,timeout:setTimeout((function(){p.timeout=void 0,r.dispatch(u(s,i));}),f)};}}}function s(t,r){var i=t.queryCacheKey,u=r.getState()[n],s=u.queries[i];if(s&&s.status!==exports.QueryStatus.uninitialized){var f=a(u.subscriptions[i]),l=o[i];if(!Number.isFinite(f))return (null==l?void 0:l.timeout)&&clearTimeout(l.timeout),void delete o[i];var d=Date.now()+f;(!l||d<l.nextPollTimestamp)&&c({queryCacheKey:i},r);}}};function a(e){void 0===e&&(e={});for(var t=Number.POSITIVE_INFINITY,n=0,r=Object.values(e);n<r.length;n++){var i=r[n];i.pollingInterval&&(t=Math.min(i.pollingInterval,t));}return t}},St=function(t){var n=t.reducerPath,r=t.context,i=t.refetchQuery;return function(e){return function(t){return function(n){var r=t(n);return et.match(n)&&u(e,"refetchOnFocus"),nt.match(n)&&u(e,"refetchOnReconnect"),r}}};function u(t,u){var a=t.getState()[n],o=a.queries,c=a.subscriptions;r.batch((function(){for(var n=0,r=Object.keys(c);n<r.length;n++){var s=r[n],f=o[s],l=c[s];if(!l||!f||f.status===exports.QueryStatus.uninitialized)return;(Object.values(l).some((function(e){return !0===e[u]}))||Object.values(l).every((function(e){return void 0===e[u]}))&&a.config[u])&&t.dispatch(i(f,s));}}));}},Rt=new Error("Promise never resolved before cacheEntryRemoved."),Tt=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,u=e.mutationThunk,a=Ue(i),o=Ue(u),c=Le(i,u);return function(e){var s={};return function(r){return function(l){var d=e.getState(),p=r(l),v=function(e){return a(e)?e.meta.arg.queryCacheKey:o(e)?e.meta.requestId:t.internalActions.removeQueryResult.match(e)?e.payload.queryCacheKey:t.internalActions.unsubscribeMutationResult.match(e)?e.payload.requestId:""}(l);if(i.pending.match(l)){var h=d[n].queries[v],y=e.getState()[n].queries[v];!h&&y&&f(l.meta.arg.endpointName,l.meta.arg.originalArgs,v,e,l.meta.requestId);}else if(u.pending.match(l))(y=e.getState()[n].mutations[v])&&f(l.meta.arg.endpointName,l.meta.arg.originalArgs,v,e,l.meta.requestId);else if(c(l))(null==(O=s[v])?void 0:O.valueResolved)&&(O.valueResolved({data:l.payload,meta:l.meta.baseQueryMeta}),delete O.valueResolved);else if(t.internalActions.removeQueryResult.match(l)||t.internalActions.unsubscribeMutationResult.match(l))(O=s[v])&&(delete s[v],O.cacheEntryRemoved());else if(t.util.resetApiState.match(l))for(var m=0,g=Object.entries(s);m<g.length;m++){var b=g[m],O=b[1];delete s[b[0]],O.cacheEntryRemoved();}return p}};function f(e,n,i,u,a){var o=r.endpointDefinitions[e],c=null==o?void 0:o.onCacheEntryAdded;if(c){var f={},l=new Promise((function(e){f.cacheEntryRemoved=e;})),d=Promise.race([new Promise((function(e){f.valueResolved=e;})),l.then((function(){throw Rt}))]);d.catch((function(){})),s[i]=f;var h=t.endpoints[e].select(o.type===at.query?n:i),y=u.dispatch((function(e,t,n){return n})),m=v(p({},u),{getCacheEntry:function(){return h(u.getState())},requestId:a,extra:y,updateCachedData:o.type===at.query?function(r){return u.dispatch(t.util.updateQueryData(e,n,r))}:void 0,cacheDataLoaded:d,cacheEntryRemoved:l}),g=c(n,m);Promise.resolve(g).catch((function(e){if(e!==Rt)throw e}));}}}},Et=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,u=Fe(r,i),a=Ke(r,i),o=Le(r,i);return function(e){var r={};return function(i){return function(c){var s,f,l,d=i(c);if(u(c)){var h=c.meta,y=h.requestId,m=h.arg,g=m.endpointName,b=m.originalArgs,O=n.endpointDefinitions[g],w=null==O?void 0:O.onQueryStarted;if(w){var j={},q=new Promise((function(e,t){j.resolve=e,j.reject=t;}));q.catch((function(){})),r[y]=j;var A=t.endpoints[g].select(O.type===at.query?b:y),P=e.dispatch((function(e,t,n){return n})),S=v(p({},e),{getCacheEntry:function(){return A(e.getState())},requestId:y,extra:P,updateCachedData:O.type===at.query?function(n){return e.dispatch(t.util.updateQueryData(g,b,n))}:void 0,queryFulfilled:q});w(b,S);}}else if(o(c)){var R=c.meta,T=R.baseQueryMeta;null==(s=r[y=R.requestId])||s.resolve({data:c.payload,meta:T}),delete r[y];}else if(a(c)){var E=c.meta;T=E.baseQueryMeta,null==(l=r[y=E.requestId])||l.reject({error:null!=(f=c.payload)?f:c.error,isUnhandledError:!E.rejectedWithValue,meta:T}),delete r[y];}return d}}}},It=function(e){var t=e.api,n=e.context.apiUid;return function(e){var r=!1;return function(i){return function(u){r||(r=!0,e.dispatch(t.internalActions.middlewareRegistered(n)));var a=i(u);return t.util.resetApiState.match(u)&&e.dispatch(t.internalActions.middlewareRegistered(n)),a}}}};function kt(e){var t=e.reducerPath,n=e.queryThunk,r={invalidateTags:Ae(t+"/invalidateTags")},i=[It,qt,At,Pt,St,Tt,Et].map((function(t){return t(v(p({},e),{refetchQuery:u}))}));return {middleware:function(e){return function(n){var r=ge.apply(void 0,i.map((function(t){return t(e)})))(n);return function(i){return e.getState()[t]?r(i):n(i)}}},actions:r};function u(e,t,r){return void 0===r&&(r={}),n(p({endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t},r))}}function xt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,u([e],t));}var Ct=Symbol(),Dt=function(){return {name:Ct,init:function(t,n,r){var u=n.baseQuery,a=n.reducerPath,o=n.serializeQueryArgs,c=n.keepUnusedDataFor,s=n.refetchOnMountOrArgChange,f=n.refetchOnFocus,l=n.refetchOnReconnect;!function(){function e(t){if(!b(t))return t;if(Array.isArray(t))return t.map(e);if(S(t))return new Map(Array.from(t.entries()).map((function(t){return [t[0],e(t[1])]})));if(R(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return j(t,ne)&&(n[ne]=t[ne]),n}function t(t){return g(t)?e(t):t}var n="add";D("Patches",{$:function(t,r){return r.forEach((function(r){for(var i=r.path,u=r.op,a=t,o=0;o<i.length-1;o++){var c=w(a),s=i[o];0!==c&&1!==c||"__proto__"!==s&&"constructor"!==s||m(24),"function"==typeof a&&"prototype"===s&&m(24),"object"!=typeof(a=q(a,s))&&m(15,i.join("/"));}var f=w(a),l=e(r.value),d=i[i.length-1];switch(u){case"replace":switch(f){case 2:return a.set(d,l);case 3:m(16);default:return a[d]=l}case n:switch(f){case 1:return a.splice(d,0,l);case 2:return a.set(d,l);case 3:return a.add(l);default:return a[d]=l}case"remove":switch(f){case 1:return a.splice(d,1);case 2:return a.delete(d);case 3:return a.delete(r.value);default:return delete a[d]}default:m(17,u);}})),t},R:function(e,r,i,u){switch(e.i){case 0:case 4:case 2:return o=r,c=i,s=u,f=(a=e).t,l=a.o,void O(a.D,(function(e,r){var i=q(f,e),u=q(l,e),a=r?j(f,e)?"replace":n:"remove";if(i!==u||"replace"!==a){var d=o.concat(e);c.push("remove"===a?{op:a,path:d}:{op:a,path:d,value:u}),s.push(a===n?{op:"remove",path:d}:"remove"===a?{op:n,path:d,value:t(i)}:{op:"replace",path:d,value:t(i)});}}));case 5:case 1:return function(e,r,i,u){var a=e.t,o=e.D,c=e.o;if(c.length<a.length){var s=[c,a];a=s[0],c=s[1];var f=[u,i];i=f[0],u=f[1];}for(var l=0;l<a.length;l++)if(o[l]&&c[l]!==a[l]){var d=r.concat([l]);i.push({op:"replace",path:d,value:t(c[l])}),u.push({op:"replace",path:d,value:t(a[l])});}for(var p=a.length;p<c.length;p++){var v=r.concat([p]);i.push({op:n,path:v,value:t(c[p])});}a.length<c.length&&u.push({op:"replace",path:r.concat(["length"]),value:a.length});}(e,r,i,u);case 3:return function(e,t,r,i){var u=e.t,a=e.o,o=0;u.forEach((function(e){if(!a.has(e)){var u=t.concat([o]);r.push({op:"remove",path:u,value:e}),i.unshift({op:n,path:u,value:e});}o++;})),o=0,a.forEach((function(e){if(!u.has(e)){var a=t.concat([o]);r.push({op:n,path:a,value:e}),i.unshift({op:"remove",path:a,value:e});}o++;}));}(e,r,i,u)}var a,o,c,s,f,l;},M:function(e,t,n,r){n.push({op:"replace",path:[],value:t}),r.push({op:"replace",path:[],value:e.t});}});}();var d=function(e){return e};Object.assign(t,{reducerPath:a,endpoints:{},internalActions:{onOnline:nt,onOffline:rt,onFocus:et,onFocusLost:tt},util:{}});var h=function(t){var n=this,r=t.reducerPath,u=t.baseQuery,a=t.context.endpointDefinitions,o=t.serializeQueryArgs,c=t.api,s=function(e,t){return y(n,[e,t],(function(e,t){var n,r,o,c,s,f,l=t.signal,d=t.rejectWithValue,p=t.fulfillWithValue,v=t.dispatch,h=t.getState;return i(this,(function(t){switch(t.label){case 0:n=a[e.endpointName],t.label=1;case 1:return t.trys.push([1,7,,8]),r=gt,o=void 0,c={signal:l,dispatch:v,getState:h},n.query?[4,u(n.query(e.originalArgs),c,n.extraOptions)]:[3,3];case 2:return o=t.sent(),n.transformResponse&&(r=n.transformResponse),[3,5];case 3:return [4,n.queryFn(e.originalArgs,c,n.extraOptions,(function(e){return u(e,c,n.extraOptions)}))];case 4:o=t.sent(),t.label=5;case 5:if(o.error)throw new Xe(o.error,o.meta);return s=p,[4,r(o.data,o.meta)];case 6:return [2,s.apply(void 0,[t.sent(),{fulfilledTimeStamp:Date.now(),baseQueryMeta:o.meta}])];case 7:if((f=t.sent())instanceof Xe)return [2,d(f.value,{baseQueryMeta:f.meta})];throw console.error(f),f;case 8:return [2]}}))}))};function f(e){return function(t){var n,r;return (null==(r=null==(n=null==t?void 0:t.meta)?void 0:n.arg)?void 0:r.endpointName)===e}}return {queryThunk:xe(r+"/executeQuery",s,{getPendingMeta:function(){return {startedTimeStamp:Date.now()}},condition:function(e,t){var n,i,u=(0, t.getState)()[r],a=null==(n=null==u?void 0:u.queries)?void 0:n[e.queryCacheKey],o=null==a?void 0:a.fulfilledTimeStamp,c=null!=(i=e.forceRefetch)?i:e.subscribe&&u.config.refetchOnMountOrArgChange;return "pending"!==(null==a?void 0:a.status)&&(!o||!!c&&(!0===c||(Number(new Date)-Number(o))/1e3>=c))},dispatchConditionRejection:!0}),mutationThunk:xe(r+"/executeMutation",s,{getPendingMeta:function(){return {startedTimeStamp:Date.now()}}}),prefetch:function(e,t,n){return function(r,i){var u=function(e){return "force"in e}(n)&&n.force,a=function(e){return "ifOlderThan"in e}(n)&&n.ifOlderThan,o=function(n){return void 0===n&&(n=!0),c.endpoints[e].initiate(t,{forceRefetch:n})},s=c.endpoints[e].select(t)(i());if(u)r(o());else if(a){var f=null==s?void 0:s.fulfilledTimeStamp;if(!f)return void r(o());(Number(new Date)-Number(new Date(f)))/1e3>=a&&r(o());}else r(o(!1));}},updateQueryData:function(t,n,r){return function(i,u){var a,o,s=c.endpoints[t].select(n)(u()),f={patches:[],inversePatches:[],undo:function(){return i(c.util.patchQueryData(t,n,f.inversePatches))}};if(s.status===exports.QueryStatus.uninitialized)return f;if("data"in s)if(b(s.data)){var l=de(s.data,r),d=l[2];(a=f.patches).push.apply(a,l[1]),(o=f.inversePatches).push.apply(o,d);}else {var p=r(s.data);f.patches.push({op:"replace",path:[],value:p}),f.inversePatches.push({op:"replace",path:[],value:s.data});}return i(c.util.patchQueryData(t,n,f.patches)),f}},patchQueryData:function(e,t,n){return function(r){r(c.internalActions.queryResultPatched({queryCacheKey:o({queryArgs:t,endpointDefinition:a[e],endpointName:e}),patches:n}));}},buildMatchThunkActions:function(e,t){return {matchPending:Ne(Fe(e),f(t)),matchFulfilled:Ne(Le(e),f(t)),matchRejected:Ne(Ke(e),f(t))}}}}({baseQuery:u,reducerPath:a,context:r,api:t,serializeQueryArgs:o}),A=h.queryThunk,P=h.mutationThunk,T=h.patchQueryData,E=h.updateQueryData,I=h.prefetch,k=h.buildMatchThunkActions,x=function(t){var n=t.reducerPath,r=t.queryThunk,i=t.mutationThunk,u=t.context,a=u.endpointDefinitions,o=u.apiUid,c=t.assertTagType,s=t.config,f=Ae(n+"/resetApiState"),l=Se({name:n+"/queries",initialState:jt,reducers:{removeQueryResult:function(e,t){delete e[t.payload.queryCacheKey];},queryResultPatched:function(e,t){var n=t.payload,r=n.patches;Ot(e,n.queryCacheKey,(function(e){e.data=pe(e.data,r.concat());}));}},extraReducers:function(t){t.addCase(r.pending,(function(t,n){var r,i=n.meta,u=n.meta.arg;u.subscribe&&(null!=t[r=u.queryCacheKey]||(t[r]={status:exports.QueryStatus.uninitialized,endpointName:u.endpointName})),Ot(t,u.queryCacheKey,(function(t){t.status=exports.QueryStatus.pending,t.requestId=i.requestId,t.originalArgs=u.originalArgs,t.startedTimeStamp=i.startedTimeStamp;}));})).addCase(r.fulfilled,(function(t,n){var r=n.meta,i=n.payload;Ot(t,r.arg.queryCacheKey,(function(t){t.requestId===r.requestId&&(t.status=exports.QueryStatus.fulfilled,t.data=Ve(t.data,i),delete t.error,t.fulfilledTimeStamp=r.fulfilledTimeStamp);}));})).addCase(r.rejected,(function(t,n){var r=n.meta,i=r.condition,u=r.requestId,a=n.error,o=n.payload;Ot(t,r.arg.queryCacheKey,(function(t){if(i);else {if(t.requestId!==u)return;t.status=exports.QueryStatus.rejected,t.error=null!=o?o:a;}}));}));}}),d=Se({name:n+"/mutations",initialState:jt,reducers:{unsubscribeMutationResult:function(e,t){t.payload.requestId in e&&delete e[t.payload.requestId];}},extraReducers:function(t){t.addCase(i.pending,(function(t,n){var r=n.meta,i=r.arg;i.track&&(t[r.requestId]={status:exports.QueryStatus.pending,endpointName:i.endpointName,startedTimeStamp:r.startedTimeStamp});})).addCase(i.fulfilled,(function(t,n){var r=n.payload,i=n.meta;i.arg.track&&wt(t,{requestId:n.meta.requestId},(function(t){t.status=exports.QueryStatus.fulfilled,t.data=r,t.fulfilledTimeStamp=i.fulfilledTimeStamp;}));})).addCase(i.rejected,(function(t,n){var r=n.payload,i=n.error,u=n.meta;u.arg.track&&wt(t,{requestId:u.requestId},(function(t){t.status=exports.QueryStatus.rejected,t.error=null!=r?r:i;}));}));}}),h=Se({name:n+"/invalidation",initialState:jt,reducers:{},extraReducers:function(e){e.addCase(l.actions.removeQueryResult,(function(e,t){for(var n=t.payload.queryCacheKey,r=0,i=Object.values(e);r<i.length;r++)for(var u=0,a=Object.values(i[r]);u<a.length;u++){var o=a[u],c=o.indexOf(n);-1!==c&&o.splice(c,1);}})).addMatcher(Qe(Le(r),ze(r)),(function(e,t){for(var n,r,i,u,o=bt(t,"providesTags",a,c),s=t.meta.arg.queryCacheKey,f=0,l=o;f<l.length;f++){var d=l[f],p=d.type,v=d.id,h=null!=(u=(r=null!=(n=e[p])?n:e[p]={})[i=v||"__internal_without_id"])?u:r[i]=[];h.includes(s)||h.push(s);}}));}}),y=Se({name:n+"/subscriptions",initialState:jt,reducers:{updateSubscriptionOptions:function(e,t){var n,r=t.payload,i=r.queryCacheKey,u=r.requestId;(null==(n=null==e?void 0:e[i])?void 0:n[u])&&(e[i][u]=r.options);},unsubscribeQueryResult:function(e,t){var n=t.payload,r=n.queryCacheKey;e[r]&&delete e[r][n.requestId];}},extraReducers:function(e){e.addCase(l.actions.removeQueryResult,(function(e,t){delete e[t.payload.queryCacheKey];})).addCase(r.pending,(function(e,t){var n,r,i,u,a=t.meta,o=a.arg,c=a.requestId;if(o.subscribe){var s=null!=(r=e[n=o.queryCacheKey])?r:e[n]={};s[c]=null!=(u=null!=(i=o.subscriptionOptions)?i:s[c])?u:{};}})).addCase(r.rejected,(function(e,t){var n,r,i=t.meta,u=i.arg,a=i.requestId,o=e[u.queryCacheKey];i.condition&&u.subscribe&&o&&(o[a]=null!=(r=null!=(n=u.subscriptionOptions)?n:o[a])?r:{});}));}}),m=Se({name:n+"/config",initialState:p({online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine,focused:"undefined"==typeof document||"hidden"!==document.visibilityState,middlewareRegistered:!1},s),reducers:{middlewareRegistered:function(e,t){e.middlewareRegistered="conflict"!==e.middlewareRegistered&&o===t.payload||"conflict";}},extraReducers:function(e){e.addCase(nt,(function(e){e.online=!0;})).addCase(rt,(function(e){e.online=!1;})).addCase(et,(function(e){e.focused=!0;})).addCase(tt,(function(e){e.focused=!1;}));}}),g=function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];"function"==typeof e[i]&&(n[i]=e[i]);}var u,a=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:me.INIT}))throw new Error(he(12));if(void 0===n(void 0,{type:me.PROBE_UNKNOWN_ACTION()}))throw new Error(he(13))}));}(n);}catch(e){u=e;}return function(e,t){if(void 0===e&&(e={}),u)throw u;for(var r=!1,i={},o=0;o<a.length;o++){var c=a[o],s=e[c],f=(0, n[c])(s,t);if(void 0===f)throw new Error(he(14));i[c]=f,r=r||f!==s;}return (r=r||a.length!==Object.keys(e).length)?i:e}}({queries:l.reducer,mutations:d.reducer,provided:h.reducer,subscriptions:y.reducer,config:m.reducer});return {reducer:function(e,t){return g(f.match(t)?void 0:e,t)},actions:v(p(p(p(p({},m.actions),l.actions),y.actions),d.actions),{resetApiState:f})}}({context:r,queryThunk:A,mutationThunk:P,reducerPath:a,assertTagType:d,config:{refetchOnFocus:f,refetchOnReconnect:l,refetchOnMountOrArgChange:s,keepUnusedDataFor:c,reducerPath:a}}),C=x.reducer,Q=x.actions;xt(t.util,{patchQueryData:T,updateQueryData:E,prefetch:I,resetApiState:Q.resetApiState}),xt(t.internalActions,Q),Object.defineProperty(t.util,"updateQueryResult",{get:function(){return t.util.updateQueryData}}),Object.defineProperty(t.util,"patchQueryResult",{get:function(){return t.util.patchQueryData}});var N=kt({reducerPath:a,context:r,queryThunk:A,mutationThunk:P,api:t,assertTagType:d}),M=N.middleware;xt(t.util,N.actions),xt(t,{reducer:C,middleware:M});var _=function(t){var n=t.serializeQueryArgs,r=t.reducerPath;return {buildQuerySelector:function(e,t){return function(r){var a=je(u,(function(i){var u,a;return null!=(a=r===ct||null==(u=null==i?void 0:i.queries)?void 0:u[n({queryArgs:r,endpointDefinition:t,endpointName:e})])?a:lt}));return je(a,i)}},buildMutationSelector:function(){return function(e){var t=je(u,(function(t){var n,r;return null!=(r=e===ct||null==(n=null==t?void 0:t.mutations)?void 0:n[e])?r:dt}));return je(t,i)}}};function i(t){return p(p({},t),{status:n=t.status,isUninitialized:n===exports.QueryStatus.uninitialized,isLoading:n===exports.QueryStatus.pending,isSuccess:n===exports.QueryStatus.fulfilled,isError:n===exports.QueryStatus.rejected});var n;}function u(e){return e[r]}}({serializeQueryArgs:o,reducerPath:a}),F=_.buildQuerySelector,K=_.buildMutationSelector,z=function(e){var t=e.serializeQueryArgs,n=e.queryThunk,r=e.mutationThunk,i=e.api,u=i.internalActions,a=u.unsubscribeQueryResult,o=u.unsubscribeMutationResult,c=u.updateSubscriptionOptions;return {buildInitiateQuery:function(e,r){var u=function(o,s){var f=void 0===s?{}:s,l=f.subscribe,d=void 0===l||l,p=f.forceRefetch,v=f.subscriptionOptions;return function(s,f){var l=t({queryArgs:o,endpointDefinition:r,endpointName:e}),h=n({subscribe:d,forceRefetch:p,subscriptionOptions:v,endpointName:e,originalArgs:o,queryCacheKey:l}),y=s(h),m=y.requestId,g=y.abort,b=Object.assign(y.then((function(){return i.endpoints[e].select(o)(f())})),{arg:o,requestId:m,subscriptionOptions:v,abort:g,refetch:function(){s(u(o,{subscribe:!1,forceRefetch:!0}));},unsubscribe:function(){d&&s(a({queryCacheKey:l,requestId:m}));},updateSubscriptionOptions:function(t){b.subscriptionOptions=t,s(c({endpointName:e,requestId:m,queryCacheKey:l,options:t}));}});return b}};return u},buildInitiateMutation:function(e,t){return function(t,n){var i=(void 0===n?{}:n).track,u=void 0===i||i;return function(n,i){var a=r({endpointName:e,originalArgs:t,track:u}),c=n(a),s=c.requestId,f=c.abort,l=c.unwrap().then((function(e){return {data:e}})).catch((function(e){return {error:e}}));return Object.assign(l,{arg:c.arg,requestId:s,abort:f,unwrap:c.unwrap,unsubscribe:function(){u&&n(o({requestId:s}));}})}}}}}({queryThunk:A,mutationThunk:P,api:t,serializeQueryArgs:o}),L=z.buildInitiateQuery,U=z.buildInitiateMutation;return {name:Ct,injectEndpoint:function(e,n){var r,i=t;null!=(r=i.endpoints)[e]||(r[e]={}),n.type===at.query?xt(i.endpoints[e],{select:F(e,n),initiate:L(e,n)},k(A,e)):n.type===at.mutation&&xt(i.endpoints[e],{select:K(),initiate:U(e,n)},k(P,e));}}}}},Qt=yt(Dt());
exports.buildCreateApi = yt;
exports.copyWithStructuralSharing = Ve;
exports.coreModule = Dt;
exports.createApi = Qt;
exports.fakeBaseQuery = mt;
exports.fetchBaseQuery = $e;
exports.retry = Ze;
exports.setupListeners = ut;
exports.skipSelector = st;
exports.skipToken = ct;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=rtk-query.umd.min.js.map