@isardsat/editorial-admin 6.6.1 → 6.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/assets/FilePicker-D_8_LM-x.js +1 -0
- package/build/client/assets/{Loading-BiO3HJmZ.js → Loading-135S8vAs.js} +1 -1
- package/build/client/assets/{URLInput-CFnU0U1n.js → URLInput-D0_7cCau.js} +1 -1
- package/build/client/assets/{authSlice-O1tz7SK1.js → authSlice-DbkAmWS9.js} +158 -158
- package/build/client/assets/{button-494fplqA.js → button-1K9v0DJg.js} +1 -1
- package/build/client/assets/{dashboard-DqU-WlEe.js → dashboard-ChM5vL1Y.js} +1 -1
- package/build/client/assets/{dashboard._collection-LAkj-iO9.js → dashboard._collection-yuvHUjkD.js} +1 -1
- package/build/client/assets/{dashboard._collection._document-Cqsuu-0-.js → dashboard._collection._document-MyRkrosI.js} +1 -1
- package/build/client/assets/{dashboard._collection.new-SI3Dkpds.js → dashboard._collection.new-B8E4HzA_.js} +1 -1
- package/build/client/assets/{dashboard._layout-BUGw8Wsg.js → dashboard._layout-CptxApKG.js} +2 -2
- package/build/client/assets/dashboard.files-DSuCEWNU.js +1 -0
- package/build/client/assets/{date-picker-D7MFHjcF.js → date-picker-BM6MlSuC.js} +1 -1
- package/build/client/assets/{datetime-picker-DzApRNz_.js → datetime-picker-RYlN_N5T.js} +1 -1
- package/build/client/assets/files-DZvtTqEL.js +26 -0
- package/build/client/assets/home-DEZ1iD3I.js +1 -0
- package/build/client/assets/{index-CqaffZUS.js → index-B_LZxNEG.js} +1 -1
- package/build/client/assets/{index-BNiwB2Xo.js → index-C4koMhA2.js} +1 -1
- package/build/client/assets/{index-CQ2mjYJl.js → index-COYoknn5.js} +1 -1
- package/build/client/assets/{index-Blx_6p83.js → index-DfWKcpIl.js} +1 -1
- package/build/client/assets/{index-gfXi4hAm.js → index-Dfe-gVs7.js} +1 -1
- package/build/client/assets/{index-DgN6jnv0.js → index-opRxY4qB.js} +1 -1
- package/build/client/assets/{index-N8jzdZDg.js → index-ufEogtin.js} +1 -1
- package/build/client/assets/{itemForm-BcDnRX3X.js → itemForm-CE-2cG5-.js} +3 -3
- package/build/client/assets/manifest-ef1d0485.js +1 -0
- package/build/client/assets/{markdownEditor-DQtQQZeo.js → markdownEditor-EbpqJ4d2.js} +51 -51
- package/build/client/assets/{popover-DDQEIzon.js → popover--B9JRpo3.js} +1 -1
- package/build/client/assets/root-Dltr_VS9.js +1 -0
- package/build/client/assets/{types-qmeOZPBc.js → types-D9rc6L8-.js} +1 -1
- package/build/client/assets/{utils-5cV-49hI.js → utils-BLOeDrX7.js} +1 -1
- package/build/client/index.html +2 -2
- package/package.json +2 -2
- package/build/client/assets/FilePicker-CWQ8ELBw.js +0 -1
- package/build/client/assets/dashboard.files-YptTPTFT.js +0 -1
- package/build/client/assets/files-DrzVVLDE.js +0 -26
- package/build/client/assets/home-BtNh5JTT.js +0 -1
- package/build/client/assets/hooks-BA9LC00C.js +0 -1
- package/build/client/assets/manifest-384b5d21.js +0 -1
- package/build/client/assets/root-DtBI39a7.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as a}from"./chunk-EF7DTUVF-CaKisB5m.js";import{S as o,c as d}from"./index-
|
|
1
|
+
import{p as a}from"./chunk-EF7DTUVF-CaKisB5m.js";import{S as o,c as d}from"./index-opRxY4qB.js";import{a as u}from"./utils-BLOeDrX7.js";const c=d("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 b({className:e,variant:r,size:t,asChild:i=!1,...s}){const n=i?o:"button";return a.jsx(n,{"data-slot":"button",className:u(c({variant:r,size:t,className:e})),...s})}export{b as B,c as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,a as w,x as C,w as V}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as x,j as i,d as N,b as v,k as H,l as L}from"./utils-
|
|
1
|
+
import{p as e,a as w,x as C,w as V}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as x,j as i,d as N,b as v,k as H,l as L}from"./utils-BLOeDrX7.js";import{c as D,u as y,T as R,a as T,b as m,d as $,f as u,e as A,g as k,h as I}from"./index-Dfe-gVs7.js";function M({className:t,...l}){return e.jsx("div",{"data-slot":"skeleton",className:x("bg-accent animate-pulse rounded-md",t),...l})}function b({className:t,title:l,value:o,isLoading:n,...a}){return e.jsxs("div",{className:x("border border-border rounded-xl p-6",t),...a,children:[e.jsx("h3",{className:"text-xs text-muted-foreground",children:l}),n?e.jsx(M,{className:"h-[2.25rem] w-16"}):e.jsx("p",{className:"text-lg sm:text-3xl font-bold leading-none",children:o})]})}const h=D(),g=[h.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(t){const l=t.getValue();return e.jsx("span",{title:l,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:l})}}),h.accessor("createdAt",{header:"Created",cell(t){return i(new Date(t.getValue()))}}),h.accessor("updatedAt",{header:"Updated",cell(t){return i(new Date(t.getValue()))}})];function S(){const{data:t}=N(),{data:l}=v(),o=w.useMemo(()=>!t||!l?[]:Object.entries(t).reduce((r,[d,p])=>r.concat(Object.values(p).filter(c=>c.isDraft).map(c=>({...c,type:d}))),[]).toSorted((r,d)=>r.updatedAt>d.updatedAt?-1:1).slice(0,6),[t,l]),n=y({data:o,columns:g,getCoreRowModel:I()});return n.getRowCount()===0?null: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:"Drafts"}),e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(R,{children:[e.jsx(T,{children:n.getHeaderGroups().map(a=>e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${g.length}, minmax(200px, 1fr))`},children:a.headers.map(s=>e.jsx($,{children:s.isPlaceholder?null:u(s.column.columnDef.header,s.getContext())},s.id))},a.id))}),e.jsx(A,{children:n.getRowModel().rows.map(a=>e.jsx(C,{to:`/admin/dashboard/${a.original.type}/${a.original.id}`,children:e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${g.length}, minmax(200px, 1fr))`},children:a.getVisibleCells().map(s=>e.jsx(k,{className:x("p-2"),children:u(s.column.columnDef.cell,s.getContext())},s.id))},a.id)},a.original.id))})]})})]})}const f=D(),j=[f.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(t){const l=t.getValue();return e.jsx("span",{title:l,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:l})}}),f.accessor("createdAt",{header:"Created",cell(t){return i(new Date(t.getValue()))}}),f.accessor("updatedAt",{header:"Updated",cell(t){return i(new Date(t.getValue()))}})];function G(){const{data:t}=N(),{data:l}=v(),o=w.useMemo(()=>!t||!l?[]:Object.entries(t).filter(([r])=>r in l).reduce((r,[d,p])=>r.concat(Object.values(p).map(c=>({...c,type:d}))),[]).toSorted((r,d)=>r.updatedAt>d.updatedAt?-1:1).slice(0,6),[t,l]),n=y({data:o,columns:j,getCoreRowModel:I()});return n.getRowCount()===0?null: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("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(R,{children:[e.jsx(T,{children:n.getHeaderGroups().map(a=>e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${j.length}, minmax(200px, 1fr))`},children:a.headers.map(s=>e.jsx($,{children:s.isPlaceholder?null:u(s.column.columnDef.header,s.getContext())},s.id))},a.id))}),e.jsx(A,{children:n.getRowModel().rows.map(a=>e.jsx(C,{to:`/admin/dashboard/${a.original.type}/${a.original.id}`,children:e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${j.length}, minmax(200px, 1fr))`},children:a.getVisibleCells().map(s=>e.jsx(k,{className:x("p-2"),children:u(s.column.columnDef.cell,s.getContext())},s.id))},a.id)},a.original.id))})]})})]})}const U=V(function(){const{data:l,isLoading:o}=H(),{data:n,isLoading:a}=L();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(b,{className:"w-full sm:w-44",title:"Items",value:l,isLoading:o}),e.jsx(b,{className:"w-full sm:w-44",title:"Files",value:n,isLoading:a})]}),e.jsx(G,{}),e.jsx(S,{})]})})});export{U as default};
|
package/build/client/assets/{dashboard._collection-LAkj-iO9.js → dashboard._collection-yuvHUjkD.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as e,a as p,x as u,R as $,w as D}from"./chunk-EF7DTUVF-CaKisB5m.js";import{B as L}from"./button-
|
|
1
|
+
import{p as e,a as p,x as u,R as $,w as D}from"./chunk-EF7DTUVF-CaKisB5m.js";import{B as L}from"./button-1K9v0DJg.js";import{j as k,m as C,d as R,n as F,o as I,a as j}from"./utils-BLOeDrX7.js";import{c as E,u as H,T as V,a as P,b as y,d as S,f as N,e as B,g as O,h as G}from"./index-Dfe-gVs7.js";import{c as d}from"./createLucideIcon-BweVylaW.js";import{C as f}from"./calendar-DVBBYeOW.js";import{T as Q,F as U}from"./trash-BPu8wmdf.js";import{E as v}from"./external-link-LWykkN17.js";import"./index-opRxY4qB.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as c,p as e}from"./chunk-EF7DTUVF-CaKisB5m.js";import{I as n}from"./itemForm-
|
|
1
|
+
import{w as c,p as e}from"./chunk-EF7DTUVF-CaKisB5m.js";import{I as n}from"./itemForm-CE-2cG5-.js";import{m as p,p as l}from"./utils-BLOeDrX7.js";import"./button-1K9v0DJg.js";import"./index-opRxY4qB.js";import"./types-D9rc6L8-.js";import"./index-C4koMhA2.js";import"./index-BJ-ODQ_I.js";import"./createLucideIcon-BweVylaW.js";import"./index-ufEogtin.js";import"./tslib.es6-De9GV7Vy.js";const w=c(function({params:s}){const{collectionId:t,documentId:i}=s,{data:o,isFetching:a}=p(t),{data:m,isFetching:r}=l({itemType:t,id:i});return!o||(a||r)?null:e.jsx("div",{className:"overflow-auto scrollbar-stable",children:e.jsx("div",{className:"flex p-4 gap-4",children:e.jsx(n,{itemType:t,fields:o.fields,data:m},`${t}-${i}`)})})});export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as i,p as o}from"./chunk-EF7DTUVF-CaKisB5m.js";import{I as m}from"./itemForm-
|
|
1
|
+
import{w as i,p as o}from"./chunk-EF7DTUVF-CaKisB5m.js";import{I as m}from"./itemForm-CE-2cG5-.js";import{m as s}from"./utils-BLOeDrX7.js";import"./button-1K9v0DJg.js";import"./index-opRxY4qB.js";import"./types-D9rc6L8-.js";import"./index-C4koMhA2.js";import"./index-BJ-ODQ_I.js";import"./createLucideIcon-BweVylaW.js";import"./index-ufEogtin.js";import"./tslib.es6-De9GV7Vy.js";const v=i(function({params:r}){const{collectionId:t}=r,{data:e}=s(t);return e?o.jsx("div",{className:"overflow-auto",children:o.jsx("div",{className:"flex p-4 gap-4",children:o.jsx(m,{itemType:t,fields:e.fields,isNew:!0})})}):null});export{v as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as e,a as d,x as y,y as U,v as le,z as ce,R as ue,w as
|
|
1
|
+
import{p as e,a as d,x as y,y as U,v as le,z as ce,R as ue,w as he,O as pe}from"./chunk-EF7DTUVF-CaKisB5m.js";import{u as xe,d as R,e as fe}from"./authSlice-DbkAmWS9.js";import{a as r,b as W,d as be,f as me,g as ge,h as je,u as ve,i as we}from"./utils-BLOeDrX7.js";import{R as Q,C as X,a as Z,T as Y,D as J,P as ee,O as te,u as ye}from"./index-ufEogtin.js";import{X as ae}from"./x-BI8YVnoZ.js";import{B as _}from"./button-1K9v0DJg.js";import{c as b}from"./createLucideIcon-BweVylaW.js";import{S as D,c as Ne,u as Ce}from"./index-opRxY4qB.js";import{R as Se,P as ke,a as _e,T as Me,b as ze,C as Re,A as De}from"./index-DfWKcpIl.js";import{u as Ee,c as Oe,P as E,a as Ae,b as Pe,d as Ie}from"./index-C4koMhA2.js";import{C as L}from"./chevron-down-CtNmiOMb.js";import{U as Te}from"./upload-C84AIRF5.js";import{E as Le}from"./external-link-LWykkN17.js";import{L as $e}from"./Loading-135S8vAs.js";import{C as Be}from"./chevron-right-haBQNeuE.js";import"./tslib.es6-De9GV7Vy.js";import"./index-BJ-ODQ_I.js";import"./index-B_LZxNEG.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -43,4 +43,4 @@ import{p as e,a as d,x as y,y as U,v as le,z as ce,R as ue,w as pe,O as he}from"
|
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const st=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],nt=b("square",st);function ot({...t}){return e.jsx(Q,{"data-slot":"dialog",...t})}function it({...t}){return e.jsx(ee,{"data-slot":"dialog-portal",...t})}function rt({className:t,...a}){return e.jsx(te,{"data-slot":"dialog-overlay",className:r("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function dt({className:t,children:a,...n}){return e.jsxs(it,{"data-slot":"dialog-portal",children:[e.jsx(rt,{}),e.jsxs(X,{"data-slot":"dialog-content",className:r("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...n,children:[a,e.jsxs(Z,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(ae,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function lt({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2 text-center sm:text-left",t),...a})}function ct({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function ut({className:t,...a}){return e.jsx(Y,{"data-slot":"dialog-title",className:r("text-lg leading-none font-semibold",t),...a})}function pt({className:t,...a}){return e.jsx(J,{"data-slot":"dialog-description",className:r("text-muted-foreground text-sm",t),...a})}const ht="#181717",xt=d.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=ht),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})}),ft="#85EA2D",$=d.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=ft),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"})]})});function bt({isOpen:t,setOpen:a}){return e.jsx(ot,{open:t,onOpenChange:n=>a(n),children:e.jsxs(dt,{children:[e.jsxs(lt,{children:[e.jsx(ut,{children:"Editorial"}),e.jsx(pt,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"https://lobelia-earth.github.io/editorial/",children:[e.jsx($,{size:14}),"Documentation"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"/doc/ui",children:[e.jsx($,{size:14}),"Swagger API UI"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(xt,{size:14}),"GitHub repository"]})})]}),e.jsx(ct,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(Ye,{size:14,className:"stroke-red-500 fill-red-500"})," by"," ",e.jsx(y,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}function mt({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(Se,{"data-slot":"separator-root",decorative:n,orientation:a,className:r("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...s})}function gt({...t}){return e.jsx(Q,{"data-slot":"sheet",...t})}function jt({...t}){return e.jsx(ee,{"data-slot":"sheet-portal",...t})}function vt({className:t,...a}){return e.jsx(te,{"data-slot":"sheet-overlay",className:r("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function wt({className:t,children:a,side:n="right",...s}){return e.jsxs(jt,{children:[e.jsx(vt,{}),e.jsxs(X,{"data-slot":"sheet-content",className:r("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,e.jsxs(Z,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(ae,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function yt({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:r("flex flex-col gap-1.5 p-4",t),...a})}function Nt({className:t,...a}){return e.jsx(Y,{"data-slot":"sheet-title",className:r("text-foreground font-semibold",t),...a})}function Ct({className:t,...a}){return e.jsx(J,{"data-slot":"sheet-description",className:r("text-muted-foreground text-sm",t),...a})}function se({delayDuration:t=0,...a}){return e.jsx(ke,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function St({...t}){return e.jsx(se,{children:e.jsx(_e,{"data-slot":"tooltip",...t})})}function kt({...t}){return e.jsx(Me,{"data-slot":"tooltip-trigger",...t})}function _t({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(ze,{children:e.jsxs(Re,{"data-slot":"tooltip-content",sideOffset:a,className:r("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...s,children:[n,e.jsx(De,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const z=768;function Mt(){const[t,a]=d.useState(void 0);return d.useEffect(()=>{const n=window.matchMedia(`(max-width: ${z-1}px)`),s=()=>{a(window.innerWidth<z)};return n.addEventListener("change",s),a(window.innerWidth<z),()=>n.removeEventListener("change",s)},[]),!!t}const zt="sidebar_state",Rt=3600*24*7,Dt="16rem",Et="18rem",Ot="3rem",At="b",ne=d.createContext(null);function O(){const t=d.useContext(ne);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Pt({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:i,...l}){const u=Mt(),[x,p]=d.useState(!1),[m,C]=d.useState(t),g=a??m,j=d.useCallback(h=>{const c=typeof h=="function"?h(g):h;n?n(c):C(c),document.cookie=`${zt}=${c}; path=/; max-age=${Rt}`},[n,g]),v=d.useCallback(()=>u?p(h=>!h):j(h=>!h),[u,j,p]);d.useEffect(()=>{const h=c=>{c.key===At&&(c.metaKey||c.ctrlKey)&&(c.preventDefault(),v())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[v]);const N=g?"expanded":"collapsed",S=d.useMemo(()=>({state:N,open:g,setOpen:j,isMobile:u,openMobile:x,setOpenMobile:p,toggleSidebar:v}),[N,g,j,u,x,p,v]);return e.jsx(ne.Provider,{value:S,children:e.jsx(se,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Dt,"--sidebar-width-icon":Ot,...o},className:r("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...l,children:i})})})}function It({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...i}){const{isMobile:l,state:u,openMobile:x,setOpenMobile:p}=O();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:r("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...i,children:o}):l?e.jsx(gt,{open:x,onOpenChange:p,...i,children:e.jsxs(wt,{"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":Et},side:t,children:[e.jsxs(yt,{className:"sr-only",children:[e.jsx(Nt,{children:"Sidebar"}),e.jsx(Ct,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":u==="collapsed"?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:r("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:r("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...i,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function Tt({className:t,onClick:a,...n}){const{toggleSidebar:s}=O();return e.jsxs(_,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:r("size-7",t),onClick:o=>{a?.(o),s()},...n,children:[e.jsx(at,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Lt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:r("flex flex-col gap-2 p-2",t),...a})}function $t({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:r("flex flex-col gap-2 p-2",t),...a})}function Bt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:r("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function k({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:r("relative flex w-full min-w-0 flex-col p-2",t),...a})}function B({className:t,asChild:a=!1,...n}){const s=a?D:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:r("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}function G({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:r("w-full text-sm",t),...a})}function H({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:r("flex w-full min-w-0 flex-col gap-1",t),...a})}function w({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:r("group/menu-item relative",t),...a})}const Gt=Ne("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 f({asChild:t=!1,isActive:a=!1,variant:n="default",size:s="default",tooltip:o,className:i,...l}){const u=t?D:"button",{isMobile:x,state:p}=O(),m=e.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:r(Gt({variant:n,size:s}),i),...l});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(St,{children:[e.jsx(kt,{asChild:!0,children:m}),e.jsx(_t,{side:"right",align:"center",hidden:p!=="collapsed"||x,...o})]})):m}function Ht({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:r("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function Ft({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...o}){const i=t?D:"a";return e.jsx(i,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":n,className:r("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",s),...o})}function F({singleton:t}){const{data:a}=W(),{data:n}=be();return a?(d.useMemo(()=>Object.entries(a).filter(([,s])=>t?s.singleton:!s.singleton),[a]),e.jsx(e.Fragment,{children:Object.entries(a).filter(([,s])=>t?s.singleton:!s.singleton).map(([s,o])=>e.jsx(Ht,{children:e.jsx(U,{to:t?`/admin/dashboard/${s}/default`:`/admin/dashboard/${s}`,className:({isActive:i,isPending:l})=>l?"pending":i?"active":"",children:({isActive:i})=>e.jsx(Ft,{isActive:i,asChild:!0,children:e.jsxs("div",{children:[e.jsx("span",{className:"inline-block overflow-hidden whitespace-nowrap text-ellipsis text-nowrap",children:o.displayName}),!t&&n?.[s]&&e.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1 min-w-[25px] text-right",children:Object.keys(n[s]).length})]})})})},o.displayName))})):null}var M="Collapsible",[qt,ba]=Oe(M),[Vt,A]=qt(M),oe=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:i,onOpenChange:l,...u}=t,[x,p]=Ee({prop:s,defaultProp:o??!1,onChange:l,caller:M});return e.jsx(Vt,{scope:n,disabled:i,contentId:ye(),open:x,onOpenToggle:d.useCallback(()=>p(m=>!m),[p]),children:e.jsx(E.div,{"data-state":I(x),"data-disabled":i?"":void 0,...u,ref:a})})});oe.displayName=M;var ie="CollapsibleTrigger",re=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=A(ie,n);return e.jsx(E.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":I(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...s,ref:a,onClick:Ae(t.onClick,o.onOpenToggle)})});re.displayName=ie;var P="CollapsibleContent",de=d.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=A(P,t.__scopeCollapsible);return e.jsx(Pe,{present:n||o.open,children:({present:i})=>e.jsx(Kt,{...s,ref:a,present:i})})});de.displayName=P;var Kt=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...i}=t,l=A(P,n),[u,x]=d.useState(s),p=d.useRef(null),m=Ce(a,p),C=d.useRef(0),g=C.current,j=d.useRef(0),v=j.current,N=l.open||u,S=d.useRef(N),h=d.useRef(void 0);return d.useEffect(()=>{const c=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(c)},[]),Ie(()=>{const c=p.current;if(c){h.current=h.current||{transitionDuration:c.style.transitionDuration,animationName:c.style.animationName},c.style.transitionDuration="0s",c.style.animationName="none";const T=c.getBoundingClientRect();C.current=T.height,j.current=T.width,S.current||(c.style.transitionDuration=h.current.transitionDuration,c.style.animationName=h.current.animationName),x(s)}},[l.open,s]),e.jsx(E.div,{"data-state":I(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!N,...i,ref:m,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:N&&o})});function I(t){return t?"open":"closed"}var Ut=oe;function q({...t}){return e.jsx(Ut,{"data-slot":"collapsible",...t})}function V({...t}){return e.jsx(re,{"data-slot":"collapsible-trigger",...t})}function K({...t}){return e.jsx(de,{"data-slot":"collapsible-content",...t})}function Wt(){const t=xe(),[a,n]=d.useState(!1),[s]=me(),[o]=ge(),[i]=je(),{data:l}=ve(),{data:u}=we(),x=R(p=>p.auth.role);return e.jsxs(It,{className:"z-50",children:[e.jsx(bt,{isOpen:a,setOpen:n}),e.jsx(Lt,{className:"h-14 justify-center",children:e.jsx(k,{children:e.jsx(y,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:l?.name})})}),e.jsxs(Bt,{children:[e.jsxs(k,{children:[e.jsx(B,{children:"Content"}),e.jsx(G,{children:e.jsxs(H,{children:[e.jsx(q,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(f,{className:"group",children:[e.jsx(Xe,{}),e.jsx("span",{children:"Collections"}),e.jsx(L,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(K,{children:e.jsx(F,{})})]})}),e.jsx(q,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(f,{className:"group",children:[e.jsx(nt,{}),e.jsx("span",{children:"Singles"}),e.jsx(L,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(K,{children:e.jsx(F,{singleton:!0})})]})}),e.jsx(w,{children:e.jsx(f,{asChild:!0,children:e.jsxs(y,{to:"/admin/dashboard/files",children:[e.jsx(We,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(w,{children:e.jsxs(f,{disabled:!0,children:[e.jsx(Ke,{}),e.jsx("span",{children:"Components"})]})})]})})]}),e.jsxs(k,{children:[e.jsx(B,{children:"Actions"}),e.jsx(G,{children:e.jsxs(H,{children:[x==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsxs(f,{className:"cursor-pointer",onClick:()=>o(),children:[e.jsx(He,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(w,{children:e.jsxs(f,{className:"cursor-pointer",onClick:()=>i(),children:[e.jsx(qe,{}),e.jsx("span",{children:"Push to repo"})]})})]}),e.jsx(w,{children:e.jsxs(f,{className:"cursor-pointer",onClick:()=>s(),children:[e.jsx(Te,{}),e.jsx("span",{children:"Publish"})]})})]})})]}),e.jsx(k,{})]}),e.jsxs($t,{children:[e.jsx(f,{asChild:!0,children:e.jsxs(y,{to:l?.previewUrl,children:["Preview",e.jsx(Le,{className:"ml-auto"})]})}),e.jsx(f,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),e.jsxs(f,{className:"cursor-pointer",onClick:()=>t(fe()),children:[e.jsx(et,{}),"Log out"]})]})]})}function Qt({children:t}){const a=le(),n=R(o=>o.auth.user),s=R(o=>o.auth.isLoading);return d.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?e.jsx($e,{}):t}function Xt(){const{pathname:t}=ce(),{data:a}=W(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,i)=>e.jsxs(ue.Fragment,{children:[i.length>1&&o>=1&&e.jsx(Be,{size:12,className:"text-gray-500 pt-[1px]"}),e.jsxs("p",{className:"text-sm leading-none tracking-tight capitalize text-gray-500 last:text-foreground",children:[o<i.length-1&&a[s]&&a[s].singleton&&(a[s]?a[s].displayName:s),o<i.length-1&&a[s]&&!a[s].singleton&&e.jsx(U,{to:`/admin/dashboard/${s}`,className:({isActive:l,isPending:u})=>u?"pending":l?"active":"",children:a[s]?a[s].displayName:s}),o===i.length-1&&(a[s]?a[s].displayName:s)]},s)]},o))}):null}const ma=pe(function(){return e.jsx(Qt,{children:e.jsxs(Pt,{className:"flex h-full",children:[e.jsx(Wt,{}),e.jsxs("main",{className:"flex flex-col flex-1 h-full w-0",children:[e.jsx("header",{className:"flex sticky bg-sidebar dark:bg-sidebar z-40 top-0 h-14 shrink-0 items-center gap-2 border-b",children:e.jsxs("div",{className:"flex items-center gap-2 px-3",children:[e.jsx(Tt,{}),e.jsx(mt,{orientation:"vertical",className:"h-4"}),e.jsx(Xt,{})]})}),e.jsx(he,{})]})]})})});export{ma as default};
|
|
46
|
+
*/const st=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],nt=b("square",st);function ot({...t}){return e.jsx(Q,{"data-slot":"dialog",...t})}function it({...t}){return e.jsx(ee,{"data-slot":"dialog-portal",...t})}function rt({className:t,...a}){return e.jsx(te,{"data-slot":"dialog-overlay",className:r("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function dt({className:t,children:a,...n}){return e.jsxs(it,{"data-slot":"dialog-portal",children:[e.jsx(rt,{}),e.jsxs(X,{"data-slot":"dialog-content",className:r("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...n,children:[a,e.jsxs(Z,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(ae,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function lt({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2 text-center sm:text-left",t),...a})}function ct({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function ut({className:t,...a}){return e.jsx(Y,{"data-slot":"dialog-title",className:r("text-lg leading-none font-semibold",t),...a})}function ht({className:t,...a}){return e.jsx(J,{"data-slot":"dialog-description",className:r("text-muted-foreground text-sm",t),...a})}const pt="#181717",xt=d.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=pt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})}),ft="#85EA2D",$=d.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=ft),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...o,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"})]})});function bt({isOpen:t,setOpen:a}){return e.jsx(ot,{open:t,onOpenChange:n=>a(n),children:e.jsxs(dt,{children:[e.jsxs(lt,{children:[e.jsx(ut,{children:"Editorial"}),e.jsx(ht,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"https://lobelia-earth.github.io/editorial/",children:[e.jsx($,{size:14}),"Documentation"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"/doc/ui",children:[e.jsx($,{size:14}),"Swagger API UI"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(xt,{size:14}),"GitHub repository"]})})]}),e.jsx(ct,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(Ye,{size:14,className:"stroke-red-500 fill-red-500"})," by"," ",e.jsx(y,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}function mt({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(Se,{"data-slot":"separator-root",decorative:n,orientation:a,className:r("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...s})}function gt({...t}){return e.jsx(Q,{"data-slot":"sheet",...t})}function jt({...t}){return e.jsx(ee,{"data-slot":"sheet-portal",...t})}function vt({className:t,...a}){return e.jsx(te,{"data-slot":"sheet-overlay",className:r("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function wt({className:t,children:a,side:n="right",...s}){return e.jsxs(jt,{children:[e.jsx(vt,{}),e.jsxs(X,{"data-slot":"sheet-content",className:r("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,e.jsxs(Z,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(ae,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function yt({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:r("flex flex-col gap-1.5 p-4",t),...a})}function Nt({className:t,...a}){return e.jsx(Y,{"data-slot":"sheet-title",className:r("text-foreground font-semibold",t),...a})}function Ct({className:t,...a}){return e.jsx(J,{"data-slot":"sheet-description",className:r("text-muted-foreground text-sm",t),...a})}function se({delayDuration:t=0,...a}){return e.jsx(ke,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function St({...t}){return e.jsx(se,{children:e.jsx(_e,{"data-slot":"tooltip",...t})})}function kt({...t}){return e.jsx(Me,{"data-slot":"tooltip-trigger",...t})}function _t({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(ze,{children:e.jsxs(Re,{"data-slot":"tooltip-content",sideOffset:a,className:r("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...s,children:[n,e.jsx(De,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const z=768;function Mt(){const[t,a]=d.useState(void 0);return d.useEffect(()=>{const n=window.matchMedia(`(max-width: ${z-1}px)`),s=()=>{a(window.innerWidth<z)};return n.addEventListener("change",s),a(window.innerWidth<z),()=>n.removeEventListener("change",s)},[]),!!t}const zt="sidebar_state",Rt=3600*24*7,Dt="16rem",Et="18rem",Ot="3rem",At="b",ne=d.createContext(null);function O(){const t=d.useContext(ne);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Pt({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:i,...l}){const u=Mt(),[x,h]=d.useState(!1),[m,C]=d.useState(t),g=a??m,j=d.useCallback(p=>{const c=typeof p=="function"?p(g):p;n?n(c):C(c),document.cookie=`${zt}=${c}; path=/; max-age=${Rt}`},[n,g]),v=d.useCallback(()=>u?h(p=>!p):j(p=>!p),[u,j,h]);d.useEffect(()=>{const p=c=>{c.key===At&&(c.metaKey||c.ctrlKey)&&(c.preventDefault(),v())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[v]);const N=g?"expanded":"collapsed",S=d.useMemo(()=>({state:N,open:g,setOpen:j,isMobile:u,openMobile:x,setOpenMobile:h,toggleSidebar:v}),[N,g,j,u,x,h,v]);return e.jsx(ne.Provider,{value:S,children:e.jsx(se,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Dt,"--sidebar-width-icon":Ot,...o},className:r("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...l,children:i})})})}function It({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...i}){const{isMobile:l,state:u,openMobile:x,setOpenMobile:h}=O();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:r("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...i,children:o}):l?e.jsx(gt,{open:x,onOpenChange:h,...i,children:e.jsxs(wt,{"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":Et},side:t,children:[e.jsxs(yt,{className:"sr-only",children:[e.jsx(Nt,{children:"Sidebar"}),e.jsx(Ct,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":u==="collapsed"?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:r("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:r("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...i,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function Tt({className:t,onClick:a,...n}){const{toggleSidebar:s}=O();return e.jsxs(_,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:r("size-7",t),onClick:o=>{a?.(o),s()},...n,children:[e.jsx(at,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Lt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:r("flex flex-col gap-2 p-2",t),...a})}function $t({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:r("flex flex-col gap-2 p-2",t),...a})}function Bt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:r("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function k({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:r("relative flex w-full min-w-0 flex-col p-2",t),...a})}function B({className:t,asChild:a=!1,...n}){const s=a?D:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:r("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}function G({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:r("w-full text-sm",t),...a})}function H({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:r("flex w-full min-w-0 flex-col gap-1",t),...a})}function w({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:r("group/menu-item relative",t),...a})}const Gt=Ne("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 f({asChild:t=!1,isActive:a=!1,variant:n="default",size:s="default",tooltip:o,className:i,...l}){const u=t?D:"button",{isMobile:x,state:h}=O(),m=e.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:r(Gt({variant:n,size:s}),i),...l});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(St,{children:[e.jsx(kt,{asChild:!0,children:m}),e.jsx(_t,{side:"right",align:"center",hidden:h!=="collapsed"||x,...o})]})):m}function Ht({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:r("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function Ft({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...o}){const i=t?D:"a";return e.jsx(i,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":n,className:r("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",s),...o})}function F({singleton:t}){const{data:a}=W(),{data:n}=be();if(!a)return null;const s=d.useMemo(()=>Object.entries(a).filter(([,o])=>t?o.singleton:!o.singleton).toSorted(([o],[i])=>o.localeCompare(i)),[a,t]);return e.jsx(e.Fragment,{children:s.map(([o,i])=>e.jsx(Ht,{children:e.jsx(U,{to:t?`/admin/dashboard/${o}/default`:`/admin/dashboard/${o}`,className:({isActive:l,isPending:u})=>u?"pending":l?"active":"",children:({isActive:l})=>e.jsx(Ft,{isActive:l,asChild:!0,children:e.jsxs("div",{children:[e.jsx("span",{className:"inline-block overflow-hidden whitespace-nowrap text-ellipsis text-nowrap",children:i.displayName}),!t&&n?.[o]&&e.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1 min-w-[25px] text-right",children:Object.keys(n[o]).length})]})})})},i.displayName))})}var M="Collapsible",[qt,fa]=Oe(M),[Vt,A]=qt(M),oe=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:i,onOpenChange:l,...u}=t,[x,h]=Ee({prop:s,defaultProp:o??!1,onChange:l,caller:M});return e.jsx(Vt,{scope:n,disabled:i,contentId:ye(),open:x,onOpenToggle:d.useCallback(()=>h(m=>!m),[h]),children:e.jsx(E.div,{"data-state":I(x),"data-disabled":i?"":void 0,...u,ref:a})})});oe.displayName=M;var ie="CollapsibleTrigger",re=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=A(ie,n);return e.jsx(E.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":I(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...s,ref:a,onClick:Ae(t.onClick,o.onOpenToggle)})});re.displayName=ie;var P="CollapsibleContent",de=d.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=A(P,t.__scopeCollapsible);return e.jsx(Pe,{present:n||o.open,children:({present:i})=>e.jsx(Kt,{...s,ref:a,present:i})})});de.displayName=P;var Kt=d.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...i}=t,l=A(P,n),[u,x]=d.useState(s),h=d.useRef(null),m=Ce(a,h),C=d.useRef(0),g=C.current,j=d.useRef(0),v=j.current,N=l.open||u,S=d.useRef(N),p=d.useRef(void 0);return d.useEffect(()=>{const c=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(c)},[]),Ie(()=>{const c=h.current;if(c){p.current=p.current||{transitionDuration:c.style.transitionDuration,animationName:c.style.animationName},c.style.transitionDuration="0s",c.style.animationName="none";const T=c.getBoundingClientRect();C.current=T.height,j.current=T.width,S.current||(c.style.transitionDuration=p.current.transitionDuration,c.style.animationName=p.current.animationName),x(s)}},[l.open,s]),e.jsx(E.div,{"data-state":I(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!N,...i,ref:m,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:N&&o})});function I(t){return t?"open":"closed"}var Ut=oe;function q({...t}){return e.jsx(Ut,{"data-slot":"collapsible",...t})}function V({...t}){return e.jsx(re,{"data-slot":"collapsible-trigger",...t})}function K({...t}){return e.jsx(de,{"data-slot":"collapsible-content",...t})}function Wt(){const t=xe(),[a,n]=d.useState(!1),[s]=me(),[o]=ge(),[i]=je(),{data:l}=ve(),{data:u}=we(),x=R(h=>h.auth.user);return e.jsxs(It,{className:"z-50",children:[e.jsx(bt,{isOpen:a,setOpen:n}),e.jsx(Lt,{className:"h-14 justify-center",children:e.jsx(k,{children:e.jsx(y,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:l?.name})})}),e.jsxs(Bt,{children:[e.jsxs(k,{children:[e.jsx(B,{children:"Content"}),e.jsx(G,{children:e.jsxs(H,{children:[e.jsx(q,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(f,{className:"group",children:[e.jsx(Xe,{}),e.jsx("span",{children:"Collections"}),e.jsx(L,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(K,{children:e.jsx(F,{})})]})}),e.jsx(q,{className:"group/collapsible",children:e.jsxs(w,{children:[e.jsx(V,{asChild:!0,children:e.jsxs(f,{className:"group",children:[e.jsx(nt,{}),e.jsx("span",{children:"Singles"}),e.jsx(L,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(K,{children:e.jsx(F,{singleton:!0})})]})}),e.jsx(w,{children:e.jsx(f,{asChild:!0,children:e.jsxs(y,{to:"/admin/dashboard/files",children:[e.jsx(We,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(w,{children:e.jsxs(f,{disabled:!0,children:[e.jsx(Ke,{}),e.jsx("span",{children:"Components"})]})})]})})]}),e.jsxs(k,{children:[e.jsx(B,{children:"Actions"}),e.jsx(G,{children:e.jsxs(H,{children:[x?.role==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsxs(f,{className:"cursor-pointer",onClick:()=>o(),children:[e.jsx(He,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(w,{children:e.jsxs(f,{className:"cursor-pointer",onClick:()=>i({author:x.email}),children:[e.jsx(qe,{}),e.jsx("span",{children:"Push to repo"})]})})]}),e.jsx(w,{children:e.jsxs(f,{className:"cursor-pointer",onClick:()=>s(),children:[e.jsx(Te,{}),e.jsx("span",{children:"Publish"})]})})]})})]}),e.jsx(k,{})]}),e.jsxs($t,{children:[e.jsx(f,{asChild:!0,children:e.jsxs(y,{to:l?.previewUrl,children:["Preview",e.jsx(Le,{className:"ml-auto"})]})}),e.jsx(f,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),e.jsxs(f,{className:"cursor-pointer",onClick:()=>t(fe()),children:[e.jsx(et,{}),"Log out"]})]})]})}function Qt({children:t}){const a=le(),n=R(o=>o.auth.user),s=R(o=>o.auth.isLoading);return d.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?e.jsx($e,{}):t}function Xt(){const{pathname:t}=ce(),{data:a}=W(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,i)=>e.jsxs(ue.Fragment,{children:[i.length>1&&o>=1&&e.jsx(Be,{size:12,className:"text-gray-500 pt-[1px]"}),e.jsxs("p",{className:"text-sm leading-none tracking-tight capitalize text-gray-500 last:text-foreground",children:[o<i.length-1&&a[s]&&a[s].singleton&&(a[s]?a[s].displayName:s),o<i.length-1&&a[s]&&!a[s].singleton&&e.jsx(U,{to:`/admin/dashboard/${s}`,className:({isActive:l,isPending:u})=>u?"pending":l?"active":"",children:a[s]?a[s].displayName:s}),o===i.length-1&&(a[s]?a[s].displayName:s)]},s)]},o))}):null}const ba=he(function(){return e.jsx(Qt,{children:e.jsxs(Pt,{className:"flex h-full",children:[e.jsx(Wt,{}),e.jsxs("main",{className:"flex flex-col flex-1 h-full w-0",children:[e.jsx("header",{className:"flex sticky bg-sidebar dark:bg-sidebar z-40 top-0 h-14 shrink-0 items-center gap-2 border-b",children:e.jsxs("div",{className:"flex items-center gap-2 px-3",children:[e.jsx(Tt,{}),e.jsx(mt,{orientation:"vertical",className:"h-4"}),e.jsx(Xt,{})]})}),e.jsx(pe,{})]})]})})});export{ba as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as e,p as o}from"./chunk-EF7DTUVF-CaKisB5m.js";import{F as r}from"./files-DZvtTqEL.js";import"./utils-BLOeDrX7.js";import"./index-opRxY4qB.js";import"./upload-C84AIRF5.js";import"./createLucideIcon-BweVylaW.js";import"./trash-BPu8wmdf.js";import"./chevron-down-CtNmiOMb.js";const n=e(function(){return o.jsx("div",{className:"overflow-auto flex flex-1 p-4 gap-4",children:o.jsx("div",{className:"flex flex-col flex-1 gap-8",children:o.jsx(r,{})})})});export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as r}from"./chunk-EF7DTUVF-CaKisB5m.js";import{B as m}from"./button-
|
|
1
|
+
import{p as r}from"./chunk-EF7DTUVF-CaKisB5m.js";import{B as m}from"./button-1K9v0DJg.js";import{P as n,a as p,f as l,b as c,C as f}from"./popover--B9JRpo3.js";import{a as u}from"./utils-BLOeDrX7.js";import{C as x}from"./calendar-DVBBYeOW.js";import"./index-opRxY4qB.js";import"./createLucideIcon-BweVylaW.js";import"./chevron-right-haBQNeuE.js";import"./chevron-down-CtNmiOMb.js";import"./index-COYoknn5.js";import"./index-C4koMhA2.js";import"./index-BJ-ODQ_I.js";import"./index-ufEogtin.js";import"./tslib.es6-De9GV7Vy.js";import"./index-B_LZxNEG.js";function F({id:o,date:t,onDateChange:e,placeholder:s="Pick a date",disabled:a=!1,className:i}){return r.jsxs(n,{children:[r.jsx(p,{asChild:!0,children:r.jsxs(m,{variant:"outline",className:u("w-full justify-start text-left font-normal",!t&&"text-muted-foreground",i),disabled:a,children:[r.jsx(x,{className:"mr-2 h-4 w-4"}),t?l(t,"PPP"):r.jsx("span",{children:s})]})}),r.jsx(c,{className:"w-auto p-0",children:r.jsx(f,{id:o,mode:"single",selected:t,onSelect:e,initialFocus:!0})})]})}export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,p as t}from"./chunk-EF7DTUVF-CaKisB5m.js";import{B as N}from"./button-
|
|
1
|
+
import{a,p as t}from"./chunk-EF7DTUVF-CaKisB5m.js";import{B as N}from"./button-1K9v0DJg.js";import{f as c,P as C,a as H,b,C as S}from"./popover--B9JRpo3.js";import{I as g}from"./types-D9rc6L8-.js";import{a as k}from"./utils-BLOeDrX7.js";import{C as E}from"./calendar-DVBBYeOW.js";import"./index-opRxY4qB.js";import"./createLucideIcon-BweVylaW.js";import"./chevron-right-haBQNeuE.js";import"./chevron-down-CtNmiOMb.js";import"./index-COYoknn5.js";import"./index-C4koMhA2.js";import"./index-BJ-ODQ_I.js";import"./index-ufEogtin.js";import"./tslib.es6-De9GV7Vy.js";import"./index-B_LZxNEG.js";function O({id:d,date:e,onDateTimeChange:o,placeholder:x="Pick a date and time",disabled:u=!1,className:j}){const[s,m]=a.useState(e),[l,p]=a.useState(e?c(e,"HH:mm"):"12:00");a.useEffect(()=>{m(e),e&&p(c(e,"HH:mm"))},[e]);const h=a.useCallback(r=>{const i=r.target.value;if(p(i),!s)return;const[n,P]=i.split(":").map(Number),f=new Date(s);f.setHours(n,P,0,0),o?.(f)},[s,o]),v=a.useCallback(r=>{if(!r){m(void 0),o?.(void 0);return}const[i,n]=l.split(":").map(Number);r.setHours(i,n,0,0),m(r),o?.(r)},[l,o]);return t.jsxs("div",{className:"flex gap-2",children:[t.jsx(g,{type:"time",value:l,onChange:h,disabled:u||!s,className:"w-32"}),t.jsxs(C,{children:[t.jsx(H,{asChild:!0,children:t.jsxs(N,{variant:"outline",className:k("flex-1 justify-start text-left font-normal",!s&&"text-muted-foreground",j),disabled:u,children:[t.jsx(E,{className:"mr-2 h-4 w-4"}),s?c(s,"PPP"):t.jsx("span",{children:x})]})}),t.jsx(b,{className:"w-auto p-0",children:t.jsx(S,{id:d,mode:"single",selected:s,onSelect:v,initialFocus:!0})})]})]})}export{O as default};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{p as e,a as g,x as w}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as v,t as k,v as F,w as z,x as C,u as $,y as M,o as D}from"./utils-BLOeDrX7.js";import{S as U,c as _}from"./index-opRxY4qB.js";import{U as y}from"./upload-C84AIRF5.js";import{F as H,T as L}from"./trash-BPu8wmdf.js";import{c as m}from"./createLucideIcon-BweVylaW.js";import{C as S}from"./chevron-down-CtNmiOMb.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 T=[["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"}]],I=m("copy",T);/**
|
|
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 V=[["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"}]],P=m("file-text",V);/**
|
|
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 E=[["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"}]],q=m("file",E);/**
|
|
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 Z=[["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"}]],G=m("folder-open",Z);/**
|
|
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:"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"}]],R=m("folder",Q),W=_("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-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 transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function B({className:s,variant:i,asChild:l=!1,...o}){const n=l?U:"span";return e.jsx(n,{"data-slot":"badge",className:v(W({variant:i}),s),...o})}const O=["txt","md","html","pdf"],J=["svg","webp","png","jpeg","jpg"],K=[{Icon:H,test:s=>J.some(i=>s.name.endsWith(i))},{Icon:P,test:s=>O.some(i=>s.name.endsWith(i))}],X={Icon:q},j=({node:s,level:i=0,onDelete:l,onChange:o,disableActions:n,onUpload:p,onCreateFolder:f})=>{const[d,h]=g.useState(!1),{data:u}=$(),a=K.find(r=>r.test(s))??X,t=s.type==="directory",c=t||o?"div":w,b=()=>{t&&h(!d)},N=r=>{const x=r.target.files;x&&p&&p(s.path,x)};return e.jsxs("div",{className:"select-none",children:[e.jsxs(c,{to:`/${s.relativePath}`,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:t?b:o?()=>o(s.isLarge?`${u?.largeFilesUrl}/${s.relativePath}`:s.relativePath):void 0,children:[t?e.jsx(S,{size:16,className:v("transition-transform",{"rotate-180":d})}):e.jsx("div",{className:"w-4"}),e.jsxs("div",{className:"flex flex-grow w-24 items-center gap-2 ml-2",children:[t?d?e.jsx(G,{size:16,className:"text-yellow-500"}):e.jsx(R,{size:16,className:"text-yellow-500"}):e.jsx(a.Icon,{size:16,className:" text-gray-500"}),e.jsxs("span",{className:"flex gap-2 items-center text-sm whitespace-nowrap text-ellipsis overflow-hidden w-full",children:[!t&&s.isLarge&&e.jsx(B,{variant:"outline",children:"Large"}),s.name]})]}),e.jsx("div",{className:"flex w-24 justify-end gap-2",children:e.jsx("span",{className:"text-sm text-gray-500",children:t?"--":M(s.size)})}),!n&&e.jsxs("div",{className:"flex items-center gap-1 ml-4 group-hover:visible invisible z-50",children:[t&&e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"file",multiple:!0,onChange:N,className:"hidden",id:`dir-upload-${s.name}-${i}`}),e.jsxs("label",{htmlFor:`dir-upload-${s.name}-${i}`,className:"hover:text-blue-500 p-1 hover:bg-muted rounded-sm cursor-pointer",onClick:r=>{r.stopPropagation()},children:[e.jsx(y,{size:16}),e.jsx("span",{className:"sr-only",children:"Upload files to this folder"})]})]}),e.jsxs("button",{className:D("hover:text-yellow-500 p-1 hover:bg-muted rounded-sm",t&&"hidden"),onClick:r=>{r.preventDefault(),r.stopPropagation(),navigator.clipboard.writeText(s.path)},children:[e.jsx(I,{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:r=>{r.preventDefault(),r.stopPropagation(),l(s.path)},children:[e.jsx(L,{size:16}),e.jsxs("span",{className:"sr-only",children:["Delete this ",t?"folder":"file"]})]})]})]}),t&&d&&s.children&&e.jsx("div",{children:s.children.map((r,x)=>e.jsx(j,{node:r,level:i+1,onDelete:l,onChange:o,disableActions:n,onUpload:p,onCreateFolder:f},`${r.name}-${x}`))})]})};function ie({disableActions:s,onChange:i}){const{data:l}=k(),[o]=F(),[n]=z(),[p]=C(),f=async a=>{const t=a.target.files;if(t)try{await n({files:t}).unwrap()}catch(c){console.error("Upload failed:",c)}},d=async(a,t)=>{try{await n({files:t,path:a}).unwrap()}catch(c){console.error("Upload failed:",c)}},h=async(a,t)=>{try{await p({name:t,path:a}).unwrap()}catch(c){console.error("Create folder failed:",c)}},u=g.useMemo(()=>l?.toSorted((a,t)=>a.type==="directory"&&t.type!=="directory"?-1:a.type!=="directory"&&t.type==="directory"?1:a.name.localeCompare(t.name)).map(a=>e.jsx(j,{node:a,onDelete:o,onChange:i,disableActions:s,onUpload:d,onCreateFolder:h},a.name)),[l,s,i]);return 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"})}),!s&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"file",multiple:!0,onChange:f,className:"hidden",id:"file-upload"}),e.jsxs("label",{htmlFor:"file-upload",className:"hover:text-blue-500 p-1 hover:bg-muted rounded-sm cursor-pointer",children:[e.jsx(y,{size:16}),e.jsx("span",{className:"sr-only",children:"Upload files"})]})]})]}),u]})}export{ie as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,p as e,w as f,v as g}from"./chunk-EF7DTUVF-CaKisB5m.js";import{S as b,L as N}from"./Loading-135S8vAs.js";import{B as y}from"./button-1K9v0DJg.js";import{o as w,b as F,s as d,u as L,t as v,F as C,a as n,c as t,d as x,e as i,I as p,f as m,C as S}from"./types-D9rc6L8-.js";import{u as E,d as c,l as k}from"./authSlice-DbkAmWS9.js";import"./utils-BLOeDrX7.js";import"./createLucideIcon-BweVylaW.js";import"./index-opRxY4qB.js";import"./index-C4koMhA2.js";import"./index-BJ-ODQ_I.js";import"./tslib.es6-De9GV7Vy.js";const P=w({email:d().nonempty("Please enter your email").email(),password:d().nonempty("Please enter your password"),remember:F()});function A(){"use no memo";const o=E(),r=c(s=>s.auth.isLoading),a=L({resolver:v(P),disabled:r,defaultValues:{email:"",password:"",remember:!1}}),l=u.useCallback(({email:s,password:h,remember:j})=>{o(k({email:s,password:h,remember:j}))},[o]);return e.jsx("div",{className:"flex flex-col",children:e.jsx(C,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[e.jsx(n,{control:a.control,name:"email",rules:{required:!0},render:({field:s})=>e.jsxs(t,{children:[e.jsx(x,{className:"flex gap-1 items-baseline",children:"Email"}),e.jsx(i,{children:e.jsx(p,{placeholder:"callasmaria@example.com",...s})}),e.jsx(m,{})]})}),e.jsx(n,{name:"password",control:a.control,rules:{required:!0},render:({field:s})=>e.jsxs(t,{children:[e.jsx(x,{className:"flex gap-1 items-baseline",children:"Password"}),e.jsx(i,{children:e.jsx(p,{type:"password",...s})}),e.jsx(m,{})]})}),e.jsx(n,{name:"remember",control:a.control,render:({field:s})=>e.jsxs(t,{children:[e.jsx(i,{children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(S,{id:"remember",checked:s.value,onCheckedChange:s.onChange}),e.jsx("label",{htmlFor:"remember",className:"text-sm leading-none",children:"Remember me"})]})}),e.jsx(m,{})]})}),e.jsx(y,{type:"submit",disabled:!a.formState.isValid||r,className:"w-full",children:r?e.jsx(b,{className:"absolute"}):"Login"})]})})})}const H=f(function(){const r=g(),a=c(s=>s.auth.user),l=c(s=>s.auth.isLoading);return u.useEffect(()=>{a&&r("/admin/dashboard")},[r,a]),l||a?e.jsx(N,{message:"Logging in..."}):e.jsx("div",{className:"flex w-full h-full",children:e.jsxs("div",{className:"self-center space-y-8 w-72 mx-auto",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight leading-none",children:"Editorial Admin"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your details below to login"})]}),e.jsx(A,{})]})})});export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R,p as X}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as Ae}from"./index-BJ-ODQ_I.js";import{P as At,c as be,e as Re,d as $t}from"./index-BNiwB2Xo.js";import{u as It}from"./index-DgN6jnv0.js";import{d as Pe}from"./index-N8jzdZDg.js";const Ce=["top","right","bottom","left"],Z=Math.min,H=Math.max,at=Math.round,ct=Math.floor,z=t=>({x:t,y:t}),Oe={left:"right",right:"left",bottom:"top",top:"bottom"},Se={start:"end",end:"start"};function xt(t,e,n){return H(t,Z(e,n))}function q(t,e){return typeof t=="function"?t(e):t}function U(t){return t.split("-")[0]}function tt(t){return t.split("-")[1]}function bt(t){return t==="x"?"y":"x"}function Rt(t){return t==="y"?"height":"width"}const Ee=new Set(["top","bottom"]);function j(t){return Ee.has(U(t))?"y":"x"}function Pt(t){return bt(j(t))}function De(t,e,n){n===void 0&&(n=!1);const o=tt(t),i=Pt(t),r=Rt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ft(s)),[s,ft(s)]}function Le(t){const e=ft(t);return[yt(t),e,yt(e)]}function yt(t){return t.replace(/start|end/g,e=>Se[e])}const kt=["left","right"],Nt=["right","left"],Te=["top","bottom"],Me=["bottom","top"];function $e(t,e,n){switch(t){case"top":case"bottom":return n?e?Nt:kt:e?kt:Nt;case"left":case"right":return e?Te:Me;default:return[]}}function ke(t,e,n,o){const i=tt(t);let r=$e(U(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(yt)))),r}function ft(t){return t.replace(/left|right|bottom|top/g,e=>Oe[e])}function Ne(t){return{top:0,right:0,bottom:0,left:0,...t}}function Yt(t){return typeof t!="number"?Ne(t):{top:t,right:t,bottom:t,left:t}}function ut(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Ft(t,e,n){let{reference:o,floating:i}=t;const r=j(e),s=Pt(e),c=Rt(s),a=U(e),l=r==="y",f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[c]/2-i[c]/2;let d;switch(a){case"top":d={x:f,y:o.y-i.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-i.width,y:u};break;default:d={x:o.x,y:o.y}}switch(tt(e)){case"start":d[s]-=p*(n&&l?-1:1);break;case"end":d[s]+=p*(n&&l?-1:1);break}return d}const Fe=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=Ft(l,o,a),p=o,d={},m=0;for(let h=0;h<c.length;h++){const{name:w,fn:g}=c[h],{x,y:A,data:y,reset:v}=await g({x:f,y:u,initialPlacement:o,placement:p,strategy:i,middlewareData:d,rects:l,platform:s,elements:{reference:t,floating:e}});f=x??f,u=A??u,d={...d,[w]:{...d[w],...y}},v&&m<=50&&(m++,typeof v=="object"&&(v.placement&&(p=v.placement),v.rects&&(l=v.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:f,y:u}=Ft(l,p,a)),h=-1)}return{x:f,y:u,placement:p,strategy:i,middlewareData:d}};async function ot(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:c,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:p=!1,padding:d=0}=q(e,t),m=Yt(d),w=c[p?u==="floating"?"reference":"floating":u],g=ut(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(w)))==null||n?w:w.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:l,rootBoundary:f,strategy:a})),x=u==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),y=await(r.isElement==null?void 0:r.isElement(A))?await(r.getScale==null?void 0:r.getScale(A))||{x:1,y:1}:{x:1,y:1},v=ut(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:A,strategy:a}):x);return{top:(g.top-v.top+m.top)/y.y,bottom:(v.bottom-g.bottom+m.bottom)/y.y,left:(g.left-v.left+m.left)/y.x,right:(v.right-g.right+m.right)/y.x}}const He=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:a}=e,{element:l,padding:f=0}=q(t,e)||{};if(l==null)return{};const u=Yt(f),p={x:n,y:o},d=Pt(i),m=Rt(d),h=await s.getDimensions(l),w=d==="y",g=w?"top":"left",x=w?"bottom":"right",A=w?"clientHeight":"clientWidth",y=r.reference[m]+r.reference[d]-p[d]-r.floating[m],v=p[d]-r.reference[d],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let P=C?C[A]:0;(!P||!await(s.isElement==null?void 0:s.isElement(C)))&&(P=c.floating[A]||r.floating[m]);const T=y/2-v/2,N=P/2-h[m]/2-1,L=Z(u[g],N),$=Z(u[x],N),k=L,S=P-h[m]-$,O=P/2-h[m]/2+T,F=xt(k,O,S),E=!a.arrow&&tt(i)!=null&&O!==F&&r.reference[m]/2-(O<k?L:$)-h[m]/2<0,D=E?O<k?O-k:O-S:0;return{[d]:p[d]+D,data:{[d]:F,centerOffset:O-F-D,...E&&{alignmentOffset:D}},reset:E}}}),We=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:a,elements:l}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...w}=q(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const g=U(i),x=j(c),A=U(c)===c,y=await(a.isRTL==null?void 0:a.isRTL(l.floating)),v=p||(A||!h?[ft(c)]:Le(c)),C=m!=="none";!p&&C&&v.push(...ke(c,h,m,y));const P=[c,...v],T=await ot(e,w),N=[];let L=((o=r.flip)==null?void 0:o.overflows)||[];if(f&&N.push(T[g]),u){const O=De(i,s,y);N.push(T[O[0]],T[O[1]])}if(L=[...L,{placement:i,overflows:N}],!N.every(O=>O<=0)){var $,k;const O=((($=r.flip)==null?void 0:$.index)||0)+1,F=P[O];if(F&&(!(u==="alignment"?x!==j(F):!1)||L.every(b=>b.overflows[0]>0&&j(b.placement)===x)))return{data:{index:O,overflows:L},reset:{placement:F}};let E=(k=L.filter(D=>D.overflows[0]<=0).sort((D,b)=>D.overflows[1]-b.overflows[1])[0])==null?void 0:k.placement;if(!E)switch(d){case"bestFit":{var S;const D=(S=L.filter(b=>{if(C){const M=j(b.placement);return M===x||M==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(M=>M>0).reduce((M,V)=>M+V,0)]).sort((b,M)=>b[1]-M[1])[0])==null?void 0:S[0];D&&(E=D);break}case"initialPlacement":E=c;break}if(i!==E)return{reset:{placement:E}}}return{}}}};function Ht(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Wt(t){return Ce.some(e=>t[e]>=0)}const _e=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=q(t,e);switch(o){case"referenceHidden":{const r=await ot(e,{...i,elementContext:"reference"}),s=Ht(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Wt(s)}}}case"escaped":{const r=await ot(e,{...i,altBoundary:!0}),s=Ht(r,n.floating);return{data:{escapedOffsets:s,escaped:Wt(s)}}}default:return{}}}}},Xt=new Set(["left","top"]);async function Be(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=U(n),c=tt(n),a=j(n)==="y",l=Xt.has(s)?-1:1,f=r&&a?-1:1,u=q(e,t);let{mainAxis:p,crossAxis:d,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof m=="number"&&(d=c==="end"?m*-1:m),a?{x:d*f,y:p*l}:{x:p*l,y:d*f}}const Ve=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:c}=e,a=await Be(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},je=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x:g,y:x}=w;return{x:g,y:x}}},...a}=q(t,e),l={x:n,y:o},f=await ot(e,a),u=j(U(i)),p=bt(u);let d=l[p],m=l[u];if(r){const w=p==="y"?"top":"left",g=p==="y"?"bottom":"right",x=d+f[w],A=d-f[g];d=xt(x,d,A)}if(s){const w=u==="y"?"top":"left",g=u==="y"?"bottom":"right",x=m+f[w],A=m-f[g];m=xt(x,m,A)}const h=c.fn({...e,[p]:d,[u]:m});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[p]:r,[u]:s}}}}}},ze=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:c=0,mainAxis:a=!0,crossAxis:l=!0}=q(t,e),f={x:n,y:o},u=j(i),p=bt(u);let d=f[p],m=f[u];const h=q(c,e),w=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(a){const A=p==="y"?"height":"width",y=r.reference[p]-r.floating[A]+w.mainAxis,v=r.reference[p]+r.reference[A]-w.mainAxis;d<y?d=y:d>v&&(d=v)}if(l){var g,x;const A=p==="y"?"width":"height",y=Xt.has(U(i)),v=r.reference[u]-r.floating[A]+(y&&((g=s.offset)==null?void 0:g[u])||0)+(y?0:w.crossAxis),C=r.reference[u]+r.reference[A]+(y?0:((x=s.offset)==null?void 0:x[u])||0)-(y?w.crossAxis:0);m<v?m=v:m>C&&(m=C)}return{[p]:d,[u]:m}}}},Ie=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:c}=e,{apply:a=()=>{},...l}=q(t,e),f=await ot(e,l),u=U(i),p=tt(i),d=j(i)==="y",{width:m,height:h}=r.floating;let w,g;u==="top"||u==="bottom"?(w=u,g=p===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(g=u,w=p==="end"?"top":"bottom");const x=h-f.top-f.bottom,A=m-f.left-f.right,y=Z(h-f[w],x),v=Z(m-f[g],A),C=!e.middlewareData.shift;let P=y,T=v;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(T=A),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(P=x),C&&!p){const L=H(f.left,0),$=H(f.right,0),k=H(f.top,0),S=H(f.bottom,0);d?T=m-2*(L!==0||$!==0?L+$:H(f.left,f.right)):P=h-2*(k!==0||S!==0?k+S:H(f.top,f.bottom))}await a({...e,availableWidth:T,availableHeight:P});const N=await s.getDimensions(c.floating);return m!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function mt(){return typeof window<"u"}function et(t){return qt(t)?(t.nodeName||"").toLowerCase():"#document"}function W(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Y(t){var e;return(e=(qt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qt(t){return mt()?t instanceof Node||t instanceof W(t).Node:!1}function _(t){return mt()?t instanceof Element||t instanceof W(t).Element:!1}function I(t){return mt()?t instanceof HTMLElement||t instanceof W(t).HTMLElement:!1}function _t(t){return!mt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof W(t).ShadowRoot}const Ye=new Set(["inline","contents"]);function rt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=B(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!Ye.has(i)}const Xe=new Set(["table","td","th"]);function qe(t){return Xe.has(et(t))}const Ue=[":popover-open",":modal"];function pt(t){return Ue.some(e=>{try{return t.matches(e)}catch{return!1}})}const Ze=["transform","translate","scale","rotate","perspective"],Ke=["transform","translate","scale","rotate","perspective","filter"],Ge=["paint","layout","strict","content"];function Ct(t){const e=Ot(),n=_(t)?B(t):t;return Ze.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Ke.some(o=>(n.willChange||"").includes(o))||Ge.some(o=>(n.contain||"").includes(o))}function Je(t){let e=K(t);for(;I(e)&&!Q(e);){if(Ct(e))return e;if(pt(e))return null;e=K(e)}return null}function Ot(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Qe=new Set(["html","body","#document"]);function Q(t){return Qe.has(et(t))}function B(t){return W(t).getComputedStyle(t)}function ht(t){return _(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function K(t){if(et(t)==="html")return t;const e=t.assignedSlot||t.parentNode||_t(t)&&t.host||Y(t);return _t(e)?e.host:e}function Ut(t){const e=K(t);return Q(e)?t.ownerDocument?t.ownerDocument.body:t.body:I(e)&&rt(e)?e:Ut(e)}function it(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ut(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=W(i);if(r){const c=vt(s);return e.concat(s,s.visualViewport||[],rt(i)?i:[],c&&n?it(c):[])}return e.concat(i,it(i,[],n))}function vt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Zt(t){const e=B(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=I(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=at(n)!==r||at(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function St(t){return _(t)?t:t.contextElement}function J(t){const e=St(t);if(!I(e))return z(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Zt(e);let s=(r?at(n.width):n.width)/o,c=(r?at(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const tn=z(0);function Kt(t){const e=W(t);return!Ot()||!e.visualViewport?tn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function en(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==W(t)?!1:e}function G(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=St(t);let s=z(1);e&&(o?_(o)&&(s=J(o)):s=J(t));const c=en(r,n,o)?Kt(r):z(0);let a=(i.left+c.x)/s.x,l=(i.top+c.y)/s.y,f=i.width/s.x,u=i.height/s.y;if(r){const p=W(r),d=o&&_(o)?W(o):o;let m=p,h=vt(m);for(;h&&o&&d!==m;){const w=J(h),g=h.getBoundingClientRect(),x=B(h),A=g.left+(h.clientLeft+parseFloat(x.paddingLeft))*w.x,y=g.top+(h.clientTop+parseFloat(x.paddingTop))*w.y;a*=w.x,l*=w.y,f*=w.x,u*=w.y,a+=A,l+=y,m=W(h),h=vt(m)}}return ut({width:f,height:u,x:a,y:l})}function Et(t,e){const n=ht(t).scrollLeft;return e?e.left+n:G(Y(t)).left+n}function Gt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=o.left+e.scrollLeft-(n?0:Et(t,o)),r=o.top+e.scrollTop;return{x:i,y:r}}function nn(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=Y(o),c=e?pt(e.floating):!1;if(o===s||c&&r)return n;let a={scrollLeft:0,scrollTop:0},l=z(1);const f=z(0),u=I(o);if((u||!u&&!r)&&((et(o)!=="body"||rt(s))&&(a=ht(o)),I(o))){const d=G(o);l=J(o),f.x=d.x+o.clientLeft,f.y=d.y+o.clientTop}const p=s&&!u&&!r?Gt(s,a,!0):z(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+f.x+p.x,y:n.y*l.y-a.scrollTop*l.y+f.y+p.y}}function on(t){return Array.from(t.getClientRects())}function rn(t){const e=Y(t),n=ht(t),o=t.ownerDocument.body,i=H(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=H(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Et(t);const c=-n.scrollTop;return B(o).direction==="rtl"&&(s+=H(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}function sn(t,e){const n=W(t),o=Y(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,c=0,a=0;if(i){r=i.width,s=i.height;const l=Ot();(!l||l&&e==="fixed")&&(c=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:c,y:a}}const cn=new Set(["absolute","fixed"]);function ln(t,e){const n=G(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=I(t)?J(t):z(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,a=i*r.x,l=o*r.y;return{width:s,height:c,x:a,y:l}}function Bt(t,e,n){let o;if(e==="viewport")o=sn(t,n);else if(e==="document")o=rn(Y(t));else if(_(e))o=ln(e,n);else{const i=Kt(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ut(o)}function Jt(t,e){const n=K(t);return n===e||!_(n)||Q(n)?!1:B(n).position==="fixed"||Jt(n,e)}function an(t,e){const n=e.get(t);if(n)return n;let o=it(t,[],!1).filter(c=>_(c)&&et(c)!=="body"),i=null;const r=B(t).position==="fixed";let s=r?K(t):t;for(;_(s)&&!Q(s);){const c=B(s),a=Ct(s);!a&&c.position==="fixed"&&(i=null),(r?!a&&!i:!a&&c.position==="static"&&!!i&&cn.has(i.position)||rt(s)&&!a&&Jt(t,s))?o=o.filter(f=>f!==s):i=c,s=K(s)}return e.set(t,o),o}function fn(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?pt(e)?[]:an(e,this._c):[].concat(n),o],c=s[0],a=s.reduce((l,f)=>{const u=Bt(e,f,i);return l.top=H(u.top,l.top),l.right=Z(u.right,l.right),l.bottom=Z(u.bottom,l.bottom),l.left=H(u.left,l.left),l},Bt(e,c,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function un(t){const{width:e,height:n}=Zt(t);return{width:e,height:n}}function dn(t,e,n){const o=I(e),i=Y(e),r=n==="fixed",s=G(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const a=z(0);function l(){a.x=Et(i)}if(o||!o&&!r)if((et(e)!=="body"||rt(i))&&(c=ht(e)),o){const d=G(e,!0,r,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop}else i&&l();r&&!o&&i&&l();const f=i&&!o&&!r?Gt(i,c):z(0),u=s.left+c.scrollLeft-a.x-f.x,p=s.top+c.scrollTop-a.y-f.y;return{x:u,y:p,width:s.width,height:s.height}}function gt(t){return B(t).position==="static"}function Vt(t,e){if(!I(t)||B(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function Qt(t,e){const n=W(t);if(pt(t))return n;if(!I(t)){let i=K(t);for(;i&&!Q(i);){if(_(i)&&!gt(i))return i;i=K(i)}return n}let o=Vt(t,e);for(;o&&qe(o)&>(o);)o=Vt(o,e);return o&&Q(o)&>(o)&&!Ct(o)?n:o||Je(t)||n}const mn=async function(t){const e=this.getOffsetParent||Qt,n=this.getDimensions,o=await n(t.floating);return{reference:dn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function pn(t){return B(t).direction==="rtl"}const hn={convertOffsetParentRelativeRectToViewportRelativeRect:nn,getDocumentElement:Y,getClippingRect:fn,getOffsetParent:Qt,getElementRects:mn,getClientRects:on,getDimensions:un,getScale:J,isElement:_,isRTL:pn};function te(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function gn(t,e){let n=null,o;const i=Y(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),r();const l=t.getBoundingClientRect(),{left:f,top:u,width:p,height:d}=l;if(c||e(),!p||!d)return;const m=ct(u),h=ct(i.clientWidth-(f+p)),w=ct(i.clientHeight-(u+d)),g=ct(f),A={rootMargin:-m+"px "+-h+"px "+-w+"px "+-g+"px",threshold:H(0,Z(1,a))||1};let y=!0;function v(C){const P=C[0].intersectionRatio;if(P!==a){if(!y)return s();P?s(!1,P):o=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!te(l,t.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(v,{...A,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,A)}n.observe(t)}return s(!0),r}function wn(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=St(t),f=i||r?[...l?it(l):[],...it(e)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),r&&g.addEventListener("resize",n)});const u=l&&c?gn(l,n):null;let p=-1,d=null;s&&(d=new ResizeObserver(g=>{let[x]=g;x&&x.target===l&&d&&(d.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var A;(A=d)==null||A.observe(e)})),n()}),l&&!a&&d.observe(l),d.observe(e));let m,h=a?G(t):null;a&&w();function w(){const g=G(t);h&&!te(h,g)&&n(),h=g,m=requestAnimationFrame(w)}return n(),()=>{var g;f.forEach(x=>{i&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),u?.(),(g=d)==null||g.disconnect(),d=null,a&&cancelAnimationFrame(m)}}const xn=Ve,yn=je,vn=We,An=Ie,bn=_e,jt=He,Rn=ze,Pn=(t,e,n)=>{const o=new Map,i={platform:hn,...n},r={...i.platform,_c:o};return Fe(t,e,{...i,platform:r})};var Cn=typeof document<"u",On=function(){},lt=Cn?R.useLayoutEffect:On;function dt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!dt(t[o],e[o]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,i[o]))return!1;for(o=n;o--!==0;){const r=i[o];if(!(r==="_owner"&&t.$$typeof)&&!dt(t[r],e[r]))return!1}return!0}return t!==t&&e!==e}function ee(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function zt(t,e){const n=ee(t);return Math.round(e*n)/n}function wt(t){const e=R.useRef(t);return lt(()=>{e.current=t}),e}function Sn(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:r,floating:s}={},transform:c=!0,whileElementsMounted:a,open:l}=t,[f,u]=R.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[p,d]=R.useState(o);dt(p,o)||d(o);const[m,h]=R.useState(null),[w,g]=R.useState(null),x=R.useCallback(b=>{b!==C.current&&(C.current=b,h(b))},[]),A=R.useCallback(b=>{b!==P.current&&(P.current=b,g(b))},[]),y=r||m,v=s||w,C=R.useRef(null),P=R.useRef(null),T=R.useRef(f),N=a!=null,L=wt(a),$=wt(i),k=wt(l),S=R.useCallback(()=>{if(!C.current||!P.current)return;const b={placement:e,strategy:n,middleware:p};$.current&&(b.platform=$.current),Pn(C.current,P.current,b).then(M=>{const V={...M,isPositioned:k.current!==!1};O.current&&!dt(T.current,V)&&(T.current=V,Ae.flushSync(()=>{u(V)}))})},[p,e,n,$,k]);lt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,u(b=>({...b,isPositioned:!1})))},[l]);const O=R.useRef(!1);lt(()=>(O.current=!0,()=>{O.current=!1}),[]),lt(()=>{if(y&&(C.current=y),v&&(P.current=v),y&&v){if(L.current)return L.current(y,v,S);S()}},[y,v,S,L,N]);const F=R.useMemo(()=>({reference:C,floating:P,setReference:x,setFloating:A}),[x,A]),E=R.useMemo(()=>({reference:y,floating:v}),[y,v]),D=R.useMemo(()=>{const b={position:n,left:0,top:0};if(!E.floating)return b;const M=zt(E.floating,f.x),V=zt(E.floating,f.y);return c?{...b,transform:"translate("+M+"px, "+V+"px)",...ee(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:V}},[n,c,E.floating,f.x,f.y]);return R.useMemo(()=>({...f,update:S,refs:F,elements:E,floatingStyles:D}),[f,S,F,E,D])}const En=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:i}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?jt({element:o.current,padding:i}).fn(n):{}:o?jt({element:o,padding:i}).fn(n):{}}}},Dn=(t,e)=>({...xn(t),options:[t,e]}),Ln=(t,e)=>({...yn(t),options:[t,e]}),Tn=(t,e)=>({...Rn(t),options:[t,e]}),Mn=(t,e)=>({...vn(t),options:[t,e]}),$n=(t,e)=>({...An(t),options:[t,e]}),kn=(t,e)=>({...bn(t),options:[t,e]}),Nn=(t,e)=>({...En(t),options:[t,e]});var Fn="Arrow",ne=R.forwardRef((t,e)=>{const{children:n,width:o=10,height:i=5,...r}=t;return X.jsx(At.svg,{...r,ref:e,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:X.jsx("polygon",{points:"0,0 30,0 15,10"})})});ne.displayName=Fn;var Hn=ne,Dt="Popper",[oe,Zn]=be(Dt),[Wn,ie]=oe(Dt),re=t=>{const{__scopePopper:e,children:n}=t,[o,i]=R.useState(null);return X.jsx(Wn,{scope:e,anchor:o,onAnchorChange:i,children:n})};re.displayName=Dt;var se="PopperAnchor",ce=R.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:o,...i}=t,r=ie(se,n),s=R.useRef(null),c=It(e,s);return R.useEffect(()=>{r.onAnchorChange(o?.current||s.current)}),o?null:X.jsx(At.div,{...i,ref:c})});ce.displayName=se;var Lt="PopperContent",[_n,Bn]=oe(Lt),le=R.forwardRef((t,e)=>{const{__scopePopper:n,side:o="bottom",sideOffset:i=0,align:r="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:a=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:p=!1,updatePositionStrategy:d="optimized",onPlaced:m,...h}=t,w=ie(Lt,n),[g,x]=R.useState(null),A=It(e,nt=>x(nt)),[y,v]=R.useState(null),C=Re(y),P=C?.width??0,T=C?.height??0,N=o+(r!=="center"?"-"+r:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},$=Array.isArray(l)?l:[l],k=$.length>0,S={padding:L,boundary:$.filter(jn),altBoundary:k},{refs:O,floatingStyles:F,placement:E,isPositioned:D,middlewareData:b}=Sn({strategy:"fixed",placement:N,whileElementsMounted:(...nt)=>wn(...nt,{animationFrame:d==="always"}),elements:{reference:w.anchor},middleware:[Dn({mainAxis:i+T,alignmentAxis:s}),a&&Ln({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Tn():void 0,...S}),a&&Mn({...S}),$n({...S,apply:({elements:nt,rects:Mt,availableWidth:we,availableHeight:xe})=>{const{width:ye,height:ve}=Mt.reference,st=nt.floating.style;st.setProperty("--radix-popper-available-width",`${we}px`),st.setProperty("--radix-popper-available-height",`${xe}px`),st.setProperty("--radix-popper-anchor-width",`${ye}px`),st.setProperty("--radix-popper-anchor-height",`${ve}px`)}}),y&&Nn({element:y,padding:c}),zn({arrowWidth:P,arrowHeight:T}),p&&kn({strategy:"referenceHidden",...S})]}),[M,V]=ue(E),Tt=Pe(m);$t(()=>{D&&Tt?.()},[D,Tt]);const de=b.arrow?.x,me=b.arrow?.y,pe=b.arrow?.centerOffset!==0,[he,ge]=R.useState();return $t(()=>{g&&ge(window.getComputedStyle(g).zIndex)},[g]),X.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:D?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[b.transformOrigin?.x,b.transformOrigin?.y].join(" "),...b.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:X.jsx(_n,{scope:n,placedSide:M,onArrowChange:v,arrowX:de,arrowY:me,shouldHideArrow:pe,children:X.jsx(At.div,{"data-side":M,"data-align":V,...h,ref:A,style:{...h.style,animation:D?void 0:"none"}})})})});le.displayName=Lt;var ae="PopperArrow",Vn={top:"bottom",right:"left",bottom:"top",left:"right"},fe=R.forwardRef(function(e,n){const{__scopePopper:o,...i}=e,r=Bn(ae,o),s=Vn[r.placedSide];return X.jsx("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:X.jsx(Hn,{...i,ref:n,style:{...i.style,display:"block"}})})});fe.displayName=ae;function jn(t){return t!==null}var zn=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:o,middlewareData:i}=e,s=i.arrow?.centerOffset!==0,c=s?0:t.arrowWidth,a=s?0:t.arrowHeight,[l,f]=ue(n),u={start:"0%",center:"50%",end:"100%"}[f],p=(i.arrow?.x??0)+c/2,d=(i.arrow?.y??0)+a/2;let m="",h="";return l==="bottom"?(m=s?u:`${p}px`,h=`${-a}px`):l==="top"?(m=s?u:`${p}px`,h=`${o.floating.height+a}px`):l==="right"?(m=`${-a}px`,h=s?u:`${d}px`):l==="left"&&(m=`${o.floating.width+a}px`,h=s?u:`${d}px`),{data:{x:m,y:h}}}});function ue(t){const[e,n="center"]=t.split("-");return[e,n]}var Kn=re,Gn=ce,Jn=le,Qn=fe;export{Gn as A,Jn as C,Kn as R,Qn as a,Zn as c};
|
|
1
|
+
import{a as R,p as X}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as Ae}from"./index-BJ-ODQ_I.js";import{P as At,c as be,e as Re,d as $t}from"./index-C4koMhA2.js";import{u as It}from"./index-opRxY4qB.js";import{d as Pe}from"./index-ufEogtin.js";const Ce=["top","right","bottom","left"],Z=Math.min,H=Math.max,at=Math.round,ct=Math.floor,z=t=>({x:t,y:t}),Oe={left:"right",right:"left",bottom:"top",top:"bottom"},Se={start:"end",end:"start"};function xt(t,e,n){return H(t,Z(e,n))}function q(t,e){return typeof t=="function"?t(e):t}function U(t){return t.split("-")[0]}function tt(t){return t.split("-")[1]}function bt(t){return t==="x"?"y":"x"}function Rt(t){return t==="y"?"height":"width"}const Ee=new Set(["top","bottom"]);function j(t){return Ee.has(U(t))?"y":"x"}function Pt(t){return bt(j(t))}function De(t,e,n){n===void 0&&(n=!1);const o=tt(t),i=Pt(t),r=Rt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ft(s)),[s,ft(s)]}function Le(t){const e=ft(t);return[yt(t),e,yt(e)]}function yt(t){return t.replace(/start|end/g,e=>Se[e])}const kt=["left","right"],Nt=["right","left"],Te=["top","bottom"],Me=["bottom","top"];function $e(t,e,n){switch(t){case"top":case"bottom":return n?e?Nt:kt:e?kt:Nt;case"left":case"right":return e?Te:Me;default:return[]}}function ke(t,e,n,o){const i=tt(t);let r=$e(U(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(yt)))),r}function ft(t){return t.replace(/left|right|bottom|top/g,e=>Oe[e])}function Ne(t){return{top:0,right:0,bottom:0,left:0,...t}}function Yt(t){return typeof t!="number"?Ne(t):{top:t,right:t,bottom:t,left:t}}function ut(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Ft(t,e,n){let{reference:o,floating:i}=t;const r=j(e),s=Pt(e),c=Rt(s),a=U(e),l=r==="y",f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[c]/2-i[c]/2;let d;switch(a){case"top":d={x:f,y:o.y-i.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-i.width,y:u};break;default:d={x:o.x,y:o.y}}switch(tt(e)){case"start":d[s]-=p*(n&&l?-1:1);break;case"end":d[s]+=p*(n&&l?-1:1);break}return d}const Fe=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=Ft(l,o,a),p=o,d={},m=0;for(let h=0;h<c.length;h++){const{name:w,fn:g}=c[h],{x,y:A,data:y,reset:v}=await g({x:f,y:u,initialPlacement:o,placement:p,strategy:i,middlewareData:d,rects:l,platform:s,elements:{reference:t,floating:e}});f=x??f,u=A??u,d={...d,[w]:{...d[w],...y}},v&&m<=50&&(m++,typeof v=="object"&&(v.placement&&(p=v.placement),v.rects&&(l=v.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:f,y:u}=Ft(l,p,a)),h=-1)}return{x:f,y:u,placement:p,strategy:i,middlewareData:d}};async function ot(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:c,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:p=!1,padding:d=0}=q(e,t),m=Yt(d),w=c[p?u==="floating"?"reference":"floating":u],g=ut(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(w)))==null||n?w:w.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:l,rootBoundary:f,strategy:a})),x=u==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),y=await(r.isElement==null?void 0:r.isElement(A))?await(r.getScale==null?void 0:r.getScale(A))||{x:1,y:1}:{x:1,y:1},v=ut(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:A,strategy:a}):x);return{top:(g.top-v.top+m.top)/y.y,bottom:(v.bottom-g.bottom+m.bottom)/y.y,left:(g.left-v.left+m.left)/y.x,right:(v.right-g.right+m.right)/y.x}}const He=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:a}=e,{element:l,padding:f=0}=q(t,e)||{};if(l==null)return{};const u=Yt(f),p={x:n,y:o},d=Pt(i),m=Rt(d),h=await s.getDimensions(l),w=d==="y",g=w?"top":"left",x=w?"bottom":"right",A=w?"clientHeight":"clientWidth",y=r.reference[m]+r.reference[d]-p[d]-r.floating[m],v=p[d]-r.reference[d],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let P=C?C[A]:0;(!P||!await(s.isElement==null?void 0:s.isElement(C)))&&(P=c.floating[A]||r.floating[m]);const T=y/2-v/2,N=P/2-h[m]/2-1,L=Z(u[g],N),$=Z(u[x],N),k=L,S=P-h[m]-$,O=P/2-h[m]/2+T,F=xt(k,O,S),E=!a.arrow&&tt(i)!=null&&O!==F&&r.reference[m]/2-(O<k?L:$)-h[m]/2<0,D=E?O<k?O-k:O-S:0;return{[d]:p[d]+D,data:{[d]:F,centerOffset:O-F-D,...E&&{alignmentOffset:D}},reset:E}}}),We=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:a,elements:l}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...w}=q(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const g=U(i),x=j(c),A=U(c)===c,y=await(a.isRTL==null?void 0:a.isRTL(l.floating)),v=p||(A||!h?[ft(c)]:Le(c)),C=m!=="none";!p&&C&&v.push(...ke(c,h,m,y));const P=[c,...v],T=await ot(e,w),N=[];let L=((o=r.flip)==null?void 0:o.overflows)||[];if(f&&N.push(T[g]),u){const O=De(i,s,y);N.push(T[O[0]],T[O[1]])}if(L=[...L,{placement:i,overflows:N}],!N.every(O=>O<=0)){var $,k;const O=((($=r.flip)==null?void 0:$.index)||0)+1,F=P[O];if(F&&(!(u==="alignment"?x!==j(F):!1)||L.every(b=>b.overflows[0]>0&&j(b.placement)===x)))return{data:{index:O,overflows:L},reset:{placement:F}};let E=(k=L.filter(D=>D.overflows[0]<=0).sort((D,b)=>D.overflows[1]-b.overflows[1])[0])==null?void 0:k.placement;if(!E)switch(d){case"bestFit":{var S;const D=(S=L.filter(b=>{if(C){const M=j(b.placement);return M===x||M==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(M=>M>0).reduce((M,V)=>M+V,0)]).sort((b,M)=>b[1]-M[1])[0])==null?void 0:S[0];D&&(E=D);break}case"initialPlacement":E=c;break}if(i!==E)return{reset:{placement:E}}}return{}}}};function Ht(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Wt(t){return Ce.some(e=>t[e]>=0)}const _e=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=q(t,e);switch(o){case"referenceHidden":{const r=await ot(e,{...i,elementContext:"reference"}),s=Ht(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Wt(s)}}}case"escaped":{const r=await ot(e,{...i,altBoundary:!0}),s=Ht(r,n.floating);return{data:{escapedOffsets:s,escaped:Wt(s)}}}default:return{}}}}},Xt=new Set(["left","top"]);async function Be(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=U(n),c=tt(n),a=j(n)==="y",l=Xt.has(s)?-1:1,f=r&&a?-1:1,u=q(e,t);let{mainAxis:p,crossAxis:d,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof m=="number"&&(d=c==="end"?m*-1:m),a?{x:d*f,y:p*l}:{x:p*l,y:d*f}}const Ve=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:c}=e,a=await Be(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},je=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x:g,y:x}=w;return{x:g,y:x}}},...a}=q(t,e),l={x:n,y:o},f=await ot(e,a),u=j(U(i)),p=bt(u);let d=l[p],m=l[u];if(r){const w=p==="y"?"top":"left",g=p==="y"?"bottom":"right",x=d+f[w],A=d-f[g];d=xt(x,d,A)}if(s){const w=u==="y"?"top":"left",g=u==="y"?"bottom":"right",x=m+f[w],A=m-f[g];m=xt(x,m,A)}const h=c.fn({...e,[p]:d,[u]:m});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[p]:r,[u]:s}}}}}},ze=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:c=0,mainAxis:a=!0,crossAxis:l=!0}=q(t,e),f={x:n,y:o},u=j(i),p=bt(u);let d=f[p],m=f[u];const h=q(c,e),w=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(a){const A=p==="y"?"height":"width",y=r.reference[p]-r.floating[A]+w.mainAxis,v=r.reference[p]+r.reference[A]-w.mainAxis;d<y?d=y:d>v&&(d=v)}if(l){var g,x;const A=p==="y"?"width":"height",y=Xt.has(U(i)),v=r.reference[u]-r.floating[A]+(y&&((g=s.offset)==null?void 0:g[u])||0)+(y?0:w.crossAxis),C=r.reference[u]+r.reference[A]+(y?0:((x=s.offset)==null?void 0:x[u])||0)-(y?w.crossAxis:0);m<v?m=v:m>C&&(m=C)}return{[p]:d,[u]:m}}}},Ie=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:c}=e,{apply:a=()=>{},...l}=q(t,e),f=await ot(e,l),u=U(i),p=tt(i),d=j(i)==="y",{width:m,height:h}=r.floating;let w,g;u==="top"||u==="bottom"?(w=u,g=p===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(g=u,w=p==="end"?"top":"bottom");const x=h-f.top-f.bottom,A=m-f.left-f.right,y=Z(h-f[w],x),v=Z(m-f[g],A),C=!e.middlewareData.shift;let P=y,T=v;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(T=A),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(P=x),C&&!p){const L=H(f.left,0),$=H(f.right,0),k=H(f.top,0),S=H(f.bottom,0);d?T=m-2*(L!==0||$!==0?L+$:H(f.left,f.right)):P=h-2*(k!==0||S!==0?k+S:H(f.top,f.bottom))}await a({...e,availableWidth:T,availableHeight:P});const N=await s.getDimensions(c.floating);return m!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function mt(){return typeof window<"u"}function et(t){return qt(t)?(t.nodeName||"").toLowerCase():"#document"}function W(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Y(t){var e;return(e=(qt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qt(t){return mt()?t instanceof Node||t instanceof W(t).Node:!1}function _(t){return mt()?t instanceof Element||t instanceof W(t).Element:!1}function I(t){return mt()?t instanceof HTMLElement||t instanceof W(t).HTMLElement:!1}function _t(t){return!mt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof W(t).ShadowRoot}const Ye=new Set(["inline","contents"]);function rt(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=B(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!Ye.has(i)}const Xe=new Set(["table","td","th"]);function qe(t){return Xe.has(et(t))}const Ue=[":popover-open",":modal"];function pt(t){return Ue.some(e=>{try{return t.matches(e)}catch{return!1}})}const Ze=["transform","translate","scale","rotate","perspective"],Ke=["transform","translate","scale","rotate","perspective","filter"],Ge=["paint","layout","strict","content"];function Ct(t){const e=Ot(),n=_(t)?B(t):t;return Ze.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Ke.some(o=>(n.willChange||"").includes(o))||Ge.some(o=>(n.contain||"").includes(o))}function Je(t){let e=K(t);for(;I(e)&&!Q(e);){if(Ct(e))return e;if(pt(e))return null;e=K(e)}return null}function Ot(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Qe=new Set(["html","body","#document"]);function Q(t){return Qe.has(et(t))}function B(t){return W(t).getComputedStyle(t)}function ht(t){return _(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function K(t){if(et(t)==="html")return t;const e=t.assignedSlot||t.parentNode||_t(t)&&t.host||Y(t);return _t(e)?e.host:e}function Ut(t){const e=K(t);return Q(e)?t.ownerDocument?t.ownerDocument.body:t.body:I(e)&&rt(e)?e:Ut(e)}function it(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ut(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=W(i);if(r){const c=vt(s);return e.concat(s,s.visualViewport||[],rt(i)?i:[],c&&n?it(c):[])}return e.concat(i,it(i,[],n))}function vt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Zt(t){const e=B(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=I(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=at(n)!==r||at(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function St(t){return _(t)?t:t.contextElement}function J(t){const e=St(t);if(!I(e))return z(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Zt(e);let s=(r?at(n.width):n.width)/o,c=(r?at(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const tn=z(0);function Kt(t){const e=W(t);return!Ot()||!e.visualViewport?tn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function en(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==W(t)?!1:e}function G(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=St(t);let s=z(1);e&&(o?_(o)&&(s=J(o)):s=J(t));const c=en(r,n,o)?Kt(r):z(0);let a=(i.left+c.x)/s.x,l=(i.top+c.y)/s.y,f=i.width/s.x,u=i.height/s.y;if(r){const p=W(r),d=o&&_(o)?W(o):o;let m=p,h=vt(m);for(;h&&o&&d!==m;){const w=J(h),g=h.getBoundingClientRect(),x=B(h),A=g.left+(h.clientLeft+parseFloat(x.paddingLeft))*w.x,y=g.top+(h.clientTop+parseFloat(x.paddingTop))*w.y;a*=w.x,l*=w.y,f*=w.x,u*=w.y,a+=A,l+=y,m=W(h),h=vt(m)}}return ut({width:f,height:u,x:a,y:l})}function Et(t,e){const n=ht(t).scrollLeft;return e?e.left+n:G(Y(t)).left+n}function Gt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=o.left+e.scrollLeft-(n?0:Et(t,o)),r=o.top+e.scrollTop;return{x:i,y:r}}function nn(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=Y(o),c=e?pt(e.floating):!1;if(o===s||c&&r)return n;let a={scrollLeft:0,scrollTop:0},l=z(1);const f=z(0),u=I(o);if((u||!u&&!r)&&((et(o)!=="body"||rt(s))&&(a=ht(o)),I(o))){const d=G(o);l=J(o),f.x=d.x+o.clientLeft,f.y=d.y+o.clientTop}const p=s&&!u&&!r?Gt(s,a,!0):z(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+f.x+p.x,y:n.y*l.y-a.scrollTop*l.y+f.y+p.y}}function on(t){return Array.from(t.getClientRects())}function rn(t){const e=Y(t),n=ht(t),o=t.ownerDocument.body,i=H(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=H(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Et(t);const c=-n.scrollTop;return B(o).direction==="rtl"&&(s+=H(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}function sn(t,e){const n=W(t),o=Y(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,c=0,a=0;if(i){r=i.width,s=i.height;const l=Ot();(!l||l&&e==="fixed")&&(c=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:c,y:a}}const cn=new Set(["absolute","fixed"]);function ln(t,e){const n=G(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=I(t)?J(t):z(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,a=i*r.x,l=o*r.y;return{width:s,height:c,x:a,y:l}}function Bt(t,e,n){let o;if(e==="viewport")o=sn(t,n);else if(e==="document")o=rn(Y(t));else if(_(e))o=ln(e,n);else{const i=Kt(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return ut(o)}function Jt(t,e){const n=K(t);return n===e||!_(n)||Q(n)?!1:B(n).position==="fixed"||Jt(n,e)}function an(t,e){const n=e.get(t);if(n)return n;let o=it(t,[],!1).filter(c=>_(c)&&et(c)!=="body"),i=null;const r=B(t).position==="fixed";let s=r?K(t):t;for(;_(s)&&!Q(s);){const c=B(s),a=Ct(s);!a&&c.position==="fixed"&&(i=null),(r?!a&&!i:!a&&c.position==="static"&&!!i&&cn.has(i.position)||rt(s)&&!a&&Jt(t,s))?o=o.filter(f=>f!==s):i=c,s=K(s)}return e.set(t,o),o}function fn(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?pt(e)?[]:an(e,this._c):[].concat(n),o],c=s[0],a=s.reduce((l,f)=>{const u=Bt(e,f,i);return l.top=H(u.top,l.top),l.right=Z(u.right,l.right),l.bottom=Z(u.bottom,l.bottom),l.left=H(u.left,l.left),l},Bt(e,c,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function un(t){const{width:e,height:n}=Zt(t);return{width:e,height:n}}function dn(t,e,n){const o=I(e),i=Y(e),r=n==="fixed",s=G(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const a=z(0);function l(){a.x=Et(i)}if(o||!o&&!r)if((et(e)!=="body"||rt(i))&&(c=ht(e)),o){const d=G(e,!0,r,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop}else i&&l();r&&!o&&i&&l();const f=i&&!o&&!r?Gt(i,c):z(0),u=s.left+c.scrollLeft-a.x-f.x,p=s.top+c.scrollTop-a.y-f.y;return{x:u,y:p,width:s.width,height:s.height}}function gt(t){return B(t).position==="static"}function Vt(t,e){if(!I(t)||B(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function Qt(t,e){const n=W(t);if(pt(t))return n;if(!I(t)){let i=K(t);for(;i&&!Q(i);){if(_(i)&&!gt(i))return i;i=K(i)}return n}let o=Vt(t,e);for(;o&&qe(o)&>(o);)o=Vt(o,e);return o&&Q(o)&>(o)&&!Ct(o)?n:o||Je(t)||n}const mn=async function(t){const e=this.getOffsetParent||Qt,n=this.getDimensions,o=await n(t.floating);return{reference:dn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function pn(t){return B(t).direction==="rtl"}const hn={convertOffsetParentRelativeRectToViewportRelativeRect:nn,getDocumentElement:Y,getClippingRect:fn,getOffsetParent:Qt,getElementRects:mn,getClientRects:on,getDimensions:un,getScale:J,isElement:_,isRTL:pn};function te(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function gn(t,e){let n=null,o;const i=Y(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),r();const l=t.getBoundingClientRect(),{left:f,top:u,width:p,height:d}=l;if(c||e(),!p||!d)return;const m=ct(u),h=ct(i.clientWidth-(f+p)),w=ct(i.clientHeight-(u+d)),g=ct(f),A={rootMargin:-m+"px "+-h+"px "+-w+"px "+-g+"px",threshold:H(0,Z(1,a))||1};let y=!0;function v(C){const P=C[0].intersectionRatio;if(P!==a){if(!y)return s();P?s(!1,P):o=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!te(l,t.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(v,{...A,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,A)}n.observe(t)}return s(!0),r}function wn(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=St(t),f=i||r?[...l?it(l):[],...it(e)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),r&&g.addEventListener("resize",n)});const u=l&&c?gn(l,n):null;let p=-1,d=null;s&&(d=new ResizeObserver(g=>{let[x]=g;x&&x.target===l&&d&&(d.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var A;(A=d)==null||A.observe(e)})),n()}),l&&!a&&d.observe(l),d.observe(e));let m,h=a?G(t):null;a&&w();function w(){const g=G(t);h&&!te(h,g)&&n(),h=g,m=requestAnimationFrame(w)}return n(),()=>{var g;f.forEach(x=>{i&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),u?.(),(g=d)==null||g.disconnect(),d=null,a&&cancelAnimationFrame(m)}}const xn=Ve,yn=je,vn=We,An=Ie,bn=_e,jt=He,Rn=ze,Pn=(t,e,n)=>{const o=new Map,i={platform:hn,...n},r={...i.platform,_c:o};return Fe(t,e,{...i,platform:r})};var Cn=typeof document<"u",On=function(){},lt=Cn?R.useLayoutEffect:On;function dt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!dt(t[o],e[o]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,i[o]))return!1;for(o=n;o--!==0;){const r=i[o];if(!(r==="_owner"&&t.$$typeof)&&!dt(t[r],e[r]))return!1}return!0}return t!==t&&e!==e}function ee(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function zt(t,e){const n=ee(t);return Math.round(e*n)/n}function wt(t){const e=R.useRef(t);return lt(()=>{e.current=t}),e}function Sn(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:r,floating:s}={},transform:c=!0,whileElementsMounted:a,open:l}=t,[f,u]=R.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[p,d]=R.useState(o);dt(p,o)||d(o);const[m,h]=R.useState(null),[w,g]=R.useState(null),x=R.useCallback(b=>{b!==C.current&&(C.current=b,h(b))},[]),A=R.useCallback(b=>{b!==P.current&&(P.current=b,g(b))},[]),y=r||m,v=s||w,C=R.useRef(null),P=R.useRef(null),T=R.useRef(f),N=a!=null,L=wt(a),$=wt(i),k=wt(l),S=R.useCallback(()=>{if(!C.current||!P.current)return;const b={placement:e,strategy:n,middleware:p};$.current&&(b.platform=$.current),Pn(C.current,P.current,b).then(M=>{const V={...M,isPositioned:k.current!==!1};O.current&&!dt(T.current,V)&&(T.current=V,Ae.flushSync(()=>{u(V)}))})},[p,e,n,$,k]);lt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,u(b=>({...b,isPositioned:!1})))},[l]);const O=R.useRef(!1);lt(()=>(O.current=!0,()=>{O.current=!1}),[]),lt(()=>{if(y&&(C.current=y),v&&(P.current=v),y&&v){if(L.current)return L.current(y,v,S);S()}},[y,v,S,L,N]);const F=R.useMemo(()=>({reference:C,floating:P,setReference:x,setFloating:A}),[x,A]),E=R.useMemo(()=>({reference:y,floating:v}),[y,v]),D=R.useMemo(()=>{const b={position:n,left:0,top:0};if(!E.floating)return b;const M=zt(E.floating,f.x),V=zt(E.floating,f.y);return c?{...b,transform:"translate("+M+"px, "+V+"px)",...ee(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:V}},[n,c,E.floating,f.x,f.y]);return R.useMemo(()=>({...f,update:S,refs:F,elements:E,floatingStyles:D}),[f,S,F,E,D])}const En=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:i}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?jt({element:o.current,padding:i}).fn(n):{}:o?jt({element:o,padding:i}).fn(n):{}}}},Dn=(t,e)=>({...xn(t),options:[t,e]}),Ln=(t,e)=>({...yn(t),options:[t,e]}),Tn=(t,e)=>({...Rn(t),options:[t,e]}),Mn=(t,e)=>({...vn(t),options:[t,e]}),$n=(t,e)=>({...An(t),options:[t,e]}),kn=(t,e)=>({...bn(t),options:[t,e]}),Nn=(t,e)=>({...En(t),options:[t,e]});var Fn="Arrow",ne=R.forwardRef((t,e)=>{const{children:n,width:o=10,height:i=5,...r}=t;return X.jsx(At.svg,{...r,ref:e,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:X.jsx("polygon",{points:"0,0 30,0 15,10"})})});ne.displayName=Fn;var Hn=ne,Dt="Popper",[oe,Zn]=be(Dt),[Wn,ie]=oe(Dt),re=t=>{const{__scopePopper:e,children:n}=t,[o,i]=R.useState(null);return X.jsx(Wn,{scope:e,anchor:o,onAnchorChange:i,children:n})};re.displayName=Dt;var se="PopperAnchor",ce=R.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:o,...i}=t,r=ie(se,n),s=R.useRef(null),c=It(e,s);return R.useEffect(()=>{r.onAnchorChange(o?.current||s.current)}),o?null:X.jsx(At.div,{...i,ref:c})});ce.displayName=se;var Lt="PopperContent",[_n,Bn]=oe(Lt),le=R.forwardRef((t,e)=>{const{__scopePopper:n,side:o="bottom",sideOffset:i=0,align:r="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:a=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:p=!1,updatePositionStrategy:d="optimized",onPlaced:m,...h}=t,w=ie(Lt,n),[g,x]=R.useState(null),A=It(e,nt=>x(nt)),[y,v]=R.useState(null),C=Re(y),P=C?.width??0,T=C?.height??0,N=o+(r!=="center"?"-"+r:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},$=Array.isArray(l)?l:[l],k=$.length>0,S={padding:L,boundary:$.filter(jn),altBoundary:k},{refs:O,floatingStyles:F,placement:E,isPositioned:D,middlewareData:b}=Sn({strategy:"fixed",placement:N,whileElementsMounted:(...nt)=>wn(...nt,{animationFrame:d==="always"}),elements:{reference:w.anchor},middleware:[Dn({mainAxis:i+T,alignmentAxis:s}),a&&Ln({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Tn():void 0,...S}),a&&Mn({...S}),$n({...S,apply:({elements:nt,rects:Mt,availableWidth:we,availableHeight:xe})=>{const{width:ye,height:ve}=Mt.reference,st=nt.floating.style;st.setProperty("--radix-popper-available-width",`${we}px`),st.setProperty("--radix-popper-available-height",`${xe}px`),st.setProperty("--radix-popper-anchor-width",`${ye}px`),st.setProperty("--radix-popper-anchor-height",`${ve}px`)}}),y&&Nn({element:y,padding:c}),zn({arrowWidth:P,arrowHeight:T}),p&&kn({strategy:"referenceHidden",...S})]}),[M,V]=ue(E),Tt=Pe(m);$t(()=>{D&&Tt?.()},[D,Tt]);const de=b.arrow?.x,me=b.arrow?.y,pe=b.arrow?.centerOffset!==0,[he,ge]=R.useState();return $t(()=>{g&&ge(window.getComputedStyle(g).zIndex)},[g]),X.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:D?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[b.transformOrigin?.x,b.transformOrigin?.y].join(" "),...b.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:X.jsx(_n,{scope:n,placedSide:M,onArrowChange:v,arrowX:de,arrowY:me,shouldHideArrow:pe,children:X.jsx(At.div,{"data-side":M,"data-align":V,...h,ref:A,style:{...h.style,animation:D?void 0:"none"}})})})});le.displayName=Lt;var ae="PopperArrow",Vn={top:"bottom",right:"left",bottom:"top",left:"right"},fe=R.forwardRef(function(e,n){const{__scopePopper:o,...i}=e,r=Bn(ae,o),s=Vn[r.placedSide];return X.jsx("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:X.jsx(Hn,{...i,ref:n,style:{...i.style,display:"block"}})})});fe.displayName=ae;function jn(t){return t!==null}var zn=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:o,middlewareData:i}=e,s=i.arrow?.centerOffset!==0,c=s?0:t.arrowWidth,a=s?0:t.arrowHeight,[l,f]=ue(n),u={start:"0%",center:"50%",end:"100%"}[f],p=(i.arrow?.x??0)+c/2,d=(i.arrow?.y??0)+a/2;let m="",h="";return l==="bottom"?(m=s?u:`${p}px`,h=`${-a}px`):l==="top"?(m=s?u:`${p}px`,h=`${o.floating.height+a}px`):l==="right"?(m=`${-a}px`,h=s?u:`${d}px`):l==="left"&&(m=`${o.floating.width+a}px`,h=s?u:`${d}px`),{data:{x:m,y:h}}}});function ue(t){const[e,n="center"]=t.split("-");return[e,n]}var Kn=re,Gn=ce,Jn=le,Qn=fe;export{Gn as A,Jn as C,Kn as R,Qn as a,Zn as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,p as x,B as y}from"./chunk-EF7DTUVF-CaKisB5m.js";import{u as E,b}from"./index-
|
|
1
|
+
import{a as c,p as x,B as y}from"./chunk-EF7DTUVF-CaKisB5m.js";import{u as E,b}from"./index-opRxY4qB.js";import{a as w}from"./index-BJ-ODQ_I.js";function D(e,t){const n=c.createContext(t),r=i=>{const{children:u,...s}=i,a=c.useMemo(()=>s,Object.values(s));return x.jsx(n.Provider,{value:a,children:u})};r.displayName=e+"Provider";function o(i){const u=c.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function j(e,t=[]){let n=[];function r(i,u){const s=c.createContext(u),a=n.length;n=[...n,u];const f=d=>{const{scope:p,children:m,...v}=d,S=p?.[e]?.[a]||s,g=c.useMemo(()=>v,Object.values(v));return x.jsx(S.Provider,{value:g,children:m})};f.displayName=i+"Provider";function l(d,p){const m=p?.[e]?.[a]||s,v=c.useContext(m);if(v)return v;if(u!==void 0)return u;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[f,l]}const o=()=>{const i=n.map(u=>c.createContext(u));return function(s){const a=s?.[e]||i;return c.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return o.scopeName=e,[r,P(o,...t)]}function P(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const u=r.reduce((s,{useScope:a,scopeName:f})=>{const d=a(i)[`__scope${f}`];return{...s,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}function L(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var N=globalThis?.document?c.useLayoutEffect:()=>{},C=y[" useInsertionEffect ".trim().toString()]||N;function W({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,u]=A({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:o;{const l=c.useRef(e!==void 0);c.useEffect(()=>{const d=l.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),l.current=s},[s,r])}const f=c.useCallback(l=>{if(s){const d=R(l)?l(e):l;d!==e&&u.current?.(d)}else i(l)},[s,e,i,u]);return[a,f]}function A({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return C(()=>{i.current=t},[t]),c.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function R(e){return typeof e=="function"}function F(e){const[t,n]=c.useState(void 0);return N(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let u,s;if("borderBoxSize"in i){const a=i.borderBoxSize,f=Array.isArray(a)?a[0]:a;u=f.inlineSize,s=f.blockSize}else u=e.offsetWidth,s=e.offsetHeight;n({width:u,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function M(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var O=e=>{const{present:t,children:n}=e,r=T(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),i=E(r.ref,I(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:i}):null};O.displayName="Presence";function T(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),i=c.useRef("none"),u=e?"mounted":"unmounted",[s,a]=M(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const f=h(r.current);i.current=s==="mounted"?f:"none"},[s]),N(()=>{const f=r.current,l=o.current;if(l!==e){const p=i.current,m=h(f);e?a("MOUNT"):m==="none"||f?.display==="none"?a("UNMOUNT"):a(l&&p!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,a]),N(()=>{if(t){let f;const l=t.ownerDocument.defaultView??window,d=m=>{const S=h(r.current).includes(m.animationName);if(m.target===t&&S&&(a("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",f=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=m=>{m.target===t&&(i.current=h(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{l.clearTimeout(f),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function h(e){return e?.animationName||"none"}function I(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var U=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],k=U.reduce((e,t)=>{const n=b(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:u,...s}=o,a=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function B(e,t){e&&w.flushSync(()=>e.dispatchEvent(t))}export{k as P,L as a,O as b,j as c,N as d,F as e,B as f,D as g,W as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,p}from"./chunk-EF7DTUVF-CaKisB5m.js";import{u as G,c as H,P as A,a as P,b as O}from"./index-
|
|
1
|
+
import{a as c,p}from"./chunk-EF7DTUVF-CaKisB5m.js";import{u as G,c as H,P as A,a as P,b as O}from"./index-C4koMhA2.js";import{u as _,b as K}from"./index-opRxY4qB.js";import{u as $,e as U,h as V,g as W,f as Z,F as q,i as z}from"./index-ufEogtin.js";import{c as E,R as B,A as w,a as J,C as Q}from"./index-B_LZxNEG.js";var x="Popover",[b,le]=H(x,[E]),g=E(),[X,u]=b(x),j=e=>{const{__scopePopover:n,children:t,open:s,defaultOpen:o,onOpenChange:r,modal:a=!1}=e,i=g(n),f=c.useRef(null),[v,h]=c.useState(!1),[C,l]=G({prop:s,defaultProp:o??!1,onChange:r,caller:x});return p.jsx(B,{...i,children:p.jsx(X,{scope:n,contentId:$(),triggerRef:f,open:C,onOpenChange:l,onOpenToggle:c.useCallback(()=>l(m=>!m),[l]),hasCustomAnchor:v,onCustomAnchorAdd:c.useCallback(()=>h(!0),[]),onCustomAnchorRemove:c.useCallback(()=>h(!1),[]),modal:a,children:t})})};j.displayName=x;var F="PopoverAnchor",N=c.forwardRef((e,n)=>{const{__scopePopover:t,...s}=e,o=u(F,t),r=g(t),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=o;return c.useEffect(()=>(a(),()=>i()),[a,i]),p.jsx(w,{...r,...s,ref:n})});N.displayName=F;var S="PopoverTrigger",y=c.forwardRef((e,n)=>{const{__scopePopover:t,...s}=e,o=u(S,t),r=g(t),a=_(n,o.triggerRef),i=p.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":L(o.open),...s,ref:a,onClick:P(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:p.jsx(w,{asChild:!0,...r,children:i})});y.displayName=S;var R="PopoverPortal",[Y,ee]=b(R,{forceMount:void 0}),D=e=>{const{__scopePopover:n,forceMount:t,children:s,container:o}=e,r=u(R,n);return p.jsx(Y,{scope:n,forceMount:t,children:p.jsx(O,{present:t||r.open,children:p.jsx(U,{asChild:!0,container:o,children:s})})})};D.displayName=R;var d="PopoverContent",M=c.forwardRef((e,n)=>{const t=ee(d,e.__scopePopover),{forceMount:s=t.forceMount,...o}=e,r=u(d,e.__scopePopover);return p.jsx(O,{present:s||r.open,children:r.modal?p.jsx(re,{...o,ref:n}):p.jsx(te,{...o,ref:n})})});M.displayName=d;var oe=K("PopoverContent.RemoveScroll"),re=c.forwardRef((e,n)=>{const t=u(d,e.__scopePopover),s=c.useRef(null),o=_(n,s),r=c.useRef(!1);return c.useEffect(()=>{const a=s.current;if(a)return V(a)},[]),p.jsx(W,{as:oe,allowPinchZoom:!0,children:p.jsx(T,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,a=>{a.preventDefault(),r.current||t.triggerRef.current?.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,f=i.button===0&&i.ctrlKey===!0,v=i.button===2||f;r.current=v},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),te=c.forwardRef((e,n)=>{const t=u(d,e.__scopePopover),s=c.useRef(!1),o=c.useRef(!1);return p.jsx(T,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{e.onCloseAutoFocus?.(r),r.defaultPrevented||(s.current||t.triggerRef.current?.focus(),r.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:r=>{e.onInteractOutside?.(r),r.defaultPrevented||(s.current=!0,r.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=r.target;t.triggerRef.current?.contains(a)&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&o.current&&r.preventDefault()}})}),T=c.forwardRef((e,n)=>{const{__scopePopover:t,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:r,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:f,onFocusOutside:v,onInteractOutside:h,...C}=e,l=u(d,t),m=g(t);return Z(),p.jsx(q,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:r,children:p.jsx(z,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:i,onPointerDownOutside:f,onFocusOutside:v,onDismiss:()=>l.onOpenChange(!1),children:p.jsx(Q,{"data-state":L(l.open),role:"dialog",id:l.contentId,...m,...C,ref:n,style:{...C.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),k="PopoverClose",ne=c.forwardRef((e,n)=>{const{__scopePopover:t,...s}=e,o=u(k,t);return p.jsx(A.button,{type:"button",...s,ref:n,onClick:P(e.onClick,()=>o.onOpenChange(!1))})});ne.displayName=k;var se="PopoverArrow",I=c.forwardRef((e,n)=>{const{__scopePopover:t,...s}=e,o=g(t);return p.jsx(J,{...o,...s,ref:n})});I.displayName=se;function L(e){return e?"open":"closed"}var de=j,fe=N,ve=y,Pe=D,ge=M,he=I;export{fe as A,ge as C,Pe as P,de as R,ve as T,he as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,p as u}from"./chunk-EF7DTUVF-CaKisB5m.js";import{P as j,c as Q,u as Z,a as m,b as H}from"./index-
|
|
1
|
+
import{a,p as u}from"./chunk-EF7DTUVF-CaKisB5m.js";import{P as j,c as Q,u as Z,a as m,b as H}from"./index-C4koMhA2.js";import{u as G,a as ee}from"./index-opRxY4qB.js";import{u as te,e as oe,i as re}from"./index-ufEogtin.js";import{c as V,R as ne,A as ae,a as se,C as ie}from"./index-B_LZxNEG.js";var le="Separator",M="horizontal",ce=["horizontal","vertical"],F=a.forwardRef((e,o)=>{const{decorative:t,orientation:r=M,...n}=e,s=ue(r)?r:M,d=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return u.jsx(j.div,{"data-orientation":s,...d,...n,ref:o})});F.displayName=le;function ue(e){return ce.includes(e)}var Ie=F,pe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),de="VisuallyHidden",U=a.forwardRef((e,o)=>u.jsx(j.span,{...e,ref:o,style:{...pe,...e.style}}));U.displayName=de;var fe=U,[_,ke]=Q("Tooltip",[V]),A=V(),Y="TooltipProvider",ve=700,D="tooltip.open",[he,N]=_(Y),B=e=>{const{__scopeTooltip:o,delayDuration:t=ve,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=e,l=a.useRef(!0),d=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const f=i.current;return()=>window.clearTimeout(f)},[]),u.jsx(he,{scope:o,isOpenDelayedRef:l,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:a.useCallback(f=>{d.current=f},[]),disableHoverableContent:n,children:s})};B.displayName=Y;var R="Tooltip",[xe,O]=_(R),z=e=>{const{__scopeTooltip:o,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:d}=e,i=N(R,e.__scopeTooltip),f=A(o),[c,v]=a.useState(null),h=te(),p=a.useRef(0),x=l??i.disableHoverableContent,y=d??i.delayDuration,T=a.useRef(!1),[C,g]=Z({prop:r,defaultProp:n??!1,onChange:S=>{S?(i.onOpen(),document.dispatchEvent(new CustomEvent(D))):i.onClose(),s?.(S)},caller:R}),w=a.useMemo(()=>C?T.current?"delayed-open":"instant-open":"closed",[C]),E=a.useCallback(()=>{window.clearTimeout(p.current),p.current=0,T.current=!1,g(!0)},[g]),P=a.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g(!1)},[g]),k=a.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{T.current=!0,g(!0),p.current=0},y)},[y,g]);return a.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),u.jsx(ne,{...f,children:u.jsx(xe,{scope:o,contentId:h,open:C,stateAttribute:w,trigger:c,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?k():E()},[i.isOpenDelayedRef,k,E]),onTriggerLeave:a.useCallback(()=>{x?P():(window.clearTimeout(p.current),p.current=0)},[P,x]),onOpen:E,onClose:P,disableHoverableContent:x,children:t})})};z.displayName=R;var L="TooltipTrigger",$=a.forwardRef((e,o)=>{const{__scopeTooltip:t,...r}=e,n=O(L,t),s=N(L,t),l=A(t),d=a.useRef(null),i=G(o,d,n.onTriggerChange),f=a.useRef(!1),c=a.useRef(!1),v=a.useCallback(()=>f.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),u.jsx(ae,{asChild:!0,...l,children:u.jsx(j.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:m(e.onPointerMove,h=>{h.pointerType!=="touch"&&!c.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),c.current=!0)}),onPointerLeave:m(e.onPointerLeave,()=>{n.onTriggerLeave(),c.current=!1}),onPointerDown:m(e.onPointerDown,()=>{n.open&&n.onClose(),f.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:m(e.onFocus,()=>{f.current||n.onOpen()}),onBlur:m(e.onBlur,n.onClose),onClick:m(e.onClick,n.onClose)})})});$.displayName=L;var I="TooltipPortal",[Te,ye]=_(I,{forceMount:void 0}),q=e=>{const{__scopeTooltip:o,forceMount:t,children:r,container:n}=e,s=O(I,o);return u.jsx(Te,{scope:o,forceMount:t,children:u.jsx(H,{present:t||s.open,children:u.jsx(oe,{asChild:!0,container:n,children:r})})})};q.displayName=I;var b="TooltipContent",W=a.forwardRef((e,o)=>{const t=ye(b,e.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=e,l=O(b,e.__scopeTooltip);return u.jsx(H,{present:r||l.open,children:l.disableHoverableContent?u.jsx(X,{side:n,...s,ref:o}):u.jsx(ge,{side:n,...s,ref:o})})}),ge=a.forwardRef((e,o)=>{const t=O(b,e.__scopeTooltip),r=N(b,e.__scopeTooltip),n=a.useRef(null),s=G(o,n),[l,d]=a.useState(null),{trigger:i,onClose:f}=t,c=n.current,{onPointerInTransitChange:v}=r,h=a.useCallback(()=>{d(null),v(!1)},[v]),p=a.useCallback((x,y)=>{const T=x.currentTarget,C={x:x.clientX,y:x.clientY},g=we(C,T.getBoundingClientRect()),w=Ee(C,g),E=Pe(y.getBoundingClientRect()),P=Oe([...w,...E]);d(P),v(!0)},[v]);return a.useEffect(()=>()=>h(),[h]),a.useEffect(()=>{if(i&&c){const x=T=>p(T,c),y=T=>p(T,i);return i.addEventListener("pointerleave",x),c.addEventListener("pointerleave",y),()=>{i.removeEventListener("pointerleave",x),c.removeEventListener("pointerleave",y)}}},[i,c,p,h]),a.useEffect(()=>{if(l){const x=y=>{const T=y.target,C={x:y.clientX,y:y.clientY},g=i?.contains(T)||c?.contains(T),w=!Re(C,l);g?h():w&&(h(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[i,c,l,f,h]),u.jsx(X,{...e,ref:s})}),[Ce,me]=_(R,{isInside:!1}),be=ee("TooltipContent"),X=a.forwardRef((e,o)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...d}=e,i=O(b,t),f=A(t),{onClose:c}=i;return a.useEffect(()=>(document.addEventListener(D,c),()=>document.removeEventListener(D,c)),[c]),a.useEffect(()=>{if(i.trigger){const v=h=>{h.target?.contains(i.trigger)&&c()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,c]),u.jsx(re,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:c,children:u.jsxs(ie,{"data-state":i.stateAttribute,...f,...d,ref:o,style:{...d.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:[u.jsx(be,{children:r}),u.jsx(Ce,{scope:t,isInside:!0,children:u.jsx(fe,{id:i.contentId,role:"tooltip",children:n||r})})]})})});W.displayName=b;var K="TooltipArrow",J=a.forwardRef((e,o)=>{const{__scopeTooltip:t,...r}=e,n=A(t);return me(K,t).isInside?null:u.jsx(se,{...n,...r,ref:o})});J.displayName=K;function we(e,o){const t=Math.abs(o.top-e.y),r=Math.abs(o.bottom-e.y),n=Math.abs(o.right-e.x),s=Math.abs(o.left-e.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ee(e,o,t=5){const r=[];switch(o){case"top":r.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":r.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":r.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":r.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return r}function Pe(e){const{top:o,right:t,bottom:r,left:n}=e;return[{x:n,y:o},{x:t,y:o},{x:t,y:r},{x:n,y:r}]}function Re(e,o){const{x:t,y:r}=e;let n=!1;for(let s=0,l=o.length-1;s<o.length;l=s++){const d=o[s],i=o[l],f=d.x,c=d.y,v=i.x,h=i.y;c>r!=h>r&&t<(v-f)*(r-c)/(h-c)+f&&(n=!n)}return n}function Oe(e){const o=e.slice();return o.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),_e(o)}function _e(e){if(e.length<=1)return e.slice();const o=[];for(let r=0;r<e.length;r++){const n=e[r];for(;o.length>=2;){const s=o[o.length-1],l=o[o.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))o.pop();else break}o.push(n)}o.pop();const t=[];for(let r=e.length-1;r>=0;r--){const n=e[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),o.length===1&&t.length===1&&o[0].x===t[0].x&&o[0].y===t[0].y?o:o.concat(t)}var Se=B,Me=z,He=$,Ge=q,Ve=W,Fe=J;export{Fe as A,Ve as C,Se as P,Ie as R,He as T,pe as V,Me as a,Ge as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as y,a as X}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as E}from"./utils-
|
|
1
|
+
import{p as y,a as X}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as E}from"./utils-BLOeDrX7.js";function ut({className:e,...o}){return y.jsx("div",{"data-slot":"table-container",className:"flex relative",children:y.jsx("div",{"data-slot":"table",className:E("flex-1 caption-bottom text-sm",e),...o})})}function at({className:e,...o}){return y.jsx("div",{"data-slot":"table-header",className:E("[&_tr]:border-b",e),...o})}function gt({className:e,...o}){return y.jsx("div",{"data-slot":"table-body",className:E("[&_tr:last-child]:border-0",e),...o})}function dt({className:e,...o}){return y.jsx("div",{"data-slot":"table-row",className:E("hover:bg-muted/50 data-[state=selected]:bg-muted transition-colors",e),...o})}function ct({className:e,...o}){return y.jsx("div",{"data-slot":"table-head",className:E("flex items-center text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap border-b [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...o})}function ft({className:e,...o}){return y.jsx("div",{"data-slot":"table-cell",className:E("p-2 align-middle whitespace-nowrap border-b [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...o})}/**
|
|
2
2
|
* table-core
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) TanStack
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,p as y}from"./chunk-EF7DTUVF-CaKisB5m.js";import{o as h}from"./utils-
|
|
1
|
+
import{a as s,p as y}from"./chunk-EF7DTUVF-CaKisB5m.js";import{o as h}from"./utils-BLOeDrX7.js";function C(n,t){if(typeof n=="function")return n(t);n!=null&&(n.current=t)}function x(...n){return t=>{let e=!1;const l=n.map(r=>{const o=C(r,t);return!e&&typeof o=="function"&&(e=!0),o});if(e)return()=>{for(let r=0;r<l.length;r++){const o=l[r];typeof o=="function"?o():C(n[r],null)}}}}function I(...n){return s.useCallback(x(...n),n)}function N(n){const t=R(n),e=s.forwardRef((l,r)=>{const{children:o,...u}=l,a=s.Children.toArray(o),f=a.find(j);if(f){const i=f.props.children,c=a.map(d=>d===f?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:d);return y.jsx(t,{...u,ref:r,children:s.isValidElement(i)?s.cloneElement(i,void 0,c):null})}return y.jsx(t,{...u,ref:r,children:o})});return e.displayName=`${n}.Slot`,e}var W=N("Slot");function R(n){const t=s.forwardRef((e,l)=>{const{children:r,...o}=e;if(s.isValidElement(r)){const u=_(r),a=O(o,r.props);return r.type!==s.Fragment&&(a.ref=l?x(l,u):u),s.cloneElement(r,a)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${n}.SlotClone`,t}var E=Symbol("radix.slottable");function k(n){const t=({children:e})=>y.jsx(y.Fragment,{children:e});return t.displayName=`${n}.Slottable`,t.__radixId=E,t}function j(n){return s.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===E}function O(n,t){const e={...t};for(const l in t){const r=n[l],o=t[l];/^on[A-Z]/.test(l)?r&&o?e[l]=(...a)=>{const f=o(...a);return r(...a),f}:r&&(e[l]=r):l==="style"?e[l]={...r,...o}:l==="className"&&(e[l]=[r,o].filter(Boolean).join(" "))}return{...n,...e}}function _(n){let t=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,e=t&&"isReactWarning"in t&&t.isReactWarning;return e?n.ref:(t=Object.getOwnPropertyDescriptor(n,"ref")?.get,e=t&&"isReactWarning"in t&&t.isReactWarning,e?n.props.ref:n.props.ref||n.ref)}const S=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,b=h,T=(n,t)=>e=>{var l;if(t?.variants==null)return b(n,e?.class,e?.className);const{variants:r,defaultVariants:o}=t,u=Object.keys(r).map(i=>{const c=e?.[i],d=o?.[i];if(c===null)return null;const m=S(c)||S(d);return r[i][m]}),a=e&&Object.entries(e).reduce((i,c)=>{let[d,m]=c;return m===void 0||(i[d]=m),i},{}),f=t==null||(l=t.compoundVariants)===null||l===void 0?void 0:l.reduce((i,c)=>{let{class:d,className:m,...V}=c;return Object.entries(V).every(g=>{let[p,v]=g;return Array.isArray(v)?v.includes({...o,...a}[p]):{...o,...a}[p]===v})?[...i,d,m]:i},[]);return b(n,u,f,e?.class,e?.className)};export{W as S,k as a,N as b,T as c,I as u};
|