@pg-boss/dashboard 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +25 -173
  2. package/build/client/assets/MenuTrigger-CEHCnGow.js +1 -0
  3. package/build/client/assets/{_index-Bcg_-XSd.js → _index-9fLquIe1.js} +1 -1
  4. package/build/client/assets/{badge-Cd8v3tl3.js → badge-B5ZugmiV.js} +1 -1
  5. package/build/client/assets/{button-BaXUPm8v.js → button-Djse56Dx.js} +1 -1
  6. package/build/client/assets/{chevron-down-xu6Uceu-.js → chevron-down-B4tDL9Ah.js} +1 -1
  7. package/build/client/assets/chunk-LFPYN7LY-Cj1DJmJR.js +26 -0
  8. package/build/client/assets/{createLucideIcon-BXGwbdrh.js → createLucideIcon-B0YqJFaz.js} +1 -1
  9. package/build/client/assets/db-link-DmvfwdX4.js +1 -0
  10. package/build/client/assets/dialog-CQzw3QVH.js +1 -0
  11. package/build/client/assets/{entry.client-COnaNoy-.js → entry.client-Szv-xmaE.js} +4 -4
  12. package/build/client/assets/{error-card-DmoxS3Ao.js → error-card-CXoOCvsg.js} +1 -1
  13. package/build/client/assets/{filter-select-mMC79WOR.js → filter-select-DXyBBVm8.js} +1 -1
  14. package/build/client/assets/{index-DhMkYPMa.js → index-x2yWco1W.js} +1 -1
  15. package/build/client/assets/{jobs-DtmTCs8I.js → jobs-CM6xcK-O.js} +1 -1
  16. package/build/client/assets/manifest-acaa4b8e.js +1 -0
  17. package/build/client/assets/{pagination-NfhvsUbp.js → pagination-C4yyCmBA.js} +1 -1
  18. package/build/client/assets/{queues._index-Cw1B49mg.js → queues._index-Dn3ieC5d.js} +1 -1
  19. package/build/client/assets/{queues._name-D0cG_qDX.js → queues._name-GrviLLx2.js} +1 -1
  20. package/build/client/assets/{queues._name.jobs._jobId-uJ3dfM3J.js → queues._name.jobs._jobId-s_wYs79w.js} +1 -1
  21. package/build/client/assets/{queues.create-BGXDhJ3m.js → queues.create-Ch3Mqw52.js} +1 -1
  22. package/build/client/assets/root-Bpb4WtY4.css +1 -0
  23. package/build/client/assets/{root-NWrBrGvr.js → root-D0qqtdF7.js} +1 -1
  24. package/build/client/assets/{schedules-DzgBEayh.js → schedules-DwnuuhxF.js} +1 -1
  25. package/build/client/assets/{schedules._name._key-i42S9kw2.js → schedules._name._key-DJn-u3Cm.js} +1 -1
  26. package/build/client/assets/{schedules.new-Dt78KptL.js → schedules.new-CQuE2Uhz.js} +1 -1
  27. package/build/client/assets/{send-0eWgiWNl.js → send-DVfuC6NR.js} +1 -1
  28. package/build/client/assets/{table-CTo0I5HG.js → table-CtSLyG7m.js} +1 -1
  29. package/build/client/assets/useOpenInteractionType-Ss_6xZdw.js +12 -0
  30. package/build/client/assets/{warnings-BhQM6lFV.js → warnings-DqRQYomb.js} +1 -1
  31. package/build/server/assets/server-build.js +305 -39
  32. package/package.json +15 -15
  33. package/build/client/assets/MenuTrigger-SThQHnlb.js +0 -1
  34. package/build/client/assets/chunk-JZWAC4HX-DC8i-F7r.js +0 -26
  35. package/build/client/assets/db-link-CtPnIrIr.js +0 -1
  36. package/build/client/assets/dialog-Bl8T588f.js +0 -1
  37. package/build/client/assets/manifest-25954681.js +0 -1
  38. package/build/client/assets/root-DJRlbyb5.css +0 -1
  39. package/build/client/assets/useOpenInteractionType-C_L8nZ_l.js +0 -12
@@ -1,4 +1,4 @@
1
- import{a,p as e,q as ne,t as ae,v as oe,w as ie,x as de,y as le,z as ce,A as ue,B as me,M as he,L as fe,S as ge,C as xe,O as be,i as pe}from"./chunk-JZWAC4HX-DC8i-F7r.js";import{c as d,u as L,m as E,a as ve,D as ye}from"./db-link-CtPnIrIr.js";import{c as M}from"./createLucideIcon-BXGwbdrh.js";import{M as z,a as H,b as P,c as D,d as q,e as S}from"./MenuTrigger-SThQHnlb.js";import"./useOpenInteractionType-C_L8nZ_l.js";import"./index-DhMkYPMa.js";const we=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],je=M("monitor",we);const ke=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],R=M("moon",ke);const Ne=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Se=M("panel-left",Ne);const Me=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],T=M("sun",Me),A=["emerald","teal","cyan","sky","blue","indigo","violet","purple"],Ce={emerald:"#059669",teal:"#0d9488",cyan:"#0891b2",sky:"#0284c7",blue:"#2563eb",indigo:"#4f46e5",violet:"#7c3aed",purple:"#9333ea"},V=a.createContext(void 0),$="pg-boss-theme",G="pg-boss-color-theme";function C(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function I(){if(typeof window>"u")return"system";const t=localStorage.getItem($);return t==="light"||t==="dark"||t==="system"?t:"system"}function Le(){if(typeof window>"u")return"violet";const t=localStorage.getItem(G);return t&&A.includes(t)?t:"violet"}function Ee({children:t}){const[s,r]=a.useState(I),[n,i]=a.useState(()=>{const o=I();return o==="system"?C():o}),[l,m]=a.useState(Le);a.useEffect(()=>{const o=s==="system"?C():s;i(o);const u=document.documentElement;u.classList.remove("light","dark"),u.classList.add(o)},[s]),a.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{if(s==="system"){const b=C();i(b),document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(b)}};return o.addEventListener("change",u),()=>o.removeEventListener("change",u)},[s]),a.useEffect(()=>{document.documentElement.dataset.colorTheme=l;const u=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="6" fill="${Ce[l]}"/><text x="16" y="22" text-anchor="middle" font-family="system-ui,sans-serif" font-size="14" font-weight="bold" fill="white">PG</text></svg>`,b=encodeURIComponent(u);let f=document.querySelector('link[rel="icon"]');f?f.href=`data:image/svg+xml,${b}`:(f=document.createElement("link"),f.rel="icon",f.type="image/svg+xml",f.href=`data:image/svg+xml,${b}`,document.head.appendChild(f))},[l]);const x=o=>{r(o),localStorage.setItem($,o)},h=o=>{m(o),localStorage.setItem(G,o)};return e.jsx(V.Provider,{value:{theme:s,setTheme:x,resolvedTheme:n,colorTheme:l,setColorTheme:h},children:t})}function W(){const t=a.useContext(V);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t}const Re={light:"Light",dark:"Dark",system:"System"};function Te(){const{theme:t,setTheme:s,resolvedTheme:r}=W();return e.jsxs(z,{children:[e.jsxs(H,{className:d("flex items-center gap-2 rounded-md p-2 w-full cursor-pointer","text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent","focus:outline-none","transition-colors"),"aria-label":"Toggle theme",children:[r==="dark"?e.jsx(R,{className:"h-5 w-5 shrink-0"}):e.jsx(T,{className:"h-5 w-5 shrink-0"}),e.jsx("span",{className:"text-sm group-data-[state=collapsed]:hidden",children:Re[t]})]}),e.jsx(P,{container:typeof document<"u"?document.body:void 0,children:e.jsx(D,{className:"z-[100]",children:e.jsxs(q,{className:d("min-w-[8rem] rounded-md border p-1 shadow-md z-[100]","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:[e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="light"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("light"),children:[e.jsx(T,{className:"h-4 w-4"}),"Light"]}),e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="dark"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("dark"),children:[e.jsx(R,{className:"h-4 w-4"}),"Dark"]}),e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="system"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("system"),children:[e.jsx(je,{className:"h-4 w-4"}),"System"]})]})})})]})}const _={emerald:"bg-emerald-500",teal:"bg-teal-500",cyan:"bg-cyan-500",sky:"bg-sky-500",blue:"bg-blue-500",indigo:"bg-indigo-500",violet:"bg-violet-500",purple:"bg-purple-500"},B={emerald:"Emerald",teal:"Teal",cyan:"Cyan",sky:"Sky",blue:"Blue",indigo:"Indigo",violet:"Violet",purple:"Purple"};function Ie(){const{colorTheme:t,setColorTheme:s}=W();return e.jsxs(z,{children:[e.jsxs(H,{className:d("flex items-center gap-2 rounded-md p-2 w-full cursor-pointer","text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent","focus:outline-none","transition-colors"),"aria-label":"Change color theme",children:[e.jsx("span",{className:d("h-5 w-5 rounded-full shrink-0",_[t])}),e.jsx("span",{className:"text-sm group-data-[state=collapsed]:hidden",children:B[t]})]}),e.jsx(P,{container:typeof document<"u"?document.body:void 0,children:e.jsx(D,{className:"z-[100]",children:e.jsx(q,{className:d("rounded-md border p-2 shadow-md z-[100]","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:e.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:A.map(r=>e.jsx(S,{className:d("w-7 h-7 rounded-full cursor-pointer transition-all","outline-none","hover:scale-110",_[r],t===r&&"ring-2 ring-offset-2 ring-gray-900 dark:ring-white dark:ring-offset-gray-900"),onClick:()=>s(r),"aria-label":r,title:B[r]},r))})})})})]})}function _e({content:t,children:s,side:r="right",align:n="center"}){const[i,l]=a.useState(!1),[m,x]=a.useState({top:0,left:0}),h=a.useRef(null),o=a.useRef(null),u=a.useCallback(()=>{if(!h.current||!o.current)return;const c=h.current.getBoundingClientRect(),g=o.current.getBoundingClientRect();let y=0,j=0;switch(r){case"top":y=c.top-g.height-8,j=c.left+(c.width-g.width)/2;break;case"right":y=c.top+(c.height-g.height)/2,j=c.right+8;break;case"bottom":y=c.bottom+8,j=c.left+(c.width-g.width)/2;break;case"left":y=c.top+(c.height-g.height)/2,j=c.left-g.width-8;break}r==="top"||r==="bottom"?n==="start"?j=c.left:n==="end"&&(j=c.right-g.width):n==="start"?y=c.top:n==="end"&&(y=c.bottom-g.height),x({top:y,left:j})},[r,n]);a.useEffect(()=>{if(i)return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}},[i,u]);const b=()=>{l(!0)},f=()=>{l(!1)},w=a.Children.only(s),k=a.cloneElement(w,{ref:c=>{c&&(h.current=c);const g=w.ref;typeof g=="function"?g(c):g&&(g.current=c)},onMouseEnter:c=>{b(),w.props?.onMouseEnter?.(c)},onMouseLeave:c=>{f(),w.props?.onMouseLeave?.(c)}});return e.jsxs(e.Fragment,{children:[k,i&&e.jsx("div",{ref:o,role:"tooltip",style:{position:"fixed",top:m.top,left:m.left,zIndex:9999},className:d("px-3 py-1.5 text-sm font-medium text-white bg-gray-900 dark:bg-gray-700 rounded-md shadow-lg","pointer-events-none animate-in fade-in-0 zoom-in-95","whitespace-nowrap"),children:t})]})}const Be="sidebar:state",Oe=3600*24*7,ze="16rem",He="3rem",Pe="b",K=a.createContext(null);function N(){const t=a.useContext(K);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const Z=a.forwardRef(({defaultOpen:t=!0,open:s,onOpenChange:r,className:n,style:i,children:l,...m},x)=>{const[h,o]=a.useState(!1),[u,b]=a.useState(t),f=s??u,w=a.useCallback(p=>{const v=typeof p=="function"?p(f):p;r?r(v):b(v),document.cookie=`${Be}=${v}; path=/; max-age=${Oe}`},[r,f]),k=a.useCallback(()=>w(p=>!p),[w]),[c,g]=a.useState(!1);a.useEffect(()=>{const p=window.matchMedia("(max-width: 768px)"),v=()=>g(p.matches);return v(),p.addEventListener("change",v),()=>p.removeEventListener("change",v)},[]),a.useEffect(()=>{const p=v=>{v.key===Pe&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),k())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[k]);const y=f?"expanded":"collapsed",j=a.useMemo(()=>({state:y,open:f,setOpen:w,isMobile:c,openMobile:h,setOpenMobile:o,toggleSidebar:k}),[y,f,w,c,h,o,k]);return e.jsx(K.Provider,{value:j,children:e.jsx("div",{style:{"--sidebar-width":ze,"--sidebar-width-icon":He,...i},className:d("group/sidebar-wrapper flex min-h-screen w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:x,...m,children:l})})});Z.displayName="SidebarProvider";const U=a.forwardRef(({side:t="left",variant:s="sidebar",collapsible:r="offcanvas",className:n,children:i,...l},m)=>{const{isMobile:x,state:h,openMobile:o,setOpenMobile:u}=N();return r==="none"?e.jsx("div",{className:d("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:m,...l,children:i}):x?e.jsxs(e.Fragment,{children:[o&&e.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:()=>u(!1)}),e.jsx("div",{ref:m,className:d("fixed inset-y-0 z-50 flex h-full w-[--sidebar-width-mobile] flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground transition-transform duration-200 ease-in-out",t==="left"?"left-0":"right-0",o?"translate-x-0":t==="left"?"-translate-x-full":"translate-x-full",n),...l,children:i})]}):e.jsx("div",{ref:m,"data-state":h,className:d("group peer hidden md:flex fixed inset-y-0 left-0 z-30 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground overflow-y-auto overflow-x-hidden","transition-[width] duration-200 ease-linear",h==="expanded"?"w-[--sidebar-width]":"w-[--sidebar-width-icon]",n),...l,children:i})});U.displayName="Sidebar";const F=a.forwardRef(({className:t,onClick:s,...r},n)=>{const{toggleSidebar:i,isMobile:l,openMobile:m,setOpenMobile:x}=N();return e.jsxs("button",{ref:n,onClick:h=>{s?.(h),l?x(!m):i()},className:d("inline-flex items-center justify-center rounded-md p-2 cursor-pointer","text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...r,children:[e.jsx(Se,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});F.displayName="SidebarTrigger";const Q=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex flex-col gap-2 p-2 overflow-hidden",t),...s}));Q.displayName="SidebarHeader";const J=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex flex-col gap-2 p-2 overflow-hidden",t),...s}));J.displayName="SidebarFooter";const Y=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex min-h-0 flex-1 flex-col gap-2 overflow-auto",t),...s}));Y.displayName="SidebarContent";const X=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("relative flex w-full min-w-0 flex-col p-2",t),...s}));X.displayName="SidebarGroup";const De=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("px-2 text-xs font-medium text-sidebar-foreground/70",t),...s}));De.displayName="SidebarGroupLabel";const ee=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("w-full text-sm",t),...s}));ee.displayName="SidebarGroupContent";const te=a.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,className:d("flex w-full min-w-0 flex-col gap-1",t),...s}));te.displayName="SidebarMenu";const se=a.forwardRef(({className:t,...s},r)=>e.jsx("li",{ref:r,className:d("group/menu-item relative",t),...s}));se.displayName="SidebarMenuItem";const qe=ve("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none 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 cursor-pointer group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 group-data-[state=collapsed]:justify-center",{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-[state=collapsed]:!h-8"}},defaultVariants:{variant:"default",size:"default"}}),re=a.forwardRef(({render:t,isActive:s=!1,variant:r="default",size:n="default",tooltip:i,className:l,...m},x)=>{const{state:h}=N(),o=L({defaultTagName:"button",render:t,props:E({"data-sidebar":"menu-button","data-active":s,className:d(qe({variant:r,size:n}),s&&"bg-sidebar-accent font-medium text-sidebar-accent-foreground",l)},m),ref:x});return h==="collapsed"&&i&&typeof i=="string"?e.jsx(_e,{content:i,children:o}):o});re.displayName="SidebarMenuButton";const Ae=a.forwardRef(({className:t,render:s,showOnHover:r=!1,...n},i)=>L({defaultTagName:"button",render:s,props:E({"data-sidebar":"menu-action",className:d("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-hover/menu-button:text-sidebar-accent-foreground",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t)},n),ref:i}));Ae.displayName="SidebarMenuAction";const Ve=a.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:d("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",t),...s}));Ve.displayName="SidebarMenuSub";const $e=a.forwardRef(({...t},s)=>e.jsx("li",{ref:s,...t}));$e.displayName="SidebarMenuSubItem";const Ge=a.forwardRef(({render:t,size:s="md",isActive:r,className:n,...i},l)=>L({defaultTagName:"a",render:t,props:E({"data-sidebar":"menu-sub-button","data-size":s,"data-active":r,className:d("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",s==="sm"&&"text-xs",s==="md"&&"text-sm",n)},i),ref:l}));Ge.displayName="SidebarMenuSubButton";const We=[{name:"Overview",href:"/",icon:Ke},{name:"Jobs",href:"/jobs",icon:Ze},{name:"Queues",href:"/queues",icon:Ue},{name:"Schedules",href:"/schedules",icon:Fe},{name:"Warnings",href:"/warnings",icon:Qe}];function Ke({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})})}function Ze({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})})}function Ue({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75Z"})})}function Fe({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}function Qe({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}function O({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})}function Je({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})}function Ye({databases:t,currentDb:s,onSelect:r}){const[n,i]=a.useState(!1);return t.length<=1?null:e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>i(!n),className:d("w-full flex items-center justify-between px-3 py-2 text-sm rounded-lg transition-colors cursor-pointer","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(O,{className:"w-4 h-4 flex-shrink-0"}),e.jsx("span",{className:"font-medium truncate",children:s.name})]}),e.jsx(Je,{className:d("w-4 h-4 flex-shrink-0 transition-transform",n&&"rotate-180")})]}),n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),e.jsx("div",{className:d("absolute left-0 right-0 mt-1 rounded-lg shadow-lg z-20 py-1","bg-sidebar-accent border border-sidebar-border"),children:t.map(l=>e.jsxs("button",{type:"button",onClick:()=>{r(l),i(!1)},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors cursor-pointer",l.id===s.id?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[e.jsx(O,{className:d("w-4 h-4 flex-shrink-0")}),e.jsx("span",{className:"truncate",children:l.name}),l.schema!=="pgboss"&&e.jsxs("span",{className:"ml-auto text-xs opacity-70",children:["(",l.schema,")"]})]},l.id))})]})]})}function Xe(){const t=ne("root"),[s]=ae(),r=oe(),{setOpenMobile:n}=N(),i=t?.databases||[],l=t?.currentDb,m=s.get("db"),x=o=>{const u=new URLSearchParams(s);o.id===i[0]?.id?u.delete("db"):u.set("db",o.id);const b=u.toString();r({pathname:window.location.pathname,search:b?`?${b}`:""})},h=o=>m?`${o}?db=${m}`:o;return e.jsxs(U,{children:[e.jsxs(Q,{children:[e.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary-600 flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-white font-bold text-sm",children:"PG"})}),e.jsx("span",{className:"font-semibold text-sidebar-foreground group-data-[state=collapsed]:hidden",children:"pg-boss"})]}),i&&l&&i.length>1&&e.jsx("div",{className:"group-data-[state=collapsed]:hidden",children:e.jsx(Ye,{databases:i,currentDb:l,onSelect:x})})]}),e.jsx(Y,{children:e.jsx(X,{children:e.jsx(ee,{children:e.jsx(te,{children:We.map(o=>e.jsx(se,{children:e.jsx(ie,{to:h(o.href),end:o.href==="/",onClick:()=>n(!1),children:({isActive:u})=>e.jsxs(re,{isActive:u,tooltip:o.name,children:[e.jsx(o.icon,{className:"h-5 w-5 flex-shrink-0"}),e.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:o.name})]})})},o.name))})})})}),e.jsx(J,{children:e.jsxs("div",{className:"flex flex-col px-2",children:[e.jsx("p",{className:"px-2 mb-1 text-xs font-medium text-sidebar-foreground/50 uppercase tracking-wider group-data-[state=collapsed]:hidden",children:"Theme"}),e.jsx(Te,{}),e.jsx(Ie,{})]})})]})}function et(){return de().state==="loading"?e.jsx("div",{className:"fixed top-0 left-0 right-0 z-50 h-1 bg-gray-200 dark:bg-gray-800",children:e.jsx("div",{className:"h-full bg-primary-600 dark:bg-primary-400 animate-loading-bar"})}):null}function tt(){le();const s=ce().pathname.split("/").filter(Boolean);if(s.length===0)return null;const r=[];if(s[0]==="queues"){if(r.push({label:"Queues",href:"/queues"}),s.length>1&&s[1]!=="queues"){const n=decodeURIComponent(s[1]);if(r.push({label:n,href:`/queues/${encodeURIComponent(n)}`}),s.length>2&&s[2]==="jobs"&&s[3]){const i=s[3];r.push({label:`${i.slice(0,8)}...`})}}}else if(s[0]==="schedules"){if(r.push({label:"Schedules",href:"/schedules"}),s.length>1&&s[1]==="new")r.push({label:"New Schedule"});else if(s.length>1){const n=decodeURIComponent(s[1]);r.push({label:n})}}else s[0]==="jobs"?r.push({label:"Jobs"}):s[0]==="warnings"?r.push({label:"Warnings"}):s[0]==="send"&&(r.push({label:"Queues",href:"/queues"}),r.push({label:"Send Job"}));return r.length===0?null:e.jsx("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400",children:r.map((n,i)=>{const l=i===r.length-1;return e.jsxs("div",{className:"flex items-center gap-2",children:[i>0&&e.jsx("span",{children:"/"}),n.href&&!l?e.jsx(ye,{to:n.href,className:"hover:text-gray-700 dark:hover:text-gray-300",children:n.label}):e.jsx("span",{className:l?"text-gray-900 dark:text-gray-100 font-medium":"",children:n.label})]},i)})})}function st({children:t}){const{open:s,isMobile:r,state:n}=N();return e.jsxs("main",{className:d("flex-1 min-w-0 overflow-x-hidden bg-gray-50 dark:bg-black transition-[padding] duration-200 ease-linear",!r&&(n==="expanded"?"md:pl-32":"md:pl-12")),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-2",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(F,{}),e.jsx(tt,{})]}),!s&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-primary-600 flex items-center justify-center md:hidden",children:e.jsx("span",{className:"text-white font-bold text-xs",children:"PG"})}),e.jsx("span",{className:"font-semibold text-sidebar-foreground md:hidden",children:"pg-boss"})]})]}),e.jsx("div",{className:"px-6 pb-6 lg:px-8 lg:pb-8",children:t})]})}const rt=`
1
+ import{a,p as e,q as ne,t as ae,v as oe,w as ie,x as de,y as le,z as ce,A as ue,B as me,M as he,L as fe,S as ge,C as xe,O as be,i as pe}from"./chunk-LFPYN7LY-Cj1DJmJR.js";import{c as d,u as L,m as E,a as ve,D as ye}from"./db-link-DmvfwdX4.js";import{c as M}from"./createLucideIcon-B0YqJFaz.js";import{M as z,a as H,b as P,c as D,d as q,e as S}from"./MenuTrigger-CEHCnGow.js";import"./useOpenInteractionType-Ss_6xZdw.js";import"./index-x2yWco1W.js";const we=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],je=M("monitor",we);const ke=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],R=M("moon",ke);const Ne=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Se=M("panel-left",Ne);const Me=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],T=M("sun",Me),A=["emerald","teal","cyan","sky","blue","indigo","violet","purple"],Ce={emerald:"#059669",teal:"#0d9488",cyan:"#0891b2",sky:"#0284c7",blue:"#2563eb",indigo:"#4f46e5",violet:"#7c3aed",purple:"#9333ea"},V=a.createContext(void 0),$="pg-boss-theme",G="pg-boss-color-theme";function C(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function I(){if(typeof window>"u")return"system";const t=localStorage.getItem($);return t==="light"||t==="dark"||t==="system"?t:"system"}function Le(){if(typeof window>"u")return"violet";const t=localStorage.getItem(G);return t&&A.includes(t)?t:"violet"}function Ee({children:t}){const[s,r]=a.useState(I),[n,i]=a.useState(()=>{const o=I();return o==="system"?C():o}),[l,m]=a.useState(Le);a.useEffect(()=>{const o=s==="system"?C():s;i(o);const u=document.documentElement;u.classList.remove("light","dark"),u.classList.add(o)},[s]),a.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{if(s==="system"){const b=C();i(b),document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(b)}};return o.addEventListener("change",u),()=>o.removeEventListener("change",u)},[s]),a.useEffect(()=>{document.documentElement.dataset.colorTheme=l;const u=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="6" fill="${Ce[l]}"/><text x="16" y="22" text-anchor="middle" font-family="system-ui,sans-serif" font-size="14" font-weight="bold" fill="white">PG</text></svg>`,b=encodeURIComponent(u);let f=document.querySelector('link[rel="icon"]');f?f.href=`data:image/svg+xml,${b}`:(f=document.createElement("link"),f.rel="icon",f.type="image/svg+xml",f.href=`data:image/svg+xml,${b}`,document.head.appendChild(f))},[l]);const x=o=>{r(o),localStorage.setItem($,o)},h=o=>{m(o),localStorage.setItem(G,o)};return e.jsx(V.Provider,{value:{theme:s,setTheme:x,resolvedTheme:n,colorTheme:l,setColorTheme:h},children:t})}function W(){const t=a.useContext(V);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t}const Re={light:"Light",dark:"Dark",system:"System"};function Te(){const{theme:t,setTheme:s,resolvedTheme:r}=W();return e.jsxs(z,{children:[e.jsxs(H,{className:d("flex items-center gap-2 rounded-md p-2 w-full cursor-pointer","text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent","focus:outline-none","transition-colors"),"aria-label":"Toggle theme",children:[r==="dark"?e.jsx(R,{className:"h-5 w-5 shrink-0"}):e.jsx(T,{className:"h-5 w-5 shrink-0"}),e.jsx("span",{className:"text-sm group-data-[state=collapsed]:hidden",children:Re[t]})]}),e.jsx(P,{container:typeof document<"u"?document.body:void 0,children:e.jsx(D,{className:"z-[100]",children:e.jsxs(q,{className:d("min-w-[8rem] rounded-md border p-1 shadow-md z-[100]","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:[e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="light"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("light"),children:[e.jsx(T,{className:"h-4 w-4"}),"Light"]}),e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="dark"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("dark"),children:[e.jsx(R,{className:"h-4 w-4"}),"Dark"]}),e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="system"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("system"),children:[e.jsx(je,{className:"h-4 w-4"}),"System"]})]})})})]})}const _={emerald:"bg-emerald-500",teal:"bg-teal-500",cyan:"bg-cyan-500",sky:"bg-sky-500",blue:"bg-blue-500",indigo:"bg-indigo-500",violet:"bg-violet-500",purple:"bg-purple-500"},B={emerald:"Emerald",teal:"Teal",cyan:"Cyan",sky:"Sky",blue:"Blue",indigo:"Indigo",violet:"Violet",purple:"Purple"};function Ie(){const{colorTheme:t,setColorTheme:s}=W();return e.jsxs(z,{children:[e.jsxs(H,{className:d("flex items-center gap-2 rounded-md p-2 w-full cursor-pointer","text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent","focus:outline-none","transition-colors"),"aria-label":"Change color theme",children:[e.jsx("span",{className:d("h-5 w-5 rounded-full shrink-0",_[t])}),e.jsx("span",{className:"text-sm group-data-[state=collapsed]:hidden",children:B[t]})]}),e.jsx(P,{container:typeof document<"u"?document.body:void 0,children:e.jsx(D,{className:"z-[100]",children:e.jsx(q,{className:d("rounded-md border p-2 shadow-md z-[100]","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:e.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:A.map(r=>e.jsx(S,{className:d("w-7 h-7 rounded-full cursor-pointer transition-all","outline-none","hover:scale-110",_[r],t===r&&"ring-2 ring-offset-2 ring-gray-900 dark:ring-white dark:ring-offset-gray-900"),onClick:()=>s(r),"aria-label":r,title:B[r]},r))})})})})]})}function _e({content:t,children:s,side:r="right",align:n="center"}){const[i,l]=a.useState(!1),[m,x]=a.useState({top:0,left:0}),h=a.useRef(null),o=a.useRef(null),u=a.useCallback(()=>{if(!h.current||!o.current)return;const c=h.current.getBoundingClientRect(),g=o.current.getBoundingClientRect();let y=0,j=0;switch(r){case"top":y=c.top-g.height-8,j=c.left+(c.width-g.width)/2;break;case"right":y=c.top+(c.height-g.height)/2,j=c.right+8;break;case"bottom":y=c.bottom+8,j=c.left+(c.width-g.width)/2;break;case"left":y=c.top+(c.height-g.height)/2,j=c.left-g.width-8;break}r==="top"||r==="bottom"?n==="start"?j=c.left:n==="end"&&(j=c.right-g.width):n==="start"?y=c.top:n==="end"&&(y=c.bottom-g.height),x({top:y,left:j})},[r,n]);a.useEffect(()=>{if(i)return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}},[i,u]);const b=()=>{l(!0)},f=()=>{l(!1)},w=a.Children.only(s),k=a.cloneElement(w,{ref:c=>{c&&(h.current=c);const g=w.ref;typeof g=="function"?g(c):g&&(g.current=c)},onMouseEnter:c=>{b(),w.props?.onMouseEnter?.(c)},onMouseLeave:c=>{f(),w.props?.onMouseLeave?.(c)}});return e.jsxs(e.Fragment,{children:[k,i&&e.jsx("div",{ref:o,role:"tooltip",style:{position:"fixed",top:m.top,left:m.left,zIndex:9999},className:d("px-3 py-1.5 text-sm font-medium text-white bg-gray-900 dark:bg-gray-700 rounded-md shadow-lg","pointer-events-none animate-in fade-in-0 zoom-in-95","whitespace-nowrap"),children:t})]})}const Be="sidebar:state",Oe=3600*24*7,ze="16rem",He="3rem",Pe="b",K=a.createContext(null);function N(){const t=a.useContext(K);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const Z=a.forwardRef(({defaultOpen:t=!0,open:s,onOpenChange:r,className:n,style:i,children:l,...m},x)=>{const[h,o]=a.useState(!1),[u,b]=a.useState(t),f=s??u,w=a.useCallback(p=>{const v=typeof p=="function"?p(f):p;r?r(v):b(v),document.cookie=`${Be}=${v}; path=/; max-age=${Oe}`},[r,f]),k=a.useCallback(()=>w(p=>!p),[w]),[c,g]=a.useState(!1);a.useEffect(()=>{const p=window.matchMedia("(max-width: 768px)"),v=()=>g(p.matches);return v(),p.addEventListener("change",v),()=>p.removeEventListener("change",v)},[]),a.useEffect(()=>{const p=v=>{v.key===Pe&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),k())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[k]);const y=f?"expanded":"collapsed",j=a.useMemo(()=>({state:y,open:f,setOpen:w,isMobile:c,openMobile:h,setOpenMobile:o,toggleSidebar:k}),[y,f,w,c,h,o,k]);return e.jsx(K.Provider,{value:j,children:e.jsx("div",{style:{"--sidebar-width":ze,"--sidebar-width-icon":He,...i},className:d("group/sidebar-wrapper flex min-h-screen w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:x,...m,children:l})})});Z.displayName="SidebarProvider";const U=a.forwardRef(({side:t="left",variant:s="sidebar",collapsible:r="offcanvas",className:n,children:i,...l},m)=>{const{isMobile:x,state:h,openMobile:o,setOpenMobile:u}=N();return r==="none"?e.jsx("div",{className:d("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:m,...l,children:i}):x?e.jsxs(e.Fragment,{children:[o&&e.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:()=>u(!1)}),e.jsx("div",{ref:m,className:d("fixed inset-y-0 z-50 flex h-full w-[--sidebar-width-mobile] flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground transition-transform duration-200 ease-in-out",t==="left"?"left-0":"right-0",o?"translate-x-0":t==="left"?"-translate-x-full":"translate-x-full",n),...l,children:i})]}):e.jsx("div",{ref:m,"data-state":h,className:d("group peer hidden md:flex fixed inset-y-0 left-0 z-30 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground overflow-y-auto overflow-x-hidden","transition-[width] duration-200 ease-linear",h==="expanded"?"w-[--sidebar-width]":"w-[--sidebar-width-icon]",n),...l,children:i})});U.displayName="Sidebar";const F=a.forwardRef(({className:t,onClick:s,...r},n)=>{const{toggleSidebar:i,isMobile:l,openMobile:m,setOpenMobile:x}=N();return e.jsxs("button",{ref:n,onClick:h=>{s?.(h),l?x(!m):i()},className:d("inline-flex items-center justify-center rounded-md p-2 cursor-pointer","text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...r,children:[e.jsx(Se,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});F.displayName="SidebarTrigger";const Q=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex flex-col gap-2 p-2 overflow-hidden",t),...s}));Q.displayName="SidebarHeader";const J=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex flex-col gap-2 p-2 overflow-hidden",t),...s}));J.displayName="SidebarFooter";const Y=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex min-h-0 flex-1 flex-col gap-2 overflow-auto",t),...s}));Y.displayName="SidebarContent";const X=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("relative flex w-full min-w-0 flex-col p-2",t),...s}));X.displayName="SidebarGroup";const De=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("px-2 text-xs font-medium text-sidebar-foreground/70",t),...s}));De.displayName="SidebarGroupLabel";const ee=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("w-full text-sm",t),...s}));ee.displayName="SidebarGroupContent";const te=a.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,className:d("flex w-full min-w-0 flex-col gap-1",t),...s}));te.displayName="SidebarMenu";const se=a.forwardRef(({className:t,...s},r)=>e.jsx("li",{ref:r,className:d("group/menu-item relative",t),...s}));se.displayName="SidebarMenuItem";const qe=ve("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none 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 cursor-pointer group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 group-data-[state=collapsed]:justify-center",{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-[state=collapsed]:!h-8"}},defaultVariants:{variant:"default",size:"default"}}),re=a.forwardRef(({render:t,isActive:s=!1,variant:r="default",size:n="default",tooltip:i,className:l,...m},x)=>{const{state:h}=N(),o=L({defaultTagName:"button",render:t,props:E({"data-sidebar":"menu-button","data-active":s,className:d(qe({variant:r,size:n}),s&&"bg-sidebar-accent font-medium text-sidebar-accent-foreground",l)},m),ref:x});return h==="collapsed"&&i&&typeof i=="string"?e.jsx(_e,{content:i,children:o}):o});re.displayName="SidebarMenuButton";const Ae=a.forwardRef(({className:t,render:s,showOnHover:r=!1,...n},i)=>L({defaultTagName:"button",render:s,props:E({"data-sidebar":"menu-action",className:d("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-hover/menu-button:text-sidebar-accent-foreground",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t)},n),ref:i}));Ae.displayName="SidebarMenuAction";const Ve=a.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:d("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",t),...s}));Ve.displayName="SidebarMenuSub";const $e=a.forwardRef(({...t},s)=>e.jsx("li",{ref:s,...t}));$e.displayName="SidebarMenuSubItem";const Ge=a.forwardRef(({render:t,size:s="md",isActive:r,className:n,...i},l)=>L({defaultTagName:"a",render:t,props:E({"data-sidebar":"menu-sub-button","data-size":s,"data-active":r,className:d("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",s==="sm"&&"text-xs",s==="md"&&"text-sm",n)},i),ref:l}));Ge.displayName="SidebarMenuSubButton";const We=[{name:"Overview",href:"/",icon:Ke},{name:"Jobs",href:"/jobs",icon:Ze},{name:"Queues",href:"/queues",icon:Ue},{name:"Schedules",href:"/schedules",icon:Fe},{name:"Warnings",href:"/warnings",icon:Qe}];function Ke({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})})}function Ze({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})})}function Ue({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75Z"})})}function Fe({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}function Qe({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}function O({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})}function Je({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})}function Ye({databases:t,currentDb:s,onSelect:r}){const[n,i]=a.useState(!1);return t.length<=1?null:e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>i(!n),className:d("w-full flex items-center justify-between px-3 py-2 text-sm rounded-lg transition-colors cursor-pointer","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(O,{className:"w-4 h-4 flex-shrink-0"}),e.jsx("span",{className:"font-medium truncate",children:s.name})]}),e.jsx(Je,{className:d("w-4 h-4 flex-shrink-0 transition-transform",n&&"rotate-180")})]}),n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),e.jsx("div",{className:d("absolute left-0 right-0 mt-1 rounded-lg shadow-lg z-20 py-1","bg-sidebar-accent border border-sidebar-border"),children:t.map(l=>e.jsxs("button",{type:"button",onClick:()=>{r(l),i(!1)},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors cursor-pointer",l.id===s.id?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[e.jsx(O,{className:d("w-4 h-4 flex-shrink-0")}),e.jsx("span",{className:"truncate",children:l.name}),l.schema!=="pgboss"&&e.jsxs("span",{className:"ml-auto text-xs opacity-70",children:["(",l.schema,")"]})]},l.id))})]})]})}function Xe(){const t=ne("root"),[s]=ae(),r=oe(),{setOpenMobile:n}=N(),i=t?.databases||[],l=t?.currentDb,m=s.get("db"),x=o=>{const u=new URLSearchParams(s);o.id===i[0]?.id?u.delete("db"):u.set("db",o.id);const b=u.toString();r({pathname:window.location.pathname,search:b?`?${b}`:""})},h=o=>m?`${o}?db=${m}`:o;return e.jsxs(U,{children:[e.jsxs(Q,{children:[e.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary-600 flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-white font-bold text-sm",children:"PG"})}),e.jsx("span",{className:"font-semibold text-sidebar-foreground group-data-[state=collapsed]:hidden",children:"pg-boss"})]}),i&&l&&i.length>1&&e.jsx("div",{className:"group-data-[state=collapsed]:hidden",children:e.jsx(Ye,{databases:i,currentDb:l,onSelect:x})})]}),e.jsx(Y,{children:e.jsx(X,{children:e.jsx(ee,{children:e.jsx(te,{children:We.map(o=>e.jsx(se,{children:e.jsx(ie,{to:h(o.href),end:o.href==="/",onClick:()=>n(!1),children:({isActive:u})=>e.jsxs(re,{isActive:u,tooltip:o.name,children:[e.jsx(o.icon,{className:"h-5 w-5 flex-shrink-0"}),e.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:o.name})]})})},o.name))})})})}),e.jsx(J,{children:e.jsxs("div",{className:"flex flex-col px-2",children:[e.jsx("p",{className:"px-2 mb-1 text-xs font-medium text-sidebar-foreground/50 uppercase tracking-wider group-data-[state=collapsed]:hidden",children:"Theme"}),e.jsx(Te,{}),e.jsx(Ie,{})]})})]})}function et(){return de().state==="loading"?e.jsx("div",{className:"fixed top-0 left-0 right-0 z-50 h-1 bg-gray-200 dark:bg-gray-800",children:e.jsx("div",{className:"h-full bg-primary-600 dark:bg-primary-400 animate-loading-bar"})}):null}function tt(){le();const s=ce().pathname.split("/").filter(Boolean);if(s.length===0)return null;const r=[];if(s[0]==="queues"){if(r.push({label:"Queues",href:"/queues"}),s.length>1&&s[1]!=="queues"){const n=decodeURIComponent(s[1]);if(r.push({label:n,href:`/queues/${encodeURIComponent(n)}`}),s.length>2&&s[2]==="jobs"&&s[3]){const i=s[3];r.push({label:`${i.slice(0,8)}...`})}}}else if(s[0]==="schedules"){if(r.push({label:"Schedules",href:"/schedules"}),s.length>1&&s[1]==="new")r.push({label:"New Schedule"});else if(s.length>1){const n=decodeURIComponent(s[1]);r.push({label:n})}}else s[0]==="jobs"?r.push({label:"Jobs"}):s[0]==="warnings"?r.push({label:"Warnings"}):s[0]==="send"&&(r.push({label:"Queues",href:"/queues"}),r.push({label:"Send Job"}));return r.length===0?null:e.jsx("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400",children:r.map((n,i)=>{const l=i===r.length-1;return e.jsxs("div",{className:"flex items-center gap-2",children:[i>0&&e.jsx("span",{children:"/"}),n.href&&!l?e.jsx(ye,{to:n.href,className:"hover:text-gray-700 dark:hover:text-gray-300",children:n.label}):e.jsx("span",{className:l?"text-gray-900 dark:text-gray-100 font-medium":"",children:n.label})]},i)})})}function st({children:t}){const{open:s,isMobile:r,state:n}=N();return e.jsxs("main",{className:d("flex-1 min-w-0 overflow-x-hidden bg-gray-50 dark:bg-black transition-[padding] duration-200 ease-linear",!r&&(n==="expanded"?"md:pl-32":"md:pl-12")),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-2",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(F,{}),e.jsx(tt,{})]}),!s&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-primary-600 flex items-center justify-center md:hidden",children:e.jsx("span",{className:"text-white font-bold text-xs",children:"PG"})}),e.jsx("span",{className:"font-semibold text-sidebar-foreground md:hidden",children:"pg-boss"})]})]}),e.jsx("div",{className:"px-6 pb-6 lg:px-8 lg:pb-8",children:t})]})}const rt=`
2
2
  (function() {
3
3
  const stored = localStorage.getItem('pg-boss-theme');
4
4
  let theme = stored || 'system';
@@ -1 +1 @@
1
- import{A as b,B as f,t as P,p as e}from"./chunk-JZWAC4HX-DC8i-F7r.js";import{D as c,e as l}from"./db-link-CtPnIrIr.js";import{B as N,C as k,a as S,b as T,c as w}from"./button-BaXUPm8v.js";import{T as B,a as E,b as d,c as r,d as v,e as s}from"./table-CTo0I5HG.js";import{P as D}from"./pagination-NfhvsUbp.js";import{E as R}from"./error-card-DmoxS3Ao.js";const I=f(function(){return e.jsx(R,{title:"Failed to load schedules"})}),K=b(function({loaderData:x}){const{schedules:o,totalCount:n,page:h,totalPages:m,hasNextPage:j,hasPrevPage:p}=x,[g,y]=P(),u=a=>{const t=new URLSearchParams(g);t.set("page",a.toString()),y(t)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Schedules"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"Cron-based job schedules"})]}),e.jsx(c,{to:"/schedules/new",children:e.jsx(N,{variant:"primary",size:"md",className:"cursor-pointer",children:"Schedule Job"})})]}),e.jsxs(k,{children:[e.jsx(S,{children:e.jsxs(T,{children:["Schedules",n!==null&&` (${n.toLocaleString()})`]})}),e.jsx(w,{className:"p-0",children:e.jsxs(B,{children:[e.jsx(E,{children:e.jsxs(d,{children:[e.jsx(r,{children:"Queue"}),e.jsx(r,{children:"Key"}),e.jsx(r,{children:"Cron"}),e.jsx(r,{children:"Timezone"}),e.jsx(r,{children:"Created"}),e.jsx(r,{children:"Updated"})]})}),e.jsx(v,{children:o.length===0?e.jsx(d,{children:e.jsx(s,{className:"text-center text-gray-500 dark:text-gray-400 py-8",colSpan:6,children:"No schedules found"})}):o.map(a=>{const t=a.key||"__default__",C=`/schedules/${encodeURIComponent(a.name)}/${encodeURIComponent(t)}`;return e.jsxs(d,{children:[e.jsx(s,{children:e.jsx(c,{to:C,className:"font-medium text-gray-900 dark:text-gray-100",children:a.name})}),e.jsx(s,{children:a.key}),e.jsx(s,{children:e.jsx("code",{className:"text-xs bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded text-gray-700 dark:text-gray-300",children:a.cron})}),e.jsx(s,{children:a.timezone||e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})}),e.jsx(s,{children:l(new Date(a.createdOn))}),e.jsx(s,{children:l(new Date(a.updatedOn))})]},`${a.name}:${a.key}`)})})]})}),n>0&&e.jsx(D,{page:h,totalPages:m,hasNextPage:j,hasPrevPage:p,onPageChange:u})]})]})});export{I as ErrorBoundary,K as default};
1
+ import{A as b,B as f,t as P,p as e}from"./chunk-LFPYN7LY-Cj1DJmJR.js";import{D as c,e as l}from"./db-link-DmvfwdX4.js";import{B as N,C as k,a as S,b as T,c as w}from"./button-Djse56Dx.js";import{T as B,a as E,b as d,c as r,d as v,e as s}from"./table-CtSLyG7m.js";import{P as D}from"./pagination-C4yyCmBA.js";import{E as R}from"./error-card-CXoOCvsg.js";const I=f(function(){return e.jsx(R,{title:"Failed to load schedules"})}),K=b(function({loaderData:x}){const{schedules:o,totalCount:n,page:h,totalPages:m,hasNextPage:j,hasPrevPage:p}=x,[g,y]=P(),u=a=>{const t=new URLSearchParams(g);t.set("page",a.toString()),y(t)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Schedules"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"Cron-based job schedules"})]}),e.jsx(c,{to:"/schedules/new",children:e.jsx(N,{variant:"primary",size:"md",className:"cursor-pointer",children:"Schedule Job"})})]}),e.jsxs(k,{children:[e.jsx(S,{children:e.jsxs(T,{children:["Schedules",n!==null&&` (${n.toLocaleString()})`]})}),e.jsx(w,{className:"p-0",children:e.jsxs(B,{children:[e.jsx(E,{children:e.jsxs(d,{children:[e.jsx(r,{children:"Queue"}),e.jsx(r,{children:"Key"}),e.jsx(r,{children:"Cron"}),e.jsx(r,{children:"Timezone"}),e.jsx(r,{children:"Created"}),e.jsx(r,{children:"Updated"})]})}),e.jsx(v,{children:o.length===0?e.jsx(d,{children:e.jsx(s,{className:"text-center text-gray-500 dark:text-gray-400 py-8",colSpan:6,children:"No schedules found"})}):o.map(a=>{const t=a.key||"__default__",C=`/schedules/${encodeURIComponent(a.name)}/${encodeURIComponent(t)}`;return e.jsxs(d,{children:[e.jsx(s,{children:e.jsx(c,{to:C,className:"font-medium text-gray-900 dark:text-gray-100",children:a.name})}),e.jsx(s,{children:a.key}),e.jsx(s,{children:e.jsx("code",{className:"text-xs bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded text-gray-700 dark:text-gray-300",children:a.cron})}),e.jsx(s,{children:a.timezone||e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})}),e.jsx(s,{children:l(new Date(a.createdOn))}),e.jsx(s,{children:l(new Date(a.updatedOn))})]},`${a.name}:${a.key}`)})})]})}),n>0&&e.jsx(D,{page:h,totalPages:m,hasNextPage:j,hasPrevPage:p,onPageChange:u})]})]})});export{I as ErrorBoundary,K as default};
@@ -1 +1 @@
1
- import{A as h,B as g,a as y,p as e}from"./chunk-JZWAC4HX-DC8i-F7r.js";import{D as u,e as c}from"./db-link-CtPnIrIr.js";import{B as s,C as a,a as d,b as n,c as i}from"./button-BaXUPm8v.js";import{D as j,a as p,b as f,c as k,d as N,e as b}from"./dialog-Bl8T588f.js";import{E as v}from"./error-card-DmoxS3Ao.js";import"./createLucideIcon-BXGwbdrh.js";import"./useOpenInteractionType-C_L8nZ_l.js";import"./index-DhMkYPMa.js";const T=g(function(){return e.jsx(v,{title:"Failed to load schedule",backTo:{href:"/schedules",label:"Back to Schedules"}})}),U=h(function({loaderData:o,actionData:l}){const{schedule:r}=o,[m,t]=y.useState(!1);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{children:e.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:[r.name,r.key&&e.jsxs("span",{className:"font-normal text-gray-500 dark:text-gray-400",children:[" (",r.key,")"]})]})}),e.jsx(s,{variant:"danger",size:"md",className:"cursor-pointer",onClick:()=>t(!0),children:"Unschedule"})]}),l?.error&&e.jsx("div",{className:"rounded-lg bg-red-50 dark:bg-red-950 border border-red-200 dark:border-red-800 p-4",children:e.jsx("p",{className:"text-sm text-red-800 dark:text-red-200",children:l.error})}),e.jsxs("div",{className:"grid gap-6",children:[e.jsxs(a,{children:[e.jsx(d,{children:e.jsx(n,{children:"Schedule Configuration"})}),e.jsxs(i,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Queue"}),e.jsx("dd",{className:"mt-1",children:e.jsx(u,{to:`/queues/${encodeURIComponent(r.name)}`,className:"text-sm text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:r.name})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Key"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:r.key||e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Cron Expression"}),e.jsx("dd",{className:"mt-1",children:e.jsx("code",{className:"text-sm bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded text-gray-700 dark:text-gray-300",children:r.cron})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Timezone"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:r.timezone||e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"Default"})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Created"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:c(new Date(r.createdOn))})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Updated"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:c(new Date(r.updatedOn))})]})]})]}),r.data&&e.jsxs(a,{children:[e.jsx(d,{children:e.jsx(n,{children:"Data"})}),e.jsx(i,{children:e.jsx("pre",{className:"text-xs bg-gray-50 dark:bg-gray-900 p-4 rounded overflow-auto text-gray-700 dark:text-gray-300",children:JSON.stringify(r.data,null,2)})})]}),r.options&&e.jsxs(a,{children:[e.jsx(d,{children:e.jsx(n,{children:"Options"})}),e.jsx(i,{children:e.jsx("pre",{className:"text-xs bg-gray-50 dark:bg-gray-900 p-4 rounded overflow-auto text-gray-700 dark:text-gray-300",children:JSON.stringify(r.options,null,2)})})]})]}),e.jsx(j,{open:m,onOpenChange:t,children:e.jsx(p,{hideCloseButton:!0,className:"w-[28rem] max-w-[calc(100vw-2rem)]",children:e.jsxs("form",{method:"post",children:[e.jsx("input",{type:"hidden",name:"intent",value:"unschedule"}),e.jsxs(f,{children:[e.jsx(k,{children:"Unschedule Job"}),e.jsx(N,{className:"mt-2",children:"Are you sure you want to unschedule? This will stop the recurring job from being created."})]}),e.jsxs(b,{className:"mt-6 flex justify-end gap-3",children:[e.jsx(s,{type:"button",variant:"outline",size:"sm",className:"cursor-pointer",onClick:()=>t(!1),children:"Cancel"}),e.jsx(s,{type:"submit",variant:"danger",size:"sm",className:"cursor-pointer",children:"Unschedule"})]})]})})})]})});export{T as ErrorBoundary,U as default};
1
+ import{A as h,B as g,a as y,p as e}from"./chunk-LFPYN7LY-Cj1DJmJR.js";import{D as u,e as c}from"./db-link-DmvfwdX4.js";import{B as s,C as a,a as d,b as n,c as i}from"./button-Djse56Dx.js";import{D as j,a as p,b as f,c as k,d as N,e as b}from"./dialog-CQzw3QVH.js";import{E as v}from"./error-card-CXoOCvsg.js";import"./createLucideIcon-B0YqJFaz.js";import"./useOpenInteractionType-Ss_6xZdw.js";import"./index-x2yWco1W.js";const T=g(function(){return e.jsx(v,{title:"Failed to load schedule",backTo:{href:"/schedules",label:"Back to Schedules"}})}),U=h(function({loaderData:o,actionData:l}){const{schedule:r}=o,[m,t]=y.useState(!1);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{children:e.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:[r.name,r.key&&e.jsxs("span",{className:"font-normal text-gray-500 dark:text-gray-400",children:[" (",r.key,")"]})]})}),e.jsx(s,{variant:"danger",size:"md",className:"cursor-pointer",onClick:()=>t(!0),children:"Unschedule"})]}),l?.error&&e.jsx("div",{className:"rounded-lg bg-red-50 dark:bg-red-950 border border-red-200 dark:border-red-800 p-4",children:e.jsx("p",{className:"text-sm text-red-800 dark:text-red-200",children:l.error})}),e.jsxs("div",{className:"grid gap-6",children:[e.jsxs(a,{children:[e.jsx(d,{children:e.jsx(n,{children:"Schedule Configuration"})}),e.jsxs(i,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Queue"}),e.jsx("dd",{className:"mt-1",children:e.jsx(u,{to:`/queues/${encodeURIComponent(r.name)}`,className:"text-sm text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:r.name})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Key"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:r.key||e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Cron Expression"}),e.jsx("dd",{className:"mt-1",children:e.jsx("code",{className:"text-sm bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded text-gray-700 dark:text-gray-300",children:r.cron})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Timezone"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:r.timezone||e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"Default"})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Created"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:c(new Date(r.createdOn))})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Updated"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:c(new Date(r.updatedOn))})]})]})]}),r.data&&e.jsxs(a,{children:[e.jsx(d,{children:e.jsx(n,{children:"Data"})}),e.jsx(i,{children:e.jsx("pre",{className:"text-xs bg-gray-50 dark:bg-gray-900 p-4 rounded overflow-auto text-gray-700 dark:text-gray-300",children:JSON.stringify(r.data,null,2)})})]}),r.options&&e.jsxs(a,{children:[e.jsx(d,{children:e.jsx(n,{children:"Options"})}),e.jsx(i,{children:e.jsx("pre",{className:"text-xs bg-gray-50 dark:bg-gray-900 p-4 rounded overflow-auto text-gray-700 dark:text-gray-300",children:JSON.stringify(r.options,null,2)})})]})]}),e.jsx(j,{open:m,onOpenChange:t,children:e.jsx(p,{hideCloseButton:!0,className:"w-[28rem] max-w-[calc(100vw-2rem)]",children:e.jsxs("form",{method:"post",children:[e.jsx("input",{type:"hidden",name:"intent",value:"unschedule"}),e.jsxs(f,{children:[e.jsx(k,{children:"Unschedule Job"}),e.jsx(N,{className:"mt-2",children:"Are you sure you want to unschedule? This will stop the recurring job from being created."})]}),e.jsxs(b,{className:"mt-6 flex justify-end gap-3",children:[e.jsx(s,{type:"button",variant:"outline",size:"sm",className:"cursor-pointer",onClick:()=>t(!1),children:"Cancel"}),e.jsx(s,{type:"submit",variant:"danger",size:"sm",className:"cursor-pointer",children:"Unschedule"})]})]})})})]})});export{T as ErrorBoundary,U as default};
@@ -1 +1 @@
1
- import{A as N,B as v,D as w,x as S,a as s,G as C,p as e}from"./chunk-JZWAC4HX-DC8i-F7r.js";import{c as a,D}from"./db-link-CtPnIrIr.js";import{B as m,C as E,a as F,b as B,c as L}from"./button-BaXUPm8v.js";import{E as z}from"./error-card-DmoxS3Ao.js";const U=v(function(){return e.jsx(z,{title:"Failed to load schedule creation",backTo:{href:"/schedules",label:"Back to Schedules"}})}),P=N(function({loaderData:h,actionData:A}){const l=w(),t=S().state==="submitting",{queues:b}=h,[x,u]=s.useState(""),[n,f]=s.useState(""),[k,o]=s.useState(!1),[i,c]=s.useState(!1),y=b.filter(r=>r.name.toLowerCase().includes(x.toLowerCase())),j=r=>{f(r),u(r),o(!1),c(!0)},g=C(({currentLocation:r,nextLocation:d})=>i&&!t&&r.pathname!==d.pathname);return s.useEffect(()=>{const r=d=>{i&&!t&&(d.preventDefault(),d.returnValue="")};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[i,t]),e.jsxs("div",{className:"space-y-6",children:[g.state==="blocked"&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 max-w-md mx-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Unsaved Changes"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"You have unsaved changes. Are you sure you want to leave this page?"}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx(m,{type:"button",variant:"outline",size:"sm",onClick:()=>g.reset(),children:"Stay"}),e.jsx(m,{type:"button",variant:"danger",size:"sm",onClick:()=>g.proceed(),children:"Leave"})]})]})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"New Schedule"}),e.jsxs(E,{children:[e.jsx(F,{children:e.jsx(B,{children:"Details"})}),e.jsx(L,{children:e.jsxs("form",{method:"post",className:"space-y-5",onChange:()=>c(!0),onSubmit:()=>c(!1),children:[l&&"error"in l&&e.jsx("div",{className:a("rounded-lg border px-4 py-3 text-sm","bg-red-50 border-red-200 text-red-700","dark:bg-red-950 dark:border-red-800 dark:text-red-400"),children:l.error}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Queue Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",id:"queueSearch",value:x,onChange:r=>{u(r.target.value),o(!0)},onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),200),placeholder:"Search for a queue...",autoComplete:"off",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("input",{type:"hidden",name:"name",value:n,required:!0}),k&&y.length>0&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",children:y.map(r=>e.jsx("button",{type:"button",onClick:()=>j(r.name),className:"w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-gray-100 cursor-pointer text-sm",children:r.name},r.name))})]}),n&&e.jsxs("p",{className:"mt-1 text-xs text-green-600 dark:text-green-400",children:["Selected: ",n]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"key",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Schedule Key"}),e.jsx("input",{type:"text",id:"key",name:"key",placeholder:"Optional unique key",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"cron",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Cron Expression ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",id:"cron",name:"cron",required:!0,placeholder:"0 8 * * *",className:a("w-full rounded-lg border px-3 py-2 text-sm font-mono","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Format: minute hour day month weekday"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"timezone",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Timezone"}),e.jsx("input",{type:"text",id:"timezone",name:"timezone",placeholder:"UTC",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Optional: IANA timezone (e.g. UTC, America/New_York)"})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"data",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Data"}),e.jsx("textarea",{id:"data",name:"data",rows:4,placeholder:'{"key": "value"}',className:a("w-full rounded-lg border px-3 py-2 text-sm font-mono","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Optional: JSON object to pass as job data"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"priority",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Priority"}),e.jsx("input",{type:"number",id:"priority",name:"priority",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryLimit",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Limit"}),e.jsx("input",{type:"number",id:"retryLimit",name:"retryLimit",min:"0",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"expireInSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Expire In Seconds"}),e.jsx("input",{type:"number",id:"expireInSeconds",name:"expireInSeconds",min:"1",placeholder:"Default",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[e.jsx(m,{type:"submit",disabled:t,className:"cursor-pointer",children:t?"Creating...":"Schedule Job"}),e.jsx(D,{to:"/schedules",className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",children:"Cancel"})]})]})})]})]})});export{U as ErrorBoundary,P as default};
1
+ import{A as N,B as v,D as w,x as S,a as s,G as C,p as e}from"./chunk-LFPYN7LY-Cj1DJmJR.js";import{c as a,D}from"./db-link-DmvfwdX4.js";import{B as m,C as E,a as F,b as B,c as L}from"./button-Djse56Dx.js";import{E as z}from"./error-card-CXoOCvsg.js";const U=v(function(){return e.jsx(z,{title:"Failed to load schedule creation",backTo:{href:"/schedules",label:"Back to Schedules"}})}),P=N(function({loaderData:h,actionData:A}){const l=w(),t=S().state==="submitting",{queues:b}=h,[x,u]=s.useState(""),[n,f]=s.useState(""),[k,o]=s.useState(!1),[i,c]=s.useState(!1),y=b.filter(r=>r.name.toLowerCase().includes(x.toLowerCase())),j=r=>{f(r),u(r),o(!1),c(!0)},g=C(({currentLocation:r,nextLocation:d})=>i&&!t&&r.pathname!==d.pathname);return s.useEffect(()=>{const r=d=>{i&&!t&&(d.preventDefault(),d.returnValue="")};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[i,t]),e.jsxs("div",{className:"space-y-6",children:[g.state==="blocked"&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 max-w-md mx-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Unsaved Changes"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"You have unsaved changes. Are you sure you want to leave this page?"}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx(m,{type:"button",variant:"outline",size:"sm",onClick:()=>g.reset(),children:"Stay"}),e.jsx(m,{type:"button",variant:"danger",size:"sm",onClick:()=>g.proceed(),children:"Leave"})]})]})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"New Schedule"}),e.jsxs(E,{children:[e.jsx(F,{children:e.jsx(B,{children:"Details"})}),e.jsx(L,{children:e.jsxs("form",{method:"post",className:"space-y-5",onChange:()=>c(!0),onSubmit:()=>c(!1),children:[l&&"error"in l&&e.jsx("div",{className:a("rounded-lg border px-4 py-3 text-sm","bg-red-50 border-red-200 text-red-700","dark:bg-red-950 dark:border-red-800 dark:text-red-400"),children:l.error}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Queue Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",id:"queueSearch",value:x,onChange:r=>{u(r.target.value),o(!0)},onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),200),placeholder:"Search for a queue...",autoComplete:"off",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("input",{type:"hidden",name:"name",value:n,required:!0}),k&&y.length>0&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",children:y.map(r=>e.jsx("button",{type:"button",onClick:()=>j(r.name),className:"w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-gray-100 cursor-pointer text-sm",children:r.name},r.name))})]}),n&&e.jsxs("p",{className:"mt-1 text-xs text-green-600 dark:text-green-400",children:["Selected: ",n]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"key",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Schedule Key"}),e.jsx("input",{type:"text",id:"key",name:"key",placeholder:"Optional unique key",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"cron",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Cron Expression ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",id:"cron",name:"cron",required:!0,placeholder:"0 8 * * *",className:a("w-full rounded-lg border px-3 py-2 text-sm font-mono","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Format: minute hour day month weekday"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"timezone",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Timezone"}),e.jsx("input",{type:"text",id:"timezone",name:"timezone",placeholder:"UTC",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Optional: IANA timezone (e.g. UTC, America/New_York)"})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"data",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Data"}),e.jsx("textarea",{id:"data",name:"data",rows:4,placeholder:'{"key": "value"}',className:a("w-full rounded-lg border px-3 py-2 text-sm font-mono","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Optional: JSON object to pass as job data"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"priority",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Priority"}),e.jsx("input",{type:"number",id:"priority",name:"priority",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryLimit",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Limit"}),e.jsx("input",{type:"number",id:"retryLimit",name:"retryLimit",min:"0",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"expireInSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Expire In Seconds"}),e.jsx("input",{type:"number",id:"expireInSeconds",name:"expireInSeconds",min:"1",placeholder:"Default",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[e.jsx(m,{type:"submit",disabled:t,className:"cursor-pointer",children:t?"Creating...":"Schedule Job"}),e.jsx(D,{to:"/schedules",className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",children:"Cancel"})]})]})})]})]})});export{U as ErrorBoundary,P as default};
@@ -1 +1 @@
1
- import{A as N,B as S,t as C,D,x as E,a as s,G as B,p as e}from"./chunk-JZWAC4HX-DC8i-F7r.js";import{c as a,D as L}from"./db-link-CtPnIrIr.js";import{B as u,C as F,a as q,b as Q,c as A}from"./button-BaXUPm8v.js";import{E as I}from"./error-card-DmoxS3Ao.js";const O=S(function(){return e.jsx(I,{title:"Failed to load job sending page",backTo:{href:"/queues",label:"Back to Queues"}})}),R=N(function({loaderData:h}){const{queues:f}=h,[k]=C(),n=D(),t=E().state==="submitting",[l,i]=s.useState(!1),x=k.get("queue")||"",[m,y]=s.useState(x),[c,j]=s.useState(x),[v,o]=s.useState(!1),p=f.filter(r=>r.name.toLowerCase().includes(m.toLowerCase())),w=r=>{j(r),y(r),o(!1),i(!0)},g=B(({currentLocation:r,nextLocation:d})=>l&&!t&&r.pathname!==d.pathname);return s.useEffect(()=>{const r=d=>{l&&!t&&(d.preventDefault(),d.returnValue="")};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[l,t]),e.jsxs("div",{className:"space-y-6",children:[g.state==="blocked"&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 max-w-md mx-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Unsaved Changes"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"You have unsaved changes. Are you sure you want to leave this page?"}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx(u,{type:"button",variant:"outline",size:"sm",onClick:()=>g.reset(),children:"Stay"}),e.jsx(u,{type:"button",variant:"danger",size:"sm",onClick:()=>g.proceed(),children:"Leave"})]})]})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Send Job"}),e.jsxs(F,{children:[e.jsx(q,{children:e.jsx(Q,{children:"Job Details"})}),e.jsx(A,{children:e.jsxs("form",{method:"post",className:"space-y-5",onChange:()=>i(!0),onSubmit:()=>i(!1),children:[n&&"error"in n&&e.jsx("div",{className:a("rounded-lg border px-4 py-3 text-sm","bg-red-50 border-red-200 text-red-700","dark:bg-red-950 dark:border-red-800 dark:text-red-400"),children:n.error}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"queueSearch",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Queue Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",id:"queueSearch",value:m,onChange:r=>{y(r.target.value),o(!0)},onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),200),placeholder:"Search for a queue...",autoComplete:"off",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("input",{type:"hidden",name:"queueName",value:c,required:!0}),v&&p.length>0&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",children:p.map(r=>e.jsx("button",{type:"button",onClick:()=>w(r.name),className:"w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-gray-100 cursor-pointer text-sm",children:r.name},r.name))})]}),c&&e.jsxs("p",{className:"mt-1 text-xs text-green-600 dark:text-green-400",children:["Selected: ",c]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"data",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Data"}),e.jsx("textarea",{id:"data",name:"data",rows:6,placeholder:'{"key": "value"}',className:a("w-full rounded-lg border px-3 py-2 text-sm font-mono","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Optional: JSON object to pass as job data"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"priority",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Priority"}),e.jsx("input",{type:"number",id:"priority",name:"priority",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"startAfter",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Start After"}),e.jsx("input",{type:"text",id:"startAfter",name:"startAfter",placeholder:"e.g. 2025-01-01T00:00:00Z or 5 minutes",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"singletonKey",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Singleton Key"}),e.jsx("input",{type:"text",id:"singletonKey",name:"singletonKey",placeholder:"Optional unique key",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryLimit",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Limit"}),e.jsx("input",{type:"number",id:"retryLimit",name:"retryLimit",min:"0",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"expireInSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Expire In Seconds"}),e.jsx("input",{type:"number",id:"expireInSeconds",name:"expireInSeconds",min:"1",placeholder:"Default",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[e.jsx(u,{type:"submit",disabled:t,children:t?"Sending...":"Send Job"}),e.jsx(L,{to:"/queues",className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",children:"Cancel"})]})]})})]})]})});export{O as ErrorBoundary,R as default};
1
+ import{A as N,B as S,t as C,D,x as E,a as s,G as B,p as e}from"./chunk-LFPYN7LY-Cj1DJmJR.js";import{c as a,D as L}from"./db-link-DmvfwdX4.js";import{B as u,C as F,a as q,b as Q,c as A}from"./button-Djse56Dx.js";import{E as I}from"./error-card-CXoOCvsg.js";const O=S(function(){return e.jsx(I,{title:"Failed to load job sending page",backTo:{href:"/queues",label:"Back to Queues"}})}),R=N(function({loaderData:h}){const{queues:f}=h,[k]=C(),n=D(),t=E().state==="submitting",[l,i]=s.useState(!1),x=k.get("queue")||"",[m,y]=s.useState(x),[c,j]=s.useState(x),[v,o]=s.useState(!1),p=f.filter(r=>r.name.toLowerCase().includes(m.toLowerCase())),w=r=>{j(r),y(r),o(!1),i(!0)},g=B(({currentLocation:r,nextLocation:d})=>l&&!t&&r.pathname!==d.pathname);return s.useEffect(()=>{const r=d=>{l&&!t&&(d.preventDefault(),d.returnValue="")};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[l,t]),e.jsxs("div",{className:"space-y-6",children:[g.state==="blocked"&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 max-w-md mx-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Unsaved Changes"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"You have unsaved changes. Are you sure you want to leave this page?"}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx(u,{type:"button",variant:"outline",size:"sm",onClick:()=>g.reset(),children:"Stay"}),e.jsx(u,{type:"button",variant:"danger",size:"sm",onClick:()=>g.proceed(),children:"Leave"})]})]})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Send Job"}),e.jsxs(F,{children:[e.jsx(q,{children:e.jsx(Q,{children:"Job Details"})}),e.jsx(A,{children:e.jsxs("form",{method:"post",className:"space-y-5",onChange:()=>i(!0),onSubmit:()=>i(!1),children:[n&&"error"in n&&e.jsx("div",{className:a("rounded-lg border px-4 py-3 text-sm","bg-red-50 border-red-200 text-red-700","dark:bg-red-950 dark:border-red-800 dark:text-red-400"),children:n.error}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"queueSearch",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Queue Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",id:"queueSearch",value:m,onChange:r=>{y(r.target.value),o(!0)},onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),200),placeholder:"Search for a queue...",autoComplete:"off",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("input",{type:"hidden",name:"queueName",value:c,required:!0}),v&&p.length>0&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",children:p.map(r=>e.jsx("button",{type:"button",onClick:()=>w(r.name),className:"w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-gray-100 cursor-pointer text-sm",children:r.name},r.name))})]}),c&&e.jsxs("p",{className:"mt-1 text-xs text-green-600 dark:text-green-400",children:["Selected: ",c]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"data",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Data"}),e.jsx("textarea",{id:"data",name:"data",rows:6,placeholder:'{"key": "value"}',className:a("w-full rounded-lg border px-3 py-2 text-sm font-mono","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Optional: JSON object to pass as job data"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"priority",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Priority"}),e.jsx("input",{type:"number",id:"priority",name:"priority",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"startAfter",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Start After"}),e.jsx("input",{type:"text",id:"startAfter",name:"startAfter",placeholder:"e.g. 2025-01-01T00:00:00Z or 5 minutes",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"singletonKey",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Singleton Key"}),e.jsx("input",{type:"text",id:"singletonKey",name:"singletonKey",placeholder:"Optional unique key",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryLimit",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Limit"}),e.jsx("input",{type:"number",id:"retryLimit",name:"retryLimit",min:"0",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"expireInSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Expire In Seconds"}),e.jsx("input",{type:"number",id:"expireInSeconds",name:"expireInSeconds",min:"1",placeholder:"Default",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[e.jsx(u,{type:"submit",disabled:t,children:t?"Sending...":"Send Job"}),e.jsx(L,{to:"/queues",className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",children:"Cancel"})]})]})})]})]})});export{O as ErrorBoundary,R as default};
@@ -1 +1 @@
1
- import{p as r}from"./chunk-JZWAC4HX-DC8i-F7r.js";import{c as t}from"./db-link-CtPnIrIr.js";function o({children:a,className:e}){return r.jsx("div",{className:t("overflow-x-auto",e),children:r.jsx("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-800",children:a})})}function n({children:a,className:e}){return r.jsx("thead",{className:t("bg-gray-50 dark:bg-gray-900",e),children:a})}function c({children:a,className:e}){return r.jsx("tbody",{className:t("divide-y divide-gray-200 bg-white","dark:divide-gray-800 dark:bg-gray-950",e),children:a})}function l({children:a,className:e,onClick:s}){return r.jsx("tr",{className:t(s&&"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-900 transition-colors",e),onClick:s,children:a})}function x({children:a,className:e}){return r.jsx("th",{scope:"col",className:t("px-6 py-3 text-left text-xs font-semibold text-gray-500 uppercase tracking-wider","dark:text-gray-400",e),children:a})}function g({children:a,className:e,colSpan:s}){return r.jsx("td",{className:t("px-6 py-4 whitespace-nowrap text-sm",e),colSpan:s,children:a})}export{o as T,n as a,l as b,x as c,c as d,g as e};
1
+ import{p as r}from"./chunk-LFPYN7LY-Cj1DJmJR.js";import{c as t}from"./db-link-DmvfwdX4.js";function o({children:a,className:e}){return r.jsx("div",{className:t("overflow-x-auto",e),children:r.jsx("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-800",children:a})})}function n({children:a,className:e}){return r.jsx("thead",{className:t("bg-gray-50 dark:bg-gray-900",e),children:a})}function c({children:a,className:e}){return r.jsx("tbody",{className:t("divide-y divide-gray-200 bg-white","dark:divide-gray-800 dark:bg-gray-950",e),children:a})}function l({children:a,className:e,onClick:s}){return r.jsx("tr",{className:t(s&&"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-900 transition-colors",e),onClick:s,children:a})}function x({children:a,className:e}){return r.jsx("th",{scope:"col",className:t("px-6 py-3 text-left text-xs font-semibold text-gray-500 uppercase tracking-wider","dark:text-gray-400",e),children:a})}function g({children:a,className:e,colSpan:s}){return r.jsx("td",{className:t("px-6 py-4 whitespace-nowrap text-sm",e),colSpan:s,children:a})}export{o as T,n as a,l as b,x as c,c as d,g as e};
@@ -0,0 +1,12 @@
1
+ import{a as f,I as sn,p as z,r as an}from"./chunk-LFPYN7LY-Cj1DJmJR.js";import{j as he,g as cn,m as nr,l as Lt,E as ve,i as rr,h as Dt,n as un,N as ln}from"./db-link-DmvfwdX4.js";import{a as Pt}from"./index-x2yWco1W.js";const ws=500,Ts=500,xs={style:{transition:"none"}},or="data-base-ui-click-trigger",Cs={fallbackAxisSide:"none"},Is={fallbackAxisSide:"end"},sr={clipPath:"inset(50%)",position:"fixed",top:0,left:0};let Le=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const ir={[Le.startingStyle]:""},ar={[Le.endingStyle]:""},Os={transitionStatus(e){return e==="starting"?ir:e==="ending"?ar:null}};let At=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Le.startingStyle]="startingStyle",e[e.endingStyle=Le.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Wt=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const cr={[Wt.popupOpen]:"",[Wt.pressed]:""},ur={[At.open]:""},lr={[At.closed]:""},fr={[At.anchorHidden]:""},ks={open(e){return e?cr:null}},Ps={open(e){return e?ur:lr},anchorHidden(e){return e?fr:null}},dr="none",Vt="trigger-press",pr="trigger-hover",As="trigger-focus",fn="outside-press",Ns="item-press",Ms="close-press",dn="focus-out",hr="escape-key",Fs="list-navigation",Ls="cancel-open",Ds="sibling-open",Ws="imperative-action",dt=sn[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],gr=dt&&dt!==f.useLayoutEffect?dt:e=>e();function A(e){const t=he(br).current;return t.next=e,gr(t.effect),t.trampoline}function br(){const e={next:void 0,callback:mr,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function mr(){}function it(){return typeof window<"u"}function De(e){return Nt(e)?(e.nodeName||"").toLowerCase():"#document"}function re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vr(e){var t;return(t=(Nt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Nt(e){return it()?e instanceof Node||e instanceof re(e).Node:!1}function te(e){return it()?e instanceof Element||e instanceof re(e).Element:!1}function Z(e){return it()?e instanceof HTMLElement||e instanceof re(e).HTMLElement:!1}function Rt(e){return!it()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}const yr=new Set(["inline","contents"]);function We(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=at(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!yr.has(o)}const Er=new Set(["table","td","th"]);function Vs(e){return Er.has(De(e))}const Sr=[":popover-open",":modal"];function Rr(e){return Sr.some(t=>{try{return e.matches(t)}catch{return!1}})}const wr=["transform","translate","scale","rotate","perspective"],Tr=["transform","translate","scale","rotate","perspective","filter"],xr=["paint","layout","strict","content"];function Cr(e){const t=pn(),n=te(e)?at(e):e;return wr.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Tr.some(r=>(n.willChange||"").includes(r))||xr.some(r=>(n.contain||"").includes(r))}function _s(e){let t=Je(e);for(;Z(t)&&!Ne(t);){if(Cr(t))return t;if(Rr(t))return null;t=Je(t)}return null}function pn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ir=new Set(["html","body","#document"]);function Ne(e){return Ir.has(De(e))}function at(e){return re(e).getComputedStyle(e)}function Bs(e){return te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Je(e){if(De(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Rt(e)&&e.host||vr(e);return Rt(t)?t.host:t}function hn(e){const t=Je(e);return Ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:Z(t)&&We(t)?t:hn(t)}function Me(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=hn(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),a=re(o);if(s){const i=Or(a);return t.concat(a,a.visualViewport||[],We(o)?o:[],i&&n?Me(i):[])}return t.concat(o,Me(o,[],n))}function Or(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const kr={...sn},Pr=()=>{},B=typeof document<"u"?f.useLayoutEffect:Pr,Ar=f.createContext(void 0);function Nr(e=!1){const t=f.useContext(Ar);if(t===void 0&&!e)throw new Error(cn(16));return t}function Mr(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,a=r&&t!==!1,i=r&&t===!1;return{props:f.useMemo(()=>{const c={onKeyDown(p){n&&t&&p.key!=="Tab"&&p.preventDefault()}};return r||(c.tabIndex=o,!s&&n&&(c.tabIndex=t?o:-1)),(s&&(t||a)||!s&&n)&&(c["aria-disabled"]=n),s&&(!t||i)&&(c.disabled=n),c},[r,n,t,a,i,s,o])}}function js(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0}=e,s=f.useRef(null),a=Nr(!0)!==void 0,i=A(()=>{const m=s.current;return!!(m?.tagName==="A"&&m?.href)}),{props:l}=Mr({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:r,isNativeButton:o}),c=f.useCallback(()=>{const m=s.current;Fr(m)&&a&&t&&l.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,l.disabled,a]);B(c,[c]);const p=f.useCallback((m={})=>{const{onClick:h,onMouseDown:v,onKeyUp:y,onKeyDown:E,onPointerDown:T,...O}=m;return nr({type:o?"button":void 0,onClick(R){if(t){R.preventDefault();return}h?.(R)},onMouseDown(R){t||v?.(R)},onKeyDown(R){if(t||(Lt(R),E?.(R)),R.baseUIHandlerPrevented)return;const F=R.target===R.currentTarget&&!o&&!i()&&!t,x=R.key==="Enter",L=R.key===" ";F&&((L||x)&&R.preventDefault(),x&&h?.(R))},onKeyUp(R){t||(Lt(R),y?.(R)),!R.baseUIHandlerPrevented&&R.target===R.currentTarget&&!o&&!t&&R.key===" "&&h?.(R)},onPointerDown(R){if(t){R.preventDefault();return}T?.(R)}},o?void 0:{role:"button"},l,O)},[t,l,o,i]),u=A(m=>{s.current=m,c()});return{getButtonProps:p,buttonRef:u}}function Fr(e){return Z(e)&&e.tagName==="BUTTON"}let _t=0;function Lr(e,t="mui"){const[n,r]=f.useState(e),o=e||n;return f.useEffect(()=>{n==null&&(_t+=1,r(`${t}-${_t}`))},[n,t]),o}const Bt=kr.useId;function Ve(e,t){if(Bt!==void 0){const n=Bt();return e??(t?`${t}-${n}`:n)}return Lr(e,t)}function $s(e){return Ve(e,"base-ui")}function pe(e,t,n,r){let o=!1,s=!1;const a=ve;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...a}}const Dr=[];function gn(e){f.useEffect(e,Dr)}const Ye=null;class Wr{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Ke=new Wr;class ne{static create(){return new ne}static request(t){return Ke.request(t)}static cancel(t){return Ke.cancel(t)}currentId=Ye;request(t){this.cancel(),this.currentId=Ke.request(()=>{this.currentId=Ye,t()})}cancel=()=>{this.currentId!==Ye&&(Ke.cancel(this.currentId),this.currentId=Ye)};disposeEffect=()=>this.cancel}function bn(){const e=he(ne.create).current;return gn(e.disposeEffect),e}function Vr(e,t=!1,n=!1){const[r,o]=f.useState(e&&t?"idle":void 0),[s,a]=f.useState(e);return e&&!s&&(a(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),B(()=>{if(!e&&s&&r!=="ending"&&n){const i=ne.request(()=>{o("ending")});return()=>{ne.cancel(i)}}},[e,s,r,n]),B(()=>{if(!e||t)return;const i=ne.request(()=>{o(void 0)});return()=>{ne.cancel(i)}},[t,e]),B(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const i=ne.request(()=>{o("idle")});return()=>{ne.cancel(i)}},[t,e,s,o,r]),f.useMemo(()=>({mounted:s,setMounted:a,transitionStatus:r}),[s,r])}function se(e){return e==null?e:"current"in e?e.current:e}function _r(e,t=!1,n=!0){const r=bn();return A((o,s=null)=>{r.cancel();function a(){Pt.flushSync(o)}const i=se(e);if(i==null)return;const l=i;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let c=function(){const u=Le.startingStyle;if(!l.hasAttribute(u)){r.request(p);return}const m=new MutationObserver(()=>{l.hasAttribute(u)||(m.disconnect(),p())});m.observe(l,{attributes:!0,attributeFilter:[u]}),s?.addEventListener("abort",()=>m.disconnect(),{once:!0})},p=function(){Promise.all(l.getAnimations().map(u=>u.finished)).then(()=>{s?.aborted||a()}).catch(()=>{const u=l.getAnimations();if(n){if(s?.aborted)return;a()}else u.length>0&&u.some(m=>m.pending||m.playState!=="finished")&&p()})};if(t){c();return}r.request(p)}})}function Br(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=A(o),a=_r(r,n,!1);f.useEffect(()=>{if(!t)return;const i=new AbortController;return a(s,i.signal),()=>{i.abort()}},[t,n,s,a])}const Ae=0;class Se{static create(){return new Se}currentId=Ae;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ae,n()},t)}isStarted(){return this.currentId!==Ae}clear=()=>{this.currentId!==Ae&&(clearTimeout(this.currentId),this.currentId=Ae)};disposeEffect=()=>this.clear}function Ze(){const e=he(Se.create).current;return gn(e.disposeEffect),e}function pt(e){const t=he(jr,e).current;return t.next=e,B(t.effect),t}function jr(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function $(e){return e?.ownerDocument||document}const we=typeof navigator<"u",ht=Hr(),mn=Kr(),vn=Yr(),yn=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),En=ht.platform==="MacIntel"&&ht.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(ht.platform),$r=we&&/apple/i.test(navigator.vendor),wt=we&&/android/i.test(mn)||/android/i.test(vn),Hs=we&&mn.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Sn=vn.includes("jsdom/");function Hr(){if(!we)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Yr(){if(!we)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Kr(){if(!we)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Tt="data-base-ui-focusable",Rn="active",wn="selected",qr="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ys="ArrowLeft",Ks="ArrowRight",qs="ArrowUp",Us="ArrowDown";function de(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function _(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Rt(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Gs(e,t){if(!te(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(_(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function ie(e){return"composedPath"in e?e.composedPath()[0]:e.target}function J(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Ur(e){return e.matches("html,body")}function Tn(e){return Z(e)&&e.matches(qr)}function jt(e){return e?e.getAttribute("role")==="combobox"&&Tn(e):!1}function zs(e){if(!e||Sn)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function xt(e){return e?e.hasAttribute(Tt)?e:e.querySelector(`[${Tt}]`)||e:null}function ye(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...ye(e,o.id,n)])}function $t(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Gr(e){e.preventDefault(),e.stopPropagation()}function zr(e){return"nativeEvent"in e}function Xr(e){return e.pointerType===""&&e.isTrusted?!0:wt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Jr(e){return Sn?!1:!wt&&e.width===0&&e.height===0||wt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Xs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Zr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}var Qr=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Qe=Qr.join(","),xn=typeof Element>"u",Re=xn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,et=!xn&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},tt=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",a=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):tt(t.parentNode));return a},eo=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Cn=function(t,n,r){if(tt(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Qe));return n&&Re.call(t,Qe)&&o.unshift(t),o=o.filter(r),o},nt=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var a=s.shift();if(!tt(a,!1))if(a.tagName==="SLOT"){var i=a.assignedElements(),l=i.length?i:a.children,c=nt(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c})}else{var p=Re.call(a,Qe);p&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var u=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),m=!tt(u,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(u&&m){var h=nt(u===!0?a.children:u.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:a,candidates:h})}else s.unshift.apply(s,a.children)}}return o},In=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},On=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||eo(t))&&!In(t)?0:t.tabIndex},to=function(t,n){var r=On(t);return r<0&&n&&!In(t)?0:r},no=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},kn=function(t){return t.tagName==="INPUT"},ro=function(t){return kn(t)&&t.type==="hidden"},oo=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},so=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},io=function(t){if(!t.name)return!0;var n=t.form||et(t),r=function(i){return n.querySelectorAll('input[type="radio"][name="'+i+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var s=so(o,t.form);return!s||s===t},ao=function(t){return kn(t)&&t.type==="radio"},co=function(t){return ao(t)&&!io(t)},uo=function(t){var n,r=t&&et(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var a,i,l;for(s=!!((a=o)!==null&&a!==void 0&&(i=a.ownerDocument)!==null&&i!==void 0&&i.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,p,u;r=et(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((p=o)!==null&&p!==void 0&&(u=p.ownerDocument)!==null&&u!==void 0&&u.contains(o))}}return s},Ht=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},lo=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var a=Re.call(t,"details>summary:first-of-type"),i=a?t.parentElement:t;if(Re.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var c=t.parentElement,p=et(t);if(c&&!c.shadowRoot&&o(c)===!0)return Ht(t);t.assignedSlot?t=t.assignedSlot:!c&&p!==t.ownerDocument?t=p.host:t=c}t=l}if(uo(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ht(t);return!1},fo=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Re.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Ct=function(t,n){return!(n.disabled||ro(n)||lo(n,t)||oo(n)||fo(n))},It=function(t,n){return!(co(n)||On(n)<0||!Ct(t,n))},po=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Pn=function(t){var n=[],r=[];return t.forEach(function(o,s){var a=!!o.scopeParent,i=a?o.scopeParent:o,l=to(i,a),c=a?Pn(o.candidates):i;l===0?a?n.push.apply(n,c):n.push(i):r.push({documentOrder:s,tabIndex:l,item:o,isScope:a,content:c})}),r.sort(no).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},_e=function(t,n){n=n||{};var r;return n.getShadowRoot?r=nt([t],n.includeContainer,{filter:It.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:po}):r=Cn(t,n.includeContainer,It.bind(null,n)),Pn(r)},ho=function(t,n){n=n||{};var r;return n.getShadowRoot?r=nt([t],n.includeContainer,{filter:Ct.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Cn(t,n.includeContainer,Ct.bind(null,n)),r},An=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Re.call(t,Qe)===!1?!1:It(n,t)};const Te=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Nn(e,t){const n=_e(e,Te()),r=n.length;if(r===0)return;const o=de($(e)),s=n.indexOf(o),a=s===-1?t===1?0:r-1:s+t;return n[a]}function Mn(e){return Nn($(e).body,1)||e}function Fn(e){return Nn($(e).body,-1)||e}function Ln(e,t){if(!e)return null;const n=_e($(e).body,Te()),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Js(e){return Ln(e,1)}function Zs(e){return Ln(e,-1)}function Fe(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!_(n,r)}function go(e){_e(e,Te()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Yt(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Dn(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class bo{nodesRef={current:[]};events=Dn();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Wn=f.createContext(null),Vn=f.createContext(null),ct=()=>f.useContext(Wn)?.id||null,Mt=e=>{const t=f.useContext(Vn);return e??t};function Qs(e){const t=Ve(),n=Mt(e),r=ct();return B(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function ei(e){const{children:t,id:n}=e,r=ct();return z.jsx(Wn.Provider,{value:f.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function ti(e){const{children:t,externalTree:n}=e,r=he(()=>n??new bo).current;return z.jsx(Vn.Provider,{value:r,children:t})}function rt(e){return`data-base-ui-${e}`}const mo={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},_n={...mo,position:"fixed",top:0,left:0},ot=f.forwardRef(function(t,n){const[r,o]=f.useState();B(()=>{$r&&o("button")},[]);const s={tabIndex:0,role:r};return z.jsx("span",{...t,ref:n,style:_n,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});let Kt=0;function gt(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Kt);const s=()=>e?.focus({preventScroll:n});o?s():Kt=requestAnimationFrame(s)}const Ee={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function qt(e){return e==="inert"?Ee.inert:e==="aria-hidden"?Ee["aria-hidden"]:Ee.none}let qe=new WeakSet,Ue={},bt=0;const Bn=e=>e&&(e.host||Bn(e.parentNode)),vo=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Bn(n);return e.contains(r)?r:null}).filter(n=>n!=null);function yo(e,t,n,r){const o="data-base-ui-inert",s=r?"inert":n?"aria-hidden":null,a=vo(t,e),i=new Set,l=new Set(a),c=[];Ue[o]||(Ue[o]=new WeakMap);const p=Ue[o];a.forEach(u),m(t),i.clear();function u(h){!h||i.has(h)||(i.add(h),h.parentNode&&u(h.parentNode))}function m(h){!h||l.has(h)||[].forEach.call(h.children,v=>{if(De(v)!=="script")if(i.has(v))m(v);else{const y=s?v.getAttribute(s):null,E=y!==null&&y!=="false",T=qt(s),O=(T.get(v)||0)+1,M=(p.get(v)||0)+1;T.set(v,O),p.set(v,M),c.push(v),O===1&&E&&qe.add(v),M===1&&v.setAttribute(o,""),!E&&s&&v.setAttribute(s,s==="inert"?"":"true")}})}return bt+=1,()=>{c.forEach(h=>{const v=qt(s),E=(v.get(h)||0)-1,T=(p.get(h)||0)-1;v.set(h,E),p.set(h,T),E||(!qe.has(h)&&s&&h.removeAttribute(s),qe.delete(h)),T||h.removeAttribute(o)}),bt-=1,bt||(Ee.inert=new WeakMap,Ee["aria-hidden"]=new WeakMap,Ee.none=new WeakMap,qe=new WeakSet,Ue={})}}function Eo(e,t=!1,n=!1){const r=$(e[0]).body;return yo(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const jn=f.createContext(null),$n=()=>f.useContext(jn),So=rt("portal");function Ro(e={}){const{ref:t,container:n,componentProps:r=ve,elementProps:o}=e,s=Ve(),i=$n()?.portalNode,[l,c]=f.useState(null),[p,u]=f.useState(null),m=A(E=>{E!==null&&u(E)}),h=f.useRef(null);B(()=>{if(n===null){h.current&&(h.current=null,u(null),c(null));return}if(s==null)return;const E=(n&&(Nt(n)?n:n.current))??i??document.body;if(E==null){h.current&&(h.current=null,u(null),c(null));return}h.current!==E&&(h.current=E,u(null),c(E))},[n,i,s]);const v=rr("div",r,{ref:[t,m],props:[{id:s,[So]:""},o]});return{portalNode:p,portalSubtree:l&&v?Pt.createPortal(v,l):null}}const ni=f.forwardRef(function(t,n){const{children:r,container:o,className:s,render:a,renderGuards:i,...l}=t,{portalNode:c,portalSubtree:p}=Ro({container:o,ref:n,componentProps:t,elementProps:l}),u=f.useRef(null),m=f.useRef(null),h=f.useRef(null),v=f.useRef(null),[y,E]=f.useState(null),T=y?.modal,O=y?.open,M=typeof i=="boolean"?i:!!y&&!y.modal&&y.open&&!!c;f.useEffect(()=>{if(!c||T)return;function F(x){c&&x.relatedTarget&&Fe(x)&&(x.type==="focusin"?Yt:go)(c)}return c.addEventListener("focusin",F,!0),c.addEventListener("focusout",F,!0),()=>{c.removeEventListener("focusin",F,!0),c.removeEventListener("focusout",F,!0)}},[c,T]),f.useEffect(()=>{!c||O||Yt(c)},[O,c]);const R=f.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:v,portalNode:c,setFocusManagerState:E}),[c]);return z.jsxs(f.Fragment,{children:[p,z.jsxs(jn.Provider,{value:R,children:[M&&c&&z.jsx(ot,{"data-type":"outside",ref:u,onFocus:F=>{if(Fe(F,c))h.current?.focus();else{const x=y?y.domReference:null;Fn(x)?.focus()}}}),M&&c&&z.jsx("span",{"aria-owns":c.id,style:sr}),c&&Pt.createPortal(r,c),M&&c&&z.jsx(ot,{"data-type":"outside",ref:m,onFocus:F=>{if(Fe(F,c))v.current?.focus();else{const x=y?y.domReference:null;Mn(x)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,pe(dn,F.nativeEvent))}}})]})]})});function wo(e,t){const n=re(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Ut=20;let ue=[];function Ft(){ue=ue.filter(e=>e.deref()?.isConnected)}function To(e){Ft(),e&&De(e)!=="body"&&(ue.push(new WeakRef(e)),ue.length>Ut&&(ue=ue.slice(-Ut)))}function mt(){return Ft(),ue[ue.length-1]?.deref()}function xo(e){if(!e)return null;const t=Te();return An(e,t)?e:_e(e,t)[0]||e}function Co(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():at(e).display!=="none"}function Gt(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Te(),o=ho(e,n).filter(a=>{const i=a.getAttribute("data-tabindex")||"";return An(a,n)||a.hasAttribute("data-tabindex")&&!i.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ri(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:i=!0,closeOnFocusOut:l=!0,openInteractionType:c="",nextFocusableElement:p,previousFocusableElement:u,beforeContentFocusGuardRef:m,externalTree:h}=e,v="rootStore"in t?t.rootStore:t,y=v.useState("open"),E=v.useState("domReferenceElement"),T=v.useState("floatingElement"),{events:O,dataRef:M}=v.context,R=A(()=>M.current.floatingContext?.nodeId),F=o===!1,x=jt(E)&&F,L=f.useRef(["content"]),D=pt(o),q=pt(s),xe=pt(c),H=Mt(h),k=$n(),Be=f.useRef(null),Ce=f.useRef(null),Y=f.useRef(!1),U=f.useRef(!1),Ie=f.useRef(!1),Q=f.useRef(-1),ae=f.useRef(""),ge=f.useRef(""),Oe=f.useRef(null),le=f.useRef(null),oe=Dt(Oe,m,k?.beforeInsideRef),ut=Dt(le,k?.afterInsideRef),be=Ze(),je=Ze(),me=bn(),fe=k!=null,C=xt(T),ee=A((g=C)=>g?_e(g,Te()):[]),ce=A(g=>{const b=ee(g);return L.current.map(()=>b).filter(Boolean).flat()});f.useEffect(()=>{if(r||!i)return;function g(N){N.key==="Tab"&&_(C,de($(C)))&&ee().length===0&&!x&&Gr(N)}const b=$(C);return b.addEventListener("keydown",g),()=>{b.removeEventListener("keydown",g)}},[r,E,C,i,L,x,ee,ce]),f.useEffect(()=>{if(r||!y)return;const g=$(C);function b(){Ie.current=!1}function N(I){const S=ie(I),W=_(T,S)||_(E,S)||_(k?.portalNode,S);Ie.current=!W,ge.current=I.pointerType||"keyboard",S?.closest(`[${or}]`)&&(U.current=!0)}function w(){ge.current="keyboard"}return g.addEventListener("pointerdown",N,!0),g.addEventListener("pointerup",b,!0),g.addEventListener("pointercancel",b,!0),g.addEventListener("keydown",w,!0),()=>{g.removeEventListener("pointerdown",N,!0),g.removeEventListener("pointerup",b,!0),g.removeEventListener("pointercancel",b,!0),g.removeEventListener("keydown",w,!0)}},[r,T,E,C,y,k]),f.useEffect(()=>{if(r||!l)return;const g=$(C);function b(){U.current=!0,je.start(0,()=>{U.current=!1})}function N(K){const P=ie(K),X=ee().indexOf(P);X!==-1&&(Q.current=X)}function w(K){const P=K.relatedTarget,V=K.currentTarget,X=ie(K);queueMicrotask(()=>{const ke=R(),$e=v.context.triggerElements,lt=P?.hasAttribute(rt("focus-guard"))&&[Oe.current,le.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,se(u),se(p)].includes(P),ft=!(_(E,P)||_(T,P)||_(P,T)||_(k?.portalNode,P)||P!=null&&$e.hasElement(P)||$e.hasMatchingElement(G=>_(G,P))||lt||H&&(ye(H.nodesRef.current,ke).find(G=>_(G.context?.elements.floating,P)||_(G.context?.elements.domReference,P))||$t(H.nodesRef.current,ke).find(G=>[G.context?.elements.floating,xt(G.context?.elements.floating)].includes(P)||G.context?.elements.domReference===P)));if(V===E&&C&&Gt(C,L),a&&V!==E&&!Co(X)&&de(g)===g.body){if(Z(C)&&(C.focus(),a==="popup")){me.request(()=>{C.focus()});return}const G=Q.current,Pe=ee(),He=Pe[G]||Pe[Pe.length-1]||C;Z(He)&&He.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}(x||!i)&&P&&ft&&!U.current&&(x||P!==mt())&&(Y.current=!0,v.setOpen(!1,pe(dn,K)))})}function I(){Ie.current||(M.current.insideReactTree=!0,be.start(0,()=>{M.current.insideReactTree=!1}))}const S=Z(E)?E:null,W=[];if(!(!T&&!S))return S&&(S.addEventListener("focusout",w),S.addEventListener("pointerdown",b),W.push(()=>{S.removeEventListener("focusout",w),S.removeEventListener("pointerdown",b)})),T&&(T.addEventListener("focusin",N),T.addEventListener("focusout",w),k&&(T.addEventListener("focusout",I,!0),W.push(()=>{T.removeEventListener("focusout",I,!0)})),W.push(()=>{T.removeEventListener("focusin",N),T.removeEventListener("focusout",w)})),()=>{W.forEach(K=>{K()})}},[r,E,T,C,i,H,k,v,l,a,ee,x,R,L,M,be,je,me,p,u]),f.useEffect(()=>{if(r||!T||!y)return;const g=Array.from(k?.portalNode?.querySelectorAll(`[${rt("portal")}]`)||[]),N=(H?$t(H.nodesRef.current,R()):[]).find(I=>jt(I.context?.elements.domReference||null))?.context?.elements.domReference,w=[T,N,...g,Be.current,Ce.current,Oe.current,le.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,se(u),se(p),x?E:null].filter(I=>I!=null);return Eo(w,i||x)},[y,r,E,T,i,L,k,x,H,R,p,u]),B(()=>{if(!y||r||!Z(C))return;const g=$(C),b=de(g);queueMicrotask(()=>{const N=ce(C),w=D.current,I=typeof w=="function"?w(xe.current||""):w;if(I===void 0||I===!1)return;let S;I===!0||I===null?S=N[0]||C:S=se(I),S=S||N[0]||C,!_(C,b)&&gt(S,{preventScroll:S===C})})},[r,y,C,F,ce,D,xe]),B(()=>{if(r||!C)return;const g=$(C),b=de(g);To(b);function N(S){if(S.open||(ae.current=wo(S.nativeEvent,ge.current)),S.reason===pr&&S.nativeEvent.type==="mouseleave"&&(Y.current=!0),S.reason===fn)if(S.nested)Y.current=!1;else if(Xr(S.nativeEvent)||Jr(S.nativeEvent))Y.current=!1;else{let W=!1;document.createElement("div").focus({get preventScroll(){return W=!0,!1}}),W?Y.current=!1:Y.current=!0}}O.on("openchange",N);const w=g.createElement("span");w.setAttribute("tabindex","-1"),w.setAttribute("aria-hidden","true"),Object.assign(w.style,_n),fe&&E&&E.insertAdjacentElement("afterend",w);function I(){const S=q.current;let W=typeof S=="function"?S(ae.current):S;if(W===void 0||W===!1)return null;if(W===null&&(W=!0),typeof W=="boolean"){const P=E||mt();return P&&P.isConnected?P:w}const K=E||mt()||w;return se(W)||K}return()=>{O.off("openchange",N);const S=de(g),W=_(T,S)||H&&ye(H.nodesRef.current,R(),!1).some(P=>_(P.context?.elements.floating,S)),K=I();queueMicrotask(()=>{const P=xo(K),V=typeof q.current!="boolean";q.current&&!Y.current&&Z(P)&&(!(!V&&P!==S&&S!==g.body)||W)&&P.focus({preventScroll:!0}),w.remove(),Y.current=!1})}},[r,T,C,q,M,O,H,fe,E,R]),B(()=>{if(!yn||y||!T)return;const g=de($(T));!Z(g)||!Tn(g)||_(T,g)&&g.blur()},[y,T]),B(()=>{if(!(r||!k))return k.setFocusManagerState({modal:i,closeOnFocusOut:l,open:y,onOpenChange:v.setOpen,domReference:E}),()=>{k.setFocusManagerState(null)}},[r,k,i,y,v,l,E]),B(()=>{if(!(r||!C))return Gt(C,L),()=>{queueMicrotask(Ft)}},[r,C,L]);const d=!r&&(i?!x:!0)&&(fe||i);return z.jsxs(f.Fragment,{children:[d&&z.jsx(ot,{"data-type":"inside",ref:oe,onFocus:g=>{if(i){const b=ce();gt(b[b.length-1])}else k?.portalNode&&(Y.current=!1,Fe(g,k.portalNode)?Mn(E)?.focus():se(u??k.beforeOutsideRef)?.focus())}}),n,d&&z.jsx(ot,{"data-type":"inside",ref:ut,onFocus:g=>{i?gt(ce()[0]):k?.portalNode&&(l&&(Y.current=!0),Fe(g,k.portalNode)?Fn(E)?.focus():se(p??k.afterOutsideRef)?.focus())}})]})}const Io={intentional:"onClick",sloppy:"onPointerDown"};function Oo(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function oi(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("referenceElement"),a=n.useState("domReferenceElement"),{onOpenChange:i,dataRef:l}=n.context,{enabled:c=!0,escapeKey:p=!0,outsidePress:u=!0,outsidePressEvent:m="sloppy",referencePress:h=!1,referencePressEvent:v="sloppy",ancestorScroll:y=!1,bubbles:E,externalTree:T}=t,O=Mt(T),M=A(typeof u=="function"?u:()=>!1),R=typeof u=="function"?M:u,F=f.useRef(!1),{escapeKey:x,outsidePress:L}=Oo(E),D=f.useRef(null),q=Ze(),xe=Ze(),H=A(()=>{xe.clear(),l.current.insideReactTree=!1}),k=f.useRef(!1),Be=f.useRef(""),Ce=A(d=>{Be.current=d.pointerType}),Y=A(()=>{const d=Be.current,g=d==="pen"||!d?"mouse":d,b=typeof m=="function"?m():m;return typeof b=="string"?b:b[g]}),U=A(d=>{if(!r||!c||!p||d.key!=="Escape"||k.current)return;const g=l.current.floatingContext?.nodeId,b=O?ye(O.nodesRef.current,g):[];if(!x&&b.length>0){let I=!0;if(b.forEach(S=>{S.context?.open&&!S.context.dataRef.current.__escapeKeyBubbles&&(I=!1)}),!I)return}const N=zr(d)?d.nativeEvent:d,w=pe(hr,N);n.setOpen(!1,w),!x&&!w.isPropagationAllowed&&d.stopPropagation()}),Ie=A(d=>{const g=Y();return g==="intentional"&&d.type!=="click"||g==="sloppy"&&d.type==="click"}),Q=A(()=>{l.current.insideReactTree=!0,xe.start(0,H)}),ae=A((d,g=!1)=>{if(Ie(d)){H();return}if(l.current.insideReactTree){H();return}if(Y()==="intentional"&&g||typeof R=="function"&&!R(d))return;const b=ie(d),N=`[${rt("inert")}]`,w=$(n.select("floatingElement")).querySelectorAll(N),I=n.context.triggerElements;if(b&&(I.hasElement(b)||I.hasMatchingElement(V=>_(V,b))))return;let S=te(b)?b:null;for(;S&&!Ne(S);){const V=Je(S);if(Ne(V)||!te(V))break;S=V}if(w.length&&te(b)&&!Ur(b)&&!_(b,n.select("floatingElement"))&&Array.from(w).every(V=>!_(S,V)))return;if(Z(b)&&!("touches"in d)){const V=Ne(b),X=at(b),ke=/auto|scroll/,$e=V||ke.test(X.overflowX),lt=V||ke.test(X.overflowY),ft=$e&&b.clientWidth>0&&b.scrollWidth>b.clientWidth,G=lt&&b.clientHeight>0&&b.scrollHeight>b.clientHeight,Pe=X.direction==="rtl",He=G&&(Pe?d.offsetX<=b.offsetWidth-b.clientWidth:d.offsetX>b.clientWidth),tr=ft&&d.offsetY>b.clientHeight;if(He||tr)return}const W=l.current.floatingContext?.nodeId,K=O&&ye(O.nodesRef.current,W).some(V=>J(d,V.context?.elements.floating));if(J(d,n.select("floatingElement"))||J(d,n.select("domReferenceElement"))||K)return;const P=O?ye(O.nodesRef.current,W):[];if(P.length>0){let V=!0;if(P.forEach(X=>{X.context?.open&&!X.context.dataRef.current.__outsidePressBubbles&&(V=!1)}),!V)return}n.setOpen(!1,pe(fn,d)),H()}),ge=A(d=>{Y()!=="sloppy"||d.pointerType==="touch"||!n.select("open")||!c||J(d,n.select("floatingElement"))||J(d,n.select("domReferenceElement"))||ae(d)}),Oe=A(d=>{if(Y()!=="sloppy"||!n.select("open")||!c||J(d,n.select("floatingElement"))||J(d,n.select("domReferenceElement")))return;const g=d.touches[0];g&&(D.current={startTime:Date.now(),startX:g.clientX,startY:g.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},q.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}),le=A(d=>{const g=ie(d);function b(){Oe(d),g?.removeEventListener(d.type,b)}g?.addEventListener(d.type,b)}),oe=A(d=>{const g=F.current;if(F.current=!1,q.clear(),d.type==="mousedown"&&D.current&&!D.current.dismissOnMouseDown)return;const b=ie(d);function N(){d.type==="pointerdown"?ge(d):ae(d,g),b?.removeEventListener(d.type,N)}b?.addEventListener(d.type,N)}),ut=A(d=>{if(Y()!=="sloppy"||!D.current||J(d,n.select("floatingElement"))||J(d,n.select("domReferenceElement")))return;const g=d.touches[0];if(!g)return;const b=Math.abs(g.clientX-D.current.startX),N=Math.abs(g.clientY-D.current.startY),w=Math.sqrt(b*b+N*N);w>5&&(D.current.dismissOnTouchEnd=!0),w>10&&(ae(d),q.clear(),D.current=null)}),be=A(d=>{const g=ie(d);function b(){ut(d),g?.removeEventListener(d.type,b)}g?.addEventListener(d.type,b)}),je=A(d=>{Y()!=="sloppy"||!D.current||J(d,n.select("floatingElement"))||J(d,n.select("domReferenceElement"))||(D.current.dismissOnTouchEnd&&ae(d),q.clear(),D.current=null)}),me=A(d=>{const g=ie(d);function b(){je(d),g?.removeEventListener(d.type,b)}g?.addEventListener(d.type,b)});f.useEffect(()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=x,l.current.__outsidePressBubbles=L;const d=new Se;function g(S){n.setOpen(!1,pe(dr,S))}function b(){d.clear(),k.current=!0}function N(){d.start(pn()?5:0,()=>{k.current=!1})}const w=$(o);w.addEventListener("pointerdown",Ce,!0),p&&(w.addEventListener("keydown",U),w.addEventListener("compositionstart",b),w.addEventListener("compositionend",N)),R&&(w.addEventListener("click",oe,!0),w.addEventListener("pointerdown",oe,!0),w.addEventListener("touchstart",le,!0),w.addEventListener("touchmove",be,!0),w.addEventListener("touchend",me,!0),w.addEventListener("mousedown",oe,!0));let I=[];return y&&(te(a)&&(I=Me(a)),te(o)&&(I=I.concat(Me(o))),!te(s)&&s&&s.contextElement&&(I=I.concat(Me(s.contextElement)))),I=I.filter(S=>S!==w.defaultView?.visualViewport),I.forEach(S=>{S.addEventListener("scroll",g,{passive:!0})}),()=>{w.removeEventListener("pointerdown",Ce,!0),p&&(w.removeEventListener("keydown",U),w.removeEventListener("compositionstart",b),w.removeEventListener("compositionend",N)),R&&(w.removeEventListener("click",oe,!0),w.removeEventListener("pointerdown",oe,!0),w.removeEventListener("touchstart",le,!0),w.removeEventListener("touchmove",be,!0),w.removeEventListener("touchend",me,!0),w.removeEventListener("mousedown",oe,!0)),I.forEach(S=>{S.removeEventListener("scroll",g)}),d.clear(),F.current=!1}},[l,o,s,a,p,R,r,i,y,c,x,L,U,ae,oe,ge,le,be,me,Ce,n]),f.useEffect(H,[R,H]);const fe=f.useMemo(()=>({onKeyDown:U,...h&&{[Io[v]]:d=>{n.setOpen(!1,pe(Vt,d.nativeEvent))},...v!=="intentional"&&{onClick(d){n.setOpen(!1,pe(Vt,d.nativeEvent))}}}}),[U,n,h,v]),C=A(d=>{const g=ie(d.nativeEvent);!_(n.select("floatingElement"),g)||d.button!==0||(F.current=!0)}),ee=A(d=>{!r||!c||d.button!==0||(F.current=!0)}),ce=f.useMemo(()=>({onKeyDown:U,onPointerDown:C,onMouseDown:C,onMouseUp:C,onClickCapture:Q,onMouseDownCapture(d){Q(),ee(d)},onPointerDownCapture(d){Q(),ee(d)},onMouseUpCapture:Q,onTouchEndCapture:Q,onTouchMoveCapture:Q}),[U,C,Q,ee]);return f.useMemo(()=>c?{reference:fe,floating:ce,trigger:fe}:{},[c,fe,ce])}var st=Symbol("NOT_FOUND");function ko(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Po(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Ao(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var zt=e=>Array.isArray(e)?e:[e];function No(e){const t=Array.isArray(e[0])?e[0]:e;return Ao(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Mo(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}function Fo(e){let t;return{get(n){return t&&e(t.key,n)?t.value:st},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Lo(e,t){let n=[];function r(i){const l=n.findIndex(c=>t(i,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return st}function o(i,l){r(i)===st&&(n.unshift({key:i,value:l}),n.length>e&&n.pop())}function s(){return n}function a(){n=[]}return{get:r,put:o,getEntries:s,clear:a}}var Do=(e,t)=>e===t;function Wo(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function Vo(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=Do,maxSize:o=1,resultEqualityCheck:s}=n,a=Wo(r);let i=0;const l=o<=1?Fo(a):Lo(o,a);function c(){let p=l.get(arguments);if(p===st){if(p=e.apply(null,arguments),i++,s){const m=l.getEntries().find(h=>s(h.value,p));m&&(p=m.value,i!==0&&i--)}l.put(arguments,p)}return p}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>i,c.resetResultsCount=()=>{i=0},c}var _o=class{constructor(e){this.value=e}deref(){return this.value}},Bo=typeof WeakRef<"u"?WeakRef:_o,jo=0,Xt=1;function Ge(){return{s:jo,v:void 0,o:null,p:null}}function Hn(e,t={}){let n=Ge();const{resultEqualityCheck:r}=t;let o,s=0;function a(){let i=n;const{length:l}=arguments;for(let u=0,m=l;u<m;u++){const h=arguments[u];if(typeof h=="function"||typeof h=="object"&&h!==null){let v=i.o;v===null&&(i.o=v=new WeakMap);const y=v.get(h);y===void 0?(i=Ge(),v.set(h,i)):i=y}else{let v=i.p;v===null&&(i.p=v=new Map);const y=v.get(h);y===void 0?(i=Ge(),v.set(h,i)):i=y}}const c=i;let p;if(i.s===Xt)p=i.v;else if(p=e.apply(null,arguments),s++,r){const u=o?.deref?.()??o;u!=null&&r(u,p)&&(p=u,s!==0&&s--),o=typeof p=="object"&&p!==null||typeof p=="function"?new Bo(p):p}return c.s=Xt,c.v=p,p}return a.clearCache=()=>{n=Ge(),a.resetResultsCount()},a.resultsCount=()=>s,a.resetResultsCount=()=>{s=0},a}function Yn(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,a=0,i,l={},c=o.pop();typeof c=="object"&&(l=c,c=o.pop()),ko(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const p={...n,...l},{memoize:u,memoizeOptions:m=[],argsMemoize:h=Hn,argsMemoizeOptions:v=[]}=p,y=zt(m),E=zt(v),T=No(o),O=u(function(){return s++,c.apply(null,arguments)},...y),M=h(function(){a++;const F=Mo(T,arguments);return i=O.apply(null,F),i},...E);return Object.assign(M,{resultFunc:c,memoizedResultFunc:O,dependencies:T,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>i,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:u,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var $o=Yn(Hn),Ho=Object.assign((e,t=$o)=>{Po(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((a,i,l)=>(a[n[l]]=i,a),{}))},{withTypes:()=>Ho});Yn({memoize:Vo,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const j=(e,t,n,r,o,s,...a)=>{if(a.length>0)throw new Error(cn(1));let i;if(e)i=e;else throw new Error("Missing arguments");return i};var vt={exports:{}},yt={};var Jt;function Yo(){if(Jt)return yt;Jt=1;var e=an();function t(u,m){return u===m&&(u!==0||1/u===1/m)||u!==u&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function i(u,m){var h=m(),v=r({inst:{value:h,getSnapshot:m}}),y=v[0].inst,E=v[1];return s(function(){y.value=h,y.getSnapshot=m,l(y)&&E({inst:y})},[u,h,m]),o(function(){return l(y)&&E({inst:y}),u(function(){l(y)&&E({inst:y})})},[u]),a(h),h}function l(u){var m=u.getSnapshot;u=u.value;try{var h=m();return!n(u,h)}catch{return!0}}function c(u,m){return m()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:i;return yt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,yt}var Zt;function Kn(){return Zt||(Zt=1,vt.exports=Yo()),vt.exports}var qn=Kn(),Et={exports:{}},St={};var Qt;function Ko(){if(Qt)return St;Qt=1;var e=an(),t=Kn();function n(c,p){return c===p&&(c!==0||1/c===1/p)||c!==c&&p!==p}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,i=e.useMemo,l=e.useDebugValue;return St.useSyncExternalStoreWithSelector=function(c,p,u,m,h){var v=s(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=i(function(){function T(x){if(!O){if(O=!0,M=x,x=m(x),h!==void 0&&y.hasValue){var L=y.value;if(h(L,x))return R=L}return R=x}if(L=R,r(M,x))return L;var D=m(x);return h!==void 0&&h(L,D)?(M=x,L):(M=x,R=D)}var O=!1,M,R,F=u===void 0?null:u;return[function(){return T(p())},F===null?void 0:function(){return T(F())}]},[p,u,m,h]);var E=o(c,v[0],v[1]);return a(function(){y.hasValue=!0,y.value=E},[E]),l(E),E},St}var en;function qo(){return en||(en=1,Et.exports=Ko()),Et.exports}var Uo=qo();const Ot=[];let kt;function Go(){return kt}function zo(e){Ot.push(e)}function Xo(e){const t=(n,r)=>{const o=he(Jo).current;let s;try{kt=o;for(const a of Ot)a.before(o);s=e(n,r);for(const a of Ot)a.after(o);o.didInitialize=!0}finally{kt=void 0}return s};return t.displayName=e.displayName||e.name,t}function si(e){return f.forwardRef(Xo(e))}function Jo(){return{didInitialize:!1}}const Zo=un(19),Qo=Zo?ts:ns;function Un(e,t,n,r,o){return Qo(e,t,n,r,o)}function es(e,t,n,r,o){const s=f.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return qn.useSyncExternalStore(e.subscribe,s,s)}zo({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,o))&&(t=!0,r.value=o,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const o of n)r.push(o.subscribe(t));return()=>{for(const o of r)o()}}),qn.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function ts(e,t,n,r,o){const s=Go();if(!s)return es(e,t,n,r,o);const a=s.syncIndex;s.syncIndex+=1;let i;return s.didInitialize?(i=s.syncHooks[a],(i.store!==e||i.selector!==t||!Object.is(i.a1,n)||!Object.is(i.a2,r)||!Object.is(i.a3,o))&&(i.store!==e&&(s.didChangeStore=!0),i.store=e,i.selector=t,i.a1=n,i.a2=r,i.a3=o,i.didChange=!0)):(i={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o),didChange:!1},s.syncHooks.push(i)),i.value}function ns(e,t,n,r,o){return Uo.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class rs{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Un(this,t,n,r,o)}}class os extends rs{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){f.useDebugValue(t),B(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;B(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);B(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){f.useDebugValue(t);const r=n!==void 0;B(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return f.useDebugValue(t),Un(this,this.selectors[t],n,r,o)}useContextCallback(t,n){f.useDebugValue(t);const r=A(n??ln);this.context[t]=r}useStateSetter(t){const n=f.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const a=r(s);if(!Object.is(o,a)){const i=o;o=a,n(a,i,this)}})}}const ss={open:j(e=>e.open),domReferenceElement:j(e=>e.domReferenceElement),referenceElement:j(e=>e.positionReference??e.referenceElement),floatingElement:j(e=>e.floatingElement),floatingId:j(e=>e.floatingId)};class Gn extends os{constructor(t){const{nested:n,noEmit:r,onOpenChange:o,triggerElements:s,...a}=t;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Dn(),nested:n,noEmit:r,triggerElements:s},ss)}setOpen=(t,n)=>{if((!t||!this.state.open||Zr(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}function is(e,t){const n=f.useRef(null),r=f.useRef(null);return f.useCallback(o=>{if(e!==void 0){if(n.current!==null){const s=n.current,a=r.current,i=t.context.triggerElements.getById(s);a&&i===a&&t.context.triggerElements.delete(s),n.current=null,r.current=null}o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o))}},[t,e])}function ii(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=is(e,n),a=A(i=>{if(s(i),!i||!n.select("open"))return;const l=n.select("activeTriggerId");if(l===e){n.update({activeTriggerElement:i,...r});return}l==null&&n.update({activeTriggerId:e,activeTriggerElement:i,...r})});return B(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:o}}function ai(e){const t=e.useState("open");B(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,o]=n.value;e.update({activeTriggerId:r,activeTriggerElement:o})}}},[t,e])}function ci(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=Vr(e);t.useSyncedValues({mounted:r,transitionStatus:s});const a=A(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),i=t.useState("preventUnmountingOnClose");return Br({enabled:!i,open:e,ref:t.context.popupRef,onComplete(){e||a()}}),{forceUnmount:a,transitionStatus:s}}class as{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function cs(){return new Gn({open:!1,floatingElement:null,referenceElement:null,triggerElements:new as,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function ui(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:cs(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ve,inactiveTriggerProps:ve,popupProps:ve}}const ze=j(e=>e.triggerIdProp??e.activeTriggerId),li={open:j(e=>e.openProp??e.open),mounted:j(e=>e.mounted),transitionStatus:j(e=>e.transitionStatus),floatingRootContext:j(e=>e.floatingRootContext),preventUnmountingOnClose:j(e=>e.preventUnmountingOnClose),payload:j(e=>e.payload),activeTriggerId:ze,activeTriggerElement:j(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:j((e,t)=>t!==void 0&&ze(e)===t),isOpenedByTrigger:j((e,t)=>t!==void 0&&ze(e)===t&&e.open),isMountedByTrigger:j((e,t)=>t!==void 0&&ze(e)===t&&e.mounted),triggerProps:j((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:j(e=>e.popupProps),popupElement:j(e=>e.popupElement),positionerElement:j(e=>e.positionerElement)};function fi(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:o}=e,s=Ve(),a=ct()!=null,i=t.useState("open"),l=t.useState("activeTriggerElement"),c=t.useState(r?"popupElement":"positionerElement"),p=t.context.triggerElements,u=he(()=>new Gn({open:i,referenceElement:l,floatingElement:c,triggerElements:p,onOpenChange:o,floatingId:s,nested:a,noEmit:n})).current;return B(()=>{const m={open:i,floatingId:s,referenceElement:l,floatingElement:c};te(l)&&(m.domReferenceElement=l),u.state.positionReference===u.state.referenceElement&&(m.positionReference=l),u.update(m)},[i,s,l,c,u]),u.context.onOpenChange=o,u.context.nested=a,u.context.noEmit=n,u}function di(e=[]){const t=e.map(c=>c?.reference),n=e.map(c=>c?.floating),r=e.map(c=>c?.item),o=e.map(c=>c?.trigger),s=f.useCallback(c=>Xe(c,e,"reference"),t),a=f.useCallback(c=>Xe(c,e,"floating"),n),i=f.useCallback(c=>Xe(c,e,"item"),r),l=f.useCallback(c=>Xe(c,e,"trigger"),o);return f.useMemo(()=>({getReferenceProps:s,getFloatingProps:a,getItemProps:i,getTriggerProps:l}),[s,a,i,l])}function Xe(e,t,n){const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Tt]="");for(const a in e)o&&e&&(a===Rn||a===wn)||(s[a]=e[a]);for(let a=0;a<t.length;a+=1){let i;const l=t[a]?.[n];typeof l=="function"?i=e?l(e):null:i=l,i&&tn(s,i,o,r)}return tn(s,e,o,r),s}function tn(e,t,n,r){for(const o in t){const s=t[o];n&&(o===Rn||o===wn)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof s=="function"&&(r.get(o)?.push(s),e[o]=(...a)=>r.get(o)?.map(i=>i(...a)).find(i=>i!==void 0))):e[o]=s)}}const us=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function pi(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),s=n.useState("domReferenceElement"),a=n.useState("floatingElement"),{role:i="dialog"}=t,l=Ve(),c=s?.id||l,p=f.useMemo(()=>xt(a)?.id||o,[a,o]),u=us.get(i)??i,h=ct()!=null,v=f.useMemo(()=>u==="tooltip"||i==="label"?ve:{"aria-haspopup":u==="alertdialog"?"dialog":u,"aria-expanded":"false",...u==="listbox"&&{role:"combobox"},...u==="menu"&&h&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[u,h,i]),y=f.useMemo(()=>u==="tooltip"||i==="label"?{[`aria-${i==="label"?"labelledby":"describedby"}`]:r?p:void 0}:{...v,"aria-expanded":r?"true":"false","aria-controls":r?p:void 0,...u==="menu"&&{id:c}},[u,p,r,c,i,v]),E=f.useMemo(()=>{const O={id:p,...u&&{role:u}};return u==="tooltip"||i==="label"?O:{...O,...u==="menu"&&{"aria-labelledby":c}}},[u,p,c,i]),T=f.useCallback(({active:O,selected:M})=>{const R={role:"option",...O&&{id:`${p}-fui-option`}};switch(i){case"select":case"combobox":return{...R,"aria-selected":M}}return{}},[p,i]);return f.useMemo(()=>({reference:y,floating:E,item:T,trigger:v}),[y,E,v,T])}const zn="ArrowUp",Xn="ArrowDown",Jn="ArrowLeft",Zn="ArrowRight",Qn="Home",er="End",ls=new Set([Jn,Zn]),fs=new Set([zn,Xn]),ds=new Set([...ls,...fs]);[...ds];const hi=new Set([zn,Xn,Jn,Zn,Qn,er]);function gi(e){return un(19)?e:e?"true":void 0}const bi=f.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const a=r?.getBoundingClientRect();s=`polygon(
2
+ 0% 0%,
3
+ 100% 0%,
4
+ 100% 100%,
5
+ 0% 100%,
6
+ 0% 0%,
7
+ ${a.left}px ${a.top}px,
8
+ ${a.left}px ${a.bottom}px,
9
+ ${a.right}px ${a.bottom}px,
10
+ ${a.right}px ${a.top}px,
11
+ ${a.left}px ${a.top}px
12
+ )`}return z.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});function mi(e){const t=f.useRef(!0);t.current&&(t.current=!1,e())}let nn={},rn={},on="";function ps(e){if(typeof document>"u")return!1;const t=$(e);return re(t).innerWidth-t.documentElement.clientWidth>0}function hs(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=$(e),r=n.documentElement,o=n.body,s=We(r)?r:o,a=s.style.overflowY,i=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const l=s.offsetWidth;s.style.overflowY="hidden";const c=s.offsetWidth;return s.style.overflowY=a,r.style.scrollbarGutter=i,l===c}function gs(e){const t=$(e),n=t.documentElement,r=t.body,o=We(n)?n:r,s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function bs(e){const t=$(e),n=t.documentElement,r=t.body,o=re(n);let s=0,a=0,i=!1;const l=ne.create();if(yn&&(o.visualViewport?.scale??1)!==1)return()=>{};function c(){const m=o.getComputedStyle(n),h=o.getComputedStyle(r),E=(m.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,nn={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},on=n.style.scrollBehavior,rn={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const T=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,M=m.overflowY==="scroll"||h.overflowY==="scroll",R=m.overflowX==="scroll"||h.overflowX==="scroll",F=Math.max(0,o.innerWidth-r.clientWidth),x=Math.max(0,o.innerHeight-r.clientHeight),L=parseFloat(h.marginTop)+parseFloat(h.marginBottom),D=parseFloat(h.marginLeft)+parseFloat(h.marginRight),q=We(n)?n:r;if(i=hs(e),i){n.style.scrollbarGutter=E,q.style.overflowY="hidden",q.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(T||M)&&(n.style.overflowY="scroll"),(O||R)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:L||x?`calc(100dvh - ${L+x}px)`:"100dvh",width:D||F?`calc(100vw - ${D+F}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function p(){Object.assign(n.style,nn),Object.assign(r.style,rn),i||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=on)}function u(){p(),l.request(c)}return c(),o.addEventListener("resize",u),()=>{l.cancel(),p(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",u)}}class ms{lockCount=0;restore=null;timeoutLock=Se.create();timeoutUnlock=Se.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=$(t).documentElement,o=re(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=ln;return}const s=En||!ps(t);this.restore=s?gs(t):bs(t)}}const vs=new ms;function vi(e=!0,t=null){B(()=>{if(e)return vs.acquire(t)},[e,t])}function ys(e){const t=f.useRef(""),n=f.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:f.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function yi(e){const[t,n]=f.useState(null),r=A((i,l)=>{e||n(l||(En?"touch":""))}),o=f.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:a}=ys(r);return f.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:s,onPointerDown:a}}),[t,o,s,a])}export{pr as $,qs as A,Vs as B,Cr as C,_s as D,De as E,We as F,Bs as G,Ve as H,ct as I,Gn as J,Mt as K,rt as L,de as M,_ as N,Gs as O,as as P,As as Q,ie as R,zs as S,$ as T,Hs as U,$r as V,hr as W,gn as X,qr as Y,Se as Z,A as _,B as a,pt as a0,xt as a1,jt as a2,gt as a3,Fs as a4,dn as a5,Xr as a6,Jr as a7,ye as a8,xs as a9,fi as aA,oi as aB,pi as aC,ws as aD,di as aE,ti as aF,Nr as aG,si as aH,ii as aI,Ls as aJ,Zs as aK,Fe as aL,Js as aM,Mn as aN,ks as aO,ot as aP,Ts as aQ,Ms as aR,At as aS,Br as aa,fn as ab,ri as ac,Ps as ad,Os as ae,hi as af,ni as ag,Cs as ah,Is as ai,bi as aj,gi as ak,ei as al,Ds as am,os as an,li as ao,bo as ap,ui as aq,j as ar,Xo as as,mi as at,Qs as au,yi as av,ai as aw,ci as ax,vi as ay,Ws as az,$s as b,Us as c,Ys as d,Ks as e,Xs as f,bn as g,Ze as h,Ns as i,Zr as j,pe as k,Tn as l,Me as m,te as n,vr as o,re as p,Or as q,at as r,Gr as s,Vt as t,js as u,Z as v,pn as w,Rr as x,Je as y,Ne as z};
@@ -1 +1 @@
1
- import{A as f,B as N,t as P,p as a}from"./chunk-JZWAC4HX-DC8i-F7r.js";import{C as u,a as T,b,c as w}from"./button-BaXUPm8v.js";import{B as C}from"./badge-Cd8v3tl3.js";import{T as S,a as E,b as l,c as o,d as W,e as r}from"./table-CTo0I5HG.js";import{P as B}from"./pagination-NfhvsUbp.js";import{F as R}from"./filter-select-mMC79WOR.js";import{E as k}from"./error-card-DmoxS3Ao.js";import{o as A,p as _,q as D,W as F,b as I}from"./db-link-CtPnIrIr.js";const M=N(function(){return a.jsx(k,{title:"Failed to load warnings",backTo:{href:"/",label:"Back to Dashboard"}})}),V=f(function({loaderData:p}){const{warnings:d,totalCount:x,page:i,totalPages:m,typeFilter:c}=p,[h,g]=P(),j=(e,s)=>{const n=new URLSearchParams(h);s?n.set(e,s):n.delete(e),n.delete("page"),g(n)},y=e=>{const s=new URLSearchParams(h);s.set("page",e.toString()),g(s)};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Warnings"}),a.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:[x.toLocaleString()," warning",x!==1?"s":""," recorded"]})]}),a.jsxs(u,{children:[a.jsxs(T,{className:"flex flex-row items-center justify-between",children:[a.jsx(b,{children:"Warning History"}),a.jsx(R,{value:c,options:A,onChange:e=>j("type",e)})]}),a.jsx(w,{className:"p-0",children:a.jsxs(S,{children:[a.jsx(E,{children:a.jsxs(l,{children:[a.jsx(o,{children:"Type"}),a.jsx(o,{children:"Message"}),a.jsx(o,{children:"Details"}),a.jsx(o,{children:"Time"})]})}),a.jsx(W,{children:d.length===0?a.jsx(l,{children:a.jsx(r,{className:"text-center text-gray-500 dark:text-gray-400 py-8",colSpan:4,children:c?`No ${c.replace("_"," ")} warnings found`:"No warnings recorded. Enable persistWarnings in pg-boss config to capture warnings."})}):d.map(e=>a.jsxs(l,{children:[a.jsx(r,{children:a.jsx(L,{type:e.type})}),a.jsx(r,{className:"text-gray-900 dark:text-gray-100 max-w-md truncate",children:e.message}),a.jsx(r,{className:"font-mono text-xs text-gray-500 dark:text-gray-400 max-w-xs truncate",children:_(e.data)}),a.jsx(r,{className:"text-gray-500 dark:text-gray-400 whitespace-nowrap",children:D(new Date(e.createdOn))})]},e.id))})]})}),a.jsx(B,{page:i,totalPages:m,hasNextPage:i<m,hasPrevPage:i>1,onPageChange:y})]})]})});function L({type:t}){return a.jsx(C,{variant:I[t],size:"sm",children:F[t]})}export{M as ErrorBoundary,V as default};
1
+ import{A as f,B as N,t as P,p as a}from"./chunk-LFPYN7LY-Cj1DJmJR.js";import{C as u,a as T,b,c as w}from"./button-Djse56Dx.js";import{B as C}from"./badge-B5ZugmiV.js";import{T as S,a as E,b as l,c as o,d as W,e as r}from"./table-CtSLyG7m.js";import{P as B}from"./pagination-C4yyCmBA.js";import{F as R}from"./filter-select-DXyBBVm8.js";import{E as k}from"./error-card-CXoOCvsg.js";import{o as A,p as _,q as D,W as F,b as I}from"./db-link-DmvfwdX4.js";const M=N(function(){return a.jsx(k,{title:"Failed to load warnings",backTo:{href:"/",label:"Back to Dashboard"}})}),V=f(function({loaderData:p}){const{warnings:d,totalCount:x,page:i,totalPages:m,typeFilter:c}=p,[h,g]=P(),j=(e,s)=>{const n=new URLSearchParams(h);s?n.set(e,s):n.delete(e),n.delete("page"),g(n)},y=e=>{const s=new URLSearchParams(h);s.set("page",e.toString()),g(s)};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Warnings"}),a.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:[x.toLocaleString()," warning",x!==1?"s":""," recorded"]})]}),a.jsxs(u,{children:[a.jsxs(T,{className:"flex flex-row items-center justify-between",children:[a.jsx(b,{children:"Warning History"}),a.jsx(R,{value:c,options:A,onChange:e=>j("type",e)})]}),a.jsx(w,{className:"p-0",children:a.jsxs(S,{children:[a.jsx(E,{children:a.jsxs(l,{children:[a.jsx(o,{children:"Type"}),a.jsx(o,{children:"Message"}),a.jsx(o,{children:"Details"}),a.jsx(o,{children:"Time"})]})}),a.jsx(W,{children:d.length===0?a.jsx(l,{children:a.jsx(r,{className:"text-center text-gray-500 dark:text-gray-400 py-8",colSpan:4,children:c?`No ${c.replace("_"," ")} warnings found`:"No warnings recorded. Enable persistWarnings in pg-boss config to capture warnings."})}):d.map(e=>a.jsxs(l,{children:[a.jsx(r,{children:a.jsx(L,{type:e.type})}),a.jsx(r,{className:"text-gray-900 dark:text-gray-100 max-w-md truncate",children:e.message}),a.jsx(r,{className:"font-mono text-xs text-gray-500 dark:text-gray-400 max-w-xs truncate",children:_(e.data)}),a.jsx(r,{className:"text-gray-500 dark:text-gray-400 whitespace-nowrap",children:D(new Date(e.createdOn))})]},e.id))})]})}),a.jsx(B,{page:i,totalPages:m,hasNextPage:i<m,hasPrevPage:i>1,onPageChange:y})]})]})});function L({type:t}){return a.jsx(C,{variant:I[t],size:"sm",children:F[t]})}export{M as ErrorBoundary,V as default};