@isardsat/editorial-admin 6.0.3 → 6.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/assets/{authSlice-5XZo_yNS.js → authSlice-B3Tyl-Nw.js} +181 -181
- package/build/client/assets/button-Da66T3Bb.js +1 -0
- package/build/client/assets/{chevron-down-BMtosYlL.js → chevron-down-D_Gla76b.js} +1 -1
- package/build/client/assets/chunk-KNED5TY2-DAA_sFzt.js +51 -0
- package/build/client/assets/{createLucideIcon-TQsNVzYU.js → createLucideIcon-R2-3a7hN.js} +1 -1
- package/build/client/assets/dashboard-BTu7-8Ba.js +1 -0
- package/build/client/assets/dashboard._collection-MtSHvYYW.js +16 -0
- package/build/client/assets/dashboard._collection._document-CRkC98aa.js +1 -0
- package/build/client/assets/dashboard._collection.new-BFe8yV0Z.js +1 -0
- package/build/client/assets/dashboard._layout-BjRnQPQr.js +66 -0
- package/build/client/assets/dashboard.files-DKh39mcB.js +36 -0
- package/build/client/assets/editorialApi-fQchmMa9.js +1 -0
- package/build/client/assets/entry.client-BGu2H8xv.js +34 -0
- package/build/client/assets/home-C2nWtN4c.js +11 -0
- package/build/client/assets/index-Bd1u2_LZ.js +45 -0
- package/build/client/assets/{index-D4Mj6Lef.js → index-BvKqmqc2.js} +1 -1
- package/build/client/assets/index-C-vcF2DZ.js +9 -0
- package/build/client/assets/{index-DZxX-xes.js → index-DeO5nu0f.js} +2 -2
- package/build/client/assets/{input-D-kT9R-x.js → input-BmmdOdbj.js} +2 -2
- package/build/client/assets/itemForm-CDbHkFXh.css +1 -0
- package/build/client/assets/itemForm-DlRBjBsd.js +90 -0
- package/build/client/assets/manifest-2ff77582.js +1 -0
- package/build/client/assets/react-redux-kbMjYGuQ.js +9 -0
- package/build/client/assets/root-DS7N36v7.css +1 -0
- package/build/client/assets/root-wKvfXBjk.js +1 -0
- package/build/client/assets/{trash-B3lfbu-5.js → trash-wq_ppIxP.js} +1 -1
- package/build/client/assets/{tslib.es6-De9GV7Vy.js → tslib.es6-CDuPK5Eb.js} +1 -1
- package/build/client/assets/utils-DslUJpbf.js +1 -0
- package/build/client/index.html +10 -18
- package/package.json +13 -11
- package/build/client/__spa-fallback.html +0 -13
- package/build/client/admin/index.html +0 -22
- package/build/client/assets/button-V-1j5t4f.js +0 -1
- package/build/client/assets/chunk-KNED5TY2-CXj9yqcQ.js +0 -51
- package/build/client/assets/dashboard-Be6nTcTN.js +0 -1
- package/build/client/assets/dashboard._collection-DppEZSog.js +0 -16
- package/build/client/assets/dashboard._collection._document-DX_V-XK4.js +0 -1
- package/build/client/assets/dashboard._collection.new-CocdSIiG.js +0 -1
- package/build/client/assets/dashboard._layout-Df-C65Il.js +0 -65
- package/build/client/assets/dashboard.files-Doq5nv7_.js +0 -36
- package/build/client/assets/editorialApi-CykQGjTu.js +0 -1
- package/build/client/assets/entry.client-B5Ca3clj.js +0 -34
- package/build/client/assets/home-ZtJfV8P0.js +0 -11
- package/build/client/assets/index-B7e3fQ32.js +0 -9
- package/build/client/assets/index-CMEgjExU.js +0 -46
- package/build/client/assets/itemForm-CcPfHU2b.css +0 -1
- package/build/client/assets/itemForm-ChV6tjGl.js +0 -99
- package/build/client/assets/manifest-a1ca6f8e.js +0 -1
- package/build/client/assets/react-redux-D9l7ZD4q.js +0 -9
- package/build/client/assets/root-BvXgIVX7.js +0 -1
- package/build/client/assets/root-DhulzpWQ.css +0 -1
- package/build/client/assets/utils-BJX_0rcU.js +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import{w as y}from"./react-redux-kbMjYGuQ.js";import{n as e,a as j,t as g}from"./chunk-KNED5TY2-DAA_sFzt.js";import{m as u,n as v}from"./editorialApi-fQchmMa9.js";import{c as N,f as k}from"./utils-DslUJpbf.js";import{c as o}from"./createLucideIcon-R2-3a7hN.js";import{C as w}from"./chevron-down-D_Gla76b.js";import{T as n}from"./trash-wq_ppIxP.js";/**
|
|
2
|
+
* @license lucide-react v0.487.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const b=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],r=o("copy",b);/**
|
|
7
|
+
* @license lucide-react v0.487.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const z=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],_=o("ellipsis",z);/**
|
|
12
|
+
* @license lucide-react v0.487.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const F=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],M=o("file-image",F);/**
|
|
17
|
+
* @license lucide-react v0.487.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const H=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],C=o("file-text",H);/**
|
|
22
|
+
* @license lucide-react v0.487.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const $=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],T=o("file",$);/**
|
|
27
|
+
* @license lucide-react v0.487.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const I=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],L=o("folder-open",I);/**
|
|
32
|
+
* @license lucide-react v0.487.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const q=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],D=o("folder",q),E=["txt","md","html","pdf"],S=["svg","webp","png","jpeg","jpg"],V=[{Icon:M,test:s=>S.some(i=>s.name.endsWith(i))},{Icon:C,test:s=>E.some(i=>s.name.endsWith(i))}],P={Icon:T},d=({node:s,level:i=0,onDelete:c})=>{const[a,p]=j.useState(!1),m=V.find(t=>t.test(s))??P,l=s.type==="directory",x=l?"div":g,h=()=>{l&&p(!a)};return e.jsxs("div",{className:"select-none",children:[e.jsxs(x,{to:s.path,target:"_blank",className:"flex items-center gap-2 h-10 p-2 group hover:bg-muted/50 cursor-pointer",style:{paddingLeft:`calc(0.5rem + ${i*20}px)`},onClick:h,children:[l?e.jsx(w,{size:16,className:N("transition-transform",{"rotate-180":a})}):e.jsx("div",{className:"w-4"}),e.jsxs("div",{className:"flex flex-grow w-24 items-center gap-2 ml-2",children:[l?a?e.jsx(L,{size:16,className:"text-yellow-500"}):e.jsx(D,{size:16,className:"text-yellow-500"}):e.jsx(m.Icon,{size:16,className:" text-gray-500"}),e.jsx("span",{className:"text-sm whitespace-nowrap text-ellipsis overflow-hidden w-full",children:s.name})]}),e.jsx("div",{className:"flex w-24 justify-end gap-2",children:e.jsx("span",{className:"text-sm text-gray-500",children:l?"--":k(s.size)})}),e.jsxs("div",{className:"flex items-center gap-1 ml-4 group-hover:visible invisible z-20",children:[l?e.jsx(r,{className:"invisible",size:16}):e.jsxs("button",{className:"hover:text-yellow-500 p-1 hover:bg-muted rounded-sm",onClick:t=>{t.preventDefault(),t.stopPropagation(),navigator.clipboard.writeText(s.path)},children:[e.jsx(r,{size:16}),e.jsx("span",{className:"sr-only",children:"Copy file URL"})]}),e.jsxs("button",{className:"hover:text-red-500 p-1 hover:bg-muted rounded-sm",onClick:t=>{t.preventDefault(),t.stopPropagation(),c(s.path)},children:[e.jsx(n,{size:16}),e.jsx("span",{className:"sr-only",children:"Delete this file"})]})]})]}),l&&a&&s.children&&e.jsx("div",{children:s.children.map((t,f)=>e.jsx(d,{node:t,level:i+1,onDelete:c},`${t.name}-${f}`))})]})};function Z(){const{data:s,isLoading:i}=u(),[c]=v();return!s||i?null:s.toSorted(a=>a.type==="directory"?-1:1).map(a=>e.jsx(d,{node:a,onDelete:c},a.name))}const B=y(function(){return e.jsx("div",{className:"overflow-auto flex flex-1 p-4 gap-4",children:e.jsx("div",{className:"flex flex-col flex-1 gap-8",children:e.jsxs("div",{className:"overflow-auto h-full max-w-[800px] rounded-xl border",children:[e.jsxs("div",{className:"sticky top-0 bg-white flex items-center gap-2 py-1 px-2 border-b group",children:[e.jsx("div",{className:"w-4"}),e.jsx("div",{className:"flex flex-grow items-center gap-2 ml-2",children:e.jsx("span",{className:"text-sm font-semibold",children:"Name"})}),e.jsx("div",{className:"flex w-24 items-center gap-2 ml-2",children:e.jsx("span",{className:"text-sm font-semibold",children:"Size"})}),e.jsxs("div",{className:"flex items-center gap-1 invisible",children:[e.jsx(r,{size:14}),e.jsx(n,{size:14}),e.jsx(_,{size:14})]})]}),e.jsx(Z,{})]})})})});export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as K,n as He,g as Ke,h as tt,j as Y,e as Ee,S as ee,f as B,p as X,k as ue,l as be,m as W,o as Te,q as nt,r as Se,s as fe,t as Re,v as We,x as rt,y as Be,z as st,A as we,B as it,C as ot,D as ut,d as ct,b as at,u as lt,E as te}from"./react-redux-kbMjYGuQ.js";import{a as C}from"./chunk-KNED5TY2-DAA_sFzt.js";function dt(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ft(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function pt(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(l=>typeof l=="function")){const l=e.map(m=>typeof m=="function"?`function ${m.name||"unnamed"}()`:typeof m).join(", ");throw new TypeError(`${t}[${l}]`)}}var Qe=e=>Array.isArray(e)?e:[e];function yt(e){const t=Array.isArray(e[0])?e[0]:e;return pt(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function gt(e,t){const l=[],{length:m}=e;for(let p=0;p<m;p++)l.push(e[p].apply(null,t));return l}var ht=class{constructor(e){this.value=e}deref(){return this.value}},mt=typeof WeakRef<"u"?WeakRef:ht,vt=0,Ie=1;function se(){return{s:vt,v:void 0,o:null,p:null}}function ce(e,t={}){let l=se();const{resultEqualityCheck:m}=t;let p,R=0;function b(){var M;let A=l;const{length:Q}=arguments;for(let f=0,i=Q;f<i;f++){const a=arguments[f];if(typeof a=="function"||typeof a=="object"&&a!==null){let r=A.o;r===null&&(A.o=r=new WeakMap);const d=r.get(a);d===void 0?(A=se(),r.set(a,A)):A=d}else{let r=A.p;r===null&&(A.p=r=new Map);const d=r.get(a);d===void 0?(A=se(),r.set(a,A)):A=d}}const O=A;let T;if(A.s===Ie)T=A.v;else if(T=e.apply(null,arguments),R++,m){const f=((M=p==null?void 0:p.deref)==null?void 0:M.call(p))??p;f!=null&&m(f,T)&&(T=f,R!==0&&R--),p=typeof T=="object"&&T!==null||typeof T=="function"?new mt(T):T}return O.s=Ie,O.v=T,T}return b.clearCache=()=>{l=se(),b.resetResultsCount()},b.resultsCount=()=>R,b.resetResultsCount=()=>{R=0},b}function bt(e,...t){const l=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,m=(...p)=>{let R=0,b=0,A,Q={},O=p.pop();typeof O=="object"&&(Q=O,O=p.pop()),dt(O,`createSelector expects an output function after the inputs, but received: [${typeof O}]`);const T={...l,...Q},{memoize:M,memoizeOptions:f=[],argsMemoize:i=ce,argsMemoizeOptions:a=[]}=T,r=Qe(f),d=Qe(a),q=yt(p),n=M(function(){return R++,O.apply(null,arguments)},...r),s=i(function(){b++;const S=gt(q,arguments);return A=n.apply(null,S),A},...d);return Object.assign(s,{resultFunc:O,memoizedResultFunc:n,dependencies:q,dependencyRecomputations:()=>b,resetDependencyRecomputations:()=>{b=0},lastResult:()=>A,recomputations:()=>R,resetRecomputations:()=>{R=0},memoize:M,argsMemoize:i})};return Object.assign(m,{withTypes:()=>m}),m}var qe=bt(ce),St=Object.assign((e,t=qe)=>{ft(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const l=Object.keys(e),m=l.map(R=>e[R]);return t(m,(...R)=>R.reduce((b,A,Q)=>(b[l[Q]]=A,b),{}))},{withTypes:()=>St}),Ve=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Ve||{});function Rt(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var De=K;function Je(e,t){if(e===t||!(De(e)&&De(t)||Array.isArray(e)&&Array.isArray(t)))return t;const l=Object.keys(t),m=Object.keys(e);let p=l.length===m.length;const R=Array.isArray(t)?[]:{};for(const b of l)R[b]=Je(e[b],t[b]),p&&(p=e[b]===R[b]);return p?e:R}function G(e){let t=0;for(const l in e)t++;return t}var Ce=e=>[].concat(...e);function qt(e){return new RegExp("(^|:)//").test(e)}function Ot(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function ae(e){return e!=null}function Mt(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var At=e=>e.replace(/\/$/,""),Et=e=>e.replace(/^\//,"");function Tt(e,t){if(!e)return t;if(!t)return e;if(qt(t))return t;const l=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=At(e),t=Et(t),`${e}${l}${t}`}function wt(e,t,l){return e.has(t)?e.get(t):e.set(t,l).get(t)}var je=(...e)=>fetch(...e),Qt=e=>e.status>=200&&e.status<=299,It=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function ke(e){if(!K(e))return e;const t={...e};for(const[l,m]of Object.entries(t))m===void 0&&delete t[l];return t}function Dt({baseUrl:e,prepareHeaders:t=M=>M,fetchFn:l=je,paramsSerializer:m,isJsonContentType:p=It,jsonContentType:R="application/json",jsonReplacer:b,timeout:A,responseHandler:Q,validateStatus:O,...T}={}){return typeof fetch>"u"&&l===je&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(f,i,a)=>{const{getState:r,extra:d,endpoint:q,forced:n,type:s}=i;let u,{url:S,headers:g=new Headers(T.headers),params:o=void 0,responseHandler:y=Q??"json",validateStatus:h=O??Qt,timeout:c=A,...v}=typeof f=="string"?{url:f}:f,E,w=i.signal;c&&(E=new AbortController,i.signal.addEventListener("abort",E.abort),w=E.signal);let I={...T,signal:w,...v};g=new Headers(ke(g)),I.headers=await t(g,{getState:r,arg:f,extra:d,endpoint:q,forced:n,type:s,extraOptions:a})||g;const D=U=>typeof U=="object"&&(K(U)||Array.isArray(U)||typeof U.toJSON=="function");if(!I.headers.has("content-type")&&D(I.body)&&I.headers.set("content-type",R),D(I.body)&&p(I.headers)&&(I.body=JSON.stringify(I.body,b)),o){const U=~S.indexOf("?")?"&":"?",H=m?m(o):new URLSearchParams(ke(o));S+=U+H}S=Tt(e,S);const P=new Request(S,I);u={request:new Request(S,I)};let j,z=!1,k=E&&setTimeout(()=>{z=!0,E.abort()},c);try{j=await l(P)}catch(U){return{error:{status:z?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(U)},meta:u}}finally{k&&clearTimeout(k),E==null||E.signal.removeEventListener("abort",E.abort)}const L=j.clone();u.response=L;let $,_="";try{let U;if(await Promise.all([M(j,y).then(H=>$=H,H=>U=H),L.text().then(H=>_=H,()=>{})]),U)throw U}catch(U){return{error:{status:"PARSING_ERROR",originalStatus:j.status,data:_,error:String(U)},meta:u}}return h(j,$)?{data:$,meta:u}:{error:{status:j.status,data:$},meta:u}};async function M(f,i){if(typeof i=="function")return i(f);if(i==="content-type"&&(i=p(f.headers)?"json":"text"),i==="json"){const a=await f.text();return a.length?JSON.parse(a):null}return f.text()}}var Pe=class{constructor(e,t=void 0){this.value=e,this.meta=t}},le=Y("__rtkq/focused"),Oe=Y("__rtkq/unfocused"),de=Y("__rtkq/online"),Me=Y("__rtkq/offline"),pe=!1;function gn(e,t){function l(){const m=()=>e(le()),p=()=>e(Oe()),R=()=>e(de()),b=()=>e(Me()),A=()=>{window.document.visibilityState==="visible"?m():p()};return pe||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",A,!1),window.addEventListener("focus",m,!1),window.addEventListener("online",R,!1),window.addEventListener("offline",b,!1),pe=!0),()=>{window.removeEventListener("focus",m),window.removeEventListener("visibilitychange",A),window.removeEventListener("online",R),window.removeEventListener("offline",b),pe=!1}}return l()}function Ge(e){return e.type==="query"}function Ct(e){return e.type==="mutation"}function Ae(e,t,l,m,p,R){return jt(e)?e(t,l,m,p).filter(ae).map(me).map(R):Array.isArray(e)?e.map(me).map(R):[]}function jt(e){return typeof e=="function"}function me(e){return typeof e=="string"?{type:e}:e}function kt(e,t){return e.catch(t)}var ne=Symbol("forceQueryFn"),ve=e=>typeof e[ne]=="function";function Pt({serializeQueryArgs:e,queryThunk:t,mutationThunk:l,api:m,context:p}){const R=new Map,b=new Map,{unsubscribeQueryResult:A,removeMutationResult:Q,updateSubscriptionOptions:O}=m.internalActions;return{buildInitiateQuery:a,buildInitiateMutation:r,getRunningQueryThunk:T,getRunningMutationThunk:M,getRunningQueriesThunk:f,getRunningMutationsThunk:i};function T(d,q){return n=>{var S;const s=p.endpointDefinitions[d],u=e({queryArgs:q,endpointDefinition:s,endpointName:d});return(S=R.get(n))==null?void 0:S[u]}}function M(d,q){return n=>{var s;return(s=b.get(n))==null?void 0:s[q]}}function f(){return d=>Object.values(R.get(d)||{}).filter(ae)}function i(){return d=>Object.values(b.get(d)||{}).filter(ae)}function a(d,q){const n=(s,{subscribe:u=!0,forceRefetch:S,subscriptionOptions:g,[ne]:o,...y}={})=>(h,c)=>{var $;const v=e({queryArgs:s,endpointDefinition:q,endpointName:d}),E=t({...y,type:"query",subscribe:u,forceRefetch:S,subscriptionOptions:g,endpointName:d,originalArgs:s,queryCacheKey:v,[ne]:o}),w=m.endpoints[d].select(s),I=h(E),D=w(c()),{requestId:P,abort:F}=I,j=D.requestId!==P,z=($=R.get(h))==null?void 0:$[v],k=()=>w(c()),L=Object.assign(o?I.then(k):j&&!z?Promise.resolve(D):Promise.all([z,I]).then(k),{arg:s,requestId:P,subscriptionOptions:g,queryCacheKey:v,abort:F,async unwrap(){const _=await L;if(_.isError)throw _.error;return _.data},refetch:()=>h(n(s,{subscribe:!1,forceRefetch:!0})),unsubscribe(){u&&h(A({queryCacheKey:v,requestId:P}))},updateSubscriptionOptions(_){L.subscriptionOptions=_,h(O({endpointName:d,requestId:P,queryCacheKey:v,options:_}))}});if(!z&&!j&&!o){const _=wt(R,h,{});_[v]=L,L.then(()=>{delete _[v],G(_)||R.delete(h)})}return L};return n}function r(d){return(q,{track:n=!0,fixedCacheKey:s}={})=>(u,S)=>{const g=l({type:"mutation",endpointName:d,originalArgs:q,track:n,fixedCacheKey:s}),o=u(g),{requestId:y,abort:h,unwrap:c}=o,v=kt(o.unwrap().then(D=>({data:D})),D=>({error:D})),E=()=>{u(Q({requestId:y,fixedCacheKey:s}))},w=Object.assign(v,{arg:o.arg,requestId:y,abort:h,unwrap:c,reset:E}),I=b.get(u)||{};return b.set(u,I),I[y]=w,w.then(()=>{delete I[y],G(I)||b.delete(u)}),s&&(I[s]=w,w.then(()=>{I[s]===w&&(delete I[s],G(I)||b.delete(u))})),w}}}function Fe(e){return e}function Ft({reducerPath:e,baseQuery:t,context:{endpointDefinitions:l},serializeQueryArgs:m,api:p,assertTagType:R}){const b=(n,s,u,S)=>(g,o)=>{const y=l[n],h=m({queryArgs:s,endpointDefinition:y,endpointName:n});if(g(p.internalActions.queryResultPatched({queryCacheKey:h,patches:u})),!S)return;const c=p.endpoints[n].select(s)(o()),v=Ae(y.providesTags,c.data,void 0,s,{},R);g(p.internalActions.updateProvidedBy({queryCacheKey:h,providedTags:v}))},A=(n,s,u,S=!0)=>(g,o)=>{const h=p.endpoints[n].select(s)(o()),c={patches:[],inversePatches:[],undo:()=>g(p.util.patchQueryData(n,s,c.inversePatches,S))};if(h.status==="uninitialized")return c;let v;if("data"in h)if(rt(h.data)){const[E,w,I]=Be(h.data,u);c.patches.push(...w),c.inversePatches.push(...I),v=E}else v=u(h.data),c.patches.push({op:"replace",path:[],value:v}),c.inversePatches.push({op:"replace",path:[],value:h.data});return c.patches.length===0||g(p.util.patchQueryData(n,s,c.patches,S)),c},Q=(n,s,u)=>S=>S(p.endpoints[n].initiate(s,{subscribe:!1,forceRefetch:!0,[ne]:()=>({data:u})})),O=async(n,{signal:s,abort:u,rejectWithValue:S,fulfillWithValue:g,dispatch:o,getState:y,extra:h})=>{const c=l[n.endpointName];try{let v=Fe,E;const w={signal:s,abort:u,dispatch:o,getState:y,extra:h,endpoint:n.endpointName,type:n.type,forced:n.type==="query"?T(n,y()):void 0,queryCacheKey:n.type==="query"?n.queryCacheKey:void 0},I=n.type==="query"?n[ne]:void 0;if(I?E=I():c.query?(E=await t(c.query(n.originalArgs),w,c.extraOptions),c.transformResponse&&(v=c.transformResponse)):E=await c.queryFn(n.originalArgs,w,c.extraOptions,D=>t(D,w,c.extraOptions)),typeof process<"u",E.error)throw new Pe(E.error,E.meta);return g(await v(E.data,E.meta,n.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:E.meta,[ee]:!0})}catch(v){let E=v;if(E instanceof Pe){let w=Fe;c.query&&c.transformErrorResponse&&(w=c.transformErrorResponse);try{return S(await w(E.value,E.meta,n.originalArgs),{baseQueryMeta:E.meta,[ee]:!0})}catch(I){E=I}}throw console.error(E),E}};function T(n,s){var y,h,c;const u=(h=(y=s[e])==null?void 0:y.queries)==null?void 0:h[n.queryCacheKey],S=(c=s[e])==null?void 0:c.config.refetchOnMountOrArgChange,g=u==null?void 0:u.fulfilledTimeStamp,o=n.forceRefetch??(n.subscribe&&S);return o?o===!0||(Number(new Date)-Number(g))/1e3>=o:!1}const M=Ee(`${e}/executeQuery`,O,{getPendingMeta(){return{startedTimeStamp:Date.now(),[ee]:!0}},condition(n,{getState:s}){var c,v,E;const u=s(),S=(v=(c=u[e])==null?void 0:c.queries)==null?void 0:v[n.queryCacheKey],g=S==null?void 0:S.fulfilledTimeStamp,o=n.originalArgs,y=S==null?void 0:S.originalArgs,h=l[n.endpointName];return ve(n)?!0:(S==null?void 0:S.status)==="pending"?!1:T(n,u)||Ge(h)&&((E=h==null?void 0:h.forceRefetch)!=null&&E.call(h,{currentArg:o,previousArg:y,endpointState:S,state:u}))?!0:!g},dispatchConditionRejection:!0}),f=Ee(`${e}/executeMutation`,O,{getPendingMeta(){return{startedTimeStamp:Date.now(),[ee]:!0}}}),i=n=>"force"in n,a=n=>"ifOlderThan"in n,r=(n,s,u)=>(S,g)=>{const o=i(u)&&u.force,y=a(u)&&u.ifOlderThan,h=(v=!0)=>{const E={forceRefetch:v,isPrefetch:!0};return p.endpoints[n].initiate(s,E)},c=p.endpoints[n].select(s)(g());if(o)S(h());else if(y){const v=c==null?void 0:c.fulfilledTimeStamp;if(!v){S(h());return}(Number(new Date)-Number(new Date(v)))/1e3>=y&&S(h())}else S(h(!1))};function d(n){return s=>{var u,S;return((S=(u=s==null?void 0:s.meta)==null?void 0:u.arg)==null?void 0:S.endpointName)===n}}function q(n,s){return{matchPending:fe(We(n),d(s)),matchFulfilled:fe(W(n),d(s)),matchRejected:fe(Re(n),d(s))}}return{queryThunk:M,mutationThunk:f,prefetch:r,updateQueryData:A,upsertQueryData:Q,patchQueryData:b,buildMatchThunkActions:q}}function Ye(e,t,l,m){return Ae(l[e.meta.arg.endpointName][t],W(e)?e.payload:void 0,be(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,m)}function ie(e,t,l){const m=e[t];m&&l(m)}function re(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function ze(e,t,l){const m=e[re(t)];m&&l(m)}var Z={};function zt({reducerPath:e,queryThunk:t,mutationThunk:l,serializeQueryArgs:m,context:{endpointDefinitions:p,apiUid:R,extractRehydrationInfo:b,hasRehydrationInfo:A},assertTagType:Q,config:O}){const T=Y(`${e}/resetApiState`);function M(g,o,y,h){var c;g[c=o.queryCacheKey]??(g[c]={status:"uninitialized",endpointName:o.endpointName}),ie(g,o.queryCacheKey,v=>{v.status="pending",v.requestId=y&&v.requestId?v.requestId:h.requestId,o.originalArgs!==void 0&&(v.originalArgs=o.originalArgs),v.startedTimeStamp=h.startedTimeStamp})}function f(g,o,y,h){ie(g,o.arg.queryCacheKey,c=>{if(c.requestId!==o.requestId&&!h)return;const{merge:v}=p[o.arg.endpointName];if(c.status="fulfilled",v)if(c.data!==void 0){const{fulfilledTimeStamp:E,arg:w,baseQueryMeta:I,requestId:D}=o;let P=Se(c.data,F=>v(F,y,{arg:w.originalArgs,baseQueryMeta:I,fulfilledTimeStamp:E,requestId:D}));c.data=P}else c.data=y;else c.data=p[o.arg.endpointName].structuralSharing??!0?Je(it(c.data)?ot(c.data):c.data,y):y;delete c.error,c.fulfilledTimeStamp=o.fulfilledTimeStamp})}const i=B({name:`${e}/queries`,initialState:Z,reducers:{removeQueryResult:{reducer(g,{payload:{queryCacheKey:o}}){delete g[o]},prepare:X()},cacheEntriesUpserted:{reducer(g,o){for(const y of o.payload){const{queryDescription:h,value:c}=y;M(g,h,!0,{requestId:o.meta.requestId,startedTimeStamp:o.meta.timestamp}),f(g,{arg:h,requestId:o.meta.requestId,fulfilledTimeStamp:o.meta.timestamp,baseQueryMeta:{}},c,!0)}},prepare:g=>({payload:g.map(h=>{const{endpointName:c,arg:v,value:E}=h,w=p[c];return{queryDescription:{type:"query",endpointName:c,originalArgs:h.arg,queryCacheKey:m({queryArgs:v,endpointDefinition:w,endpointName:c})},value:E}}),meta:{[ee]:!0,requestId:He(),timestamp:Date.now()}})},queryResultPatched:{reducer(g,{payload:{queryCacheKey:o,patches:y}}){ie(g,o,h=>{h.data=Te(h.data,y.concat())})},prepare:X()}},extraReducers(g){g.addCase(t.pending,(o,{meta:y,meta:{arg:h}})=>{const c=ve(h);M(o,h,c,y)}).addCase(t.fulfilled,(o,{meta:y,payload:h})=>{const c=ve(y.arg);f(o,y,h,c)}).addCase(t.rejected,(o,{meta:{condition:y,arg:h,requestId:c},error:v,payload:E})=>{ie(o,h.queryCacheKey,w=>{if(!y){if(w.requestId!==c)return;w.status="rejected",w.error=E??v}})}).addMatcher(A,(o,y)=>{const{queries:h}=b(y);for(const[c,v]of Object.entries(h))((v==null?void 0:v.status)==="fulfilled"||(v==null?void 0:v.status)==="rejected")&&(o[c]=v)})}}),a=B({name:`${e}/mutations`,initialState:Z,reducers:{removeMutationResult:{reducer(g,{payload:o}){const y=re(o);y in g&&delete g[y]},prepare:X()}},extraReducers(g){g.addCase(l.pending,(o,{meta:y,meta:{requestId:h,arg:c,startedTimeStamp:v}})=>{c.track&&(o[re(y)]={requestId:h,status:"pending",endpointName:c.endpointName,startedTimeStamp:v})}).addCase(l.fulfilled,(o,{payload:y,meta:h})=>{h.arg.track&&ze(o,h,c=>{c.requestId===h.requestId&&(c.status="fulfilled",c.data=y,c.fulfilledTimeStamp=h.fulfilledTimeStamp)})}).addCase(l.rejected,(o,{payload:y,error:h,meta:c})=>{c.arg.track&&ze(o,c,v=>{v.requestId===c.requestId&&(v.status="rejected",v.error=y??h)})}).addMatcher(A,(o,y)=>{const{mutations:h}=b(y);for(const[c,v]of Object.entries(h))((v==null?void 0:v.status)==="fulfilled"||(v==null?void 0:v.status)==="rejected")&&c!==(v==null?void 0:v.requestId)&&(o[c]=v)})}}),r=B({name:`${e}/invalidation`,initialState:Z,reducers:{updateProvidedBy:{reducer(g,o){var c,v;const{queryCacheKey:y,providedTags:h}=o.payload;for(const E of Object.values(g))for(const w of Object.values(E)){const I=w.indexOf(y);I!==-1&&w.splice(I,1)}for(const{type:E,id:w}of h){const I=(c=g[E]??(g[E]={}))[v=w||"__internal_without_id"]??(c[v]=[]);I.includes(y)||I.push(y)}},prepare:X()}},extraReducers(g){g.addCase(i.actions.removeQueryResult,(o,{payload:{queryCacheKey:y}})=>{for(const h of Object.values(o))for(const c of Object.values(h)){const v=c.indexOf(y);v!==-1&&c.splice(v,1)}}).addMatcher(A,(o,y)=>{var c,v;const{provided:h}=b(y);for(const[E,w]of Object.entries(h))for(const[I,D]of Object.entries(w)){const P=(c=o[E]??(o[E]={}))[v=I||"__internal_without_id"]??(c[v]=[]);for(const F of D)P.includes(F)||P.push(F)}}).addMatcher(ue(W(t),be(t)),(o,y)=>{const h=Ye(y,"providesTags",p,Q),{queryCacheKey:c}=y.meta.arg;r.caseReducers.updateProvidedBy(o,r.actions.updateProvidedBy({queryCacheKey:c,providedTags:h}))})}}),d=B({name:`${e}/subscriptions`,initialState:Z,reducers:{updateSubscriptionOptions(g,o){},unsubscribeQueryResult(g,o){},internal_getRTKQSubscriptions(){}}}),q=B({name:`${e}/internalSubscriptions`,initialState:Z,reducers:{subscriptionsUpdated:{reducer(g,o){return Te(g,o.payload)},prepare:X()}}}),n=B({name:`${e}/config`,initialState:{online:Mt(),focused:Ot(),middlewareRegistered:!1,...O},reducers:{middlewareRegistered(g,{payload:o}){g.middlewareRegistered=g.middlewareRegistered==="conflict"||R!==o?"conflict":!0}},extraReducers:g=>{g.addCase(de,o=>{o.online=!0}).addCase(Me,o=>{o.online=!1}).addCase(le,o=>{o.focused=!0}).addCase(Oe,o=>{o.focused=!1}).addMatcher(A,o=>({...o}))}}),s=nt({queries:i.reducer,mutations:a.reducer,provided:r.reducer,subscriptions:q.reducer,config:n.reducer}),u=(g,o)=>s(T.match(o)?void 0:g,o),S={...n.actions,...i.actions,...d.actions,...q.actions,...a.actions,...r.actions,resetApiState:T};return{reducer:u,actions:S}}var x=Symbol.for("RTKQ/skipToken"),Xe={status:"uninitialized"},Le=Se(Xe,()=>{}),_e=Se(Xe,()=>{});function Lt({serializeQueryArgs:e,reducerPath:t,createSelector:l}){const m=M=>Le,p=M=>_e;return{buildQuerySelector:A,buildMutationSelector:Q,selectInvalidatedBy:O,selectCachedArgsForQuery:T};function R(M){return{...M,...Rt(M.status)}}function b(M){return M[t]}function A(M,f){return i=>{if(i===x)return l(m,R);const a=e({queryArgs:i,endpointDefinition:f,endpointName:M});return l(d=>{var q,n;return((n=(q=b(d))==null?void 0:q.queries)==null?void 0:n[a])??Le},R)}}function Q(){return M=>{let f;return typeof M=="object"?f=re(M)??x:f=M,l(f===x?p:r=>{var d,q;return((q=(d=b(r))==null?void 0:d.mutations)==null?void 0:q[f])??_e},R)}}function O(M,f){const i=M[t],a=new Set;for(const r of f.filter(ae).map(me)){const d=i.provided[r.type];if(!d)continue;let q=(r.id!==void 0?d[r.id]:Ce(Object.values(d)))??[];for(const n of q)a.add(n)}return Ce(Array.from(a.values()).map(r=>{const d=i.queries[r];return d?[{queryCacheKey:r,endpointName:d.endpointName,originalArgs:d.originalArgs}]:[]}))}function T(M,f){return Object.values(M[t].queries).filter(i=>(i==null?void 0:i.endpointName)===f&&i.status!=="uninitialized").map(i=>i.originalArgs)}}var V=WeakMap?new WeakMap:void 0,Ue=({endpointName:e,queryArgs:t})=>{let l="";const m=V==null?void 0:V.get(t);if(typeof m=="string")l=m;else{const p=JSON.stringify(t,(R,b)=>(b=typeof b=="bigint"?{$bigint:b.toString()}:b,b=K(b)?Object.keys(b).sort().reduce((A,Q)=>(A[Q]=b[Q],A),{}):b,b));K(t)&&(V==null||V.set(t,p)),l=p}return`${e}(${l})`};function Ze(...e){return function(l){const m=ce(O=>{var T;return(T=l.extractRehydrationInfo)==null?void 0:T.call(l,O,{reducerPath:l.reducerPath??"api"})}),p={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...l,extractRehydrationInfo:m,serializeQueryArgs(O){let T=Ue;if("serializeQueryArgs"in O.endpointDefinition){const M=O.endpointDefinition.serializeQueryArgs;T=f=>{const i=M(f);return typeof i=="string"?i:Ue({...f,queryArgs:i})}}else l.serializeQueryArgs&&(T=l.serializeQueryArgs);return T(O)},tagTypes:[...l.tagTypes||[]]},R={endpointDefinitions:{},batch(O){O()},apiUid:He(),extractRehydrationInfo:m,hasRehydrationInfo:ce(O=>m(O)!=null)},b={injectEndpoints:Q,enhanceEndpoints({addTagTypes:O,endpoints:T}){if(O)for(const M of O)p.tagTypes.includes(M)||p.tagTypes.push(M);if(T)for(const[M,f]of Object.entries(T))typeof f=="function"?f(R.endpointDefinitions[M]):Object.assign(R.endpointDefinitions[M]||{},f);return b}},A=e.map(O=>O.init(b,p,R));function Q(O){const T=O.endpoints({query:M=>({...M,type:"query"}),mutation:M=>({...M,type:"mutation"})});for(const[M,f]of Object.entries(T)){if(O.overrideExisting!==!0&&M in R.endpointDefinitions){if(O.overrideExisting==="throw")throw new Error(Ke(39));continue}R.endpointDefinitions[M]=f;for(const i of A)i.injectEndpoint(M,f)}return b}return b.injectEndpoints({endpoints:l.endpoints})}}function N(e,...t){return Object.assign(e,...t)}var _t=({api:e,queryThunk:t,internalState:l})=>{const m=`${e.reducerPath}/subscriptions`;let p=null,R=null;const{updateSubscriptionOptions:b,unsubscribeQueryResult:A}=e.internalActions,Q=(i,a)=>{var d,q,n;if(b.match(a)){const{queryCacheKey:s,requestId:u,options:S}=a.payload;return(d=i==null?void 0:i[s])!=null&&d[u]&&(i[s][u]=S),!0}if(A.match(a)){const{queryCacheKey:s,requestId:u}=a.payload;return i[s]&&delete i[s][u],!0}if(e.internalActions.removeQueryResult.match(a))return delete i[a.payload.queryCacheKey],!0;if(t.pending.match(a)){const{meta:{arg:s,requestId:u}}=a,S=i[q=s.queryCacheKey]??(i[q]={});return S[`${u}_running`]={},s.subscribe&&(S[u]=s.subscriptionOptions??S[u]??{}),!0}let r=!1;if(t.fulfilled.match(a)||t.rejected.match(a)){const s=i[a.meta.arg.queryCacheKey]||{},u=`${a.meta.requestId}_running`;r||(r=!!s[u]),delete s[u]}if(t.rejected.match(a)){const{meta:{condition:s,arg:u,requestId:S}}=a;if(s&&u.subscribe){const g=i[n=u.queryCacheKey]??(i[n]={});g[S]=u.subscriptionOptions??g[S]??{},r=!0}}return r},O=()=>l.currentSubscriptions,f={getSubscriptions:O,getSubscriptionCount:i=>{const r=O()[i]??{};return G(r)},isRequestSubscribed:(i,a)=>{var d;const r=O();return!!((d=r==null?void 0:r[i])!=null&&d[a])}};return(i,a)=>{if(p||(p=JSON.parse(JSON.stringify(l.currentSubscriptions))),e.util.resetApiState.match(i))return p=l.currentSubscriptions={},R=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(i))return[!1,f];const r=Q(l.currentSubscriptions,i);let d=!0;if(r){R||(R=setTimeout(()=>{const s=JSON.parse(JSON.stringify(l.currentSubscriptions)),[,u]=Be(p,()=>s);a.next(e.internalActions.subscriptionsUpdated(u)),p=s,R=null},500));const q=typeof i.type=="string"&&!!i.type.startsWith(m),n=t.rejected.match(i)&&i.meta.condition&&!!i.meta.arg.subscribe;d=!q&&!n}return[d,!1]}};function Ut(e){for(const t in e)return!1;return!0}var $t=2147483647/1e3-1,Nt=({reducerPath:e,api:t,queryThunk:l,context:m,internalState:p})=>{const{removeQueryResult:R,unsubscribeQueryResult:b,cacheEntriesUpserted:A}=t.internalActions,Q=ue(b.match,l.fulfilled,l.rejected,A.match);function O(i){const a=p.currentSubscriptions[i];return!!a&&!Ut(a)}const T={},M=(i,a,r)=>{var d;if(Q(i)){const q=a.getState()[e];let n;if(A.match(i))n=i.payload.map(s=>s.queryDescription.queryCacheKey);else{const{queryCacheKey:s}=b.match(i)?i.payload:i.meta.arg;n=[s]}for(const s of n)f(s,(d=q.queries[s])==null?void 0:d.endpointName,a,q.config)}if(t.util.resetApiState.match(i))for(const[q,n]of Object.entries(T))n&&clearTimeout(n),delete T[q];if(m.hasRehydrationInfo(i)){const q=a.getState()[e],{queries:n}=m.extractRehydrationInfo(i);for(const[s,u]of Object.entries(n))f(s,u==null?void 0:u.endpointName,a,q.config)}};function f(i,a,r,d){const q=m.endpointDefinitions[a],n=(q==null?void 0:q.keepUnusedDataFor)??d.keepUnusedDataFor;if(n===1/0)return;const s=Math.max(0,Math.min(n,$t));if(!O(i)){const u=T[i];u&&clearTimeout(u),T[i]=setTimeout(()=>{O(i)||r.dispatch(R({queryCacheKey:i})),delete T[i]},s*1e3)}}return M},$e=new Error("Promise never resolved before cacheEntryRemoved."),xt=({api:e,reducerPath:t,context:l,queryThunk:m,mutationThunk:p,internalState:R})=>{const b=we(m),A=we(p),Q=W(m,p),O={};function T(r,d,q){const n=O[r];n!=null&&n.valueResolved&&(n.valueResolved({data:d,meta:q}),delete n.valueResolved)}function M(r){const d=O[r];d&&(delete O[r],d.cacheEntryRemoved())}const f=(r,d,q)=>{const n=i(r);function s(u,S,g,o){const y=q[t].queries[S],h=d.getState()[t].queries[S];!y&&h&&a(u,o,S,d,g)}if(m.pending.match(r))s(r.meta.arg.endpointName,n,r.meta.requestId,r.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(r))for(const{queryDescription:u,value:S}of r.payload){const{endpointName:g,originalArgs:o,queryCacheKey:y}=u;s(g,y,r.meta.requestId,o),T(y,S,{})}else if(p.pending.match(r))d.getState()[t].mutations[n]&&a(r.meta.arg.endpointName,r.meta.arg.originalArgs,n,d,r.meta.requestId);else if(Q(r))T(n,r.payload,r.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(r)||e.internalActions.removeMutationResult.match(r))M(n);else if(e.util.resetApiState.match(r))for(const u of Object.keys(O))M(u)};function i(r){return b(r)?r.meta.arg.queryCacheKey:A(r)?r.meta.arg.fixedCacheKey??r.meta.requestId:e.internalActions.removeQueryResult.match(r)?r.payload.queryCacheKey:e.internalActions.removeMutationResult.match(r)?re(r.payload):""}function a(r,d,q,n,s){const u=l.endpointDefinitions[r],S=u==null?void 0:u.onCacheEntryAdded;if(!S)return;const g={},o=new Promise(w=>{g.cacheEntryRemoved=w}),y=Promise.race([new Promise(w=>{g.valueResolved=w}),o.then(()=>{throw $e})]);y.catch(()=>{}),O[q]=g;const h=e.endpoints[r].select(u.type==="query"?d:q),c=n.dispatch((w,I,D)=>D),v={...n,getCacheEntry:()=>h(n.getState()),requestId:s,extra:c,updateCachedData:u.type==="query"?w=>n.dispatch(e.util.updateQueryData(r,d,w)):void 0,cacheDataLoaded:y,cacheEntryRemoved:o},E=S(d,v);Promise.resolve(E).catch(w=>{if(w!==$e)throw w})}return f},Ht=({api:e,context:{apiUid:t},reducerPath:l})=>(m,p)=>{e.util.resetApiState.match(m)&&p.dispatch(e.internalActions.middlewareRegistered(t))},Kt=({reducerPath:e,context:t,context:{endpointDefinitions:l},mutationThunk:m,queryThunk:p,api:R,assertTagType:b,refetchQuery:A,internalState:Q})=>{const{removeQueryResult:O}=R.internalActions,T=ue(W(m),be(m)),M=ue(W(m,p),Re(m,p));let f=[];const i=(d,q)=>{T(d)?r(Ye(d,"invalidatesTags",l,b),q):M(d)?r([],q):R.util.invalidateTags.match(d)&&r(Ae(d.payload,void 0,void 0,void 0,void 0,b),q)};function a(d){var q,n;for(const s in d.queries)if(((q=d.queries[s])==null?void 0:q.status)==="pending")return!0;for(const s in d.mutations)if(((n=d.mutations[s])==null?void 0:n.status)==="pending")return!0;return!1}function r(d,q){const n=q.getState(),s=n[e];if(f.push(...d),s.config.invalidationBehavior==="delayed"&&a(s))return;const u=f;if(f=[],u.length===0)return;const S=R.util.selectInvalidatedBy(n,u);t.batch(()=>{const g=Array.from(S.values());for(const{queryCacheKey:o}of g){const y=s.queries[o],h=Q.currentSubscriptions[o]??{};y&&(G(h)===0?q.dispatch(O({queryCacheKey:o})):y.status!=="uninitialized"&&q.dispatch(A(y)))}})}return i},Wt=({reducerPath:e,queryThunk:t,api:l,refetchQuery:m,internalState:p})=>{const R={},b=(f,i)=>{(l.internalActions.updateSubscriptionOptions.match(f)||l.internalActions.unsubscribeQueryResult.match(f))&&Q(f.payload,i),(t.pending.match(f)||t.rejected.match(f)&&f.meta.condition)&&Q(f.meta.arg,i),(t.fulfilled.match(f)||t.rejected.match(f)&&!f.meta.condition)&&A(f.meta.arg,i),l.util.resetApiState.match(f)&&T()};function A({queryCacheKey:f},i){const a=i.getState()[e],r=a.queries[f],d=p.currentSubscriptions[f];if(!r||r.status==="uninitialized")return;const{lowestPollingInterval:q,skipPollingIfUnfocused:n}=M(d);if(!Number.isFinite(q))return;const s=R[f];s!=null&&s.timeout&&(clearTimeout(s.timeout),s.timeout=void 0);const u=Date.now()+q;R[f]={nextPollTimestamp:u,pollingInterval:q,timeout:setTimeout(()=>{(a.config.focused||!n)&&i.dispatch(m(r)),A({queryCacheKey:f},i)},q)}}function Q({queryCacheKey:f},i){const r=i.getState()[e].queries[f],d=p.currentSubscriptions[f];if(!r||r.status==="uninitialized")return;const{lowestPollingInterval:q}=M(d);if(!Number.isFinite(q)){O(f);return}const n=R[f],s=Date.now()+q;(!n||s<n.nextPollTimestamp)&&A({queryCacheKey:f},i)}function O(f){const i=R[f];i!=null&&i.timeout&&clearTimeout(i.timeout),delete R[f]}function T(){for(const f of Object.keys(R))O(f)}function M(f={}){let i=!1,a=Number.POSITIVE_INFINITY;for(let r in f)f[r].pollingInterval&&(a=Math.min(f[r].pollingInterval,a),i=f[r].skipPollingIfUnfocused||i);return{lowestPollingInterval:a,skipPollingIfUnfocused:i}}return b},Bt=({api:e,context:t,queryThunk:l,mutationThunk:m})=>{const p=We(l,m),R=Re(l,m),b=W(l,m),A={};return(O,T)=>{var M,f;if(p(O)){const{requestId:i,arg:{endpointName:a,originalArgs:r}}=O.meta,d=t.endpointDefinitions[a],q=d==null?void 0:d.onQueryStarted;if(q){const n={},s=new Promise((o,y)=>{n.resolve=o,n.reject=y});s.catch(()=>{}),A[i]=n;const u=e.endpoints[a].select(d.type==="query"?r:i),S=T.dispatch((o,y,h)=>h),g={...T,getCacheEntry:()=>u(T.getState()),requestId:i,extra:S,updateCachedData:d.type==="query"?o=>T.dispatch(e.util.updateQueryData(a,r,o)):void 0,queryFulfilled:s};q(r,g)}}else if(b(O)){const{requestId:i,baseQueryMeta:a}=O.meta;(M=A[i])==null||M.resolve({data:O.payload,meta:a}),delete A[i]}else if(R(O)){const{requestId:i,rejectedWithValue:a,baseQueryMeta:r}=O.meta;(f=A[i])==null||f.reject({error:O.payload??O.error,isUnhandledError:!a,meta:r}),delete A[i]}}},Vt=({reducerPath:e,context:t,api:l,refetchQuery:m,internalState:p})=>{const{removeQueryResult:R}=l.internalActions,b=(Q,O)=>{le.match(Q)&&A(O,"refetchOnFocus"),de.match(Q)&&A(O,"refetchOnReconnect")};function A(Q,O){const T=Q.getState()[e],M=T.queries,f=p.currentSubscriptions;t.batch(()=>{for(const i of Object.keys(f)){const a=M[i],r=f[i];if(!r||!a)continue;(Object.values(r).some(q=>q[O]===!0)||Object.values(r).every(q=>q[O]===void 0)&&T.config[O])&&(G(r)===0?Q.dispatch(R({queryCacheKey:i})):a.status!=="uninitialized"&&Q.dispatch(m(a)))}})}return b};function Jt(e){const{reducerPath:t,queryThunk:l,api:m,context:p}=e,{apiUid:R}=p,b={invalidateTags:Y(`${t}/invalidateTags`)},A=M=>M.type.startsWith(`${t}/`),Q=[Ht,Nt,Kt,Wt,xt,Bt];return{middleware:M=>{let f=!1;const a={...e,internalState:{currentSubscriptions:{}},refetchQuery:T,isThisApiSliceAction:A},r=Q.map(n=>n(a)),d=_t(a),q=Vt(a);return n=>s=>{if(!st(s))return n(s);f||(f=!0,M.dispatch(m.internalActions.middlewareRegistered(R)));const u={...M,next:n},S=M.getState(),[g,o]=d(s,u,S);let y;if(g?y=n(s):y=o,M.getState()[t]&&(q(s,u,S),A(s)||p.hasRehydrationInfo(s)))for(const h of r)h(s,u,S);return y}},actions:b};function T(M){return e.api.endpoints[M.endpointName].initiate(M.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Ne=Symbol(),et=({createSelector:e=qe}={})=>({name:Ne,init(t,{baseQuery:l,tagTypes:m,reducerPath:p,serializeQueryArgs:R,keepUnusedDataFor:b,refetchOnMountOrArgChange:A,refetchOnFocus:Q,refetchOnReconnect:O,invalidationBehavior:T},M){tt();const f=j=>j;Object.assign(t,{reducerPath:p,endpoints:{},internalActions:{onOnline:de,onOffline:Me,onFocus:le,onFocusLost:Oe},util:{}});const{queryThunk:i,mutationThunk:a,patchQueryData:r,updateQueryData:d,upsertQueryData:q,prefetch:n,buildMatchThunkActions:s}=Ft({baseQuery:l,reducerPath:p,context:M,api:t,serializeQueryArgs:R,assertTagType:f}),{reducer:u,actions:S}=zt({context:M,queryThunk:i,mutationThunk:a,serializeQueryArgs:R,reducerPath:p,assertTagType:f,config:{refetchOnFocus:Q,refetchOnReconnect:O,refetchOnMountOrArgChange:A,keepUnusedDataFor:b,reducerPath:p,invalidationBehavior:T}});N(t.util,{patchQueryData:r,updateQueryData:d,upsertQueryData:q,prefetch:n,resetApiState:S.resetApiState,upsertQueryEntries:S.cacheEntriesUpserted}),N(t.internalActions,S);const{middleware:g,actions:o}=Jt({reducerPath:p,context:M,queryThunk:i,mutationThunk:a,api:t,assertTagType:f});N(t.util,o),N(t,{reducer:u,middleware:g});const{buildQuerySelector:y,buildMutationSelector:h,selectInvalidatedBy:c,selectCachedArgsForQuery:v}=Lt({serializeQueryArgs:R,reducerPath:p,createSelector:e});N(t.util,{selectInvalidatedBy:c,selectCachedArgsForQuery:v});const{buildInitiateQuery:E,buildInitiateMutation:w,getRunningMutationThunk:I,getRunningMutationsThunk:D,getRunningQueriesThunk:P,getRunningQueryThunk:F}=Pt({queryThunk:i,mutationThunk:a,api:t,serializeQueryArgs:R,context:M});return N(t.util,{getRunningMutationThunk:I,getRunningMutationsThunk:D,getRunningQueryThunk:F,getRunningQueriesThunk:P}),{name:Ne,injectEndpoint(j,z){var L;const k=t;(L=k.endpoints)[j]??(L[j]={}),Ge(z)?N(k.endpoints[j],{name:j,select:y(j,z),initiate:E(j,z)},s(i,j)):Ct(z)&&N(k.endpoints[j],{name:j,select:h(),initiate:w(j)},s(a,j))}}}});et();function ye(e){return e.replace(e[0],e[0].toUpperCase())}function Gt(e){return e.type==="query"}function Yt(e){return e.type==="mutation"}function oe(e,...t){return Object.assign(e,...t)}var J=WeakMap?new WeakMap:void 0,Xt=({endpointName:e,queryArgs:t})=>{let l="";const m=J==null?void 0:J.get(t);if(typeof m=="string")l=m;else{const p=JSON.stringify(t,(R,b)=>(b=typeof b=="bigint"?{$bigint:b.toString()}:b,b=K(b)?Object.keys(b).sort().reduce((A,Q)=>(A[Q]=b[Q],A),{}):b,b));K(t)&&(J==null||J.set(t,p)),l=p}return`${e}(${l})`},ge=Symbol();function xe(e,t,l,m){const p=C.useMemo(()=>({queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:l,endpointName:m}):e}),[e,t,l,m]),R=C.useRef(p);return C.useEffect(()=>{R.current.serialized!==p.serialized&&(R.current=p)},[p]),R.current.serialized===p.serialized?R.current.queryArgs:e}function he(e){const t=C.useRef(e);return C.useEffect(()=>{te(t.current,e)||(t.current=e)},[e]),te(t.current,e)?t.current:e}var Zt=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",en=Zt(),tn=()=>typeof navigator<"u"&&navigator.product==="ReactNative",nn=tn(),rn=()=>en||nn?C.useLayoutEffect:C.useEffect,sn=rn(),on=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Ve.pending}:e;function un({api:e,moduleOptions:{batch:t,hooks:{useDispatch:l,useSelector:m,useStore:p},unstable__sideEffectsInRender:R,createSelector:b},serializeQueryArgs:A,context:Q}){const O=R?a=>a():C.useEffect;return{buildQueryHooks:f,buildMutationHook:i,usePrefetch:M};function T(a,r,d){if(r!=null&&r.endpointName&&a.isUninitialized){const{endpointName:g}=r,o=Q.endpointDefinitions[g];d!==x&&A({queryArgs:r.originalArgs,endpointDefinition:o,endpointName:g})===A({queryArgs:d,endpointDefinition:o,endpointName:g})&&(r=void 0)}let q=a.isSuccess?a.data:r==null?void 0:r.data;q===void 0&&(q=a.data);const n=q!==void 0,s=a.isLoading,u=(!r||r.isLoading||r.isUninitialized)&&!n&&s,S=a.isSuccess||n&&(s&&!(r!=null&&r.isError)||a.isUninitialized);return{...a,data:q,currentData:a.data,isFetching:s,isLoading:u,isSuccess:S}}function M(a,r){const d=l(),q=he(r);return C.useCallback((n,s)=>d(e.util.prefetch(a,n,{...q,...s})),[a,d,q])}function f(a){const r=(n,{refetchOnReconnect:s,refetchOnFocus:u,refetchOnMountOrArgChange:S,skip:g=!1,pollingInterval:o=0,skipPollingIfUnfocused:y=!1}={})=>{const{initiate:h}=e.endpoints[a],c=l(),v=C.useRef(void 0);if(!v.current){const k=c(e.internalActions.internal_getRTKQSubscriptions());v.current=k}const E=xe(g?x:n,Xt,Q.endpointDefinitions[a],a),w=he({refetchOnReconnect:s,refetchOnFocus:u,pollingInterval:o,skipPollingIfUnfocused:y}),I=C.useRef(!1),D=C.useRef(void 0);let{queryCacheKey:P,requestId:F}=D.current||{},j=!1;P&&F&&(j=v.current.isRequestSubscribed(P,F));const z=!j&&I.current;return O(()=>{I.current=j}),O(()=>{z&&(D.current=void 0)},[z]),O(()=>{var $;const k=D.current;if(E===x){k==null||k.unsubscribe(),D.current=void 0;return}const L=($=D.current)==null?void 0:$.subscriptionOptions;if(!k||k.arg!==E){k==null||k.unsubscribe();const _=c(h(E,{subscriptionOptions:w,forceRefetch:S}));D.current=_}else w!==L&&k.updateSubscriptionOptions(w)},[c,h,S,E,w,z]),C.useEffect(()=>()=>{var k;(k=D.current)==null||k.unsubscribe(),D.current=void 0},[]),C.useMemo(()=>({refetch:()=>{var k;if(!D.current)throw new Error(Ke(38));return(k=D.current)==null?void 0:k.refetch()}}),[])},d=({refetchOnReconnect:n,refetchOnFocus:s,pollingInterval:u=0,skipPollingIfUnfocused:S=!1}={})=>{const{initiate:g}=e.endpoints[a],o=l(),[y,h]=C.useState(ge),c=C.useRef(void 0),v=he({refetchOnReconnect:n,refetchOnFocus:s,pollingInterval:u,skipPollingIfUnfocused:S});O(()=>{var P,F;const D=(P=c.current)==null?void 0:P.subscriptionOptions;v!==D&&((F=c.current)==null||F.updateSubscriptionOptions(v))},[v]);const E=C.useRef(v);O(()=>{E.current=v},[v]);const w=C.useCallback(function(D,P=!1){let F;return t(()=>{var j;(j=c.current)==null||j.unsubscribe(),c.current=F=o(g(D,{subscriptionOptions:E.current,forceRefetch:!P})),h(D)}),F},[o,g]),I=C.useCallback(()=>{var D,P;(D=c.current)!=null&&D.queryCacheKey&&o(e.internalActions.removeQueryResult({queryCacheKey:(P=c.current)==null?void 0:P.queryCacheKey}))},[o]);return C.useEffect(()=>()=>{var D;(D=c==null?void 0:c.current)==null||D.unsubscribe()},[]),C.useEffect(()=>{y!==ge&&!c.current&&w(y,!0)},[y,w]),C.useMemo(()=>[w,y,{reset:I}],[w,y,I])},q=(n,{skip:s=!1,selectFromResult:u}={})=>{const{select:S}=e.endpoints[a],g=xe(s?x:n,A,Q.endpointDefinitions[a],a),o=C.useRef(void 0),y=C.useMemo(()=>b([S(g),(w,I)=>I,w=>g],T,{memoizeOptions:{resultEqualityCheck:te}}),[S,g]),h=C.useMemo(()=>u?b([y],u,{devModeChecks:{identityFunctionCheck:"never"}}):y,[y,u]),c=m(w=>h(w,o.current),te),v=p(),E=y(v.getState(),o.current);return sn(()=>{o.current=E},[E]),c};return{useQueryState:q,useQuerySubscription:r,useLazyQuerySubscription:d,useLazyQuery(n){const[s,u,{reset:S}]=d(n),g=q(u,{...n,skip:u===ge}),o=C.useMemo(()=>({lastArg:u}),[u]);return C.useMemo(()=>[s,{...g,reset:S},o],[s,g,S,o])},useQuery(n,s){const u=r(n,s),S=q(n,{selectFromResult:n===x||s!=null&&s.skip?void 0:on,...s}),{data:g,status:o,isLoading:y,isSuccess:h,isError:c,error:v}=S;return C.useDebugValue({data:g,status:o,isLoading:y,isSuccess:h,isError:c,error:v}),C.useMemo(()=>({...S,...u}),[S,u])}}}function i(a){return({selectFromResult:r,fixedCacheKey:d}={})=>{const{select:q,initiate:n}=e.endpoints[a],s=l(),[u,S]=C.useState();C.useEffect(()=>()=>{u!=null&&u.arg.fixedCacheKey||u==null||u.reset()},[u]);const g=C.useCallback(function(L){const $=s(n(L,{fixedCacheKey:d}));return S($),$},[s,n,d]),{requestId:o}=u||{},y=C.useMemo(()=>q({fixedCacheKey:d,requestId:u==null?void 0:u.requestId}),[d,u,q]),h=C.useMemo(()=>r?b([y],r):y,[r,y]),c=m(h,te),v=d==null?u==null?void 0:u.arg.originalArgs:void 0,E=C.useCallback(()=>{t(()=>{u&&S(void 0),d&&s(e.internalActions.removeMutationResult({requestId:o,fixedCacheKey:d}))})},[s,d,u,o]),{endpointName:w,data:I,status:D,isLoading:P,isSuccess:F,isError:j,error:z}=c;C.useDebugValue({endpointName:w,data:I,status:D,isLoading:P,isSuccess:F,isError:j,error:z});const k=C.useMemo(()=>({...c,originalArgs:v,reset:E}),[c,v,E]);return C.useMemo(()=>[g,k],[g,k])}}}var cn=Symbol(),an=({batch:e=ut,hooks:t={useDispatch:lt,useSelector:at,useStore:ct},createSelector:l=qe,unstable__sideEffectsInRender:m=!1,...p}={})=>({name:cn,init(R,{serializeQueryArgs:b},A){const Q=R,{buildQueryHooks:O,buildMutationHook:T,usePrefetch:M}=un({api:R,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:m,createSelector:l},serializeQueryArgs:b,context:A});return oe(Q,{usePrefetch:M}),oe(A,{batch:e}),{injectEndpoint(f,i){if(Gt(i)){const{useQuery:a,useLazyQuery:r,useLazyQuerySubscription:d,useQueryState:q,useQuerySubscription:n}=O(f);oe(Q.endpoints[f],{useQuery:a,useLazyQuery:r,useLazyQuerySubscription:d,useQueryState:q,useQuerySubscription:n}),R[`use${ye(f)}Query`]=a,R[`useLazy${ye(f)}Query`]=r}else if(Yt(i)){const a=T(f);oe(Q.endpoints[f],{useMutation:a}),R[`use${ye(f)}Mutation`]=a}}}}}),ln=Ze(et(),an());const dn=Dt({baseUrl:"/api/v1"}),fn=ln({reducerPath:"editorialApi",baseQuery:dn,tagTypes:["schema","data","files"],endpoints:e=>({pull:e.mutation({query:()=>({url:"/pull",method:"POST"})}),push:e.mutation({query:()=>({url:"/push",method:"POST"})}),publish:e.mutation({query:()=>({url:"/publish",method:"POST"})}),getSchema:e.query({query:()=>"/schema",providesTags:[{type:"schema"}]}),getSchemaType:e.query({query:()=>"/schema",transformResponse:(t,l,m)=>t[m]||null,providesTags:[{type:"schema"}]}),getData:e.query({query:()=>"/data",providesTags:()=>[{type:"data"}]}),getDataCount:e.query({query:()=>"/data",transformResponse(t){return Object.values(t).reduce((m,p)=>m+Object.keys(p).length,0)}}),getDataObject:e.query({query:()=>"/data",transformResponse:(t,l,{itemType:m,id:p})=>t[m][p]||null,providesTags:()=>[{type:"data"}]}),getFiles:e.query({query:()=>"/files",providesTags:()=>[{type:"files"}]}),getFileCount:e.query({query:()=>"/files",transformResponse:t=>{function l(p){let R=p.type==="file"?1:0;return p.children&&p.children.length>0&&(R+=p.children.reduce((b,A)=>b+l(A),0)),R}function m(p){return p.reduce((R,b)=>R+l(b),0)}return m(t)}}),deleteFile:e.mutation({query:t=>({url:"/files",method:"DELETE",body:{path:t}}),invalidatesTags:()=>[{type:"files"}]}),updateObject:e.mutation({query:({id:t,type:l,...m})=>({url:`/data/${l}/${t}`,method:"PATCH",body:{id:t,type:l,...m}}),invalidatesTags:()=>[{type:"data"}]}),createObject:e.mutation({query:({id:t,type:l,...m})=>({url:`/data/${l}/${t}`,method:"PUT",body:{id:t,type:l,...m}}),invalidatesTags:()=>[{type:"data"}]}),deleteObject:e.mutation({query:({id:t,type:l})=>({url:`/data/${l}/${t}`,method:"DELETE"}),invalidatesTags:()=>[{type:"data"}]})})}),{useCreateObjectMutation:hn,useDeleteFileMutation:mn,useDeleteObjectMutation:vn,useGetDataCountQuery:bn,useGetDataObjectQuery:Sn,useGetDataQuery:Rn,useGetFileCountQuery:qn,useGetFilesQuery:On,useGetSchemaQuery:Mn,useGetSchemaTypeQuery:An,usePublishMutation:En,usePullMutation:Tn,usePushMutation:wn,useUpdateObjectMutation:Qn}=fn;export{Rn as a,En as b,Tn as c,wn as d,fn as e,bn as f,qn as g,An as h,vn as i,Sn as j,hn as k,Qn as l,On as m,mn as n,gn as s,Mn as u};
|