@isardsat/editorial-admin 6.0.1 → 6.0.3

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.
Files changed (41) hide show
  1. package/build/client/__spa-fallback.html +13 -0
  2. package/build/client/admin/index.html +22 -0
  3. package/build/client/assets/{authSlice-KDhecIDl.js → authSlice-5XZo_yNS.js} +181 -181
  4. package/build/client/assets/{button-O0EDocjF.js → button-V-1j5t4f.js} +1 -1
  5. package/build/client/assets/dashboard-Be6nTcTN.js +1 -0
  6. package/build/client/assets/dashboard._collection-DppEZSog.js +16 -0
  7. package/build/client/assets/dashboard._collection._document-DX_V-XK4.js +1 -0
  8. package/build/client/assets/dashboard._collection.new-CocdSIiG.js +1 -0
  9. package/build/client/assets/dashboard._layout-Df-C65Il.js +65 -0
  10. package/build/client/assets/dashboard.files-Doq5nv7_.js +36 -0
  11. package/build/client/assets/editorialApi-CykQGjTu.js +1 -0
  12. package/build/client/assets/{home-wnsWYgD_.js → home-ZtJfV8P0.js} +2 -2
  13. package/build/client/assets/index-CMEgjExU.js +46 -0
  14. package/build/client/assets/{index-B_FOxFgA.js → index-D4Mj6Lef.js} +1 -1
  15. package/build/client/assets/{index-DrhM6FV9.js → index-DZxX-xes.js} +2 -2
  16. package/build/client/assets/{input-BH49oaMa.js → input-D-kT9R-x.js} +2 -2
  17. package/build/client/assets/itemForm-CcPfHU2b.css +1 -0
  18. package/build/client/assets/itemForm-ChV6tjGl.js +99 -0
  19. package/build/client/assets/manifest-a1ca6f8e.js +1 -0
  20. package/build/client/assets/react-redux-D9l7ZD4q.js +9 -0
  21. package/build/client/assets/root-BvXgIVX7.js +1 -0
  22. package/build/client/assets/root-DhulzpWQ.css +1 -0
  23. package/build/client/assets/{tslib.es6-CDuPK5Eb.js → tslib.es6-De9GV7Vy.js} +1 -1
  24. package/build/client/assets/utils-BJX_0rcU.js +1 -0
  25. package/build/client/index.html +18 -10
  26. package/package.json +4 -4
  27. package/build/client/assets/dashboard-Binq3-uL.js +0 -1
  28. package/build/client/assets/dashboard._collection-DCypgAsP.js +0 -16
  29. package/build/client/assets/dashboard._collection._document-B9dEIw39.js +0 -1
  30. package/build/client/assets/dashboard._collection.new-QbdwRouF.js +0 -1
  31. package/build/client/assets/dashboard._layout-BdJ3SrSw.js +0 -66
  32. package/build/client/assets/dashboard.files-DVCxRHOl.js +0 -36
  33. package/build/client/assets/editorialApi-DCnC5eM9.js +0 -1
  34. package/build/client/assets/index-C-iH5ItK.js +0 -45
  35. package/build/client/assets/index-G-cqIhgh.js +0 -9
  36. package/build/client/assets/itemForm-CDbHkFXh.css +0 -1
  37. package/build/client/assets/itemForm-dtoqbEoC.js +0 -90
  38. package/build/client/assets/manifest-a309df9e.js +0 -1
  39. package/build/client/assets/root-DHDQPxhg.js +0 -1
  40. package/build/client/assets/root-DS7N36v7.css +0 -1
  41. package/build/client/assets/utils-DslUJpbf.js +0 -1
@@ -1 +1 @@
1
- import{r as a,l as p}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{a as V,c as E}from"./utils-DslUJpbf.js";function b(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function x(...e){return n=>{let t=!1;const i=e.map(r=>{const o=b(r,n);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let r=0;r<i.length;r++){const o=i[r];typeof o=="function"?o():b(e[r],null)}}}}function z(...e){return a.useCallback(x(...e),e)}function j(e){const n=_(e),t=a.forwardRef((i,r)=>{const{children:o,...u}=i,l=a.Children.toArray(o),v=l.find(R);if(v){const s=v.props.children,c=l.map(d=>d===v?a.Children.count(s)>1?a.Children.only(null):a.isValidElement(s)?s.props.children:null:d);return p.jsx(n,{...u,ref:r,children:a.isValidElement(s)?a.cloneElement(s,void 0,c):null})}return p.jsx(n,{...u,ref:r,children:o})});return t.displayName=`${e}.Slot`,t}var N=j("Slot");function _(e){const n=a.forwardRef((t,i)=>{const{children:r,...o}=t;if(a.isValidElement(r)){const u=O(r),l=w(o,r.props);return r.type!==a.Fragment&&(l.ref=i?x(i,u):u),a.cloneElement(r,l)}return a.Children.count(r)>1?a.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var C=Symbol("radix.slottable");function B(e){const n=({children:t})=>p.jsx(p.Fragment,{children:t});return n.displayName=`${e}.Slottable`,n.__radixId=C,n}function R(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===C}function w(e,n){const t={...n};for(const i in n){const r=e[i],o=n[i];/^on[A-Z]/.test(i)?r&&o?t[i]=(...l)=>{o(...l),r(...l)}:r&&(t[i]=r):i==="style"?t[i]={...r,...o}:i==="className"&&(t[i]=[r,o].filter(Boolean).join(" "))}return{...e,...t}}function O(e){var i,r;let n=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}const y=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,h=V,P=(e,n)=>t=>{var i;if((n==null?void 0:n.variants)==null)return h(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:r,defaultVariants:o}=n,u=Object.keys(r).map(s=>{const c=t==null?void 0:t[s],d=o==null?void 0:o[s];if(c===null)return null;const f=y(c)||y(d);return r[s][f]}),l=t&&Object.entries(t).reduce((s,c)=>{let[d,f]=c;return f===void 0||(s[d]=f),s},{}),v=n==null||(i=n.compoundVariants)===null||i===void 0?void 0:i.reduce((s,c)=>{let{class:d,className:f,...S}=c;return Object.entries(S).every(k=>{let[m,g]=k;return Array.isArray(g)?g.includes({...o,...l}[m]):{...o,...l}[m]===g})?[...s,d,f]:s},[]);return h(e,u,v,t==null?void 0:t.class,t==null?void 0:t.className)},A=P("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function T({className:e,variant:n,size:t,asChild:i=!1,...r}){const o=i?N:"button";return p.jsx(o,{"data-slot":"button",className:E(A({variant:n,size:t,className:e})),...r})}export{T as B,N as S,j as a,B as b,P as c,z as u};
1
+ import{r as a,l as p}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{a as V,c as E}from"./utils-BJX_0rcU.js";function b(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function x(...e){return n=>{let t=!1;const i=e.map(r=>{const o=b(r,n);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let r=0;r<i.length;r++){const o=i[r];typeof o=="function"?o():b(e[r],null)}}}}function z(...e){return a.useCallback(x(...e),e)}function j(e){const n=_(e),t=a.forwardRef((i,r)=>{const{children:o,...u}=i,l=a.Children.toArray(o),v=l.find(R);if(v){const s=v.props.children,c=l.map(d=>d===v?a.Children.count(s)>1?a.Children.only(null):a.isValidElement(s)?s.props.children:null:d);return p.jsx(n,{...u,ref:r,children:a.isValidElement(s)?a.cloneElement(s,void 0,c):null})}return p.jsx(n,{...u,ref:r,children:o})});return t.displayName=`${e}.Slot`,t}var N=j("Slot");function _(e){const n=a.forwardRef((t,i)=>{const{children:r,...o}=t;if(a.isValidElement(r)){const u=O(r),l=w(o,r.props);return r.type!==a.Fragment&&(l.ref=i?x(i,u):u),a.cloneElement(r,l)}return a.Children.count(r)>1?a.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var C=Symbol("radix.slottable");function B(e){const n=({children:t})=>p.jsx(p.Fragment,{children:t});return n.displayName=`${e}.Slottable`,n.__radixId=C,n}function R(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===C}function w(e,n){const t={...n};for(const i in n){const r=e[i],o=n[i];/^on[A-Z]/.test(i)?r&&o?t[i]=(...l)=>{o(...l),r(...l)}:r&&(t[i]=r):i==="style"?t[i]={...r,...o}:i==="className"&&(t[i]=[r,o].filter(Boolean).join(" "))}return{...e,...t}}function O(e){var i,r;let n=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}const y=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,h=V,P=(e,n)=>t=>{var i;if((n==null?void 0:n.variants)==null)return h(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:r,defaultVariants:o}=n,u=Object.keys(r).map(s=>{const c=t==null?void 0:t[s],d=o==null?void 0:o[s];if(c===null)return null;const f=y(c)||y(d);return r[s][f]}),l=t&&Object.entries(t).reduce((s,c)=>{let[d,f]=c;return f===void 0||(s[d]=f),s},{}),v=n==null||(i=n.compoundVariants)===null||i===void 0?void 0:i.reduce((s,c)=>{let{class:d,className:f,...S}=c;return Object.entries(S).every(k=>{let[m,g]=k;return Array.isArray(g)?g.includes({...o,...l}[m]):{...o,...l}[m]===g})?[...s,d,f]:s},[]);return h(e,u,v,t==null?void 0:t.class,t==null?void 0:t.className)},A=P("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function T({className:e,variant:n,size:t,asChild:i=!1,...r}){const o=i?N:"button";return p.jsx(o,{"data-slot":"button",className:E(A({variant:n,size:t,className:e})),...r})}export{T as B,N as S,B as a,P as b,j as c,x as d,z as u};
@@ -0,0 +1 @@
1
+ import{w as j}from"./react-redux-D9l7ZD4q.js";import{l as e,r as b,q as w}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{c as m,f as u}from"./utils-BJX_0rcU.js";import{a as C,u as N,h as v,i as T}from"./editorialApi-CykQGjTu.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-DZxX-xes.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=b.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(w,{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 F=j(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{F as default};
@@ -0,0 +1,16 @@
1
+ import{w as v}from"./react-redux-D9l7ZD4q.js";import{l as e,r as m,q as N}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{B as k}from"./button-V-1j5t4f.js";import{j as w,a as T,k as M}from"./editorialApi-CykQGjTu.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-DZxX-xes.js";import{f as P,a as S,c as B}from"./utils-BJX_0rcU.js";import{T as E}from"./trash-B3lfbu-5.js";import{c as x}from"./createLucideIcon-TQsNVzYU.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 L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],O=x("circle-check",L);/**
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 F=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],G=x("circle",F);/**
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 Q=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],q=x("plus",Q),u=$(),b=[u.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(l){const t=l.getValue();return e.jsx("span",{title:t,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:t})}})];function A({itemType:l}){const{data:t}=w(l),{data:c}=T(),[r]=M(),o=m.useMemo(()=>u.display({id:"actions",header:()=>e.jsx("span",{className:"flex justify-end ml-auto"}),cell(a){return e.jsx("div",{className:"flex gap-2 justify-end",children:e.jsxs("button",{className:"hover:text-red-500 p-1 hover:bg-muted rounded-sm",onClick:s=>{s.stopPropagation(),r({type:l,id:a.row.original.id})},children:[e.jsx(E,{size:16,className:"group-hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"Delete entry"})]})})}}),[l,r]),i=m.useMemo(()=>{if(!t)return b;const a=Object.entries(t.fields);return[...b,...a.filter(([,s])=>s.showInSummary).map(([s,d])=>u.accessor(n=>n[s],{id:s,header:d.displayName,cell(n){switch(d.type){case"boolean":const C=n.getValue()?O:G;return e.jsx("span",{className:"flex justify-center items-center h-full text-nowrap",children:e.jsx(C,{className:S("mx-auto",n.getValue()?"text-green-600":"text-gray-300"),size:14})});case"date":const p=n.getValue();return p?e.jsx("span",{className:"text-nowrap",children:P(new Date(p))}):"--";case"markdown":case"string":const f=n.getValue();return e.jsx("span",{title:f,className:"block w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:f});default:return n.getValue()}}})),o]},[o,t]),y=m.useMemo(()=>c?Object.values(c[l]):[],[l,c]),h=D({data:y,columns:i,getCoreRowModel:I()});return!t||!c?null:e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(R,{children:[e.jsx(V,{className:"sticky top-0 z-50",children:h.getHeaderGroups().map(a=>e.jsx(g,{className:"grid",style:{gridTemplateColumns:`repeat(${i.length}, minmax(200px, 1fr))`},children:a.headers.map(s=>e.jsx(_,{className:"bg-background",children:s.isPlaceholder?null:j(s.column.columnDef.header,s.getContext())},s.id))},a.id))}),e.jsx(z,{children:h.getRowModel().rows.map(a=>e.jsx(N,{to:`/admin/dashboard/${l}/${a.original.id}`,children:e.jsx(g,{className:"grid",style:{gridTemplateColumns:`repeat(${i.length}, minmax(200px, 1fr))`},children:a.getVisibleCells().map((s,d)=>e.jsx(H,{className:B("h-10",{"w-full":d==i.length-1}),children:j(s.column.columnDef.cell,s.getContext())},s.id))})},a.id))})]})})}const se=v(function({params:t}){const{collectionId:c}=t,{data:r,isFetching:o}=w(c);return o||!r?null:e.jsx("div",{className:"overflow-hidden flex flex-1 p-4 gap-4",children:e.jsx("div",{className:"flex flex-col overflow-hidden flex-1 gap-8",children:e.jsxs("div",{className:"flex flex-col h-full gap-4 last:mb-20",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",id:r.displayName,children:r.displayName}),e.jsx(k,{asChild:!0,variant:"default",size:"sm",className:"ml-auto",children:e.jsxs(N,{to:`/admin/dashboard/${c}/new`,children:[e.jsx(q,{}),"Create"]})})]}),e.jsx(A,{itemType:c},c)]})})})});export{se as default};
@@ -0,0 +1 @@
1
+ import{w as c}from"./react-redux-D9l7ZD4q.js";import{l as e}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{I as n}from"./itemForm-ChV6tjGl.js";import{j as p,l}from"./editorialApi-CykQGjTu.js";import"./button-V-1j5t4f.js";import"./utils-BJX_0rcU.js";import"./input-D-kT9R-x.js";import"./index-D4Mj6Lef.js";import"./index-B7e3fQ32.js";import"./createLucideIcon-TQsNVzYU.js";import"./index-CMEgjExU.js";import"./tslib.es6-De9GV7Vy.js";const T=c(function({params:m}){const{collectionId:t,documentId:i}=m,{data:o,isFetching:r}=p(t),{data:s,isFetching:a}=l({itemType:t,id:i});return!o||!s||(r||a)?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{T as default};
@@ -0,0 +1 @@
1
+ import{w as i}from"./react-redux-D9l7ZD4q.js";import{l as o}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{I as m}from"./itemForm-ChV6tjGl.js";import{j as s}from"./editorialApi-CykQGjTu.js";import"./button-V-1j5t4f.js";import"./utils-BJX_0rcU.js";import"./input-D-kT9R-x.js";import"./index-D4Mj6Lef.js";import"./index-B7e3fQ32.js";import"./createLucideIcon-TQsNVzYU.js";import"./index-CMEgjExU.js";import"./tslib.es6-De9GV7Vy.js";const y=i(function({params:e}){const{collectionId:t}=e,{data:r}=s(t);return r?o.jsx("div",{className:"overflow-auto",children:o.jsx("div",{className:"flex p-4 gap-4",children:o.jsx(m,{itemType:t,fields:r.fields,isNew:!0})})}):null});export{y as default};
@@ -0,0 +1,65 @@
1
+ import{c as Jt,w as Eo}from"./react-redux-D9l7ZD4q.js";import{r as u,l as i,q as ce,N as jo,p as Ro,t as Po,v as Ao,O as Oo}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{u as No,e as Ue,h as To}from"./authSlice-5XZo_yNS.js";import{u as en,a as Do,b as So,c as _o,d as Mo,f as Lo,g as ko}from"./editorialApi-CykQGjTu.js";import{P as M,c as $,u as xe,d as Io,a as Ae,b as Je,e as _e,f as fe,g as Fo,h as $o}from"./index-D4Mj6Lef.js";import{u as G,c as Ho,B as Ge,a as Bo,S as et,b as zo}from"./button-V-1j5t4f.js";import{u as Wo,a as ge,h as Vo,R as Uo,b as Go,E as Ko}from"./index-CMEgjExU.js";import{R as Yo,r as qo}from"./index-B7e3fQ32.js";import{c as A}from"./utils-BJX_0rcU.js";import{c as W}from"./createLucideIcon-TQsNVzYU.js";import{C as Tt}from"./chevron-down-BMtosYlL.js";import"./tslib.es6-De9GV7Vy.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 Xo=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Zo=W("arrow-down",Xo);/**
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 Qo=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Jo=W("arrow-up",Qo);/**
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 er=[["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"}]],tr=W("blocks",er);/**
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 nr=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],or=W("chevron-right",nr);/**
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 rr=[["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"}]],sr=W("files",rr);/**
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 ir=[["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"}]],ar=W("grid-3x3",ir);/**
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 cr=[["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"}]],lr=W("heart",cr);/**
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 dr=[["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"}]],ur=W("log-out",dr);/**
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 fr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],pr=W("panel-left",fr);/**
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 hr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],mr=W("square",hr);/**
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 gr=[["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"}]],xr=W("upload",gr);/**
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 vr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],tn=W("x",vr);var br="DismissableLayer",Ke="dismissableLayer.update",yr="dismissableLayer.pointerDownOutside",wr="dismissableLayer.focusOutside",Dt,nn=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tt=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...l}=e,d=u.useContext(nn),[f,h]=u.useState(null),g=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=u.useState({}),v=G(t,j=>h(j)),m=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(y),b=f?m.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,C=b>=x,E=jr(j=>{const O=j.target,L=[...d.branches].some(N=>N.contains(O));!C||L||(r==null||r(j),a==null||a(j),j.defaultPrevented||c==null||c())},g),R=Rr(j=>{const O=j.target;[...d.branches].some(N=>N.contains(O))||(s==null||s(j),a==null||a(j),j.defaultPrevented||c==null||c())},g);return Wo(j=>{b===d.layers.size-1&&(o==null||o(j),!j.defaultPrevented&&c&&(j.preventDefault(),c()))},g),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Dt=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),St(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=Dt)}},[f,g,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),St())},[f,d]),u.useEffect(()=>{const j=()=>p({});return document.addEventListener(Ke,j),()=>document.removeEventListener(Ke,j)},[]),i.jsx(M.div,{...l,ref:v,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:$(e.onFocusCapture,R.onFocusCapture),onBlurCapture:$(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:$(e.onPointerDownCapture,E.onPointerDownCapture)})});tt.displayName=br;var Cr="DismissableLayerBranch",Er=u.forwardRef((e,t)=>{const n=u.useContext(nn),o=u.useRef(null),r=G(t,o);return u.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),i.jsx(M.div,{...e,ref:r})});Er.displayName=Cr;function jr(e,t=globalThis==null?void 0:globalThis.document){const n=xe(e),o=u.useRef(!1),r=u.useRef(()=>{});return u.useEffect(()=>{const s=c=>{if(c.target&&!o.current){let l=function(){on(yr,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Rr(e,t=globalThis==null?void 0:globalThis.document){const n=xe(e),o=u.useRef(!1);return u.useEffect(()=>{const r=s=>{s.target&&!o.current&&on(wr,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function St(){const e=new CustomEvent(Ke);document.dispatchEvent(e)}function on(e,t,n,{discrete:o}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Io(r,s):r.dispatchEvent(s)}var He="focusScope.autoFocusOnMount",Be="focusScope.autoFocusOnUnmount",_t={bubbles:!1,cancelable:!0},Pr="FocusScope",rn=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...a}=e,[c,l]=u.useState(null),d=xe(r),f=xe(s),h=u.useRef(null),g=G(t,m=>l(m)),p=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(o){let m=function(w){if(p.paused||!c)return;const C=w.target;c.contains(C)?h.current=C:te(h.current,{select:!0})},y=function(w){if(p.paused||!c)return;const C=w.relatedTarget;C!==null&&(c.contains(C)||te(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&te(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const b=new MutationObserver(x);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),b.disconnect()}}},[o,c,p.paused]),u.useEffect(()=>{if(c){Lt.add(p);const m=document.activeElement;if(!c.contains(m)){const x=new CustomEvent(He,_t);c.addEventListener(He,d),c.dispatchEvent(x),x.defaultPrevented||(Ar(Sr(sn(c)),{select:!0}),document.activeElement===m&&te(c))}return()=>{c.removeEventListener(He,d),setTimeout(()=>{const x=new CustomEvent(Be,_t);c.addEventListener(Be,f),c.dispatchEvent(x),x.defaultPrevented||te(m??document.body,{select:!0}),c.removeEventListener(Be,f),Lt.remove(p)},0)}}},[c,d,f,p]);const v=u.useCallback(m=>{if(!n&&!o||p.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(y&&x){const b=m.currentTarget,[w,C]=Or(b);w&&C?!m.shiftKey&&x===C?(m.preventDefault(),n&&te(w,{select:!0})):m.shiftKey&&x===w&&(m.preventDefault(),n&&te(C,{select:!0})):x===b&&m.preventDefault()}},[n,o,p.paused]);return i.jsx(M.div,{tabIndex:-1,...a,ref:g,onKeyDown:v})});rn.displayName=Pr;function Ar(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(te(o,{select:t}),document.activeElement!==n)return}function Or(e){const t=sn(e),n=Mt(t,e),o=Mt(t.reverse(),e);return[n,o]}function sn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Mt(e,t){for(const n of e)if(!Nr(n,{upTo:t}))return n}function Nr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Tr(e){return e instanceof HTMLInputElement&&"select"in e}function te(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Tr(e)&&t&&e.select()}}var Lt=Dr();function Dr(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=kt(e,t),e.unshift(t)},remove(t){var n;e=kt(e,t),(n=e[0])==null||n.resume()}}}function kt(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Sr(e){return e.filter(t=>t.tagName!=="A")}var _r="Portal",nt=u.forwardRef((e,t)=>{var c;const{container:n,...o}=e,[r,s]=u.useState(!1);Ae(()=>s(!0),[]);const a=n||r&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?Yo.createPortal(i.jsx(M.div,{...o,ref:t}),a):null});nt.displayName=_r;var ot="Dialog",[an,Da]=_e(ot),[Mr,K]=an(ot),cn=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:a=!0}=e,c=u.useRef(null),l=u.useRef(null),[d=!1,f]=Je({prop:o,defaultProp:r,onChange:s});return i.jsx(Mr,{scope:t,triggerRef:c,contentRef:l,contentId:ge(),titleId:ge(),descriptionId:ge(),open:d,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(h=>!h),[f]),modal:a,children:n})};cn.displayName=ot;var ln="DialogTrigger",Lr=u.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=K(ln,n),s=G(t,r.triggerRef);return i.jsx(M.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":it(r.open),...o,ref:s,onClick:$(e.onClick,r.onOpenToggle)})});Lr.displayName=ln;var rt="DialogPortal",[kr,dn]=an(rt,{forceMount:void 0}),un=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,s=K(rt,t);return i.jsx(kr,{scope:t,forceMount:n,children:u.Children.map(o,a=>i.jsx(fe,{present:n||s.open,children:i.jsx(nt,{asChild:!0,container:r,children:a})}))})};un.displayName=rt;var Oe="DialogOverlay",fn=u.forwardRef((e,t)=>{const n=dn(Oe,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=K(Oe,e.__scopeDialog);return s.modal?i.jsx(fe,{present:o||s.open,children:i.jsx(Fr,{...r,ref:t})}):null});fn.displayName=Oe;var Ir=Ho("DialogOverlay.RemoveScroll"),Fr=u.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=K(Oe,n);return i.jsx(Uo,{as:Ir,allowPinchZoom:!0,shards:[r.contentRef],children:i.jsx(M.div,{"data-state":it(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),ie="DialogContent",pn=u.forwardRef((e,t)=>{const n=dn(ie,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=K(ie,e.__scopeDialog);return i.jsx(fe,{present:o||s.open,children:s.modal?i.jsx($r,{...r,ref:t}):i.jsx(Hr,{...r,ref:t})})});pn.displayName=ie;var $r=u.forwardRef((e,t)=>{const n=K(ie,e.__scopeDialog),o=u.useRef(null),r=G(t,n.contentRef,o);return u.useEffect(()=>{const s=o.current;if(s)return Vo(s)},[]),i.jsx(hn,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:$(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&s.preventDefault()}),onFocusOutside:$(e.onFocusOutside,s=>s.preventDefault())})}),Hr=u.forwardRef((e,t)=>{const n=K(ie,e.__scopeDialog),o=u.useRef(!1),r=u.useRef(!1);return i.jsx(hn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(o.current||(c=n.triggerRef.current)==null||c.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{var l,d;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=s.target;((d=n.triggerRef.current)==null?void 0:d.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),hn=u.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,...a}=e,c=K(ie,n),l=u.useRef(null),d=G(t,l);return Go(),i.jsxs(i.Fragment,{children:[i.jsx(rn,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:i.jsx(tt,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":it(c.open),...a,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(Br,{titleId:c.titleId}),i.jsx(Wr,{contentRef:l,descriptionId:c.descriptionId})]})]})}),st="DialogTitle",mn=u.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=K(st,n);return i.jsx(M.h2,{id:r.titleId,...o,ref:t})});mn.displayName=st;var gn="DialogDescription",xn=u.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=K(gn,n);return i.jsx(M.p,{id:r.descriptionId,...o,ref:t})});xn.displayName=gn;var vn="DialogClose",bn=u.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=K(vn,n);return i.jsx(M.button,{type:"button",...o,ref:t,onClick:$(e.onClick,()=>r.onOpenChange(!1))})});bn.displayName=vn;function it(e){return e?"open":"closed"}var yn="DialogTitleWarning",[Sa,wn]=Fo(yn,{contentName:ie,titleName:st,docsSlug:"dialog"}),Br=({titleId:e})=>{const t=wn(yn),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
62
+
63
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
64
+
65
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return u.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},zr="DialogDescriptionWarning",Wr=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${wn(zr).contentName}}.`;return u.useEffect(()=>{var s;const r=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Cn=cn,En=un,jn=fn,Rn=pn,Pn=mn,An=xn,On=bn;function Vr({...e}){return i.jsx(Cn,{"data-slot":"dialog",...e})}function Ur({...e}){return i.jsx(En,{"data-slot":"dialog-portal",...e})}function Gr({className:e,...t}){return i.jsx(jn,{"data-slot":"dialog-overlay",className:A("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",e),...t})}function Kr({className:e,children:t,...n}){return i.jsxs(Ur,{"data-slot":"dialog-portal",children:[i.jsx(Gr,{}),i.jsxs(Rn,{"data-slot":"dialog-content",className:A("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",e),...n,children:[t,i.jsxs(On,{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:[i.jsx(tn,{}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Yr({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-header",className:A("flex flex-col gap-2 text-center sm:text-left",e),...t})}function qr({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-footer",className:A("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Xr({className:e,...t}){return i.jsx(Pn,{"data-slot":"dialog-title",className:A("text-lg leading-none font-semibold",e),...t})}function Zr({className:e,...t}){return i.jsx(An,{"data-slot":"dialog-description",className:A("text-muted-foreground text-sm",e),...t})}const Qr="#181717",Jr=u.forwardRef(function({title:t="GitHub",color:n="currentColor",size:o=24,...r},s){return n==="default"&&(n=Qr),i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o,height:o,fill:n,viewBox:"0 0 24 24",ref:s,...r,children:[i.jsx("title",{children:t}),i.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"})]})}),es="#85EA2D",ts=u.forwardRef(function({title:t="Swagger",color:n="currentColor",size:o=24,...r},s){return n==="default"&&(n=es),i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:o,height:o,fill:n,viewBox:"0 0 24 24",ref:s,...r,children:[i.jsx("title",{children:t}),i.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 ns({isOpen:e,setOpen:t}){return i.jsx(Vr,{open:e,onOpenChange:n=>t(n),children:i.jsxs(Kr,{children:[i.jsxs(Yr,{children:[i.jsx(Xr,{children:"Editorial"}),i.jsx(Zr,{children:"A simple CMS for static websites"})]}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx(Ge,{asChild:!0,variant:"ghost",children:i.jsxs(ce,{to:new URL("/doc",Jt.EDITORIAL_API_URL).href,children:[i.jsx(ts,{size:14}),"Swagger API UI"]})}),i.jsx(Ge,{asChild:!0,variant:"ghost",children:i.jsxs(ce,{to:"https://github.com/Lobelia-Earth/editorial",children:[i.jsx(Jr,{size:14}),"GitHub repository"]})})]}),i.jsx(qr,{children:i.jsxs("p",{className:"flex items-center gap-1",children:["Created with",i.jsx(lr,{size:14,className:"stroke-red-500 fill-red-500"})," by"," ",i.jsx(ce,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}var os="Separator",It="horizontal",rs=["horizontal","vertical"],Nn=u.forwardRef((e,t)=>{const{decorative:n,orientation:o=It,...r}=e,s=ss(o)?o:It,c=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return i.jsx(M.div,{"data-orientation":s,...c,...r,ref:t})});Nn.displayName=os;function ss(e){return rs.includes(e)}var is=Nn;function as({className:e,orientation:t="horizontal",decorative:n=!0,...o}){return i.jsx(is,{"data-slot":"separator-root",decorative:n,orientation:t,className:A("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...o})}function cs({...e}){return i.jsx(Cn,{"data-slot":"sheet",...e})}function ls({...e}){return i.jsx(En,{"data-slot":"sheet-portal",...e})}function ds({className:e,...t}){return i.jsx(jn,{"data-slot":"sheet-overlay",className:A("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",e),...t})}function us({className:e,children:t,side:n="right",...o}){return i.jsxs(ls,{children:[i.jsx(ds,{}),i.jsxs(Rn,{"data-slot":"sheet-content",className:A("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",e),...o,children:[t,i.jsxs(On,{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:[i.jsx(tn,{className:"size-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function fs({className:e,...t}){return i.jsx("div",{"data-slot":"sheet-header",className:A("flex flex-col gap-1.5 p-4",e),...t})}function ps({className:e,...t}){return i.jsx(Pn,{"data-slot":"sheet-title",className:A("text-foreground font-semibold",e),...t})}function hs({className:e,...t}){return i.jsx(An,{"data-slot":"sheet-description",className:A("text-muted-foreground text-sm",e),...t})}const ms=["top","right","bottom","left"],ne=Math.min,H=Math.max,Ne=Math.round,je=Math.floor,X=e=>({x:e,y:e}),gs={left:"right",right:"left",bottom:"top",top:"bottom"},xs={start:"end",end:"start"};function Ye(e,t,n){return H(e,ne(t,n))}function J(e,t){return typeof e=="function"?e(t):e}function ee(e){return e.split("-")[0]}function pe(e){return e.split("-")[1]}function at(e){return e==="x"?"y":"x"}function ct(e){return e==="y"?"height":"width"}function oe(e){return["top","bottom"].includes(ee(e))?"y":"x"}function lt(e){return at(oe(e))}function vs(e,t,n){n===void 0&&(n=!1);const o=pe(e),r=lt(e),s=ct(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Te(a)),[a,Te(a)]}function bs(e){const t=Te(e);return[qe(e),t,qe(t)]}function qe(e){return e.replace(/start|end/g,t=>xs[t])}function ys(e,t,n){const o=["left","right"],r=["right","left"],s=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?s:a;default:return[]}}function ws(e,t,n,o){const r=pe(e);let s=ys(ee(e),n==="start",o);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(qe)))),s}function Te(e){return e.replace(/left|right|bottom|top/g,t=>gs[t])}function Cs(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tn(e){return typeof e!="number"?Cs(e):{top:e,right:e,bottom:e,left:e}}function De(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Ft(e,t,n){let{reference:o,floating:r}=e;const s=oe(t),a=lt(t),c=ct(a),l=ee(t),d=s==="y",f=o.x+o.width/2-r.width/2,h=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let p;switch(l){case"top":p={x:f,y:o.y-r.height};break;case"bottom":p={x:f,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:h};break;case"left":p={x:o.x-r.width,y:h};break;default:p={x:o.x,y:o.y}}switch(pe(t)){case"start":p[a]-=g*(n&&d?-1:1);break;case"end":p[a]+=g*(n&&d?-1:1);break}return p}const Es=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,c=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:h}=Ft(d,o,l),g=o,p={},v=0;for(let m=0;m<c.length;m++){const{name:y,fn:x}=c[m],{x:b,y:w,data:C,reset:E}=await x({x:f,y:h,initialPlacement:o,placement:g,strategy:r,middlewareData:p,rects:d,platform:a,elements:{reference:e,floating:t}});f=b??f,h=w??h,p={...p,[y]:{...p[y],...C}},E&&v<=50&&(v++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(d=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):E.rects),{x:f,y:h}=Ft(d,g,l)),m=-1)}return{x:f,y:h,placement:g,strategy:r,middlewareData:p}};async function ve(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:a,elements:c,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:g=!1,padding:p=0}=J(t,e),v=Tn(p),y=c[g?h==="floating"?"reference":"floating":h],x=De(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:f,strategy:l})),b=h==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),C=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},E=De(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:w,strategy:l}):b);return{top:(x.top-E.top+v.top)/C.y,bottom:(E.bottom-x.bottom+v.bottom)/C.y,left:(x.left-E.left+v.left)/C.x,right:(E.right-x.right+v.right)/C.x}}const js=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:a,elements:c,middlewareData:l}=t,{element:d,padding:f=0}=J(e,t)||{};if(d==null)return{};const h=Tn(f),g={x:n,y:o},p=lt(r),v=ct(p),m=await a.getDimensions(d),y=p==="y",x=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",C=s.reference[v]+s.reference[p]-g[p]-s.floating[v],E=g[p]-s.reference[p],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let j=R?R[w]:0;(!j||!await(a.isElement==null?void 0:a.isElement(R)))&&(j=c.floating[w]||s.floating[v]);const O=C/2-E/2,L=j/2-m[v]/2-1,N=ne(h[x],L),I=ne(h[b],L),F=N,D=j-m[v]-I,T=j/2-m[v]/2+O,z=Ye(F,T,D),S=!l.arrow&&pe(r)!=null&&T!==z&&s.reference[v]/2-(T<F?N:I)-m[v]/2<0,_=S?T<F?T-F:T-D:0;return{[p]:g[p]+_,data:{[p]:z,centerOffset:T-z-_,...S&&{alignmentOffset:_}},reset:S}}}),Rs=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:a,initialPlacement:c,platform:l,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...y}=J(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=ee(r),b=oe(c),w=ee(c)===c,C=await(l.isRTL==null?void 0:l.isRTL(d.floating)),E=g||(w||!m?[Te(c)]:bs(c)),R=v!=="none";!g&&R&&E.push(...ws(c,m,v,C));const j=[c,...E],O=await ve(t,y),L=[];let N=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&L.push(O[x]),h){const T=vs(r,a,C);L.push(O[T[0]],O[T[1]])}if(N=[...N,{placement:r,overflows:L}],!L.every(T=>T<=0)){var I,F;const T=(((I=s.flip)==null?void 0:I.index)||0)+1,z=j[T];if(z)return{data:{index:T,overflows:N},reset:{placement:z}};let S=(F=N.filter(_=>_.overflows[0]<=0).sort((_,P)=>_.overflows[1]-P.overflows[1])[0])==null?void 0:F.placement;if(!S)switch(p){case"bestFit":{var D;const _=(D=N.filter(P=>{if(R){const k=oe(P.placement);return k===b||k==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(k=>k>0).reduce((k,Y)=>k+Y,0)]).sort((P,k)=>P[1]-k[1])[0])==null?void 0:D[0];_&&(S=_);break}case"initialPlacement":S=c;break}if(r!==S)return{reset:{placement:S}}}return{}}}};function $t(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ht(e){return ms.some(t=>e[t]>=0)}const Ps=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=J(e,t);switch(o){case"referenceHidden":{const s=await ve(t,{...r,elementContext:"reference"}),a=$t(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ht(a)}}}case"escaped":{const s=await ve(t,{...r,altBoundary:!0}),a=$t(s,n.floating);return{data:{escapedOffsets:a,escaped:Ht(a)}}}default:return{}}}}};async function As(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=ee(n),c=pe(n),l=oe(n)==="y",d=["left","top"].includes(a)?-1:1,f=s&&l?-1:1,h=J(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof v=="number"&&(p=c==="end"?v*-1:v),l?{x:p*f,y:g*d}:{x:g*d,y:p*f}}const Os=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:a,middlewareData:c}=t,l=await As(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:a}}}}},Ns=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...l}=J(e,t),d={x:n,y:o},f=await ve(t,l),h=oe(ee(r)),g=at(h);let p=d[g],v=d[h];if(s){const y=g==="y"?"top":"left",x=g==="y"?"bottom":"right",b=p+f[y],w=p-f[x];p=Ye(b,p,w)}if(a){const y=h==="y"?"top":"left",x=h==="y"?"bottom":"right",b=v+f[y],w=v-f[x];v=Ye(b,v,w)}const m=c.fn({...t,[g]:p,[h]:v});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[g]:s,[h]:a}}}}}},Ts=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:a}=t,{offset:c=0,mainAxis:l=!0,crossAxis:d=!0}=J(e,t),f={x:n,y:o},h=oe(r),g=at(h);let p=f[g],v=f[h];const m=J(c,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const w=g==="y"?"height":"width",C=s.reference[g]-s.floating[w]+y.mainAxis,E=s.reference[g]+s.reference[w]-y.mainAxis;p<C?p=C:p>E&&(p=E)}if(d){var x,b;const w=g==="y"?"width":"height",C=["top","left"].includes(ee(r)),E=s.reference[h]-s.floating[w]+(C&&((x=a.offset)==null?void 0:x[h])||0)+(C?0:y.crossAxis),R=s.reference[h]+s.reference[w]+(C?0:((b=a.offset)==null?void 0:b[h])||0)-(C?y.crossAxis:0);v<E?v=E:v>R&&(v=R)}return{[g]:p,[h]:v}}}},Ds=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:a,elements:c}=t,{apply:l=()=>{},...d}=J(e,t),f=await ve(t,d),h=ee(r),g=pe(r),p=oe(r)==="y",{width:v,height:m}=s.floating;let y,x;h==="top"||h==="bottom"?(y=h,x=g===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(x=h,y=g==="end"?"top":"bottom");const b=m-f.top-f.bottom,w=v-f.left-f.right,C=ne(m-f[y],b),E=ne(v-f[x],w),R=!t.middlewareData.shift;let j=C,O=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(j=b),R&&!g){const N=H(f.left,0),I=H(f.right,0),F=H(f.top,0),D=H(f.bottom,0);p?O=v-2*(N!==0||I!==0?N+I:H(f.left,f.right)):j=m-2*(F!==0||D!==0?F+D:H(f.top,f.bottom))}await l({...t,availableWidth:O,availableHeight:j});const L=await a.getDimensions(c.floating);return v!==L.width||m!==L.height?{reset:{rects:!0}}:{}}}};function Me(){return typeof window<"u"}function he(e){return Dn(e)?(e.nodeName||"").toLowerCase():"#document"}function B(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Q(e){var t;return(t=(Dn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Dn(e){return Me()?e instanceof Node||e instanceof B(e).Node:!1}function V(e){return Me()?e instanceof Element||e instanceof B(e).Element:!1}function Z(e){return Me()?e instanceof HTMLElement||e instanceof B(e).HTMLElement:!1}function Bt(e){return!Me()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof B(e).ShadowRoot}function ye(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=U(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function Ss(e){return["table","td","th"].includes(he(e))}function Le(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function dt(e){const t=ut(),n=V(e)?U(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function _s(e){let t=re(e);for(;Z(t)&&!de(t);){if(dt(t))return t;if(Le(t))return null;t=re(t)}return null}function ut(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function de(e){return["html","body","#document"].includes(he(e))}function U(e){return B(e).getComputedStyle(e)}function ke(e){return V(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function re(e){if(he(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Bt(e)&&e.host||Q(e);return Bt(t)?t.host:t}function Sn(e){const t=re(e);return de(t)?e.ownerDocument?e.ownerDocument.body:e.body:Z(t)&&ye(t)?t:Sn(t)}function be(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Sn(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),a=B(r);if(s){const c=Xe(a);return t.concat(a,a.visualViewport||[],ye(r)?r:[],c&&n?be(c):[])}return t.concat(r,be(r,[],n))}function Xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _n(e){const t=U(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Z(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:o,c=Ne(n)!==s||Ne(o)!==a;return c&&(n=s,o=a),{width:n,height:o,$:c}}function ft(e){return V(e)?e:e.contextElement}function le(e){const t=ft(e);if(!Z(t))return X(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=_n(t);let a=(s?Ne(n.width):n.width)/o,c=(s?Ne(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Ms=X(0);function Mn(e){const t=B(e);return!ut()||!t.visualViewport?Ms:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ls(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==B(e)?!1:t}function ae(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=ft(e);let a=X(1);t&&(o?V(o)&&(a=le(o)):a=le(e));const c=Ls(s,n,o)?Mn(s):X(0);let l=(r.left+c.x)/a.x,d=(r.top+c.y)/a.y,f=r.width/a.x,h=r.height/a.y;if(s){const g=B(s),p=o&&V(o)?B(o):o;let v=g,m=Xe(v);for(;m&&o&&p!==v;){const y=le(m),x=m.getBoundingClientRect(),b=U(m),w=x.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,C=x.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,d*=y.y,f*=y.x,h*=y.y,l+=w,d+=C,v=B(m),m=Xe(v)}}return De({width:f,height:h,x:l,y:d})}function pt(e,t){const n=ke(e).scrollLeft;return t?t.left+n:ae(Q(e)).left+n}function Ln(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-(n?0:pt(e,o)),s=o.top+t.scrollTop;return{x:r,y:s}}function ks(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",a=Q(o),c=t?Le(t.floating):!1;if(o===a||c&&s)return n;let l={scrollLeft:0,scrollTop:0},d=X(1);const f=X(0),h=Z(o);if((h||!h&&!s)&&((he(o)!=="body"||ye(a))&&(l=ke(o)),Z(o))){const p=ae(o);d=le(o),f.x=p.x+o.clientLeft,f.y=p.y+o.clientTop}const g=a&&!h&&!s?Ln(a,l,!0):X(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+f.x+g.x,y:n.y*d.y-l.scrollTop*d.y+f.y+g.y}}function Is(e){return Array.from(e.getClientRects())}function Fs(e){const t=Q(e),n=ke(e),o=e.ownerDocument.body,r=H(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=H(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+pt(e);const c=-n.scrollTop;return U(o).direction==="rtl"&&(a+=H(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:a,y:c}}function $s(e,t){const n=B(e),o=Q(e),r=n.visualViewport;let s=o.clientWidth,a=o.clientHeight,c=0,l=0;if(r){s=r.width,a=r.height;const d=ut();(!d||d&&t==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}return{width:s,height:a,x:c,y:l}}function Hs(e,t){const n=ae(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Z(e)?le(e):X(1),a=e.clientWidth*s.x,c=e.clientHeight*s.y,l=r*s.x,d=o*s.y;return{width:a,height:c,x:l,y:d}}function zt(e,t,n){let o;if(t==="viewport")o=$s(e,n);else if(t==="document")o=Fs(Q(e));else if(V(t))o=Hs(t,n);else{const r=Mn(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return De(o)}function kn(e,t){const n=re(e);return n===t||!V(n)||de(n)?!1:U(n).position==="fixed"||kn(n,t)}function Bs(e,t){const n=t.get(e);if(n)return n;let o=be(e,[],!1).filter(c=>V(c)&&he(c)!=="body"),r=null;const s=U(e).position==="fixed";let a=s?re(e):e;for(;V(a)&&!de(a);){const c=U(a),l=dt(a);!l&&c.position==="fixed"&&(r=null),(s?!l&&!r:!l&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||ye(a)&&!l&&kn(e,a))?o=o.filter(f=>f!==a):r=c,a=re(a)}return t.set(e,o),o}function zs(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?Le(t)?[]:Bs(t,this._c):[].concat(n),o],c=a[0],l=a.reduce((d,f)=>{const h=zt(t,f,r);return d.top=H(h.top,d.top),d.right=ne(h.right,d.right),d.bottom=ne(h.bottom,d.bottom),d.left=H(h.left,d.left),d},zt(t,c,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ws(e){const{width:t,height:n}=_n(e);return{width:t,height:n}}function Vs(e,t,n){const o=Z(t),r=Q(t),s=n==="fixed",a=ae(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=X(0);if(o||!o&&!s)if((he(t)!=="body"||ye(r))&&(c=ke(t)),o){const g=ae(t,!0,s,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else r&&(l.x=pt(r));const d=r&&!o&&!s?Ln(r,c):X(0),f=a.left+c.scrollLeft-l.x-d.x,h=a.top+c.scrollTop-l.y-d.y;return{x:f,y:h,width:a.width,height:a.height}}function ze(e){return U(e).position==="static"}function Wt(e,t){if(!Z(e)||U(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Q(e)===n&&(n=n.ownerDocument.body),n}function In(e,t){const n=B(e);if(Le(e))return n;if(!Z(e)){let r=re(e);for(;r&&!de(r);){if(V(r)&&!ze(r))return r;r=re(r)}return n}let o=Wt(e,t);for(;o&&Ss(o)&&ze(o);)o=Wt(o,t);return o&&de(o)&&ze(o)&&!dt(o)?n:o||_s(e)||n}const Us=async function(e){const t=this.getOffsetParent||In,n=this.getDimensions,o=await n(e.floating);return{reference:Vs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Gs(e){return U(e).direction==="rtl"}const Ks={convertOffsetParentRelativeRectToViewportRelativeRect:ks,getDocumentElement:Q,getClippingRect:zs,getOffsetParent:In,getElementRects:Us,getClientRects:Is,getDimensions:Ws,getScale:le,isElement:V,isRTL:Gs};function Fn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ys(e,t){let n=null,o;const r=Q(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function a(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const d=e.getBoundingClientRect(),{left:f,top:h,width:g,height:p}=d;if(c||t(),!g||!p)return;const v=je(h),m=je(r.clientWidth-(f+g)),y=je(r.clientHeight-(h+p)),x=je(f),w={rootMargin:-v+"px "+-m+"px "+-y+"px "+-x+"px",threshold:H(0,ne(1,l))||1};let C=!0;function E(R){const j=R[0].intersectionRatio;if(j!==l){if(!C)return a();j?a(!1,j):o=setTimeout(()=>{a(!1,1e-7)},1e3)}j===1&&!Fn(d,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(E,{...w,root:r.ownerDocument})}catch{n=new IntersectionObserver(E,w)}n.observe(e)}return a(!0),s}function qs(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,d=ft(e),f=r||s?[...d?be(d):[],...be(t)]:[];f.forEach(x=>{r&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const h=d&&c?Ys(d,n):null;let g=-1,p=null;a&&(p=new ResizeObserver(x=>{let[b]=x;b&&b.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),d&&!l&&p.observe(d),p.observe(t));let v,m=l?ae(e):null;l&&y();function y(){const x=ae(e);m&&!Fn(m,x)&&n(),m=x,v=requestAnimationFrame(y)}return n(),()=>{var x;f.forEach(b=>{r&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),h==null||h(),(x=p)==null||x.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const Xs=Os,Zs=Ns,Qs=Rs,Js=Ds,ei=Ps,Vt=js,ti=Ts,ni=(e,t,n)=>{const o=new Map,r={platform:Ks,...n},s={...r.platform,_c:o};return Es(e,t,{...r,platform:s})};var Pe=typeof document<"u"?u.useLayoutEffect:u.useEffect;function Se(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Se(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Se(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function $n(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ut(e,t){const n=$n(e);return Math.round(t*n)/n}function We(e){const t=u.useRef(e);return Pe(()=>{t.current=e}),t}function oi(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:l,open:d}=e,[f,h]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=u.useState(o);Se(g,o)||p(o);const[v,m]=u.useState(null),[y,x]=u.useState(null),b=u.useCallback(P=>{P!==R.current&&(R.current=P,m(P))},[]),w=u.useCallback(P=>{P!==j.current&&(j.current=P,x(P))},[]),C=s||v,E=a||y,R=u.useRef(null),j=u.useRef(null),O=u.useRef(f),L=l!=null,N=We(l),I=We(r),F=We(d),D=u.useCallback(()=>{if(!R.current||!j.current)return;const P={placement:t,strategy:n,middleware:g};I.current&&(P.platform=I.current),ni(R.current,j.current,P).then(k=>{const Y={...k,isPositioned:F.current!==!1};T.current&&!Se(O.current,Y)&&(O.current=Y,qo.flushSync(()=>{h(Y)}))})},[g,t,n,I,F]);Pe(()=>{d===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,h(P=>({...P,isPositioned:!1})))},[d]);const T=u.useRef(!1);Pe(()=>(T.current=!0,()=>{T.current=!1}),[]),Pe(()=>{if(C&&(R.current=C),E&&(j.current=E),C&&E){if(N.current)return N.current(C,E,D);D()}},[C,E,D,N,L]);const z=u.useMemo(()=>({reference:R,floating:j,setReference:b,setFloating:w}),[b,w]),S=u.useMemo(()=>({reference:C,floating:E}),[C,E]),_=u.useMemo(()=>{const P={position:n,left:0,top:0};if(!S.floating)return P;const k=Ut(S.floating,f.x),Y=Ut(S.floating,f.y);return c?{...P,transform:"translate("+k+"px, "+Y+"px)",...$n(S.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:Y}},[n,c,S.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:D,refs:z,elements:S,floatingStyles:_}),[f,D,z,S,_])}const ri=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Vt({element:o.current,padding:r}).fn(n):{}:o?Vt({element:o,padding:r}).fn(n):{}}}},si=(e,t)=>({...Xs(e),options:[e,t]}),ii=(e,t)=>({...Zs(e),options:[e,t]}),ai=(e,t)=>({...ti(e),options:[e,t]}),ci=(e,t)=>({...Qs(e),options:[e,t]}),li=(e,t)=>({...Js(e),options:[e,t]}),di=(e,t)=>({...ei(e),options:[e,t]}),ui=(e,t)=>({...ri(e),options:[e,t]});var fi="Arrow",Hn=u.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return i.jsx(M.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});Hn.displayName=fi;var pi=Hn,ht="Popper",[Bn,zn]=_e(ht),[hi,Wn]=Bn(ht),Vn=e=>{const{__scopePopper:t,children:n}=e,[o,r]=u.useState(null);return i.jsx(hi,{scope:t,anchor:o,onAnchorChange:r,children:n})};Vn.displayName=ht;var Un="PopperAnchor",Gn=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Wn(Un,n),a=u.useRef(null),c=G(t,a);return u.useEffect(()=>{s.onAnchorChange((o==null?void 0:o.current)||a.current)}),o?null:i.jsx(M.div,{...r,ref:c})});Gn.displayName=Un;var mt="PopperContent",[mi,gi]=Bn(mt),Kn=u.forwardRef((e,t)=>{var Et,jt,Rt,Pt,At,Ot;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:p="optimized",onPlaced:v,...m}=e,y=Wn(mt,n),[x,b]=u.useState(null),w=G(t,me=>b(me)),[C,E]=u.useState(null),R=$o(C),j=(R==null?void 0:R.width)??0,O=(R==null?void 0:R.height)??0,L=o+(s!=="center"?"-"+s:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},I=Array.isArray(d)?d:[d],F=I.length>0,D={padding:N,boundary:I.filter(vi),altBoundary:F},{refs:T,floatingStyles:z,placement:S,isPositioned:_,middlewareData:P}=oi({strategy:"fixed",placement:L,whileElementsMounted:(...me)=>qs(...me,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[si({mainAxis:r+O,alignmentAxis:a}),l&&ii({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?ai():void 0,...D}),l&&ci({...D}),li({...D,apply:({elements:me,rects:Nt,availableWidth:bo,availableHeight:yo})=>{const{width:wo,height:Co}=Nt.reference,Ee=me.floating.style;Ee.setProperty("--radix-popper-available-width",`${bo}px`),Ee.setProperty("--radix-popper-available-height",`${yo}px`),Ee.setProperty("--radix-popper-anchor-width",`${wo}px`),Ee.setProperty("--radix-popper-anchor-height",`${Co}px`)}}),C&&ui({element:C,padding:c}),bi({arrowWidth:j,arrowHeight:O}),g&&di({strategy:"referenceHidden",...D})]}),[k,Y]=Xn(S),Ce=xe(v);Ae(()=>{_&&(Ce==null||Ce())},[_,Ce]);const ho=(Et=P.arrow)==null?void 0:Et.x,mo=(jt=P.arrow)==null?void 0:jt.y,go=((Rt=P.arrow)==null?void 0:Rt.centerOffset)!==0,[xo,vo]=u.useState();return Ae(()=>{x&&vo(window.getComputedStyle(x).zIndex)},[x]),i.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:_?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xo,"--radix-popper-transform-origin":[(Pt=P.transformOrigin)==null?void 0:Pt.x,(At=P.transformOrigin)==null?void 0:At.y].join(" "),...((Ot=P.hide)==null?void 0:Ot.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(mi,{scope:n,placedSide:k,onArrowChange:E,arrowX:ho,arrowY:mo,shouldHideArrow:go,children:i.jsx(M.div,{"data-side":k,"data-align":Y,...m,ref:w,style:{...m.style,animation:_?void 0:"none"}})})})});Kn.displayName=mt;var Yn="PopperArrow",xi={top:"bottom",right:"left",bottom:"top",left:"right"},qn=u.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=gi(Yn,o),a=xi[s.placedSide];return i.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:i.jsx(pi,{...r,ref:n,style:{...r.style,display:"block"}})})});qn.displayName=Yn;function vi(e){return e!==null}var bi=e=>({name:"transformOrigin",options:e,fn(t){var y,x,b;const{placement:n,rects:o,middlewareData:r}=t,a=((y=r.arrow)==null?void 0:y.centerOffset)!==0,c=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[d,f]=Xn(n),h={start:"0%",center:"50%",end:"100%"}[f],g=(((x=r.arrow)==null?void 0:x.x)??0)+c/2,p=(((b=r.arrow)==null?void 0:b.y)??0)+l/2;let v="",m="";return d==="bottom"?(v=a?h:`${g}px`,m=`${-l}px`):d==="top"?(v=a?h:`${g}px`,m=`${o.floating.height+l}px`):d==="right"?(v=`${-l}px`,m=a?h:`${p}px`):d==="left"&&(v=`${o.floating.width+l}px`,m=a?h:`${p}px`),{data:{x:v,y:m}}}});function Xn(e){const[t,n="center"]=e.split("-");return[t,n]}var yi=Vn,wi=Gn,Ci=Kn,Ei=qn,ji="VisuallyHidden",Zn=u.forwardRef((e,t)=>i.jsx(M.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Zn.displayName=ji;var Ri=Zn,[Ie,_a]=_e("Tooltip",[zn]),Fe=zn(),Qn="TooltipProvider",Pi=700,Ze="tooltip.open",[Ai,gt]=Ie(Qn),Jn=e=>{const{__scopeTooltip:t,delayDuration:n=Pi,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:s}=e,a=u.useRef(!0),c=u.useRef(!1),l=u.useRef(0);return u.useEffect(()=>{const d=l.current;return()=>window.clearTimeout(d)},[]),i.jsx(Ai,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:u.useCallback(d=>{c.current=d},[]),disableHoverableContent:r,children:s})};Jn.displayName=Qn;var $e="Tooltip",[Oi,we]=Ie($e),eo=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r=!1,onOpenChange:s,disableHoverableContent:a,delayDuration:c}=e,l=gt($e,e.__scopeTooltip),d=Fe(t),[f,h]=u.useState(null),g=ge(),p=u.useRef(0),v=a??l.disableHoverableContent,m=c??l.delayDuration,y=u.useRef(!1),[x=!1,b]=Je({prop:o,defaultProp:r,onChange:j=>{j?(l.onOpen(),document.dispatchEvent(new CustomEvent(Ze))):l.onClose(),s==null||s(j)}}),w=u.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),C=u.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y.current=!1,b(!0)},[b]),E=u.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b(!1)},[b]),R=u.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,b(!0),p.current=0},m)},[m,b]);return u.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),i.jsx(yi,{...d,children:i.jsx(Oi,{scope:t,contentId:g,open:x,stateAttribute:w,trigger:f,onTriggerChange:h,onTriggerEnter:u.useCallback(()=>{l.isOpenDelayedRef.current?R():C()},[l.isOpenDelayedRef,R,C]),onTriggerLeave:u.useCallback(()=>{v?E():(window.clearTimeout(p.current),p.current=0)},[E,v]),onOpen:C,onClose:E,disableHoverableContent:v,children:n})})};eo.displayName=$e;var Qe="TooltipTrigger",to=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=we(Qe,n),s=gt(Qe,n),a=Fe(n),c=u.useRef(null),l=G(t,c,r.onTriggerChange),d=u.useRef(!1),f=u.useRef(!1),h=u.useCallback(()=>d.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),i.jsx(wi,{asChild:!0,...a,children:i.jsx(M.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:$(e.onPointerMove,g=>{g.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:$(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:$(e.onPointerDown,()=>{r.open&&r.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:$(e.onFocus,()=>{d.current||r.onOpen()}),onBlur:$(e.onBlur,r.onClose),onClick:$(e.onClick,r.onClose)})})});to.displayName=Qe;var xt="TooltipPortal",[Ni,Ti]=Ie(xt,{forceMount:void 0}),no=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,s=we(xt,t);return i.jsx(Ni,{scope:t,forceMount:n,children:i.jsx(fe,{present:n||s.open,children:i.jsx(nt,{asChild:!0,container:r,children:o})})})};no.displayName=xt;var ue="TooltipContent",oo=u.forwardRef((e,t)=>{const n=Ti(ue,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...s}=e,a=we(ue,e.__scopeTooltip);return i.jsx(fe,{present:o||a.open,children:a.disableHoverableContent?i.jsx(ro,{side:r,...s,ref:t}):i.jsx(Di,{side:r,...s,ref:t})})}),Di=u.forwardRef((e,t)=>{const n=we(ue,e.__scopeTooltip),o=gt(ue,e.__scopeTooltip),r=u.useRef(null),s=G(t,r),[a,c]=u.useState(null),{trigger:l,onClose:d}=n,f=r.current,{onPointerInTransitChange:h}=o,g=u.useCallback(()=>{c(null),h(!1)},[h]),p=u.useCallback((v,m)=>{const y=v.currentTarget,x={x:v.clientX,y:v.clientY},b=Li(x,y.getBoundingClientRect()),w=ki(x,b),C=Ii(m.getBoundingClientRect()),E=$i([...w,...C]);c(E),h(!0)},[h]);return u.useEffect(()=>()=>g(),[g]),u.useEffect(()=>{if(l&&f){const v=y=>p(y,f),m=y=>p(y,l);return l.addEventListener("pointerleave",v),f.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",m)}}},[l,f,p,g]),u.useEffect(()=>{if(a){const v=m=>{const y=m.target,x={x:m.clientX,y:m.clientY},b=(l==null?void 0:l.contains(y))||(f==null?void 0:f.contains(y)),w=!Fi(x,a);b?g():w&&(g(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,f,a,d,g]),i.jsx(ro,{...e,ref:s})}),[Si,_i]=Ie($e,{isInside:!1}),Mi=Bo("TooltipContent"),ro=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:a,...c}=e,l=we(ue,n),d=Fe(n),{onClose:f}=l;return u.useEffect(()=>(document.addEventListener(Ze,f),()=>document.removeEventListener(Ze,f)),[f]),u.useEffect(()=>{if(l.trigger){const h=g=>{const p=g.target;p!=null&&p.contains(l.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,f]),i.jsx(tt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:i.jsxs(Ci,{"data-state":l.stateAttribute,...d,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(Mi,{children:o}),i.jsx(Si,{scope:n,isInside:!0,children:i.jsx(Ri,{id:l.contentId,role:"tooltip",children:r||o})})]})})});oo.displayName=ue;var so="TooltipArrow",io=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Fe(n);return _i(so,n).isInside?null:i.jsx(Ei,{...r,...o,ref:t})});io.displayName=so;function Li(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,o,r,s)){case s:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function ki(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Ii(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Fi(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const c=t[s].x,l=t[s].y,d=t[a].x,f=t[a].y;l>o!=f>o&&n<(d-c)*(o-l)/(f-l)+c&&(r=!r)}return r}function $i(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),Hi(t)}function Hi(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Bi=Jn,zi=eo,Wi=to,Vi=no,Ui=oo,Gi=io;function ao({delayDuration:e=0,...t}){return i.jsx(Bi,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Ki({...e}){return i.jsx(ao,{children:i.jsx(zi,{"data-slot":"tooltip",...e})})}function Yi({...e}){return i.jsx(Wi,{"data-slot":"tooltip-trigger",...e})}function qi({className:e,sideOffset:t=0,children:n,...o}){return i.jsx(Vi,{children:i.jsxs(Ui,{"data-slot":"tooltip-content",sideOffset:t,className:A("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",e),...o,children:[n,i.jsx(Gi,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const Ve=768;function Xi(){const[e,t]=u.useState(void 0);return u.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Ve-1}px)`),o=()=>{t(window.innerWidth<Ve)};return n.addEventListener("change",o),t(window.innerWidth<Ve),()=>n.removeEventListener("change",o)},[]),!!e}const Zi="sidebar_state",Qi=60*60*24*7,Ji="16rem",ea="18rem",ta="3rem",na="b",co=u.createContext(null);function vt(){const e=u.useContext(co);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function oa({defaultOpen:e=!0,open:t,onOpenChange:n,className:o,style:r,children:s,...a}){const c=Xi(),[l,d]=u.useState(!1),[f,h]=u.useState(e),g=t??f,p=u.useCallback(x=>{const b=typeof x=="function"?x(g):x;n?n(b):h(b),document.cookie=`${Zi}=${b}; path=/; max-age=${Qi}`},[n,g]),v=u.useCallback(()=>c?d(x=>!x):p(x=>!x),[c,p,d]);u.useEffect(()=>{const x=b=>{b.key===na&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),v())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[v]);const m=g?"expanded":"collapsed",y=u.useMemo(()=>({state:m,open:g,setOpen:p,isMobile:c,openMobile:l,setOpenMobile:d,toggleSidebar:v}),[m,g,p,c,l,d,v]);return i.jsx(co.Provider,{value:y,children:i.jsx(ao,{delayDuration:0,children:i.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Ji,"--sidebar-width-icon":ta,...r},className:A("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",o),...a,children:s})})})}function ra({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:o,children:r,...s}){const{isMobile:a,state:c,openMobile:l,setOpenMobile:d}=vt();return n==="none"?i.jsx("div",{"data-slot":"sidebar",className:A("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),...s,children:r}):a?i.jsx(cs,{open:l,onOpenChange:d,...s,children:i.jsxs(us,{"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":ea},side:e,children:[i.jsxs(fs,{className:"sr-only",children:[i.jsx(ps,{children:"Sidebar"}),i.jsx(hs,{children:"Displays the mobile sidebar."})]}),i.jsx("div",{className:"flex h-full w-full flex-col",children:r})]})}):i.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":c,"data-collapsible":c==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[i.jsx("div",{"data-slot":"sidebar-gap",className:A("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),i.jsx("div",{"data-slot":"sidebar-container",className:A("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="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)]",t==="floating"||t==="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",o),...s,children:i.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:r})})]})}function sa({className:e,onClick:t,...n}){const{toggleSidebar:o}=vt();return i.jsxs(Ge,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:A("size-7",e),onClick:r=>{t==null||t(r),o()},...n,children:[i.jsx(pr,{}),i.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function ia({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:A("flex flex-col gap-2 p-2",e),...t})}function aa({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:A("flex flex-col gap-2 p-2",e),...t})}function ca({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:A("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function Re({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:A("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Gt({className:e,asChild:t=!1,...n}){const o=t?et:"div";return i.jsx(o,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:A("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",e),...n})}function Kt({className:e,...t}){return i.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:A("w-full text-sm",e),...t})}function Yt({className:e,...t}){return i.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:A("flex w-full min-w-0 flex-col gap-1",e),...t})}function se({className:e,...t}){return i.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:A("group/menu-item relative",e),...t})}const la=zo("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 q({asChild:e=!1,isActive:t=!1,variant:n="default",size:o="default",tooltip:r,className:s,...a}){const c=e?et:"button",{isMobile:l,state:d}=vt(),f=i.jsx(c,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":o,"data-active":t,className:A(la({variant:n,size:o}),s),...a});return r?(typeof r=="string"&&(r={children:r}),i.jsxs(Ki,{children:[i.jsx(Yi,{asChild:!0,children:f}),i.jsx(qi,{side:"right",align:"center",hidden:d!=="collapsed"||l,...r})]})):f}function da({className:e,...t}){return i.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:A("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",e),...t})}function ua({asChild:e=!1,size:t="md",isActive:n=!1,className:o,...r}){const s=e?et:"a";return i.jsx(s,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:A("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",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...r})}function qt({singleton:e}){const{data:t}=en(),{data:n}=Do();return t?i.jsx(i.Fragment,{children:Object.entries(t).filter(([,o])=>e?o.singleton:!o.singleton).map(([o,r])=>i.jsx(da,{children:i.jsx(jo,{to:e?`/admin/dashboard/${o}/default`:`/admin/dashboard/${o}`,className:({isActive:s,isPending:a})=>a?"pending":s?"active":"",children:({isActive:s})=>i.jsx(ua,{isActive:s,asChild:!0,children:i.jsxs("div",{children:[i.jsx("span",{className:"inline-block overflow-hidden whitespace-nowrap text-ellipsis text-nowrap w-full",children:r.displayName}),!e&&n&&i.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1",children:Object.keys(n[o]).length})]})})})},r.displayName))}):null}var bt="Collapsible",[fa,Ma]=_e(bt),[pa,yt]=fa(bt),lo=u.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:o,defaultOpen:r,disabled:s,onOpenChange:a,...c}=e,[l=!1,d]=Je({prop:o,defaultProp:r,onChange:a});return i.jsx(pa,{scope:n,disabled:s,contentId:ge(),open:l,onOpenToggle:u.useCallback(()=>d(f=>!f),[d]),children:i.jsx(M.div,{"data-state":Ct(l),"data-disabled":s?"":void 0,...c,ref:t})})});lo.displayName=bt;var uo="CollapsibleTrigger",fo=u.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,r=yt(uo,n);return i.jsx(M.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":Ct(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:t,onClick:$(e.onClick,r.onOpenToggle)})});fo.displayName=uo;var wt="CollapsibleContent",po=u.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=yt(wt,e.__scopeCollapsible);return i.jsx(fe,{present:n||r.open,children:({present:s})=>i.jsx(ha,{...o,ref:t,present:s})})});po.displayName=wt;var ha=u.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:o,children:r,...s}=e,a=yt(wt,n),[c,l]=u.useState(o),d=u.useRef(null),f=G(t,d),h=u.useRef(0),g=h.current,p=u.useRef(0),v=p.current,m=a.open||c,y=u.useRef(m),x=u.useRef(void 0);return u.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),Ae(()=>{const b=d.current;if(b){x.current=x.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();h.current=w.height,p.current=w.width,y.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),l(o)}},[a.open,o]),i.jsx(M.div,{"data-state":Ct(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m,...s,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:m&&r})});function Ct(e){return e?"open":"closed"}var ma=lo;function Xt({...e}){return i.jsx(ma,{"data-slot":"collapsible",...e})}function Zt({...e}){return i.jsx(fo,{"data-slot":"collapsible-trigger",...e})}function Qt({...e}){return i.jsx(po,{"data-slot":"collapsible-content",...e})}function ga(){const e=No(),[t,n]=u.useState(!1),[o]=So(),[r]=_o(),[s]=Mo(),{data:a}=Lo(),{data:c}=ko(),l=Ue(d=>d.auth.role);return i.jsxs(ra,{className:"z-50",children:[i.jsx(ns,{isOpen:t,setOpen:n}),i.jsx(ia,{className:"h-14 justify-center",children:i.jsx(Re,{children:i.jsx(ce,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:a==null?void 0:a.name})})}),i.jsxs(ca,{children:[i.jsxs(Re,{children:[i.jsx(Gt,{children:"Content"}),i.jsx(Kt,{children:i.jsxs(Yt,{children:[i.jsx(Xt,{className:"group/collapsible",children:i.jsxs(se,{children:[i.jsx(Zt,{asChild:!0,children:i.jsxs(q,{className:"group",children:[i.jsx(ar,{}),i.jsx("span",{children:"Collections"}),i.jsx(Tt,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),i.jsx(Qt,{children:i.jsx(qt,{})})]})}),i.jsx(Xt,{className:"group/collapsible",children:i.jsxs(se,{children:[i.jsx(Zt,{asChild:!0,children:i.jsxs(q,{className:"group",children:[i.jsx(mr,{}),i.jsx("span",{children:"Singles"}),i.jsx(Tt,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),i.jsx(Qt,{children:i.jsx(qt,{singleton:!0})})]})}),i.jsx(se,{children:i.jsx(q,{asChild:!0,children:i.jsxs(ce,{to:"/admin/dashboard/files",children:[i.jsx(sr,{}),i.jsx("span",{children:"Files"})]})})}),i.jsx(se,{children:i.jsxs(q,{disabled:!0,children:[i.jsx(tr,{}),i.jsx("span",{children:"Components"})]})})]})})]}),i.jsxs(Re,{children:[i.jsx(Gt,{children:"Actions"}),i.jsx(Kt,{children:i.jsxs(Yt,{children:[l==="developer"&&i.jsxs(i.Fragment,{children:[i.jsx(se,{children:i.jsxs(q,{className:"cursor-pointer",onClick:()=>r(),children:[i.jsx(Zo,{}),i.jsx("span",{children:"Pull from repo"})]})}),i.jsx(se,{children:i.jsxs(q,{className:"cursor-pointer",onClick:()=>s(),children:[i.jsx(Jo,{}),i.jsx("span",{children:"Push to repo"})]})})]}),i.jsx(se,{children:i.jsxs(q,{className:"cursor-pointer",onClick:()=>o(),children:[i.jsx(xr,{}),i.jsx("span",{children:"Publish"})]})})]})})]}),i.jsx(Re,{})]}),i.jsxs(aa,{children:[i.jsx(q,{asChild:!0,children:i.jsxs(ce,{to:Jt.PREVIEW_URL,children:["Preview",i.jsx(Ko,{className:"ml-auto"})]})}),i.jsx(q,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),i.jsxs(q,{className:"cursor-pointer",onClick:()=>e(To()),children:[i.jsx(ur,{}),"Log out"]})]})]})}function xa({children:e}){const t=Ro(),n=Ue(r=>r.auth.user),o=Ue(r=>r.auth.isLoading);return u.useEffect(()=>{!o&&!n&&t("/admin")},[o,t,n]),o||!n?null:e}function va(){const{pathname:e}=Po(),{data:t}=en(),n=e.split("/").filter(o=>!["admin","dashboard"].includes(o)&&o!=="");return t?i.jsx(i.Fragment,{children:n.map((o,r,s)=>i.jsxs(Ao.Fragment,{children:[s.length>1&&r>=1&&i.jsx(or,{size:12,className:"text-gray-500 pt-[1px]"}),i.jsx("p",{className:"text-sm leading-none tracking-tight capitalize text-gray-500 last:text-foreground",children:t[o]?t[o].displayName:o},o)]},r))}):null}const La=Eo(function(){return i.jsx(xa,{children:i.jsxs(oa,{className:"flex h-full",children:[i.jsx(ga,{}),i.jsxs("main",{className:"flex flex-col flex-1 h-full w-0",children:[i.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:i.jsxs("div",{className:"flex items-center gap-2 px-3",children:[i.jsx(sa,{}),i.jsx(as,{orientation:"vertical",className:"h-4"}),i.jsx(va,{})]})}),i.jsx(Oo,{})]})]})})});export{La as default};
@@ -0,0 +1,36 @@
1
+ import{c as j,w as u}from"./react-redux-D9l7ZD4q.js";import{l as e,r as v,q as g}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{e as N,i as k}from"./authSlice-5XZo_yNS.js";import{o as w,p as b}from"./editorialApi-CykQGjTu.js";import{c as z,b as _,a as F}from"./utils-BJX_0rcU.js";import{c as o}from"./createLucideIcon-TQsNVzYU.js";import{C as M}from"./chevron-down-BMtosYlL.js";import{T as r}from"./trash-B3lfbu-5.js";import"./tslib.es6-De9GV7Vy.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 $=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],n=o("copy",$);/**
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 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"}]],I=o("ellipsis",H);/**
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 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"}]],L=o("file-image",C);/**
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 T=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],E=o("file-text",T);/**
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 q=[["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"}]],D=o("file",q);/**
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 S=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],V=o("folder-open",S);/**
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 A=[["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",A),R=["txt","md","html","pdf"],Z=["svg","webp","png","jpeg","jpg"],O=[{Icon:L,test:s=>Z.some(i=>s.name.endsWith(i))},{Icon:E,test:s=>R.some(i=>s.name.endsWith(i))}],U={Icon:D},p=({node:s,level:i=0,onDelete:c})=>{const[a,d]=v.useState(!1),m=N(k),x=O.find(t=>t.test(s))??U,l=s.type==="directory",h=l?"div":g,f=()=>{l&&d(!a)};return e.jsxs("div",{className:"select-none",children:[e.jsxs(h,{to:`${j.EDITORIAL_API_URL}${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(M,{size:16,className:z("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(V,{size:16,className:"text-yellow-500"}):e.jsx(P,{size:16,className:"text-yellow-500"}):e.jsx(x.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?"--":_(s.size)})}),m==="developer"&&e.jsxs("div",{className:"flex items-center gap-1 ml-4 group-hover:visible invisible z-20",children:[e.jsxs("button",{className:F("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 W(){const{data:s,isLoading:i}=w(),[c]=b();return!s||i?null:s.toSorted(a=>a.type==="directory"?-1:1).map(a=>e.jsx(p,{node:a,onDelete:c},a.name))}const te=u(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(I,{size:14})]})]}),e.jsx(W,{})]})})})});export{te as default};
@@ -0,0 +1 @@
1
+ import{i as K,n as He,h as Ke,j as tt,k as Y,f as Te,S as ee,g as B,p as X,l as ue,m as be,o as W,q as Ee,r as nt,s as Se,t as fe,v as Re,x as We,y as rt,A as Be,B as st,C as we,D as it,E as ot,F as ut,e as ct,d as at,u as lt,G as te,c as dt}from"./react-redux-D9l7ZD4q.js";import{r as C}from"./chunk-KNED5TY2-CXj9yqcQ.js";function ft(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function pt(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function yt(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(a=>typeof a=="function")){const a=e.map(y=>typeof y=="function"?`function ${y.name||"unnamed"}()`:typeof y).join(", ");throw new TypeError(`${t}[${a}]`)}}var Ie=e=>Array.isArray(e)?e:[e];function gt(e){const t=Array.isArray(e[0])?e[0]:e;return yt(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ht(e,t){const a=[],{length:y}=e;for(let p=0;p<y;p++)a.push(e[p].apply(null,t));return a}var mt=class{constructor(e){this.value=e}deref(){return this.value}},vt=typeof WeakRef<"u"?WeakRef:mt,bt=0,Qe=1;function se(){return{s:bt,v:void 0,o:null,p:null}}function ce(e,t={}){let a=se();const{resultEqualityCheck:y}=t;let p,R=0;function b(){var A;let M=a;const{length:I}=arguments;for(let f=0,i=I;f<i;f++){const l=arguments[f];if(typeof l=="function"||typeof l=="object"&&l!==null){let r=M.o;r===null&&(M.o=r=new WeakMap);const d=r.get(l);d===void 0?(M=se(),r.set(l,M)):M=d}else{let r=M.p;r===null&&(M.p=r=new Map);const d=r.get(l);d===void 0?(M=se(),r.set(l,M)):M=d}}const O=M;let E;if(M.s===Qe)E=M.v;else if(E=e.apply(null,arguments),R++,y){const f=((A=p==null?void 0:p.deref)==null?void 0:A.call(p))??p;f!=null&&y(f,E)&&(E=f,R!==0&&R--),p=typeof E=="object"&&E!==null||typeof E=="function"?new vt(E):E}return O.s=Qe,O.v=E,E}return b.clearCache=()=>{a=se(),b.resetResultsCount()},b.resultsCount=()=>R,b.resetResultsCount=()=>{R=0},b}function St(e,...t){const a=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,y=(...p)=>{let R=0,b=0,M,I={},O=p.pop();typeof O=="object"&&(I=O,O=p.pop()),ft(O,`createSelector expects an output function after the inputs, but received: [${typeof O}]`);const E={...a,...I},{memoize:A,memoizeOptions:f=[],argsMemoize:i=ce,argsMemoizeOptions:l=[]}=E,r=Ie(f),d=Ie(l),q=gt(p),n=A(function(){return R++,O.apply(null,arguments)},...r),s=i(function(){b++;const S=ht(q,arguments);return M=n.apply(null,S),M},...d);return Object.assign(s,{resultFunc:O,memoizedResultFunc:n,dependencies:q,dependencyRecomputations:()=>b,resetDependencyRecomputations:()=>{b=0},lastResult:()=>M,recomputations:()=>R,resetRecomputations:()=>{R=0},memoize:A,argsMemoize:i})};return Object.assign(y,{withTypes:()=>y}),y}var qe=St(ce),Rt=Object.assign((e,t=qe)=>{pt(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const a=Object.keys(e),y=a.map(R=>e[R]);return t(y,(...R)=>R.reduce((b,M,I)=>(b[a[I]]=M,b),{}))},{withTypes:()=>Rt}),Ve=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Ve||{});function qt(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}var De=K;function Ge(e,t){if(e===t||!(De(e)&&De(t)||Array.isArray(e)&&Array.isArray(t)))return t;const a=Object.keys(t),y=Object.keys(e);let p=a.length===y.length;const R=Array.isArray(t)?[]:{};for(const b of a)R[b]=Ge(e[b],t[b]),p&&(p=e[b]===R[b]);return p?e:R}function J(e){let t=0;for(const a in e)t++;return t}var Ce=e=>[].concat(...e);function Ot(e){return new RegExp("(^|:)//").test(e)}function At(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function ae(e){return e!=null}function Mt(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Tt=e=>e.replace(/\/$/,""),Et=e=>e.replace(/^\//,"");function wt(e,t){if(!e)return t;if(!t)return e;if(Ot(t))return t;const a=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Tt(e),t=Et(t),`${e}${a}${t}`}function It(e,t,a){return e.has(t)?e.get(t):e.set(t,a).get(t)}var je=(...e)=>fetch(...e),Qt=e=>e.status>=200&&e.status<=299,Dt=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function ke(e){if(!K(e))return e;const t={...e};for(const[a,y]of Object.entries(t))y===void 0&&delete t[a];return t}function Ct({baseUrl:e,prepareHeaders:t=A=>A,fetchFn:a=je,paramsSerializer:y,isJsonContentType:p=Dt,jsonContentType:R="application/json",jsonReplacer:b,timeout:M,responseHandler:I,validateStatus:O,...E}={}){return typeof fetch>"u"&&a===je&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(f,i,l)=>{const{getState:r,extra:d,endpoint:q,forced:n,type:s}=i;let u,{url:S,headers:h=new Headers(E.headers),params:o=void 0,responseHandler:g=I??"json",validateStatus:m=O??Qt,timeout:c=M,...v}=typeof f=="string"?{url:f}:f,T,w=i.signal;c&&(T=new AbortController,i.signal.addEventListener("abort",T.abort),w=T.signal);let Q={...E,signal:w,...v};h=new Headers(ke(h)),Q.headers=await t(h,{getState:r,arg:f,extra:d,endpoint:q,forced:n,type:s,extraOptions:l})||h;const D=U=>typeof U=="object"&&(K(U)||Array.isArray(U)||typeof U.toJSON=="function");if(!Q.headers.has("content-type")&&D(Q.body)&&Q.headers.set("content-type",R),D(Q.body)&&p(Q.headers)&&(Q.body=JSON.stringify(Q.body,b)),o){const U=~S.indexOf("?")?"&":"?",H=y?y(o):new URLSearchParams(ke(o));S+=U+H}S=wt(e,S);const P=new Request(S,Q);u={request:new Request(S,Q)};let j,_=!1,k=T&&setTimeout(()=>{_=!0,T.abort()},c);try{j=await a(P)}catch(U){return{error:{status:_?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(U)},meta:u}}finally{k&&clearTimeout(k),T==null||T.signal.removeEventListener("abort",T.abort)}const L=j.clone();u.response=L;let $,z="";try{let U;if(await Promise.all([A(j,g).then(H=>$=H,H=>U=H),L.text().then(H=>z=H,()=>{})]),U)throw U}catch(U){return{error:{status:"PARSING_ERROR",originalStatus:j.status,data:z,error:String(U)},meta:u}}return m(j,$)?{data:$,meta:u}:{error:{status:j.status,data:$},meta:u}};async function A(f,i){if(typeof i=="function")return i(f);if(i==="content-type"&&(i=p(f.headers)?"json":"text"),i==="json"){const l=await f.text();return l.length?JSON.parse(l):null}return f.text()}}var Pe=class{constructor(e,t=void 0){this.value=e,this.meta=t}},le=Y("__rtkq/focused"),Oe=Y("__rtkq/unfocused"),de=Y("__rtkq/online"),Ae=Y("__rtkq/offline"),pe=!1;function hn(e,t){function a(){const y=()=>e(le()),p=()=>e(Oe()),R=()=>e(de()),b=()=>e(Ae()),M=()=>{window.document.visibilityState==="visible"?y():p()};return pe||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",M,!1),window.addEventListener("focus",y,!1),window.addEventListener("online",R,!1),window.addEventListener("offline",b,!1),pe=!0),()=>{window.removeEventListener("focus",y),window.removeEventListener("visibilitychange",M),window.removeEventListener("online",R),window.removeEventListener("offline",b),pe=!1}}return a()}function Je(e){return e.type==="query"}function jt(e){return e.type==="mutation"}function Me(e,t,a,y,p,R){return kt(e)?e(t,a,y,p).filter(ae).map(me).map(R):Array.isArray(e)?e.map(me).map(R):[]}function kt(e){return typeof e=="function"}function me(e){return typeof e=="string"?{type:e}:e}function Pt(e,t){return e.catch(t)}var ne=Symbol("forceQueryFn"),ve=e=>typeof e[ne]=="function";function Ft({serializeQueryArgs:e,queryThunk:t,mutationThunk:a,api:y,context:p}){const R=new Map,b=new Map,{unsubscribeQueryResult:M,removeMutationResult:I,updateSubscriptionOptions:O}=y.internalActions;return{buildInitiateQuery:l,buildInitiateMutation:r,getRunningQueryThunk:E,getRunningMutationThunk:A,getRunningQueriesThunk:f,getRunningMutationsThunk:i};function E(d,q){return n=>{var S;const s=p.endpointDefinitions[d],u=e({queryArgs:q,endpointDefinition:s,endpointName:d});return(S=R.get(n))==null?void 0:S[u]}}function A(d,q){return n=>{var s;return(s=b.get(n))==null?void 0:s[q]}}function f(){return d=>Object.values(R.get(d)||{}).filter(ae)}function i(){return d=>Object.values(b.get(d)||{}).filter(ae)}function l(d,q){const n=(s,{subscribe:u=!0,forceRefetch:S,subscriptionOptions:h,[ne]:o,...g}={})=>(m,c)=>{var $;const v=e({queryArgs:s,endpointDefinition:q,endpointName:d}),T=t({...g,type:"query",subscribe:u,forceRefetch:S,subscriptionOptions:h,endpointName:d,originalArgs:s,queryCacheKey:v,[ne]:o}),w=y.endpoints[d].select(s),Q=m(T),D=w(c()),{requestId:P,abort:F}=Q,j=D.requestId!==P,_=($=R.get(m))==null?void 0:$[v],k=()=>w(c()),L=Object.assign(o?Q.then(k):j&&!_?Promise.resolve(D):Promise.all([_,Q]).then(k),{arg:s,requestId:P,subscriptionOptions:h,queryCacheKey:v,abort:F,async unwrap(){const z=await L;if(z.isError)throw z.error;return z.data},refetch:()=>m(n(s,{subscribe:!1,forceRefetch:!0})),unsubscribe(){u&&m(M({queryCacheKey:v,requestId:P}))},updateSubscriptionOptions(z){L.subscriptionOptions=z,m(O({endpointName:d,requestId:P,queryCacheKey:v,options:z}))}});if(!_&&!j&&!o){const z=It(R,m,{});z[v]=L,L.then(()=>{delete z[v],J(z)||R.delete(m)})}return L};return n}function r(d){return(q,{track:n=!0,fixedCacheKey:s}={})=>(u,S)=>{const h=a({type:"mutation",endpointName:d,originalArgs:q,track:n,fixedCacheKey:s}),o=u(h),{requestId:g,abort:m,unwrap:c}=o,v=Pt(o.unwrap().then(D=>({data:D})),D=>({error:D})),T=()=>{u(I({requestId:g,fixedCacheKey:s}))},w=Object.assign(v,{arg:o.arg,requestId:g,abort:m,unwrap:c,reset:T}),Q=b.get(u)||{};return b.set(u,Q),Q[g]=w,w.then(()=>{delete Q[g],J(Q)||b.delete(u)}),s&&(Q[s]=w,w.then(()=>{Q[s]===w&&(delete Q[s],J(Q)||b.delete(u))})),w}}}function Fe(e){return e}function _t({reducerPath:e,baseQuery:t,context:{endpointDefinitions:a},serializeQueryArgs:y,api:p,assertTagType:R}){const b=(n,s,u,S)=>(h,o)=>{const g=a[n],m=y({queryArgs:s,endpointDefinition:g,endpointName:n});if(h(p.internalActions.queryResultPatched({queryCacheKey:m,patches:u})),!S)return;const c=p.endpoints[n].select(s)(o()),v=Me(g.providesTags,c.data,void 0,s,{},R);h(p.internalActions.updateProvidedBy({queryCacheKey:m,providedTags:v}))},M=(n,s,u,S=!0)=>(h,o)=>{const m=p.endpoints[n].select(s)(o()),c={patches:[],inversePatches:[],undo:()=>h(p.util.patchQueryData(n,s,c.inversePatches,S))};if(m.status==="uninitialized")return c;let v;if("data"in m)if(rt(m.data)){const[T,w,Q]=Be(m.data,u);c.patches.push(...w),c.inversePatches.push(...Q),v=T}else v=u(m.data),c.patches.push({op:"replace",path:[],value:v}),c.inversePatches.push({op:"replace",path:[],value:m.data});return c.patches.length===0||h(p.util.patchQueryData(n,s,c.patches,S)),c},I=(n,s,u)=>S=>S(p.endpoints[n].initiate(s,{subscribe:!1,forceRefetch:!0,[ne]:()=>({data:u})})),O=async(n,{signal:s,abort:u,rejectWithValue:S,fulfillWithValue:h,dispatch:o,getState:g,extra:m})=>{const c=a[n.endpointName];try{let v=Fe,T;const w={signal:s,abort:u,dispatch:o,getState:g,extra:m,endpoint:n.endpointName,type:n.type,forced:n.type==="query"?E(n,g()):void 0,queryCacheKey:n.type==="query"?n.queryCacheKey:void 0},Q=n.type==="query"?n[ne]:void 0;if(Q?T=Q():c.query?(T=await t(c.query(n.originalArgs),w,c.extraOptions),c.transformResponse&&(v=c.transformResponse)):T=await c.queryFn(n.originalArgs,w,c.extraOptions,D=>t(D,w,c.extraOptions)),typeof process<"u",T.error)throw new Pe(T.error,T.meta);return h(await v(T.data,T.meta,n.originalArgs),{fulfilledTimeStamp:Date.now(),baseQueryMeta:T.meta,[ee]:!0})}catch(v){let T=v;if(T instanceof Pe){let w=Fe;c.query&&c.transformErrorResponse&&(w=c.transformErrorResponse);try{return S(await w(T.value,T.meta,n.originalArgs),{baseQueryMeta:T.meta,[ee]:!0})}catch(Q){T=Q}}throw console.error(T),T}};function E(n,s){var g,m,c;const u=(m=(g=s[e])==null?void 0:g.queries)==null?void 0:m[n.queryCacheKey],S=(c=s[e])==null?void 0:c.config.refetchOnMountOrArgChange,h=u==null?void 0:u.fulfilledTimeStamp,o=n.forceRefetch??(n.subscribe&&S);return o?o===!0||(Number(new Date)-Number(h))/1e3>=o:!1}const A=Te(`${e}/executeQuery`,O,{getPendingMeta(){return{startedTimeStamp:Date.now(),[ee]:!0}},condition(n,{getState:s}){var c,v,T;const u=s(),S=(v=(c=u[e])==null?void 0:c.queries)==null?void 0:v[n.queryCacheKey],h=S==null?void 0:S.fulfilledTimeStamp,o=n.originalArgs,g=S==null?void 0:S.originalArgs,m=a[n.endpointName];return ve(n)?!0:(S==null?void 0:S.status)==="pending"?!1:E(n,u)||Je(m)&&((T=m==null?void 0:m.forceRefetch)!=null&&T.call(m,{currentArg:o,previousArg:g,endpointState:S,state:u}))?!0:!h},dispatchConditionRejection:!0}),f=Te(`${e}/executeMutation`,O,{getPendingMeta(){return{startedTimeStamp:Date.now(),[ee]:!0}}}),i=n=>"force"in n,l=n=>"ifOlderThan"in n,r=(n,s,u)=>(S,h)=>{const o=i(u)&&u.force,g=l(u)&&u.ifOlderThan,m=(v=!0)=>{const T={forceRefetch:v,isPrefetch:!0};return p.endpoints[n].initiate(s,T)},c=p.endpoints[n].select(s)(h());if(o)S(m());else if(g){const v=c==null?void 0:c.fulfilledTimeStamp;if(!v){S(m());return}(Number(new Date)-Number(new Date(v)))/1e3>=g&&S(m())}else S(m(!1))};function d(n){return s=>{var u,S;return((S=(u=s==null?void 0:s.meta)==null?void 0:u.arg)==null?void 0:S.endpointName)===n}}function q(n,s){return{matchPending:fe(We(n),d(s)),matchFulfilled:fe(W(n),d(s)),matchRejected:fe(Re(n),d(s))}}return{queryThunk:A,mutationThunk:f,prefetch:r,updateQueryData:M,upsertQueryData:I,patchQueryData:b,buildMatchThunkActions:q}}function Ye(e,t,a,y){return Me(a[e.meta.arg.endpointName][t],W(e)?e.payload:void 0,be(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,y)}function ie(e,t,a){const y=e[t];y&&a(y)}function re(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function _e(e,t,a){const y=e[re(t)];y&&a(y)}var Z={};function Lt({reducerPath:e,queryThunk:t,mutationThunk:a,serializeQueryArgs:y,context:{endpointDefinitions:p,apiUid:R,extractRehydrationInfo:b,hasRehydrationInfo:M},assertTagType:I,config:O}){const E=Y(`${e}/resetApiState`);function A(h,o,g,m){var c;h[c=o.queryCacheKey]??(h[c]={status:"uninitialized",endpointName:o.endpointName}),ie(h,o.queryCacheKey,v=>{v.status="pending",v.requestId=g&&v.requestId?v.requestId:m.requestId,o.originalArgs!==void 0&&(v.originalArgs=o.originalArgs),v.startedTimeStamp=m.startedTimeStamp})}function f(h,o,g,m){ie(h,o.arg.queryCacheKey,c=>{if(c.requestId!==o.requestId&&!m)return;const{merge:v}=p[o.arg.endpointName];if(c.status="fulfilled",v)if(c.data!==void 0){const{fulfilledTimeStamp:T,arg:w,baseQueryMeta:Q,requestId:D}=o;let P=Se(c.data,F=>v(F,g,{arg:w.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:T,requestId:D}));c.data=P}else c.data=g;else c.data=p[o.arg.endpointName].structuralSharing??!0?Ge(it(c.data)?ot(c.data):c.data,g):g;delete c.error,c.fulfilledTimeStamp=o.fulfilledTimeStamp})}const i=B({name:`${e}/queries`,initialState:Z,reducers:{removeQueryResult:{reducer(h,{payload:{queryCacheKey:o}}){delete h[o]},prepare:X()},cacheEntriesUpserted:{reducer(h,o){for(const g of o.payload){const{queryDescription:m,value:c}=g;A(h,m,!0,{requestId:o.meta.requestId,startedTimeStamp:o.meta.timestamp}),f(h,{arg:m,requestId:o.meta.requestId,fulfilledTimeStamp:o.meta.timestamp,baseQueryMeta:{}},c,!0)}},prepare:h=>({payload:h.map(m=>{const{endpointName:c,arg:v,value:T}=m,w=p[c];return{queryDescription:{type:"query",endpointName:c,originalArgs:m.arg,queryCacheKey:y({queryArgs:v,endpointDefinition:w,endpointName:c})},value:T}}),meta:{[ee]:!0,requestId:He(),timestamp:Date.now()}})},queryResultPatched:{reducer(h,{payload:{queryCacheKey:o,patches:g}}){ie(h,o,m=>{m.data=Ee(m.data,g.concat())})},prepare:X()}},extraReducers(h){h.addCase(t.pending,(o,{meta:g,meta:{arg:m}})=>{const c=ve(m);A(o,m,c,g)}).addCase(t.fulfilled,(o,{meta:g,payload:m})=>{const c=ve(g.arg);f(o,g,m,c)}).addCase(t.rejected,(o,{meta:{condition:g,arg:m,requestId:c},error:v,payload:T})=>{ie(o,m.queryCacheKey,w=>{if(!g){if(w.requestId!==c)return;w.status="rejected",w.error=T??v}})}).addMatcher(M,(o,g)=>{const{queries:m}=b(g);for(const[c,v]of Object.entries(m))((v==null?void 0:v.status)==="fulfilled"||(v==null?void 0:v.status)==="rejected")&&(o[c]=v)})}}),l=B({name:`${e}/mutations`,initialState:Z,reducers:{removeMutationResult:{reducer(h,{payload:o}){const g=re(o);g in h&&delete h[g]},prepare:X()}},extraReducers(h){h.addCase(a.pending,(o,{meta:g,meta:{requestId:m,arg:c,startedTimeStamp:v}})=>{c.track&&(o[re(g)]={requestId:m,status:"pending",endpointName:c.endpointName,startedTimeStamp:v})}).addCase(a.fulfilled,(o,{payload:g,meta:m})=>{m.arg.track&&_e(o,m,c=>{c.requestId===m.requestId&&(c.status="fulfilled",c.data=g,c.fulfilledTimeStamp=m.fulfilledTimeStamp)})}).addCase(a.rejected,(o,{payload:g,error:m,meta:c})=>{c.arg.track&&_e(o,c,v=>{v.requestId===c.requestId&&(v.status="rejected",v.error=g??m)})}).addMatcher(M,(o,g)=>{const{mutations:m}=b(g);for(const[c,v]of Object.entries(m))((v==null?void 0:v.status)==="fulfilled"||(v==null?void 0:v.status)==="rejected")&&c!==(v==null?void 0:v.requestId)&&(o[c]=v)})}}),r=B({name:`${e}/invalidation`,initialState:Z,reducers:{updateProvidedBy:{reducer(h,o){var c,v;const{queryCacheKey:g,providedTags:m}=o.payload;for(const T of Object.values(h))for(const w of Object.values(T)){const Q=w.indexOf(g);Q!==-1&&w.splice(Q,1)}for(const{type:T,id:w}of m){const Q=(c=h[T]??(h[T]={}))[v=w||"__internal_without_id"]??(c[v]=[]);Q.includes(g)||Q.push(g)}},prepare:X()}},extraReducers(h){h.addCase(i.actions.removeQueryResult,(o,{payload:{queryCacheKey:g}})=>{for(const m of Object.values(o))for(const c of Object.values(m)){const v=c.indexOf(g);v!==-1&&c.splice(v,1)}}).addMatcher(M,(o,g)=>{var c,v;const{provided:m}=b(g);for(const[T,w]of Object.entries(m))for(const[Q,D]of Object.entries(w)){const P=(c=o[T]??(o[T]={}))[v=Q||"__internal_without_id"]??(c[v]=[]);for(const F of D)P.includes(F)||P.push(F)}}).addMatcher(ue(W(t),be(t)),(o,g)=>{const m=Ye(g,"providesTags",p,I),{queryCacheKey:c}=g.meta.arg;r.caseReducers.updateProvidedBy(o,r.actions.updateProvidedBy({queryCacheKey:c,providedTags:m}))})}}),d=B({name:`${e}/subscriptions`,initialState:Z,reducers:{updateSubscriptionOptions(h,o){},unsubscribeQueryResult(h,o){},internal_getRTKQSubscriptions(){}}}),q=B({name:`${e}/internalSubscriptions`,initialState:Z,reducers:{subscriptionsUpdated:{reducer(h,o){return Ee(h,o.payload)},prepare:X()}}}),n=B({name:`${e}/config`,initialState:{online:Mt(),focused:At(),middlewareRegistered:!1,...O},reducers:{middlewareRegistered(h,{payload:o}){h.middlewareRegistered=h.middlewareRegistered==="conflict"||R!==o?"conflict":!0}},extraReducers:h=>{h.addCase(de,o=>{o.online=!0}).addCase(Ae,o=>{o.online=!1}).addCase(le,o=>{o.focused=!0}).addCase(Oe,o=>{o.focused=!1}).addMatcher(M,o=>({...o}))}}),s=nt({queries:i.reducer,mutations:l.reducer,provided:r.reducer,subscriptions:q.reducer,config:n.reducer}),u=(h,o)=>s(E.match(o)?void 0:h,o),S={...n.actions,...i.actions,...d.actions,...q.actions,...l.actions,...r.actions,resetApiState:E};return{reducer:u,actions:S}}var x=Symbol.for("RTKQ/skipToken"),Xe={status:"uninitialized"},Le=Se(Xe,()=>{}),ze=Se(Xe,()=>{});function zt({serializeQueryArgs:e,reducerPath:t,createSelector:a}){const y=A=>Le,p=A=>ze;return{buildQuerySelector:M,buildMutationSelector:I,selectInvalidatedBy:O,selectCachedArgsForQuery:E};function R(A){return{...A,...qt(A.status)}}function b(A){return A[t]}function M(A,f){return i=>{if(i===x)return a(y,R);const l=e({queryArgs:i,endpointDefinition:f,endpointName:A});return a(d=>{var q,n;return((n=(q=b(d))==null?void 0:q.queries)==null?void 0:n[l])??Le},R)}}function I(){return A=>{let f;return typeof A=="object"?f=re(A)??x:f=A,a(f===x?p:r=>{var d,q;return((q=(d=b(r))==null?void 0:d.mutations)==null?void 0:q[f])??ze},R)}}function O(A,f){const i=A[t],l=new Set;for(const r of f.filter(ae).map(me)){const d=i.provided[r.type];if(!d)continue;let q=(r.id!==void 0?d[r.id]:Ce(Object.values(d)))??[];for(const n of q)l.add(n)}return Ce(Array.from(l.values()).map(r=>{const d=i.queries[r];return d?[{queryCacheKey:r,endpointName:d.endpointName,originalArgs:d.originalArgs}]:[]}))}function E(A,f){return Object.values(A[t].queries).filter(i=>(i==null?void 0:i.endpointName)===f&&i.status!=="uninitialized").map(i=>i.originalArgs)}}var V=WeakMap?new WeakMap:void 0,Ue=({endpointName:e,queryArgs:t})=>{let a="";const y=V==null?void 0:V.get(t);if(typeof y=="string")a=y;else{const p=JSON.stringify(t,(R,b)=>(b=typeof b=="bigint"?{$bigint:b.toString()}:b,b=K(b)?Object.keys(b).sort().reduce((M,I)=>(M[I]=b[I],M),{}):b,b));K(t)&&(V==null||V.set(t,p)),a=p}return`${e}(${a})`};function Ze(...e){return function(a){const y=ce(O=>{var E;return(E=a.extractRehydrationInfo)==null?void 0:E.call(a,O,{reducerPath:a.reducerPath??"api"})}),p={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...a,extractRehydrationInfo:y,serializeQueryArgs(O){let E=Ue;if("serializeQueryArgs"in O.endpointDefinition){const A=O.endpointDefinition.serializeQueryArgs;E=f=>{const i=A(f);return typeof i=="string"?i:Ue({...f,queryArgs:i})}}else a.serializeQueryArgs&&(E=a.serializeQueryArgs);return E(O)},tagTypes:[...a.tagTypes||[]]},R={endpointDefinitions:{},batch(O){O()},apiUid:He(),extractRehydrationInfo:y,hasRehydrationInfo:ce(O=>y(O)!=null)},b={injectEndpoints:I,enhanceEndpoints({addTagTypes:O,endpoints:E}){if(O)for(const A of O)p.tagTypes.includes(A)||p.tagTypes.push(A);if(E)for(const[A,f]of Object.entries(E))typeof f=="function"?f(R.endpointDefinitions[A]):Object.assign(R.endpointDefinitions[A]||{},f);return b}},M=e.map(O=>O.init(b,p,R));function I(O){const E=O.endpoints({query:A=>({...A,type:"query"}),mutation:A=>({...A,type:"mutation"})});for(const[A,f]of Object.entries(E)){if(O.overrideExisting!==!0&&A in R.endpointDefinitions){if(O.overrideExisting==="throw")throw new Error(Ke(39));continue}R.endpointDefinitions[A]=f;for(const i of M)i.injectEndpoint(A,f)}return b}return b.injectEndpoints({endpoints:a.endpoints})}}function N(e,...t){return Object.assign(e,...t)}var Ut=({api:e,queryThunk:t,internalState:a})=>{const y=`${e.reducerPath}/subscriptions`;let p=null,R=null;const{updateSubscriptionOptions:b,unsubscribeQueryResult:M}=e.internalActions,I=(i,l)=>{var d,q,n;if(b.match(l)){const{queryCacheKey:s,requestId:u,options:S}=l.payload;return(d=i==null?void 0:i[s])!=null&&d[u]&&(i[s][u]=S),!0}if(M.match(l)){const{queryCacheKey:s,requestId:u}=l.payload;return i[s]&&delete i[s][u],!0}if(e.internalActions.removeQueryResult.match(l))return delete i[l.payload.queryCacheKey],!0;if(t.pending.match(l)){const{meta:{arg:s,requestId:u}}=l,S=i[q=s.queryCacheKey]??(i[q]={});return S[`${u}_running`]={},s.subscribe&&(S[u]=s.subscriptionOptions??S[u]??{}),!0}let r=!1;if(t.fulfilled.match(l)||t.rejected.match(l)){const s=i[l.meta.arg.queryCacheKey]||{},u=`${l.meta.requestId}_running`;r||(r=!!s[u]),delete s[u]}if(t.rejected.match(l)){const{meta:{condition:s,arg:u,requestId:S}}=l;if(s&&u.subscribe){const h=i[n=u.queryCacheKey]??(i[n]={});h[S]=u.subscriptionOptions??h[S]??{},r=!0}}return r},O=()=>a.currentSubscriptions,f={getSubscriptions:O,getSubscriptionCount:i=>{const r=O()[i]??{};return J(r)},isRequestSubscribed:(i,l)=>{var d;const r=O();return!!((d=r==null?void 0:r[i])!=null&&d[l])}};return(i,l)=>{if(p||(p=JSON.parse(JSON.stringify(a.currentSubscriptions))),e.util.resetApiState.match(i))return p=a.currentSubscriptions={},R=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(i))return[!1,f];const r=I(a.currentSubscriptions,i);let d=!0;if(r){R||(R=setTimeout(()=>{const s=JSON.parse(JSON.stringify(a.currentSubscriptions)),[,u]=Be(p,()=>s);l.next(e.internalActions.subscriptionsUpdated(u)),p=s,R=null},500));const q=typeof i.type=="string"&&!!i.type.startsWith(y),n=t.rejected.match(i)&&i.meta.condition&&!!i.meta.arg.subscribe;d=!q&&!n}return[d,!1]}};function $t(e){for(const t in e)return!1;return!0}var Nt=2147483647/1e3-1,xt=({reducerPath:e,api:t,queryThunk:a,context:y,internalState:p})=>{const{removeQueryResult:R,unsubscribeQueryResult:b,cacheEntriesUpserted:M}=t.internalActions,I=ue(b.match,a.fulfilled,a.rejected,M.match);function O(i){const l=p.currentSubscriptions[i];return!!l&&!$t(l)}const E={},A=(i,l,r)=>{var d;if(I(i)){const q=l.getState()[e];let n;if(M.match(i))n=i.payload.map(s=>s.queryDescription.queryCacheKey);else{const{queryCacheKey:s}=b.match(i)?i.payload:i.meta.arg;n=[s]}for(const s of n)f(s,(d=q.queries[s])==null?void 0:d.endpointName,l,q.config)}if(t.util.resetApiState.match(i))for(const[q,n]of Object.entries(E))n&&clearTimeout(n),delete E[q];if(y.hasRehydrationInfo(i)){const q=l.getState()[e],{queries:n}=y.extractRehydrationInfo(i);for(const[s,u]of Object.entries(n))f(s,u==null?void 0:u.endpointName,l,q.config)}};function f(i,l,r,d){const q=y.endpointDefinitions[l],n=(q==null?void 0:q.keepUnusedDataFor)??d.keepUnusedDataFor;if(n===1/0)return;const s=Math.max(0,Math.min(n,Nt));if(!O(i)){const u=E[i];u&&clearTimeout(u),E[i]=setTimeout(()=>{O(i)||r.dispatch(R({queryCacheKey:i})),delete E[i]},s*1e3)}}return A},$e=new Error("Promise never resolved before cacheEntryRemoved."),Ht=({api:e,reducerPath:t,context:a,queryThunk:y,mutationThunk:p,internalState:R})=>{const b=we(y),M=we(p),I=W(y,p),O={};function E(r,d,q){const n=O[r];n!=null&&n.valueResolved&&(n.valueResolved({data:d,meta:q}),delete n.valueResolved)}function A(r){const d=O[r];d&&(delete O[r],d.cacheEntryRemoved())}const f=(r,d,q)=>{const n=i(r);function s(u,S,h,o){const g=q[t].queries[S],m=d.getState()[t].queries[S];!g&&m&&l(u,o,S,d,h)}if(y.pending.match(r))s(r.meta.arg.endpointName,n,r.meta.requestId,r.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(r))for(const{queryDescription:u,value:S}of r.payload){const{endpointName:h,originalArgs:o,queryCacheKey:g}=u;s(h,g,r.meta.requestId,o),E(g,S,{})}else if(p.pending.match(r))d.getState()[t].mutations[n]&&l(r.meta.arg.endpointName,r.meta.arg.originalArgs,n,d,r.meta.requestId);else if(I(r))E(n,r.payload,r.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(r)||e.internalActions.removeMutationResult.match(r))A(n);else if(e.util.resetApiState.match(r))for(const u of Object.keys(O))A(u)};function i(r){return b(r)?r.meta.arg.queryCacheKey:M(r)?r.meta.arg.fixedCacheKey??r.meta.requestId:e.internalActions.removeQueryResult.match(r)?r.payload.queryCacheKey:e.internalActions.removeMutationResult.match(r)?re(r.payload):""}function l(r,d,q,n,s){const u=a.endpointDefinitions[r],S=u==null?void 0:u.onCacheEntryAdded;if(!S)return;const h={},o=new Promise(w=>{h.cacheEntryRemoved=w}),g=Promise.race([new Promise(w=>{h.valueResolved=w}),o.then(()=>{throw $e})]);g.catch(()=>{}),O[q]=h;const m=e.endpoints[r].select(u.type==="query"?d:q),c=n.dispatch((w,Q,D)=>D),v={...n,getCacheEntry:()=>m(n.getState()),requestId:s,extra:c,updateCachedData:u.type==="query"?w=>n.dispatch(e.util.updateQueryData(r,d,w)):void 0,cacheDataLoaded:g,cacheEntryRemoved:o},T=S(d,v);Promise.resolve(T).catch(w=>{if(w!==$e)throw w})}return f},Kt=({api:e,context:{apiUid:t},reducerPath:a})=>(y,p)=>{e.util.resetApiState.match(y)&&p.dispatch(e.internalActions.middlewareRegistered(t))},Wt=({reducerPath:e,context:t,context:{endpointDefinitions:a},mutationThunk:y,queryThunk:p,api:R,assertTagType:b,refetchQuery:M,internalState:I})=>{const{removeQueryResult:O}=R.internalActions,E=ue(W(y),be(y)),A=ue(W(y,p),Re(y,p));let f=[];const i=(d,q)=>{E(d)?r(Ye(d,"invalidatesTags",a,b),q):A(d)?r([],q):R.util.invalidateTags.match(d)&&r(Me(d.payload,void 0,void 0,void 0,void 0,b),q)};function l(d){var q,n;for(const s in d.queries)if(((q=d.queries[s])==null?void 0:q.status)==="pending")return!0;for(const s in d.mutations)if(((n=d.mutations[s])==null?void 0:n.status)==="pending")return!0;return!1}function r(d,q){const n=q.getState(),s=n[e];if(f.push(...d),s.config.invalidationBehavior==="delayed"&&l(s))return;const u=f;if(f=[],u.length===0)return;const S=R.util.selectInvalidatedBy(n,u);t.batch(()=>{const h=Array.from(S.values());for(const{queryCacheKey:o}of h){const g=s.queries[o],m=I.currentSubscriptions[o]??{};g&&(J(m)===0?q.dispatch(O({queryCacheKey:o})):g.status!=="uninitialized"&&q.dispatch(M(g)))}})}return i},Bt=({reducerPath:e,queryThunk:t,api:a,refetchQuery:y,internalState:p})=>{const R={},b=(f,i)=>{(a.internalActions.updateSubscriptionOptions.match(f)||a.internalActions.unsubscribeQueryResult.match(f))&&I(f.payload,i),(t.pending.match(f)||t.rejected.match(f)&&f.meta.condition)&&I(f.meta.arg,i),(t.fulfilled.match(f)||t.rejected.match(f)&&!f.meta.condition)&&M(f.meta.arg,i),a.util.resetApiState.match(f)&&E()};function M({queryCacheKey:f},i){const l=i.getState()[e],r=l.queries[f],d=p.currentSubscriptions[f];if(!r||r.status==="uninitialized")return;const{lowestPollingInterval:q,skipPollingIfUnfocused:n}=A(d);if(!Number.isFinite(q))return;const s=R[f];s!=null&&s.timeout&&(clearTimeout(s.timeout),s.timeout=void 0);const u=Date.now()+q;R[f]={nextPollTimestamp:u,pollingInterval:q,timeout:setTimeout(()=>{(l.config.focused||!n)&&i.dispatch(y(r)),M({queryCacheKey:f},i)},q)}}function I({queryCacheKey:f},i){const r=i.getState()[e].queries[f],d=p.currentSubscriptions[f];if(!r||r.status==="uninitialized")return;const{lowestPollingInterval:q}=A(d);if(!Number.isFinite(q)){O(f);return}const n=R[f],s=Date.now()+q;(!n||s<n.nextPollTimestamp)&&M({queryCacheKey:f},i)}function O(f){const i=R[f];i!=null&&i.timeout&&clearTimeout(i.timeout),delete R[f]}function E(){for(const f of Object.keys(R))O(f)}function A(f={}){let i=!1,l=Number.POSITIVE_INFINITY;for(let r in f)f[r].pollingInterval&&(l=Math.min(f[r].pollingInterval,l),i=f[r].skipPollingIfUnfocused||i);return{lowestPollingInterval:l,skipPollingIfUnfocused:i}}return b},Vt=({api:e,context:t,queryThunk:a,mutationThunk:y})=>{const p=We(a,y),R=Re(a,y),b=W(a,y),M={};return(O,E)=>{var A,f;if(p(O)){const{requestId:i,arg:{endpointName:l,originalArgs:r}}=O.meta,d=t.endpointDefinitions[l],q=d==null?void 0:d.onQueryStarted;if(q){const n={},s=new Promise((o,g)=>{n.resolve=o,n.reject=g});s.catch(()=>{}),M[i]=n;const u=e.endpoints[l].select(d.type==="query"?r:i),S=E.dispatch((o,g,m)=>m),h={...E,getCacheEntry:()=>u(E.getState()),requestId:i,extra:S,updateCachedData:d.type==="query"?o=>E.dispatch(e.util.updateQueryData(l,r,o)):void 0,queryFulfilled:s};q(r,h)}}else if(b(O)){const{requestId:i,baseQueryMeta:l}=O.meta;(A=M[i])==null||A.resolve({data:O.payload,meta:l}),delete M[i]}else if(R(O)){const{requestId:i,rejectedWithValue:l,baseQueryMeta:r}=O.meta;(f=M[i])==null||f.reject({error:O.payload??O.error,isUnhandledError:!l,meta:r}),delete M[i]}}},Gt=({reducerPath:e,context:t,api:a,refetchQuery:y,internalState:p})=>{const{removeQueryResult:R}=a.internalActions,b=(I,O)=>{le.match(I)&&M(O,"refetchOnFocus"),de.match(I)&&M(O,"refetchOnReconnect")};function M(I,O){const E=I.getState()[e],A=E.queries,f=p.currentSubscriptions;t.batch(()=>{for(const i of Object.keys(f)){const l=A[i],r=f[i];if(!r||!l)continue;(Object.values(r).some(q=>q[O]===!0)||Object.values(r).every(q=>q[O]===void 0)&&E.config[O])&&(J(r)===0?I.dispatch(R({queryCacheKey:i})):l.status!=="uninitialized"&&I.dispatch(y(l)))}})}return b};function Jt(e){const{reducerPath:t,queryThunk:a,api:y,context:p}=e,{apiUid:R}=p,b={invalidateTags:Y(`${t}/invalidateTags`)},M=A=>A.type.startsWith(`${t}/`),I=[Kt,xt,Wt,Bt,Ht,Vt];return{middleware:A=>{let f=!1;const l={...e,internalState:{currentSubscriptions:{}},refetchQuery:E,isThisApiSliceAction:M},r=I.map(n=>n(l)),d=Ut(l),q=Gt(l);return n=>s=>{if(!st(s))return n(s);f||(f=!0,A.dispatch(y.internalActions.middlewareRegistered(R)));const u={...A,next:n},S=A.getState(),[h,o]=d(s,u,S);let g;if(h?g=n(s):g=o,A.getState()[t]&&(q(s,u,S),M(s)||p.hasRehydrationInfo(s)))for(const m of r)m(s,u,S);return g}},actions:b};function E(A){return e.api.endpoints[A.endpointName].initiate(A.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Ne=Symbol(),et=({createSelector:e=qe}={})=>({name:Ne,init(t,{baseQuery:a,tagTypes:y,reducerPath:p,serializeQueryArgs:R,keepUnusedDataFor:b,refetchOnMountOrArgChange:M,refetchOnFocus:I,refetchOnReconnect:O,invalidationBehavior:E},A){tt();const f=j=>j;Object.assign(t,{reducerPath:p,endpoints:{},internalActions:{onOnline:de,onOffline:Ae,onFocus:le,onFocusLost:Oe},util:{}});const{queryThunk:i,mutationThunk:l,patchQueryData:r,updateQueryData:d,upsertQueryData:q,prefetch:n,buildMatchThunkActions:s}=_t({baseQuery:a,reducerPath:p,context:A,api:t,serializeQueryArgs:R,assertTagType:f}),{reducer:u,actions:S}=Lt({context:A,queryThunk:i,mutationThunk:l,serializeQueryArgs:R,reducerPath:p,assertTagType:f,config:{refetchOnFocus:I,refetchOnReconnect:O,refetchOnMountOrArgChange:M,keepUnusedDataFor:b,reducerPath:p,invalidationBehavior:E}});N(t.util,{patchQueryData:r,updateQueryData:d,upsertQueryData:q,prefetch:n,resetApiState:S.resetApiState,upsertQueryEntries:S.cacheEntriesUpserted}),N(t.internalActions,S);const{middleware:h,actions:o}=Jt({reducerPath:p,context:A,queryThunk:i,mutationThunk:l,api:t,assertTagType:f});N(t.util,o),N(t,{reducer:u,middleware:h});const{buildQuerySelector:g,buildMutationSelector:m,selectInvalidatedBy:c,selectCachedArgsForQuery:v}=zt({serializeQueryArgs:R,reducerPath:p,createSelector:e});N(t.util,{selectInvalidatedBy:c,selectCachedArgsForQuery:v});const{buildInitiateQuery:T,buildInitiateMutation:w,getRunningMutationThunk:Q,getRunningMutationsThunk:D,getRunningQueriesThunk:P,getRunningQueryThunk:F}=Ft({queryThunk:i,mutationThunk:l,api:t,serializeQueryArgs:R,context:A});return N(t.util,{getRunningMutationThunk:Q,getRunningMutationsThunk:D,getRunningQueryThunk:F,getRunningQueriesThunk:P}),{name:Ne,injectEndpoint(j,_){var L;const k=t;(L=k.endpoints)[j]??(L[j]={}),Je(_)?N(k.endpoints[j],{name:j,select:g(j,_),initiate:T(j,_)},s(i,j)):jt(_)&&N(k.endpoints[j],{name:j,select:m(),initiate:w(j)},s(l,j))}}}});et();function ye(e){return e.replace(e[0],e[0].toUpperCase())}function Yt(e){return e.type==="query"}function Xt(e){return e.type==="mutation"}function oe(e,...t){return Object.assign(e,...t)}var G=WeakMap?new WeakMap:void 0,Zt=({endpointName:e,queryArgs:t})=>{let a="";const y=G==null?void 0:G.get(t);if(typeof y=="string")a=y;else{const p=JSON.stringify(t,(R,b)=>(b=typeof b=="bigint"?{$bigint:b.toString()}:b,b=K(b)?Object.keys(b).sort().reduce((M,I)=>(M[I]=b[I],M),{}):b,b));K(t)&&(G==null||G.set(t,p)),a=p}return`${e}(${a})`},ge=Symbol();function xe(e,t,a,y){const p=C.useMemo(()=>({queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:a,endpointName:y}):e}),[e,t,a,y]),R=C.useRef(p);return C.useEffect(()=>{R.current.serialized!==p.serialized&&(R.current=p)},[p]),R.current.serialized===p.serialized?R.current.queryArgs:e}function he(e){const t=C.useRef(e);return C.useEffect(()=>{te(t.current,e)||(t.current=e)},[e]),te(t.current,e)?t.current:e}var en=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tn=en(),nn=()=>typeof navigator<"u"&&navigator.product==="ReactNative",rn=nn(),sn=()=>tn||rn?C.useLayoutEffect:C.useEffect,on=sn(),un=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Ve.pending}:e;function cn({api:e,moduleOptions:{batch:t,hooks:{useDispatch:a,useSelector:y,useStore:p},unstable__sideEffectsInRender:R,createSelector:b},serializeQueryArgs:M,context:I}){const O=R?l=>l():C.useEffect;return{buildQueryHooks:f,buildMutationHook:i,usePrefetch:A};function E(l,r,d){if(r!=null&&r.endpointName&&l.isUninitialized){const{endpointName:h}=r,o=I.endpointDefinitions[h];d!==x&&M({queryArgs:r.originalArgs,endpointDefinition:o,endpointName:h})===M({queryArgs:d,endpointDefinition:o,endpointName:h})&&(r=void 0)}let q=l.isSuccess?l.data:r==null?void 0:r.data;q===void 0&&(q=l.data);const n=q!==void 0,s=l.isLoading,u=(!r||r.isLoading||r.isUninitialized)&&!n&&s,S=l.isSuccess||n&&(s&&!(r!=null&&r.isError)||l.isUninitialized);return{...l,data:q,currentData:l.data,isFetching:s,isLoading:u,isSuccess:S}}function A(l,r){const d=a(),q=he(r);return C.useCallback((n,s)=>d(e.util.prefetch(l,n,{...q,...s})),[l,d,q])}function f(l){const r=(n,{refetchOnReconnect:s,refetchOnFocus:u,refetchOnMountOrArgChange:S,skip:h=!1,pollingInterval:o=0,skipPollingIfUnfocused:g=!1}={})=>{const{initiate:m}=e.endpoints[l],c=a(),v=C.useRef(void 0);if(!v.current){const k=c(e.internalActions.internal_getRTKQSubscriptions());v.current=k}const T=xe(h?x:n,Zt,I.endpointDefinitions[l],l),w=he({refetchOnReconnect:s,refetchOnFocus:u,pollingInterval:o,skipPollingIfUnfocused:g}),Q=C.useRef(!1),D=C.useRef(void 0);let{queryCacheKey:P,requestId:F}=D.current||{},j=!1;P&&F&&(j=v.current.isRequestSubscribed(P,F));const _=!j&&Q.current;return O(()=>{Q.current=j}),O(()=>{_&&(D.current=void 0)},[_]),O(()=>{var $;const k=D.current;if(T===x){k==null||k.unsubscribe(),D.current=void 0;return}const L=($=D.current)==null?void 0:$.subscriptionOptions;if(!k||k.arg!==T){k==null||k.unsubscribe();const z=c(m(T,{subscriptionOptions:w,forceRefetch:S}));D.current=z}else w!==L&&k.updateSubscriptionOptions(w)},[c,m,S,T,w,_]),C.useEffect(()=>()=>{var k;(k=D.current)==null||k.unsubscribe(),D.current=void 0},[]),C.useMemo(()=>({refetch:()=>{var k;if(!D.current)throw new Error(Ke(38));return(k=D.current)==null?void 0:k.refetch()}}),[])},d=({refetchOnReconnect:n,refetchOnFocus:s,pollingInterval:u=0,skipPollingIfUnfocused:S=!1}={})=>{const{initiate:h}=e.endpoints[l],o=a(),[g,m]=C.useState(ge),c=C.useRef(void 0),v=he({refetchOnReconnect:n,refetchOnFocus:s,pollingInterval:u,skipPollingIfUnfocused:S});O(()=>{var P,F;const D=(P=c.current)==null?void 0:P.subscriptionOptions;v!==D&&((F=c.current)==null||F.updateSubscriptionOptions(v))},[v]);const T=C.useRef(v);O(()=>{T.current=v},[v]);const w=C.useCallback(function(D,P=!1){let F;return t(()=>{var j;(j=c.current)==null||j.unsubscribe(),c.current=F=o(h(D,{subscriptionOptions:T.current,forceRefetch:!P})),m(D)}),F},[o,h]),Q=C.useCallback(()=>{var D,P;(D=c.current)!=null&&D.queryCacheKey&&o(e.internalActions.removeQueryResult({queryCacheKey:(P=c.current)==null?void 0:P.queryCacheKey}))},[o]);return C.useEffect(()=>()=>{var D;(D=c==null?void 0:c.current)==null||D.unsubscribe()},[]),C.useEffect(()=>{g!==ge&&!c.current&&w(g,!0)},[g,w]),C.useMemo(()=>[w,g,{reset:Q}],[w,g,Q])},q=(n,{skip:s=!1,selectFromResult:u}={})=>{const{select:S}=e.endpoints[l],h=xe(s?x:n,M,I.endpointDefinitions[l],l),o=C.useRef(void 0),g=C.useMemo(()=>b([S(h),(w,Q)=>Q,w=>h],E,{memoizeOptions:{resultEqualityCheck:te}}),[S,h]),m=C.useMemo(()=>u?b([g],u,{devModeChecks:{identityFunctionCheck:"never"}}):g,[g,u]),c=y(w=>m(w,o.current),te),v=p(),T=g(v.getState(),o.current);return on(()=>{o.current=T},[T]),c};return{useQueryState:q,useQuerySubscription:r,useLazyQuerySubscription:d,useLazyQuery(n){const[s,u,{reset:S}]=d(n),h=q(u,{...n,skip:u===ge}),o=C.useMemo(()=>({lastArg:u}),[u]);return C.useMemo(()=>[s,{...h,reset:S},o],[s,h,S,o])},useQuery(n,s){const u=r(n,s),S=q(n,{selectFromResult:n===x||s!=null&&s.skip?void 0:un,...s}),{data:h,status:o,isLoading:g,isSuccess:m,isError:c,error:v}=S;return C.useDebugValue({data:h,status:o,isLoading:g,isSuccess:m,isError:c,error:v}),C.useMemo(()=>({...S,...u}),[S,u])}}}function i(l){return({selectFromResult:r,fixedCacheKey:d}={})=>{const{select:q,initiate:n}=e.endpoints[l],s=a(),[u,S]=C.useState();C.useEffect(()=>()=>{u!=null&&u.arg.fixedCacheKey||u==null||u.reset()},[u]);const h=C.useCallback(function(L){const $=s(n(L,{fixedCacheKey:d}));return S($),$},[s,n,d]),{requestId:o}=u||{},g=C.useMemo(()=>q({fixedCacheKey:d,requestId:u==null?void 0:u.requestId}),[d,u,q]),m=C.useMemo(()=>r?b([g],r):g,[r,g]),c=y(m,te),v=d==null?u==null?void 0:u.arg.originalArgs:void 0,T=C.useCallback(()=>{t(()=>{u&&S(void 0),d&&s(e.internalActions.removeMutationResult({requestId:o,fixedCacheKey:d}))})},[s,d,u,o]),{endpointName:w,data:Q,status:D,isLoading:P,isSuccess:F,isError:j,error:_}=c;C.useDebugValue({endpointName:w,data:Q,status:D,isLoading:P,isSuccess:F,isError:j,error:_});const k=C.useMemo(()=>({...c,originalArgs:v,reset:T}),[c,v,T]);return C.useMemo(()=>[h,k],[h,k])}}}var an=Symbol(),ln=({batch:e=ut,hooks:t={useDispatch:lt,useSelector:at,useStore:ct},createSelector:a=qe,unstable__sideEffectsInRender:y=!1,...p}={})=>({name:an,init(R,{serializeQueryArgs:b},M){const I=R,{buildQueryHooks:O,buildMutationHook:E,usePrefetch:A}=cn({api:R,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:y,createSelector:a},serializeQueryArgs:b,context:M});return oe(I,{usePrefetch:A}),oe(M,{batch:e}),{injectEndpoint(f,i){if(Yt(i)){const{useQuery:l,useLazyQuery:r,useLazyQuerySubscription:d,useQueryState:q,useQuerySubscription:n}=O(f);oe(I.endpoints[f],{useQuery:l,useLazyQuery:r,useLazyQuerySubscription:d,useQueryState:q,useQuerySubscription:n}),R[`use${ye(f)}Query`]=l,R[`useLazy${ye(f)}Query`]=r}else if(Xt(i)){const l=E(f);oe(I.endpoints[f],{useMutation:l}),R[`use${ye(f)}Mutation`]=l}}}}}),dn=Ze(et(),ln());const fn=Ct({baseUrl:new URL("/api/v1",dt.EDITORIAL_API_URL).href}),pn=dn({reducerPath:"editorialApi",baseQuery:fn,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,a,y)=>t[y]||null,providesTags:(t,a,y)=>[{type:"schema",id:y}]}),getData:e.query({query:()=>"/data",providesTags:()=>[{type:"data"}]}),getDataCount:e.query({query:()=>"/data",transformResponse(t){return Object.values(t).reduce((y,p)=>y+Object.keys(p).length,0)}}),getDataObject:e.query({query:()=>"/data",transformResponse:(t,a,{itemType:y,id:p})=>t[y][p]||null,providesTags:(t,a,{itemType:y,id:p})=>[{type:"data",id:`${y}-${p}`}]}),getFiles:e.query({query:()=>"/files",transformResponse:t=>t.files,providesTags:()=>[{type:"files"}]}),getFileCount:e.query({query:()=>"/files",transformResponse:t=>{function a(p){let R=p.type==="file"?1:0;return p.children&&p.children.length>0&&(R+=p.children.reduce((b,M)=>b+a(M),0)),R}function y(p){return p.reduce((R,b)=>R+a(b),0)}return y(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:a,...y})=>({url:`/data/${a}/${t}`,method:"PATCH",body:{id:t,type:a,...y}}),invalidatesTags:()=>[{type:"data"}]}),createObject:e.mutation({query:({id:t,type:a,...y})=>({url:`/data/${a}/${t}`,method:"PUT",body:{id:t,type:a,...y}}),invalidatesTags:()=>[{type:"data"}]}),deleteObject:e.mutation({query:({id:t,type:a})=>({url:`/data/${a}/${t}`,method:"DELETE"}),invalidatesTags:()=>[{type:"data"}]})})}),{useCreateObjectMutation:mn,useDeleteFileMutation:vn,useDeleteObjectMutation:bn,useGetConfigQuery:Sn,useGetDataCountQuery:Rn,useGetDataObjectQuery:qn,useGetDataQuery:On,useGetFileCountQuery:An,useGetFilesQuery:Mn,useGetFilesTotalSizeQuery:Tn,useGetSchemaQuery:En,useGetSchemaTypeQuery:wn,usePublishMutation:In,usePullMutation:Qn,usePushMutation:Dn,useUpdateObjectMutation:Cn}=pn;export{On as a,In as b,Qn as c,Dn as d,pn as e,Sn as f,Tn as g,Rn as h,An as i,wn as j,bn as k,qn as l,mn as m,Cn as n,Mn as o,vn as p,hn as s,En as u};
@@ -1,4 +1,4 @@
1
- import{z as d,w as C}from"./index-G-cqIhgh.js";import{r as y,l as r,p as V}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{B as M}from"./button-O0EDocjF.js";import{g as j,s as u,a as P,u as S,F as A,b as f,c as h,d as b,e as p,I as v,f as x,C as I}from"./input-BH49oaMa.js";import{c as U}from"./utils-DslUJpbf.js";import{c as w}from"./createLucideIcon-TQsNVzYU.js";import{u as _,d as g,l as q}from"./authSlice-KDhecIDl.js";import"./index-B_FOxFgA.js";import"./index-B7e3fQ32.js";import"./tslib.es6-CDuPK5Eb.js";/**
1
+ import{z as d,w as C}from"./react-redux-D9l7ZD4q.js";import{r as y,l as r,p as V}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{B as M}from"./button-V-1j5t4f.js";import{g as j,s as u,a as P,u as S,F as A,b as f,c as h,d as b,e as p,I as v,f as x,C as I}from"./input-D-kT9R-x.js";import{c as U}from"./utils-BJX_0rcU.js";import{c as w}from"./createLucideIcon-TQsNVzYU.js";import{u as _,e as g,l as q}from"./authSlice-5XZo_yNS.js";import"./index-D4Mj6Lef.js";import"./index-B7e3fQ32.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,4 +8,4 @@ import{z as d,w as C}from"./index-G-cqIhgh.js";import{r as y,l as r,p as V}from"
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 R=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],B=w("loader",R),k=y.forwardRef(({className:o,...a},e)=>r.jsx(O,{ref:e,className:U(o,"animate-spin"),...a}));k.displayName=B.displayName;const N=(o,a,e)=>{if(o&&"reportValidity"in o){const s=j(e,a);o.setCustomValidity(s&&s.message||""),o.reportValidity()}},E=(o,a)=>{for(const e in a.fields){const s=a.fields[e];s&&s.ref&&"reportValidity"in s.ref?N(s.ref,e,o):s.refs&&s.refs.forEach(t=>N(t,e,o))}},D=(o,a)=>{a.shouldUseNativeValidation&&E(o,a);const e={};for(const s in o){const t=j(a.fields,s),i=Object.assign(o[s]||{},{ref:t&&t.ref});if(W(a.names||Object.keys(o),s)){const n=Object.assign({},j(e,s));u(n,"root",i),u(e,s,n)}else u(e,s,i)}return e},W=(o,a)=>o.some(e=>e.startsWith(a+"."));var G=function(o,a){for(var e={};o.length;){var s=o[0],t=s.code,i=s.message,n=s.path.join(".");if(!e[n])if("unionErrors"in s){var l=s.unionErrors[0].errors[0];e[n]={message:l.message,type:l.code}}else e[n]={message:i,type:t};if("unionErrors"in s&&s.unionErrors.forEach(function(F){return F.errors.forEach(function(L){return o.push(L)})}),a){var c=e[n].types,m=c&&c[s.code];e[n]=P(n,a,e,t,m?[].concat(m,s.message):s.message)}o.shift()}return e},H=function(o,a,e){return e===void 0&&(e={}),function(s,t,i){try{return Promise.resolve(function(n,l){try{var c=Promise.resolve(o[e.mode==="sync"?"parse":"parseAsync"](s,a)).then(function(m){return i.shouldUseNativeValidation&&E({},i),{errors:{},values:e.raw?s:m}})}catch(m){return l(m)}return c&&c.then?c.then(void 0,l):c}(0,function(n){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(n))return{values:{},errors:D(G(n.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw n}))}catch(n){return Promise.reject(n)}}};const J=d.object({email:d.string().nonempty("Please enter your email").email(),password:d.string().nonempty("Please enter your password"),remember:d.boolean()});function K(){"use no memo";const o=_(),a=g(t=>t.auth.isLoading),e=S({resolver:H(J),defaultValues:{email:"",password:"",remember:!1}}),s=y.useCallback(({email:t,password:i,remember:n})=>{o(q({email:t,password:i,remember:n}))},[o]);return r.jsx("div",{className:"flex flex-col",children:r.jsx(A,{...e,children:r.jsxs("form",{onSubmit:e.handleSubmit(s),className:"space-y-4",children:[r.jsx(f,{control:e.control,name:"email",rules:{required:!0},render:({field:t})=>r.jsxs(h,{children:[r.jsx(b,{className:"flex gap-1 items-baseline",children:"Email"}),r.jsx(p,{children:r.jsx(v,{placeholder:"callasmaria@example.com",...t})}),r.jsx(x,{})]})}),r.jsx(f,{name:"password",control:e.control,rules:{required:!0},render:({field:t})=>r.jsxs(h,{children:[r.jsx(b,{className:"flex gap-1 items-baseline",children:"Password"}),r.jsx(p,{children:r.jsx(v,{type:"password",...t})}),r.jsx(x,{})]})}),r.jsx(f,{name:"remember",control:e.control,render:({field:t})=>r.jsxs(h,{children:[r.jsx(p,{children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(I,{id:"remember",checked:t.value,onCheckedChange:t.onChange}),r.jsx("label",{htmlFor:"remember",className:"text-sm leading-none",children:"Remember me"})]})}),r.jsx(x,{})]})}),r.jsx(M,{type:"submit",disabled:!e.formState.isValid||a,className:"w-full",children:a?r.jsx(k,{className:"absolute"}):"Login"})]})})})}const ae=C(function(){const a=V(),e=g(t=>t.auth.user),s=g(t=>t.auth.isLoading);return y.useEffect(()=>{e&&a("/admin/dashboard")},[a,e]),s||e?null:r.jsx("div",{className:"flex w-full h-full",children:r.jsxs("div",{className:"self-center space-y-8 w-72 mx-auto",children:[r.jsxs("div",{className:"flex flex-col space-y-2 text-center",children:[r.jsx("h1",{className:"text-2xl font-semibold tracking-tight leading-none",children:"Editorial Admin"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your details below to login"})]}),r.jsx(K,{})]})})});export{ae as default};
11
+ */const R=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],B=w("loader",R),k=y.forwardRef(({className:o,...a},e)=>r.jsx(O,{ref:e,className:U(o,"animate-spin"),...a}));k.displayName=B.displayName;const N=(o,a,e)=>{if(o&&"reportValidity"in o){const s=j(e,a);o.setCustomValidity(s&&s.message||""),o.reportValidity()}},E=(o,a)=>{for(const e in a.fields){const s=a.fields[e];s&&s.ref&&"reportValidity"in s.ref?N(s.ref,e,o):s.refs&&s.refs.forEach(t=>N(t,e,o))}},D=(o,a)=>{a.shouldUseNativeValidation&&E(o,a);const e={};for(const s in o){const t=j(a.fields,s),i=Object.assign(o[s]||{},{ref:t&&t.ref});if(W(a.names||Object.keys(o),s)){const n=Object.assign({},j(e,s));u(n,"root",i),u(e,s,n)}else u(e,s,i)}return e},W=(o,a)=>o.some(e=>e.startsWith(a+"."));var G=function(o,a){for(var e={};o.length;){var s=o[0],t=s.code,i=s.message,n=s.path.join(".");if(!e[n])if("unionErrors"in s){var l=s.unionErrors[0].errors[0];e[n]={message:l.message,type:l.code}}else e[n]={message:i,type:t};if("unionErrors"in s&&s.unionErrors.forEach(function(F){return F.errors.forEach(function(L){return o.push(L)})}),a){var c=e[n].types,m=c&&c[s.code];e[n]=P(n,a,e,t,m?[].concat(m,s.message):s.message)}o.shift()}return e},H=function(o,a,e){return e===void 0&&(e={}),function(s,t,i){try{return Promise.resolve(function(n,l){try{var c=Promise.resolve(o[e.mode==="sync"?"parse":"parseAsync"](s,a)).then(function(m){return i.shouldUseNativeValidation&&E({},i),{errors:{},values:e.raw?s:m}})}catch(m){return l(m)}return c&&c.then?c.then(void 0,l):c}(0,function(n){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(n))return{values:{},errors:D(G(n.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw n}))}catch(n){return Promise.reject(n)}}};const J=d.object({email:d.string().nonempty("Please enter your email").email(),password:d.string().nonempty("Please enter your password"),remember:d.boolean()});function K(){"use no memo";const o=_(),a=g(t=>t.auth.isLoading),e=S({resolver:H(J),disabled:a,defaultValues:{email:"",password:"",remember:!1}}),s=y.useCallback(({email:t,password:i,remember:n})=>{o(q({email:t,password:i,remember:n}))},[o]);return r.jsx("div",{className:"flex flex-col",children:r.jsx(A,{...e,children:r.jsxs("form",{onSubmit:e.handleSubmit(s),className:"space-y-4",children:[r.jsx(f,{control:e.control,name:"email",rules:{required:!0},render:({field:t})=>r.jsxs(h,{children:[r.jsx(b,{className:"flex gap-1 items-baseline",children:"Email"}),r.jsx(p,{children:r.jsx(v,{placeholder:"callasmaria@example.com",...t})}),r.jsx(x,{})]})}),r.jsx(f,{name:"password",control:e.control,rules:{required:!0},render:({field:t})=>r.jsxs(h,{children:[r.jsx(b,{className:"flex gap-1 items-baseline",children:"Password"}),r.jsx(p,{children:r.jsx(v,{type:"password",...t})}),r.jsx(x,{})]})}),r.jsx(f,{name:"remember",control:e.control,render:({field:t})=>r.jsxs(h,{children:[r.jsx(p,{children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx(I,{id:"remember",checked:t.value,onCheckedChange:t.onChange}),r.jsx("label",{htmlFor:"remember",className:"text-sm leading-none",children:"Remember me"})]})}),r.jsx(x,{})]})}),r.jsx(M,{type:"submit",disabled:!e.formState.isValid||a,className:"w-full",children:a?r.jsx(k,{className:"absolute"}):"Login"})]})})})}const ae=C(function(){const a=V(),e=g(t=>t.auth.user),s=g(t=>t.auth.isLoading);return y.useEffect(()=>{e&&a("/admin/dashboard")},[a,e]),s||e?null:r.jsx("div",{className:"flex w-full h-full",children:r.jsxs("div",{className:"self-center space-y-8 w-72 mx-auto",children:[r.jsxs("div",{className:"flex flex-col space-y-2 text-center",children:[r.jsx("h1",{className:"text-2xl font-semibold tracking-tight leading-none",children:"Editorial Admin"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your details below to login"})]}),r.jsx(K,{})]})})});export{ae as default};
@@ -0,0 +1,46 @@
1
+ import{c as oe}from"./createLucideIcon-TQsNVzYU.js";import{r as c,x as ce}from"./chunk-KNED5TY2-CXj9yqcQ.js";import{a as ie,u as ue}from"./index-D4Mj6Lef.js";import{_ as C,a as Q,b as le}from"./tslib.es6-De9GV7Vy.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 se=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],rt=oe("external-link",se);var fe=ce[" useId ".trim().toString()]||(()=>{}),de=0;function nt(e){const[t,r]=c.useState(fe());return ie(()=>{r(n=>n??String(de++))},[e]),e||(t?`radix-${t}`:"")}function at(e,t=globalThis==null?void 0:globalThis.document){const r=ue(e);c.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var X=0;function ot(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??z()),document.body.insertAdjacentElement("beforeend",e[1]??z()),X++,()=>{X===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),X--}},[])}function z(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var N="right-scroll-bar-position",D="width-before-scroll-bar",ve="with-scroll-bars-hidden",he="--removed-body-scroll-bar-size";function Y(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function me(e,t){var r=c.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=t,r.facade}var ge=typeof window<"u"?c.useLayoutEffect:c.useEffect,G=new WeakMap;function ye(e,t){var r=me(null,function(n){return e.forEach(function(i){return Y(i,n)})});return ge(function(){var n=G.get(r);if(n){var i=new Set(n),u=new Set(e),l=r.current;i.forEach(function(a){u.has(a)||Y(a,null)}),u.forEach(function(a){i.has(a)||Y(a,l)})}G.set(r,e)},[e]),r}function pe(e){return e}function Se(e,t){t===void 0&&(t=pe);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(u){var l=t(u,n);return r.push(l),function(){r=r.filter(function(a){return a!==l})}},assignSyncMedium:function(u){for(n=!0;r.length;){var l=r;r=[],l.forEach(u)}r={push:function(a){return u(a)},filter:function(){return r}}},assignMedium:function(u){n=!0;var l=[];if(r.length){var a=r;r=[],a.forEach(u),l=r}var y=function(){var v=l;l=[],v.forEach(u)},m=function(){return Promise.resolve().then(y)};m(),r={push:function(v){l.push(v),m()},filter:function(v){return l=l.filter(v),r}}}};return i}function we(e){e===void 0&&(e={});var t=Se(null);return t.options=C({async:!0,ssr:!1},e),t}var U=function(e){var t=e.sideCar,r=Q(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return c.createElement(n,C({},r))};U.isSideCarExport=!0;function be(e,t){return e.useMedium(t),U}var J=we(),H=function(){},V=c.forwardRef(function(e,t){var r=c.useRef(null),n=c.useState({onScrollCapture:H,onWheelCapture:H,onTouchMoveCapture:H}),i=n[0],u=n[1],l=e.forwardProps,a=e.children,y=e.className,m=e.removeScrollBar,v=e.enabled,f=e.shards,d=e.sideCar,p=e.noIsolation,w=e.inert,o=e.allowPinchZoom,s=e.as,g=s===void 0?"div":s,b=e.gapMode,S=Q(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=d,h=ye([r,t]),k=C(C({},S),i);return c.createElement(c.Fragment,null,v&&c.createElement(E,{sideCar:J,removeScrollBar:m,shards:f,noIsolation:p,inert:w,setCallbacks:u,allowPinchZoom:!!o,lockRef:r,gapMode:b}),l?c.cloneElement(c.Children.only(a),C(C({},k),{ref:h})):c.createElement(g,C({},k,{className:y,ref:h}),a))});V.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};V.classNames={fullWidth:D,zeroRight:N};var Ee=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ce(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ee();return t&&e.setAttribute("nonce",t),e}function ke(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Re(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ae=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Ce())&&(ke(t,r),Re(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Me=function(){var e=Ae();return function(t,r){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},ee=function(){var e=Me(),t=function(r){var n=r.styles,i=r.dynamic;return e(n,i),null};return t},xe={left:0,top:0,right:0,gap:0},F=function(e){return parseInt(e||"",10)||0},Le=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[F(r),F(n),F(i)]},Pe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xe;var t=Le(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},We=ee(),x="data-scroll-locked",Be=function(e,t,r,n){var i=e.left,u=e.top,l=e.right,a=e.gap;return r===void 0&&(r="margin"),`
7
+ .`.concat(ve,` {
8
+ overflow: hidden `).concat(n,`;
9
+ padding-right: `).concat(a,"px ").concat(n,`;
10
+ }
11
+ body[`).concat(x,`] {
12
+ overflow: hidden `).concat(n,`;
13
+ overscroll-behavior: contain;
14
+ `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
15
+ padding-left: `.concat(i,`px;
16
+ padding-top: `).concat(u,`px;
17
+ padding-right: `).concat(l,`px;
18
+ margin-left:0;
19
+ margin-top:0;
20
+ margin-right: `).concat(a,"px ").concat(n,`;
21
+ `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
22
+ }
23
+
24
+ .`).concat(N,` {
25
+ right: `).concat(a,"px ").concat(n,`;
26
+ }
27
+
28
+ .`).concat(D,` {
29
+ margin-right: `).concat(a,"px ").concat(n,`;
30
+ }
31
+
32
+ .`).concat(N," .").concat(N,` {
33
+ right: 0 `).concat(n,`;
34
+ }
35
+
36
+ .`).concat(D," .").concat(D,` {
37
+ margin-right: 0 `).concat(n,`;
38
+ }
39
+
40
+ body[`).concat(x,`] {
41
+ `).concat(he,": ").concat(a,`px;
42
+ }
43
+ `)},K=function(){var e=parseInt(document.body.getAttribute(x)||"0",10);return isFinite(e)?e:0},Te=function(){c.useEffect(function(){return document.body.setAttribute(x,(K()+1).toString()),function(){var e=K()-1;e<=0?document.body.removeAttribute(x):document.body.setAttribute(x,e.toString())}},[])},Ie=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;Te();var u=c.useMemo(function(){return Pe(i)},[i]);return c.createElement(We,{styles:Be(u,!t,i,r?"":"!important")})},O=!1;if(typeof window<"u")try{var W=Object.defineProperty({},"passive",{get:function(){return O=!0,!0}});window.addEventListener("test",W,W),window.removeEventListener("test",W,W)}catch{O=!1}var R=O?{passive:!1}:!1,Ne=function(e){return e.tagName==="TEXTAREA"},te=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Ne(e)&&r[t]==="visible")},De=function(e){return te(e,"overflowY")},Ve=function(e){return te(e,"overflowX")},Z=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=re(e,n);if(i){var u=ne(e,n),l=u[1],a=u[2];if(l>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Xe=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Ye=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},re=function(e,t){return e==="v"?De(t):Ve(t)},ne=function(e,t){return e==="v"?Xe(t):Ye(t)},He=function(e,t){return e==="h"&&t==="rtl"?-1:1},Fe=function(e,t,r,n,i){var u=He(e,window.getComputedStyle(t).direction),l=u*n,a=r.target,y=t.contains(a),m=!1,v=l>0,f=0,d=0;do{var p=ne(e,a),w=p[0],o=p[1],s=p[2],g=o-s-u*w;(w||g)&&re(e,a)&&(f+=g,d+=w),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!y&&a!==document.body||y&&(t.contains(a)||t===a));return(v&&Math.abs(f)<1||!v&&Math.abs(d)<1)&&(m=!0),m},B=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_=function(e){return[e.deltaX,e.deltaY]},$=function(e){return e&&"current"in e?e.current:e},qe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Oe=function(e){return`
44
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
45
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
46
+ `)},je=0,A=[];function ze(e){var t=c.useRef([]),r=c.useRef([0,0]),n=c.useRef(),i=c.useState(je++)[0],u=c.useState(ee)[0],l=c.useRef(e);c.useEffect(function(){l.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var o=le([e.lockRef.current],(e.shards||[]).map($),!0).filter(Boolean);return o.forEach(function(s){return s.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),o.forEach(function(s){return s.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(o,s){if("touches"in o&&o.touches.length===2||o.type==="wheel"&&o.ctrlKey)return!l.current.allowPinchZoom;var g=B(o),b=r.current,S="deltaX"in o?o.deltaX:b[0]-g[0],E="deltaY"in o?o.deltaY:b[1]-g[1],h,k=o.target,L=Math.abs(S)>Math.abs(E)?"h":"v";if("touches"in o&&L==="h"&&k.type==="range")return!1;var P=Z(L,k);if(!P)return!0;if(P?h=L:(h=L==="v"?"h":"v",P=Z(L,k)),!P)return!1;if(!n.current&&"changedTouches"in o&&(S||E)&&(n.current=h),!h)return!0;var j=n.current||h;return Fe(j,s,o,j==="h"?S:E)},[]),y=c.useCallback(function(o){var s=o;if(!(!A.length||A[A.length-1]!==u)){var g="deltaY"in s?_(s):B(s),b=t.current.filter(function(h){return h.name===s.type&&(h.target===s.target||s.target===h.shadowParent)&&qe(h.delta,g)})[0];if(b&&b.should){s.cancelable&&s.preventDefault();return}if(!b){var S=(l.current.shards||[]).map($).filter(Boolean).filter(function(h){return h.contains(s.target)}),E=S.length>0?a(s,S[0]):!l.current.noIsolation;E&&s.cancelable&&s.preventDefault()}}},[]),m=c.useCallback(function(o,s,g,b){var S={name:o,delta:s,target:g,should:b,shadowParent:Ge(g)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(E){return E!==S})},1)},[]),v=c.useCallback(function(o){r.current=B(o),n.current=void 0},[]),f=c.useCallback(function(o){m(o.type,_(o),o.target,a(o,e.lockRef.current))},[]),d=c.useCallback(function(o){m(o.type,B(o),o.target,a(o,e.lockRef.current))},[]);c.useEffect(function(){return A.push(u),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",y,R),document.addEventListener("touchmove",y,R),document.addEventListener("touchstart",v,R),function(){A=A.filter(function(o){return o!==u}),document.removeEventListener("wheel",y,R),document.removeEventListener("touchmove",y,R),document.removeEventListener("touchstart",v,R)}},[]);var p=e.removeScrollBar,w=e.inert;return c.createElement(c.Fragment,null,w?c.createElement(u,{styles:Oe(i)}):null,p?c.createElement(Ie,{gapMode:e.gapMode}):null)}function Ge(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ke=be(J,ze);var Ze=c.forwardRef(function(e,t){return c.createElement(V,C({},e,{ref:t,sideCar:Ke}))});Ze.classNames=V.classNames;var _e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},M=new WeakMap,T=new WeakMap,I={},q=0,ae=function(e){return e&&(e.host||ae(e.parentNode))},$e=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=ae(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Qe=function(e,t,r,n){var i=$e(t,Array.isArray(e)?e:[e]);I[r]||(I[r]=new WeakMap);var u=I[r],l=[],a=new Set,y=new Set(i),m=function(f){!f||a.has(f)||(a.add(f),m(f.parentNode))};i.forEach(m);var v=function(f){!f||y.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))v(d);else try{var p=d.getAttribute(n),w=p!==null&&p!=="false",o=(M.get(d)||0)+1,s=(u.get(d)||0)+1;M.set(d,o),u.set(d,s),l.push(d),o===1&&w&&T.set(d,!0),s===1&&d.setAttribute(r,"true"),w||d.setAttribute(n,"true")}catch(g){console.error("aria-hidden: cannot operate on ",d,g)}})};return v(t),a.clear(),q++,function(){l.forEach(function(f){var d=M.get(f)-1,p=u.get(f)-1;M.set(f,d),u.set(f,p),d||(T.has(f)||f.removeAttribute(n),T.delete(f)),p||f.removeAttribute(r)}),q--,q||(M=new WeakMap,M=new WeakMap,T=new WeakMap,I={})}},ct=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=_e(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),Qe(n,i,r,"aria-hidden")):function(){return null}};export{rt as E,Ze as R,nt as a,ot as b,ct as h,at as u};