import{p as It}from"./vite-plugin-node-polyfills-0kknRRv8.js";import{p as re,i as fe,a as _e,c as dt,b as Be,e as Ct,d as pt,o as qt}from"./immer-D4ZyvrkM.js";import{c as jt,w as De,a as yt}from"./reselect-sgeznYkp.js";import{b as Dt,u as Tt,a as Qt,c as kt,s as ue}from"./react-redux-CSpVpHH9.js";import{r as T}from"./react-CV9IiogI.js";function L(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 Pt=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ve=Pt,Oe=()=>Math.random().toString(36).substring(7).split("").join("."),_t={INIT:`@@redux/INIT${Oe()}`,REPLACE:`@@redux/REPLACE${Oe()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Oe()}`},me=_t;function B(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function ht(e,t,r){if(typeof e!="function")throw new Error(L(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(L(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(L(1));return r(ht)(e,t)}let s=e,o=t,l=new Map,c=l,w=0,b=!1;function S(){c===l&&(c=new Map,l.forEach((i,a)=>{c.set(a,i)}))}function M(){if(b)throw new Error(L(3));return o}function m(i){if(typeof i!="function")throw new Error(L(4));if(b)throw new Error(L(5));let a=!0;S();const n=w++;return c.set(n,i),function(){if(a){if(b)throw new Error(L(6));a=!1,S(),c.delete(n),l=null}}}function p(i){if(!B(i))throw new Error(L(7));if(typeof i.type>"u")throw new Error(L(8));if(typeof i.type!="string")throw new Error(L(17));if(b)throw new Error(L(9));try{b=!0,o=s(o,i)}finally{b=!1}return(l=c).forEach(n=>{n()}),i}function h(i){if(typeof i!="function")throw new Error(L(10));s=i,p({type:me.REPLACE})}function f(){const i=m;return{subscribe(a){if(typeof a!="object"||a===null)throw new Error(L(11));function n(){const g=a;g.next&&g.next(M())}return n(),{unsubscribe:i(n)}},[Ve](){return this}}}return p({type:me.INIT}),{dispatch:p,subscribe:m,getState:M,replaceReducer:h,[Ve]:f}}function xt(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:me.INIT})>"u")throw new Error(L(12));if(typeof r(void 0,{type:me.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(L(13))})}function xe(e){const t=Object.keys(e),r={};for(let l=0;l<t.length;l++){const c=t[l];typeof e[c]=="function"&&(r[c]=e[c])}const s=Object.keys(r);let o;try{xt(r)}catch(l){o=l}return function(c={},w){if(o)throw o;let b=!1;const S={};for(let M=0;M<s.length;M++){const m=s[M],p=r[m],h=c[m],f=p(h,w);if(typeof f>"u")throw w&&w.type,new Error(L(14));S[m]=f,b=b||f!==h}return b=b||s.length!==Object.keys(c).length,b?S:c}}function be(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...s)=>t(r(...s)))}function Nt(...e){return t=>(r,s)=>{const o=t(r,s);let l=()=>{throw new Error(L(15))};const c={getState:o.getState,dispatch:(b,...S)=>l(b,...S)},w=e.map(b=>b(c));return l=be(...w)(o.dispatch),{...o,dispatch:l}}}function Ne(e){return B(e)&&"type"in e&&typeof e.type=="string"}function gt(e){return({dispatch:r,getState:s})=>o=>l=>typeof l=="function"?l(r,s,e):o(l)}var Lt=gt(),Ft=gt,Ut=(...e)=>{const t=jt(...e),r=Object.assign((...s)=>{const o=t(...s),l=(c,...w)=>o(fe(c)?dt(c):c,...w);return Object.assign(l,o),l},{withTypes:()=>r});return r},$t=Ut(De),zt=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?be:be.apply(null,arguments)},Kt=e=>e&&typeof e.match=="function";function K(e,t){function r(...s){if(t){let o=t(...s);if(!o)throw new Error(U(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:s[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=s=>Ne(s)&&s.type===e,r}function Bt(e){return Ne(e)&&Object.keys(e).every(Vt)}function Vt(e){return["type","payload","error","meta"].indexOf(e)>-1}var mt=class oe extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,oe.prototype)}static get[Symbol.species](){return oe}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new oe(...t[0].concat(this)):new oe(...t.concat(this))}};function We(e){return _e(e)?re(e,()=>{}):e}function Te(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Wt(e){return typeof e=="boolean"}var Ht=()=>function(t){const{thunk:r=!0,immutableCheck:s=!0,serializableCheck:o=!0,actionCreatorCheck:l=!0}=t??{};let c=new mt;return r&&(Wt(r)?c.push(Lt):c.push(Ft(r.extraArgument))),c},X="RTK_autoBatch",ie=()=>e=>({payload:e,meta:{[X]:!0}}),He=e=>t=>{setTimeout(t,e)},Jt=(e={type:"raf"})=>t=>(...r)=>{const s=t(...r);let o=!0,l=!1,c=!1;const w=new Set,b=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:He(10):e.type==="callback"?e.queueNotification:He(e.timeout),S=()=>{c=!1,l&&(l=!1,w.forEach(M=>M()))};return Object.assign({},s,{subscribe(M){const m=()=>o&&M(),p=s.subscribe(m);return w.add(M),()=>{p(),w.delete(M)}},dispatch(M){try{return o=!M?.meta?.[X],l=!o,l&&(c||(c=!0,b(S))),s.dispatch(M)}finally{o=!0}}})},Gt=e=>function(r){const{autoBatch:s=!0}=r??{};let o=new mt(e);return s&&o.push(Jt(typeof s=="object"?s:void 0)),o};function Mr(e){const t=Ht(),{reducer:r=void 0,middleware:s,devTools:o=!0,preloadedState:l=void 0,enhancers:c=void 0}=e;let w;if(typeof r=="function")w=r;else if(B(r))w=xe(r);else throw new Error(U(1));let b;typeof s=="function"?b=s(t):b=t();let S=be;o&&(S=zt({trace:!1,...typeof o=="object"&&o}));const M=Nt(...b),m=Gt(M);let p=typeof c=="function"?c(m):m();const h=S(...p);return ht(w,l,h)}function bt(e){const t={},r=[];let s;const o={addCase(l,c){const w=typeof l=="string"?l:l.type;if(!w)throw new Error(U(28));if(w in t)throw new Error(U(29));return t[w]=c,o},addMatcher(l,c){return r.push({matcher:l,reducer:c}),o},addDefaultCase(l){return s=l,o}};return e(o),[t,r,s]}function Xt(e){return typeof e=="function"}function Yt(e,t){let[r,s,o]=bt(t),l;if(Xt(e))l=()=>We(e());else{const w=We(e);l=()=>w}function c(w=l(),b){let S=[r[b.type],...s.filter(({matcher:M})=>M(b)).map(({reducer:M})=>M)];return S.filter(M=>!!M).length===0&&(S=[o]),S.reduce((M,m)=>{if(m)if(fe(M)){const h=m(M,b);return h===void 0?M:h}else{if(_e(M))return re(M,p=>m(p,b));{const p=m(M,b);if(p===void 0){if(M===null)return M;throw Error("A case reducer on a non-draftable value must not return undefined")}return p}}return M},w)}return c.getInitialState=l,c}var St=(e,t)=>Kt(e)?e.match(t):e(t);function V(...e){return t=>e.some(r=>St(r,t))}function ce(...e){return t=>e.every(r=>St(r,t))}function ve(e,t){if(!e||!e.meta)return!1;const r=typeof e.meta.requestId=="string",s=t.indexOf(e.meta.requestStatus)>-1;return r&&s}function de(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Le(...e){return e.length===0?t=>ve(t,["pending"]):de(e)?V(...e.map(t=>t.pending)):Le()(e[0])}function ne(...e){return e.length===0?t=>ve(t,["rejected"]):de(e)?V(...e.map(t=>t.rejected)):ne()(e[0])}function we(...e){const t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?ce(ne(...e),t):de(e)?ce(ne(...e),t):we()(e[0])}function J(...e){return e.length===0?t=>ve(t,["fulfilled"]):de(e)?V(...e.map(t=>t.fulfilled)):J()(e[0])}function Qe(...e){return e.length===0?t=>ve(t,["pending","fulfilled","rejected"]):de(e)?V(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):Qe()(e[0])}var Zt="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Re=(e=21)=>{let t="",r=e;for(;r--;)t+=Zt[Math.random()*64|0];return t},en=["name","message","stack","code"],Ae=class{constructor(e,t){this.payload=e,this.meta=t}_type},Je=class{constructor(e,t){this.payload=e,this.meta=t}_type},tn=e=>{if(typeof e=="object"&&e!==null){const t={};for(const r of en)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},Ge=(()=>{function e(t,r,s){const o=K(t+"/fulfilled",(b,S,M,m)=>({payload:b,meta:{...m||{},arg:M,requestId:S,requestStatus:"fulfilled"}})),l=K(t+"/pending",(b,S,M)=>({payload:void 0,meta:{...M||{},arg:S,requestId:b,requestStatus:"pending"}})),c=K(t+"/rejected",(b,S,M,m,p)=>({payload:m,error:(s&&s.serializeError||tn)(b||"Rejected"),meta:{...p||{},arg:M,requestId:S,rejectedWithValue:!!m,requestStatus:"rejected",aborted:b?.name==="AbortError",condition:b?.name==="ConditionError"}}));function w(b){return(S,M,m)=>{const p=s?.idGenerator?s.idGenerator(b):Re(),h=new AbortController;let f,u;function i(n){u=n,h.abort()}const a=async function(){let n;try{let g=s?.condition?.(b,{getState:M,extra:m});if(rn(g)&&(g=await g),g===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const A=new Promise((v,d)=>{f=()=>{d({name:"AbortError",message:u||"Aborted"})},h.signal.addEventListener("abort",f)});S(l(p,b,s?.getPendingMeta?.({requestId:p,arg:b},{getState:M,extra:m}))),n=await Promise.race([A,Promise.resolve(r(b,{dispatch:S,getState:M,extra:m,requestId:p,signal:h.signal,abort:i,rejectWithValue:(v,d)=>new Ae(v,d),fulfillWithValue:(v,d)=>new Je(v,d)})).then(v=>{if(v instanceof Ae)throw v;return v instanceof Je?o(v.payload,p,b,v.meta):o(v,p,b)})])}catch(g){n=g instanceof Ae?c(null,p,b,g.payload,g.meta):c(g,p,b)}finally{f&&h.signal.removeEventListener("abort",f)}return s&&!s.dispatchConditionRejection&&c.match(n)&&n.meta.condition||S(n),n}();return Object.assign(a,{abort:i,requestId:p,arg:b,unwrap(){return a.then(nn)}})}}return Object.assign(w,{pending:l,rejected:c,fulfilled:o,settled:V(c,o),typePrefix:t})}return e.withTypes=()=>e,e})();function nn(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function rn(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var sn=Symbol.for("rtk-slice-createasyncthunk");function on(e,t){return`${e}/${t}`}function un({creators:e}={}){const t=e?.asyncThunk?.[sn];return function(s){const{name:o,reducerPath:l=o}=s;if(!o)throw new Error(U(11));const c=(typeof s.reducers=="function"?s.reducers(an()):s.reducers)||{},w=Object.keys(c),b={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},S={addCase(n,y){const g=typeof n=="string"?n:n.type;if(!g)throw new Error(U(12));if(g in b.sliceCaseReducersByType)throw new Error(U(13));return b.sliceCaseReducersByType[g]=y,S},addMatcher(n,y){return b.sliceMatchers.push({matcher:n,reducer:y}),S},exposeAction(n,y){return b.actionCreators[n]=y,S},exposeCaseReducer(n,y){return b.sliceCaseReducersByName[n]=y,S}};w.forEach(n=>{const y=c[n],g={reducerName:n,type:on(o,n),createNotation:typeof s.reducers=="function"};fn(y)?pn(g,y,S,t):ln(g,y,S)});function M(){const[n={},y=[],g=void 0]=typeof s.extraReducers=="function"?bt(s.extraReducers):[s.extraReducers],A={...n,...b.sliceCaseReducersByType};return Yt(s.initialState,v=>{for(let d in A)v.addCase(d,A[d]);for(let d of b.sliceMatchers)v.addMatcher(d.matcher,d.reducer);for(let d of y)v.addMatcher(d.matcher,d.reducer);g&&v.addDefaultCase(g)})}const m=n=>n,p=new Map;let h;function f(n,y){return h||(h=M()),h(n,y)}function u(){return h||(h=M()),h.getInitialState()}function i(n,y=!1){function g(v){let d=v[n];return typeof d>"u"&&y&&(d=u()),d}function A(v=m){const d=Te(p,y,()=>new WeakMap);return Te(d,v,()=>{const O={};for(const[E,R]of Object.entries(s.selectors??{}))O[E]=cn(R,v,u,y);return O})}return{reducerPath:n,getSelectors:A,get selectors(){return A(g)},selectSlice:g}}const a={name:o,reducer:f,actions:b.actionCreators,caseReducers:b.sliceCaseReducersByName,getInitialState:u,...i(l),injectInto(n,{reducerPath:y,...g}={}){const A=y??l;return n.inject({reducerPath:A,reducer:f},g),{...a,...i(A,!0)}}};return a}}function cn(e,t,r,s){function o(l,...c){let w=t(l);return typeof w>"u"&&s&&(w=r()),e(w,...c)}return o.unwrapped=e,o}var Z=un();function an(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function ln({type:e,reducerName:t,createNotation:r},s,o){let l,c;if("reducer"in s){if(r&&!dn(s))throw new Error(U(17));l=s.reducer,c=s.prepare}else l=s;o.addCase(e,l).exposeCaseReducer(t,l).exposeAction(t,c?K(e,c):K(e))}function fn(e){return e._reducerDefinitionType==="asyncThunk"}function dn(e){return e._reducerDefinitionType==="reducerWithPrepare"}function pn({type:e,reducerName:t},r,s,o){if(!o)throw new Error(U(18));const{payloadCreator:l,fulfilled:c,pending:w,rejected:b,settled:S,options:M}=r,m=o(e,l,M);s.exposeAction(t,m),c&&s.addCase(m.fulfilled,c),w&&s.addCase(m.pending,w),b&&s.addCase(m.rejected,b),S&&s.addMatcher(m.settled,S),s.exposeCaseReducer(t,{fulfilled:c||pe,pending:w||pe,rejected:b||pe,settled:S||pe})}function pe(){}function yn(){return{ids:[],entities:{}}}function hn(e){function t(r={},s){const o=Object.assign(yn(),r);return s?e.setAll(o,s):o}return{getInitialState:t}}function gn(){function e(t,r={}){const{createSelector:s=$t}=r,o=m=>m.ids,l=m=>m.entities,c=s(o,l,(m,p)=>m.map(h=>p[h])),w=(m,p)=>p,b=(m,p)=>m[p],S=s(o,m=>m.length);if(!t)return{selectIds:o,selectEntities:l,selectAll:c,selectTotal:S,selectById:s(l,w,b)};const M=s(t,l);return{selectIds:s(t,o),selectEntities:M,selectAll:s(t,c),selectTotal:s(t,S),selectById:s(M,w,b)}}return{getSelectors:e}}var mn=fe;function bn(e){const t=k((r,s)=>e(s));return function(s){return t(s,void 0)}}function k(e){return function(r,s){function o(c){return Bt(c)}const l=c=>{o(s)?e(s.payload,c):e(s,c)};return mn(r)?(l(r),r):re(r,l)}}function ee(e,t){return t(e)}function Y(e){return Array.isArray(e)||(e=Object.values(e)),e}function ge(e){return fe(e)?dt(e):e}function vt(e,t,r){e=Y(e);const s=ge(r.ids),o=new Set(s),l=[],c=[];for(const w of e){const b=ee(w,t);o.has(b)?c.push({id:b,changes:w}):l.push(w)}return[l,c,s]}function wt(e){function t(f,u){const i=ee(f,e);i in u.entities||(u.ids.push(i),u.entities[i]=f)}function r(f,u){f=Y(f);for(const i of f)t(i,u)}function s(f,u){const i=ee(f,e);i in u.entities||u.ids.push(i),u.entities[i]=f}function o(f,u){f=Y(f);for(const i of f)s(i,u)}function l(f,u){f=Y(f),u.ids=[],u.entities={},r(f,u)}function c(f,u){return w([f],u)}function w(f,u){let i=!1;f.forEach(a=>{a in u.entities&&(delete u.entities[a],i=!0)}),i&&(u.ids=u.ids.filter(a=>a in u.entities))}function b(f){Object.assign(f,{ids:[],entities:{}})}function S(f,u,i){const a=i.entities[u.id];if(a===void 0)return!1;const n=Object.assign({},a,u.changes),y=ee(n,e),g=y!==u.id;return g&&(f[u.id]=y,delete i.entities[u.id]),i.entities[y]=n,g}function M(f,u){return m([f],u)}function m(f,u){const i={},a={};f.forEach(y=>{y.id in u.entities&&(a[y.id]={id:y.id,changes:{...a[y.id]?.changes,...y.changes}})}),f=Object.values(a),f.length>0&&f.filter(g=>S(i,g,u)).length>0&&(u.ids=Object.values(u.entities).map(g=>ee(g,e)))}function p(f,u){return h([f],u)}function h(f,u){const[i,a]=vt(f,e,u);m(a,u),r(i,u)}return{removeAll:bn(b),addOne:k(t),addMany:k(r),setOne:k(s),setMany:k(o),setAll:k(l),updateOne:k(M),updateMany:k(m),upsertOne:k(p),upsertMany:k(h),removeOne:k(c),removeMany:k(w)}}function Sn(e,t,r){let s=0,o=e.length;for(;s<o;){let l=s+o>>>1;const c=e[l];r(t,c)>=0?s=l+1:o=l}return s}function vn(e,t,r){const s=Sn(e,t,r);return e.splice(s,0,t),e}function wn(e,t){const{removeOne:r,removeMany:s,removeAll:o}=wt(e);function l(i,a){return c([i],a)}function c(i,a,n){i=Y(i);const y=new Set(n??ge(a.ids)),g=i.filter(A=>!y.has(ee(A,e)));g.length!==0&&u(a,g)}function w(i,a){return b([i],a)}function b(i,a){if(i=Y(i),i.length!==0){for(const n of i)delete a.entities[e(n)];u(a,i)}}function S(i,a){i=Y(i),a.entities={},a.ids=[],c(i,a,[])}function M(i,a){return m([i],a)}function m(i,a){let n=!1,y=!1;for(let g of i){const A=a.entities[g.id];if(!A)continue;n=!0,Object.assign(A,g.changes);const v=e(A);if(g.id!==v){y=!0,delete a.entities[g.id];const d=a.ids.indexOf(g.id);a.ids[d]=v,a.entities[v]=A}}n&&u(a,[],n,y)}function p(i,a){return h([i],a)}function h(i,a){const[n,y,g]=vt(i,e,a);y.length&&m(y,a),n.length&&c(n,a,g)}function f(i,a){if(i.length!==a.length)return!1;for(let n=0;n<i.length;n++)if(i[n]!==a[n])return!1;return!0}const u=(i,a,n,y)=>{const g=ge(i.entities),A=ge(i.ids),v=i.entities;let d=A;y&&(d=new Set(A));let O=[];for(const I of d){const C=g[I];C&&O.push(C)}const E=O.length===0;for(const I of a)v[e(I)]=I,E||vn(O,I,t);E?O=a.slice().sort(t):n&&O.sort(t);const R=O.map(e);f(A,R)||(i.ids=R)};return{removeOne:r,removeMany:s,removeAll:o,addOne:k(l),updateOne:k(M),upsertOne:k(p),setOne:k(w),setMany:k(b),setAll:k(S),addMany:k(c),updateMany:k(m),upsertMany:k(h)}}function Er(e={}){const{selectId:t,sortComparer:r}={sortComparer:!1,selectId:c=>c.id,...e},s=r?wn(t,r):wt(t),o=hn(s),l=gn();return{selectId:t,sortComparer:r,...o,...l,...s}}var Rn=e=>"reducerPath"in e&&typeof e.reducerPath=="string",Mn=e=>e.flatMap(t=>Rn(t)?[[t.reducerPath,t.reducer]]:Object.entries(t)),Fe=Symbol.for("rtk-state-proxy-original"),En=e=>!!e&&!!e[Fe],On=new WeakMap,An=(e,t)=>Te(On,e,()=>new Proxy(e,{get:(r,s,o)=>{if(s===Fe)return r;const l=Reflect.get(r,s,o);if(typeof l>"u"){const c=t[s.toString()];if(c){const w=c(void 0,{type:Re()});if(typeof w>"u")throw new Error(U(24));return w}}return l}})),In=e=>{if(!En(e))throw new Error(U(25));return e[Fe]},Cn=(e={})=>e;function Or(...e){const t=Object.fromEntries(Mn(e)),r=()=>Object.keys(t).length?xe(t):Cn;let s=r();function o(w,b){return s(w,b)}o.withLazyLoadedSlices=()=>o;const l=(w,b={})=>{const{reducerPath:S,reducer:M}=w,m=t[S];return!b.overrideExisting&&m&&m!==M||(t[S]=M,s=r()),o},c=Object.assign(function(b,S){return function(m,...p){return b(An(S?S(m,...p):m,t),...p)}},{original:In});return Object.assign(o,{inject:l,selector:c})}function U(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Rt=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Rt||{});function qn(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var Xe=B;function Mt(e,t){if(e===t||!(Xe(e)&&Xe(t)||Array.isArray(e)&&Array.isArray(t)))return t;const r=Object.keys(t),s=Object.keys(e);let o=r.length===s.length;const l=Array.isArray(t)?[]:{};for(const c of r)l[c]=Mt(e[c],t[c]),o&&(o=e[c]===l[c]);return o?e:l}function te(e){let t=0;for(const r in e)t++;return t}var Ye=e=>[].concat(...e);function jn(e){return new RegExp("(^|:)//").test(e)}function Dn(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Se(e){return e!=null}function Tn(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Qn=e=>e.replace(/\/$/,""),kn=e=>e.replace(/^\//,"");function Pn(e,t){if(!e)return t;if(!t)return e;if(jn(t))return t;const r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Qn(e),t=kn(t),`${e}${r}${t}`}function _n(e,t,r){return e.has(t)?e.get(t):e.set(t,r).get(t)}var Ze=(...e)=>fetch(...e),xn=e=>e.status>=200&&e.status<=299,Nn=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function et(e){if(!B(e))return e;const t={...e};for(const[r,s]of Object.entries(t))s===void 0&&delete t[r];return t}function Ar({baseUrl:e,prepareHeaders:t=m=>m,fetchFn:r=Ze,paramsSerializer:s,isJsonContentType:o=Nn,jsonContentType:l="application/json",jsonReplacer:c,timeout:w,responseHandler:b,validateStatus:S,...M}={}){return typeof fetch>"u"&&r===Ze&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(p,h,f)=>{const{getState:u,extra:i,endpoint:a,forced:n,type:y}=h;let g,{url:A,headers:v=new Headers(M.headers),params:d=void 0,responseHandler:O=b??"json",validateStatus:E=S??xn,timeout:R=w,...I}=typeof p=="string"?{url:p}:p,C,q=h.signal;R&&(C=new AbortController,h.signal.addEventListener("abort",C.abort),q=C.signal);let j={...M,signal:q,...I};v=new Headers(et(v)),j.headers=await t(v,{getState:u,arg:p,extra:i,endpoint:a,forced:n,type:y,extraOptions:f})||v;const D=F=>typeof F=="object"&&(B(F)||Array.isArray(F)||typeof F.toJSON=="function");if(!j.headers.has("content-type")&&D(j.body)&&j.headers.set("content-type",l),D(j.body)&&o(j.headers)&&(j.body=JSON.stringify(j.body,c)),d){const F=~A.indexOf("?")?"&":"?",G=s?s(d):new URLSearchParams(et(d));A+=F+G}A=Pn(e,A);const x=new Request(A,j);g={request:new Request(A,j)};let Q,N=!1,P=C&&setTimeout(()=>{N=!0,C.abort()},R);try{Q=await r(x)}catch(F){return{error:{status:N?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(F)},meta:g}}finally{P&&clearTimeout(P),C?.signal.removeEventListener("abort",C.abort)}const z=Q.clone();g.response=z;let _,Ke="";try{let F;if(await Promise.all([m(Q,O).then(G=>_=G,G=>F=G),z.text().then(G=>Ke=G,()=>{})]),F)throw F}catch(F){return{error:{status:"PARSING_ERROR",originalStatus:Q.status,data:Ke,error:String(F)},meta:g}}return E(Q,_)?{data:_,meta:g}:{error:{status:Q.status,data:_},meta:g}};async function m(p,h){if(typeof h=="function")return h(p);if(h==="content-type"&&(h=o(p.headers)?"json":"text"),h==="json"){const f=await p.text();return f.length?JSON.parse(f):null}return p.text()}}var tt=class{constructor(e,t=void 0){this.value=e,this.meta=t}},Me=K("__rtkq/focused"),Ue=K("__rtkq/unfocused"),Ee=K("__rtkq/online"),$e=K("__rtkq/offline"),Ie=!1;function Ir(e,t){function r(){const s=()=>e(Me()),o=()=>e(Ue()),l=()=>e(Ee()),c=()=>e($e()),w=()=>{window.document.visibilityState==="visible"?s():o()};return Ie||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",w,!1),window.addEventListener("focus",s,!1),window.addEventListener("online",l,!1),window.addEventListener("offline",c,!1),Ie=!0),()=>{window.removeEventListener("focus",s),window.removeEventListener("visibilitychange",w),window.removeEventListener("online",l),window.removeEventListener("offline",c),Ie=!1}}return r()}function Et(e){return e.type==="query"}function Ln(e){return e.type==="mutation"}function ze(e,t,r,s,o,l){return Fn(e)?e(t,r,s,o).filter(Se).map(ke).map(l):Array.isArray(e)?e.map(ke).map(l):[]}function Fn(e){return typeof e=="function"}function ke(e){return typeof e=="string"?{type:e}:e}function Un(e,t){return e.catch(t)}var ae=Symbol("forceQueryFn"),Pe=e=>typeof e[ae]=="function";function $n({serializeQueryArgs:e,queryThunk:t,mutationThunk:r,api:s,context:o}){const l=new Map,c=new Map,{unsubscribeQueryResult:w,removeMutationResult:b,updateSubscriptionOptions:S}=s.internalActions;return{buildInitiateQuery:f,buildInitiateMutation:u,getRunningQueryThunk:M,getRunningMutationThunk:m,getRunningQueriesThunk:p,getRunningMutationsThunk:h};function M(i,a){return n=>{const y=o.endpointDefinitions[i],g=e({queryArgs:a,endpointDefinition:y,endpointName:i});return l.get(n)?.[g]}}function m(i,a){return n=>c.get(n)?.[a]}function p(){return i=>Object.values(l.get(i)||{}).filter(Se)}function h(){return i=>Object.values(c.get(i)||{}).filter(Se)}function f(i,a){const n=(y,{subscribe:g=!0,forceRefetch:A,subscriptionOptions:v,[ae]:d,...O}={})=>(E,R)=>{const I=e({queryArgs:y,endpointDefinition:a,endpointName:i}),C=t({...O,type:"query",subscribe:g,forceRefetch:A,subscriptionOptions:v,endpointName:i,originalArgs:y,queryCacheKey:I,[ae]:d}),q=s.endpoints[i].select(y),j=E(C),D=q(R()),{requestId:x,abort:$}=j,Q=D.requestId!==x,N=l.get(E)?.[I],P=()=>q(R()),z=Object.assign(d?j.then(P):Q&&!N?Promise.resolve(D):Promise.all([N,j]).then(P),{arg:y,requestId:x,subscriptionOptions:v,queryCacheKey:I,abort:$,async unwrap(){const _=await z;if(_.isError)throw _.error;return _.data},refetch:()=>E(n(y,{subscribe:!1,forceRefetch:!0})),unsubscribe(){g&&E(w({queryCacheKey:I,requestId:x}))},updateSubscriptionOptions(_){z.subscriptionOptions=_,E(S({endpointName:i,requestId:x,queryCacheKey:I,options:_}))}});if(!N&&!Q&&!d){const _=_n(l,E,{});_[I]=z,z.then(()=>{delete _[I],te(_)||l.delete(E)})}return z};return n}function u(i){return(a,{track:n=!0,fixedCacheKey:y}={})=>(g,A)=>{const v=r({type:"mutation",endpointName:i,originalArgs:a,track:n,fixedCacheKey:y}),d=g(v),{requestId:O,abort:E,unwrap:R}=d,I=Un(d.unwrap().then(D=>({data:D})),D=>({error:D})),C=()=>{g(b({requestId:O,fixedCacheKey:y}))},q=Object.assign(I,{arg:d.arg,requestId:O,abort:E,unwrap:R,reset:C}),j=c.get(g)||{};return c.set(g,j),j[O]=q,q.then(()=>{delete j[O],te(j)||c.delete(g)}),y&&(j[y]=q,q.then(()=>{j[y]===q&&(delete j[y],te(j)||c.delete(g))})),q}}}function nt(e){return e}function zn({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:s,api:o,assertTagType:l}){const c=(n,y,g,A)=>(v,d)=>{const O=r[n],E=s({queryArgs:y,endpointDefinition:O,endpointName:n});if(v(o.internalActions.queryResultPatched({queryCacheKey:E,patches:g})),!A)return;const R=o.endpoints[n].select(y)(d()),I=ze(O.providesTags,R.data,void 0,y,{},l);v(o.internalActions.updateProvidedBy({queryCacheKey:E,providedTags:I}))},w=(n,y,g,A=!0)=>(v,d)=>{const E=o.endpoints[n].select(y)(d()),R={patches:[],inversePatches:[],undo:()=>v(o.util.patchQueryData(n,y,R.inversePatches,A))};if(E.status==="uninitialized")return R;let I;if("data"in E)if(_e(E.data)){const[C,q,j]=pt(E.data,g);R.patches.push(...q),R.inversePatches.push(...j),I=C}else I=g(E.data),R.patches.push({op:"replace",path:[],value:I}),R.inversePatches.push({op:"replace",path:[],value:E.data});return R.patches.length===0||v(o.util.patchQueryData(n,y,R.patches,A)),R},b=(n,y,g)=>A=>A(o.endpoints[n].initiate(y,{subscribe:!1,forceRefetch:!0,[ae]:()=>({data:g})})),S=async(n,{signal:y,abort:g,rejectWithValue:A,fulfillWithValue:v,dispatch:d,getState:O,extra:E})=>{const R=r[n.endpointName];try{let I=nt,C;const q={signal:y,abort:g,dispatch:d,getState:O,extra:E,endpoint:n.endpointName,type:n.type,forced:n.type==="query"?M(n,O()):void 0,queryCacheKey:n.type==="query"?n.queryCacheKey:void 0},j=n.type==="query"?n[ae]:void 0;if(j?C=j():R.query?(C=await t(R.query(n.originalArgs),q,R.extraOptions),R.transformResponse&&(I=R.transformResponse)):C=await R.queryFn(n.originalArgs,q,R.extraOptions,D=>t(D,q,R.extraOptions)),typeof It<"u",C.error)throw new tt(C.error,C.meta);return v(await I(C.data,C.meta,n.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:C.meta,[X]:!0})}catch(I){let C=I;if(C instanceof tt){let q=nt;R.query&&R.transformErrorResponse&&(q=R.transformErrorResponse);try{return A(await q(C.value,C.meta,n.originalArgs),{baseQueryMeta:C.meta,[X]:!0})}catch(j){C=j}}throw console.error(C),C}};function M(n,y){const g=y[e]?.queries?.[n.queryCacheKey],A=y[e]?.config.refetchOnMountOrArgChange,v=g?.fulfilledTimeStamp,d=n.forceRefetch??(n.subscribe&&A);return d?d===!0||(Number(new Date)-Number(v))/1e3>=d:!1}const m=Ge(`${e}/executeQuery`,S,{getPendingMeta(){return{startedTimeStamp:Date.now(),[X]:!0}},condition(n,{getState:y}){const g=y(),A=g[e]?.queries?.[n.queryCacheKey],v=A?.fulfilledTimeStamp,d=n.originalArgs,O=A?.originalArgs,E=r[n.endpointName];return Pe(n)?!0:A?.status==="pending"?!1:M(n,g)||Et(E)&&E?.forceRefetch?.({currentArg:d,previousArg:O,endpointState:A,state:g})?!0:!v},dispatchConditionRejection:!0}),p=Ge(`${e}/executeMutation`,S,{getPendingMeta(){return{startedTimeStamp:Date.now(),[X]:!0}}}),h=n=>"force"in n,f=n=>"ifOlderThan"in n,u=(n,y,g)=>(A,v)=>{const d=h(g)&&g.force,O=f(g)&&g.ifOlderThan,E=(I=!0)=>{const C={forceRefetch:I,isPrefetch:!0};return o.endpoints[n].initiate(y,C)},R=o.endpoints[n].select(y)(v());if(d)A(E());else if(O){const I=R?.fulfilledTimeStamp;if(!I){A(E());return}(Number(new Date)-Number(new Date(I)))/1e3>=O&&A(E())}else A(E(!1))};function i(n){return y=>y?.meta?.arg?.endpointName===n}function a(n,y){return{matchPending:ce(Le(n),i(y)),matchFulfilled:ce(J(n),i(y)),matchRejected:ce(ne(n),i(y))}}return{queryThunk:m,mutationThunk:p,prefetch:u,updateQueryData:w,upsertQueryData:b,patchQueryData:c,buildMatchThunkActions:a}}function Ot(e,t,r,s){return ze(r[e.meta.arg.endpointName][t],J(e)?e.payload:void 0,we(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,s)}function ye(e,t,r){const s=e[t];s&&r(s)}function le(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function rt(e,t,r){const s=e[le(t)];s&&r(s)}var se={};function Kn({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:s,context:{endpointDefinitions:o,apiUid:l,extractRehydrationInfo:c,hasRehydrationInfo:w},assertTagType:b,config:S}){const M=K(`${e}/resetApiState`);function m(v,d,O,E){v[d.queryCacheKey]??={status:"uninitialized",endpointName:d.endpointName},ye(v,d.queryCacheKey,R=>{R.status="pending",R.requestId=O&&R.requestId?R.requestId:E.requestId,d.originalArgs!==void 0&&(R.originalArgs=d.originalArgs),R.startedTimeStamp=E.startedTimeStamp})}function p(v,d,O){ye(v,d.arg.queryCacheKey,E=>{if(E.requestId!==d.requestId&&!Pe(d.arg))return;const{merge:R}=o[d.arg.endpointName];if(E.status="fulfilled",R)if(E.data!==void 0){const{fulfilledTimeStamp:I,arg:C,baseQueryMeta:q,requestId:j}=d;let D=re(E.data,x=>R(x,O,{arg:C.originalArgs,baseQueryMeta:q,fulfilledTimeStamp:I,requestId:j}));E.data=D}else E.data=O;else E.data=o[d.arg.endpointName].structuralSharing??!0?Mt(fe(E.data)?qt(E.data):E.data,O):O;delete E.error,E.fulfilledTimeStamp=d.fulfilledTimeStamp})}const h=Z({name:`${e}/queries`,initialState:se,reducers:{removeQueryResult:{reducer(v,{payload:{queryCacheKey:d}}){delete v[d]},prepare:ie()},cacheEntriesUpserted:{reducer(v,d){for(const O of d.payload){const{queryDescription:E,value:R}=O;m(v,E,!0,{arg:E,requestId:d.meta.requestId,startedTimeStamp:d.meta.timestamp}),p(v,{arg:E,requestId:d.meta.requestId,fulfilledTimeStamp:d.meta.timestamp,baseQueryMeta:{}},R)}},prepare:v=>({payload:v.map(E=>{const{endpointName:R,arg:I,value:C}=E,q=o[R];return{queryDescription:{type:"query",endpointName:R,originalArgs:E.arg,queryCacheKey:s({queryArgs:I,endpointDefinition:q,endpointName:R})},value:C}}),meta:{[X]:!0,requestId:Re(),timestamp:Date.now()}})},queryResultPatched:{reducer(v,{payload:{queryCacheKey:d,patches:O}}){ye(v,d,E=>{E.data=Be(E.data,O.concat())})},prepare:ie()}},extraReducers(v){v.addCase(t.pending,(d,{meta:O,meta:{arg:E}})=>{const R=Pe(E);m(d,E,R,O)}).addCase(t.fulfilled,(d,{meta:O,payload:E})=>{p(d,O,E)}).addCase(t.rejected,(d,{meta:{condition:O,arg:E,requestId:R},error:I,payload:C})=>{ye(d,E.queryCacheKey,q=>{if(!O){if(q.requestId!==R)return;q.status="rejected",q.error=C??I}})}).addMatcher(w,(d,O)=>{const{queries:E}=c(O);for(const[R,I]of Object.entries(E))(I?.status==="fulfilled"||I?.status==="rejected")&&(d[R]=I)})}}),f=Z({name:`${e}/mutations`,initialState:se,reducers:{removeMutationResult:{reducer(v,{payload:d}){const O=le(d);O in v&&delete v[O]},prepare:ie()}},extraReducers(v){v.addCase(r.pending,(d,{meta:O,meta:{requestId:E,arg:R,startedTimeStamp:I}})=>{R.track&&(d[le(O)]={requestId:E,status:"pending",endpointName:R.endpointName,startedTimeStamp:I})}).addCase(r.fulfilled,(d,{payload:O,meta:E})=>{E.arg.track&&rt(d,E,R=>{R.requestId===E.requestId&&(R.status="fulfilled",R.data=O,R.fulfilledTimeStamp=E.fulfilledTimeStamp)})}).addCase(r.rejected,(d,{payload:O,error:E,meta:R})=>{R.arg.track&&rt(d,R,I=>{I.requestId===R.requestId&&(I.status="rejected",I.error=O??E)})}).addMatcher(w,(d,O)=>{const{mutations:E}=c(O);for(const[R,I]of Object.entries(E))(I?.status==="fulfilled"||I?.status==="rejected")&&R!==I?.requestId&&(d[R]=I)})}}),u=Z({name:`${e}/invalidation`,initialState:se,reducers:{updateProvidedBy:{reducer(v,d){const{queryCacheKey:O,providedTags:E}=d.payload;for(const R of Object.values(v))for(const I of Object.values(R)){const C=I.indexOf(O);C!==-1&&I.splice(C,1)}for(const{type:R,id:I}of E){const C=(v[R]??={})[I||"__internal_without_id"]??=[];C.includes(O)||C.push(O)}},prepare:ie()}},extraReducers(v){v.addCase(h.actions.removeQueryResult,(d,{payload:{queryCacheKey:O}})=>{for(const E of Object.values(d))for(const R of Object.values(E)){const I=R.indexOf(O);I!==-1&&R.splice(I,1)}}).addMatcher(w,(d,O)=>{const{provided:E}=c(O);for(const[R,I]of Object.entries(E))for(const[C,q]of Object.entries(I)){const j=(d[R]??={})[C||"__internal_without_id"]??=[];for(const D of q)j.includes(D)||j.push(D)}}).addMatcher(V(J(t),we(t)),(d,O)=>{const E=Ot(O,"providesTags",o,b),{queryCacheKey:R}=O.meta.arg;u.caseReducers.updateProvidedBy(d,u.actions.updateProvidedBy({queryCacheKey:R,providedTags:E}))})}}),i=Z({name:`${e}/subscriptions`,initialState:se,reducers:{updateSubscriptionOptions(v,d){},unsubscribeQueryResult(v,d){},internal_getRTKQSubscriptions(){}}}),a=Z({name:`${e}/internalSubscriptions`,initialState:se,reducers:{subscriptionsUpdated:{reducer(v,d){return Be(v,d.payload)},prepare:ie()}}}),n=Z({name:`${e}/config`,initialState:{online:Tn(),focused:Dn(),middlewareRegistered:!1,...S},reducers:{middlewareRegistered(v,{payload:d}){v.middlewareRegistered=v.middlewareRegistered==="conflict"||l!==d?"conflict":!0}},extraReducers:v=>{v.addCase(Ee,d=>{d.online=!0}).addCase($e,d=>{d.online=!1}).addCase(Me,d=>{d.focused=!0}).addCase(Ue,d=>{d.focused=!1}).addMatcher(w,d=>({...d}))}}),y=xe({queries:h.reducer,mutations:f.reducer,provided:u.reducer,subscriptions:a.reducer,config:n.reducer}),g=(v,d)=>y(M.match(d)?void 0:v,d),A={...n.actions,...h.actions,...i.actions,...a.actions,...f.actions,...u.actions,resetApiState:M};return{reducer:g,actions:A}}var H=Symbol.for("RTKQ/skipToken"),At={status:"uninitialized"},it=re(At,()=>{}),st=re(At,()=>{});function Bn({serializeQueryArgs:e,reducerPath:t,createSelector:r}){const s=m=>it,o=m=>st;return{buildQuerySelector:w,buildMutationSelector:b,selectInvalidatedBy:S,selectCachedArgsForQuery:M};function l(m){return{...m,...qn(m.status)}}function c(m){return m[t]}function w(m,p){return h=>{if(h===H)return r(s,l);const f=e({queryArgs:h,endpointDefinition:p,endpointName:m});return r(i=>c(i)?.queries?.[f]??it,l)}}function b(){return m=>{let p;return typeof m=="object"?p=le(m)??H:p=m,r(p===H?o:u=>c(u)?.mutations?.[p]??st,l)}}function S(m,p){const h=m[t],f=new Set;for(const u of p.filter(Se).map(ke)){const i=h.provided[u.type];if(!i)continue;let a=(u.id!==void 0?i[u.id]:Ye(Object.values(i)))??[];for(const n of a)f.add(n)}return Ye(Array.from(f.values()).map(u=>{const i=h.queries[u];return i?[{queryCacheKey:u,endpointName:i.endpointName,originalArgs:i.originalArgs}]:[]}))}function M(m,p){return Object.values(m[t].queries).filter(h=>h?.endpointName===p&&h.status!=="uninitialized").map(h=>h.originalArgs)}}var ot=WeakMap?new WeakMap:void 0,ut=({endpointName:e,queryArgs:t})=>{let r="";const s=ot?.get(t);if(typeof s=="string")r=s;else{const o=JSON.stringify(t,(l,c)=>(c=typeof c=="bigint"?{$bigint:c.toString()}:c,c=B(c)?Object.keys(c).sort().reduce((w,b)=>(w[b]=c[b],w),{}):c,c));B(t)&&ot?.set(t,o),r=o}return`${e}(${r})`};function Vn(...e){return function(r){const s=De(S=>r.extractRehydrationInfo?.(S,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:s,serializeQueryArgs(S){let M=ut;if("serializeQueryArgs"in S.endpointDefinition){const m=S.endpointDefinition.serializeQueryArgs;M=p=>{const h=m(p);return typeof h=="string"?h:ut({...p,queryArgs:h})}}else r.serializeQueryArgs&&(M=r.serializeQueryArgs);return M(S)},tagTypes:[...r.tagTypes||[]]},l={endpointDefinitions:{},batch(S){S()},apiUid:Re(),extractRehydrationInfo:s,hasRehydrationInfo:De(S=>s(S)!=null)},c={injectEndpoints:b,enhanceEndpoints({addTagTypes:S,endpoints:M}){if(S)for(const m of S)o.tagTypes.includes(m)||o.tagTypes.push(m);if(M)for(const[m,p]of Object.entries(M))typeof p=="function"?p(l.endpointDefinitions[m]):Object.assign(l.endpointDefinitions[m]||{},p);return c}},w=e.map(S=>S.init(c,o,l));function b(S){const M=S.endpoints({query:m=>({...m,type:"query"}),mutation:m=>({...m,type:"mutation"})});for(const[m,p]of Object.entries(M)){if(S.overrideExisting!==!0&&m in l.endpointDefinitions){if(S.overrideExisting==="throw")throw new Error(U(39));continue}l.endpointDefinitions[m]=p;for(const h of w)h.injectEndpoint(m,p)}return c}return c.injectEndpoints({endpoints:r.endpoints})}}function W(e,...t){return Object.assign(e,...t)}var Wn=({api:e,queryThunk:t,internalState:r})=>{const s=`${e.reducerPath}/subscriptions`;let o=null,l=null;const{updateSubscriptionOptions:c,unsubscribeQueryResult:w}=e.internalActions,b=(h,f)=>{if(c.match(f)){const{queryCacheKey:i,requestId:a,options:n}=f.payload;return h?.[i]?.[a]&&(h[i][a]=n),!0}if(w.match(f)){const{queryCacheKey:i,requestId:a}=f.payload;return h[i]&&delete h[i][a],!0}if(e.internalActions.removeQueryResult.match(f))return delete h[f.payload.queryCacheKey],!0;if(t.pending.match(f)){const{meta:{arg:i,requestId:a}}=f,n=h[i.queryCacheKey]??={};return n[`${a}_running`]={},i.subscribe&&(n[a]=i.subscriptionOptions??n[a]??{}),!0}let u=!1;if(t.fulfilled.match(f)||t.rejected.match(f)){const i=h[f.meta.arg.queryCacheKey]||{},a=`${f.meta.requestId}_running`;u||=!!i[a],delete i[a]}if(t.rejected.match(f)){const{meta:{condition:i,arg:a,requestId:n}}=f;if(i&&a.subscribe){const y=h[a.queryCacheKey]??={};y[n]=a.subscriptionOptions??y[n]??{},u=!0}}return u},S=()=>r.currentSubscriptions,p={getSubscriptions:S,getSubscriptionCount:h=>{const u=S()[h]??{};return te(u)},isRequestSubscribed:(h,f)=>!!S()?.[h]?.[f]};return(h,f)=>{if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),e.util.resetApiState.match(h))return o=r.currentSubscriptions={},l=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(h))return[!1,p];const u=b(r.currentSubscriptions,h);let i=!0;if(u){l||(l=setTimeout(()=>{const y=JSON.parse(JSON.stringify(r.currentSubscriptions)),[,g]=pt(o,()=>y);f.next(e.internalActions.subscriptionsUpdated(g)),o=y,l=null},500));const a=typeof h.type=="string"&&!!h.type.startsWith(s),n=t.rejected.match(h)&&h.meta.condition&&!!h.meta.arg.subscribe;i=!a&&!n}return[i,!1]}};function Hn(e){for(const t in e)return!1;return!0}var Jn=2147483647/1e3-1,Gn=({reducerPath:e,api:t,queryThunk:r,context:s,internalState:o})=>{const{removeQueryResult:l,unsubscribeQueryResult:c,cacheEntriesUpserted:w}=t.internalActions,b=V(c.match,r.fulfilled,r.rejected,w.match);function S(h){const f=o.currentSubscriptions[h];return!!f&&!Hn(f)}const M={},m=(h,f,u)=>{if(b(h)){const i=f.getState()[e];let a;if(w.match(h))a=h.payload.map(n=>n.queryDescription.queryCacheKey);else{const{queryCacheKey:n}=c.match(h)?h.payload:h.meta.arg;a=[n]}for(const n of a)p(n,i.queries[n]?.endpointName,f,i.config)}if(t.util.resetApiState.match(h))for(const[i,a]of Object.entries(M))a&&clearTimeout(a),delete M[i];if(s.hasRehydrationInfo(h)){const i=f.getState()[e],{queries:a}=s.extractRehydrationInfo(h);for(const[n,y]of Object.entries(a))p(n,y?.endpointName,f,i.config)}};function p(h,f,u,i){const n=s.endpointDefinitions[f]?.keepUnusedDataFor??i.keepUnusedDataFor;if(n===1/0)return;const y=Math.max(0,Math.min(n,Jn));if(!S(h)){const g=M[h];g&&clearTimeout(g),M[h]=setTimeout(()=>{S(h)||u.dispatch(l({queryCacheKey:h})),delete M[h]},y*1e3)}}return m},ct=new Error("Promise never resolved before cacheEntryRemoved."),Xn=({api:e,reducerPath:t,context:r,queryThunk:s,mutationThunk:o,internalState:l})=>{const c=Qe(s),w=Qe(o),b=J(s,o),S={};function M(u,i,a){const n=S[u];n?.valueResolved&&(n.valueResolved({data:i,meta:a}),delete n.valueResolved)}function m(u){const i=S[u];i&&(delete S[u],i.cacheEntryRemoved())}const p=(u,i,a)=>{const n=h(u);function y(g,A,v,d){const O=a[t].queries[A],E=i.getState()[t].queries[A];!O&&E&&f(g,d,A,i,v)}if(s.pending.match(u))y(u.meta.arg.endpointName,n,u.meta.requestId,u.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(u))for(const{queryDescription:g,value:A}of u.payload){const{endpointName:v,originalArgs:d,queryCacheKey:O}=g;y(v,O,u.meta.requestId,d),M(O,A,{})}else if(o.pending.match(u))i.getState()[t].mutations[n]&&f(u.meta.arg.endpointName,u.meta.arg.originalArgs,n,i,u.meta.requestId);else if(b(u))M(n,u.payload,u.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(u)||e.internalActions.removeMutationResult.match(u))m(n);else if(e.util.resetApiState.match(u))for(const g of Object.keys(S))m(g)};function h(u){return c(u)?u.meta.arg.queryCacheKey:w(u)?u.meta.arg.fixedCacheKey??u.meta.requestId:e.internalActions.removeQueryResult.match(u)?u.payload.queryCacheKey:e.internalActions.removeMutationResult.match(u)?le(u.payload):""}function f(u,i,a,n,y){const g=r.endpointDefinitions[u],A=g?.onCacheEntryAdded;if(!A)return;const v={},d=new Promise(q=>{v.cacheEntryRemoved=q}),O=Promise.race([new Promise(q=>{v.valueResolved=q}),d.then(()=>{throw ct})]);O.catch(()=>{}),S[a]=v;const E=e.endpoints[u].select(g.type==="query"?i:a),R=n.dispatch((q,j,D)=>D),I={...n,getCacheEntry:()=>E(n.getState()),requestId:y,extra:R,updateCachedData:g.type==="query"?q=>n.dispatch(e.util.updateQueryData(u,i,q)):void 0,cacheDataLoaded:O,cacheEntryRemoved:d},C=A(i,I);Promise.resolve(C).catch(q=>{if(q!==ct)throw q})}return p},Yn=({api:e,context:{apiUid:t},reducerPath:r})=>(s,o)=>{e.util.resetApiState.match(s)&&o.dispatch(e.internalActions.middlewareRegistered(t))},Zn=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:s,queryThunk:o,api:l,assertTagType:c,refetchQuery:w,internalState:b})=>{const{removeQueryResult:S}=l.internalActions,M=V(J(s),we(s)),m=V(J(s,o),ne(s,o));let p=[];const h=(i,a)=>{M(i)?u(Ot(i,"invalidatesTags",r,c),a):m(i)?u([],a):l.util.invalidateTags.match(i)&&u(ze(i.payload,void 0,void 0,void 0,void 0,c),a)};function f(i){for(const a in i.queries)if(i.queries[a]?.status==="pending")return!0;for(const a in i.mutations)if(i.mutations[a]?.status==="pending")return!0;return!1}function u(i,a){const n=a.getState(),y=n[e];if(p.push(...i),y.config.invalidationBehavior==="delayed"&&f(y))return;const g=p;if(p=[],g.length===0)return;const A=l.util.selectInvalidatedBy(n,g);t.batch(()=>{const v=Array.from(A.values());for(const{queryCacheKey:d}of v){const O=y.queries[d],E=b.currentSubscriptions[d]??{};O&&(te(E)===0?a.dispatch(S({queryCacheKey:d})):O.status!=="uninitialized"&&a.dispatch(w(O)))}})}return h},er=({reducerPath:e,queryThunk:t,api:r,refetchQuery:s,internalState:o})=>{const l={},c=(p,h)=>{(r.internalActions.updateSubscriptionOptions.match(p)||r.internalActions.unsubscribeQueryResult.match(p))&&b(p.payload,h),(t.pending.match(p)||t.rejected.match(p)&&p.meta.condition)&&b(p.meta.arg,h),(t.fulfilled.match(p)||t.rejected.match(p)&&!p.meta.condition)&&w(p.meta.arg,h),r.util.resetApiState.match(p)&&M()};function w({queryCacheKey:p},h){const f=h.getState()[e],u=f.queries[p],i=o.currentSubscriptions[p];if(!u||u.status==="uninitialized")return;const{lowestPollingInterval:a,skipPollingIfUnfocused:n}=m(i);if(!Number.isFinite(a))return;const y=l[p];y?.timeout&&(clearTimeout(y.timeout),y.timeout=void 0);const g=Date.now()+a;l[p]={nextPollTimestamp:g,pollingInterval:a,timeout:setTimeout(()=>{(f.config.focused||!n)&&h.dispatch(s(u)),w({queryCacheKey:p},h)},a)}}function b({queryCacheKey:p},h){const u=h.getState()[e].queries[p],i=o.currentSubscriptions[p];if(!u||u.status==="uninitialized")return;const{lowestPollingInterval:a}=m(i);if(!Number.isFinite(a)){S(p);return}const n=l[p],y=Date.now()+a;(!n||y<n.nextPollTimestamp)&&w({queryCacheKey:p},h)}function S(p){const h=l[p];h?.timeout&&clearTimeout(h.timeout),delete l[p]}function M(){for(const p of Object.keys(l))S(p)}function m(p={}){let h=!1,f=Number.POSITIVE_INFINITY;for(let u in p)p[u].pollingInterval&&(f=Math.min(p[u].pollingInterval,f),h=p[u].skipPollingIfUnfocused||h);return{lowestPollingInterval:f,skipPollingIfUnfocused:h}}return c},tr=({api:e,context:t,queryThunk:r,mutationThunk:s})=>{const o=Le(r,s),l=ne(r,s),c=J(r,s),w={};return(S,M)=>{if(o(S)){const{requestId:m,arg:{endpointName:p,originalArgs:h}}=S.meta,f=t.endpointDefinitions[p],u=f?.onQueryStarted;if(u){const i={},a=new Promise((A,v)=>{i.resolve=A,i.reject=v});a.catch(()=>{}),w[m]=i;const n=e.endpoints[p].select(f.type==="query"?h:m),y=M.dispatch((A,v,d)=>d),g={...M,getCacheEntry:()=>n(M.getState()),requestId:m,extra:y,updateCachedData:f.type==="query"?A=>M.dispatch(e.util.updateQueryData(p,h,A)):void 0,queryFulfilled:a};u(h,g)}}else if(c(S)){const{requestId:m,baseQueryMeta:p}=S.meta;w[m]?.resolve({data:S.payload,meta:p}),delete w[m]}else if(l(S)){const{requestId:m,rejectedWithValue:p,baseQueryMeta:h}=S.meta;w[m]?.reject({error:S.payload??S.error,isUnhandledError:!p,meta:h}),delete w[m]}}},nr=({reducerPath:e,context:t,api:r,refetchQuery:s,internalState:o})=>{const{removeQueryResult:l}=r.internalActions,c=(b,S)=>{Me.match(b)&&w(S,"refetchOnFocus"),Ee.match(b)&&w(S,"refetchOnReconnect")};function w(b,S){const M=b.getState()[e],m=M.queries,p=o.currentSubscriptions;t.batch(()=>{for(const h of Object.keys(p)){const f=m[h],u=p[h];if(!u||!f)continue;(Object.values(u).some(a=>a[S]===!0)||Object.values(u).every(a=>a[S]===void 0)&&M.config[S])&&(te(u)===0?b.dispatch(l({queryCacheKey:h})):f.status!=="uninitialized"&&b.dispatch(s(f)))}})}return c};function rr(e){const{reducerPath:t,queryThunk:r,api:s,context:o}=e,{apiUid:l}=o,c={invalidateTags:K(`${t}/invalidateTags`)},w=m=>m.type.startsWith(`${t}/`),b=[Yn,Gn,Zn,er,Xn,tr];return{middleware:m=>{let p=!1;const f={...e,internalState:{currentSubscriptions:{}},refetchQuery:M,isThisApiSliceAction:w},u=b.map(n=>n(f)),i=Wn(f),a=nr(f);return n=>y=>{if(!Ne(y))return n(y);p||(p=!0,m.dispatch(s.internalActions.middlewareRegistered(l)));const g={...m,next:n},A=m.getState(),[v,d]=i(y,g,A);let O;if(v?O=n(y):O=d,m.getState()[t]&&(a(y,g,A),w(y)||o.hasRehydrationInfo(y)))for(const E of u)E(y,g,A);return O}},actions:c};function M(m){return e.api.endpoints[m.endpointName].initiate(m.originalArgs,{subscribe:!1,forceRefetch:!0})}}var at=Symbol(),ir=({createSelector:e=yt}={})=>({name:at,init(t,{baseQuery:r,tagTypes:s,reducerPath:o,serializeQueryArgs:l,keepUnusedDataFor:c,refetchOnMountOrArgChange:w,refetchOnFocus:b,refetchOnReconnect:S,invalidationBehavior:M},m){Ct();const p=Q=>Q;Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:Ee,onOffline:$e,onFocus:Me,onFocusLost:Ue},util:{}});const{queryThunk:h,mutationThunk:f,patchQueryData:u,updateQueryData:i,upsertQueryData:a,prefetch:n,buildMatchThunkActions:y}=zn({baseQuery:r,reducerPath:o,context:m,api:t,serializeQueryArgs:l,assertTagType:p}),{reducer:g,actions:A}=Kn({context:m,queryThunk:h,mutationThunk:f,serializeQueryArgs:l,reducerPath:o,assertTagType:p,config:{refetchOnFocus:b,refetchOnReconnect:S,refetchOnMountOrArgChange:w,keepUnusedDataFor:c,reducerPath:o,invalidationBehavior:M}});W(t.util,{patchQueryData:u,updateQueryData:i,upsertQueryData:a,prefetch:n,resetApiState:A.resetApiState,upsertQueryEntries:A.cacheEntriesUpserted}),W(t.internalActions,A);const{middleware:v,actions:d}=rr({reducerPath:o,context:m,queryThunk:h,mutationThunk:f,api:t,assertTagType:p});W(t.util,d),W(t,{reducer:g,middleware:v});const{buildQuerySelector:O,buildMutationSelector:E,selectInvalidatedBy:R,selectCachedArgsForQuery:I}=Bn({serializeQueryArgs:l,reducerPath:o,createSelector:e});W(t.util,{selectInvalidatedBy:R,selectCachedArgsForQuery:I});const{buildInitiateQuery:C,buildInitiateMutation:q,getRunningMutationThunk:j,getRunningMutationsThunk:D,getRunningQueriesThunk:x,getRunningQueryThunk:$}=$n({queryThunk:h,mutationThunk:f,api:t,serializeQueryArgs:l,context:m});return W(t.util,{getRunningMutationThunk:j,getRunningMutationsThunk:D,getRunningQueryThunk:$,getRunningQueriesThunk:x}),{name:at,injectEndpoint(Q,N){const P=t;P.endpoints[Q]??={},Et(N)?W(P.endpoints[Q],{name:Q,select:O(Q,N),initiate:C(Q,N)},y(h,Q)):Ln(N)&&W(P.endpoints[Q],{name:Q,select:E(),initiate:q(Q)},y(f,Q))}}}});function Ce(e){return e.replace(e[0],e[0].toUpperCase())}function sr(e){return e.type==="query"}function or(e){return e.type==="mutation"}function he(e,...t){return Object.assign(e,...t)}var lt=WeakMap?new WeakMap:void 0,ur=({endpointName:e,queryArgs:t})=>{let r="";const s=lt?.get(t);if(typeof s=="string")r=s;else{const o=JSON.stringify(t,(l,c)=>(c=typeof c=="bigint"?{$bigint:c.toString()}:c,c=B(c)?Object.keys(c).sort().reduce((w,b)=>(w[b]=c[b],w),{}):c,c));B(t)&&lt?.set(t,o),r=o}return`${e}(${r})`},qe=Symbol();function ft(e,t,r,s){const o=T.useMemo(()=>({queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:r,endpointName:s}):e}),[e,t,r,s]),l=T.useRef(o);return T.useEffect(()=>{l.current.serialized!==o.serialized&&(l.current=o)},[o]),l.current.serialized===o.serialized?l.current.queryArgs:e}function je(e){const t=T.useRef(e);return T.useEffect(()=>{ue(t.current,e)||(t.current=e)},[e]),ue(t.current,e)?t.current:e}var cr=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ar=cr(),lr=()=>typeof navigator<"u"&&navigator.product==="ReactNative",fr=lr(),dr=()=>ar||fr?T.useLayoutEffect:T.useEffect,pr=dr(),yr=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Rt.pending}:e;function hr({api:e,moduleOptions:{batch:t,hooks:{useDispatch:r,useSelector:s,useStore:o},unstable__sideEffectsInRender:l,createSelector:c},serializeQueryArgs:w,context:b}){const S=l?f=>f():T.useEffect;return{buildQueryHooks:p,buildMutationHook:h,usePrefetch:m};function M(f,u,i){if(u?.endpointName&&f.isUninitialized){const{endpointName:v}=u,d=b.endpointDefinitions[v];i!==H&&w({queryArgs:u.originalArgs,endpointDefinition:d,endpointName:v})===w({queryArgs:i,endpointDefinition:d,endpointName:v})&&(u=void 0)}let a=f.isSuccess?f.data:u?.data;a===void 0&&(a=f.data);const n=a!==void 0,y=f.isLoading,g=(!u||u.isLoading||u.isUninitialized)&&!n&&y,A=f.isSuccess||n&&(y&&!u?.isError||f.isUninitialized);return{...f,data:a,currentData:f.data,isFetching:y,isLoading:g,isSuccess:A}}function m(f,u){const i=r(),a=je(u);return T.useCallback((n,y)=>i(e.util.prefetch(f,n,{...a,...y})),[f,i,a])}function p(f){const u=(n,{refetchOnReconnect:y,refetchOnFocus:g,refetchOnMountOrArgChange:A,skip:v=!1,pollingInterval:d=0,skipPollingIfUnfocused:O=!1}={})=>{const{initiate:E}=e.endpoints[f],R=r(),I=T.useRef(void 0);if(!I.current){const P=R(e.internalActions.internal_getRTKQSubscriptions());I.current=P}const C=ft(v?H:n,ur,b.endpointDefinitions[f],f),q=je({refetchOnReconnect:y,refetchOnFocus:g,pollingInterval:d,skipPollingIfUnfocused:O}),j=T.useRef(!1),D=T.useRef(void 0);let{queryCacheKey:x,requestId:$}=D.current||{},Q=!1;x&&$&&(Q=I.current.isRequestSubscribed(x,$));const N=!Q&&j.current;return S(()=>{j.current=Q}),S(()=>{N&&(D.current=void 0)},[N]),S(()=>{const P=D.current;if(C===H){P?.unsubscribe(),D.current=void 0;return}const z=D.current?.subscriptionOptions;if(!P||P.arg!==C){P?.unsubscribe();const _=R(E(C,{subscriptionOptions:q,forceRefetch:A}));D.current=_}else q!==z&&P.updateSubscriptionOptions(q)},[R,E,A,C,q,N]),T.useEffect(()=>()=>{D.current?.unsubscribe(),D.current=void 0},[]),T.useMemo(()=>({refetch:()=>{if(!D.current)throw new Error(U(38));return D.current?.refetch()}}),[])},i=({refetchOnReconnect:n,refetchOnFocus:y,pollingInterval:g=0,skipPollingIfUnfocused:A=!1}={})=>{const{initiate:v}=e.endpoints[f],d=r(),[O,E]=T.useState(qe),R=T.useRef(void 0),I=je({refetchOnReconnect:n,refetchOnFocus:y,pollingInterval:g,skipPollingIfUnfocused:A});S(()=>{const D=R.current?.subscriptionOptions;I!==D&&R.current?.updateSubscriptionOptions(I)},[I]);const C=T.useRef(I);S(()=>{C.current=I},[I]);const q=T.useCallback(function(D,x=!1){let $;return t(()=>{R.current?.unsubscribe(),R.current=$=d(v(D,{subscriptionOptions:C.current,forceRefetch:!x})),E(D)}),$},[d,v]),j=T.useCallback(()=>{R.current?.queryCacheKey&&d(e.internalActions.removeQueryResult({queryCacheKey:R.current?.queryCacheKey}))},[d]);return T.useEffect(()=>()=>{R?.current?.unsubscribe()},[]),T.useEffect(()=>{O!==qe&&!R.current&&q(O,!0)},[O,q]),T.useMemo(()=>[q,O,{reset:j}],[q,O,j])},a=(n,{skip:y=!1,selectFromResult:g}={})=>{const{select:A}=e.endpoints[f],v=ft(y?H:n,w,b.endpointDefinitions[f],f),d=T.useRef(void 0),O=T.useMemo(()=>c([A(v),(q,j)=>j,q=>v],M,{memoizeOptions:{resultEqualityCheck:ue}}),[A,v]),E=T.useMemo(()=>g?c([O],g,{devModeChecks:{identityFunctionCheck:"never"}}):O,[O,g]),R=s(q=>E(q,d.current),ue),I=o(),C=O(I.getState(),d.current);return pr(()=>{d.current=C},[C]),R};return{useQueryState:a,useQuerySubscription:u,useLazyQuerySubscription:i,useLazyQuery(n){const[y,g,{reset:A}]=i(n),v=a(g,{...n,skip:g===qe}),d=T.useMemo(()=>({lastArg:g}),[g]);return T.useMemo(()=>[y,{...v,reset:A},d],[y,v,A,d])},useQuery(n,y){const g=u(n,y),A=a(n,{selectFromResult:n===H||y?.skip?void 0:yr,...y}),{data:v,status:d,isLoading:O,isSuccess:E,isError:R,error:I}=A;return T.useDebugValue({data:v,status:d,isLoading:O,isSuccess:E,isError:R,error:I}),T.useMemo(()=>({...A,...g}),[A,g])}}}function h(f){return({selectFromResult:u,fixedCacheKey:i}={})=>{const{select:a,initiate:n}=e.endpoints[f],y=r(),[g,A]=T.useState();T.useEffect(()=>()=>{g?.arg.fixedCacheKey||g?.reset()},[g]);const v=T.useCallback(function(z){const _=y(n(z,{fixedCacheKey:i}));return A(_),_},[y,n,i]),{requestId:d}=g||{},O=T.useMemo(()=>a({fixedCacheKey:i,requestId:g?.requestId}),[i,g,a]),E=T.useMemo(()=>u?c([O],u):O,[u,O]),R=s(E,ue),I=i==null?g?.arg.originalArgs:void 0,C=T.useCallback(()=>{t(()=>{g&&A(void 0),i&&y(e.internalActions.removeMutationResult({requestId:d,fixedCacheKey:i}))})},[y,i,g,d]),{endpointName:q,data:j,status:D,isLoading:x,isSuccess:$,isError:Q,error:N}=R;T.useDebugValue({endpointName:q,data:j,status:D,isLoading:x,isSuccess:$,isError:Q,error:N});const P=T.useMemo(()=>({...R,originalArgs:I,reset:C}),[R,I,C]);return T.useMemo(()=>[v,P],[v,P])}}}var gr=Symbol(),mr=({batch:e=Dt,hooks:t={useDispatch:Tt,useSelector:Qt,useStore:kt},createSelector:r=yt,unstable__sideEffectsInRender:s=!1,...o}={})=>({name:gr,init(l,{serializeQueryArgs:c},w){const b=l,{buildQueryHooks:S,buildMutationHook:M,usePrefetch:m}=hr({api:l,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:s,createSelector:r},serializeQueryArgs:c,context:w});return he(b,{usePrefetch:m}),he(w,{batch:e}),{injectEndpoint(p,h){if(sr(h)){const{useQuery:f,useLazyQuery:u,useLazyQuerySubscription:i,useQueryState:a,useQuerySubscription:n}=S(p);he(b.endpoints[p],{useQuery:f,useLazyQuery:u,useLazyQuerySubscription:i,useQueryState:a,useQuerySubscription:n}),l[`use${Ce(p)}Query`]=f,l[`useLazy${Ce(p)}Query`]=u}else if(or(h)){const f=M(p);he(b.endpoints[p],{useMutation:f}),l[`use${Ce(p)}Mutation`]=f}}}}}),Cr=Vn(ir(),mr());export{Er as a,Cr as b,Z as c,Ge as d,xe as e,Ar as f,Or as g,Mr as h,we as i,Ir as s};
