@isardsat/editorial-admin 6.3.1 → 6.3.2
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-DST6tNnU.js → authSlice-NyheTN-1.js} +1 -1
- package/build/client/assets/{dashboard-BjYHjaPP.js → dashboard-D3bouS6Q.js} +1 -1
- package/build/client/assets/{dashboard._collection-U37ELAZn.js → dashboard._collection-C33q3HNx.js} +1 -1
- package/build/client/assets/{dashboard._collection._document-Dt2belpf.js → dashboard._collection._document-BbCS-wOn.js} +1 -1
- package/build/client/assets/{dashboard._collection.new-B-0plYyF.js → dashboard._collection.new-DzsaJ27b.js} +1 -1
- package/build/client/assets/dashboard._layout-CX3yKpzk.js +61 -0
- package/build/client/assets/{dashboard.files-Bal43yfa.js → dashboard.files-Cc4VF-R3.js} +4 -4
- package/build/client/assets/{editorialApi-CqxxtYzA.js → editorialApi-4jvMs8ha.js} +1 -1
- package/build/client/assets/{home-BkOGwoQz.js → home-CmHCwA-Y.js} +1 -1
- package/build/client/assets/{itemForm-CnzvRzeD.js → itemForm-0kgC59b7.js} +1 -1
- package/build/client/assets/{manifest-8cebdeb7.js → manifest-0a56f9c0.js} +1 -1
- package/build/client/assets/{root-Cuw5kjHy.js → root-DH7Vh4qn.js} +1 -1
- package/build/client/index.html +2 -2
- package/package.json +2 -2
- package/build/client/assets/dashboard._layout-D6uAMjWG.js +0 -61
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as vi}from"./tslib.es6-De9GV7Vy.js";import{r as Wa,t as Ba,v as Ha,w as Va,e as $a,x as Ga}from"./editorialApi-
|
|
1
|
+
import{a as vi}from"./tslib.es6-De9GV7Vy.js";import{r as Wa,t as Ba,v as Ha,w as Va,e as $a,x as Ga}from"./editorialApi-4jvMs8ha.js";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,a as j,x as b,w}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{c as m,f as u}from"./utils-BSDwSRl3.js";import{b as C,a as N,i as v,j as T}from"./editorialApi-
|
|
1
|
+
import{p as e,a as j,x as b,w}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{c as m,f as u}from"./utils-BSDwSRl3.js";import{b as C,a as N,i as v,j as T}from"./editorialApi-4jvMs8ha.js";import{c as y,u as D,T as R,a as L,b as x,d as k,f as p,e as A,g as H,h as I}from"./index-CQvFoK7s.js";function G({className:a,...t}){return e.jsx("div",{"data-slot":"skeleton",className:m("bg-accent animate-pulse rounded-md",a),...t})}function f({className:a,title:t,value:r,isLoading:n,...s}){return e.jsxs("div",{className:m("border border-border rounded-xl p-6",a),...s,children:[e.jsx("h3",{className:"text-xs text-muted-foreground",children:t}),n?e.jsx(G,{className:"h-[2.25rem] w-16"}):e.jsx("p",{className:"text-lg sm:text-3xl font-bold leading-none",children:r})]})}const i=y(),c=[i.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(a){const t=a.getValue();return e.jsx("span",{title:t,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:t})}}),i.accessor("createdAt",{header:"Created",cell(a){return u(new Date(a.getValue()))}}),i.accessor("updatedAt",{header:"Updated",cell(a){return u(new Date(a.getValue()))}})];function M(){const{data:a}=C(),{data:t}=N(),r=j.useMemo(()=>!a||!t?[]:Object.entries(a).filter(([o])=>o in t).reduce((o,[d,h])=>o.concat(Object.values(h).map(g=>({...g,type:d}))),[]).toSorted((o,d)=>o.updatedAt>d.updatedAt?-1:1).slice(0,6),[a,t]),n=D({data:r,columns:c,getCoreRowModel:I()});return e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(R,{children:[e.jsx(L,{children:n.getHeaderGroups().map(s=>e.jsx(x,{className:"grid",style:{gridTemplateColumns:`repeat(${c.length}, minmax(200px, 1fr))`},children:s.headers.map(l=>e.jsx(k,{children:l.isPlaceholder?null:p(l.column.columnDef.header,l.getContext())},l.id))},s.id))}),e.jsx(A,{children:n.getRowModel().rows.map(s=>e.jsx(b,{to:`/admin/dashboard/${s.original.type}/${s.original.id}`,children:e.jsx(x,{className:"grid",style:{gridTemplateColumns:`repeat(${c.length}, minmax(200px, 1fr))`},children:s.getVisibleCells().map(l=>e.jsx(H,{className:m("p-2"),children:p(l.column.columnDef.cell,l.getContext())},l.id))},s.id)},s.original.id))})]})})}const E=w(function(){const{data:t,isLoading:r}=v(),{data:n,isLoading:s}=T();return e.jsx("div",{className:"flex flex-1 h-full p-4 gap-4",children:e.jsxs("div",{className:"flex flex-col overflow-hidden flex-1 gap-4",children:[e.jsxs("div",{className:"flex flex-row gap-2 grid-cols-12",children:[e.jsx(f,{className:"w-full sm:w-44",title:"Items",value:t,isLoading:r}),e.jsx(f,{className:"w-full sm:w-44",title:"Files",value:n,isLoading:s})]}),e.jsxs("div",{className:"flex flex-col gap-4 last:mb-20",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",children:"Recently Updated"}),e.jsx(M,{})]})]})})});export{E as default};
|
package/build/client/assets/{dashboard._collection-U37ELAZn.js → dashboard._collection-C33q3HNx.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as e,a as m,x as N,w as v}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{B as k}from"./button-DjJX-cbR.js";import{k as w,b as T,l as M}from"./editorialApi-
|
|
1
|
+
import{p as e,a as m,x as N,w as v}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{B as k}from"./button-DjJX-cbR.js";import{k as w,b as T,l as M}from"./editorialApi-4jvMs8ha.js";import{c as $,u as D,T as R,a as V,b as g,d as _,f as j,e as z,g as H,h as I}from"./index-CQvFoK7s.js";import{f as P,a as S,c as B}from"./utils-BSDwSRl3.js";import{T as E}from"./trash-CYTPibS3.js";import{c as x}from"./createLucideIcon-BOhrmKcl.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as r,p as e}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{I as n}from"./itemForm-
|
|
1
|
+
import{w as r,p as e}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{I as n}from"./itemForm-0kgC59b7.js";import{k as p,m as d}from"./editorialApi-4jvMs8ha.js";import"./button-DjJX-cbR.js";import"./utils-BSDwSRl3.js";import"./input-DA43W1bc.js";import"./index-B0NebLYn.js";import"./index-BnyqKVWo.js";import"./createLucideIcon-BOhrmKcl.js";import"./index-b1VEd5BJ.js";import"./tslib.es6-De9GV7Vy.js";const w=r(function({params:m}){const{collectionId:t,documentId:i}=m,{data:o,isFetching:a}=p(t),{data:s,isFetching:c}=d({itemType:t,id:i});return!o||!s||(a||c)?null:e.jsx("div",{className:"overflow-auto",children:e.jsx("div",{className:"flex p-4 gap-4",children:e.jsx(n,{itemType:t,fields:o.fields,data:s},`${t}-${i}`)})})});export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as i,p as o}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{I as s}from"./itemForm-
|
|
1
|
+
import{w as i,p as o}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{I as s}from"./itemForm-0kgC59b7.js";import{k as m}from"./editorialApi-4jvMs8ha.js";import"./button-DjJX-cbR.js";import"./utils-BSDwSRl3.js";import"./input-DA43W1bc.js";import"./index-B0NebLYn.js";import"./index-BnyqKVWo.js";import"./createLucideIcon-BOhrmKcl.js";import"./index-b1VEd5BJ.js";import"./tslib.es6-De9GV7Vy.js";const v=i(function({params:r}){const{collectionId:t}=r,{data:e}=m(t);return e?o.jsx("div",{className:"overflow-auto",children:o.jsx("div",{className:"flex p-4 gap-4",children:o.jsx(s,{itemType:t,fields:e.fields,isNew:!0})})}):null});export{v as default};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import{p as e,a as d,x as y,y as de,v as le,z as ce,R as ue,w as he,O as pe}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{u as xe,e as D,h as fe}from"./authSlice-NyheTN-1.js";import{a as U,b as be,d as ge,f as me,g as je,u as ve,h as we}from"./editorialApi-4jvMs8ha.js";import{R as W,C as Q,a as X,T as Z,D as Y,P as J,O as ee,b as ye,c as Ne,d as Ce,e as Se,f as _e,g as ke,A as Me,u as ze,E as De}from"./index-b1VEd5BJ.js";import{c as i}from"./utils-BSDwSRl3.js";import{c as f}from"./createLucideIcon-BOhrmKcl.js";import{B as k,S as E,c as Ee,u as Re}from"./button-DjJX-cbR.js";import{u as Oe,c as Ae,P as R,a as Pe,b as Ie,d as Te}from"./index-B0NebLYn.js";import{C as $}from"./chevron-down-CYVLN3e-.js";import"./tslib.es6-De9GV7Vy.js";import"./index-BnyqKVWo.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 $e=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Le=f("arrow-down",$e);/**
|
|
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 Be=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Ge=f("arrow-up",Be);/**
|
|
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 He=[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]],Fe=f("blocks",He);/**
|
|
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 qe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ve=f("chevron-right",qe);/**
|
|
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 Ke=[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]],Ue=f("files",Ke);/**
|
|
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 We=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Qe=f("grid-3x3",We);/**
|
|
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 Xe=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]],Ze=f("heart",Xe);/**
|
|
37
|
+
* @license lucide-react v0.487.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const Ye=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],Je=f("log-out",Ye);/**
|
|
42
|
+
* @license lucide-react v0.487.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const et=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],tt=f("panel-left",et);/**
|
|
47
|
+
* @license lucide-react v0.487.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const at=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],st=f("square",at);/**
|
|
52
|
+
* @license lucide-react v0.487.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const nt=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],ot=f("upload",nt);/**
|
|
57
|
+
* @license lucide-react v0.487.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const it=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],te=f("x",it);function rt({...t}){return e.jsx(W,{"data-slot":"dialog",...t})}function dt({...t}){return e.jsx(J,{"data-slot":"dialog-portal",...t})}function lt({className:t,...a}){return e.jsx(ee,{"data-slot":"dialog-overlay",className:i("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function ct({className:t,children:a,...n}){return e.jsxs(dt,{"data-slot":"dialog-portal",children:[e.jsx(lt,{}),e.jsxs(Q,{"data-slot":"dialog-content",className:i("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...n,children:[a,e.jsxs(X,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(te,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ut({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:i("flex flex-col gap-2 text-center sm:text-left",t),...a})}function ht({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:i("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function pt({className:t,...a}){return e.jsx(Z,{"data-slot":"dialog-title",className:i("text-lg leading-none font-semibold",t),...a})}function xt({className:t,...a}){return e.jsx(Y,{"data-slot":"dialog-description",className:i("text-muted-foreground text-sm",t),...a})}const ft="#181717",bt=d.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},r){return n==="default"&&(n=ft),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:r,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})}),gt="#85EA2D",L=d.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},r){return n==="default"&&(n=gt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:r,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"})]})});function mt({isOpen:t,setOpen:a}){return e.jsx(rt,{open:t,onOpenChange:n=>a(n),children:e.jsxs(ct,{children:[e.jsxs(ut,{children:[e.jsx(pt,{children:"Editorial"}),e.jsx(xt,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(k,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"https://lobelia-earth.github.io/editorial/",children:[e.jsx(L,{size:14}),"Documentation"]})}),e.jsx(k,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"/doc",children:[e.jsx(L,{size:14}),"Swagger API UI"]})}),e.jsx(k,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(bt,{size:14}),"GitHub repository"]})})]}),e.jsx(ht,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(Ze,{size:14,className:"stroke-red-500 fill-red-500"})," by"," ",e.jsx(y,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}function jt({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(ye,{"data-slot":"separator-root",decorative:n,orientation:a,className:i("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...s})}function vt({...t}){return e.jsx(W,{"data-slot":"sheet",...t})}function wt({...t}){return e.jsx(J,{"data-slot":"sheet-portal",...t})}function yt({className:t,...a}){return e.jsx(ee,{"data-slot":"sheet-overlay",className:i("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function Nt({className:t,children:a,side:n="right",...s}){return e.jsxs(wt,{children:[e.jsx(yt,{}),e.jsxs(Q,{"data-slot":"sheet-content",className:i("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,e.jsxs(X,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(te,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ct({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:i("flex flex-col gap-1.5 p-4",t),...a})}function St({className:t,...a}){return e.jsx(Z,{"data-slot":"sheet-title",className:i("text-foreground font-semibold",t),...a})}function _t({className:t,...a}){return e.jsx(Y,{"data-slot":"sheet-description",className:i("text-muted-foreground text-sm",t),...a})}function ae({delayDuration:t=0,...a}){return e.jsx(Ne,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function kt({...t}){return e.jsx(ae,{children:e.jsx(Ce,{"data-slot":"tooltip",...t})})}function Mt({...t}){return e.jsx(Se,{"data-slot":"tooltip-trigger",...t})}function zt({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(_e,{children:e.jsxs(ke,{"data-slot":"tooltip-content",sideOffset:a,className:i("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...s,children:[n,e.jsx(Me,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const z=768;function Dt(){const[t,a]=d.useState(void 0);return d.useEffect(()=>{const n=window.matchMedia(`(max-width: ${z-1}px)`),s=()=>{a(window.innerWidth<z)};return n.addEventListener("change",s),a(window.innerWidth<z),()=>n.removeEventListener("change",s)},[]),!!t}const Et="sidebar_state",Rt=60*60*24*7,Ot="16rem",At="18rem",Pt="3rem",It="b",se=d.createContext(null);function O(){const t=d.useContext(se);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Tt({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:r,...l}){const p=Dt(),[x,u]=d.useState(!1),[g,C]=d.useState(t),m=a??g,j=d.useCallback(h=>{const c=typeof h=="function"?h(m):h;n?n(c):C(c),document.cookie=`${Et}=${c}; path=/; max-age=${Rt}`},[n,m]),v=d.useCallback(()=>p?u(h=>!h):j(h=>!h),[p,j,u]);d.useEffect(()=>{const h=c=>{c.key===It&&(c.metaKey||c.ctrlKey)&&(c.preventDefault(),v())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[v]);const N=m?"expanded":"collapsed",S=d.useMemo(()=>({state:N,open:m,setOpen:j,isMobile:p,openMobile:x,setOpenMobile:u,toggleSidebar:v}),[N,m,j,p,x,u,v]);return e.jsx(se.Provider,{value:S,children:e.jsx(ae,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Ot,"--sidebar-width-icon":Pt,...o},className:i("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...l,children:r})})})}function $t({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...r}){const{isMobile:l,state:p,openMobile:x,setOpenMobile:u}=O();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:i("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...r,children:o}):l?e.jsx(vt,{open:x,onOpenChange:u,...r,children:e.jsxs(Nt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":At},side:t,children:[e.jsxs(Ct,{className:"sr-only",children:[e.jsx(St,{children:"Sidebar"}),e.jsx(_t,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":p,"data-collapsible":p==="collapsed"?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:i("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:i("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...r,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function Lt({className:t,onClick:a,...n}){const{toggleSidebar:s}=O();return e.jsxs(k,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:i("size-7",t),onClick:o=>{a==null||a(o),s()},...n,children:[e.jsx(tt,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Bt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:i("flex flex-col gap-2 p-2",t),...a})}function Gt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i("flex flex-col gap-2 p-2",t),...a})}function Ht({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function _({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i("relative flex w-full min-w-0 flex-col p-2",t),...a})}function B({className:t,asChild:a=!1,...n}){const s=a?E:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:i("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}function G({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i("w-full text-sm",t),...a})}function H({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i("flex w-full min-w-0 flex-col gap-1",t),...a})}function w({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i("group/menu-item relative",t),...a})}const Ft=Ee("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function b({asChild:t=!1,isActive:a=!1,variant:n="default",size:s="default",tooltip:o,className:r,...l}){const p=t?E:"button",{isMobile:x,state:u}=O(),g=e.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:i(Ft({variant:n,size:s}),r),...l});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(kt,{children:[e.jsx(Mt,{asChild:!0,children:g}),e.jsx(zt,{side:"right",align:"center",hidden:u!=="collapsed"||x,...o})]})):g}function qt({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:i("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function Vt({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...o}){const r=t?E:"a";return e.jsx(r,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":n,className:i("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",s),...o})}function F({singleton:t}){const{data:a}=U(),{data:n}=be();return a?e.jsx(e.Fragment,{children:Object.entries(a).filter(([,s])=>t?s.singleton:!s.singleton).map(([s,o])=>e.jsx(qt,{children:e.jsx(de,{to:t?`/admin/dashboard/${s}/default`:`/admin/dashboard/${s}`,className:({isActive:r,isPending:l})=>l?"pending":r?"active":"",children:({isActive:r})=>e.jsx(Vt,{isActive:r,asChild:!0,children:e.jsxs("div",{children:[e.jsx("span",{className:"inline-block overflow-hidden whitespace-nowrap text-ellipsis text-nowrap w-full",children:o.displayName}),!t&&n&&e.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1",children:Object.keys(n[s]).length})]})})})},o.displayName))}):null}var M="Collapsible",[Kt,ca]=Ae(M),[Ut,A]=Kt(M),ne=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:r,onOpenChange:l,...p}=t,[x,u]=Oe({prop:s,defaultProp:o??!1,onChange:l,caller:M});return e.jsx(Ut,{scope:n,disabled:r,contentId:ze(),open:x,onOpenToggle:d.useCallback(()=>u(g=>!g),[u]),children:e.jsx(R.div,{"data-state":I(x),"data-disabled":r?"":void 0,...p,ref:a})})});ne.displayName=M;var oe="CollapsibleTrigger",ie=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=A(oe,n);return e.jsx(R.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":I(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...s,ref:a,onClick:Pe(t.onClick,o.onOpenToggle)})});ie.displayName=oe;var P="CollapsibleContent",re=d.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=A(P,t.__scopeCollapsible);return e.jsx(Ie,{present:n||o.open,children:({present:r})=>e.jsx(Wt,{...s,ref:a,present:r})})});re.displayName=P;var Wt=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...r}=t,l=A(P,n),[p,x]=d.useState(s),u=d.useRef(null),g=Re(a,u),C=d.useRef(0),m=C.current,j=d.useRef(0),v=j.current,N=l.open||p,S=d.useRef(N),h=d.useRef(void 0);return d.useEffect(()=>{const c=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(c)},[]),Te(()=>{const c=u.current;if(c){h.current=h.current||{transitionDuration:c.style.transitionDuration,animationName:c.style.animationName},c.style.transitionDuration="0s",c.style.animationName="none";const T=c.getBoundingClientRect();C.current=T.height,j.current=T.width,S.current||(c.style.transitionDuration=h.current.transitionDuration,c.style.animationName=h.current.animationName),x(s)}},[l.open,s]),e.jsx(R.div,{"data-state":I(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!N,...r,ref:g,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:N&&o})});function I(t){return t?"open":"closed"}var Qt=ne;function q({...t}){return e.jsx(Qt,{"data-slot":"collapsible",...t})}function V({...t}){return e.jsx(ie,{"data-slot":"collapsible-trigger",...t})}function K({...t}){return e.jsx(re,{"data-slot":"collapsible-content",...t})}function Xt(){const t=xe(),[a,n]=d.useState(!1),[s]=ge(),[o]=me(),[r]=je(),{data:l}=ve(),{data:p}=we(),x=D(u=>u.auth.role);return e.jsxs($t,{className:"z-50",children:[e.jsx(mt,{isOpen:a,setOpen:n}),e.jsx(Bt,{className:"h-14 justify-center",children:e.jsx(_,{children:e.jsx(y,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:l==null?void 0:l.name})})}),e.jsxs(Ht,{children:[e.jsxs(_,{children:[e.jsx(B,{children:"Content"}),e.jsx(G,{children:e.jsxs(H,{children:[e.jsx(q,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(b,{className:"group",children:[e.jsx(Qe,{}),e.jsx("span",{children:"Collections"}),e.jsx($,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(K,{children:e.jsx(F,{})})]})}),e.jsx(q,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(b,{className:"group",children:[e.jsx(st,{}),e.jsx("span",{children:"Singles"}),e.jsx($,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(K,{children:e.jsx(F,{singleton:!0})})]})}),e.jsx(w,{children:e.jsx(b,{asChild:!0,children:e.jsxs(y,{to:"/admin/dashboard/files",children:[e.jsx(Ue,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(w,{children:e.jsxs(b,{disabled:!0,children:[e.jsx(Fe,{}),e.jsx("span",{children:"Components"})]})})]})})]}),e.jsxs(_,{children:[e.jsx(B,{children:"Actions"}),e.jsx(G,{children:e.jsxs(H,{children:[x==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsxs(b,{className:"cursor-pointer",onClick:()=>o(),children:[e.jsx(Le,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(w,{children:e.jsxs(b,{className:"cursor-pointer",onClick:()=>r(),children:[e.jsx(Ge,{}),e.jsx("span",{children:"Push to repo"})]})})]}),e.jsx(w,{children:e.jsxs(b,{className:"cursor-pointer",onClick:()=>s(),children:[e.jsx(ot,{}),e.jsx("span",{children:"Publish"})]})})]})})]}),e.jsx(_,{})]}),e.jsxs(Gt,{children:[e.jsx(b,{asChild:!0,children:e.jsxs(y,{to:l==null?void 0:l.previewUrl,children:["Preview",e.jsx(De,{className:"ml-auto"})]})}),e.jsx(b,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),e.jsxs(b,{className:"cursor-pointer",onClick:()=>t(fe()),children:[e.jsx(Je,{}),"Log out"]})]})]})}function Zt({children:t}){const a=le(),n=D(o=>o.auth.user),s=D(o=>o.auth.isLoading);return d.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?null:t}function Yt(){const{pathname:t}=ce(),{data:a}=U(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,r)=>e.jsxs(ue.Fragment,{children:[r.length>1&&o>=1&&e.jsx(Ve,{size:12,className:"text-gray-500 pt-[1px]"}),e.jsx("p",{className:"text-sm leading-none tracking-tight capitalize text-gray-500 last:text-foreground",children:a[s]?a[s].displayName:s},s)]},o))}):null}const ua=he(function(){return e.jsx(Zt,{children:e.jsxs(Tt,{className:"flex h-full",children:[e.jsx(Xt,{}),e.jsxs("main",{className:"flex flex-col flex-1 h-full w-0",children:[e.jsx("header",{className:"flex sticky bg-sidebar dark:bg-sidebar z-40 top-0 h-14 shrink-0 items-center gap-2 border-b",children:e.jsxs("div",{className:"flex items-center gap-2 px-3",children:[e.jsx(Lt,{}),e.jsx(jt,{orientation:"vertical",className:"h-4"}),e.jsx(Yt,{})]})}),e.jsx(pe,{})]})]})})});export{ua as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as e,a as j,x as u,w as g}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{e as v,j as N}from"./authSlice-
|
|
1
|
+
import{p as e,a as j,x as u,w as g}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{e as v,j as N}from"./authSlice-NyheTN-1.js";import{p as k,q as w}from"./editorialApi-4jvMs8ha.js";import{c as b,b as z,a as _}from"./utils-BSDwSRl3.js";import{c as o}from"./createLucideIcon-BOhrmKcl.js";import{C as F}from"./chevron-down-CYVLN3e-.js";import{T as r}from"./trash-CYTPibS3.js";import"./tslib.es6-De9GV7Vy.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -8,12 +8,12 @@ import{p as e,a as j,x as u,w as g}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{e a
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const H=[["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"}]]
|
|
11
|
+
*/const H=[["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",H);/**
|
|
12
12
|
* @license lucide-react v0.487.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const
|
|
16
|
+
*/const C=[["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"}]],T=o("file-image",C);/**
|
|
17
17
|
* @license lucide-react v0.487.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
@@ -33,4 +33,4 @@ import{p as e,a as j,x as u,w as g}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{e a
|
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const V=[["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"}]],P=o("folder",V),Z=["txt","md","html","pdf"],A=["svg","webp","png","jpeg","jpg"],R=[{Icon:T,test:s=>A.some(i=>s.name.endsWith(i))},{Icon:I,test:s=>Z.some(i=>s.name.endsWith(i))}],W={Icon:S},p=({node:s,level:i=0,onDelete:c})=>{const[a,d]=j.useState(!1),x=v(N),m=R.find(t=>t.test(s))??W,l=s.type==="directory",h=l?"div":u,f=()=>{l&&d(!a)};return e.jsxs("div",{className:"select-none",children:[e.jsxs(h,{to
|
|
36
|
+
*/const V=[["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"}]],P=o("folder",V),Z=["txt","md","html","pdf"],A=["svg","webp","png","jpeg","jpg"],R=[{Icon:T,test:s=>A.some(i=>s.name.endsWith(i))},{Icon:I,test:s=>Z.some(i=>s.name.endsWith(i))}],W={Icon:S},p=({node:s,level:i=0,onDelete:c})=>{const[a,d]=j.useState(!1),x=v(N),m=R.find(t=>t.test(s))??W,l=s.type==="directory",h=l?"div":u,f=()=>{l&&d(!a)};return e.jsxs("div",{className:"select-none",children:[e.jsxs(h,{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:f,children:[l?e.jsx(F,{size:16,className:b("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(E,{size:16,className:"text-yellow-500"}):e.jsx(P,{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?"--":z(s.size)})}),x==="developer"&&e.jsxs("div",{className:"flex items-center gap-1 ml-4 group-hover:visible invisible z-20",children:[e.jsxs("button",{className:_("hover:text-yellow-500 p-1 hover:bg-muted rounded-clsx",l&&"invisible"),onClick:t=>{t.preventDefault(),t.stopPropagation(),navigator.clipboard.writeText(s.path)},children:[e.jsx(n,{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(r,{size:16}),e.jsx("span",{className:"sr-only",children:"Delete this file"})]})]})]}),l&&a&&s.children&&e.jsx("div",{children:s.children.map((t,y)=>e.jsx(p,{node:t,level:i+1,onDelete:c},`${t.name}-${y}`))})]})};function G(){const{data:s,isLoading:i}=k(),[c]=w();return!s||i?null:s.toSorted(a=>a.type==="directory"?-1:1).map(a=>e.jsx(p,{node:a,onDelete:c},a.name))}const ee=g(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(n,{size:14}),e.jsx(r,{size:14}),e.jsx($,{size:14})]})]}),e.jsx(G,{})]})})})});export{ee as default};
|
|
@@ -6,4 +6,4 @@ var Yn=Object.defineProperty;var Zn=(e,t,n)=>t in e?Yn(e,t,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var cn;function Xr(){if(cn)return vt;cn=1;var e=er();function t(b,v){return b===v&&(b!==0||1/b===1/v)||b!==b&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,o=e.useEffect,a=e.useMemo,y=e.useDebugValue;return vt.useSyncExternalStoreWithSelector=function(b,v,E,O,f){var l=i(null);if(l.current===null){var w={hasValue:!1,value:null};l.current=w}else w=l.current;l=a(function(){function R(u){if(!h){if(h=!0,M=u,u=O(u),f!==void 0&&w.hasValue){var S=w.value;if(f(S,u))return c=S}return c=u}if(S=c,n(M,u))return S;var A=O(u);return f!==void 0&&f(S,A)?(M=u,S):(M=u,c=A)}var h=!1,M,c,s=E===void 0?null:E;return[function(){return R(v())},s===null?void 0:function(){return R(s())}]},[v,E,O,f]);var C=r(b,l[0],l[1]);return o(function(){w.hasValue=!0,w.value=C},[C]),y(C),C},vt}var an;function Yr(){return an||(an=1,bt.exports=Xr()),bt.exports}var Zr=Yr();function xn(e){e()}function ei(){let e=null,t=null;return{clear(){e=null,t=null},notify(){xn(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var fn={notify(){},get:()=>[]};function ti(e,t){let n,r=fn,i=0,o=!1;function a(C){E();const R=r.subscribe(C);let h=!1;return()=>{h||(h=!0,R(),O())}}function y(){r.notify()}function b(){w.onStateChange&&w.onStateChange()}function v(){return o}function E(){i++,n||(n=e.subscribe(b),r=ei())}function O(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=fn)}function f(){o||(o=!0,E())}function l(){o&&(o=!1,O())}const w={addNestedSub:a,notifyNestedSubs:y,handleChangeWrapper:b,isSubscribed:v,trySubscribe:f,tryUnsubscribe:l,getListeners:()=>r};return w}var ni=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ri=ni(),ii=()=>typeof navigator<"u"&&navigator.product==="ReactNative",si=ii(),oi=()=>ri||si?x.useLayoutEffect:x.useEffect,ui=oi();function ln(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Te(e,t){if(ln(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!ln(e[n[i]],t[n[i]]))return!1;return!0}var St=Symbol.for("react-redux-context"),wt=typeof globalThis<"u"?globalThis:{};function ci(){if(!x.createContext)return{};const e=wt[St]??(wt[St]=new Map);let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var de=ci();function ai(e){const{children:t,context:n,serverState:r,store:i}=e,o=x.useMemo(()=>{const b=ti(i);return{store:i,subscription:b,getServerState:r?()=>r:void 0}},[i,r]),a=x.useMemo(()=>i.getState(),[i]);ui(()=>{const{subscription:b}=o;return b.onStateChange=b.notifyNestedSubs,b.trySubscribe(),a!==i.getState()&&b.notifyNestedSubs(),()=>{b.tryUnsubscribe(),b.onStateChange=void 0}},[o,a]);const y=n||de;return x.createElement(y.Provider,{value:o},t)}var as=ai;function $t(e=de){return function(){return x.useContext(e)}}var Fn=$t();function Nn(e=de){const t=e===de?Fn:$t(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var zn=Nn();function fi(e=de){const t=e===de?zn:Nn(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var li=fi(),di=(e,t)=>e===t;function pi(e=de){const t=e===de?Fn:$t(e),n=(r,i={})=>{const{equalityFn:o=di}=typeof i=="function"?{equalityFn:i}:i,a=t(),{store:y,subscription:b,getServerState:v}=a;x.useRef(!0);const E=x.useCallback({[r.name](f){return r(f)}}[r.name],[r]),O=Zr.useSyncExternalStoreWithSelector(b.addNestedSub,y.getState,v||y.getState,E,o);return x.useDebugValue(O),O};return Object.assign(n,{withTypes:()=>n}),n}var yi=pi(),hi=xn,gi=class extends Error{constructor(t){super(t[0].message);Le(this,"issues");this.name="SchemaError",this.issues=t}},Un=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Un||{});function dn(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var pn=fe;function Ln(e,t){if(e===t||!(pn(e)&&pn(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let i=n.length===r.length;const o=Array.isArray(t)?[]:{};for(const a of n)o[a]=Ln(e[a],t[a]),i&&(i=e[a]===o[a]);return i?e:o}function _e(e){let t=0;for(const n in e)t++;return t}var yn=e=>[].concat(...e);function mi(e){return new RegExp("(^|:)//").test(e)}function bi(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function tt(e){return e!=null}function vi(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Si=e=>e.replace(/\/$/,""),wi=e=>e.replace(/^\//,"");function _i(e,t){if(!e)return t;if(!t)return e;if(mi(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Si(e),t=wi(t),`${e}${n}${t}`}function Ei(e,t,n){return e.has(t)?e.get(t):e.set(t,n).get(t)}var hn=(...e)=>fetch(...e),Ri=e=>e.status>=200&&e.status<=299,Pi=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function gn(e){if(!fe(e))return e;const t={...e};for(const[n,r]of Object.entries(t))r===void 0&&delete t[n];return t}function Oi({baseUrl:e,prepareHeaders:t=O=>O,fetchFn:n=hn,paramsSerializer:r,isJsonContentType:i=Pi,jsonContentType:o="application/json",jsonReplacer:a,timeout:y,responseHandler:b,validateStatus:v,...E}={}){return typeof fetch>"u"&&n===hn&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(f,l,w)=>{const{getState:C,extra:R,endpoint:h,forced:M,type:c}=l;let s,{url:u,headers:S=new Headers(E.headers),params:A=void 0,responseHandler:I=b??"json",validateStatus:g=v??Ri,timeout:d=y,...p}=typeof f=="string"?{url:f}:f,m,_=l.signal;d&&(m=new AbortController,l.signal.addEventListener("abort",m.abort),_=m.signal);let P={...E,signal:_,...p};S=new Headers(gn(S)),P.headers=await t(S,{getState:C,arg:f,extra:R,endpoint:h,forced:M,type:c,extraOptions:w})||S;const T=U=>typeof U=="object"&&(fe(U)||Array.isArray(U)||typeof U.toJSON=="function");if(!P.headers.has("content-type")&&T(P.body)&&P.headers.set("content-type",o),T(P.body)&&i(P.headers)&&(P.body=JSON.stringify(P.body,a)),A){const U=~u.indexOf("?")?"&":"?",k=r?r(A):new URLSearchParams(gn(A));u+=U+k}u=_i(e,u);const q=new Request(u,P);s={request:new Request(u,P)};let j,D=!1,F=m&&setTimeout(()=>{D=!0,m.abort()},d);try{j=await n(q)}catch(U){return{error:{status:D?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(U)},meta:s}}finally{F&&clearTimeout(F),m==null||m.signal.removeEventListener("abort",m.abort)}const N=j.clone();s.response=N;let L,K="";try{let U;if(await Promise.all([O(j,I).then(k=>L=k,k=>U=k),N.text().then(k=>K=k,()=>{})]),U)throw U}catch(U){return{error:{status:"PARSING_ERROR",originalStatus:j.status,data:K,error:String(U)},meta:s}}return g(j,L)?{data:L,meta:s}:{error:{status:j.status,data:L},meta:s}};async function O(f,l){if(typeof l=="function")return l(f);if(l==="content-type"&&(l=i(f.headers)?"json":"text"),l==="json"){const w=await f.text();return w.length?JSON.parse(w):null}return f.text()}}var mn=class{constructor(e,t=void 0){this.value=e,this.meta=t}},ct=ee("__rtkq/focused"),Wt=ee("__rtkq/unfocused"),at=ee("__rtkq/online"),Vt=ee("__rtkq/offline"),_t=!1;function fs(e,t){function n(){const r=()=>e(ct()),i=()=>e(Wt()),o=()=>e(at()),a=()=>e(Vt()),y=()=>{window.document.visibilityState==="visible"?r():i()};return _t||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",y,!1),window.addEventListener("focus",r,!1),window.addEventListener("online",o,!1),window.addEventListener("offline",a,!1),_t=!0),()=>{window.removeEventListener("focus",r),window.removeEventListener("visibilitychange",y),window.removeEventListener("online",o),window.removeEventListener("offline",a),_t=!1}}return n()}function ft(e){return e.type==="query"}function Ci(e){return e.type==="mutation"}function lt(e){return e.type==="infinitequery"}function nt(e){return ft(e)||lt(e)}function Kt(e,t,n,r,i,o){return Ai(e)?e(t,n,r,i).filter(tt).map(Qt).map(o):Array.isArray(e)?e.map(Qt).map(o):[]}function Ai(e){return typeof e=="function"}function Qt(e){return typeof e=="string"?{type:e}:e}function Mi(e,t){return e.catch(t)}var je=Symbol("forceQueryFn"),kt=e=>typeof e[je]=="function";function Ii({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:r,api:i,context:o}){const a=new Map,y=new Map,{unsubscribeQueryResult:b,removeMutationResult:v,updateSubscriptionOptions:E}=i.internalActions;return{buildInitiateQuery:R,buildInitiateInfiniteQuery:h,buildInitiateMutation:M,getRunningQueryThunk:O,getRunningMutationThunk:f,getRunningQueriesThunk:l,getRunningMutationsThunk:w};function O(c,s){return u=>{var I;const S=o.endpointDefinitions[c],A=e({queryArgs:s,endpointDefinition:S,endpointName:c});return(I=a.get(u))==null?void 0:I[A]}}function f(c,s){return u=>{var S;return(S=y.get(u))==null?void 0:S[s]}}function l(){return c=>Object.values(a.get(c)||{}).filter(tt)}function w(){return c=>Object.values(y.get(c)||{}).filter(tt)}function C(c,s){const u=(S,{subscribe:A=!0,forceRefetch:I,subscriptionOptions:g,[je]:d,...p}={})=>(m,_)=>{var W;const P=e({queryArgs:S,endpointDefinition:s,endpointName:c});let T;const q={...p,type:"query",subscribe:A,forceRefetch:I,subscriptionOptions:g,endpointName:c,originalArgs:S,queryCacheKey:P,[je]:d};if(ft(s))T=t(q);else{const{direction:z,initialPageParam:J}=p;T=n({...q,direction:z,initialPageParam:J})}const Q=i.endpoints[c].select(S),j=m(T),D=Q(_()),{requestId:F,abort:N}=j,L=D.requestId!==F,K=(W=a.get(m))==null?void 0:W[P],U=()=>Q(_()),k=Object.assign(d?j.then(U):L&&!K?Promise.resolve(D):Promise.all([K,j]).then(U),{arg:S,requestId:F,subscriptionOptions:g,queryCacheKey:P,abort:N,async unwrap(){const z=await k;if(z.isError)throw z.error;return z.data},refetch:()=>m(u(S,{subscribe:!1,forceRefetch:!0})),unsubscribe(){A&&m(b({queryCacheKey:P,requestId:F}))},updateSubscriptionOptions(z){k.subscriptionOptions=z,m(E({endpointName:c,requestId:F,queryCacheKey:P,options:z}))}});if(!K&&!L&&!d){const z=Ei(a,m,{});z[P]=k,k.then(()=>{delete z[P],_e(z)||a.delete(m)})}return k};return u}function R(c,s){return C(c,s)}function h(c,s){return C(c,s)}function M(c){return(s,{track:u=!0,fixedCacheKey:S}={})=>(A,I)=>{const g=r({type:"mutation",endpointName:c,originalArgs:s,track:u,fixedCacheKey:S}),d=A(g),{requestId:p,abort:m,unwrap:_}=d,P=Mi(d.unwrap().then(j=>({data:j})),j=>({error:j})),T=()=>{A(v({requestId:p,fixedCacheKey:S}))},q=Object.assign(P,{arg:d.arg,requestId:p,abort:m,unwrap:_,reset:T}),Q=y.get(A)||{};return y.set(A,Q),Q[p]=q,q.then(()=>{delete Q[p],_e(Q)||y.delete(A)}),S&&(Q[S]=q,q.then(()=>{Q[S]===q&&(delete Q[S],_e(Q)||y.delete(A))})),q}}}var $n=class extends gi{constructor(e,t,n,r){super(e),this.value=t,this.schemaName=n,this._bqMeta=r}};async function pe(e,t,n,r){const i=await e["~standard"].validate(t);if(i.issues)throw new $n(i.issues,t,n,r);return i.value}function Ti(e){return e}var Oe=(e={})=>({...e,[st]:!0});function qi({reducerPath:e,baseQuery:t,context:{endpointDefinitions:n},serializeQueryArgs:r,api:i,assertTagType:o,selectors:a,onSchemaFailure:y,catchSchemaFailure:b,skipSchemaValidation:v}){const E=(p,m,_,P)=>(T,q)=>{const Q=n[p],j=r({queryArgs:m,endpointDefinition:Q,endpointName:p});if(T(i.internalActions.queryResultPatched({queryCacheKey:j,patches:_})),!P)return;const D=i.endpoints[p].select(m)(q()),F=Kt(Q.providesTags,D.data,void 0,m,{},o);T(i.internalActions.updateProvidedBy([{queryCacheKey:j,providedTags:F}]))};function O(p,m,_=0){const P=[m,...p];return _&&P.length>_?P.slice(0,-1):P}function f(p,m,_=0){const P=[...p,m];return _&&P.length>_?P.slice(1):P}const l=(p,m,_,P=!0)=>(T,q)=>{const j=i.endpoints[p].select(m)(q()),D={patches:[],inversePatches:[],undo:()=>T(i.util.patchQueryData(p,m,D.inversePatches,P))};if(j.status==="uninitialized")return D;let F;if("data"in j)if(ne(j.data)){const[N,L,K]=qn(j.data,_);D.patches.push(...L),D.inversePatches.push(...K),F=N}else F=_(j.data),D.patches.push({op:"replace",path:[],value:F}),D.inversePatches.push({op:"replace",path:[],value:j.data});return D.patches.length===0||T(i.util.patchQueryData(p,m,D.patches,P)),D},w=(p,m,_)=>P=>P(i.endpoints[p].initiate(m,{subscribe:!1,forceRefetch:!0,[je]:()=>({data:_})})),C=(p,m)=>p.query&&p[m]?p[m]:Ti,R=async(p,{signal:m,abort:_,rejectWithValue:P,fulfillWithValue:T,dispatch:q,getState:Q,extra:j})=>{var L,K;const D=n[p.endpointName],{metaSchema:F,skipSchemaValidation:N=v}=D;try{let U=C(D,"transformResponse");const k={signal:m,abort:_,dispatch:q,getState:Q,extra:j,endpoint:p.endpointName,type:p.type,forced:p.type==="query"?h(p,Q()):void 0,queryCacheKey:p.type==="query"?p.queryCacheKey:void 0},W=p.type==="query"?p[je]:void 0;let z;const J=async(V,$,G,be)=>{if($==null&&V.pages.length)return Promise.resolve({data:V});const re={queryArg:p.originalArgs,pageParam:$},ve=await oe(re),ie=be?O:f;return{data:{pages:ie(V.pages,ve.data,G),pageParams:ie(V.pageParams,$,G)},meta:ve.meta}};async function oe(V){let $;const{extraOptions:G,argSchema:be,rawResponseSchema:re,responseSchema:ve}=D;if(be&&!N&&(V=await pe(be,V,"argSchema",{})),W?$=W():D.query?$=await t(D.query(V),k,G):$=await D.queryFn(V,k,G,Re=>t(Re,k,G)),typeof process<"u",$.error)throw new mn($.error,$.meta);let{data:ie}=$;re&&!N&&(ie=await pe(re,$.data,"rawResponseSchema",$.meta));let ae=await U(ie,$.meta,V);return ve&&!N&&(ae=await pe(ve,ae,"responseSchema",$.meta)),{...$,data:ae}}if(p.type==="query"&&"infiniteQueryOptions"in D){const{infiniteQueryOptions:V}=D,{maxPages:$=1/0}=V;let G;const be={pages:[],pageParams:[]},re=(L=a.selectQueryEntry(Q(),p.queryCacheKey))==null?void 0:L.data,ie=h(p,Q())&&!p.direction||!re?be:re;if("direction"in p&&p.direction&&ie.pages.length){const ae=p.direction==="backward",dt=(ae?Wn:jt)(V,ie,p.originalArgs);G=await J(ie,dt,$,ae)}else{const{initialPageParam:ae=V.initialPageParam}=p,Re=(re==null?void 0:re.pageParams)??[],dt=Re[0]??ae,Jn=Re.length;G=await J(ie,dt,$),W&&(G={data:G.data.pages[0]});for(let Bt=1;Bt<Jn;Bt++){const Xn=jt(V,G.data,p.originalArgs);G=await J(G.data,Xn,$)}}z=G}else z=await oe(p.originalArgs);return F&&!N&&z.meta&&(z.meta=await pe(F,z.meta,"metaSchema",z.meta)),T(z.data,Oe({fulfilledTimeStamp:Date.now(),baseQueryMeta:z.meta}))}catch(U){let k=U;if(k instanceof mn){let W=C(D,"transformErrorResponse");const{rawErrorResponseSchema:z,errorResponseSchema:J}=D;let{value:oe,meta:V}=k;try{z&&!N&&(oe=await pe(z,oe,"rawErrorResponseSchema",V)),F&&!N&&(V=await pe(F,V,"metaSchema",V));let $=await W(oe,V,p.originalArgs);return J&&!N&&($=await pe(J,$,"errorResponseSchema",V)),P($,Oe({baseQueryMeta:V}))}catch($){k=$}}try{if(k instanceof $n){const W={endpoint:p.endpointName,arg:p.originalArgs,type:p.type,queryCacheKey:p.type==="query"?p.queryCacheKey:void 0};(K=D.onSchemaFailure)==null||K.call(D,k,W),y==null||y(k,W);const{catchSchemaFailure:z=b}=D;if(z)return P(z(k,W),Oe({baseQueryMeta:k._bqMeta}))}}catch(W){k=W}throw console.error(k),k}};function h(p,m){const _=a.selectQueryEntry(m,p.queryCacheKey),P=a.selectConfig(m).refetchOnMountOrArgChange,T=_==null?void 0:_.fulfilledTimeStamp,q=p.forceRefetch??(p.subscribe&&P);return q?q===!0||(Number(new Date)-Number(T))/1e3>=q:!1}const M=()=>un(`${e}/executeQuery`,R,{getPendingMeta({arg:m}){const _=n[m.endpointName];return Oe({startedTimeStamp:Date.now(),...lt(_)?{direction:m.direction}:{}})},condition(m,{getState:_}){var N;const P=_(),T=a.selectQueryEntry(P,m.queryCacheKey),q=T==null?void 0:T.fulfilledTimeStamp,Q=m.originalArgs,j=T==null?void 0:T.originalArgs,D=n[m.endpointName],F=m.direction;return kt(m)?!0:(T==null?void 0:T.status)==="pending"?!1:h(m,P)||ft(D)&&((N=D==null?void 0:D.forceRefetch)!=null&&N.call(D,{currentArg:Q,previousArg:j,endpointState:T,state:P}))?!0:!(q&&!F)},dispatchConditionRejection:!0}),c=M(),s=M(),u=un(`${e}/executeMutation`,R,{getPendingMeta(){return Oe({startedTimeStamp:Date.now()})}}),S=p=>"force"in p,A=p=>"ifOlderThan"in p,I=(p,m,_)=>(P,T)=>{const q=S(_)&&_.force,Q=A(_)&&_.ifOlderThan,j=(F=!0)=>{const N={forceRefetch:F,isPrefetch:!0};return i.endpoints[p].initiate(m,N)},D=i.endpoints[p].select(m)(T());if(q)P(j());else if(Q){const F=D==null?void 0:D.fulfilledTimeStamp;if(!F){P(j());return}(Number(new Date)-Number(new Date(F)))/1e3>=Q&&P(j())}else P(j(!1))};function g(p){return m=>{var _,P;return((P=(_=m==null?void 0:m.meta)==null?void 0:_.arg)==null?void 0:P.endpointName)===p}}function d(p,m){return{matchPending:Ie(Ut(p),g(m)),matchFulfilled:Ie(le(p),g(m)),matchRejected:Ie(Ee(p),g(m))}}return{queryThunk:c,mutationThunk:u,infiniteQueryThunk:s,prefetch:I,updateQueryData:l,upsertQueryData:w,patchQueryData:E,buildMatchThunkActions:d}}function jt(e,{pages:t,pageParams:n},r){const i=t.length-1;return e.getNextPageParam(t[i],t,n[i],n,r)}function Wn(e,{pages:t,pageParams:n},r){var i;return(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n,r)}function Vn(e,t,n,r){return Kt(n[e.meta.arg.endpointName][t],le(e)?e.payload:void 0,ut(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function Ke(e,t,n){const r=e[t];r&&n(r)}function xe(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function bn(e,t,n){const r=e[xe(t)];r&&n(r)}var Be={};function Di({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:r,context:{endpointDefinitions:i,apiUid:o,extractRehydrationInfo:a,hasRehydrationInfo:y},assertTagType:b,config:v}){const E=ee(`${e}/resetApiState`);function O(g,d,p,m){var _;g[_=d.queryCacheKey]??(g[_]={status:"uninitialized",endpointName:d.endpointName}),Ke(g,d.queryCacheKey,P=>{P.status="pending",P.requestId=p&&P.requestId?P.requestId:m.requestId,d.originalArgs!==void 0&&(P.originalArgs=d.originalArgs),P.startedTimeStamp=m.startedTimeStamp;const T=i[m.arg.endpointName];lt(T)&&"direction"in d&&(P.direction=d.direction)})}function f(g,d,p,m){Ke(g,d.arg.queryCacheKey,_=>{if(_.requestId!==d.requestId&&!m)return;const{merge:P}=i[d.arg.endpointName];if(_.status="fulfilled",P)if(_.data!==void 0){const{fulfilledTimeStamp:T,arg:q,baseQueryMeta:Q,requestId:j}=d;let D=ze(_.data,F=>P(F,p,{arg:q.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:T,requestId:j}));_.data=D}else _.data=p;else _.data=i[d.arg.endpointName].structuralSharing??!0?Ln(se(_.data)?or(_.data):_.data,p):p;delete _.error,_.fulfilledTimeStamp=d.fulfilledTimeStamp})}const l=Se({name:`${e}/queries`,initialState:Be,reducers:{removeQueryResult:{reducer(g,{payload:{queryCacheKey:d}}){delete g[d]},prepare:Pe()},cacheEntriesUpserted:{reducer(g,d){for(const p of d.payload){const{queryDescription:m,value:_}=p;O(g,m,!0,{arg:m,requestId:d.meta.requestId,startedTimeStamp:d.meta.timestamp}),f(g,{arg:m,requestId:d.meta.requestId,fulfilledTimeStamp:d.meta.timestamp,baseQueryMeta:{}},_,!0)}},prepare:g=>({payload:g.map(m=>{const{endpointName:_,arg:P,value:T}=m,q=i[_];return{queryDescription:{type:"query",endpointName:_,originalArgs:m.arg,queryCacheKey:r({queryArgs:P,endpointDefinition:q,endpointName:_})},value:T}}),meta:{[st]:!0,requestId:Lt(),timestamp:Date.now()}})},queryResultPatched:{reducer(g,{payload:{queryCacheKey:d,patches:p}}){Ke(g,d,m=>{m.data=Zt(m.data,p.concat())})},prepare:Pe()}},extraReducers(g){g.addCase(t.pending,(d,{meta:p,meta:{arg:m}})=>{const _=kt(m);O(d,m,_,p)}).addCase(t.fulfilled,(d,{meta:p,payload:m})=>{const _=kt(p.arg);f(d,p,m,_)}).addCase(t.rejected,(d,{meta:{condition:p,arg:m,requestId:_},error:P,payload:T})=>{Ke(d,m.queryCacheKey,q=>{if(!p){if(q.requestId!==_)return;q.status="rejected",q.error=T??P}})}).addMatcher(y,(d,p)=>{const{queries:m}=a(p);for(const[_,P]of Object.entries(m))((P==null?void 0:P.status)==="fulfilled"||(P==null?void 0:P.status)==="rejected")&&(d[_]=P)})}}),w=Se({name:`${e}/mutations`,initialState:Be,reducers:{removeMutationResult:{reducer(g,{payload:d}){const p=xe(d);p in g&&delete g[p]},prepare:Pe()}},extraReducers(g){g.addCase(n.pending,(d,{meta:p,meta:{requestId:m,arg:_,startedTimeStamp:P}})=>{_.track&&(d[xe(p)]={requestId:m,status:"pending",endpointName:_.endpointName,startedTimeStamp:P})}).addCase(n.fulfilled,(d,{payload:p,meta:m})=>{m.arg.track&&bn(d,m,_=>{_.requestId===m.requestId&&(_.status="fulfilled",_.data=p,_.fulfilledTimeStamp=m.fulfilledTimeStamp)})}).addCase(n.rejected,(d,{payload:p,error:m,meta:_})=>{_.arg.track&&bn(d,_,P=>{P.requestId===_.requestId&&(P.status="rejected",P.error=p??m)})}).addMatcher(y,(d,p)=>{const{mutations:m}=a(p);for(const[_,P]of Object.entries(m))((P==null?void 0:P.status)==="fulfilled"||(P==null?void 0:P.status)==="rejected")&&_!==(P==null?void 0:P.requestId)&&(d[_]=P)})}}),C={tags:{},keys:{}},R=Se({name:`${e}/invalidation`,initialState:C,reducers:{updateProvidedBy:{reducer(g,d){var p,m,_;for(const{queryCacheKey:P,providedTags:T}of d.payload){h(g,P);for(const{type:q,id:Q}of T){const j=(m=(p=g.tags)[q]??(p[q]={}))[_=Q||"__internal_without_id"]??(m[_]=[]);j.includes(P)||j.push(P)}g.keys[P]=T}},prepare:Pe()}},extraReducers(g){g.addCase(l.actions.removeQueryResult,(d,{payload:{queryCacheKey:p}})=>{h(d,p)}).addMatcher(y,(d,p)=>{var _,P,T;const{provided:m}=a(p);for(const[q,Q]of Object.entries(m))for(const[j,D]of Object.entries(Q)){const F=(P=(_=d.tags)[q]??(_[q]={}))[T=j||"__internal_without_id"]??(P[T]=[]);for(const N of D)F.includes(N)||F.push(N)}}).addMatcher(ce(le(t),ut(t)),(d,p)=>{M(d,[p])}).addMatcher(l.actions.cacheEntriesUpserted.match,(d,p)=>{const m=p.payload.map(({queryDescription:_,value:P})=>({type:"UNKNOWN",payload:P,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:_}}));M(d,m)})}});function h(g,d){var m;const p=g.keys[d]??[];for(const _ of p){const P=_.type,T=_.id??"__internal_without_id",q=(m=g.tags[P])==null?void 0:m[T];q&&(g.tags[P][T]=q.filter(Q=>Q!==d))}delete g.keys[d]}function M(g,d){const p=d.map(m=>{const _=Vn(m,"providesTags",i,b),{queryCacheKey:P}=m.meta.arg;return{queryCacheKey:P,providedTags:_}});R.caseReducers.updateProvidedBy(g,R.actions.updateProvidedBy(p))}const c=Se({name:`${e}/subscriptions`,initialState:Be,reducers:{updateSubscriptionOptions(g,d){},unsubscribeQueryResult(g,d){},internal_getRTKQSubscriptions(){}}}),s=Se({name:`${e}/internalSubscriptions`,initialState:Be,reducers:{subscriptionsUpdated:{reducer(g,d){return Zt(g,d.payload)},prepare:Pe()}}}),u=Se({name:`${e}/config`,initialState:{online:vi(),focused:bi(),middlewareRegistered:!1,...v},reducers:{middlewareRegistered(g,{payload:d}){g.middlewareRegistered=g.middlewareRegistered==="conflict"||o!==d?"conflict":!0}},extraReducers:g=>{g.addCase(at,d=>{d.online=!0}).addCase(Vt,d=>{d.online=!1}).addCase(ct,d=>{d.focused=!0}).addCase(Wt,d=>{d.focused=!1}).addMatcher(y,d=>({...d}))}}),S=Pn({queries:l.reducer,mutations:w.reducer,provided:R.reducer,subscriptions:s.reducer,config:u.reducer}),A=(g,d)=>S(E.match(d)?void 0:g,d),I={...u.actions,...l.actions,...c.actions,...s.actions,...w.actions,...R.actions,resetApiState:E};return{reducer:A,actions:I}}var Z=Symbol.for("RTKQ/skipToken"),Kn={status:"uninitialized"},vn=ze(Kn,()=>{}),Sn=ze(Kn,()=>{});function Qi({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const r=c=>vn,i=c=>Sn;return{buildQuerySelector:f,buildInfiniteQuerySelector:l,buildMutationSelector:w,selectInvalidatedBy:C,selectCachedArgsForQuery:R,selectApiState:a,selectQueries:y,selectMutations:v,selectQueryEntry:b,selectConfig:E};function o(c){return{...c,...dn(c.status)}}function a(c){return c[t]}function y(c){var s;return(s=a(c))==null?void 0:s.queries}function b(c,s){var u;return(u=y(c))==null?void 0:u[s]}function v(c){var s;return(s=a(c))==null?void 0:s.mutations}function E(c){var s;return(s=a(c))==null?void 0:s.config}function O(c,s,u){return S=>{if(S===Z)return n(r,u);const A=e({queryArgs:S,endpointDefinition:s,endpointName:c});return n(g=>b(g,A)??vn,u)}}function f(c,s){return O(c,s,o)}function l(c,s){const{infiniteQueryOptions:u}=s;function S(A){const I={...A,...dn(A.status)},{isLoading:g,isError:d,direction:p}=I,m=p==="forward",_=p==="backward";return{...I,hasNextPage:h(u,I.data,I.originalArgs),hasPreviousPage:M(u,I.data,I.originalArgs),isFetchingNextPage:g&&m,isFetchingPreviousPage:g&&_,isFetchNextPageError:d&&m,isFetchPreviousPageError:d&&_}}return O(c,s,S)}function w(){return c=>{let s;return typeof c=="object"?s=xe(c)??Z:s=c,n(s===Z?i:A=>{var I,g;return((g=(I=a(A))==null?void 0:I.mutations)==null?void 0:g[s])??Sn},o)}}function C(c,s){const u=c[t],S=new Set;for(const A of s.filter(tt).map(Qt)){const I=u.provided.tags[A.type];if(!I)continue;let g=(A.id!==void 0?I[A.id]:yn(Object.values(I)))??[];for(const d of g)S.add(d)}return yn(Array.from(S.values()).map(A=>{const I=u.queries[A];return I?[{queryCacheKey:A,endpointName:I.endpointName,originalArgs:I.originalArgs}]:[]}))}function R(c,s){return Object.values(y(c)).filter(u=>(u==null?void 0:u.endpointName)===s&&u.status!=="uninitialized").map(u=>u.originalArgs)}function h(c,s,u){return s?jt(c,s,u)!=null:!1}function M(c,s,u){return!s||!c.getPreviousPageParam?!1:Wn(c,s,u)!=null}}var we=WeakMap?new WeakMap:void 0,rt=({endpointName:e,queryArgs:t})=>{let n="";const r=we==null?void 0:we.get(t);if(typeof r=="string")n=r;else{const i=JSON.stringify(t,(o,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=fe(a)?Object.keys(a).sort().reduce((y,b)=>(y[b]=a[b],y),{}):a,a));fe(t)&&(we==null||we.set(t,i)),n=i}return`${e}(${n})`};function Bn(...e){return function(n){const r=et(v=>{var E;return(E=n.extractRehydrationInfo)==null?void 0:E.call(n,v,{reducerPath:n.reducerPath??"api"})}),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(v){let E=rt;if("serializeQueryArgs"in v.endpointDefinition){const O=v.endpointDefinition.serializeQueryArgs;E=f=>{const l=O(f);return typeof l=="string"?l:rt({...f,queryArgs:l})}}else n.serializeQueryArgs&&(E=n.serializeQueryArgs);return E(v)},tagTypes:[...n.tagTypes||[]]},o={endpointDefinitions:{},batch(v){v()},apiUid:Lt(),extractRehydrationInfo:r,hasRehydrationInfo:et(v=>r(v)!=null)},a={injectEndpoints:b,enhanceEndpoints({addTagTypes:v,endpoints:E}){if(v)for(const O of v)i.tagTypes.includes(O)||i.tagTypes.push(O);if(E)for(const[O,f]of Object.entries(E))typeof f=="function"?f(o.endpointDefinitions[O]):Object.assign(o.endpointDefinitions[O]||{},f);return a}},y=e.map(v=>v.init(a,i,o));function b(v){const E=v.endpoints({query:O=>({...O,type:"query"}),mutation:O=>({...O,type:"mutation"}),infiniteQuery:O=>({...O,type:"infinitequery"})});for(const[O,f]of Object.entries(E)){if(v.overrideExisting!==!0&&O in o.endpointDefinitions){if(v.overrideExisting==="throw")throw new Error(te(39));continue}o.endpointDefinitions[O]=f;for(const l of y)l.injectEndpoint(O,f)}return a}return a.injectEndpoints({endpoints:n.endpoints})}}function ue(e,...t){return Object.assign(e,...t)}var ki=({api:e,queryThunk:t,internalState:n})=>{const r=`${e.reducerPath}/subscriptions`;let i=null,o=null;const{updateSubscriptionOptions:a,unsubscribeQueryResult:y}=e.internalActions,b=(l,w)=>{var R,h,M;if(a.match(w)){const{queryCacheKey:c,requestId:s,options:u}=w.payload;return(R=l==null?void 0:l[c])!=null&&R[s]&&(l[c][s]=u),!0}if(y.match(w)){const{queryCacheKey:c,requestId:s}=w.payload;return l[c]&&delete l[c][s],!0}if(e.internalActions.removeQueryResult.match(w))return delete l[w.payload.queryCacheKey],!0;if(t.pending.match(w)){const{meta:{arg:c,requestId:s}}=w,u=l[h=c.queryCacheKey]??(l[h]={});return u[`${s}_running`]={},c.subscribe&&(u[s]=c.subscriptionOptions??u[s]??{}),!0}let C=!1;if(t.fulfilled.match(w)||t.rejected.match(w)){const c=l[w.meta.arg.queryCacheKey]||{},s=`${w.meta.requestId}_running`;C||(C=!!c[s]),delete c[s]}if(t.rejected.match(w)){const{meta:{condition:c,arg:s,requestId:u}}=w;if(c&&s.subscribe){const S=l[M=s.queryCacheKey]??(l[M]={});S[u]=s.subscriptionOptions??S[u]??{},C=!0}}return C},v=()=>n.currentSubscriptions,f={getSubscriptions:v,getSubscriptionCount:l=>{const C=v()[l]??{};return _e(C)},isRequestSubscribed:(l,w)=>{var R;const C=v();return!!((R=C==null?void 0:C[l])!=null&&R[w])}};return(l,w)=>{if(i||(i=JSON.parse(JSON.stringify(n.currentSubscriptions))),e.util.resetApiState.match(l))return i=n.currentSubscriptions={},o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(l))return[!1,f];const C=b(n.currentSubscriptions,l);let R=!0;if(C){o||(o=setTimeout(()=>{const c=JSON.parse(JSON.stringify(n.currentSubscriptions)),[,s]=qn(i,()=>c);w.next(e.internalActions.subscriptionsUpdated(s)),i=c,o=null},500));const h=typeof l.type=="string"&&!!l.type.startsWith(r),M=t.rejected.match(l)&&l.meta.condition&&!!l.meta.arg.subscribe;R=!h&&!M}return[R,!1]}};function ji(e){for(const t in e)return!1;return!0}var xi=2147483647/1e3-1,Fi=({reducerPath:e,api:t,queryThunk:n,context:r,internalState:i,selectors:{selectQueryEntry:o,selectConfig:a}})=>{const{removeQueryResult:y,unsubscribeQueryResult:b,cacheEntriesUpserted:v}=t.internalActions,E=ce(b.match,n.fulfilled,n.rejected,v.match);function O(R){const h=i.currentSubscriptions[R];return!!h&&!ji(h)}const f={},l=(R,h,M)=>{const c=h.getState(),s=a(c);if(E(R)){let u;if(v.match(R))u=R.payload.map(S=>S.queryDescription.queryCacheKey);else{const{queryCacheKey:S}=b.match(R)?R.payload:R.meta.arg;u=[S]}w(u,h,s)}if(t.util.resetApiState.match(R))for(const[u,S]of Object.entries(f))S&&clearTimeout(S),delete f[u];if(r.hasRehydrationInfo(R)){const{queries:u}=r.extractRehydrationInfo(R);w(Object.keys(u),h,s)}};function w(R,h,M){const c=h.getState();for(const s of R){const u=o(c,s);C(s,u==null?void 0:u.endpointName,h,M)}}function C(R,h,M,c){const s=r.endpointDefinitions[h],u=(s==null?void 0:s.keepUnusedDataFor)??c.keepUnusedDataFor;if(u===1/0)return;const S=Math.max(0,Math.min(u,xi));if(!O(R)){const A=f[R];A&&clearTimeout(A),f[R]=setTimeout(()=>{O(R)||M.dispatch(y({queryCacheKey:R})),delete f[R]},S*1e3)}}return l},wn=new Error("Promise never resolved before cacheEntryRemoved."),Ni=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:i,internalState:o,selectors:{selectQueryEntry:a,selectApiState:y}})=>{const b=Dt(r),v=Dt(i),E=le(r,i),O={};function f(h,M,c){const s=O[h];s!=null&&s.valueResolved&&(s.valueResolved({data:M,meta:c}),delete s.valueResolved)}function l(h){const M=O[h];M&&(delete O[h],M.cacheEntryRemoved())}const w=(h,M,c)=>{const s=C(h);function u(S,A,I,g){const d=a(c,A),p=a(M.getState(),A);!d&&p&&R(S,g,A,M,I)}if(r.pending.match(h))u(h.meta.arg.endpointName,s,h.meta.requestId,h.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(h))for(const{queryDescription:S,value:A}of h.payload){const{endpointName:I,originalArgs:g,queryCacheKey:d}=S;u(I,d,h.meta.requestId,g),f(d,A,{})}else if(i.pending.match(h))M.getState()[t].mutations[s]&&R(h.meta.arg.endpointName,h.meta.arg.originalArgs,s,M,h.meta.requestId);else if(E(h))f(s,h.payload,h.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(h)||e.internalActions.removeMutationResult.match(h))l(s);else if(e.util.resetApiState.match(h))for(const S of Object.keys(O))l(S)};function C(h){return b(h)?h.meta.arg.queryCacheKey:v(h)?h.meta.arg.fixedCacheKey??h.meta.requestId:e.internalActions.removeQueryResult.match(h)?h.payload.queryCacheKey:e.internalActions.removeMutationResult.match(h)?xe(h.payload):""}function R(h,M,c,s,u){const S=n.endpointDefinitions[h],A=S==null?void 0:S.onCacheEntryAdded;if(!A)return;const I={},g=new Promise(T=>{I.cacheEntryRemoved=T}),d=Promise.race([new Promise(T=>{I.valueResolved=T}),g.then(()=>{throw wn})]);d.catch(()=>{}),O[c]=I;const p=e.endpoints[h].select(nt(S)?M:c),m=s.dispatch((T,q,Q)=>Q),_={...s,getCacheEntry:()=>p(s.getState()),requestId:u,extra:m,updateCachedData:nt(S)?T=>s.dispatch(e.util.updateQueryData(h,M,T)):void 0,cacheDataLoaded:d,cacheEntryRemoved:g},P=A(M,_);Promise.resolve(P).catch(T=>{if(T!==wn)throw T})}return w},zi=({api:e,context:{apiUid:t},reducerPath:n})=>(r,i)=>{e.util.resetApiState.match(r)&&i.dispatch(e.internalActions.middlewareRegistered(t))},Ui=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:r,queryThunk:i,api:o,assertTagType:a,refetchQuery:y,internalState:b})=>{const{removeQueryResult:v}=o.internalActions,E=ce(le(r),ut(r)),O=ce(le(r,i),Ee(r,i));let f=[];const l=(R,h)=>{E(R)?C(Vn(R,"invalidatesTags",n,a),h):O(R)?C([],h):o.util.invalidateTags.match(R)&&C(Kt(R.payload,void 0,void 0,void 0,void 0,a),h)};function w(R){var c;const{queries:h,mutations:M}=R;for(const s of[h,M])for(const u in s)if(((c=s[u])==null?void 0:c.status)==="pending")return!0;return!1}function C(R,h){const M=h.getState(),c=M[e];if(f.push(...R),c.config.invalidationBehavior==="delayed"&&w(c))return;const s=f;if(f=[],s.length===0)return;const u=o.util.selectInvalidatedBy(M,s);t.batch(()=>{const S=Array.from(u.values());for(const{queryCacheKey:A}of S){const I=c.queries[A],g=b.currentSubscriptions[A]??{};I&&(_e(g)===0?h.dispatch(v({queryCacheKey:A})):I.status!=="uninitialized"&&h.dispatch(y(I)))}})}return l},Li=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:i})=>{const o={},a=(f,l)=>{(n.internalActions.updateSubscriptionOptions.match(f)||n.internalActions.unsubscribeQueryResult.match(f))&&b(f.payload,l),(t.pending.match(f)||t.rejected.match(f)&&f.meta.condition)&&b(f.meta.arg,l),(t.fulfilled.match(f)||t.rejected.match(f)&&!f.meta.condition)&&y(f.meta.arg,l),n.util.resetApiState.match(f)&&E()};function y({queryCacheKey:f},l){const w=l.getState()[e],C=w.queries[f],R=i.currentSubscriptions[f];if(!C||C.status==="uninitialized")return;const{lowestPollingInterval:h,skipPollingIfUnfocused:M}=O(R);if(!Number.isFinite(h))return;const c=o[f];c!=null&&c.timeout&&(clearTimeout(c.timeout),c.timeout=void 0);const s=Date.now()+h;o[f]={nextPollTimestamp:s,pollingInterval:h,timeout:setTimeout(()=>{(w.config.focused||!M)&&l.dispatch(r(C)),y({queryCacheKey:f},l)},h)}}function b({queryCacheKey:f},l){const C=l.getState()[e].queries[f],R=i.currentSubscriptions[f];if(!C||C.status==="uninitialized")return;const{lowestPollingInterval:h}=O(R);if(!Number.isFinite(h)){v(f);return}const M=o[f],c=Date.now()+h;(!M||c<M.nextPollTimestamp)&&y({queryCacheKey:f},l)}function v(f){const l=o[f];l!=null&&l.timeout&&clearTimeout(l.timeout),delete o[f]}function E(){for(const f of Object.keys(o))v(f)}function O(f={}){let l=!1,w=Number.POSITIVE_INFINITY;for(let C in f)f[C].pollingInterval&&(w=Math.min(f[C].pollingInterval,w),l=f[C].skipPollingIfUnfocused||l);return{lowestPollingInterval:w,skipPollingIfUnfocused:l}}return a},$i=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const i=Ut(n,r),o=Ee(n,r),a=le(n,r),y={};return(v,E)=>{var O,f;if(i(v)){const{requestId:l,arg:{endpointName:w,originalArgs:C}}=v.meta,R=t.endpointDefinitions[w],h=R==null?void 0:R.onQueryStarted;if(h){const M={},c=new Promise((A,I)=>{M.resolve=A,M.reject=I});c.catch(()=>{}),y[l]=M;const s=e.endpoints[w].select(nt(R)?C:l),u=E.dispatch((A,I,g)=>g),S={...E,getCacheEntry:()=>s(E.getState()),requestId:l,extra:u,updateCachedData:nt(R)?A=>E.dispatch(e.util.updateQueryData(w,C,A)):void 0,queryFulfilled:c};h(C,S)}}else if(a(v)){const{requestId:l,baseQueryMeta:w}=v.meta;(O=y[l])==null||O.resolve({data:v.payload,meta:w}),delete y[l]}else if(o(v)){const{requestId:l,rejectedWithValue:w,baseQueryMeta:C}=v.meta;(f=y[l])==null||f.reject({error:v.payload??v.error,isUnhandledError:!w,meta:C}),delete y[l]}}},Wi=({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:i})=>{const{removeQueryResult:o}=n.internalActions,a=(b,v)=>{ct.match(b)&&y(v,"refetchOnFocus"),at.match(b)&&y(v,"refetchOnReconnect")};function y(b,v){const E=b.getState()[e],O=E.queries,f=i.currentSubscriptions;t.batch(()=>{for(const l of Object.keys(f)){const w=O[l],C=f[l];if(!C||!w)continue;(Object.values(C).some(h=>h[v]===!0)||Object.values(C).every(h=>h[v]===void 0)&&E.config[v])&&(_e(C)===0?b.dispatch(o({queryCacheKey:l})):w.status!=="uninitialized"&&b.dispatch(r(w)))}})}return a};function Vi(e){const{reducerPath:t,queryThunk:n,api:r,context:i}=e,{apiUid:o}=i,a={invalidateTags:ee(`${t}/invalidateTags`)},y=O=>O.type.startsWith(`${t}/`),b=[zi,Fi,Ui,Li,Ni,$i];return{middleware:O=>{let f=!1;const w={...e,internalState:{currentSubscriptions:{}},refetchQuery:E,isThisApiSliceAction:y},C=b.map(M=>M(w)),R=ki(w),h=Wi(w);return M=>c=>{if(!On(c))return M(c);f||(f=!0,O.dispatch(r.internalActions.middlewareRegistered(o)));const s={...O,next:M},u=O.getState(),[S,A]=R(c,s,u);let I;if(S?I=M(c):I=A,O.getState()[t]&&(h(c,s,u),y(c)||i.hasRehydrationInfo(c)))for(const g of C)g(c,s,u);return I}},actions:a};function E(O){return e.api.endpoints[O.endpointName].initiate(O.originalArgs,{subscribe:!1,forceRefetch:!0})}}var _n=Symbol(),Hn=({createSelector:e=zt}={})=>({name:_n,init(t,{baseQuery:n,tagTypes:r,reducerPath:i,serializeQueryArgs:o,keepUnusedDataFor:a,refetchOnMountOrArgChange:y,refetchOnFocus:b,refetchOnReconnect:v,invalidationBehavior:E,onSchemaFailure:O,catchSchemaFailure:f,skipSchemaValidation:l},w){gr();const C=k=>k;Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:at,onOffline:Vt,onFocus:ct,onFocusLost:Wt},util:{}});const R=Qi({serializeQueryArgs:o,reducerPath:i,createSelector:e}),{selectInvalidatedBy:h,selectCachedArgsForQuery:M,buildQuerySelector:c,buildInfiniteQuerySelector:s,buildMutationSelector:u}=R;ue(t.util,{selectInvalidatedBy:h,selectCachedArgsForQuery:M});const{queryThunk:S,infiniteQueryThunk:A,mutationThunk:I,patchQueryData:g,updateQueryData:d,upsertQueryData:p,prefetch:m,buildMatchThunkActions:_}=qi({baseQuery:n,reducerPath:i,context:w,api:t,serializeQueryArgs:o,assertTagType:C,selectors:R,onSchemaFailure:O,catchSchemaFailure:f,skipSchemaValidation:l}),{reducer:P,actions:T}=Di({context:w,queryThunk:S,mutationThunk:I,serializeQueryArgs:o,reducerPath:i,assertTagType:C,config:{refetchOnFocus:b,refetchOnReconnect:v,refetchOnMountOrArgChange:y,keepUnusedDataFor:a,reducerPath:i,invalidationBehavior:E}});ue(t.util,{patchQueryData:g,updateQueryData:d,upsertQueryData:p,prefetch:m,resetApiState:T.resetApiState,upsertQueryEntries:T.cacheEntriesUpserted}),ue(t.internalActions,T);const{middleware:q,actions:Q}=Vi({reducerPath:i,context:w,queryThunk:S,mutationThunk:I,infiniteQueryThunk:A,api:t,assertTagType:C,selectors:R});ue(t.util,Q),ue(t,{reducer:P,middleware:q});const{buildInitiateQuery:j,buildInitiateInfiniteQuery:D,buildInitiateMutation:F,getRunningMutationThunk:N,getRunningMutationsThunk:L,getRunningQueriesThunk:K,getRunningQueryThunk:U}=Ii({queryThunk:S,mutationThunk:I,infiniteQueryThunk:A,api:t,serializeQueryArgs:o,context:w});return ue(t.util,{getRunningMutationThunk:N,getRunningMutationsThunk:L,getRunningQueryThunk:U,getRunningQueriesThunk:K}),{name:_n,injectEndpoint(k,W){var oe;const J=(oe=t.endpoints)[k]??(oe[k]={});ft(W)&&ue(J,{name:k,select:c(k,W),initiate:j(k,W)},_(S,k)),Ci(W)&&ue(J,{name:k,select:u(),initiate:F(k)},_(I,k)),lt(W)&&ue(J,{name:k,select:s(k,W),initiate:D(k,W)},_(S,k))}}}});Hn();function He(e){return e.replace(e[0],e[0].toUpperCase())}function Ki(e){return e.type==="query"}function Bi(e){return e.type==="mutation"}function Gn(e){return e.type==="infinitequery"}function Ce(e,...t){return Object.assign(e,...t)}var Et=Symbol();function Rt(e,t,n,r){const i=x.useMemo(()=>({queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}),[e,t,n,r]),o=x.useRef(i);return x.useEffect(()=>{o.current.serialized!==i.serialized&&(o.current=i)},[i]),o.current.serialized===i.serialized?o.current.queryArgs:e}function Ge(e){const t=x.useRef(e);return x.useEffect(()=>{Te(t.current,e)||(t.current=e)},[e]),Te(t.current,e)?t.current:e}var Hi=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Gi=Hi(),Ji=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Xi=Ji(),Yi=()=>Gi||Xi?x.useLayoutEffect:x.useEffect,Zi=Yi(),En=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Un.pending}:e;function Pt(e,...t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}var Ot=["data","status","isLoading","isSuccess","isError","error"];function es({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:r,useStore:i},unstable__sideEffectsInRender:o,createSelector:a},serializeQueryArgs:y,context:b}){const v=o?s=>s():x.useEffect;return{buildQueryHooks:h,buildInfiniteQueryHooks:M,buildMutationHook:c,usePrefetch:f};function E(s,u,S){if(u!=null&&u.endpointName&&s.isUninitialized){const{endpointName:m}=u,_=b.endpointDefinitions[m];S!==Z&&y({queryArgs:u.originalArgs,endpointDefinition:_,endpointName:m})===y({queryArgs:S,endpointDefinition:_,endpointName:m})&&(u=void 0)}let A=s.isSuccess?s.data:u==null?void 0:u.data;A===void 0&&(A=s.data);const I=A!==void 0,g=s.isLoading,d=(!u||u.isLoading||u.isUninitialized)&&!I&&g,p=s.isSuccess||I&&(g&&!(u!=null&&u.isError)||s.isUninitialized);return{...s,data:A,currentData:s.data,isFetching:g,isLoading:d,isSuccess:p}}function O(s,u,S){if(u!=null&&u.endpointName&&s.isUninitialized){const{endpointName:m}=u,_=b.endpointDefinitions[m];S!==Z&&y({queryArgs:u.originalArgs,endpointDefinition:_,endpointName:m})===y({queryArgs:S,endpointDefinition:_,endpointName:m})&&(u=void 0)}let A=s.isSuccess?s.data:u==null?void 0:u.data;A===void 0&&(A=s.data);const I=A!==void 0,g=s.isLoading,d=(!u||u.isLoading||u.isUninitialized)&&!I&&g,p=s.isSuccess||g&&I;return{...s,data:A,currentData:s.data,isFetching:g,isLoading:d,isSuccess:p}}function f(s,u){const S=n(),A=Ge(u);return x.useCallback((I,g)=>S(e.util.prefetch(s,I,{...A,...g})),[s,S,A])}function l(s,u,{refetchOnReconnect:S,refetchOnFocus:A,refetchOnMountOrArgChange:I,skip:g=!1,pollingInterval:d=0,skipPollingIfUnfocused:p=!1,...m}={}){const{initiate:_}=e.endpoints[s],P=n(),T=x.useRef(void 0);if(!T.current){const k=P(e.internalActions.internal_getRTKQSubscriptions());T.current=k}const q=Rt(g?Z:u,rt,b.endpointDefinitions[s],s),Q=Ge({refetchOnReconnect:S,refetchOnFocus:A,pollingInterval:d,skipPollingIfUnfocused:p}),j=m.initialPageParam,D=Ge(j),F=x.useRef(void 0);let{queryCacheKey:N,requestId:L}=F.current||{},K=!1;N&&L&&(K=T.current.isRequestSubscribed(N,L));const U=!K&&F.current!==void 0;return v(()=>{U&&(F.current=void 0)},[U]),v(()=>{var z;const k=F.current;if(q===Z){k==null||k.unsubscribe(),F.current=void 0;return}const W=(z=F.current)==null?void 0:z.subscriptionOptions;if(!k||k.arg!==q){k==null||k.unsubscribe();const J=P(_(q,{subscriptionOptions:Q,forceRefetch:I,...Gn(b.endpointDefinitions[s])?{initialPageParam:D}:{}}));F.current=J}else Q!==W&&k.updateSubscriptionOptions(Q)},[P,_,I,q,Q,U,D,s]),[F,P,_,Q]}function w(s,u){return(A,{skip:I=!1,selectFromResult:g}={})=>{const{select:d}=e.endpoints[s],p=Rt(I?Z:A,y,b.endpointDefinitions[s],s),m=x.useRef(void 0),_=x.useMemo(()=>a([d(p),(j,D)=>D,j=>p],u,{memoizeOptions:{resultEqualityCheck:Te}}),[d,p]),P=x.useMemo(()=>g?a([_],g,{devModeChecks:{identityFunctionCheck:"never"}}):_,[_,g]),T=r(j=>P(j,m.current),Te),q=i(),Q=_(q.getState(),m.current);return Zi(()=>{m.current=Q},[Q]),T}}function C(s){x.useEffect(()=>()=>{var u,S;(S=(u=s.current)==null?void 0:u.unsubscribe)==null||S.call(u),s.current=void 0},[s])}function R(s){if(!s.current)throw new Error(te(38));return s.current.refetch()}function h(s){const u=(I,g={})=>{const[d]=l(s,I,g);return C(d),x.useMemo(()=>({refetch:()=>R(d)}),[d])},S=({refetchOnReconnect:I,refetchOnFocus:g,pollingInterval:d=0,skipPollingIfUnfocused:p=!1}={})=>{const{initiate:m}=e.endpoints[s],_=n(),[P,T]=x.useState(Et),q=x.useRef(void 0),Q=Ge({refetchOnReconnect:I,refetchOnFocus:g,pollingInterval:d,skipPollingIfUnfocused:p});v(()=>{var L,K;const N=(L=q.current)==null?void 0:L.subscriptionOptions;Q!==N&&((K=q.current)==null||K.updateSubscriptionOptions(Q))},[Q]);const j=x.useRef(Q);v(()=>{j.current=Q},[Q]);const D=x.useCallback(function(N,L=!1){let K;return t(()=>{var U;(U=q.current)==null||U.unsubscribe(),q.current=K=_(m(N,{subscriptionOptions:j.current,forceRefetch:!L})),T(N)}),K},[_,m]),F=x.useCallback(()=>{var N,L;(N=q.current)!=null&&N.queryCacheKey&&_(e.internalActions.removeQueryResult({queryCacheKey:(L=q.current)==null?void 0:L.queryCacheKey}))},[_]);return x.useEffect(()=>()=>{var N;(N=q==null?void 0:q.current)==null||N.unsubscribe()},[]),x.useEffect(()=>{P!==Et&&!q.current&&D(P,!0)},[P,D]),x.useMemo(()=>[D,P,{reset:F}],[D,P,F])},A=w(s,E);return{useQueryState:A,useQuerySubscription:u,useLazyQuerySubscription:S,useLazyQuery(I){const[g,d,{reset:p}]=S(I),m=A(d,{...I,skip:d===Et}),_=x.useMemo(()=>({lastArg:d}),[d]);return x.useMemo(()=>[g,{...m,reset:p},_],[g,m,p,_])},useQuery(I,g){const d=u(I,g),p=A(I,{selectFromResult:I===Z||g!=null&&g.skip?void 0:En,...g}),m=Pt(p,...Ot);return x.useDebugValue(m),x.useMemo(()=>({...p,...d}),[p,d])}}}function M(s){const u=(A,I={})=>{const[g,d,p,m]=l(s,A,I),_=x.useRef(m);v(()=>{_.current=m},[m]);const P=x.useCallback(function(Q,j){let D;return t(()=>{var F;(F=g.current)==null||F.unsubscribe(),g.current=D=d(p(Q,{subscriptionOptions:_.current,direction:j}))}),D},[g,d,p]);C(g);const T=Rt(I.skip?Z:A,rt,b.endpointDefinitions[s],s),q=x.useCallback(()=>R(g),[g]);return x.useMemo(()=>({trigger:P,refetch:q,fetchNextPage:()=>P(T,"forward"),fetchPreviousPage:()=>P(T,"backward")}),[q,P,T])},S=w(s,O);return{useInfiniteQueryState:S,useInfiniteQuerySubscription:u,useInfiniteQuery(A,I){const{refetch:g,fetchNextPage:d,fetchPreviousPage:p}=u(A,I),m=S(A,{selectFromResult:A===Z||I!=null&&I.skip?void 0:En,...I}),_=Pt(m,...Ot,"hasNextPage","hasPreviousPage");return x.useDebugValue(_),x.useMemo(()=>({...m,fetchNextPage:d,fetchPreviousPage:p,refetch:g}),[m,d,p,g])}}}function c(s){return({selectFromResult:u,fixedCacheKey:S}={})=>{const{select:A,initiate:I}=e.endpoints[s],g=n(),[d,p]=x.useState();x.useEffect(()=>()=>{d!=null&&d.arg.fixedCacheKey||d==null||d.reset()},[d]);const m=x.useCallback(function(N){const L=g(I(N,{fixedCacheKey:S}));return p(L),L},[g,I,S]),{requestId:_}=d||{},P=x.useMemo(()=>A({fixedCacheKey:S,requestId:d==null?void 0:d.requestId}),[S,d,A]),T=x.useMemo(()=>u?a([P],u):P,[u,P]),q=r(T,Te),Q=S==null?d==null?void 0:d.arg.originalArgs:void 0,j=x.useCallback(()=>{t(()=>{d&&p(void 0),S&&g(e.internalActions.removeMutationResult({requestId:_,fixedCacheKey:S}))})},[g,S,d,_]),D=Pt(q,...Ot,"endpointName");x.useDebugValue(D);const F=x.useMemo(()=>({...q,originalArgs:Q,reset:j}),[q,Q,j]);return x.useMemo(()=>[m,F],[m,F])}}}var ts=Symbol(),ns=({batch:e=hi,hooks:t={useDispatch:li,useSelector:yi,useStore:zn},createSelector:n=zt,unstable__sideEffectsInRender:r=!1,...i}={})=>({name:ts,init(o,{serializeQueryArgs:a},y){const b=o,{buildQueryHooks:v,buildInfiniteQueryHooks:E,buildMutationHook:O,usePrefetch:f}=es({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:r,createSelector:n},serializeQueryArgs:a,context:y});return Ce(b,{usePrefetch:f}),Ce(y,{batch:e}),{injectEndpoint(l,w){if(Ki(w)){const{useQuery:C,useLazyQuery:R,useLazyQuerySubscription:h,useQueryState:M,useQuerySubscription:c}=v(l);Ce(b.endpoints[l],{useQuery:C,useLazyQuery:R,useLazyQuerySubscription:h,useQueryState:M,useQuerySubscription:c}),o[`use${He(l)}Query`]=C,o[`useLazy${He(l)}Query`]=R}if(Bi(w)){const C=O(l);Ce(b.endpoints[l],{useMutation:C}),o[`use${He(l)}Mutation`]=C}else if(Gn(w)){const{useInfiniteQuery:C,useInfiniteQuerySubscription:R,useInfiniteQueryState:h}=E(l);Ce(b.endpoints[l],{useInfiniteQuery:C,useInfiniteQuerySubscription:R,useInfiniteQueryState:h}),o[`use${He(l)}InfiniteQuery`]=C}}}}}),rs=Bn(Hn(),ns());const is=async(e,t,n)=>typeof window>"u"?{data:{}}:Oi({baseUrl:"/api/v1"})(e,t,n),ss=rs({reducerPath:"editorialApi",baseQuery:is,tagTypes:["schema","data","files","config"],endpoints:e=>({getConfig:e.query({query:()=>"/config",providesTags:[{type:"config"}]}),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,n,r)=>t[r]||null,providesTags:(t,n,r)=>[{type:"schema",id:r}]}),getData:e.query({query:()=>"/data",providesTags:()=>[{type:"data"}]}),getDataCount:e.query({query:()=>"/data",transformResponse(t){return Object.values(t).reduce((r,i)=>r+Object.keys(i).length,0)}}),getDataObject:e.query({query:()=>"/data",transformResponse:(t,n,{itemType:r,id:i})=>t[r][i]||null,providesTags:(t,n,{itemType:r,id:i})=>[{type:"data",id:`${r}-${i}`}]}),getFiles:e.query({query:()=>"/files",transformResponse:t=>t.files,providesTags:()=>[{type:"files"}]}),getFileCount:e.query({query:()=>"/files",transformResponse:t=>{function n(i){let o=i.type==="file"?1:0;return i.children&&i.children.length>0&&(o+=i.children.reduce((a,y)=>a+n(y),0)),o}function r(i){return i.reduce((o,a)=>o+n(a),0)}return r(t.files)}}),getFilesTotalSize:e.query({query:()=>"/files",transformResponse:t=>t.totalSize,providesTags:()=>[{type:"files"}]}),deleteFile:e.mutation({query:t=>({url:"/files",method:"DELETE",body:{path:t}}),invalidatesTags:()=>[{type:"files"}]}),updateObject:e.mutation({query:({id:t,type:n,...r})=>({url:`/data/${n}/${t}`,method:"PATCH",body:{id:t,type:n,...r}}),invalidatesTags:()=>[{type:"data"}]}),createObject:e.mutation({query:({id:t,type:n,...r})=>({url:`/data/${n}/${t}`,method:"PUT",body:{id:t,type:n,...r}}),invalidatesTags:()=>[{type:"data"}]}),deleteObject:e.mutation({query:({id:t,type:n})=>({url:`/data/${n}/${t}`,method:"DELETE"}),invalidatesTags:()=>[{type:"data"}]})})}),{useCreateObjectMutation:ls,useDeleteFileMutation:ds,useDeleteObjectMutation:ps,useGetConfigQuery:ys,useGetDataCountQuery:hs,useGetDataObjectQuery:gs,useGetDataQuery:ms,useGetFileCountQuery:bs,useGetFilesQuery:vs,useGetFilesTotalSizeQuery:Ss,useGetSchemaQuery:ws,useGetSchemaTypeQuery:_s,usePublishMutation:Es,usePullMutation:Rs,usePushMutation:Ps,useUpdateObjectMutation:Os}=ss;export{as as P,ws as a,ms as b,cs as c,Es as d,ss as e,Rs as f,Ps as g,Ss as h,hs as i,bs as j,_s as k,ps as l,gs as m,ls as n,Os as o,vs as p,ds as q,li as r,fs as s,yi as t,ys as u,zn as v,un as w,Se as x};
|
|
9
|
+
*/var cn;function Xr(){if(cn)return vt;cn=1;var e=er();function t(b,v){return b===v&&(b!==0||1/b===1/v)||b!==b&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,o=e.useEffect,a=e.useMemo,y=e.useDebugValue;return vt.useSyncExternalStoreWithSelector=function(b,v,E,O,f){var l=i(null);if(l.current===null){var w={hasValue:!1,value:null};l.current=w}else w=l.current;l=a(function(){function R(u){if(!h){if(h=!0,M=u,u=O(u),f!==void 0&&w.hasValue){var S=w.value;if(f(S,u))return c=S}return c=u}if(S=c,n(M,u))return S;var A=O(u);return f!==void 0&&f(S,A)?(M=u,S):(M=u,c=A)}var h=!1,M,c,s=E===void 0?null:E;return[function(){return R(v())},s===null?void 0:function(){return R(s())}]},[v,E,O,f]);var C=r(b,l[0],l[1]);return o(function(){w.hasValue=!0,w.value=C},[C]),y(C),C},vt}var an;function Yr(){return an||(an=1,bt.exports=Xr()),bt.exports}var Zr=Yr();function xn(e){e()}function ei(){let e=null,t=null;return{clear(){e=null,t=null},notify(){xn(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var fn={notify(){},get:()=>[]};function ti(e,t){let n,r=fn,i=0,o=!1;function a(C){E();const R=r.subscribe(C);let h=!1;return()=>{h||(h=!0,R(),O())}}function y(){r.notify()}function b(){w.onStateChange&&w.onStateChange()}function v(){return o}function E(){i++,n||(n=e.subscribe(b),r=ei())}function O(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=fn)}function f(){o||(o=!0,E())}function l(){o&&(o=!1,O())}const w={addNestedSub:a,notifyNestedSubs:y,handleChangeWrapper:b,isSubscribed:v,trySubscribe:f,tryUnsubscribe:l,getListeners:()=>r};return w}var ni=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ri=ni(),ii=()=>typeof navigator<"u"&&navigator.product==="ReactNative",si=ii(),oi=()=>ri||si?x.useLayoutEffect:x.useEffect,ui=oi();function ln(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Te(e,t){if(ln(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!ln(e[n[i]],t[n[i]]))return!1;return!0}var St=Symbol.for("react-redux-context"),wt=typeof globalThis<"u"?globalThis:{};function ci(){if(!x.createContext)return{};const e=wt[St]??(wt[St]=new Map);let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var de=ci();function ai(e){const{children:t,context:n,serverState:r,store:i}=e,o=x.useMemo(()=>{const b=ti(i);return{store:i,subscription:b,getServerState:r?()=>r:void 0}},[i,r]),a=x.useMemo(()=>i.getState(),[i]);ui(()=>{const{subscription:b}=o;return b.onStateChange=b.notifyNestedSubs,b.trySubscribe(),a!==i.getState()&&b.notifyNestedSubs(),()=>{b.tryUnsubscribe(),b.onStateChange=void 0}},[o,a]);const y=n||de;return x.createElement(y.Provider,{value:o},t)}var as=ai;function $t(e=de){return function(){return x.useContext(e)}}var Fn=$t();function Nn(e=de){const t=e===de?Fn:$t(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var zn=Nn();function fi(e=de){const t=e===de?zn:Nn(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var li=fi(),di=(e,t)=>e===t;function pi(e=de){const t=e===de?Fn:$t(e),n=(r,i={})=>{const{equalityFn:o=di}=typeof i=="function"?{equalityFn:i}:i,a=t(),{store:y,subscription:b,getServerState:v}=a;x.useRef(!0);const E=x.useCallback({[r.name](f){return r(f)}}[r.name],[r]),O=Zr.useSyncExternalStoreWithSelector(b.addNestedSub,y.getState,v||y.getState,E,o);return x.useDebugValue(O),O};return Object.assign(n,{withTypes:()=>n}),n}var yi=pi(),hi=xn,gi=class extends Error{constructor(t){super(t[0].message);Le(this,"issues");this.name="SchemaError",this.issues=t}},Un=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Un||{});function dn(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var pn=fe;function Ln(e,t){if(e===t||!(pn(e)&&pn(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let i=n.length===r.length;const o=Array.isArray(t)?[]:{};for(const a of n)o[a]=Ln(e[a],t[a]),i&&(i=e[a]===o[a]);return i?e:o}function _e(e){let t=0;for(const n in e)t++;return t}var yn=e=>[].concat(...e);function mi(e){return new RegExp("(^|:)//").test(e)}function bi(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function tt(e){return e!=null}function vi(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Si=e=>e.replace(/\/$/,""),wi=e=>e.replace(/^\//,"");function _i(e,t){if(!e)return t;if(!t)return e;if(mi(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Si(e),t=wi(t),`${e}${n}${t}`}function Ei(e,t,n){return e.has(t)?e.get(t):e.set(t,n).get(t)}var hn=(...e)=>fetch(...e),Ri=e=>e.status>=200&&e.status<=299,Pi=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function gn(e){if(!fe(e))return e;const t={...e};for(const[n,r]of Object.entries(t))r===void 0&&delete t[n];return t}function Oi({baseUrl:e,prepareHeaders:t=O=>O,fetchFn:n=hn,paramsSerializer:r,isJsonContentType:i=Pi,jsonContentType:o="application/json",jsonReplacer:a,timeout:y,responseHandler:b,validateStatus:v,...E}={}){return typeof fetch>"u"&&n===hn&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(f,l,w)=>{const{getState:C,extra:R,endpoint:h,forced:M,type:c}=l;let s,{url:u,headers:S=new Headers(E.headers),params:A=void 0,responseHandler:I=b??"json",validateStatus:g=v??Ri,timeout:d=y,...p}=typeof f=="string"?{url:f}:f,m,_=l.signal;d&&(m=new AbortController,l.signal.addEventListener("abort",m.abort),_=m.signal);let P={...E,signal:_,...p};S=new Headers(gn(S)),P.headers=await t(S,{getState:C,arg:f,extra:R,endpoint:h,forced:M,type:c,extraOptions:w})||S;const T=U=>typeof U=="object"&&(fe(U)||Array.isArray(U)||typeof U.toJSON=="function");if(!P.headers.has("content-type")&&T(P.body)&&P.headers.set("content-type",o),T(P.body)&&i(P.headers)&&(P.body=JSON.stringify(P.body,a)),A){const U=~u.indexOf("?")?"&":"?",k=r?r(A):new URLSearchParams(gn(A));u+=U+k}u=_i(e,u);const q=new Request(u,P);s={request:new Request(u,P)};let j,D=!1,F=m&&setTimeout(()=>{D=!0,m.abort()},d);try{j=await n(q)}catch(U){return{error:{status:D?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(U)},meta:s}}finally{F&&clearTimeout(F),m==null||m.signal.removeEventListener("abort",m.abort)}const N=j.clone();s.response=N;let L,K="";try{let U;if(await Promise.all([O(j,I).then(k=>L=k,k=>U=k),N.text().then(k=>K=k,()=>{})]),U)throw U}catch(U){return{error:{status:"PARSING_ERROR",originalStatus:j.status,data:K,error:String(U)},meta:s}}return g(j,L)?{data:L,meta:s}:{error:{status:j.status,data:L},meta:s}};async function O(f,l){if(typeof l=="function")return l(f);if(l==="content-type"&&(l=i(f.headers)?"json":"text"),l==="json"){const w=await f.text();return w.length?JSON.parse(w):null}return f.text()}}var mn=class{constructor(e,t=void 0){this.value=e,this.meta=t}},ct=ee("__rtkq/focused"),Wt=ee("__rtkq/unfocused"),at=ee("__rtkq/online"),Vt=ee("__rtkq/offline"),_t=!1;function fs(e,t){function n(){const r=()=>e(ct()),i=()=>e(Wt()),o=()=>e(at()),a=()=>e(Vt()),y=()=>{window.document.visibilityState==="visible"?r():i()};return _t||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",y,!1),window.addEventListener("focus",r,!1),window.addEventListener("online",o,!1),window.addEventListener("offline",a,!1),_t=!0),()=>{window.removeEventListener("focus",r),window.removeEventListener("visibilitychange",y),window.removeEventListener("online",o),window.removeEventListener("offline",a),_t=!1}}return n()}function ft(e){return e.type==="query"}function Ci(e){return e.type==="mutation"}function lt(e){return e.type==="infinitequery"}function nt(e){return ft(e)||lt(e)}function Kt(e,t,n,r,i,o){return Ai(e)?e(t,n,r,i).filter(tt).map(Qt).map(o):Array.isArray(e)?e.map(Qt).map(o):[]}function Ai(e){return typeof e=="function"}function Qt(e){return typeof e=="string"?{type:e}:e}function Mi(e,t){return e.catch(t)}var je=Symbol("forceQueryFn"),kt=e=>typeof e[je]=="function";function Ii({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:r,api:i,context:o}){const a=new Map,y=new Map,{unsubscribeQueryResult:b,removeMutationResult:v,updateSubscriptionOptions:E}=i.internalActions;return{buildInitiateQuery:R,buildInitiateInfiniteQuery:h,buildInitiateMutation:M,getRunningQueryThunk:O,getRunningMutationThunk:f,getRunningQueriesThunk:l,getRunningMutationsThunk:w};function O(c,s){return u=>{var I;const S=o.endpointDefinitions[c],A=e({queryArgs:s,endpointDefinition:S,endpointName:c});return(I=a.get(u))==null?void 0:I[A]}}function f(c,s){return u=>{var S;return(S=y.get(u))==null?void 0:S[s]}}function l(){return c=>Object.values(a.get(c)||{}).filter(tt)}function w(){return c=>Object.values(y.get(c)||{}).filter(tt)}function C(c,s){const u=(S,{subscribe:A=!0,forceRefetch:I,subscriptionOptions:g,[je]:d,...p}={})=>(m,_)=>{var W;const P=e({queryArgs:S,endpointDefinition:s,endpointName:c});let T;const q={...p,type:"query",subscribe:A,forceRefetch:I,subscriptionOptions:g,endpointName:c,originalArgs:S,queryCacheKey:P,[je]:d};if(ft(s))T=t(q);else{const{direction:z,initialPageParam:J}=p;T=n({...q,direction:z,initialPageParam:J})}const Q=i.endpoints[c].select(S),j=m(T),D=Q(_()),{requestId:F,abort:N}=j,L=D.requestId!==F,K=(W=a.get(m))==null?void 0:W[P],U=()=>Q(_()),k=Object.assign(d?j.then(U):L&&!K?Promise.resolve(D):Promise.all([K,j]).then(U),{arg:S,requestId:F,subscriptionOptions:g,queryCacheKey:P,abort:N,async unwrap(){const z=await k;if(z.isError)throw z.error;return z.data},refetch:()=>m(u(S,{subscribe:!1,forceRefetch:!0})),unsubscribe(){A&&m(b({queryCacheKey:P,requestId:F}))},updateSubscriptionOptions(z){k.subscriptionOptions=z,m(E({endpointName:c,requestId:F,queryCacheKey:P,options:z}))}});if(!K&&!L&&!d){const z=Ei(a,m,{});z[P]=k,k.then(()=>{delete z[P],_e(z)||a.delete(m)})}return k};return u}function R(c,s){return C(c,s)}function h(c,s){return C(c,s)}function M(c){return(s,{track:u=!0,fixedCacheKey:S}={})=>(A,I)=>{const g=r({type:"mutation",endpointName:c,originalArgs:s,track:u,fixedCacheKey:S}),d=A(g),{requestId:p,abort:m,unwrap:_}=d,P=Mi(d.unwrap().then(j=>({data:j})),j=>({error:j})),T=()=>{A(v({requestId:p,fixedCacheKey:S}))},q=Object.assign(P,{arg:d.arg,requestId:p,abort:m,unwrap:_,reset:T}),Q=y.get(A)||{};return y.set(A,Q),Q[p]=q,q.then(()=>{delete Q[p],_e(Q)||y.delete(A)}),S&&(Q[S]=q,q.then(()=>{Q[S]===q&&(delete Q[S],_e(Q)||y.delete(A))})),q}}}var $n=class extends gi{constructor(e,t,n,r){super(e),this.value=t,this.schemaName=n,this._bqMeta=r}};async function pe(e,t,n,r){const i=await e["~standard"].validate(t);if(i.issues)throw new $n(i.issues,t,n,r);return i.value}function Ti(e){return e}var Oe=(e={})=>({...e,[st]:!0});function qi({reducerPath:e,baseQuery:t,context:{endpointDefinitions:n},serializeQueryArgs:r,api:i,assertTagType:o,selectors:a,onSchemaFailure:y,catchSchemaFailure:b,skipSchemaValidation:v}){const E=(p,m,_,P)=>(T,q)=>{const Q=n[p],j=r({queryArgs:m,endpointDefinition:Q,endpointName:p});if(T(i.internalActions.queryResultPatched({queryCacheKey:j,patches:_})),!P)return;const D=i.endpoints[p].select(m)(q()),F=Kt(Q.providesTags,D.data,void 0,m,{},o);T(i.internalActions.updateProvidedBy([{queryCacheKey:j,providedTags:F}]))};function O(p,m,_=0){const P=[m,...p];return _&&P.length>_?P.slice(0,-1):P}function f(p,m,_=0){const P=[...p,m];return _&&P.length>_?P.slice(1):P}const l=(p,m,_,P=!0)=>(T,q)=>{const j=i.endpoints[p].select(m)(q()),D={patches:[],inversePatches:[],undo:()=>T(i.util.patchQueryData(p,m,D.inversePatches,P))};if(j.status==="uninitialized")return D;let F;if("data"in j)if(ne(j.data)){const[N,L,K]=qn(j.data,_);D.patches.push(...L),D.inversePatches.push(...K),F=N}else F=_(j.data),D.patches.push({op:"replace",path:[],value:F}),D.inversePatches.push({op:"replace",path:[],value:j.data});return D.patches.length===0||T(i.util.patchQueryData(p,m,D.patches,P)),D},w=(p,m,_)=>P=>P(i.endpoints[p].initiate(m,{subscribe:!1,forceRefetch:!0,[je]:()=>({data:_})})),C=(p,m)=>p.query&&p[m]?p[m]:Ti,R=async(p,{signal:m,abort:_,rejectWithValue:P,fulfillWithValue:T,dispatch:q,getState:Q,extra:j})=>{var L,K;const D=n[p.endpointName],{metaSchema:F,skipSchemaValidation:N=v}=D;try{let U=C(D,"transformResponse");const k={signal:m,abort:_,dispatch:q,getState:Q,extra:j,endpoint:p.endpointName,type:p.type,forced:p.type==="query"?h(p,Q()):void 0,queryCacheKey:p.type==="query"?p.queryCacheKey:void 0},W=p.type==="query"?p[je]:void 0;let z;const J=async(V,$,G,be)=>{if($==null&&V.pages.length)return Promise.resolve({data:V});const re={queryArg:p.originalArgs,pageParam:$},ve=await oe(re),ie=be?O:f;return{data:{pages:ie(V.pages,ve.data,G),pageParams:ie(V.pageParams,$,G)},meta:ve.meta}};async function oe(V){let $;const{extraOptions:G,argSchema:be,rawResponseSchema:re,responseSchema:ve}=D;if(be&&!N&&(V=await pe(be,V,"argSchema",{})),W?$=W():D.query?$=await t(D.query(V),k,G):$=await D.queryFn(V,k,G,Re=>t(Re,k,G)),typeof process<"u",$.error)throw new mn($.error,$.meta);let{data:ie}=$;re&&!N&&(ie=await pe(re,$.data,"rawResponseSchema",$.meta));let ae=await U(ie,$.meta,V);return ve&&!N&&(ae=await pe(ve,ae,"responseSchema",$.meta)),{...$,data:ae}}if(p.type==="query"&&"infiniteQueryOptions"in D){const{infiniteQueryOptions:V}=D,{maxPages:$=1/0}=V;let G;const be={pages:[],pageParams:[]},re=(L=a.selectQueryEntry(Q(),p.queryCacheKey))==null?void 0:L.data,ie=h(p,Q())&&!p.direction||!re?be:re;if("direction"in p&&p.direction&&ie.pages.length){const ae=p.direction==="backward",dt=(ae?Wn:jt)(V,ie,p.originalArgs);G=await J(ie,dt,$,ae)}else{const{initialPageParam:ae=V.initialPageParam}=p,Re=(re==null?void 0:re.pageParams)??[],dt=Re[0]??ae,Jn=Re.length;G=await J(ie,dt,$),W&&(G={data:G.data.pages[0]});for(let Bt=1;Bt<Jn;Bt++){const Xn=jt(V,G.data,p.originalArgs);G=await J(G.data,Xn,$)}}z=G}else z=await oe(p.originalArgs);return F&&!N&&z.meta&&(z.meta=await pe(F,z.meta,"metaSchema",z.meta)),T(z.data,Oe({fulfilledTimeStamp:Date.now(),baseQueryMeta:z.meta}))}catch(U){let k=U;if(k instanceof mn){let W=C(D,"transformErrorResponse");const{rawErrorResponseSchema:z,errorResponseSchema:J}=D;let{value:oe,meta:V}=k;try{z&&!N&&(oe=await pe(z,oe,"rawErrorResponseSchema",V)),F&&!N&&(V=await pe(F,V,"metaSchema",V));let $=await W(oe,V,p.originalArgs);return J&&!N&&($=await pe(J,$,"errorResponseSchema",V)),P($,Oe({baseQueryMeta:V}))}catch($){k=$}}try{if(k instanceof $n){const W={endpoint:p.endpointName,arg:p.originalArgs,type:p.type,queryCacheKey:p.type==="query"?p.queryCacheKey:void 0};(K=D.onSchemaFailure)==null||K.call(D,k,W),y==null||y(k,W);const{catchSchemaFailure:z=b}=D;if(z)return P(z(k,W),Oe({baseQueryMeta:k._bqMeta}))}}catch(W){k=W}throw console.error(k),k}};function h(p,m){const _=a.selectQueryEntry(m,p.queryCacheKey),P=a.selectConfig(m).refetchOnMountOrArgChange,T=_==null?void 0:_.fulfilledTimeStamp,q=p.forceRefetch??(p.subscribe&&P);return q?q===!0||(Number(new Date)-Number(T))/1e3>=q:!1}const M=()=>un(`${e}/executeQuery`,R,{getPendingMeta({arg:m}){const _=n[m.endpointName];return Oe({startedTimeStamp:Date.now(),...lt(_)?{direction:m.direction}:{}})},condition(m,{getState:_}){var N;const P=_(),T=a.selectQueryEntry(P,m.queryCacheKey),q=T==null?void 0:T.fulfilledTimeStamp,Q=m.originalArgs,j=T==null?void 0:T.originalArgs,D=n[m.endpointName],F=m.direction;return kt(m)?!0:(T==null?void 0:T.status)==="pending"?!1:h(m,P)||ft(D)&&((N=D==null?void 0:D.forceRefetch)!=null&&N.call(D,{currentArg:Q,previousArg:j,endpointState:T,state:P}))?!0:!(q&&!F)},dispatchConditionRejection:!0}),c=M(),s=M(),u=un(`${e}/executeMutation`,R,{getPendingMeta(){return Oe({startedTimeStamp:Date.now()})}}),S=p=>"force"in p,A=p=>"ifOlderThan"in p,I=(p,m,_)=>(P,T)=>{const q=S(_)&&_.force,Q=A(_)&&_.ifOlderThan,j=(F=!0)=>{const N={forceRefetch:F,isPrefetch:!0};return i.endpoints[p].initiate(m,N)},D=i.endpoints[p].select(m)(T());if(q)P(j());else if(Q){const F=D==null?void 0:D.fulfilledTimeStamp;if(!F){P(j());return}(Number(new Date)-Number(new Date(F)))/1e3>=Q&&P(j())}else P(j(!1))};function g(p){return m=>{var _,P;return((P=(_=m==null?void 0:m.meta)==null?void 0:_.arg)==null?void 0:P.endpointName)===p}}function d(p,m){return{matchPending:Ie(Ut(p),g(m)),matchFulfilled:Ie(le(p),g(m)),matchRejected:Ie(Ee(p),g(m))}}return{queryThunk:c,mutationThunk:u,infiniteQueryThunk:s,prefetch:I,updateQueryData:l,upsertQueryData:w,patchQueryData:E,buildMatchThunkActions:d}}function jt(e,{pages:t,pageParams:n},r){const i=t.length-1;return e.getNextPageParam(t[i],t,n[i],n,r)}function Wn(e,{pages:t,pageParams:n},r){var i;return(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n,r)}function Vn(e,t,n,r){return Kt(n[e.meta.arg.endpointName][t],le(e)?e.payload:void 0,ut(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function Ke(e,t,n){const r=e[t];r&&n(r)}function xe(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function bn(e,t,n){const r=e[xe(t)];r&&n(r)}var Be={};function Di({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:r,context:{endpointDefinitions:i,apiUid:o,extractRehydrationInfo:a,hasRehydrationInfo:y},assertTagType:b,config:v}){const E=ee(`${e}/resetApiState`);function O(g,d,p,m){var _;g[_=d.queryCacheKey]??(g[_]={status:"uninitialized",endpointName:d.endpointName}),Ke(g,d.queryCacheKey,P=>{P.status="pending",P.requestId=p&&P.requestId?P.requestId:m.requestId,d.originalArgs!==void 0&&(P.originalArgs=d.originalArgs),P.startedTimeStamp=m.startedTimeStamp;const T=i[m.arg.endpointName];lt(T)&&"direction"in d&&(P.direction=d.direction)})}function f(g,d,p,m){Ke(g,d.arg.queryCacheKey,_=>{if(_.requestId!==d.requestId&&!m)return;const{merge:P}=i[d.arg.endpointName];if(_.status="fulfilled",P)if(_.data!==void 0){const{fulfilledTimeStamp:T,arg:q,baseQueryMeta:Q,requestId:j}=d;let D=ze(_.data,F=>P(F,p,{arg:q.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:T,requestId:j}));_.data=D}else _.data=p;else _.data=i[d.arg.endpointName].structuralSharing??!0?Ln(se(_.data)?or(_.data):_.data,p):p;delete _.error,_.fulfilledTimeStamp=d.fulfilledTimeStamp})}const l=Se({name:`${e}/queries`,initialState:Be,reducers:{removeQueryResult:{reducer(g,{payload:{queryCacheKey:d}}){delete g[d]},prepare:Pe()},cacheEntriesUpserted:{reducer(g,d){for(const p of d.payload){const{queryDescription:m,value:_}=p;O(g,m,!0,{arg:m,requestId:d.meta.requestId,startedTimeStamp:d.meta.timestamp}),f(g,{arg:m,requestId:d.meta.requestId,fulfilledTimeStamp:d.meta.timestamp,baseQueryMeta:{}},_,!0)}},prepare:g=>({payload:g.map(m=>{const{endpointName:_,arg:P,value:T}=m,q=i[_];return{queryDescription:{type:"query",endpointName:_,originalArgs:m.arg,queryCacheKey:r({queryArgs:P,endpointDefinition:q,endpointName:_})},value:T}}),meta:{[st]:!0,requestId:Lt(),timestamp:Date.now()}})},queryResultPatched:{reducer(g,{payload:{queryCacheKey:d,patches:p}}){Ke(g,d,m=>{m.data=Zt(m.data,p.concat())})},prepare:Pe()}},extraReducers(g){g.addCase(t.pending,(d,{meta:p,meta:{arg:m}})=>{const _=kt(m);O(d,m,_,p)}).addCase(t.fulfilled,(d,{meta:p,payload:m})=>{const _=kt(p.arg);f(d,p,m,_)}).addCase(t.rejected,(d,{meta:{condition:p,arg:m,requestId:_},error:P,payload:T})=>{Ke(d,m.queryCacheKey,q=>{if(!p){if(q.requestId!==_)return;q.status="rejected",q.error=T??P}})}).addMatcher(y,(d,p)=>{const{queries:m}=a(p);for(const[_,P]of Object.entries(m))((P==null?void 0:P.status)==="fulfilled"||(P==null?void 0:P.status)==="rejected")&&(d[_]=P)})}}),w=Se({name:`${e}/mutations`,initialState:Be,reducers:{removeMutationResult:{reducer(g,{payload:d}){const p=xe(d);p in g&&delete g[p]},prepare:Pe()}},extraReducers(g){g.addCase(n.pending,(d,{meta:p,meta:{requestId:m,arg:_,startedTimeStamp:P}})=>{_.track&&(d[xe(p)]={requestId:m,status:"pending",endpointName:_.endpointName,startedTimeStamp:P})}).addCase(n.fulfilled,(d,{payload:p,meta:m})=>{m.arg.track&&bn(d,m,_=>{_.requestId===m.requestId&&(_.status="fulfilled",_.data=p,_.fulfilledTimeStamp=m.fulfilledTimeStamp)})}).addCase(n.rejected,(d,{payload:p,error:m,meta:_})=>{_.arg.track&&bn(d,_,P=>{P.requestId===_.requestId&&(P.status="rejected",P.error=p??m)})}).addMatcher(y,(d,p)=>{const{mutations:m}=a(p);for(const[_,P]of Object.entries(m))((P==null?void 0:P.status)==="fulfilled"||(P==null?void 0:P.status)==="rejected")&&_!==(P==null?void 0:P.requestId)&&(d[_]=P)})}}),C={tags:{},keys:{}},R=Se({name:`${e}/invalidation`,initialState:C,reducers:{updateProvidedBy:{reducer(g,d){var p,m,_;for(const{queryCacheKey:P,providedTags:T}of d.payload){h(g,P);for(const{type:q,id:Q}of T){const j=(m=(p=g.tags)[q]??(p[q]={}))[_=Q||"__internal_without_id"]??(m[_]=[]);j.includes(P)||j.push(P)}g.keys[P]=T}},prepare:Pe()}},extraReducers(g){g.addCase(l.actions.removeQueryResult,(d,{payload:{queryCacheKey:p}})=>{h(d,p)}).addMatcher(y,(d,p)=>{var _,P,T;const{provided:m}=a(p);for(const[q,Q]of Object.entries(m))for(const[j,D]of Object.entries(Q)){const F=(P=(_=d.tags)[q]??(_[q]={}))[T=j||"__internal_without_id"]??(P[T]=[]);for(const N of D)F.includes(N)||F.push(N)}}).addMatcher(ce(le(t),ut(t)),(d,p)=>{M(d,[p])}).addMatcher(l.actions.cacheEntriesUpserted.match,(d,p)=>{const m=p.payload.map(({queryDescription:_,value:P})=>({type:"UNKNOWN",payload:P,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:_}}));M(d,m)})}});function h(g,d){var m;const p=g.keys[d]??[];for(const _ of p){const P=_.type,T=_.id??"__internal_without_id",q=(m=g.tags[P])==null?void 0:m[T];q&&(g.tags[P][T]=q.filter(Q=>Q!==d))}delete g.keys[d]}function M(g,d){const p=d.map(m=>{const _=Vn(m,"providesTags",i,b),{queryCacheKey:P}=m.meta.arg;return{queryCacheKey:P,providedTags:_}});R.caseReducers.updateProvidedBy(g,R.actions.updateProvidedBy(p))}const c=Se({name:`${e}/subscriptions`,initialState:Be,reducers:{updateSubscriptionOptions(g,d){},unsubscribeQueryResult(g,d){},internal_getRTKQSubscriptions(){}}}),s=Se({name:`${e}/internalSubscriptions`,initialState:Be,reducers:{subscriptionsUpdated:{reducer(g,d){return Zt(g,d.payload)},prepare:Pe()}}}),u=Se({name:`${e}/config`,initialState:{online:vi(),focused:bi(),middlewareRegistered:!1,...v},reducers:{middlewareRegistered(g,{payload:d}){g.middlewareRegistered=g.middlewareRegistered==="conflict"||o!==d?"conflict":!0}},extraReducers:g=>{g.addCase(at,d=>{d.online=!0}).addCase(Vt,d=>{d.online=!1}).addCase(ct,d=>{d.focused=!0}).addCase(Wt,d=>{d.focused=!1}).addMatcher(y,d=>({...d}))}}),S=Pn({queries:l.reducer,mutations:w.reducer,provided:R.reducer,subscriptions:s.reducer,config:u.reducer}),A=(g,d)=>S(E.match(d)?void 0:g,d),I={...u.actions,...l.actions,...c.actions,...s.actions,...w.actions,...R.actions,resetApiState:E};return{reducer:A,actions:I}}var Z=Symbol.for("RTKQ/skipToken"),Kn={status:"uninitialized"},vn=ze(Kn,()=>{}),Sn=ze(Kn,()=>{});function Qi({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const r=c=>vn,i=c=>Sn;return{buildQuerySelector:f,buildInfiniteQuerySelector:l,buildMutationSelector:w,selectInvalidatedBy:C,selectCachedArgsForQuery:R,selectApiState:a,selectQueries:y,selectMutations:v,selectQueryEntry:b,selectConfig:E};function o(c){return{...c,...dn(c.status)}}function a(c){return c[t]}function y(c){var s;return(s=a(c))==null?void 0:s.queries}function b(c,s){var u;return(u=y(c))==null?void 0:u[s]}function v(c){var s;return(s=a(c))==null?void 0:s.mutations}function E(c){var s;return(s=a(c))==null?void 0:s.config}function O(c,s,u){return S=>{if(S===Z)return n(r,u);const A=e({queryArgs:S,endpointDefinition:s,endpointName:c});return n(g=>b(g,A)??vn,u)}}function f(c,s){return O(c,s,o)}function l(c,s){const{infiniteQueryOptions:u}=s;function S(A){const I={...A,...dn(A.status)},{isLoading:g,isError:d,direction:p}=I,m=p==="forward",_=p==="backward";return{...I,hasNextPage:h(u,I.data,I.originalArgs),hasPreviousPage:M(u,I.data,I.originalArgs),isFetchingNextPage:g&&m,isFetchingPreviousPage:g&&_,isFetchNextPageError:d&&m,isFetchPreviousPageError:d&&_}}return O(c,s,S)}function w(){return c=>{let s;return typeof c=="object"?s=xe(c)??Z:s=c,n(s===Z?i:A=>{var I,g;return((g=(I=a(A))==null?void 0:I.mutations)==null?void 0:g[s])??Sn},o)}}function C(c,s){const u=c[t],S=new Set;for(const A of s.filter(tt).map(Qt)){const I=u.provided.tags[A.type];if(!I)continue;let g=(A.id!==void 0?I[A.id]:yn(Object.values(I)))??[];for(const d of g)S.add(d)}return yn(Array.from(S.values()).map(A=>{const I=u.queries[A];return I?[{queryCacheKey:A,endpointName:I.endpointName,originalArgs:I.originalArgs}]:[]}))}function R(c,s){return Object.values(y(c)).filter(u=>(u==null?void 0:u.endpointName)===s&&u.status!=="uninitialized").map(u=>u.originalArgs)}function h(c,s,u){return s?jt(c,s,u)!=null:!1}function M(c,s,u){return!s||!c.getPreviousPageParam?!1:Wn(c,s,u)!=null}}var we=WeakMap?new WeakMap:void 0,rt=({endpointName:e,queryArgs:t})=>{let n="";const r=we==null?void 0:we.get(t);if(typeof r=="string")n=r;else{const i=JSON.stringify(t,(o,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=fe(a)?Object.keys(a).sort().reduce((y,b)=>(y[b]=a[b],y),{}):a,a));fe(t)&&(we==null||we.set(t,i)),n=i}return`${e}(${n})`};function Bn(...e){return function(n){const r=et(v=>{var E;return(E=n.extractRehydrationInfo)==null?void 0:E.call(n,v,{reducerPath:n.reducerPath??"api"})}),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(v){let E=rt;if("serializeQueryArgs"in v.endpointDefinition){const O=v.endpointDefinition.serializeQueryArgs;E=f=>{const l=O(f);return typeof l=="string"?l:rt({...f,queryArgs:l})}}else n.serializeQueryArgs&&(E=n.serializeQueryArgs);return E(v)},tagTypes:[...n.tagTypes||[]]},o={endpointDefinitions:{},batch(v){v()},apiUid:Lt(),extractRehydrationInfo:r,hasRehydrationInfo:et(v=>r(v)!=null)},a={injectEndpoints:b,enhanceEndpoints({addTagTypes:v,endpoints:E}){if(v)for(const O of v)i.tagTypes.includes(O)||i.tagTypes.push(O);if(E)for(const[O,f]of Object.entries(E))typeof f=="function"?f(o.endpointDefinitions[O]):Object.assign(o.endpointDefinitions[O]||{},f);return a}},y=e.map(v=>v.init(a,i,o));function b(v){const E=v.endpoints({query:O=>({...O,type:"query"}),mutation:O=>({...O,type:"mutation"}),infiniteQuery:O=>({...O,type:"infinitequery"})});for(const[O,f]of Object.entries(E)){if(v.overrideExisting!==!0&&O in o.endpointDefinitions){if(v.overrideExisting==="throw")throw new Error(te(39));continue}o.endpointDefinitions[O]=f;for(const l of y)l.injectEndpoint(O,f)}return a}return a.injectEndpoints({endpoints:n.endpoints})}}function ue(e,...t){return Object.assign(e,...t)}var ki=({api:e,queryThunk:t,internalState:n})=>{const r=`${e.reducerPath}/subscriptions`;let i=null,o=null;const{updateSubscriptionOptions:a,unsubscribeQueryResult:y}=e.internalActions,b=(l,w)=>{var R,h,M;if(a.match(w)){const{queryCacheKey:c,requestId:s,options:u}=w.payload;return(R=l==null?void 0:l[c])!=null&&R[s]&&(l[c][s]=u),!0}if(y.match(w)){const{queryCacheKey:c,requestId:s}=w.payload;return l[c]&&delete l[c][s],!0}if(e.internalActions.removeQueryResult.match(w))return delete l[w.payload.queryCacheKey],!0;if(t.pending.match(w)){const{meta:{arg:c,requestId:s}}=w,u=l[h=c.queryCacheKey]??(l[h]={});return u[`${s}_running`]={},c.subscribe&&(u[s]=c.subscriptionOptions??u[s]??{}),!0}let C=!1;if(t.fulfilled.match(w)||t.rejected.match(w)){const c=l[w.meta.arg.queryCacheKey]||{},s=`${w.meta.requestId}_running`;C||(C=!!c[s]),delete c[s]}if(t.rejected.match(w)){const{meta:{condition:c,arg:s,requestId:u}}=w;if(c&&s.subscribe){const S=l[M=s.queryCacheKey]??(l[M]={});S[u]=s.subscriptionOptions??S[u]??{},C=!0}}return C},v=()=>n.currentSubscriptions,f={getSubscriptions:v,getSubscriptionCount:l=>{const C=v()[l]??{};return _e(C)},isRequestSubscribed:(l,w)=>{var R;const C=v();return!!((R=C==null?void 0:C[l])!=null&&R[w])}};return(l,w)=>{if(i||(i=JSON.parse(JSON.stringify(n.currentSubscriptions))),e.util.resetApiState.match(l))return i=n.currentSubscriptions={},o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(l))return[!1,f];const C=b(n.currentSubscriptions,l);let R=!0;if(C){o||(o=setTimeout(()=>{const c=JSON.parse(JSON.stringify(n.currentSubscriptions)),[,s]=qn(i,()=>c);w.next(e.internalActions.subscriptionsUpdated(s)),i=c,o=null},500));const h=typeof l.type=="string"&&!!l.type.startsWith(r),M=t.rejected.match(l)&&l.meta.condition&&!!l.meta.arg.subscribe;R=!h&&!M}return[R,!1]}};function ji(e){for(const t in e)return!1;return!0}var xi=2147483647/1e3-1,Fi=({reducerPath:e,api:t,queryThunk:n,context:r,internalState:i,selectors:{selectQueryEntry:o,selectConfig:a}})=>{const{removeQueryResult:y,unsubscribeQueryResult:b,cacheEntriesUpserted:v}=t.internalActions,E=ce(b.match,n.fulfilled,n.rejected,v.match);function O(R){const h=i.currentSubscriptions[R];return!!h&&!ji(h)}const f={},l=(R,h,M)=>{const c=h.getState(),s=a(c);if(E(R)){let u;if(v.match(R))u=R.payload.map(S=>S.queryDescription.queryCacheKey);else{const{queryCacheKey:S}=b.match(R)?R.payload:R.meta.arg;u=[S]}w(u,h,s)}if(t.util.resetApiState.match(R))for(const[u,S]of Object.entries(f))S&&clearTimeout(S),delete f[u];if(r.hasRehydrationInfo(R)){const{queries:u}=r.extractRehydrationInfo(R);w(Object.keys(u),h,s)}};function w(R,h,M){const c=h.getState();for(const s of R){const u=o(c,s);C(s,u==null?void 0:u.endpointName,h,M)}}function C(R,h,M,c){const s=r.endpointDefinitions[h],u=(s==null?void 0:s.keepUnusedDataFor)??c.keepUnusedDataFor;if(u===1/0)return;const S=Math.max(0,Math.min(u,xi));if(!O(R)){const A=f[R];A&&clearTimeout(A),f[R]=setTimeout(()=>{O(R)||M.dispatch(y({queryCacheKey:R})),delete f[R]},S*1e3)}}return l},wn=new Error("Promise never resolved before cacheEntryRemoved."),Ni=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:i,internalState:o,selectors:{selectQueryEntry:a,selectApiState:y}})=>{const b=Dt(r),v=Dt(i),E=le(r,i),O={};function f(h,M,c){const s=O[h];s!=null&&s.valueResolved&&(s.valueResolved({data:M,meta:c}),delete s.valueResolved)}function l(h){const M=O[h];M&&(delete O[h],M.cacheEntryRemoved())}const w=(h,M,c)=>{const s=C(h);function u(S,A,I,g){const d=a(c,A),p=a(M.getState(),A);!d&&p&&R(S,g,A,M,I)}if(r.pending.match(h))u(h.meta.arg.endpointName,s,h.meta.requestId,h.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(h))for(const{queryDescription:S,value:A}of h.payload){const{endpointName:I,originalArgs:g,queryCacheKey:d}=S;u(I,d,h.meta.requestId,g),f(d,A,{})}else if(i.pending.match(h))M.getState()[t].mutations[s]&&R(h.meta.arg.endpointName,h.meta.arg.originalArgs,s,M,h.meta.requestId);else if(E(h))f(s,h.payload,h.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(h)||e.internalActions.removeMutationResult.match(h))l(s);else if(e.util.resetApiState.match(h))for(const S of Object.keys(O))l(S)};function C(h){return b(h)?h.meta.arg.queryCacheKey:v(h)?h.meta.arg.fixedCacheKey??h.meta.requestId:e.internalActions.removeQueryResult.match(h)?h.payload.queryCacheKey:e.internalActions.removeMutationResult.match(h)?xe(h.payload):""}function R(h,M,c,s,u){const S=n.endpointDefinitions[h],A=S==null?void 0:S.onCacheEntryAdded;if(!A)return;const I={},g=new Promise(T=>{I.cacheEntryRemoved=T}),d=Promise.race([new Promise(T=>{I.valueResolved=T}),g.then(()=>{throw wn})]);d.catch(()=>{}),O[c]=I;const p=e.endpoints[h].select(nt(S)?M:c),m=s.dispatch((T,q,Q)=>Q),_={...s,getCacheEntry:()=>p(s.getState()),requestId:u,extra:m,updateCachedData:nt(S)?T=>s.dispatch(e.util.updateQueryData(h,M,T)):void 0,cacheDataLoaded:d,cacheEntryRemoved:g},P=A(M,_);Promise.resolve(P).catch(T=>{if(T!==wn)throw T})}return w},zi=({api:e,context:{apiUid:t},reducerPath:n})=>(r,i)=>{e.util.resetApiState.match(r)&&i.dispatch(e.internalActions.middlewareRegistered(t))},Ui=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:r,queryThunk:i,api:o,assertTagType:a,refetchQuery:y,internalState:b})=>{const{removeQueryResult:v}=o.internalActions,E=ce(le(r),ut(r)),O=ce(le(r,i),Ee(r,i));let f=[];const l=(R,h)=>{E(R)?C(Vn(R,"invalidatesTags",n,a),h):O(R)?C([],h):o.util.invalidateTags.match(R)&&C(Kt(R.payload,void 0,void 0,void 0,void 0,a),h)};function w(R){var c;const{queries:h,mutations:M}=R;for(const s of[h,M])for(const u in s)if(((c=s[u])==null?void 0:c.status)==="pending")return!0;return!1}function C(R,h){const M=h.getState(),c=M[e];if(f.push(...R),c.config.invalidationBehavior==="delayed"&&w(c))return;const s=f;if(f=[],s.length===0)return;const u=o.util.selectInvalidatedBy(M,s);t.batch(()=>{const S=Array.from(u.values());for(const{queryCacheKey:A}of S){const I=c.queries[A],g=b.currentSubscriptions[A]??{};I&&(_e(g)===0?h.dispatch(v({queryCacheKey:A})):I.status!=="uninitialized"&&h.dispatch(y(I)))}})}return l},Li=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:i})=>{const o={},a=(f,l)=>{(n.internalActions.updateSubscriptionOptions.match(f)||n.internalActions.unsubscribeQueryResult.match(f))&&b(f.payload,l),(t.pending.match(f)||t.rejected.match(f)&&f.meta.condition)&&b(f.meta.arg,l),(t.fulfilled.match(f)||t.rejected.match(f)&&!f.meta.condition)&&y(f.meta.arg,l),n.util.resetApiState.match(f)&&E()};function y({queryCacheKey:f},l){const w=l.getState()[e],C=w.queries[f],R=i.currentSubscriptions[f];if(!C||C.status==="uninitialized")return;const{lowestPollingInterval:h,skipPollingIfUnfocused:M}=O(R);if(!Number.isFinite(h))return;const c=o[f];c!=null&&c.timeout&&(clearTimeout(c.timeout),c.timeout=void 0);const s=Date.now()+h;o[f]={nextPollTimestamp:s,pollingInterval:h,timeout:setTimeout(()=>{(w.config.focused||!M)&&l.dispatch(r(C)),y({queryCacheKey:f},l)},h)}}function b({queryCacheKey:f},l){const C=l.getState()[e].queries[f],R=i.currentSubscriptions[f];if(!C||C.status==="uninitialized")return;const{lowestPollingInterval:h}=O(R);if(!Number.isFinite(h)){v(f);return}const M=o[f],c=Date.now()+h;(!M||c<M.nextPollTimestamp)&&y({queryCacheKey:f},l)}function v(f){const l=o[f];l!=null&&l.timeout&&clearTimeout(l.timeout),delete o[f]}function E(){for(const f of Object.keys(o))v(f)}function O(f={}){let l=!1,w=Number.POSITIVE_INFINITY;for(let C in f)f[C].pollingInterval&&(w=Math.min(f[C].pollingInterval,w),l=f[C].skipPollingIfUnfocused||l);return{lowestPollingInterval:w,skipPollingIfUnfocused:l}}return a},$i=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const i=Ut(n,r),o=Ee(n,r),a=le(n,r),y={};return(v,E)=>{var O,f;if(i(v)){const{requestId:l,arg:{endpointName:w,originalArgs:C}}=v.meta,R=t.endpointDefinitions[w],h=R==null?void 0:R.onQueryStarted;if(h){const M={},c=new Promise((A,I)=>{M.resolve=A,M.reject=I});c.catch(()=>{}),y[l]=M;const s=e.endpoints[w].select(nt(R)?C:l),u=E.dispatch((A,I,g)=>g),S={...E,getCacheEntry:()=>s(E.getState()),requestId:l,extra:u,updateCachedData:nt(R)?A=>E.dispatch(e.util.updateQueryData(w,C,A)):void 0,queryFulfilled:c};h(C,S)}}else if(a(v)){const{requestId:l,baseQueryMeta:w}=v.meta;(O=y[l])==null||O.resolve({data:v.payload,meta:w}),delete y[l]}else if(o(v)){const{requestId:l,rejectedWithValue:w,baseQueryMeta:C}=v.meta;(f=y[l])==null||f.reject({error:v.payload??v.error,isUnhandledError:!w,meta:C}),delete y[l]}}},Wi=({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:i})=>{const{removeQueryResult:o}=n.internalActions,a=(b,v)=>{ct.match(b)&&y(v,"refetchOnFocus"),at.match(b)&&y(v,"refetchOnReconnect")};function y(b,v){const E=b.getState()[e],O=E.queries,f=i.currentSubscriptions;t.batch(()=>{for(const l of Object.keys(f)){const w=O[l],C=f[l];if(!C||!w)continue;(Object.values(C).some(h=>h[v]===!0)||Object.values(C).every(h=>h[v]===void 0)&&E.config[v])&&(_e(C)===0?b.dispatch(o({queryCacheKey:l})):w.status!=="uninitialized"&&b.dispatch(r(w)))}})}return a};function Vi(e){const{reducerPath:t,queryThunk:n,api:r,context:i}=e,{apiUid:o}=i,a={invalidateTags:ee(`${t}/invalidateTags`)},y=O=>O.type.startsWith(`${t}/`),b=[zi,Fi,Ui,Li,Ni,$i];return{middleware:O=>{let f=!1;const w={...e,internalState:{currentSubscriptions:{}},refetchQuery:E,isThisApiSliceAction:y},C=b.map(M=>M(w)),R=ki(w),h=Wi(w);return M=>c=>{if(!On(c))return M(c);f||(f=!0,O.dispatch(r.internalActions.middlewareRegistered(o)));const s={...O,next:M},u=O.getState(),[S,A]=R(c,s,u);let I;if(S?I=M(c):I=A,O.getState()[t]&&(h(c,s,u),y(c)||i.hasRehydrationInfo(c)))for(const g of C)g(c,s,u);return I}},actions:a};function E(O){return e.api.endpoints[O.endpointName].initiate(O.originalArgs,{subscribe:!1,forceRefetch:!0})}}var _n=Symbol(),Hn=({createSelector:e=zt}={})=>({name:_n,init(t,{baseQuery:n,tagTypes:r,reducerPath:i,serializeQueryArgs:o,keepUnusedDataFor:a,refetchOnMountOrArgChange:y,refetchOnFocus:b,refetchOnReconnect:v,invalidationBehavior:E,onSchemaFailure:O,catchSchemaFailure:f,skipSchemaValidation:l},w){gr();const C=k=>k;Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:at,onOffline:Vt,onFocus:ct,onFocusLost:Wt},util:{}});const R=Qi({serializeQueryArgs:o,reducerPath:i,createSelector:e}),{selectInvalidatedBy:h,selectCachedArgsForQuery:M,buildQuerySelector:c,buildInfiniteQuerySelector:s,buildMutationSelector:u}=R;ue(t.util,{selectInvalidatedBy:h,selectCachedArgsForQuery:M});const{queryThunk:S,infiniteQueryThunk:A,mutationThunk:I,patchQueryData:g,updateQueryData:d,upsertQueryData:p,prefetch:m,buildMatchThunkActions:_}=qi({baseQuery:n,reducerPath:i,context:w,api:t,serializeQueryArgs:o,assertTagType:C,selectors:R,onSchemaFailure:O,catchSchemaFailure:f,skipSchemaValidation:l}),{reducer:P,actions:T}=Di({context:w,queryThunk:S,mutationThunk:I,serializeQueryArgs:o,reducerPath:i,assertTagType:C,config:{refetchOnFocus:b,refetchOnReconnect:v,refetchOnMountOrArgChange:y,keepUnusedDataFor:a,reducerPath:i,invalidationBehavior:E}});ue(t.util,{patchQueryData:g,updateQueryData:d,upsertQueryData:p,prefetch:m,resetApiState:T.resetApiState,upsertQueryEntries:T.cacheEntriesUpserted}),ue(t.internalActions,T);const{middleware:q,actions:Q}=Vi({reducerPath:i,context:w,queryThunk:S,mutationThunk:I,infiniteQueryThunk:A,api:t,assertTagType:C,selectors:R});ue(t.util,Q),ue(t,{reducer:P,middleware:q});const{buildInitiateQuery:j,buildInitiateInfiniteQuery:D,buildInitiateMutation:F,getRunningMutationThunk:N,getRunningMutationsThunk:L,getRunningQueriesThunk:K,getRunningQueryThunk:U}=Ii({queryThunk:S,mutationThunk:I,infiniteQueryThunk:A,api:t,serializeQueryArgs:o,context:w});return ue(t.util,{getRunningMutationThunk:N,getRunningMutationsThunk:L,getRunningQueryThunk:U,getRunningQueriesThunk:K}),{name:_n,injectEndpoint(k,W){var oe;const J=(oe=t.endpoints)[k]??(oe[k]={});ft(W)&&ue(J,{name:k,select:c(k,W),initiate:j(k,W)},_(S,k)),Ci(W)&&ue(J,{name:k,select:u(),initiate:F(k)},_(I,k)),lt(W)&&ue(J,{name:k,select:s(k,W),initiate:D(k,W)},_(S,k))}}}});Hn();function He(e){return e.replace(e[0],e[0].toUpperCase())}function Ki(e){return e.type==="query"}function Bi(e){return e.type==="mutation"}function Gn(e){return e.type==="infinitequery"}function Ce(e,...t){return Object.assign(e,...t)}var Et=Symbol();function Rt(e,t,n,r){const i=x.useMemo(()=>({queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}),[e,t,n,r]),o=x.useRef(i);return x.useEffect(()=>{o.current.serialized!==i.serialized&&(o.current=i)},[i]),o.current.serialized===i.serialized?o.current.queryArgs:e}function Ge(e){const t=x.useRef(e);return x.useEffect(()=>{Te(t.current,e)||(t.current=e)},[e]),Te(t.current,e)?t.current:e}var Hi=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Gi=Hi(),Ji=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Xi=Ji(),Yi=()=>Gi||Xi?x.useLayoutEffect:x.useEffect,Zi=Yi(),En=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Un.pending}:e;function Pt(e,...t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}var Ot=["data","status","isLoading","isSuccess","isError","error"];function es({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:r,useStore:i},unstable__sideEffectsInRender:o,createSelector:a},serializeQueryArgs:y,context:b}){const v=o?s=>s():x.useEffect;return{buildQueryHooks:h,buildInfiniteQueryHooks:M,buildMutationHook:c,usePrefetch:f};function E(s,u,S){if(u!=null&&u.endpointName&&s.isUninitialized){const{endpointName:m}=u,_=b.endpointDefinitions[m];S!==Z&&y({queryArgs:u.originalArgs,endpointDefinition:_,endpointName:m})===y({queryArgs:S,endpointDefinition:_,endpointName:m})&&(u=void 0)}let A=s.isSuccess?s.data:u==null?void 0:u.data;A===void 0&&(A=s.data);const I=A!==void 0,g=s.isLoading,d=(!u||u.isLoading||u.isUninitialized)&&!I&&g,p=s.isSuccess||I&&(g&&!(u!=null&&u.isError)||s.isUninitialized);return{...s,data:A,currentData:s.data,isFetching:g,isLoading:d,isSuccess:p}}function O(s,u,S){if(u!=null&&u.endpointName&&s.isUninitialized){const{endpointName:m}=u,_=b.endpointDefinitions[m];S!==Z&&y({queryArgs:u.originalArgs,endpointDefinition:_,endpointName:m})===y({queryArgs:S,endpointDefinition:_,endpointName:m})&&(u=void 0)}let A=s.isSuccess?s.data:u==null?void 0:u.data;A===void 0&&(A=s.data);const I=A!==void 0,g=s.isLoading,d=(!u||u.isLoading||u.isUninitialized)&&!I&&g,p=s.isSuccess||g&&I;return{...s,data:A,currentData:s.data,isFetching:g,isLoading:d,isSuccess:p}}function f(s,u){const S=n(),A=Ge(u);return x.useCallback((I,g)=>S(e.util.prefetch(s,I,{...A,...g})),[s,S,A])}function l(s,u,{refetchOnReconnect:S,refetchOnFocus:A,refetchOnMountOrArgChange:I,skip:g=!1,pollingInterval:d=0,skipPollingIfUnfocused:p=!1,...m}={}){const{initiate:_}=e.endpoints[s],P=n(),T=x.useRef(void 0);if(!T.current){const k=P(e.internalActions.internal_getRTKQSubscriptions());T.current=k}const q=Rt(g?Z:u,rt,b.endpointDefinitions[s],s),Q=Ge({refetchOnReconnect:S,refetchOnFocus:A,pollingInterval:d,skipPollingIfUnfocused:p}),j=m.initialPageParam,D=Ge(j),F=x.useRef(void 0);let{queryCacheKey:N,requestId:L}=F.current||{},K=!1;N&&L&&(K=T.current.isRequestSubscribed(N,L));const U=!K&&F.current!==void 0;return v(()=>{U&&(F.current=void 0)},[U]),v(()=>{var z;const k=F.current;if(q===Z){k==null||k.unsubscribe(),F.current=void 0;return}const W=(z=F.current)==null?void 0:z.subscriptionOptions;if(!k||k.arg!==q){k==null||k.unsubscribe();const J=P(_(q,{subscriptionOptions:Q,forceRefetch:I,...Gn(b.endpointDefinitions[s])?{initialPageParam:D}:{}}));F.current=J}else Q!==W&&k.updateSubscriptionOptions(Q)},[P,_,I,q,Q,U,D,s]),[F,P,_,Q]}function w(s,u){return(A,{skip:I=!1,selectFromResult:g}={})=>{const{select:d}=e.endpoints[s],p=Rt(I?Z:A,y,b.endpointDefinitions[s],s),m=x.useRef(void 0),_=x.useMemo(()=>a([d(p),(j,D)=>D,j=>p],u,{memoizeOptions:{resultEqualityCheck:Te}}),[d,p]),P=x.useMemo(()=>g?a([_],g,{devModeChecks:{identityFunctionCheck:"never"}}):_,[_,g]),T=r(j=>P(j,m.current),Te),q=i(),Q=_(q.getState(),m.current);return Zi(()=>{m.current=Q},[Q]),T}}function C(s){x.useEffect(()=>()=>{var u,S;(S=(u=s.current)==null?void 0:u.unsubscribe)==null||S.call(u),s.current=void 0},[s])}function R(s){if(!s.current)throw new Error(te(38));return s.current.refetch()}function h(s){const u=(I,g={})=>{const[d]=l(s,I,g);return C(d),x.useMemo(()=>({refetch:()=>R(d)}),[d])},S=({refetchOnReconnect:I,refetchOnFocus:g,pollingInterval:d=0,skipPollingIfUnfocused:p=!1}={})=>{const{initiate:m}=e.endpoints[s],_=n(),[P,T]=x.useState(Et),q=x.useRef(void 0),Q=Ge({refetchOnReconnect:I,refetchOnFocus:g,pollingInterval:d,skipPollingIfUnfocused:p});v(()=>{var L,K;const N=(L=q.current)==null?void 0:L.subscriptionOptions;Q!==N&&((K=q.current)==null||K.updateSubscriptionOptions(Q))},[Q]);const j=x.useRef(Q);v(()=>{j.current=Q},[Q]);const D=x.useCallback(function(N,L=!1){let K;return t(()=>{var U;(U=q.current)==null||U.unsubscribe(),q.current=K=_(m(N,{subscriptionOptions:j.current,forceRefetch:!L})),T(N)}),K},[_,m]),F=x.useCallback(()=>{var N,L;(N=q.current)!=null&&N.queryCacheKey&&_(e.internalActions.removeQueryResult({queryCacheKey:(L=q.current)==null?void 0:L.queryCacheKey}))},[_]);return x.useEffect(()=>()=>{var N;(N=q==null?void 0:q.current)==null||N.unsubscribe()},[]),x.useEffect(()=>{P!==Et&&!q.current&&D(P,!0)},[P,D]),x.useMemo(()=>[D,P,{reset:F}],[D,P,F])},A=w(s,E);return{useQueryState:A,useQuerySubscription:u,useLazyQuerySubscription:S,useLazyQuery(I){const[g,d,{reset:p}]=S(I),m=A(d,{...I,skip:d===Et}),_=x.useMemo(()=>({lastArg:d}),[d]);return x.useMemo(()=>[g,{...m,reset:p},_],[g,m,p,_])},useQuery(I,g){const d=u(I,g),p=A(I,{selectFromResult:I===Z||g!=null&&g.skip?void 0:En,...g}),m=Pt(p,...Ot);return x.useDebugValue(m),x.useMemo(()=>({...p,...d}),[p,d])}}}function M(s){const u=(A,I={})=>{const[g,d,p,m]=l(s,A,I),_=x.useRef(m);v(()=>{_.current=m},[m]);const P=x.useCallback(function(Q,j){let D;return t(()=>{var F;(F=g.current)==null||F.unsubscribe(),g.current=D=d(p(Q,{subscriptionOptions:_.current,direction:j}))}),D},[g,d,p]);C(g);const T=Rt(I.skip?Z:A,rt,b.endpointDefinitions[s],s),q=x.useCallback(()=>R(g),[g]);return x.useMemo(()=>({trigger:P,refetch:q,fetchNextPage:()=>P(T,"forward"),fetchPreviousPage:()=>P(T,"backward")}),[q,P,T])},S=w(s,O);return{useInfiniteQueryState:S,useInfiniteQuerySubscription:u,useInfiniteQuery(A,I){const{refetch:g,fetchNextPage:d,fetchPreviousPage:p}=u(A,I),m=S(A,{selectFromResult:A===Z||I!=null&&I.skip?void 0:En,...I}),_=Pt(m,...Ot,"hasNextPage","hasPreviousPage");return x.useDebugValue(_),x.useMemo(()=>({...m,fetchNextPage:d,fetchPreviousPage:p,refetch:g}),[m,d,p,g])}}}function c(s){return({selectFromResult:u,fixedCacheKey:S}={})=>{const{select:A,initiate:I}=e.endpoints[s],g=n(),[d,p]=x.useState();x.useEffect(()=>()=>{d!=null&&d.arg.fixedCacheKey||d==null||d.reset()},[d]);const m=x.useCallback(function(N){const L=g(I(N,{fixedCacheKey:S}));return p(L),L},[g,I,S]),{requestId:_}=d||{},P=x.useMemo(()=>A({fixedCacheKey:S,requestId:d==null?void 0:d.requestId}),[S,d,A]),T=x.useMemo(()=>u?a([P],u):P,[u,P]),q=r(T,Te),Q=S==null?d==null?void 0:d.arg.originalArgs:void 0,j=x.useCallback(()=>{t(()=>{d&&p(void 0),S&&g(e.internalActions.removeMutationResult({requestId:_,fixedCacheKey:S}))})},[g,S,d,_]),D=Pt(q,...Ot,"endpointName");x.useDebugValue(D);const F=x.useMemo(()=>({...q,originalArgs:Q,reset:j}),[q,Q,j]);return x.useMemo(()=>[m,F],[m,F])}}}var ts=Symbol(),ns=({batch:e=hi,hooks:t={useDispatch:li,useSelector:yi,useStore:zn},createSelector:n=zt,unstable__sideEffectsInRender:r=!1,...i}={})=>({name:ts,init(o,{serializeQueryArgs:a},y){const b=o,{buildQueryHooks:v,buildInfiniteQueryHooks:E,buildMutationHook:O,usePrefetch:f}=es({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:r,createSelector:n},serializeQueryArgs:a,context:y});return Ce(b,{usePrefetch:f}),Ce(y,{batch:e}),{injectEndpoint(l,w){if(Ki(w)){const{useQuery:C,useLazyQuery:R,useLazyQuerySubscription:h,useQueryState:M,useQuerySubscription:c}=v(l);Ce(b.endpoints[l],{useQuery:C,useLazyQuery:R,useLazyQuerySubscription:h,useQueryState:M,useQuerySubscription:c}),o[`use${He(l)}Query`]=C,o[`useLazy${He(l)}Query`]=R}if(Bi(w)){const C=O(l);Ce(b.endpoints[l],{useMutation:C}),o[`use${He(l)}Mutation`]=C}else if(Gn(w)){const{useInfiniteQuery:C,useInfiniteQuerySubscription:R,useInfiniteQueryState:h}=E(l);Ce(b.endpoints[l],{useInfiniteQuery:C,useInfiniteQuerySubscription:R,useInfiniteQueryState:h}),o[`use${He(l)}InfiniteQuery`]=C}}}}}),rs=Bn(Hn(),ns());const is=async(e,t,n)=>typeof window>"u"?{data:{}}:Oi({baseUrl:"http://localhost:3001/api/v1"})(e,t,n),ss=rs({reducerPath:"editorialApi",baseQuery:is,tagTypes:["schema","data","files","config"],endpoints:e=>({getConfig:e.query({query:()=>"/config",providesTags:[{type:"config"}]}),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,n,r)=>t[r]||null,providesTags:(t,n,r)=>[{type:"schema",id:r}]}),getData:e.query({query:()=>"/data",providesTags:()=>[{type:"data"}]}),getDataCount:e.query({query:()=>"/data",transformResponse(t){return Object.values(t).reduce((r,i)=>r+Object.keys(i).length,0)}}),getDataObject:e.query({query:()=>"/data",transformResponse:(t,n,{itemType:r,id:i})=>t[r][i]||null,providesTags:(t,n,{itemType:r,id:i})=>[{type:"data",id:`${r}-${i}`}]}),getFiles:e.query({query:()=>"/files",transformResponse:t=>t.files,providesTags:()=>[{type:"files"}]}),getFileCount:e.query({query:()=>"/files",transformResponse:t=>{function n(i){let o=i.type==="file"?1:0;return i.children&&i.children.length>0&&(o+=i.children.reduce((a,y)=>a+n(y),0)),o}function r(i){return i.reduce((o,a)=>o+n(a),0)}return r(t.files)}}),getFilesTotalSize:e.query({query:()=>"/files",transformResponse:t=>t.totalSize,providesTags:()=>[{type:"files"}]}),deleteFile:e.mutation({query:t=>({url:"/files",method:"DELETE",body:{path:t}}),invalidatesTags:()=>[{type:"files"}]}),updateObject:e.mutation({query:({id:t,type:n,...r})=>({url:`/data/${n}/${t}`,method:"PATCH",body:{id:t,type:n,...r}}),invalidatesTags:()=>[{type:"data"}]}),createObject:e.mutation({query:({id:t,type:n,...r})=>({url:`/data/${n}/${t}`,method:"PUT",body:{id:t,type:n,...r}}),invalidatesTags:()=>[{type:"data"}]}),deleteObject:e.mutation({query:({id:t,type:n})=>({url:`/data/${n}/${t}`,method:"DELETE"}),invalidatesTags:()=>[{type:"data"}]})})}),{useCreateObjectMutation:ls,useDeleteFileMutation:ds,useDeleteObjectMutation:ps,useGetConfigQuery:ys,useGetDataCountQuery:hs,useGetDataObjectQuery:gs,useGetDataQuery:ms,useGetFileCountQuery:bs,useGetFilesQuery:vs,useGetFilesTotalSizeQuery:Ss,useGetSchemaQuery:ws,useGetSchemaTypeQuery:_s,usePublishMutation:Es,usePullMutation:Rs,usePushMutation:Ps,useUpdateObjectMutation:Os}=ss;export{as as P,ws as a,ms as b,cs as c,Es as d,ss as e,Rs as f,Ps as g,Ss as h,hs as i,bs as j,_s as k,ps as l,gs as m,ls as n,Os as o,vs as p,ds as q,li as r,fs as s,yi as t,ys as u,zn as v,un as w,Se as x};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as oe,p as x,w as $e,v as Ve}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{B as Le}from"./button-DjJX-cbR.js";import{g as K,s as J,a as Me,u as Pe,F as ze,b as Y,c as H,d as ce,e as G,I as ue,f as Q,C as De}from"./input-DA43W1bc.js";import{c as Fe}from"./utils-BSDwSRl3.js";import{c as Se}from"./createLucideIcon-BOhrmKcl.js";import{u as Ue,e as ee,l as Be}from"./authSlice-
|
|
1
|
+
import{a as oe,p as x,w as $e,v as Ve}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{B as Le}from"./button-DjJX-cbR.js";import{g as K,s as J,a as Me,u as Pe,F as ze,b as Y,c as H,d as ce,e as G,I as ue,f as Q,C as De}from"./input-DA43W1bc.js";import{c as Fe}from"./utils-BSDwSRl3.js";import{c as Se}from"./createLucideIcon-BOhrmKcl.js";import{u as Ue,e as ee,l as Be}from"./authSlice-NyheTN-1.js";import"./index-B0NebLYn.js";import"./index-BnyqKVWo.js";import"./tslib.es6-De9GV7Vy.js";import"./editorialApi-4jvMs8ha.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var s5=Object.defineProperty;var l5=(e,t,n)=>t in e?s5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var bt=(e,t,n)=>l5(e,typeof t!="symbol"?t+"":t,n);import{a as N,R as S,p as P,A as $h,B as Uc,x as a5}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{u as at,a as Bo,B as u5}from"./button-DjJX-cbR.js";import{h as c5,u as fu,i as d5,I as Yl,F as f5,b as sl,c as ll,d as po,e as al,j as ul,f as cl,C as h5}from"./input-DA43W1bc.js";import{n as g5,o as p5}from"./editorialApi-
|
|
1
|
+
var s5=Object.defineProperty;var l5=(e,t,n)=>t in e?s5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var bt=(e,t,n)=>l5(e,typeof t!="symbol"?t+"":t,n);import{a as N,R as S,p as P,A as $h,B as Uc,x as a5}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{u as at,a as Bo,B as u5}from"./button-DjJX-cbR.js";import{h as c5,u as fu,i as d5,I as Yl,F as f5,b as sl,c as ll,d as po,e as al,j as ul,f as cl,C as h5}from"./input-DA43W1bc.js";import{n as g5,o as p5}from"./editorialApi-4jvMs8ha.js";import{c as m5}from"./utils-BSDwSRl3.js";import{a as zo}from"./index-BnyqKVWo.js";import{h as vs,i as Dh,u as Ki,j as hu,k as Vh,l as Hh,m as Bh,n as zh,o as jh,F as Uh,p as Wh,q as Jh,r as Kh,b as x5,R as y5,P as b5,O as v5,C as _5,T as C5,a as w5,V as k5,c as Zh,d as Gh,e as qh,f as Yh,g as Xh,A as S5,E as E5}from"./index-b1VEd5BJ.js";import{_ as Wc}from"./tslib.es6-De9GV7Vy.js";import{u as sr,c as qr,b as Qh,a as ye,P as Re,d as Pn}from"./index-B0NebLYn.js";import{c as T5}from"./createLucideIcon-BOhrmKcl.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-DxhHtLqO.js","imports":["/assets/chunk-EF7DTUVF-CZaHNoTs.js","/assets/index-BnyqKVWo.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":true,"module":"/assets/root-
|
|
1
|
+
window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-DxhHtLqO.js","imports":["/assets/chunk-EF7DTUVF-CZaHNoTs.js","/assets/index-BnyqKVWo.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":true,"module":"/assets/root-DH7Vh4qn.js","imports":["/assets/chunk-EF7DTUVF-CZaHNoTs.js","/assets/index-BnyqKVWo.js","/assets/authSlice-NyheTN-1.js","/assets/editorialApi-4jvMs8ha.js","/assets/tslib.es6-De9GV7Vy.js"],"css":["/assets/root-DdgoqUZJ.css"]},"routes/home":{"id":"routes/home","parentId":"root","path":"/admin","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/home-CmHCwA-Y.js","imports":["/assets/chunk-EF7DTUVF-CZaHNoTs.js","/assets/button-DjJX-cbR.js","/assets/input-DA43W1bc.js","/assets/utils-BSDwSRl3.js","/assets/createLucideIcon-BOhrmKcl.js","/assets/authSlice-NyheTN-1.js","/assets/index-B0NebLYn.js","/assets/index-BnyqKVWo.js","/assets/tslib.es6-De9GV7Vy.js","/assets/editorialApi-4jvMs8ha.js"],"css":[]},"routes/dashboard._layout":{"id":"routes/dashboard._layout","parentId":"root","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._layout-CX3yKpzk.js","imports":["/assets/chunk-EF7DTUVF-CZaHNoTs.js","/assets/authSlice-NyheTN-1.js","/assets/editorialApi-4jvMs8ha.js","/assets/index-b1VEd5BJ.js","/assets/utils-BSDwSRl3.js","/assets/createLucideIcon-BOhrmKcl.js","/assets/button-DjJX-cbR.js","/assets/index-B0NebLYn.js","/assets/chevron-down-CYVLN3e-.js","/assets/tslib.es6-De9GV7Vy.js","/assets/index-BnyqKVWo.js"],"css":[]},"routes/dashboard":{"id":"routes/dashboard","parentId":"routes/dashboard._layout","path":"/admin/dashboard","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard-D3bouS6Q.js","imports":["/assets/chunk-EF7DTUVF-CZaHNoTs.js","/assets/utils-BSDwSRl3.js","/assets/editorialApi-4jvMs8ha.js","/assets/index-CQvFoK7s.js"],"css":[]},"routes/dashboard.$collection.new":{"id":"routes/dashboard.$collection.new","parentId":"routes/dashboard._layout","path":"/admin/dashboard/:collectionId/new","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._collection.new-DzsaJ27b.js","imports":["/assets/chunk-EF7DTUVF-CZaHNoTs.js","/assets/itemForm-0kgC59b7.js","/assets/editorialApi-4jvMs8ha.js","/assets/button-DjJX-cbR.js","/assets/utils-BSDwSRl3.js","/assets/input-DA43W1bc.js","/assets/index-B0NebLYn.js","/assets/index-BnyqKVWo.js","/assets/createLucideIcon-BOhrmKcl.js","/assets/index-b1VEd5BJ.js","/assets/tslib.es6-De9GV7Vy.js"],"css":["/assets/itemForm-BVtnhZqg.css"]},"routes/dashboard.$collection":{"id":"routes/dashboard.$collection","parentId":"routes/dashboard._layout","path":"/admin/dashboard/:collectionId","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._collection-C33q3HNx.js","imports":["/assets/chunk-EF7DTUVF-CZaHNoTs.js","/assets/button-DjJX-cbR.js","/assets/editorialApi-4jvMs8ha.js","/assets/index-CQvFoK7s.js","/assets/utils-BSDwSRl3.js","/assets/trash-CYTPibS3.js","/assets/createLucideIcon-BOhrmKcl.js"],"css":[]},"routes/dashboard.$collection.$document":{"id":"routes/dashboard.$collection.$document","parentId":"routes/dashboard._layout","path":"/admin/dashboard/:collectionId/:documentId","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._collection._document-BbCS-wOn.js","imports":["/assets/chunk-EF7DTUVF-CZaHNoTs.js","/assets/itemForm-0kgC59b7.js","/assets/editorialApi-4jvMs8ha.js","/assets/button-DjJX-cbR.js","/assets/utils-BSDwSRl3.js","/assets/input-DA43W1bc.js","/assets/index-B0NebLYn.js","/assets/index-BnyqKVWo.js","/assets/createLucideIcon-BOhrmKcl.js","/assets/index-b1VEd5BJ.js","/assets/tslib.es6-De9GV7Vy.js"],"css":["/assets/itemForm-BVtnhZqg.css"]},"routes/dashboard.files":{"id":"routes/dashboard.files","parentId":"routes/dashboard._layout","path":"/admin/dashboard/files","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard.files-Cc4VF-R3.js","imports":["/assets/chunk-EF7DTUVF-CZaHNoTs.js","/assets/authSlice-NyheTN-1.js","/assets/editorialApi-4jvMs8ha.js","/assets/utils-BSDwSRl3.js","/assets/createLucideIcon-BOhrmKcl.js","/assets/chevron-down-CYVLN3e-.js","/assets/trash-CYTPibS3.js","/assets/tslib.es6-De9GV7Vy.js"],"css":[]}},"url":"/assets/manifest-0a56f9c0.js","version":"0a56f9c0"};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,p as e,w as m,q as h,M as x,L as p,S as j,t as b,O as g,i as y}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{u as E,o as w,r as v,f as N,g as S,s as l,a as F,b as R,c as z,i as A,d as L}from"./authSlice-
|
|
1
|
+
import{a as c,p as e,w as m,q as h,M as x,L as p,S as j,t as b,O as g,i as y}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{u as E,o as w,r as v,f as N,g as S,s as l,a as F,b as R,c as z,i as A,d as L}from"./authSlice-NyheTN-1.js";import{u,c as P,s as I,e as o,P as k}from"./editorialApi-4jvMs8ha.js";import"./tslib.es6-De9GV7Vy.js";function q(){const s=E(),{data:t}=u();return c.useEffect(()=>{const a=w(z,async r=>{var i;if(r&&(t!=null&&t.firebase)){const n=(i=r.email)==null?void 0:i.replace(/[.@]/g,"_"),d=v(N,`${t.firebase.dbUsersPath}/${n}`),f=(await S(d)).val();s(l({uid:r.uid,email:r.email})),s(F(f))}else s(l(void 0));s(R(!1))});return()=>a()},[s,t]),null}function B({children:s}){const[t,a]=c.useState(!1),{data:r,error:i,isLoading:n}=u();return c.useEffect(()=>{if(!n){if(i){console.error("Failed to fetch admin config:",i);return}if(r)try{if(!r.firebase)throw new Error("Firebase configuration not found in admin config");A(r.firebase),a(!0)}catch(d){console.error("Failed to initialize Firebase:",d)}}},[r,i,n]),i?e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-xl font-semibold text-red-600 mb-2",children:"Firebase Initialization Error"}),e.jsx("p",{className:"text-gray-600",children:i instanceof Error?i.message:"Failed to fetch admin config"})]})}):n||!t?e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-600",children:"Initializing Firebase..."})]})}):e.jsx(e.Fragment,{children:s})}function C(){const s=P({reducer:{auth:L,[o.reducerPath]:o.reducer},middleware:t=>t().concat(o.middleware)});return I(s.dispatch),s}function D({children:s}){const t=c.useRef(null);return t.current||(t.current=C(),t.current.dispatch(o.endpoints.getConfig.initiate())),e.jsx(k,{store:t.current,children:s})}const $=()=>[];function G({}){return[{title:"Editorial Admin"}]}function K({children:s}){return e.jsxs("html",{lang:"en",className:"min-h-screen",children:[e.jsxs("head",{children:[e.jsx("meta",{charSet:"utf-8"}),e.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),e.jsx(x,{}),e.jsx(p,{})]}),e.jsxs("body",{className:"h-full min-h-screen bg-background font-sans antialiased",children:[e.jsx(D,{children:e.jsxs(B,{children:[e.jsx(q,{}),s]})}),e.jsx(j,{}),e.jsx(b,{})]})]})}const Q=m(function(){return e.jsx(g,{})}),H=h(function({error:t}){let a="Oops!",r="An unexpected error occurred.",i;return y(t)&&(a=t.status===404?"404":"Error",r=t.status===404?"The requested page could not be found.":t.statusText||r),e.jsxs("main",{className:"pt-16 p-4 container mx-auto",children:[e.jsx("h1",{children:a}),e.jsx("p",{children:r}),i]})});export{H as ErrorBoundary,K as Layout,Q as default,$ as links,G as meta};
|
package/build/client/index.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="min-h-screen"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="modulepreload" href="/assets/manifest-
|
|
2
|
-
import * as route0 from "/assets/root-
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="min-h-screen"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="modulepreload" href="/assets/manifest-0a56f9c0.js"/><link rel="modulepreload" href="/assets/entry.client-DxhHtLqO.js"/><link rel="modulepreload" href="/assets/chunk-EF7DTUVF-CZaHNoTs.js"/><link rel="modulepreload" href="/assets/index-BnyqKVWo.js"/><link rel="modulepreload" href="/assets/root-DH7Vh4qn.js"/><link rel="modulepreload" href="/assets/authSlice-NyheTN-1.js"/><link rel="modulepreload" href="/assets/editorialApi-4jvMs8ha.js"/><link rel="modulepreload" href="/assets/tslib.es6-De9GV7Vy.js"/><title>Editorial Admin</title><link rel="stylesheet" href="/assets/root-DdgoqUZJ.css"/></head><body class="h-full min-h-screen bg-background font-sans antialiased"><div class="flex items-center justify-center min-h-screen"><div class="text-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600 mx-auto mb-4"></div><p class="text-gray-600">Initializing Firebase...</p></div></div><script>window.__reactRouterContext = {"basename":"/","future":{"unstable_middleware":false,"unstable_optimizeDeps":false,"unstable_splitRouteModules":false,"unstable_subResourceIntegrity":false,"unstable_viteEnvironmentApi":false},"routeDiscovery":{"mode":"initial"},"ssr":false,"isSpaMode":true};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());</script><script type="module" async="">import "/assets/manifest-0a56f9c0.js";
|
|
2
|
+
import * as route0 from "/assets/root-DH7Vh4qn.js";
|
|
3
3
|
|
|
4
4
|
window.__reactRouterRouteModules = {"root":route0};
|
|
5
5
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isardsat/editorial-admin",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"tailwindcss-animate": "^1.0.7",
|
|
79
79
|
"vaul": "^1.1.2",
|
|
80
80
|
"zod": "^3",
|
|
81
|
-
"@isardsat/editorial-common": "^6.3.
|
|
81
|
+
"@isardsat/editorial-common": "^6.3.2"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@react-router/dev": "^7.5.3",
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import{p as e,a as d,x as N,y as re,v as de,z as le,R as ce,w as ue,O as he}from"./chunk-EF7DTUVF-CZaHNoTs.js";import{u as pe,e as z,h as xe}from"./authSlice-DST6tNnU.js";import{a as K,b as fe,d as be,f as ge,g as me,u as je,h as ve}from"./editorialApi-CqxxtYzA.js";import{R as U,C as W,a as Q,T as X,D as Z,P as Y,O as J,b as we,c as ye,d as Ne,e as Ce,f as Se,g as _e,A as ke,u as Me,E as ze}from"./index-b1VEd5BJ.js";import{c as i}from"./utils-BSDwSRl3.js";import{c as f}from"./createLucideIcon-BOhrmKcl.js";import{B as E,S as R,c as Ee,u as Re}from"./button-DjJX-cbR.js";import{u as De,c as Oe,P as D,a as Ae,b as Pe,d as Ie}from"./index-B0NebLYn.js";import{C as $}from"./chevron-down-CYVLN3e-.js";import"./tslib.es6-De9GV7Vy.js";import"./index-BnyqKVWo.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 Te=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],$e=f("arrow-down",Te);/**
|
|
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 Le=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Be=f("arrow-up",Le);/**
|
|
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 Ge=[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]],He=f("blocks",Ge);/**
|
|
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 Fe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qe=f("chevron-right",Fe);/**
|
|
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 Ve=[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]],Ke=f("files",Ve);/**
|
|
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 Ue=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],We=f("grid-3x3",Ue);/**
|
|
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 Qe=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]],Xe=f("heart",Qe);/**
|
|
37
|
-
* @license lucide-react v0.487.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const Ze=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],Ye=f("log-out",Ze);/**
|
|
42
|
-
* @license lucide-react v0.487.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const Je=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],et=f("panel-left",Je);/**
|
|
47
|
-
* @license lucide-react v0.487.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const tt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],at=f("square",tt);/**
|
|
52
|
-
* @license lucide-react v0.487.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const st=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],nt=f("upload",st);/**
|
|
57
|
-
* @license lucide-react v0.487.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const ot=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ee=f("x",ot);function it({...t}){return e.jsx(U,{"data-slot":"dialog",...t})}function rt({...t}){return e.jsx(Y,{"data-slot":"dialog-portal",...t})}function dt({className:t,...a}){return e.jsx(J,{"data-slot":"dialog-overlay",className:i("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function lt({className:t,children:a,...n}){return e.jsxs(rt,{"data-slot":"dialog-portal",children:[e.jsx(dt,{}),e.jsxs(W,{"data-slot":"dialog-content",className:i("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...n,children:[a,e.jsxs(Q,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(ee,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ct({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:i("flex flex-col gap-2 text-center sm:text-left",t),...a})}function ut({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:i("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function ht({className:t,...a}){return e.jsx(X,{"data-slot":"dialog-title",className:i("text-lg leading-none font-semibold",t),...a})}function pt({className:t,...a}){return e.jsx(Z,{"data-slot":"dialog-description",className:i("text-muted-foreground text-sm",t),...a})}const xt="#181717",ft=d.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},r){return n==="default"&&(n=xt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:r,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})}),bt="#85EA2D",gt=d.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},r){return n==="default"&&(n=bt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:r,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"})]})});function mt({isOpen:t,setOpen:a}){return e.jsx(it,{open:t,onOpenChange:n=>a(n),children:e.jsxs(lt,{children:[e.jsxs(ct,{children:[e.jsx(ht,{children:"Editorial"}),e.jsx(pt,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(E,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"/doc",children:[e.jsx(gt,{size:14}),"Swagger API UI"]})}),e.jsx(E,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(ft,{size:14}),"GitHub repository"]})})]}),e.jsx(ut,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(Xe,{size:14,className:"stroke-red-500 fill-red-500"})," by"," ",e.jsx(N,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}function jt({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(we,{"data-slot":"separator-root",decorative:n,orientation:a,className:i("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...s})}function vt({...t}){return e.jsx(U,{"data-slot":"sheet",...t})}function wt({...t}){return e.jsx(Y,{"data-slot":"sheet-portal",...t})}function yt({className:t,...a}){return e.jsx(J,{"data-slot":"sheet-overlay",className:i("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function Nt({className:t,children:a,side:n="right",...s}){return e.jsxs(wt,{children:[e.jsx(yt,{}),e.jsxs(W,{"data-slot":"sheet-content",className:i("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,e.jsxs(Q,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(ee,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ct({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:i("flex flex-col gap-1.5 p-4",t),...a})}function St({className:t,...a}){return e.jsx(X,{"data-slot":"sheet-title",className:i("text-foreground font-semibold",t),...a})}function _t({className:t,...a}){return e.jsx(Z,{"data-slot":"sheet-description",className:i("text-muted-foreground text-sm",t),...a})}function te({delayDuration:t=0,...a}){return e.jsx(ye,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function kt({...t}){return e.jsx(te,{children:e.jsx(Ne,{"data-slot":"tooltip",...t})})}function Mt({...t}){return e.jsx(Ce,{"data-slot":"tooltip-trigger",...t})}function zt({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(Se,{children:e.jsxs(_e,{"data-slot":"tooltip-content",sideOffset:a,className:i("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...s,children:[n,e.jsx(ke,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const M=768;function Et(){const[t,a]=d.useState(void 0);return d.useEffect(()=>{const n=window.matchMedia(`(max-width: ${M-1}px)`),s=()=>{a(window.innerWidth<M)};return n.addEventListener("change",s),a(window.innerWidth<M),()=>n.removeEventListener("change",s)},[]),!!t}const Rt="sidebar_state",Dt=60*60*24*7,Ot="16rem",At="18rem",Pt="3rem",It="b",ae=d.createContext(null);function O(){const t=d.useContext(ae);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Tt({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:r,...l}){const p=Et(),[x,u]=d.useState(!1),[g,C]=d.useState(t),m=a??g,j=d.useCallback(h=>{const c=typeof h=="function"?h(m):h;n?n(c):C(c),document.cookie=`${Rt}=${c}; path=/; max-age=${Dt}`},[n,m]),v=d.useCallback(()=>p?u(h=>!h):j(h=>!h),[p,j,u]);d.useEffect(()=>{const h=c=>{c.key===It&&(c.metaKey||c.ctrlKey)&&(c.preventDefault(),v())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[v]);const y=m?"expanded":"collapsed",S=d.useMemo(()=>({state:y,open:m,setOpen:j,isMobile:p,openMobile:x,setOpenMobile:u,toggleSidebar:v}),[y,m,j,p,x,u,v]);return e.jsx(ae.Provider,{value:S,children:e.jsx(te,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Ot,"--sidebar-width-icon":Pt,...o},className:i("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...l,children:r})})})}function $t({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...r}){const{isMobile:l,state:p,openMobile:x,setOpenMobile:u}=O();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:i("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...r,children:o}):l?e.jsx(vt,{open:x,onOpenChange:u,...r,children:e.jsxs(Nt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":At},side:t,children:[e.jsxs(Ct,{className:"sr-only",children:[e.jsx(St,{children:"Sidebar"}),e.jsx(_t,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":p,"data-collapsible":p==="collapsed"?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:i("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:i("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...r,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function Lt({className:t,onClick:a,...n}){const{toggleSidebar:s}=O();return e.jsxs(E,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:i("size-7",t),onClick:o=>{a==null||a(o),s()},...n,children:[e.jsx(et,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Bt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:i("flex flex-col gap-2 p-2",t),...a})}function Gt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i("flex flex-col gap-2 p-2",t),...a})}function Ht({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function _({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i("relative flex w-full min-w-0 flex-col p-2",t),...a})}function L({className:t,asChild:a=!1,...n}){const s=a?R:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:i("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}function B({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i("w-full text-sm",t),...a})}function G({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i("flex w-full min-w-0 flex-col gap-1",t),...a})}function w({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i("group/menu-item relative",t),...a})}const Ft=Ee("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function b({asChild:t=!1,isActive:a=!1,variant:n="default",size:s="default",tooltip:o,className:r,...l}){const p=t?R:"button",{isMobile:x,state:u}=O(),g=e.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:i(Ft({variant:n,size:s}),r),...l});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(kt,{children:[e.jsx(Mt,{asChild:!0,children:g}),e.jsx(zt,{side:"right",align:"center",hidden:u!=="collapsed"||x,...o})]})):g}function qt({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:i("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function Vt({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...o}){const r=t?R:"a";return e.jsx(r,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":n,className:i("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",s),...o})}function H({singleton:t}){const{data:a}=K(),{data:n}=fe();return a?e.jsx(e.Fragment,{children:Object.entries(a).filter(([,s])=>t?s.singleton:!s.singleton).map(([s,o])=>e.jsx(qt,{children:e.jsx(re,{to:t?`/admin/dashboard/${s}/default`:`/admin/dashboard/${s}`,className:({isActive:r,isPending:l})=>l?"pending":r?"active":"",children:({isActive:r})=>e.jsx(Vt,{isActive:r,asChild:!0,children:e.jsxs("div",{children:[e.jsx("span",{className:"inline-block overflow-hidden whitespace-nowrap text-ellipsis text-nowrap w-full",children:o.displayName}),!t&&n&&e.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1",children:Object.keys(n[s]).length})]})})})},o.displayName))}):null}var k="Collapsible",[Kt,ca]=Oe(k),[Ut,A]=Kt(k),se=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:r,onOpenChange:l,...p}=t,[x,u]=De({prop:s,defaultProp:o??!1,onChange:l,caller:k});return e.jsx(Ut,{scope:n,disabled:r,contentId:Me(),open:x,onOpenToggle:d.useCallback(()=>u(g=>!g),[u]),children:e.jsx(D.div,{"data-state":I(x),"data-disabled":r?"":void 0,...p,ref:a})})});se.displayName=k;var ne="CollapsibleTrigger",oe=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=A(ne,n);return e.jsx(D.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":I(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...s,ref:a,onClick:Ae(t.onClick,o.onOpenToggle)})});oe.displayName=ne;var P="CollapsibleContent",ie=d.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=A(P,t.__scopeCollapsible);return e.jsx(Pe,{present:n||o.open,children:({present:r})=>e.jsx(Wt,{...s,ref:a,present:r})})});ie.displayName=P;var Wt=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...r}=t,l=A(P,n),[p,x]=d.useState(s),u=d.useRef(null),g=Re(a,u),C=d.useRef(0),m=C.current,j=d.useRef(0),v=j.current,y=l.open||p,S=d.useRef(y),h=d.useRef(void 0);return d.useEffect(()=>{const c=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(c)},[]),Ie(()=>{const c=u.current;if(c){h.current=h.current||{transitionDuration:c.style.transitionDuration,animationName:c.style.animationName},c.style.transitionDuration="0s",c.style.animationName="none";const T=c.getBoundingClientRect();C.current=T.height,j.current=T.width,S.current||(c.style.transitionDuration=h.current.transitionDuration,c.style.animationName=h.current.animationName),x(s)}},[l.open,s]),e.jsx(D.div,{"data-state":I(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!y,...r,ref:g,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:y&&o})});function I(t){return t?"open":"closed"}var Qt=se;function F({...t}){return e.jsx(Qt,{"data-slot":"collapsible",...t})}function q({...t}){return e.jsx(oe,{"data-slot":"collapsible-trigger",...t})}function V({...t}){return e.jsx(ie,{"data-slot":"collapsible-content",...t})}function Xt(){const t=pe(),[a,n]=d.useState(!1),[s]=be(),[o]=ge(),[r]=me(),{data:l}=je(),{data:p}=ve(),x=z(u=>u.auth.role);return e.jsxs($t,{className:"z-50",children:[e.jsx(mt,{isOpen:a,setOpen:n}),e.jsx(Bt,{className:"h-14 justify-center",children:e.jsx(_,{children:e.jsx(N,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:l==null?void 0:l.name})})}),e.jsxs(Ht,{children:[e.jsxs(_,{children:[e.jsx(L,{children:"Content"}),e.jsx(B,{children:e.jsxs(G,{children:[e.jsx(F,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(q,{asChild:!0,children:e.jsxs(b,{className:"group",children:[e.jsx(We,{}),e.jsx("span",{children:"Collections"}),e.jsx($,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(V,{children:e.jsx(H,{})})]})}),e.jsx(F,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(q,{asChild:!0,children:e.jsxs(b,{className:"group",children:[e.jsx(at,{}),e.jsx("span",{children:"Singles"}),e.jsx($,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(V,{children:e.jsx(H,{singleton:!0})})]})}),e.jsx(w,{children:e.jsx(b,{asChild:!0,children:e.jsxs(N,{to:"/admin/dashboard/files",children:[e.jsx(Ke,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(w,{children:e.jsxs(b,{disabled:!0,children:[e.jsx(He,{}),e.jsx("span",{children:"Components"})]})})]})})]}),e.jsxs(_,{children:[e.jsx(L,{children:"Actions"}),e.jsx(B,{children:e.jsxs(G,{children:[x==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsxs(b,{className:"cursor-pointer",onClick:()=>o(),children:[e.jsx($e,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(w,{children:e.jsxs(b,{className:"cursor-pointer",onClick:()=>r(),children:[e.jsx(Be,{}),e.jsx("span",{children:"Push to repo"})]})})]}),e.jsx(w,{children:e.jsxs(b,{className:"cursor-pointer",onClick:()=>s(),children:[e.jsx(nt,{}),e.jsx("span",{children:"Publish"})]})})]})})]}),e.jsx(_,{})]}),e.jsxs(Gt,{children:[e.jsx(b,{asChild:!0,children:e.jsxs(N,{to:l==null?void 0:l.previewUrl,children:["Preview",e.jsx(ze,{className:"ml-auto"})]})}),e.jsx(b,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),e.jsxs(b,{className:"cursor-pointer",onClick:()=>t(xe()),children:[e.jsx(Ye,{}),"Log out"]})]})]})}function Zt({children:t}){const a=de(),n=z(o=>o.auth.user),s=z(o=>o.auth.isLoading);return d.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?null:t}function Yt(){const{pathname:t}=le(),{data:a}=K(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,r)=>e.jsxs(ce.Fragment,{children:[r.length>1&&o>=1&&e.jsx(qe,{size:12,className:"text-gray-500 pt-[1px]"}),e.jsx("p",{className:"text-sm leading-none tracking-tight capitalize text-gray-500 last:text-foreground",children:a[s]?a[s].displayName:s},s)]},o))}):null}const ua=ue(function(){return e.jsx(Zt,{children:e.jsxs(Tt,{className:"flex h-full",children:[e.jsx(Xt,{}),e.jsxs("main",{className:"flex flex-col flex-1 h-full w-0",children:[e.jsx("header",{className:"flex sticky bg-sidebar dark:bg-sidebar z-40 top-0 h-14 shrink-0 items-center gap-2 border-b",children:e.jsxs("div",{className:"flex items-center gap-2 px-3",children:[e.jsx(Lt,{}),e.jsx(jt,{orientation:"vertical",className:"h-4"}),e.jsx(Yt,{})]})}),e.jsx(he,{})]})]})})});export{ua as default};
|