@dub/ui 0.2.13 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client"
2
- import{$ as Cm,$a as lu,$b as Zu,A as wo,Aa as Eo,Ab as Mu,Ac as yp,B as Zd,Ba as To,Bb as Lu,Bc as xp,C as Qd,Ca as Bm,Cb as Eu,Cc as wp,D as Jd,Da as Wm,Db as Tu,Dc as Cp,E as Xd,Ea as cr,Eb as Au,Ec as Np,F as em,Fa as Um,Fb as Fo,Fc as kp,G as tm,Ga as $m,Gb as Bo,Gc as Pp,H as rm,Ha as Gm,Hb as Wo,Hc as Sp,I as om,Ia as Ao,Ib as Du,Ic as Rp,J as am,Ja as Km,Jb as Iu,Jc as Mp,K as im,Ka as jm,Kb as zu,Kc as Lp,L as nm,La as Ym,Lb as Uo,Lc as Ep,M as sm,Ma as kt,Mb as Ou,Mc as Tp,N as lm,Na as qm,Nb as Vu,Nc as Ap,O as cm,Oa as Zm,Ob as _u,Oc as Dp,P as dm,Pa as Qm,Pb as Hu,Pc as Ip,Q as mm,Qa as Jm,Qb as $o,Qc as zp,R as um,Ra as Xm,Rb as Fu,Rc as Op,S as pm,Sa as eu,Sb as Bu,Sc as Vp,T as fm,Ta as tu,Tb as Wu,Tc as _p,U as gm,Ua as Pt,Ub as Uu,Uc as Hp,V as hm,Va as ru,Vb as $u,Vc as Fp,W as vm,Wa as ou,Wb as Gu,Wc as Bp,X as bm,Xa as au,Xb as Ku,Xc as Wp,Y as ym,Ya as iu,Yb as ju,Yc as Up,Z as xm,Za as nu,Zb as Yu,_ as wm,_a as su,_b as qu,a as oo,aa as Nm,ab as cu,ac as Qu,b as ao,ba as km,bb as du,bc as Go,c as io,ca as Pm,cb as mu,cc as Ju,d as Ud,da as Sm,db as Do,dc as Xu,e as no,ea as Rm,eb as Io,ec as ep,f as so,fa as Co,fb as zo,fc as tp,g as lo,ga as Mm,gb as uu,gc as rp,h as co,ha as Lm,hb as pu,hc as op,i as it,ia as Em,ib as fu,ic as ap,j as $d,ja as No,jb as gu,jc as St,k as be,ka as Tm,kb as hu,kc as ip,l as Gd,la as Am,lb as Oo,lc as np,m as mo,ma as Dm,mb as vu,mc as sp,n as Kd,na as Im,nb as bu,nc as lp,o as uo,oa as zm,ob as yu,oc as Ko,p as jd,pa as Om,pb as xu,pc as cp,q as po,qa as Vm,qb as wu,qc as dp,r as fo,ra as ko,rb as Cu,rc as jo,s as Yd,sa as Po,sb as Nu,sc as mp,t as go,ta as So,tb as ku,tc as up,u as qd,ua as Ro,ub as Vo,uc as pp,v as ho,va as Mo,vb as Pu,vc as fp,w as vo,wa as _m,wb as Su,wc as gp,x as bo,xa as Hm,xb as _o,xc as hp,y as yo,ya as Fm,yb as Ru,yc as vp,z as xo,za as Lo,zb as Ho,zc as bp}from"./chunk-5NKUYDPC.mjs";import{a as j}from"./chunk-NWME2ANF.mjs";import{a as qr,b as V,c as xt,d as wt,e as Zr,f as Ue,g as Qr,h as Jr,i as Ct,j as Xr,k as eo,l as Nt,m as to,n as me,o as n,p as ro}from"./chunk-Y2YC64FB.mjs";import*as ae from"@radix-ui/react-accordion";import{ChevronDown as Ci}from"lucide-react";import*as Mt from"react";import{jsx as Rt,jsxs as Si}from"react/jsx-runtime";var qp=ae.Root,Ni=Mt.forwardRef(({className:e,...t},r)=>Rt(ae.Item,{ref:r,className:n("border-b border-b-slate-200 py-3 last:border-none",e),...t}));Ni.displayName="AccordionItem";var ki=Mt.forwardRef(({className:e,children:t,variant:r="chevron",...o},a)=>{let l=r==="chevron"?Ci:St;return Rt(ae.Header,{className:"flex",children:Si(ae.Trigger,{ref:a,className:n("flex flex-1 items-center justify-between font-medium transition-all sm:text-lg",{"[&[data-state=open]>svg]:rotate-180":r==="chevron","[&[data-state=open]>svg]:rotate-45":r==="plus"},e),...o,children:[t,Rt(l,{className:"h-5 w-5 flex-none transition-transform duration-300"})]})})});ki.displayName=ae.Trigger.displayName;var Pi=Mt.forwardRef(({className:e,children:t,...r},o)=>Rt(ae.Content,{ref:o,className:n("data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-gray-500 transition-all sm:text-base",e),...r,children:t}));Pi.displayName=ae.Content.displayName;import{cva as Ri}from"class-variance-authority";import*as Lt from"react";import{jsx as dr}from"react/jsx-runtime";var Mi=Ri("relative w-full rounded-lg border px-4 py-6 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive border-red-500 dark:border-red-500"}},defaultVariants:{variant:"default"}}),Li=Lt.forwardRef(({className:e,variant:t,...r},o)=>dr("div",{ref:o,role:"alert",className:n(Mi({variant:t}),e),...r}));Li.displayName="Alert";var Ei=Lt.forwardRef(({className:e,...t},r)=>dr("h5",{ref:r,className:n("text-md mb-2 font-medium leading-none tracking-tight",e),...t}));Ei.displayName="AlertTitle";var Ti=Lt.forwardRef(({className:e,...t},r)=>dr("div",{ref:r,className:n("text-sm [&_p]:leading-relaxed",e),...t}));Ti.displayName="AlertDescription";import{sha256 as Ai}from"js-sha256";import{useState as Di}from"react";import{jsx as mr}from"react/jsx-runtime";function Ii(e){if(e!=null&&e.image)return e.image;if(!(e!=null&&e.id))return"https://api.dicebear.com/9.x/micah/svg";let t=`https://api.dicebear.com/9.x/micah/svg?seed=${encodeURIComponent(e.id)}`,r=`https://api.dicebear.com/9.x/micah/png/${encodeURIComponent(`seed=${encodeURIComponent(e.id)}`)}`;return e.email?`https://www.gravatar.com/avatar/${Ai(e.email)}?d=${encodeURIComponent(r)}`:t}function o0({user:e={},className:t}){if(!e)return mr("div",{className:n("h-10 w-10 animate-pulse rounded-full border border-gray-300 bg-gray-100",t)});let[r,o]=Di(Ii(e));return mr("img",{alt:`Avatar for ${e.name||e.email}`,referrerPolicy:"no-referrer",src:r,className:n("h-10 w-10 rounded-full border border-gray-300",t),draggable:!1,onError:()=>{o(`https://api.dicebear.com/9.x/micah/svg?seed=${encodeURIComponent(e.id||"")}`)}})}function a0({id:e,className:t}){return mr("img",{src:`https://api.dicebear.com/9.x/shapes/svg?seed=${e}`,alt:"avatar",className:n("h-10 w-10 rounded-full",t),draggable:!1})}import{cva as zi}from"class-variance-authority";import{jsx as Vi}from"react/jsx-runtime";var Oi=zi("max-w-fit rounded-full border px-2 py-px text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"border-gray-400 text-gray-500",violet:"border-violet-600 bg-violet-600 text-white",blue:"border-blue-500 bg-blue-500 text-white",sky:"border-sky-900 bg-sky-900 text-white",black:"border-black bg-black text-white",gray:"border-gray-200 bg-gray-100 text-gray-800",neutral:"border-gray-400 text-gray-500",blueGradient:"bg-gradient-to-r from-blue-100 via-blue-100/50 to-blue-100 border border-blue-200 text-blue-900",rainbow:"bg-gradient-to-r from-violet-600 to-pink-600 text-white border-transparent"}},defaultVariants:{variant:"neutral"}});function Et({className:e,variant:t,...r}){return Vi("span",{className:n(Oi({variant:t}),e),...r})}import{cva as Wi}from"class-variance-authority";import{forwardRef as Ui}from"react";import*as ue from"@radix-ui/react-tooltip";import _i from"linkify-react";import{HelpCircle as Hi}from"lucide-react";import Fi from"next/link";import{useState as Bi}from"react";import{jsx as U,jsxs as $e}from"react/jsx-runtime";function b0({children:e}){return U(ue.Provider,{delayDuration:150,children:e})}function te({children:e,content:t,contentClassName:r,side:o="top",disableHoverableContent:a,...l}){let[c,s]=Bi(!1);return $e(ue.Root,{open:c,onOpenChange:s,delayDuration:0,disableHoverableContent:a,children:[U(ue.Trigger,{asChild:!0,onClick:()=>{s(!0)},onBlur:()=>{s(!1)},children:e}),U(ue.Portal,{children:U(ue.Content,{sideOffset:8,side:o,className:"animate-slide-up-fade z-[99] items-center overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm",collisionPadding:0,...l,children:typeof t=="string"?U("span",{className:n("block max-w-xs text-pretty px-4 py-2 text-center text-sm text-gray-700",r),children:t}):typeof t=="function"?t({setOpen:s}):t})})]})}function y0({title:e,cta:t,href:r,target:o,onClick:a}){return $e("div",{className:"flex max-w-xs flex-col items-center space-y-3 p-4 text-center",children:[U("p",{className:"text-sm text-gray-700",children:e}),t&&(r?U(Fi,{href:r,...o?{target:o}:{},className:n(pe({variant:"primary"}),"flex h-9 w-full items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm"),children:t}):a?U(ie,{onClick:a,text:t,variant:"primary",className:"h-9"}):null)]})}function x0({title:e,cta:t,href:r}){return $e("div",{className:"max-w-xs px-4 py-2 text-center text-sm text-gray-700",children:[e," ",U("a",{href:r,target:"_blank",rel:"noopener noreferrer",onClick:o=>o.stopPropagation(),className:"inline-flex text-gray-500 underline underline-offset-4 hover:text-gray-800",children:t})]})}function w0({children:e}){return U("div",{className:"block max-w-md whitespace-pre-wrap px-4 py-2 text-center text-sm text-gray-700",children:U(_i,{as:"p",options:{target:"_blank",rel:"noopener noreferrer nofollow",className:"underline underline-offset-4 text-gray-400 hover:text-gray-700"},children:e})})}function C0(e){return U(te,{...e,children:U(Hi,{className:"h-4 w-4 text-gray-500"})})}function N0({value:e,unit:t="total clicks",prefix:r,children:o,lastClicked:a}){return(!e||e<1e3)&&!a?o:U(te,{content:$e("div",{className:"block max-w-xs px-4 py-2 text-center text-sm text-gray-700",children:[$e("p",{className:"text-sm font-semibold text-gray-700",children:[r,xt(e||0,{full:!0})," ",t]}),a&&$e("p",{className:"mt-1 text-xs text-gray-500",suppressHydrationWarning:!0,children:["Last clicked ",eo(a,{withAgo:!0})]})]}),children:o})}function k0({children:e,content:t,...r}){return U(te,{content:t,...r,children:U("div",{className:"flex cursor-pointer items-center",children:U(Et,{variant:"gray",className:"border-gray-300 transition-all hover:bg-gray-200",children:e})})})}function P0({children:e,tooltipProps:t,...r}){return U(te,{...t,children:U("button",{type:"button",...r,className:n("flex h-6 w-6 items-center justify-center rounded-md text-gray-500 transition-colors duration-75 hover:bg-gray-100 active:bg-gray-200 disabled:cursor-not-allowed disabled:hover:bg-transparent",r.className),children:e})})}import{jsx as Ge,jsxs as Yo}from"react/jsx-runtime";var pe=Wi("transition-all",{variants:{variant:{primary:"border-black bg-black text-white hover:bg-gray-800 hover:ring-4 hover:ring-gray-200",secondary:n("border-gray-200 bg-white text-gray-900 hover:bg-gray-50 focus-visible:border-gray-500 outline-none","data-[state=open]:border-gray-500 data-[state=open]:ring-4 data-[state=open]:ring-gray-200"),outline:"border-transparent text-neutral-600 hover:bg-neutral-100",success:"border-blue-500 bg-blue-500 text-white hover:bg-blue-600 hover:ring-4 hover:ring-blue-100",danger:"border-red-500 bg-red-500 text-white hover:bg-red-600 hover:ring-4 hover:ring-red-100","danger-outline":"border-transparent bg-white text-red-500 hover:bg-red-600 hover:text-white"}},defaultVariants:{variant:"primary"}}),ie=Ui(({text:e,variant:t="primary",className:r,textWrapperClassName:o,loading:a,icon:l,shortcut:c,disabledTooltip:s,right:d,...m},i)=>s?Ge(te,{content:s,children:Yo("div",{className:n("flex h-10 w-full cursor-not-allowed items-center justify-center gap-x-2 rounded-md border border-gray-200 bg-gray-100 px-4 text-sm text-gray-400 transition-all focus:outline-none",{"border-transparent bg-transparent":t==null?void 0:t.endsWith("outline")},r),children:[l,e&&Ge("div",{className:n("min-w-0 truncate",c&&"flex-1 text-left",o),children:e}),c&&Ge("kbd",{className:n("hidden rounded border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-400 md:inline-block",{"bg-gray-100":t==null?void 0:t.endsWith("outline")}),children:c})]})}):Yo("button",{ref:i,type:m.onClick?"button":"submit",className:n("group flex h-10 w-full items-center justify-center gap-2 whitespace-nowrap rounded-md border px-4 text-sm",m.disabled||a?"cursor-not-allowed border-gray-200 bg-gray-100 text-gray-400 outline-none":pe({variant:t}),r),disabled:m.disabled||a,...m,children:[a?Ge(be,{}):l||null,e&&Ge("div",{className:n("min-w-0 truncate",c&&"flex-1 text-left",o),children:e}),c&&Ge("kbd",{className:n("hidden rounded px-2 py-0.5 text-xs font-light transition-all duration-75 md:inline-block",{"bg-gray-700 text-gray-400 group-hover:bg-gray-600 group-hover:text-gray-300":t==="primary","bg-gray-200 text-gray-400 group-hover:bg-gray-100 group-hover:text-gray-500":t==="secondary","bg-gray-100 text-gray-500 group-hover:bg-gray-200":t==="outline","bg-red-100 text-red-600 group-hover:bg-red-500 group-hover:text-white":t==="danger-outline"}),children:c}),d]}));ie.displayName="Button";import{cva as $i}from"class-variance-authority";import{createContext as Gi}from"react";import{jsx as qo}from"react/jsx-runtime";var Ki=$i("group/card-list w-full flex flex-col transition-[gap,opacity] min-w-0",{variants:{variant:{compact:"gap-0",loose:"gap-4"},loading:{true:"opacity-50"}}}),nt=Gi({variant:"loose"});function Zo({variant:e="loose",loading:t=!1,className:r,children:o}){return qo("ul",{className:n(Ki({variant:e,loading:t}),r),"data-variant":e,children:qo(nt.Provider,{value:{variant:e},children:o})})}import{cva as ji}from"class-variance-authority";import{createContext as Yi,useContext as qi,useEffect as Zi,useRef as Qi,useState as Ji}from"react";import{jsx as ur}from"react/jsx-runtime";var Xi=ji("w-full group/card border-gray-200 bg-white",{variants:{variant:{compact:"first-of-type:rounded-t-xl last-of-type:rounded-b-xl first-of-type:border-t border-b border-x data-[hover-state-enabled=true]:hover:bg-gray-50 transition-colors",loose:"border rounded-xl transition-[filter] data-[hover-state-enabled=true]:hover:drop-shadow-card-hover"}}}),en="w-full py-2.5 px-4",pr=Yi({hovered:!1});function Qo({outerClassName:e,innerClassName:t,children:r,onClick:o,hoverStateEnabled:a=!0}){let{variant:l}=qi(nt),c=Qi(null),[s,d]=Ji(!1);return Zi(()=>{if(!s||!c.current)return;let m=setInterval(()=>{var i;((i=c.current)==null?void 0:i.matches(":hover"))===!1&&d(!1)},1e3);return()=>clearInterval(m)},[s]),ur("li",{ref:c,className:n(Xi({variant:l}),e),onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),"data-hover-state-enabled":a,children:ur("div",{className:n(en,t),onClick:o?m=>{document.getElementById("modal-backdrop")||Nt(m)||o()}:void 0,children:ur(pr.Provider,{value:{hovered:s},children:r})})})}var q0=Object.assign(Zo,{Card:Object.assign(Qo,{Context:pr}),Context:nt});import{cva as tn}from"class-variance-authority";import rn from"embla-carousel-autoplay";import on from"embla-carousel-react";import{motion as an}from"framer-motion";import{ArrowLeft as nn,ArrowRight as sn,ChevronLeft as ln,ChevronRight as cn}from"lucide-react";import*as T from"react";import{jsx as Z,jsxs as ze}from"react/jsx-runtime";var Jo=2e3,Xo=T.createContext(null);function Ke(){let e=T.useContext(Xo);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function nf(){let{api:e}=Ke(),[t,r]=T.useState(0),o=T.useCallback(a=>r((a==null?void 0:a.selectedScrollSnap())??0),[]);return T.useEffect(()=>{!e||(o(e),e.on("reInit",o),e.on("select",o))},[e,o]),t}var dn=T.forwardRef(({orientation:e="horizontal",opts:t,setApi:r,autoplay:o,plugins:a,className:l,children:c,...s},d)=>{let[m,i]=on({...t,axis:e==="horizontal"?"x":"y"},[...o?[rn(typeof o=="object"?o:{delay:Jo})]:[],...a||[]]),[p,f]=T.useState(!1),[b,y]=T.useState(!1),h=T.useCallback(S=>{!S||(f(S.canScrollPrev()),y(S.canScrollNext()))},[]),g=T.useCallback(()=>{i==null||i.scrollPrev()},[i]),C=T.useCallback(()=>{i==null||i.scrollNext()},[i]),P=T.useCallback(S=>{S.key==="ArrowLeft"?(S.preventDefault(),g()):S.key==="ArrowRight"&&(S.preventDefault(),C())},[g,C]);return T.useEffect(()=>{!i||!r||r(i)},[i,r]),T.useEffect(()=>{if(!!i)return h(i),i.on("reInit",h),i.on("select",h),()=>{i==null||i.off("select",h)}},[i,h]),Z(Xo.Provider,{value:{carouselRef:m,api:i,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:g,scrollNext:C,canScrollPrev:p,canScrollNext:b},children:Z("div",{ref:d,onKeyDownCapture:P,className:n("relative",l),role:"region","aria-roledescription":"carousel",...s,children:c})})});dn.displayName="Carousel";var mn=T.forwardRef(({className:e,...t},r)=>{let{carouselRef:o,orientation:a}=Ke();return Z("div",{ref:o,className:"overflow-hidden",children:Z("div",{ref:r,className:n("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});mn.displayName="CarouselContent";var un=T.forwardRef(({className:e,...t},r)=>{let{orientation:o}=Ke();return Z("div",{ref:r,role:"group","aria-roledescription":"slide",className:n("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",e),...t})});un.displayName="CarouselItem";var pn=T.forwardRef(({className:e,...t},r)=>{let{orientation:o,scrollPrev:a,canScrollPrev:l}=Ke();return ze("button",{ref:r,className:n("absolute",o==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",pe({variant:"secondary",className:"p-2"}),e),disabled:!l,onClick:a,...t,children:[Z(nn,{className:"h-4 w-4"}),Z("span",{className:"sr-only",children:"Previous slide"})]})});pn.displayName="CarouselPrevious";var fn=T.forwardRef(({className:e,...t},r)=>{let{orientation:o,scrollNext:a,canScrollNext:l}=Ke();return ze("button",{ref:r,className:n("absolute",o==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",pe({variant:"secondary",className:"p-2"}),e),disabled:!l,onClick:a,...t,children:[Z(sn,{className:"h-4 w-4"}),Z("span",{className:"sr-only",children:"Next slide"})]})});fn.displayName="CarouselNext";var gn=tn("flex items-center justify-center gap-3 sm:gap-6",{variants:{variant:{simple:"relative",floating:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full border border-gray-800/10 bg-white sm:bottom-6 "}}}),sf=({variant:e="simple",className:t})=>{var y;let{scrollNext:r,scrollPrev:o,canScrollNext:a,canScrollPrev:l,api:c}=Ke(),s=(y=c==null?void 0:c.plugins())==null?void 0:y.autoplay,[d,m]=T.useState(0),[i,p]=T.useState(!1),f=T.useCallback(h=>{m((h==null?void 0:h.selectedScrollSnap())??0)},[]),b=T.useCallback(h=>()=>{s&&s.isPlaying()&&s.stop(),h()},[s]);return T.useEffect(()=>{!c||(f(c),p((s==null?void 0:s.isPlaying())??!1),c.on("reInit",f),c.on("select",f),c.on("autoplay:play",()=>p(!0)),c.on("autoplay:stop",()=>p(!1)))},[c,s,f]),ze("div",{className:n(gn({variant:e}),t),children:[e!=="simple"&&ze("button",{className:"cursor-pointer rounded-full p-2 hover:bg-gray-50 active:bg-gray-100",disabled:!l,onClick:b(o),children:[Z(ln,{className:"h-4 w-4"}),Z("span",{className:"sr-only",children:"Previous slide"})]}),c!=null&&Z("div",{className:"flex items-center gap-1",children:c.slideNodes().map((h,g)=>ze("button",{onClick:b(()=>c.scrollTo(g)),className:"rounded-full p-0.5 hover:bg-gray-100 active:bg-gray-200 sm:p-1.5",children:[Z("div",{className:n("relative isolate h-1.5 w-1.5 overflow-hidden rounded-full transition-all",g===d?"bg-black":"bg-black/20",i&&g===d&&"w-6 bg-black/20"),children:i&&g===d&&Z(an.div,{initial:{x:"-100%"},animate:{x:0},transition:{type:"tween",duration:((s==null?void 0:s.options.delay)??Jo)/1e3},className:"animate-fill-width h-full w-full rounded-full bg-black"})}),ze("span",{className:"sr-only",children:["Slide ",g+1]})]},g))}),e!=="simple"&&ze("button",{className:"cursor-pointer rounded-full p-2 hover:bg-gray-50 active:bg-gray-100",disabled:!a,onClick:b(r),children:[Z(cn,{className:"h-4 w-4"}),Z("span",{className:"sr-only",children:"Next slide"})]})]})};import*as st from"@radix-ui/react-checkbox";import{Check as hn}from"lucide-react";import*as ea from"react";import{jsx as fr}from"react/jsx-runtime";var vn=ea.forwardRef(({className:e,...t},r)=>fr(st.Root,{ref:r,className:n("peer h-5 w-5 shrink-0 rounded-md border border-gray-200 bg-white outline-none focus-visible:border-black disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500",e),...t,children:fr(st.Indicator,{className:"flex items-center justify-center",children:fr(hn,{className:"h-3 w-3 text-white"})})}));vn.displayName=st.Root.displayName;import{Command as zt,CommandInput as is,CommandItem as ns,useCommandState as ss}from"cmdk";import{ChevronDown as ls}from"lucide-react";import{forwardRef as cs,isValidElement as ds,useCallback as ms,useEffect as It,useRef as us,useState as lt}from"react";import{motion as rs}from"framer-motion";import{forwardRef as os,useRef as as}from"react";import gr from"js-cookie";import{useEffect as bn,useState as yn}from"react";function ff(e,t,r){let[o,a]=yn(()=>{let c=gr.get(e);return c?JSON.parse(c):t});return bn(()=>{let c=()=>{let s=gr.get(e);s&&a(JSON.parse(s))};return window.addEventListener("storage",c),()=>{window.removeEventListener("storage",c)}},[e]),[o,c=>{a(c),gr.set(e,JSON.stringify(c),r)}]}import{useCallback as xn,useEffect as wn,useRef as Cn,useState as Nn}from"react";var je=(e=3e3)=>{let t=Cn(null),[r,o]=Nn(!1),a=()=>{t.current&&(clearTimeout(t.current),t.current=null)},l=xn(async c=>{a();try{typeof c=="string"?await navigator.clipboard.writeText(c):c instanceof ClipboardItem&&await navigator.clipboard.write([c]),o(!0),Number.isFinite(e)&&e>=0&&(t.current=setTimeout(()=>o(!1),e))}catch(s){console.error("Failed to copy: ",s)}},[e]);return wn(()=>()=>a(),[]),[r,l]};import{useEffect as kn,useState as Pn}from"react";function yf(){let[e,t]=Pn(null);return kn(()=>{let r=document.querySelector("[data-mdx-container]");if(!r)return;let o=r.offsetTop-1,a=new IntersectionObserver(s=>{var p,f,b;let d=s[0];if(!d)return;let m=(((p=d.rootBounds)==null?void 0:p.height)||0)*.3+o;for(let y=1;y<s.length;y++){let h=s[y];if(!h)break;(h.boundingClientRect.top<d.boundingClientRect.top||d.boundingClientRect.bottom<o)&&(d=h)}let i=d.target;for(;i&&i.getBoundingClientRect().bottom<o;)i=(f=l.get(i))==null?void 0:f.next;for(;i&&i.getBoundingClientRect().top>m;)i=(b=l.get(i))==null?void 0:b.prev;i&&t(i.getAttribute("href"))},{threshold:1,rootMargin:`-${o}px 0px 0px 0px`}),l=new Map;return(r==null?void 0:r.querySelectorAll("[data-mdx-heading]")).forEach(s=>a.observe(s)),()=>{a.disconnect()}},[]),e==null?void 0:e.replace("#","")}function wf(e){return{handleKeyDown:r=>{r.key==="Enter"&&r.metaKey&&(r.preventDefault(),e.current&&e.current.requestSubmit())}}}import{useEffect as Sn,useState as Rn}from"react";function Pf(e,t={}){let{root:r,defaultValue:o}=t,[a,l]=Rn(o??!1);return Sn(()=>{let c=()=>{let d=e.current;if(!d)return;let m=r==null?void 0:r.current,i=d.getBoundingClientRect(),p=m?m.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};l(i.top<p.bottom&&i.bottom>p.top&&i.left<p.right&&i.right>p.left)};((r==null?void 0:r.current)||window).addEventListener("scroll",c),window.addEventListener("resize",c);let s=null;return e.current&&(s=new IntersectionObserver(c),s.observe(e.current)),c(),()=>{((r==null?void 0:r.current)||window).removeEventListener("scroll",c),window.removeEventListener("resize",c),s==null||s.disconnect()}},[e,r]),a}import{useEffect as Mn,useState as Ln}from"react";function Mf(){let[e,t]=Ln(!1);return Mn(()=>{let r=()=>{let o=document.activeElement;t((o==null?void 0:o.tagName)!=null&&["INPUT","TEXTAREA"].includes(o.tagName))};return window.addEventListener("focusin",r),window.addEventListener("focusout",r),()=>{window.removeEventListener("focusin",r),window.removeEventListener("focusout",r)}},[]),e}import{useEffect as En,useState as Tn}from"react";function Af(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:a=!1}){let[l,c]=Tn(),s=(l==null?void 0:l.isIntersecting)&&a,d=([m])=>{c(m)};return En(()=>{let m=e==null?void 0:e.current;if(!!!window.IntersectionObserver||s||!m)return;let p={threshold:t,root:r,rootMargin:o},f=new IntersectionObserver(d,p);return f.observe(m),()=>f.disconnect()},[e,JSON.stringify(t),r,o,s]),l}import{createContext as An,useCallback as Dn,useContext as In,useEffect as ta,useId as zn,useState as On}from"react";import{jsx as Vn}from"react/jsx-runtime";var ra=An({listeners:[],setListeners:()=>{}});function _f({children:e}){let[t,r]=On([]);return Vn(ra.Provider,{value:{listeners:t,setListeners:r},children:e})}function Ye(e,t,r={}){let o=zn(),{listeners:a,setListeners:l}=In(ra),c=Dn(s=>{let d=s.target,m=document.getElementById("modal-backdrop");if(s.metaKey||s.ctrlKey||d.tagName==="INPUT"||d.tagName==="TEXTAREA"||!!m!=!!r.modal||(Array.isArray(e)?!e.includes(s.key):s.key!==e))return;let i=a.filter(f=>f.enabled!==!1&&(Array.isArray(f.key)?f.key.includes(s.key):f.key===s.key));!i.length||Xr(i,(f,b)=>(b.priority??0)-(f.priority??0)).slice(-1)[0].id!==o||(s.preventDefault(),t(s))},[e,a,o,t]);ta(()=>(document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)),[c]),ta(()=>(l(s=>[...s.filter(d=>d.id!==o),{id:o,key:e,...r}]),()=>l(s=>s.filter(d=>d.id!==o))),[JSON.stringify(e),r.enabled,r.priority])}import{useEffect as _n,useState as Hn}from"react";function oa(e){if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}function Bf(e,t){let[r,o]=Hn(oa(e)??t);return _n(()=>{let l=oa(e);l&&o(l)},[e]),[r,l=>{o(l),window.localStorage.setItem(e,JSON.stringify(l))}]}import{toast as Fn}from"sonner";import Bn from"swr";function Kf(e,t){let{data:r,isLoading:o,mutate:a}=Bn(e,me);return{data:r,isLoading:o,update:async(l,c)=>Fn.promise(a(l(r),{optimisticData:c,rollbackOnError:!0,populateCache:!0,revalidate:!0}),{loading:(t==null?void 0:t.loading)||"Updating...",success:(t==null?void 0:t.success)||"Successfully updated",error:(t==null?void 0:t.error)||"Failed to update"})}}import{useEffect as sa,useMemo as Kn}from"react";import{useEffect as aa,useState as Wn}from"react";function ia({pageSize:e,page:t,onPageChange:r}){let[o,a]=Wn({pageIndex:t,pageSize:e});return aa(()=>{a(l=>({...l,pageIndex:t}))},[t]),aa(()=>{r==null||r(o.pageIndex)},[o]),{pagination:o,setPagination:a}}import{usePathname as Un,useRouter as $n,useSearchParams as Gn}from"next/navigation";function na(){let e=Un(),t=$n(),r=Gn(),o=Object.fromEntries(r);return{pathname:e,router:t,searchParams:r,searchParamsObj:o,queryParams:({set:c,del:s,replace:d,scroll:m=!0,getNewPath:i,arrayDelimiter:p=","})=>{let f=new URLSearchParams(r);c&&Object.entries(c).forEach(([h,g])=>f.set(h,Array.isArray(g)?g.join(p):g)),s&&(Array.isArray(s)?s.forEach(h=>f.delete(h)):f.delete(s));let b=f.toString(),y=`${e}${b.length>0?`?${b}`:""}`;if(i)return y;d?t.replace(y,{scroll:!1}):t.push(y,{scroll:m})},getQueryString:(c,s)=>{let d=new URLSearchParams(r);c&&Object.entries(c).forEach(([i,p])=>d.set(i,p)),s!=null&&s.ignore&&s.ignore.forEach(i=>d.delete(i));let m=d.toString();return m.length>0?`?${m}`:""}}}function rg(e=Zr){let{searchParams:t,queryParams:r}=na(),o=Kn(()=>parseInt(t.get("page")||"1")||1,[t.get("page")]),{pagination:a,setPagination:l}=ia({pageSize:e,page:o,onPageChange:c=>{r(c===1?{del:"page"}:{set:{page:c.toString()}})}});return sa(()=>{let c=parseInt(t.get("page")||"1")||1;l(s=>({...s,pageIndex:c}))},[t.get("page")]),sa(()=>{r(a.pageIndex===1?{del:"page"}:{set:{page:a.pageIndex.toString()}})},[a]),{pagination:a,setPagination:l}}import{useEffect as jn,useState as Yn}from"react";function Tt(e){let[t,r]=Yn(),o=([a])=>{r(a)};return jn(()=>{let a=e==null?void 0:e.current;if(!a)return;let l=new ResizeObserver(o);return l.observe(a),()=>l.disconnect()},[e]),t}import{useCallback as qn,useEffect as la,useState as Zn}from"react";function ca(e){let[t,r]=Zn(!1),o=qn(()=>{r(window.scrollY>e)},[e]);return la(()=>(window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)),[o]),la(()=>{o()},[o]),t}import{useCallback as Qn,useEffect as Jn,useState as Xn}from"react";function qe(e){let[t,r]=Xn(1),o=Qn(()=>{if(!e.current)return;let{scrollTop:l,scrollHeight:c,clientHeight:s}=e.current;r(c===s?1:Math.min(l/(c-s),1))},[]),a=Tt(e);return Jn(o,[a]),{scrollProgress:t,updateScrollProgress:o}}import{useEffect as es}from"react";import{toast as ma}from"sonner";import{jsx as At,jsxs as da}from"react/jsx-runtime";function ts({id:e,message:t,undo:r}){let o=()=>{r(),ma.dismiss(e)},a=l=>{l.key==="z"&&(l.ctrlKey||l.metaKey)&&o()};return es(()=>(document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)),[]),da("div",{className:"flex w-full items-center justify-between space-x-2",children:[da("div",{className:"flex items-center space-x-2",children:[At(lo,{}),At("p",{className:"font-medium",children:t})]}),At("button",{className:"whitespace-nowrap rounded border border-black bg-black px-2 py-1 text-xs font-normal text-white transition-all duration-75 active:scale-95",onClick:o,children:"Undo"})]})}function hg(){return({id:t,message:r,undo:o,duration:a})=>ma(At(ts,{id:t,message:r,undo:o}),{id:t,...a&&{duration:a}})}import{jsx as ua}from"react/jsx-runtime";var ye=os(({width:e=!1,height:t=!1,className:r,transition:o,children:a,...l},c)=>{var m,i;let s=as(null),d=Tt(s);return ua(rs.div,{ref:c,className:n("overflow-hidden",r),animate:{width:e?((m=d==null?void 0:d.contentRect)==null?void 0:m.width)??"auto":"auto",height:t?((i=d==null?void 0:d.contentRect)==null?void 0:i.height)??"auto":"auto"},transition:o??{type:"spring",duration:.3},...l,children:ua("div",{ref:s,className:n(t&&"h-max",e&&"w-max"),children:a})})});ye.displayName="AnimatedSizeContainer";import*as Ne from"@radix-ui/react-popover";import{Drawer as Ze}from"vaul";import{jsx as xe,jsxs as Dt}from"react/jsx-runtime";function Qe({children:e,content:t,align:r="center",side:o="bottom",openPopover:a,setOpenPopover:l,mobileOnly:c,popoverContentClassName:s,collisionBoundary:d,sticky:m,onEscapeKeyDown:i,onWheel:p}){let{isMobile:f}=j();return c||f?Dt(Ze.Root,{open:a,onOpenChange:l,children:[xe(Ze.Trigger,{className:"sm:hidden",asChild:!0,children:e}),Dt(Ze.Portal,{children:[xe(Ze.Overlay,{className:"fixed inset-0 z-50 bg-gray-100 bg-opacity-10 backdrop-blur"}),Dt(Ze.Content,{className:"fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-[10px] border-t border-gray-200 bg-white",onEscapeKeyDown:i,onPointerDownOutside:b=>{b.target instanceof Element&&b.target.closest("[data-sonner-toast]")&&b.preventDefault()},children:[xe("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:xe("div",{className:"my-3 h-1 w-12 rounded-full bg-gray-300"})}),xe("div",{className:"flex min-h-[150px] w-full items-center justify-center overflow-hidden bg-white pb-8 align-middle shadow-xl",children:t})]}),xe(Ze.Overlay,{})]})]}):Dt(Ne.Root,{open:a,onOpenChange:l,children:[xe(Ne.Trigger,{className:"sm:inline-flex",asChild:!0,children:e}),xe(Ne.Portal,{children:xe(Ne.Content,{sideOffset:8,align:r,side:o,className:n("animate-slide-up-fade z-50 items-center rounded-lg border border-gray-200 bg-white drop-shadow-lg sm:block",s),sticky:m,collisionBoundary:d,onEscapeKeyDown:i,onWheel:p,children:t})})]})}import{Fragment as hr,jsx as A,jsxs as ke}from"react/jsx-runtime";function ps(e,t){return e===!0}function $g({multiple:e,selected:t,setSelected:r,options:o,icon:a,placeholder:l="Select...",searchPlaceholder:c="Search...",emptyState:s,createLabel:d,onCreate:m,buttonProps:i,shortcutHint:p,caret:f,side:b,open:y,onOpenChange:h,onSearchChange:g,shouldFilter:C=!0,inputClassName:P,optionRight:S,optionClassName:k,matchTriggerWidth:x,children:v}){let R=ps(e,r),I=Array.isArray(t)?t:t?[t]:[],{isMobile:D}=j(),[q,w]=lt(!1),z=y??q,ce=h??w,[L,de]=lt(""),[ee,nr]=lt(!1),[sr,yi]=lt(void 0),[xi,jr]=lt(!1),wi=O=>{var We;if(R){let lr=I.some(({value:at})=>at===O.value);r(lr?I.filter(({value:at})=>at!==O.value):[...I,O])}else r(I.length&&((We=I[0])==null?void 0:We.value)===O.value?null:O),ce(!1)},Yr=ms((O,We)=>We===""?[...I,...O.filter(lr=>I.findIndex(at=>at.value===lr.value)===-1)]:O,[I]);return It(()=>{ee&&(yi(o&&Yr(o,L)),nr(!1))},[ee,o,Yr,L]),It(()=>{nr(!0)},[o]),It(()=>{z||(de(""),nr(!0))},[z]),It(()=>g==null?void 0:g(L),[L]),A(Qe,{openPopover:z,setOpenPopover:ce,align:"start",side:b,onWheel:O=>{O.stopPropagation()},popoverContentClassName:n(x&&"sm:w-[var(--radix-popover-trigger-width)]"),content:A(ye,{width:!D&&!x,height:!0,style:{transform:"translateZ(0)"},transition:{ease:"easeInOut",duration:.1},className:"pointer-events-auto",children:ke(zt,{loop:!0,shouldFilter:C,children:[ke("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-gray-200",children:[A(is,{placeholder:c,value:L,onValueChange:de,className:n("grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-gray-400 focus:ring-0 sm:text-sm",P),onKeyDown:O=>{(O.key==="Escape"||O.key==="Backspace"&&!L)&&(O.preventDefault(),O.stopPropagation(),ce(!1))}}),p&&A("kbd",{className:"mr-2 hidden shrink-0 rounded border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-500 md:block",children:p})]}),A(fs,{children:A(zt.List,{className:n("flex w-full min-w-[100px] flex-col gap-1 p-1"),children:sr!==void 0?ke(hr,{children:[sr.map(O=>A(gs,{option:O,multiple:R,selected:I.some(({value:We})=>We===O.value),onSelect:()=>wi(O),right:S==null?void 0:S(O),className:k},`${O.label}, ${O.value}`)),L.length>0&&m&&ke(ns,{className:n("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm text-gray-700","data-[selected=true]:bg-gray-100",k),onSelect:async()=>{jr(!0),await(m==null?void 0:m(L))&&(de(""),ce(!1)),jr(!1)},children:[xi?A(be,{className:"size-4 shrink-0"}):A(St,{className:"size-4 shrink-0"}),A("div",{className:"grow truncate",children:(d==null?void 0:d(L))||`Create "${L}"`})]}),C?A(hs,{className:"flex min-h-12 items-center justify-center text-sm text-gray-500",children:s||"No matches"}):sr.length===0?A("div",{className:"flex min-h-12 items-center justify-center text-sm text-gray-500",children:s||"No matches"}):null]}):A(zt.Loading,{children:A("div",{className:"flex h-12 items-center justify-center",children:A(be,{})})})})})]})}),children:A(ie,{variant:"secondary",...i,className:n(i==null?void 0:i.className,"flex gap-2"),textWrapperClassName:n(i==null?void 0:i.textWrapperClassName,"w-full flex items-center justify-start"),text:ke(hr,{children:[A("div",{className:"min-w-0 grow truncate text-left",children:v||I.map(O=>O.label).join(", ")||l}),f&&A(ls,{className:"ml-1 size-4 shrink-0 text-gray-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}),icon:a?pa(a)?a:A(a,{className:"size-4 shrink-0"}):void 0})})}var fs=({children:e})=>{let t=us(null),{scrollProgress:r,updateScrollProgress:o}=qe(t);return ke(hr,{children:[A("div",{className:"scrollbar-hide max-h-[min(50vh,250px)] w-screen overflow-y-scroll sm:w-auto",ref:t,onScroll:o,children:e}),A("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full rounded-b-lg bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(r,2)}})]})};function gs({option:e,onSelect:t,multiple:r,selected:o,right:a,className:l}){return ke(zt.Item,{className:n("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-gray-100",l),onSelect:t,value:e.label+(e==null?void 0:e.value),children:[r&&A("div",{className:"shrink-0 text-gray-600",children:o?A(So,{className:"size-4 text-gray-600"}):A(Ro,{className:"size-4 text-gray-400"})}),ke("div",{className:"flex min-w-0 grow items-center gap-1",children:[e.icon&&A("span",{className:"shrink-0 text-gray-600",children:pa(e.icon)?e.icon:A(e.icon,{className:"h-4 w-4"})}),A("span",{className:"grow truncate",children:e.label})]}),a,!r&&o&&A(Po,{className:"size-4 shrink-0 text-gray-600"})]})}var pa=e=>ds(e),hs=cs((e,t)=>ss(o=>o.filtered.count===0)?A("div",{ref:t,"cmdk-empty":"",role:"presentation",...e}):null);import{addYears as Ot,format as vs,isSameMonth as bs}from"date-fns";import{ChevronLeft as fa,ChevronRight as ga,ChevronsLeft as ys,ChevronsRight as xs}from"lucide-react";import{forwardRef as ws,useRef as Cs}from"react";import{DayPicker as Ns,useDayPicker as ks,useDayRender as Ps,useNavigation as Ss}from"react-day-picker";import{Fragment as Rs,jsx as re,jsxs as Vt}from"react/jsx-runtime";var ct=ws(({onClick:e,icon:t,disabled:r,...o},a)=>re("button",{ref:a,type:"button",disabled:r,className:n("flex h-7 w-7 shrink-0 select-none items-center justify-center rounded border p-1 outline-none transition","border-gray-200 text-gray-600 hover:text-gray-800","hover:bg-gray-50 active:bg-gray-100","disabled:pointer-events-none disabled:text-gray-400"),onClick:e,...o,children:re(t,{className:"h-full w-full shrink-0"})}));ct.displayName="NavigationButton";function ha({mode:e="single",weekStartsOn:t=1,numberOfMonths:r=1,showYearNavigation:o=!1,disableNavigation:a,locale:l,className:c,classNames:s,...d}){return re(Ns,{mode:e,weekStartsOn:t,numberOfMonths:r,locale:l,showOutsideDays:r===1,className:c,classNames:{months:"flex space-y-0",month:"space-y-4 p-3 w-full",nav:"gap-1 flex items-center rounded-full w-full h-full justify-between p-4",table:"w-full border-separate border-spacing-y-1",head_cell:"w-9 font-medium text-xs text-center text-gray-400 pb-2",row:"w-full",cell:"relative p-0 text-center focus-within:relative text-gray-900",day:n("relative h-10 w-full sm:h-9 sm:w-9 rounded-md text-sm text-gray-900","hover:bg-gray-100 active:bg-gray-200 outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500"),day_today:"font-semibold",day_selected:"rounded aria-selected:bg-blue-500 aria-selected:text-white",day_disabled:"!text-gray-300 line-through disabled:hover:bg-transparent",day_outside:"text-gray-400",day_range_middle:"!rounded-none aria-selected:!bg-blue-100 aria-selected:!text-blue-900",day_range_start:"rounded-r-none !rounded-l",day_range_end:"rounded-l-none !rounded-r",day_hidden:"invisible",...s},components:{IconLeft:()=>re(fa,{className:"h-4 w-4"}),IconRight:()=>re(ga,{className:"h-4 w-4"}),Caption:({...m})=>{let{goToMonth:i,nextMonth:p,previousMonth:f,currentMonth:b,displayMonths:y}=Ss(),{numberOfMonths:h,fromDate:g,toDate:C}=ks(),P=y.findIndex(D=>bs(m.displayMonth,D)),S=P===0,k=P===y.length-1,x=h>1&&(S||!k),v=h>1&&(k||!S),R=()=>{let D=Ot(b,-1);f&&(!g||D.getTime()>=g.getTime())&&i(D)},I=()=>{let D=Ot(b,1);p&&(!C||D.getTime()<=C.getTime())&&i(D)};return Vt("div",{className:"flex items-center justify-between",children:[Vt("div",{className:"flex items-center gap-1",children:[o&&!v&&re(ct,{disabled:a||!f||g&&Ot(b,-1).getTime()<g.getTime(),"aria-label":"Go to previous year",onClick:R,icon:ys}),!v&&re(ct,{disabled:a||!f,"aria-label":"Go to previous month",onClick:()=>f&&i(f),icon:fa})]}),re("div",{role:"presentation","aria-live":"polite",className:"text-sm font-medium capitalize tabular-nums text-gray-900",children:vs(m.displayMonth,"LLLL yyy",{locale:l})}),Vt("div",{className:"flex items-center gap-1",children:[!x&&re(ct,{disabled:a||!p,"aria-label":"Go to next month",onClick:()=>p&&i(p),icon:ga}),o&&!x&&re(ct,{disabled:a||!p||C&&Ot(b,1).getTime()>C.getTime(),"aria-label":"Go to next year",onClick:I,icon:xs})]})]})},Day:({date:m,displayMonth:i})=>{let p=Cs(null),{activeModifiers:f,buttonProps:b,divProps:y,isButton:h,isHidden:g}=Ps(m,i,p),{selected:C,today:P,disabled:S,range_middle:k}=f;if(g)return re(Rs,{});if(!h)return re("div",{...y,className:n("flex items-center justify-center",y.className)});let{children:x,...v}=b;return Vt("button",{ref:p,...v,type:"button",children:[x,P&&re("span",{className:n("absolute inset-x-1/2 bottom-1.5 h-0.5 w-4 -translate-x-1/2 rounded-[2px]",{"bg-blue-500":!C,"!bg-white":C,"!bg-blue-400":C&&k,"text-gray-400":S})})]})}},...d})}import{enUS as _s}from"date-fns/locale";import{useEffect as Cr,useMemo as ba,useState as Ht}from"react";import{Command as vr}from"cmdk";import{Lock as Ms}from"lucide-react";import{jsx as Oe,jsxs as Ls}from"react/jsx-runtime";var br=({presets:e,onSelect:t,currentValue:r})=>{let o=d=>"dateRange"in d,a=d=>"date"in d,l=(d,m)=>d.getDate()===m.getDate()&&d.getMonth()===m.getMonth()&&d.getFullYear()===m.getFullYear(),c=(d,m)=>{let i=d.from,p=m.from,f=!1;i&&p&&l(i,p)&&(f=!0);let b=d.to,y=m.to,h=!1;return b&&y&&l(b,y)&&(h=!0),f&&h},s=d=>{if(o(d)){let m=r;return m&&c(m,d.dateRange)}else if(a(d)){let m=r;return m&&l(m,d.date)}return!1};return Oe(vr,{className:"w-full rounded ring-gray-200 ring-offset-2 focus:outline-none",tabIndex:0,autoFocus:!0,loop:!0,children:Oe(vr.List,{className:"[&>*]:flex [&>*]:w-full [&>*]:items-start [&>*]:gap-x-2 [&>*]:gap-y-0.5 [&>*]:sm:flex-col",children:e.map((d,m)=>Ls(vr.Item,{disabled:d.requiresUpgrade,onSelect:()=>t(d),title:d.label,value:d.id,className:n("group relative flex cursor-pointer items-center justify-between overflow-hidden text-ellipsis whitespace-nowrap rounded border border-gray-200","px-2.5 py-1.5 text-left text-sm text-gray-700 shadow-sm outline-none sm:w-full sm:border-none sm:py-2 sm:shadow-none","disabled:pointer-events-none disabled:opacity-50","sm:data-[selected=true]:bg-gray-100",s(d)&&"font-semibold text-gray-800"),children:[Oe("span",{children:d.label}),d.requiresUpgrade?Oe(Ms,{className:"h-3.5 w-3.5","aria-hidden":"true"}):d.shortcut?Oe("kbd",{className:"text-gray-4000 hidden rounded bg-gray-100 px-2 py-0.5 text-xs font-light group-data-[selected=true]:bg-gray-200 md:block",children:d.shortcut.toUpperCase()}):null,d.requiresUpgrade&&d.tooltipContent&&Oe(te,{side:"bottom",content:d.tooltipContent,children:Oe("div",{className:"absolute inset-0 cursor-not-allowed"})})]},m))})})};br.displayName="DatePicker.Presets";import{format as Pe}from"date-fns";import{createContext as Es}from"react";var yr=Es({isOpen:!1,setIsOpen:()=>{}}),Ts=()=>{let e=typeof window<"u"?window.navigator.language:"en-US",t=new Intl.DateTimeFormat(e,{hour:"numeric"}).format();return Number.isInteger(Number(t))},xr=(e,t,r=!1)=>{let o=!Ts(),a;return r?a=o?Pe(e,"d MMM, yyyy h:mm a",{locale:t}):Pe(e,"d MMM, yyyy HH:mm",{locale:t}):a=Pe(e,"d MMM, yyyy",{locale:t}),a},va=(e,t)=>{let{toYear:r,fromYear:o,fromMonth:a,toMonth:l,fromDay:c,toDay:s}=t;if(e&&e.length>0){let d=o,m=r;e.forEach(i=>{var p,f,b,y,h,g;if("date"in i){let C=i.date.getFullYear();if(o&&C<o)throw new Error(`Preset ${i.label} is before fromYear ${d}.`);if(r&&C>r)throw new Error(`Preset ${i.label} is after toYear ${m}.`);if(a&&i.date.getMonth()<a.getMonth())throw new Error(`Preset ${i.label} is before fromMonth ${a}.`);if(l&&i.date.getMonth()>l.getMonth())throw new Error(`Preset ${i.label} is after toMonth ${l}.`);if(c&&i.date.getDate()<c.getDate())throw new Error(`Preset ${i.label} is before fromDay ${c}.`);if(s&&i.date.getDate()>s.getDate())throw new Error(`Preset ${i.label} is after toDay ${Pe(s,"MMM dd, yyyy")}.`)}if("dateRange"in i){let C=(p=i.dateRange.from)==null?void 0:p.getFullYear(),P=(f=i.dateRange.to)==null?void 0:f.getFullYear();if(C&&o&&C<o)throw new Error(`Preset ${i.label}'s 'from' is before fromYear ${d}.`);if(P&&r&&P>r)throw new Error(`Preset ${i.label}'s 'to' is after toYear ${m}.`);if(a){let S=(b=i.dateRange.from)==null?void 0:b.getMonth();if(S&&S<a.getMonth())throw new Error(`Preset ${i.label}'s 'from' is before fromMonth ${Pe(a,"MMM, yyyy")}.`)}if(l){let S=(y=i.dateRange.to)==null?void 0:y.getMonth();if(S&&S>l.getMonth())throw new Error(`Preset ${i.label}'s 'to' is after toMonth ${Pe(l,"MMM, yyyy")}.`)}if(c){let S=(h=i.dateRange.from)==null?void 0:h.getDate();if(S&&S<c.getDate())throw new Error(`Preset ${i.dateRange.from}'s 'from' is before fromDay ${Pe(c,"MMM dd, yyyy")}.`)}if(s){let S=(g=i.dateRange.to)==null?void 0:g.getDate();if(S&&S>s.getDate())throw new Error(`Preset ${i.label}'s 'to' is after toDay ${Pe(s,"MMM dd, yyyy")}.`)}}})}};import{cva as As}from"class-variance-authority";import{Calendar as Ds,ChevronDown as Is}from"lucide-react";import{forwardRef as zs}from"react";import{jsx as _t,jsxs as Vs}from"react/jsx-runtime";var Os=As(["group peer flex cursor-pointer appearance-none items-center gap-x-2 truncate rounded-md border px-3 h-10 outline-none transition-all text-sm","bg-white border-gray-200 text-gray-900 placeholder-gray-400 transition-all","disabled:pointer-events-none disabled:bg-gray-100 disabled:text-gray-400","focus-visible:border-gray-500 data-[state=open]:border-gray-500 data-[state=open]:ring-4 data-[state=open]:ring-gray-200"],{variants:{hasError:{true:"ring-2 ring-red-200 border-red-500"}}}),wr=zs(({className:e,children:t,placeholder:r,hasError:o,...a},l)=>Vs("button",{ref:l,className:n(Os({hasError:o}),e),...a,children:[_t(Ds,{className:n("h-4 w-4 shrink-0 text-gray-400",!!t&&"text-gray-900")}),_t("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-gray-900",children:t||(r?_t("span",{className:"text-gray-400",children:r}):null)}),_t(Is,{className:"h-4 w-4 flex-shrink-0 text-gray-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}));wr.displayName="DatePicker.Trigger";import{jsx as fe,jsxs as Fs}from"react/jsx-runtime";var Hs=({value:e,defaultValue:t,presetId:r,onChange:o,presets:a,disabled:l,disableNavigation:c,disabledDays:s,showYearNavigation:d=!1,locale:m=_s,placeholder:i="Select date range",hasError:p,align:f="center",className:b,...y})=>{let{isDesktop:h}=j(),[g,C]=Ht(!1),[P,S]=Ht(a&&r?a==null?void 0:a.find(({id:L})=>L===r):void 0),[k,x]=Ht((P==null?void 0:P.dateRange)??e??t??void 0),[v,R]=Ht(k==null?void 0:k.to),I=ba(()=>k,[g]);Cr(()=>{x(e)},[e]),Cr(()=>{let L=a==null?void 0:a.find(({id:de})=>de===r);S(L),x((L==null?void 0:L.dateRange)??e??t)},[a,r]),Cr(()=>{g?k&&R(k.to):R(k==null?void 0:k.to)},[g]);let D=(L,de)=>{let ee=(k==null?void 0:k.from)&&(k==null?void 0:k.to)?{from:de}:L;x(ee),S(void 0),(ee==null?void 0:ee.from)&&(ee==null?void 0:ee.to)&&(o==null||o(ee),C(!1))},q=L=>{x(L.dateRange),S(L),o==null||o(L.dateRange,L),C(!1)},w=()=>{x(I),C(!1)},z=L=>{L||w(),C(L)},ce=ba(()=>k?`${k.from?xr(k.from,m):""} - ${k.to?xr(k.to,m):""}`:null,[k,m]);return Ye((a==null?void 0:a.filter(L=>L.shortcut).map(L=>L.shortcut))??[],L=>{let de=a==null?void 0:a.find(ee=>ee.shortcut===L.key);de&&q(de)}),fe(yr.Provider,{value:{isOpen:g,setIsOpen:C},children:fe(Qe,{align:f,openPopover:g,setOpenPopover:z,popoverContentClassName:"rounded-xl",content:fe("div",{className:"flex w-full",children:Fs("div",{className:"scrollbar-hide flex w-full flex-col overflow-x-scroll sm:flex-row-reverse sm:items-start",children:[a&&a.length>0&&fe("div",{className:n("relative flex h-16 w-full items-center sm:h-full sm:w-48","border-b border-gray-200 sm:border-b-0 sm:border-l","scrollbar-hide overflow-auto"),children:fe("div",{className:"absolute px-3 sm:inset-0 sm:left-0 sm:p-3",children:fe(br,{currentValue:k,presets:a,onSelect:q})})}),fe("div",{className:"scrollbar-hide overflow-x-scroll",children:fe(ha,{mode:"range",selected:k,onSelect:D,month:v,onMonthChange:R,numberOfMonths:h?2:1,disabled:s,disableNavigation:c,showYearNavigation:d,locale:m,className:"scrollbar-hide overflow-x-scroll",classNames:{months:"flex flex-row divide-x divide-gray-200 overflow-x-scroll scrollbar-hide"},...y})})]})}),children:fe(wr,{placeholder:i,disabled:l,className:b,hasError:p,"aria-required":y.required||y["aria-required"],"aria-invalid":y["aria-invalid"],"aria-label":y["aria-label"],"aria-labelledby":y["aria-labelledby"],children:(P==null?void 0:P.label)??ce})})})};function Rh({presets:e,...t}){return e&&va(e,t),fe(Hs,{presets:e,...t})}import{jsx as Ft,jsxs as ya}from"react/jsx-runtime";function Dh({icon:e,title:t,description:r,learnMore:o,children:a}){return ya("div",{className:"flex flex-col items-center justify-center gap-y-4",children:[Ft("div",{className:"flex size-16 items-center justify-center rounded-2xl border border-gray-200 bg-gray-50",children:Ft(e,{className:"size-6 text-gray-800"})}),Ft("p",{className:"text-center text-base font-medium text-gray-950",children:t}),r&&ya("p",{className:"max-w-sm text-balance text-center text-sm text-gray-500",children:[r," ",o&&Ft("a",{href:o,target:"_blank",className:"underline underline-offset-2 hover:text-gray-800",children:"Learn more \u2197"})]}),a]})}import{cva as Bs}from"class-variance-authority";import{useState as xa}from"react";import{toast as wa}from"sonner";import{Fragment as Us,jsx as ge,jsxs as kr}from"react/jsx-runtime";var Nr={any:{types:[]},images:{types:["image/png","image/jpeg"],errorMessage:"File type not supported (.png or .jpg only)"},csv:{types:["text/csv"],errorMessage:"File type not supported (.csv only)"}},Ws=Bs("group relative isolate flex aspect-[1200/630] w-full flex-col items-center justify-center overflow-hidden bg-white transition-all hover:bg-gray-50",{variants:{variant:{default:"rounded-md border border-gray-300 shadow-sm",plain:""}},defaultVariants:{variant:"default"}});function Uh({readFile:e,onChange:t,variant:r,className:o,iconClassName:a,previewClassName:l,customPreview:c,accept:s="any",imageSrc:d,loading:m=!1,clickToUpload:i=!0,showHoverOverlay:p=!0,content:f,maxFileSizeMB:b=0,targetResolution:y,accessibilityLabel:h="File upload",disabled:g=!1}){let[C,P]=xa(!1),[S,k]=xa(null),x=async v=>{let R="dataTransfer"in v?v.dataTransfer.files&&v.dataTransfer.files[0]:v.target.files&&v.target.files[0];if(!R)return;if(k(R.name),b>0&&R.size/1024/1024>b){wa.error(`File size too big (max ${b} MB)`);return}let I=Nr[s].types;if(I.length&&!I.includes(R.type)){wa.error(Nr[s].errorMessage??"File type not supported");return}let D=R;if(y&&R.type.startsWith("image/"))try{let q=await Jr(R,y),w=await fetch(q).then(z=>z.blob());D=new File([w],R.name,{type:R.type})}catch(q){console.error("Error resizing image:",q)}if(e){let q=new FileReader;q.onload=w=>{var z;return t==null?void 0:t({src:(z=w.target)==null?void 0:z.result,file:D})},q.readAsDataURL(D);return}t==null||t({file:D})};return kr("label",{className:n(Ws({variant:r}),g?"cursor-not-allowed":n(i&&"cursor-pointer"),o),children:[m&&ge("div",{className:"absolute inset-0 z-[5] flex items-center justify-center rounded-[inherit] bg-white",children:ge(it,{})}),ge("div",{className:"absolute inset-0 z-[5]",onDragOver:v=>{v.preventDefault(),v.stopPropagation(),P(!0)},onDragEnter:v=>{v.preventDefault(),v.stopPropagation(),P(!0)},onDragLeave:v=>{v.preventDefault(),v.stopPropagation(),P(!1)},onDrop:async v=>{v.preventDefault(),v.stopPropagation(),x(v),P(!1)}}),kr("div",{className:n("absolute inset-0 z-[3] flex flex-col items-center justify-center rounded-[inherit] border-2 border-transparent bg-white transition-all",g&&"bg-gray-50",C&&!g&&"cursor-copy border-black bg-gray-50 opacity-100",d?n("opacity-0",p&&!g&&"group-hover:opacity-100"):n(!g&&"group-hover:bg-gray-50")),children:[ge(Ao,{className:n("size-7 transition-all duration-75",g?"text-gray-400":n("text-gray-500 group-hover:scale-110 group-active:scale-95",C?"scale-110":"scale-100"),a)}),f!==null&&ge("div",{className:n("mt-2 text-center text-sm text-gray-500",g&&"text-gray-400"),children:f??ge(Us,{children:kr("p",{children:["Drag and drop ",i&&"or click"," to upload."]})})}),ge("span",{className:"sr-only",children:h})]}),d&&(c??ge("img",{src:d,alt:"Preview",className:n("h-full w-full rounded-[inherit] object-cover",l)})),i&&ge("div",{className:"sr-only mt-1 flex shadow-sm",children:ge("input",{type:"file",accept:Nr[s].types.join(","),onChange:x,disabled:g},S)})]})}import{AnimatePresence as $s,motion as Ca}from"framer-motion";import{X as Gs}from"lucide-react";import{isValidElement as Ks}from"react";import{Fragment as js,jsx as X,jsxs as dt}from"react/jsx-runtime";function ka({filters:e,activeFilters:t,onRemove:r,onRemoveAll:o,className:a}){return Ye("Escape",o,{priority:1}),X(ye,{height:!0,className:"w-full",transition:{type:"tween",duration:.3},children:dt("div",{className:n("flex w-full flex-wrap items-start gap-4 sm:flex-nowrap",a),children:[X("div",{className:"flex grow flex-wrap gap-x-4 gap-y-2",children:X($s,{children:t==null?void 0:t.map(({key:l,value:c})=>{if(l==="loader")return X(Ca.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"h-9 w-48 animate-pulse rounded-md border border-gray-200 bg-white"},`loader-${c}`);let s=e.find(d=>d.key===l);return s?(s.multiple&&Array.isArray(c)?c:[c]).map(d=>{var f,b,y;let m=(f=s.options)==null?void 0:f.find(h=>typeof h.value=="string"&&typeof d=="string"?h.value.toLowerCase()===d.toLowerCase():h.value===d),i=(m==null?void 0:m.icon)??((b=s.getOptionIcon)==null?void 0:b.call(s,d,{key:s.key,option:m}))??s.icon,p=(m==null?void 0:m.label)??((y=s.getOptionLabel)==null?void 0:y.call(s,d,{key:s.key,option:m}))??d;return dt(Ca.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"flex items-center divide-x rounded-md border border-gray-200 bg-white text-sm text-black",children:[dt("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[X("span",{className:"shrink-0 text-gray-600",children:Na(s.icon)?s.icon:X(s.icon,{className:"h-4 w-4"})}),s.label]}),X("div",{className:"px-3 py-2 text-gray-500",children:"is"}),X("div",{className:"flex items-center gap-2.5 px-3 py-2",children:s.options?dt(js,{children:[X("span",{className:"shrink-0 text-gray-600",children:Na(i)?i:X(i,{className:"h-4 w-4"})}),Ct(p,30)]}):X("div",{className:"h-5 w-12 animate-pulse rounded-md bg-gray-200"})}),X("button",{type:"button",className:"h-full rounded-r-md p-2 text-gray-500 ring-inset ring-gray-500 hover:bg-gray-100 hover:text-gray-800 focus:outline-none focus-visible:ring-1",onClick:()=>r(l,d),children:X(Gs,{className:"h-3.5 w-3.5"})})]},`${l}-${d}`)}):(console.error("Filter.List received an activeFilter without a corresponding filter"),null)})})}),(t==null?void 0:t.length)!==0&&dt("button",{type:"button",className:"group mt-px flex items-center gap-2 whitespace-nowrap rounded-lg border border-transparent px-3 py-2 text-sm text-gray-500 ring-inset ring-gray-500 transition-colors hover:border-gray-200 hover:bg-white hover:text-black focus:outline-none",onClick:o,children:["Clear Filters",X("kbd",{className:"rounded-md border border-gray-200 px-1.5 py-0.5 text-xs text-gray-950 group-hover:bg-gray-50",children:"ESC"})]})]})})}var Na=e=>Ks(e);import{Command as Se,useCommandState as Ys}from"cmdk";import{ChevronDown as qs,ListFilter as Zs}from"lucide-react";import{Fragment as Qs,forwardRef as Js,isValidElement as Sa,useCallback as Bt,useEffect as Wt,useImperativeHandle as Xs,useRef as Sr,useState as Pr}from"react";import{Fragment as il,jsx as _,jsxs as he}from"react/jsx-runtime";function Ra({filters:e,onSelect:t,onRemove:r,onOpenFilter:o,onSearchChange:a,onSelectedFilterChange:l,activeFilters:c,askAI:s,children:d,emptyState:m,className:i}){var D,q;let{isMobile:p}=j(),f=Sr(null),b=Sr(),[y,h]=Pr(!1);Ye("f",()=>h(!0),{enabled:!y});let[g,C]=Pr(""),[P,S]=Pr(null),k=Bt(()=>{C(""),S(null)},[]);Wt(()=>{y||k()},[y]);let x=P?e.find(({key:w})=>w===P):null,v=Bt(w=>{f.current&&(b.current={width:f.current.clientWidth,height:f.current.clientHeight}),C(""),S(w),o==null||o(w)},[]),R=Bt(w=>{if(!x||!c)return!1;let z=c.find(({key:ce})=>ce===P);return(z==null?void 0:z.value)===w||z&&x.multiple&&Array.isArray(z.value)&&z.value.includes(w)},[x]),I=Bt(w=>{x&&(R(w)?r(x.key,w):t(x.key,w),x.multiple||h(!1))},[c,x,s]);return Wt(()=>{a==null||a(g)},[g]),Wt(()=>{l==null||l(P)},[P]),Wt(()=>{(x==null?void 0:x.options)&&f.current&&(b.current={width:f.current.clientWidth,height:f.current.clientHeight})},[x==null?void 0:x.options]),_(Qe,{openPopover:y,setOpenPopover:h,onEscapeKeyDown:w=>{P&&(w.preventDefault(),k())},content:_(ye,{width:!p,height:!0,className:"rounded-[inherit]",style:{transform:"translateZ(0)"},children:he(Se,{loop:!0,shouldFilter:!x||x.shouldFilter!==!1,children:[he("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-gray-200",children:[_(tl,{placeholder:`${(x==null?void 0:x.label)||"Filter"}...`,value:g,onValueChange:C,onKeyDown:w=>{(w.key==="Escape"||w.key==="Backspace"&&!g)&&(w.preventDefault(),w.stopPropagation(),P?k():h(!1))},emptySubmit:w=>{w.preventDefault(),w.stopPropagation(),s?(t("ai",x?`${x.label} ${g}`:g),h(!1)):I(g)}}),!x&&_("kbd",{className:"mr-2 hidden shrink-0 rounded border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-500 md:block",children:"F"})]}),_(rl,{ref:f,children:he(Se.List,{className:n("flex w-full flex-col gap-1 p-1",x?"min-w-[100px]":"min-w-[180px]"),children:[x?((q=(D=x.options)==null?void 0:D.filter(w=>!g||!w.hideDuringSearch))==null?void 0:q.map(w=>{let z=R(w.value);return _(Pa,{filter:x,option:w,right:z?_(ko,{className:"h-4 w-4"}):w.right,onSelect:()=>I(w.value)},w.value)}))??_(Se.Loading,{children:_("div",{className:"-m-1 flex items-center justify-center",style:b.current,children:_(be,{})})}):e.map(w=>he(Qs,{children:[_(Pa,{filter:w,onSelect:()=>v(w.key)}),w.separatorAfter&&_(Se.Separator,{className:"-mx-1 my-1 border-b border-gray-200"})]},w.key)),(!x||x.options)&&_(ol,{search:g,askAI:s,children:m?el(m)?(m==null?void 0:m[P??"default"])??"No matches":m:"No matches"})]})},P)]})}),children:he("button",{type:"button",className:n("group flex h-10 cursor-pointer appearance-none items-center gap-x-2 truncate rounded-md border px-3 text-sm outline-none transition-all","border-gray-200 bg-white text-gray-900 placeholder-gray-400","focus-visible:border-gray-500 data-[state=open]:border-gray-500 data-[state=open]:ring-4 data-[state=open]:ring-gray-200",i),children:[_(Zs,{className:"size-4 shrink-0"}),_("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-gray-900",children:d??"Filter"}),c!=null&&c.length?_("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-black text-[0.625rem] text-white",children:c.length}):_(qs,{className:"size-4 shrink-0 text-gray-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]})})}function el(e){return typeof e=="object"&&e!==null&&!Sa(e)}var tl=e=>{let t=Ys(r=>r.filtered.count===0);return _(Se.Input,{...e,size:1,className:"grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-gray-400 focus:ring-0 sm:text-sm",onKeyDown:r=>{var o,a;(o=e.onKeyDown)==null||o.call(e,r),r.key==="Enter"&&t&&((a=e.emptySubmit)==null||a.call(e,r))},autoCapitalize:"none"})},rl=Js(({children:e},t)=>{let r=Sr(null);Xs(t,()=>r.current);let{scrollProgress:o,updateScrollProgress:a}=qe(r);return he(il,{children:[_("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",ref:r,onScroll:a,children:e}),_("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(o,2)}})]})});function Pa({filter:e,option:t,right:r,onSelect:o}){var s,d;let{isMobile:a}=j(),l=t?t.icon??((s=e.getOptionIcon)==null?void 0:s.call(e,t.value,{key:e.key,option:t}))??e.icon:e.icon,c=t?t.label??((d=e.getOptionLabel)==null?void 0:d.call(e,t.value,{key:e.key,option:t})):e.label;return he(Se.Item,{className:n("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-gray-100"),onPointerDown:m=>{m.preventDefault()},onPointerUp:m=>{m.preventDefault(),a?setTimeout(o,100):o()},onSelect:o,value:c+(t==null?void 0:t.value),children:[_("span",{className:"shrink-0 text-gray-600",children:al(l)?l:_(l,{className:"h-4 w-4"})}),Ct(c,48),_("div",{className:"ml-1 flex shrink-0 grow justify-end text-gray-500",children:r})]})}var ol=({search:e,askAI:t,children:r})=>t&&e?he(Se.Empty,{className:"flex min-w-[180px] items-center space-x-2 rounded-md bg-gray-100 px-3 py-2",children:[_(io,{className:"h-4 w-4"}),he("p",{className:"text-center text-sm text-gray-600",children:["Ask AI ",he("span",{className:"text-black",children:['"',e,'"']})]})]}):_(Se.Empty,{className:"p-2 text-center text-sm text-gray-400",children:r}),al=e=>Sa(e);var p1={Select:Ra,List:ka};import{useMemo as nl,useState as Ma}from"react";import{jsx as Ve,jsxs as Ut}from"react/jsx-runtime";function x1({title:e,description:t,inputAttrs:r,helpText:o,buttonText:a="Save Changes",disabledTooltip:l,handleSubmit:c}){let[s,d]=Ma(r.defaultValue),[m,i]=Ma(!1),p=nl(()=>m||!s||s===r.defaultValue,[m,s,r.defaultValue]);return Ut("form",{onSubmit:async f=>{f.preventDefault(),i(!0),await c({[r.name]:s}),i(!1)},className:"rounded-lg border border-gray-200 bg-white",children:[Ut("div",{className:"relative flex flex-col space-y-6 p-5 sm:p-10",children:[Ut("div",{className:"flex flex-col space-y-3",children:[Ve("h2",{className:"text-xl font-medium",children:e}),Ve("p",{className:"text-sm text-gray-500",children:t})]}),typeof r.defaultValue=="string"?Ve("input",{...r,type:r.type||"text",required:!0,disabled:!!l,onChange:f=>d(f.target.value),className:n("w-full max-w-md rounded-md border border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm",{"cursor-not-allowed bg-gray-100 text-gray-400":l})}):Ve("div",{className:"h-[2.35rem] w-full max-w-md animate-pulse rounded-md bg-gray-200"})]}),Ut("div",{className:"flex items-center justify-between space-x-4 rounded-b-lg border-t border-gray-200 bg-gray-50 p-3 sm:px-10",children:[typeof o=="string"?Ve("p",{className:"prose-sm prose-a:underline prose-a:underline-offset-4 hover:prose-a:text-gray-700 text-gray-500 transition-colors",dangerouslySetInnerHTML:{__html:o||""}}):o,Ve("div",{className:"shrink-0",children:Ve(ie,{text:a,loading:m,disabled:p,disabledTooltip:l})})]})]})}import{useId as sl}from"react";import{jsx as $t,jsxs as ll}from"react/jsx-runtime";function La({cellSize:e=12,strokeWidth:t=1,patternOffset:r=[0,0],className:o}){let a=sl();return ll("svg",{className:n("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[$t("defs",{children:$t("pattern",{id:`grid-${a}`,x:r[0]-1,y:r[1]-1,width:e,height:e,patternUnits:"userSpaceOnUse",children:$t("path",{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"transparent",stroke:"currentColor",strokeWidth:t})})}),$t("rect",{fill:`url(#grid-${a})`,width:"100%",height:"100%"})]})}import{AlertCircle as cl}from"lucide-react";import dl,{useCallback as ml,useState as ul}from"react";import{jsx as _e,jsxs as Rr}from"react/jsx-runtime";var pl=dl.forwardRef(({className:e,type:t,...r},o)=>{let[a,l]=ul(!1),c=ml(()=>l(!a),[a,l]);return Rr("div",{children:[Rr("div",{className:"relative flex",children:[_e("input",{type:a?"text":t,className:n("w-full max-w-md rounded-md border border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm",r.error&&"border-red-500 focus:border-red-500 focus:ring-red-500",e),ref:o,...r}),Rr("div",{className:"group",children:[r.error&&_e("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex flex-none items-center px-2.5",children:_e(cl,{className:n("size-5 text-white",t==="password"&&"transition-opacity group-hover:opacity-0"),fill:"#ef4444"})}),t==="password"&&_e("button",{className:n("absolute inset-y-0 right-0 flex items-center px-3",r.error&&"opacity-0 transition-opacity group-hover:opacity-100"),type:"button",onClick:()=>c(),"aria-label":a?"Hide password":"Show Password",children:a?_e(Do,{className:"size-4 flex-none text-gray-500 transition hover:text-gray-700","aria-hidden":!0}):_e(Io,{className:"size-4 flex-none text-gray-500 transition hover:text-gray-700","aria-hidden":!0})})]})]}),r.error&&_e("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});pl.displayName="Input";import{flip as vl,offset as bl,size as yl,useDismiss as xl,useFloating as wl,useInteractions as Cl}from"@floating-ui/react";import{Command as we,useCommandState as Nl}from"cmdk";import{Check as kl,ChevronDown as Pl,Search as Mr,X as Sl}from"lucide-react";import{createContext as Rl,forwardRef as Ml,useContext as Dr,useEffect as Lr,useMemo as Ll,useRef as Ta,useState as Er}from"react";import{Drawer as Je}from"vaul";import fl from"next/image";import{useEffect as gl,useState as Ea}from"react";import{jsx as hl}from"react/jsx-runtime";function Gt(e){let[t,r]=Ea(!0),[o,a]=Ea(e.src);gl(()=>a(e.src),[e.src]);let l=c=>{r(!1);let s=c.target;s.naturalWidth<=16&&s.naturalHeight<=16&&a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)};return hl(fl,{...e,src:o,alt:e.alt,className:n(t?"blur-[2px]":"blur-0",e.className),onLoad:l,onError:()=>{a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)},unoptimized:!0})}import{jsx as M,jsxs as Q}from"react/jsx-runtime";var Kt=Rl({inputAttrs:{},openCommandList:!1,setOpenCommandList:()=>{},inputValue:"",setInputValue:()=>{},disabled:!1,selectedItem:null,setSelectedItem:()=>{}});function q1({items:e,selectedItem:t,setSelectedItem:r,className:o,disabled:a,adjustForMobile:l,icon:c,inputAttrs:s,noItemsElement:d}){let m=Ta(null),[i,p]=Er(!1),[f,b]=Er(""),[y,h]=Er(!1);Lr(()=>{i&&h(!1)},[i]),Lr(()=>h(!0),[f]),Lr(()=>{t&&b(t.value)},[t]);let g=Ll(()=>{let w=f.toLowerCase();return y?e.filter(z=>z.value.toLowerCase().includes(w)):f?e.sort((z,ce)=>(ce.value.toLowerCase().includes(w)?1:0)-(z.value.toLowerCase().includes(w)?1:0)):e},[y,f,e]),{refs:C,floatingStyles:P,context:S}=wl({open:i,onOpenChange:p,middleware:[bl(8),yl({apply({elements:{floating:w},availableHeight:z}){Object.assign(w.style,{maxHeight:`${Math.max(75,Math.min(z,290))}px`})},padding:8}),vl({fallbackStrategy:"initialPlacement",padding:8})]}),k=xl(S),{getReferenceProps:x,getFloatingProps:v}=Cl([k]),R=Ta(null),{scrollProgress:I,updateScrollProgress:D}=qe(R),{isMobile:q}=j();return M(Kt.Provider,{value:{inputAttrs:s||{},openCommandList:i,setOpenCommandList:p,inputValue:f,setInputValue:b,disabled:Boolean(a),selectedItem:t,setSelectedItem:r},children:q&&l?Q(Je.Root,{open:i,onOpenChange:p,children:[M(Je.Trigger,{className:"sm:hidden",asChild:!0,children:M(we,{ref:m,className:"relative",shouldFilter:!1,loop:!0,children:Q("div",{className:n("group relative rounded-md border border-gray-300 bg-white px-1 focus-within:border-gray-500 focus-within:ring-1 focus-within:ring-gray-500 md:min-w-[140px]",o),children:[M("div",{className:"absolute inset-y-0 left-0 flex items-center justify-center pl-3 text-gray-400",children:t&&t.image?M("img",{src:t.image,alt:t.value,className:"h-4 w-4 rounded-full"}):c||M(Mr,{className:"h-4 w-4 text-gray-400"})}),Q("div",{className:"flex h-10 px-8",children:[M(Tr,{}),M(Ar,{})]})]})})}),M(Je.Overlay,{className:"fixed inset-0 z-40 bg-gray-100 bg-opacity-10 backdrop-blur"}),Q(Je.Portal,{children:[M(Je.Content,{className:"fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-lg border-t border-gray-200 bg-white",onPointerDownOutside:w=>{w.target instanceof Element&&w.target.closest("[data-sonner-toast]")&&w.preventDefault()},children:Q(we,{ref:m,className:"relative",shouldFilter:!1,loop:!0,children:[Q("div",{className:n("group relative mb-2 rounded-t-md border-b border-gray-300 bg-white p-1 sm:border sm:py-0 sm:focus-within:border-gray-500 sm:focus-within:ring-1 sm:focus-within:ring-gray-200",o),children:[M("div",{className:"absolute inset-y-0 left-0 flex items-center justify-center pl-3 text-gray-400",children:t&&t.image?M("img",{src:t.image,alt:t.value,className:"h-4 w-4 rounded-full"}):c||M(Mr,{className:"h-4 w-4 text-gray-400"})}),Q("div",{className:"flex h-10 px-8",children:[M(Tr,{}),M(Ar,{})]})]}),i&&Q(we.List,{className:"dub-scrollbar h-[70vh] overflow-y-auto p-2",children:[e.length===0&&f===""&&(d?M("div",{children:d}):M("p",{className:"px-4 py-2 text-sm text-gray-600",children:"No items found."})),f!==""&&M(we.Empty,{className:"px-4 py-2 text-sm text-gray-600",children:"No results found."}),M(Aa,{items:g})]})]})}),M(Je.Overlay,{})]})]}):Q(we,{ref:m,className:"relative",shouldFilter:!1,loop:!0,children:[Q("div",{className:n("group rounded-md border border-gray-200 bg-white px-1 transition-all focus-within:border-gray-500 focus-within:ring-4 focus-within:ring-gray-200",o),children:[M("div",{onClick:()=>p(w=>!w),className:"absolute inset-y-0 left-0 flex cursor-pointer items-center justify-center pl-3 text-gray-400",children:t&&t.image?M("img",{src:t.image,alt:t.value,className:"h-4 w-4 rounded-full"}):c||M(Mr,{className:"h-4 w-4 text-gray-400"})}),Q("div",{className:"flex h-10 px-8",children:[M(Tr,{ref:C.setReference,...x()}),M(Ar,{})]})]}),i&&Q("div",{ref:C.setFloating,style:P,...v(),className:"z-20 flex w-full min-w-[160px] flex-col overflow-hidden rounded-md border border-gray-200 bg-white shadow-md",children:[Q("div",{ref:R,onScroll:D,className:"grow overflow-y-auto p-2",children:[Q(we.List,{children:[e.length===0&&f===""&&(d?M("div",{children:d}):M("p",{className:"px-4 py-2 text-sm text-gray-600",children:"No items found."})),f!==""&&M(we.Empty,{className:"px-4 py-2 text-sm text-gray-600",children:"No results found."})]}),M(Aa,{items:g})]}),M("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(I,2)}})]})]})})}var Tr=Ml((e,t)=>{let r=Nl(m=>m.filtered.count===0),{inputAttrs:o,openCommandList:a,setOpenCommandList:l,inputValue:c,setInputValue:s,disabled:d}=Dr(Kt);return M(we.Input,{ref:t,placeholder:(o==null?void 0:o.placeholder)||"Search...",autoFocus:a,onFocus:()=>l(!0),value:c,onValueChange:s,onKeyDown:m=>{m.key==="Escape"?(m.preventDefault(),l(!1)):m.key==="Enter"&&r?l(!1):m.key.match(/^[a-z0-9]$/i)&&!m.metaKey&&l(!0)},disabled:d,className:"block w-full truncate rounded-md border-none px-0 text-base text-gray-900 placeholder-gray-400 outline-none outline-0 transition-all duration-300 focus:ring-0 md:text-sm",autoCapitalize:"none"})});function Ar(){let{setSelectedItem:e,openCommandList:t,setOpenCommandList:r,inputValue:o,setInputValue:a}=Dr(Kt);return M("button",{type:"button",onClick:()=>{r(l=>!l),e(null),a("")},className:"absolute inset-y-0 right-0 my-auto pr-3",children:o.length>0?M(Sl,{className:"h-4 w-4 text-gray-400 transition-all hover:text-gray-700"}):M(Pl,{className:n("h-4 w-4 text-gray-400 transition-all hover:text-gray-700",{"rotate-180 transform":t})})})}function Aa({items:e}){let{setSelectedItem:t,setOpenCommandList:r,setInputValue:o}=Dr(Kt);return e.map(a=>Q(we.Item,{value:a.value,disabled:a.disabled,onSelect:()=>{t(a),o(a.value),r(!1)},className:"group flex cursor-pointer items-center justify-between rounded-md px-4 py-2 text-sm text-gray-900 hover:bg-gray-100 hover:text-gray-900 active:bg-gray-200 aria-disabled:cursor-not-allowed aria-disabled:opacity-75 aria-disabled:hover:bg-white aria-selected:bg-gray-100 aria-selected:text-gray-900",children:[Q("div",{className:"flex items-center space-x-2",children:[a.image&&M(Gt,{src:a.image,alt:a.value,className:"h-4 w-4 rounded-full",width:16,height:16}),M("p",{className:n("whitespace-nowrap py-0.5 text-sm",a.color&&"rounded-md px-2",a.color==="red"&&"bg-red-100 text-red-600",a.color==="yellow"&&"bg-yellow-100 text-yellow-600",a.color==="green"&&"bg-green-100 text-green-600",a.color==="blue"&&"bg-blue-100 text-blue-600",a.color==="purple"&&"bg-purple-100 text-purple-600",a.color==="brown"&&"bg-brown-100 text-brown-600"),children:a.value}),a.label&&M(Et,{className:"text-xs",variant:"neutral",children:a.label})]}),M(kl,{className:"invisible h-5 w-5 text-gray-500 aria-selected:visible"})]},a.id))}import*as Ir from"@radix-ui/react-label";import{cva as El}from"class-variance-authority";import*as Da from"react";import{jsx as Dl}from"react/jsx-runtime";var Tl=El("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Al=Da.forwardRef(({className:e,...t},r)=>Dl(Ir.Root,{ref:r,className:n(Tl(),e),...t}));Al.displayName=Ir.Root.displayName;import{curveNatural as Ia}from"@visx/curve";import{LinearGradient as za}from"@visx/gradient";import{Group as Il}from"@visx/group";import{ParentSize as zl}from"@visx/responsive";import{scaleLinear as Ol,scaleUtc as Vl}from"@visx/scale";import{Area as _l,AreaClosed as Hl}from"@visx/shape";import{motion as Oa}from"framer-motion";import{useId as Fl,useMemo as Va}from"react";import{jsx as ve,jsxs as zr}from"react/jsx-runtime";function lv(e){return ve(zl,{className:"relative",children:({width:t,height:r})=>t>0&&r>0&&ve(Bl,{...{width:t,height:r,...e}})})}var Re={top:8,right:2,bottom:2,left:2};function Bl({width:e,height:t,data:r,curve:o=!0,color:a}){let l=Fl(),c=Va(()=>r.map(({date:m})=>({date:m,value:0})),[r]),{yScale:s,xScale:d}=Va(()=>{let m=r.map(({value:y})=>y),i=Math.max(...m),p=r.map(({date:y})=>y.getTime()),f=new Date(Math.min(...p)),b=new Date(Math.max(...p));return{yScale:Ol({domain:[-2,Math.max(i,2)],range:[t-Re.top-Re.bottom,0],nice:!0,clamp:!0}),xScale:Vl({domain:[f,b],range:[0,e-Re.left-Re.right],nice:!0})}},[r,t,e]);return zr("svg",{width:e,height:t,children:[zr("defs",{children:[ve(za,{id:`${l}-color-gradient`,from:a||"#7D3AEC",to:a||"#DA2778",x1:0,x2:e-Re.left-Re.right,gradientUnits:"userSpaceOnUse"}),ve(za,{id:`${l}-mask-gradient`,from:"white",to:"white",fromOpacity:.3,toOpacity:0,x1:0,x2:0,y1:0,y2:1}),ve("mask",{id:`${l}-mask`,maskContentUnits:"objectBoundingBox",children:ve("rect",{width:"1",height:"1",fill:`url(#${l}-mask-gradient)`})})]}),zr(Il,{left:Re.left,top:Re.top,children:[ve(_l,{data:r,x:({date:m})=>d(m),y:({value:m})=>s(m)??0,curve:o?Ia:void 0,children:({path:m})=>ve(Oa.path,{initial:{d:m(c)||"",opacity:0},animate:{d:m(r)||"",opacity:1},strokeWidth:1.5,stroke:`url(#${l}-color-gradient)`})}),ve(Hl,{data:r,x:({date:m})=>d(m),y:({value:m})=>s(m)??0,yScale:s,curve:o?Ia:void 0,children:({path:m})=>ve(Oa.path,{initial:{d:m(c)||"",opacity:0},animate:{d:m(r)||"",opacity:1},fill:`url(#${l}-color-gradient)`,mask:`url(#${l}-mask)`})})]})]},r.length)}import*as ne from"@radix-ui/react-dialog";import*as Or from"@radix-ui/react-visually-hidden";import{useRouter as Wl}from"next/navigation";import{Drawer as He}from"vaul";import{jsx as oe,jsxs as Xe}from"react/jsx-runtime";function fv({children:e,className:t,showModal:r,setShowModal:o,onClose:a,desktopOnly:l,preventDefaultClose:c,drawerRootProps:s}){let d=Wl(),m=({dragged:p}={})=>{c&&!p||(a&&a(),o?o(!1):d.back())},{isMobile:i}=j();return i&&!l?oe(He.Root,{open:o?r:!0,onOpenChange:p=>{p||m({dragged:!0})},...s,children:Xe(He.Portal,{children:[oe(He.Overlay,{className:"fixed inset-0 z-50 bg-gray-100 bg-opacity-10 backdrop-blur"}),oe(He.Content,{onPointerDownOutside:p=>{p.target instanceof Element&&p.target.closest("[data-sonner-toast]")&&p.preventDefault()},className:n("fixed bottom-0 left-0 right-0 z-50 flex flex-col","rounded-t-[10px] border-t border-gray-200 bg-white",t),children:Xe("div",{className:"scrollbar-hide flex-1 overflow-y-auto rounded-t-[10px] bg-inherit",children:[Xe(Or.Root,{children:[oe(He.Title,{children:"Modal"}),oe(He.Description,{children:"This is a modal"})]}),oe(Ul,{}),e]})}),oe(He.Overlay,{})]})}):oe(ne.Root,{open:o?r:!0,onOpenChange:p=>{p||m()},children:Xe(ne.Portal,{children:[oe(ne.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-gray-100 bg-opacity-50 backdrop-blur-md"}),Xe(ne.Content,{onOpenAutoFocus:p=>p.preventDefault(),onCloseAutoFocus:p=>p.preventDefault(),onPointerDownOutside:p=>{p.target instanceof Element&&p.target.closest("[data-sonner-toast]")&&p.preventDefault()},className:n("fixed inset-0 z-40 m-auto h-fit w-full max-w-md","border border-gray-200 bg-white p-0 shadow-xl sm:rounded-2xl","scrollbar-hide animate-scale-in overflow-y-auto",t),children:[Xe(Or.Root,{children:[oe(ne.Title,{children:"Modal"}),oe(ne.Description,{children:"This is a modal"})]}),e]})]})})}function Ul(){return oe("div",{className:"sticky top-0 z-20 flex items-center justify-center rounded-t-[10px] bg-inherit",children:oe("div",{className:"my-3 h-1 w-12 rounded-full bg-gray-300"})})}import{Fragment as $l,jsx as jt,jsxs as et}from"react/jsx-runtime";var _a=n("flex h-7 items-center justify-center gap-2 whitespace-nowrap rounded-md border border-gray-200 bg-white px-2 text-sm text-gray-600","outline-none hover:bg-gray-50 focus-visible:border-gray-500","disabled:cursor-not-allowed disabled:border-gray-200 disabled:text-gray-400 disabled:bg-gray-100");function vv({pagination:e,setPagination:t,totalCount:r,unit:o=c=>`item${c?"s":""}`,className:a,children:l}){return et("div",{className:n("flex items-center justify-between gap-2 text-sm leading-6 text-gray-600",a),children:[et("div",{className:"flex items-center gap-2",children:[et("div",{children:[jt("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",r>0&&et($l,{children:[et("span",{className:"font-medium",children:[(e.pageIndex-1)*e.pageSize+1,"-",Math.min((e.pageIndex-1)*e.pageSize+e.pageSize,r)]})," ","of"," "]}),jt("span",{className:"font-medium",children:xt(r,{full:!0})})," ",typeof o=="function"?o(r!==1):o]}),l]}),et("div",{className:"flex items-center gap-2",children:[jt("button",{type:"button",className:_a,onClick:()=>t({...e,pageIndex:e.pageIndex-1}),disabled:e.pageIndex===1,children:"Previous"}),jt("button",{type:"button",className:_a,onClick:()=>t({...e,pageIndex:e.pageIndex+1}),disabled:(e.pageIndex-1)*e.pageSize+e.pageSize>=r,children:"Next"})]})]})}import*as Me from"@radix-ui/react-radio-group";import{Circle as Gl}from"lucide-react";import*as Vr from"react";import{jsx as Yt}from"react/jsx-runtime";var Kl=Vr.forwardRef(({className:e,...t},r)=>Yt(Me.Root,{className:n("grid gap-2",e),...t,ref:r}));Kl.displayName=Me.Root.displayName;var jl=Vr.forwardRef(({className:e,...t},r)=>Yt(Me.Item,{ref:r,className:n("border-primary text-primary ring-offset-background focus-visible:ring-ring aspect-square h-4 w-4 rounded-full border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:Yt(Me.Indicator,{className:"flex items-center justify-center",children:Yt(Gl,{className:"h-2.5 w-2.5 fill-current text-current"})})}));jl.displayName=Me.Item.displayName;import{Drawer as Le}from"vaul";import{jsx as Fe,jsxs as Jl}from"react/jsx-runtime";function Yl({children:e,contentProps:t,nested:r=!1,...o}){let a=r?Le.NestedRoot:Le.Root;return Fe(a,{direction:"right",handleOnly:!0,...o,children:Jl(Le.Portal,{children:[Fe(Le.Overlay,{className:"fixed inset-0 bg-black/20"}),Fe(Le.Content,{...t,onPointerDownOutside:l=>{var c;l.target instanceof Element&&l.target.closest("[data-sonner-toast]")&&l.preventDefault(),(c=t==null?void 0:t.onPointerDownOutside)==null||c.call(t,l)},className:n("fixed bottom-2 right-2 top-2 z-10 flex w-[calc(100%-16px)] outline-none md:w-[540px]",t==null?void 0:t.className),style:{"--initial-transform":"calc(100% + 8px)","user-select":"auto",...t==null?void 0:t.style},children:Fe("div",{className:"scrollbar-hide flex size-full grow flex-col overflow-y-auto rounded-lg bg-white",children:e})})]})})}function ql({className:e,...t}){return Fe(Le.Title,{className:n("text-xl font-medium text-zinc-900",e),...t})}function Zl(e){return Fe(Le.Description,{...e})}function Ql(e){return Fe(Le.Close,{...e})}var Pv=Object.assign(Yl,{Title:ql,Description:Zl,Close:Ql});import{useEffect as Xl,useRef as ec,useState as tc}from"react";import{jsx as Ha}from"react/jsx-runtime";var rc=`
2
+ import{$ as Cm,$a as lu,$b as Zu,A as wo,Aa as Eo,Ab as Mu,Ac as yp,B as Zd,Ba as To,Bb as Lu,Bc as xp,C as Qd,Ca as Bm,Cb as Eu,Cc as wp,D as Jd,Da as Wm,Db as Tu,Dc as Cp,E as Xd,Ea as cr,Eb as Au,Ec as Np,F as em,Fa as Um,Fb as Fo,Fc as kp,G as tm,Ga as $m,Gb as Bo,Gc as Pp,H as rm,Ha as Gm,Hb as Wo,Hc as Sp,I as om,Ia as Ao,Ib as Du,Ic as Rp,J as am,Ja as Km,Jb as Iu,Jc as Mp,K as im,Ka as jm,Kb as zu,Kc as Lp,L as nm,La as Ym,Lb as Uo,Lc as Ep,M as sm,Ma as kt,Mb as Ou,Mc as Tp,N as lm,Na as qm,Nb as Vu,Nc as Ap,O as cm,Oa as Zm,Ob as _u,Oc as Dp,P as dm,Pa as Qm,Pb as Hu,Pc as Ip,Q as mm,Qa as Jm,Qb as $o,Qc as zp,R as um,Ra as Xm,Rb as Fu,Rc as Op,S as pm,Sa as eu,Sb as Bu,Sc as Vp,T as fm,Ta as tu,Tb as Wu,Tc as _p,U as gm,Ua as Pt,Ub as Uu,Uc as Hp,V as hm,Va as ru,Vb as $u,Vc as Fp,W as vm,Wa as ou,Wb as Gu,Wc as Bp,X as bm,Xa as au,Xb as Ku,Xc as Wp,Y as ym,Ya as iu,Yb as ju,Yc as Up,Z as xm,Za as nu,Zb as Yu,_ as wm,_a as su,_b as qu,a as oo,aa as Nm,ab as cu,ac as Qu,b as ao,ba as km,bb as du,bc as Go,c as io,ca as Pm,cb as mu,cc as Ju,d as Ud,da as Sm,db as Do,dc as Xu,e as no,ea as Rm,eb as Io,ec as ep,f as so,fa as Co,fb as zo,fc as tp,g as lo,ga as Mm,gb as uu,gc as rp,h as co,ha as Lm,hb as pu,hc as op,i as it,ia as Em,ib as fu,ic as ap,j as $d,ja as No,jb as gu,jc as St,k as be,ka as Tm,kb as hu,kc as ip,l as Gd,la as Am,lb as Oo,lc as np,m as mo,ma as Dm,mb as vu,mc as sp,n as Kd,na as Im,nb as bu,nc as lp,o as uo,oa as zm,ob as yu,oc as Ko,p as jd,pa as Om,pb as xu,pc as cp,q as po,qa as Vm,qb as wu,qc as dp,r as fo,ra as ko,rb as Cu,rc as jo,s as Yd,sa as Po,sb as Nu,sc as mp,t as go,ta as So,tb as ku,tc as up,u as qd,ua as Ro,ub as Vo,uc as pp,v as ho,va as Mo,vb as Pu,vc as fp,w as vo,wa as _m,wb as Su,wc as gp,x as bo,xa as Hm,xb as _o,xc as hp,y as yo,ya as Fm,yb as Ru,yc as vp,z as xo,za as Lo,zb as Ho,zc as bp}from"./chunk-AEEIAOKR.mjs";import{a as j}from"./chunk-NWME2ANF.mjs";import{a as qr,b as V,c as xt,d as wt,e as Zr,f as Ue,g as Qr,h as Jr,i as Ct,j as Xr,k as eo,l as Nt,m as to,n as me,o as n,p as ro}from"./chunk-LPRQFZ6K.mjs";import*as ae from"@radix-ui/react-accordion";import{ChevronDown as Ci}from"lucide-react";import*as Mt from"react";import{jsx as Rt,jsxs as Si}from"react/jsx-runtime";var qp=ae.Root,Ni=Mt.forwardRef(({className:e,...t},r)=>Rt(ae.Item,{ref:r,className:n("border-b border-b-slate-200 py-3 last:border-none",e),...t}));Ni.displayName="AccordionItem";var ki=Mt.forwardRef(({className:e,children:t,variant:r="chevron",...o},a)=>{let l=r==="chevron"?Ci:St;return Rt(ae.Header,{className:"flex",children:Si(ae.Trigger,{ref:a,className:n("flex flex-1 items-center justify-between font-medium transition-all sm:text-lg",{"[&[data-state=open]>svg]:rotate-180":r==="chevron","[&[data-state=open]>svg]:rotate-45":r==="plus"},e),...o,children:[t,Rt(l,{className:"h-5 w-5 flex-none transition-transform duration-300"})]})})});ki.displayName=ae.Trigger.displayName;var Pi=Mt.forwardRef(({className:e,children:t,...r},o)=>Rt(ae.Content,{ref:o,className:n("data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-gray-500 transition-all sm:text-base",e),...r,children:t}));Pi.displayName=ae.Content.displayName;import{cva as Ri}from"class-variance-authority";import*as Lt from"react";import{jsx as dr}from"react/jsx-runtime";var Mi=Ri("relative w-full rounded-lg border px-4 py-6 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive border-red-500 dark:border-red-500"}},defaultVariants:{variant:"default"}}),Li=Lt.forwardRef(({className:e,variant:t,...r},o)=>dr("div",{ref:o,role:"alert",className:n(Mi({variant:t}),e),...r}));Li.displayName="Alert";var Ei=Lt.forwardRef(({className:e,...t},r)=>dr("h5",{ref:r,className:n("text-md mb-2 font-medium leading-none tracking-tight",e),...t}));Ei.displayName="AlertTitle";var Ti=Lt.forwardRef(({className:e,...t},r)=>dr("div",{ref:r,className:n("text-sm [&_p]:leading-relaxed",e),...t}));Ti.displayName="AlertDescription";import{sha256 as Ai}from"js-sha256";import{useState as Di}from"react";import{jsx as mr}from"react/jsx-runtime";function Ii(e){if(e!=null&&e.image)return e.image;if(!(e!=null&&e.id))return"https://api.dicebear.com/9.x/micah/svg";let t=`https://api.dicebear.com/9.x/micah/svg?seed=${encodeURIComponent(e.id)}`,r=`https://api.dicebear.com/9.x/micah/png/${encodeURIComponent(`seed=${encodeURIComponent(e.id)}`)}`;return e.email?`https://www.gravatar.com/avatar/${Ai(e.email)}?d=${encodeURIComponent(r)}`:t}function o0({user:e={},className:t}){if(!e)return mr("div",{className:n("h-10 w-10 animate-pulse rounded-full border border-gray-300 bg-gray-100",t)});let[r,o]=Di(Ii(e));return mr("img",{alt:`Avatar for ${e.name||e.email}`,referrerPolicy:"no-referrer",src:r,className:n("h-10 w-10 rounded-full border border-gray-300",t),draggable:!1,onError:()=>{o(`https://api.dicebear.com/9.x/micah/svg?seed=${encodeURIComponent(e.id||"")}`)}})}function a0({id:e,className:t}){return mr("img",{src:`https://api.dicebear.com/9.x/shapes/svg?seed=${e}`,alt:"avatar",className:n("h-10 w-10 rounded-full",t),draggable:!1})}import{cva as zi}from"class-variance-authority";import{jsx as Vi}from"react/jsx-runtime";var Oi=zi("max-w-fit rounded-full border px-2 py-px text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"border-gray-400 text-gray-500",violet:"border-violet-600 bg-violet-600 text-white",blue:"border-blue-500 bg-blue-500 text-white",sky:"border-sky-900 bg-sky-900 text-white",black:"border-black bg-black text-white",gray:"border-gray-200 bg-gray-100 text-gray-800",neutral:"border-gray-400 text-gray-500",blueGradient:"bg-gradient-to-r from-blue-100 via-blue-100/50 to-blue-100 border border-blue-200 text-blue-900",rainbow:"bg-gradient-to-r from-violet-600 to-pink-600 text-white border-transparent"}},defaultVariants:{variant:"neutral"}});function Et({className:e,variant:t,...r}){return Vi("span",{className:n(Oi({variant:t}),e),...r})}import{cva as Wi}from"class-variance-authority";import{forwardRef as Ui}from"react";import*as ue from"@radix-ui/react-tooltip";import _i from"linkify-react";import{HelpCircle as Hi}from"lucide-react";import Fi from"next/link";import{useState as Bi}from"react";import{jsx as U,jsxs as $e}from"react/jsx-runtime";function b0({children:e}){return U(ue.Provider,{delayDuration:150,children:e})}function te({children:e,content:t,contentClassName:r,side:o="top",disableHoverableContent:a,...l}){let[c,s]=Bi(!1);return $e(ue.Root,{open:c,onOpenChange:s,delayDuration:0,disableHoverableContent:a,children:[U(ue.Trigger,{asChild:!0,onClick:()=>{s(!0)},onBlur:()=>{s(!1)},children:e}),U(ue.Portal,{children:U(ue.Content,{sideOffset:8,side:o,className:"animate-slide-up-fade z-[99] items-center overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm",collisionPadding:0,...l,children:typeof t=="string"?U("span",{className:n("block max-w-xs text-pretty px-4 py-2 text-center text-sm text-gray-700",r),children:t}):typeof t=="function"?t({setOpen:s}):t})})]})}function y0({title:e,cta:t,href:r,target:o,onClick:a}){return $e("div",{className:"flex max-w-xs flex-col items-center space-y-3 p-4 text-center",children:[U("p",{className:"text-sm text-gray-700",children:e}),t&&(r?U(Fi,{href:r,...o?{target:o}:{},className:n(pe({variant:"primary"}),"flex h-9 w-full items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm"),children:t}):a?U(ie,{onClick:a,text:t,variant:"primary",className:"h-9"}):null)]})}function x0({title:e,cta:t,href:r}){return $e("div",{className:"max-w-xs px-4 py-2 text-center text-sm text-gray-700",children:[e," ",U("a",{href:r,target:"_blank",rel:"noopener noreferrer",onClick:o=>o.stopPropagation(),className:"inline-flex text-gray-500 underline underline-offset-4 hover:text-gray-800",children:t})]})}function w0({children:e}){return U("div",{className:"block max-w-md whitespace-pre-wrap px-4 py-2 text-center text-sm text-gray-700",children:U(_i,{as:"p",options:{target:"_blank",rel:"noopener noreferrer nofollow",className:"underline underline-offset-4 text-gray-400 hover:text-gray-700"},children:e})})}function C0(e){return U(te,{...e,children:U(Hi,{className:"h-4 w-4 text-gray-500"})})}function N0({value:e,unit:t="total clicks",prefix:r,children:o,lastClicked:a}){return(!e||e<1e3)&&!a?o:U(te,{content:$e("div",{className:"block max-w-xs px-4 py-2 text-center text-sm text-gray-700",children:[$e("p",{className:"text-sm font-semibold text-gray-700",children:[r,xt(e||0,{full:!0})," ",t]}),a&&$e("p",{className:"mt-1 text-xs text-gray-500",suppressHydrationWarning:!0,children:["Last clicked ",eo(a,{withAgo:!0})]})]}),children:o})}function k0({children:e,content:t,...r}){return U(te,{content:t,...r,children:U("div",{className:"flex cursor-pointer items-center",children:U(Et,{variant:"gray",className:"border-gray-300 transition-all hover:bg-gray-200",children:e})})})}function P0({children:e,tooltipProps:t,...r}){return U(te,{...t,children:U("button",{type:"button",...r,className:n("flex h-6 w-6 items-center justify-center rounded-md text-gray-500 transition-colors duration-75 hover:bg-gray-100 active:bg-gray-200 disabled:cursor-not-allowed disabled:hover:bg-transparent",r.className),children:e})})}import{jsx as Ge,jsxs as Yo}from"react/jsx-runtime";var pe=Wi("transition-all",{variants:{variant:{primary:"border-black bg-black text-white hover:bg-gray-800 hover:ring-4 hover:ring-gray-200",secondary:n("border-gray-200 bg-white text-gray-900 hover:bg-gray-50 focus-visible:border-gray-500 outline-none","data-[state=open]:border-gray-500 data-[state=open]:ring-4 data-[state=open]:ring-gray-200"),outline:"border-transparent text-neutral-600 hover:bg-neutral-100",success:"border-blue-500 bg-blue-500 text-white hover:bg-blue-600 hover:ring-4 hover:ring-blue-100",danger:"border-red-500 bg-red-500 text-white hover:bg-red-600 hover:ring-4 hover:ring-red-100","danger-outline":"border-transparent bg-white text-red-500 hover:bg-red-600 hover:text-white"}},defaultVariants:{variant:"primary"}}),ie=Ui(({text:e,variant:t="primary",className:r,textWrapperClassName:o,loading:a,icon:l,shortcut:c,disabledTooltip:s,right:d,...m},i)=>s?Ge(te,{content:s,children:Yo("div",{className:n("flex h-10 w-full cursor-not-allowed items-center justify-center gap-x-2 rounded-md border border-gray-200 bg-gray-100 px-4 text-sm text-gray-400 transition-all focus:outline-none",{"border-transparent bg-transparent":t==null?void 0:t.endsWith("outline")},r),children:[l,e&&Ge("div",{className:n("min-w-0 truncate",c&&"flex-1 text-left",o),children:e}),c&&Ge("kbd",{className:n("hidden rounded border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-400 md:inline-block",{"bg-gray-100":t==null?void 0:t.endsWith("outline")}),children:c})]})}):Yo("button",{ref:i,type:m.onClick?"button":"submit",className:n("group flex h-10 w-full items-center justify-center gap-2 whitespace-nowrap rounded-md border px-4 text-sm",m.disabled||a?"cursor-not-allowed border-gray-200 bg-gray-100 text-gray-400 outline-none":pe({variant:t}),r),disabled:m.disabled||a,...m,children:[a?Ge(be,{}):l||null,e&&Ge("div",{className:n("min-w-0 truncate",c&&"flex-1 text-left",o),children:e}),c&&Ge("kbd",{className:n("hidden rounded px-2 py-0.5 text-xs font-light transition-all duration-75 md:inline-block",{"bg-gray-700 text-gray-400 group-hover:bg-gray-600 group-hover:text-gray-300":t==="primary","bg-gray-200 text-gray-400 group-hover:bg-gray-100 group-hover:text-gray-500":t==="secondary","bg-gray-100 text-gray-500 group-hover:bg-gray-200":t==="outline","bg-red-100 text-red-600 group-hover:bg-red-500 group-hover:text-white":t==="danger-outline"}),children:c}),d]}));ie.displayName="Button";import{cva as $i}from"class-variance-authority";import{createContext as Gi}from"react";import{jsx as qo}from"react/jsx-runtime";var Ki=$i("group/card-list w-full flex flex-col transition-[gap,opacity] min-w-0",{variants:{variant:{compact:"gap-0",loose:"gap-4"},loading:{true:"opacity-50"}}}),nt=Gi({variant:"loose"});function Zo({variant:e="loose",loading:t=!1,className:r,children:o}){return qo("ul",{className:n(Ki({variant:e,loading:t}),r),"data-variant":e,children:qo(nt.Provider,{value:{variant:e},children:o})})}import{cva as ji}from"class-variance-authority";import{createContext as Yi,useContext as qi,useEffect as Zi,useRef as Qi,useState as Ji}from"react";import{jsx as ur}from"react/jsx-runtime";var Xi=ji("w-full group/card border-gray-200 bg-white",{variants:{variant:{compact:"first-of-type:rounded-t-xl last-of-type:rounded-b-xl first-of-type:border-t border-b border-x data-[hover-state-enabled=true]:hover:bg-gray-50 transition-colors",loose:"border rounded-xl transition-[filter] data-[hover-state-enabled=true]:hover:drop-shadow-card-hover"}}}),en="w-full py-2.5 px-4",pr=Yi({hovered:!1});function Qo({outerClassName:e,innerClassName:t,children:r,onClick:o,hoverStateEnabled:a=!0}){let{variant:l}=qi(nt),c=Qi(null),[s,d]=Ji(!1);return Zi(()=>{if(!s||!c.current)return;let m=setInterval(()=>{var i;((i=c.current)==null?void 0:i.matches(":hover"))===!1&&d(!1)},1e3);return()=>clearInterval(m)},[s]),ur("li",{ref:c,className:n(Xi({variant:l}),e),onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),"data-hover-state-enabled":a,children:ur("div",{className:n(en,t),onClick:o?m=>{document.getElementById("modal-backdrop")||Nt(m)||o()}:void 0,children:ur(pr.Provider,{value:{hovered:s},children:r})})})}var q0=Object.assign(Zo,{Card:Object.assign(Qo,{Context:pr}),Context:nt});import{cva as tn}from"class-variance-authority";import rn from"embla-carousel-autoplay";import on from"embla-carousel-react";import{motion as an}from"framer-motion";import{ArrowLeft as nn,ArrowRight as sn,ChevronLeft as ln,ChevronRight as cn}from"lucide-react";import*as T from"react";import{jsx as Z,jsxs as ze}from"react/jsx-runtime";var Jo=2e3,Xo=T.createContext(null);function Ke(){let e=T.useContext(Xo);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function nf(){let{api:e}=Ke(),[t,r]=T.useState(0),o=T.useCallback(a=>r((a==null?void 0:a.selectedScrollSnap())??0),[]);return T.useEffect(()=>{!e||(o(e),e.on("reInit",o),e.on("select",o))},[e,o]),t}var dn=T.forwardRef(({orientation:e="horizontal",opts:t,setApi:r,autoplay:o,plugins:a,className:l,children:c,...s},d)=>{let[m,i]=on({...t,axis:e==="horizontal"?"x":"y"},[...o?[rn(typeof o=="object"?o:{delay:Jo})]:[],...a||[]]),[p,f]=T.useState(!1),[b,y]=T.useState(!1),h=T.useCallback(S=>{!S||(f(S.canScrollPrev()),y(S.canScrollNext()))},[]),g=T.useCallback(()=>{i==null||i.scrollPrev()},[i]),C=T.useCallback(()=>{i==null||i.scrollNext()},[i]),P=T.useCallback(S=>{S.key==="ArrowLeft"?(S.preventDefault(),g()):S.key==="ArrowRight"&&(S.preventDefault(),C())},[g,C]);return T.useEffect(()=>{!i||!r||r(i)},[i,r]),T.useEffect(()=>{if(!!i)return h(i),i.on("reInit",h),i.on("select",h),()=>{i==null||i.off("select",h)}},[i,h]),Z(Xo.Provider,{value:{carouselRef:m,api:i,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:g,scrollNext:C,canScrollPrev:p,canScrollNext:b},children:Z("div",{ref:d,onKeyDownCapture:P,className:n("relative",l),role:"region","aria-roledescription":"carousel",...s,children:c})})});dn.displayName="Carousel";var mn=T.forwardRef(({className:e,...t},r)=>{let{carouselRef:o,orientation:a}=Ke();return Z("div",{ref:o,className:"overflow-hidden",children:Z("div",{ref:r,className:n("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});mn.displayName="CarouselContent";var un=T.forwardRef(({className:e,...t},r)=>{let{orientation:o}=Ke();return Z("div",{ref:r,role:"group","aria-roledescription":"slide",className:n("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",e),...t})});un.displayName="CarouselItem";var pn=T.forwardRef(({className:e,...t},r)=>{let{orientation:o,scrollPrev:a,canScrollPrev:l}=Ke();return ze("button",{ref:r,className:n("absolute",o==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",pe({variant:"secondary",className:"p-2"}),e),disabled:!l,onClick:a,...t,children:[Z(nn,{className:"h-4 w-4"}),Z("span",{className:"sr-only",children:"Previous slide"})]})});pn.displayName="CarouselPrevious";var fn=T.forwardRef(({className:e,...t},r)=>{let{orientation:o,scrollNext:a,canScrollNext:l}=Ke();return ze("button",{ref:r,className:n("absolute",o==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",pe({variant:"secondary",className:"p-2"}),e),disabled:!l,onClick:a,...t,children:[Z(sn,{className:"h-4 w-4"}),Z("span",{className:"sr-only",children:"Next slide"})]})});fn.displayName="CarouselNext";var gn=tn("flex items-center justify-center gap-3 sm:gap-6",{variants:{variant:{simple:"relative",floating:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full border border-gray-800/10 bg-white sm:bottom-6 "}}}),sf=({variant:e="simple",className:t})=>{var y;let{scrollNext:r,scrollPrev:o,canScrollNext:a,canScrollPrev:l,api:c}=Ke(),s=(y=c==null?void 0:c.plugins())==null?void 0:y.autoplay,[d,m]=T.useState(0),[i,p]=T.useState(!1),f=T.useCallback(h=>{m((h==null?void 0:h.selectedScrollSnap())??0)},[]),b=T.useCallback(h=>()=>{s&&s.isPlaying()&&s.stop(),h()},[s]);return T.useEffect(()=>{!c||(f(c),p((s==null?void 0:s.isPlaying())??!1),c.on("reInit",f),c.on("select",f),c.on("autoplay:play",()=>p(!0)),c.on("autoplay:stop",()=>p(!1)))},[c,s,f]),ze("div",{className:n(gn({variant:e}),t),children:[e!=="simple"&&ze("button",{className:"cursor-pointer rounded-full p-2 hover:bg-gray-50 active:bg-gray-100",disabled:!l,onClick:b(o),children:[Z(ln,{className:"h-4 w-4"}),Z("span",{className:"sr-only",children:"Previous slide"})]}),c!=null&&Z("div",{className:"flex items-center gap-1",children:c.slideNodes().map((h,g)=>ze("button",{onClick:b(()=>c.scrollTo(g)),className:"rounded-full p-0.5 hover:bg-gray-100 active:bg-gray-200 sm:p-1.5",children:[Z("div",{className:n("relative isolate h-1.5 w-1.5 overflow-hidden rounded-full transition-all",g===d?"bg-black":"bg-black/20",i&&g===d&&"w-6 bg-black/20"),children:i&&g===d&&Z(an.div,{initial:{x:"-100%"},animate:{x:0},transition:{type:"tween",duration:((s==null?void 0:s.options.delay)??Jo)/1e3},className:"animate-fill-width h-full w-full rounded-full bg-black"})}),ze("span",{className:"sr-only",children:["Slide ",g+1]})]},g))}),e!=="simple"&&ze("button",{className:"cursor-pointer rounded-full p-2 hover:bg-gray-50 active:bg-gray-100",disabled:!a,onClick:b(r),children:[Z(cn,{className:"h-4 w-4"}),Z("span",{className:"sr-only",children:"Next slide"})]})]})};import*as st from"@radix-ui/react-checkbox";import{Check as hn}from"lucide-react";import*as ea from"react";import{jsx as fr}from"react/jsx-runtime";var vn=ea.forwardRef(({className:e,...t},r)=>fr(st.Root,{ref:r,className:n("peer h-5 w-5 shrink-0 rounded-md border border-gray-200 bg-white outline-none focus-visible:border-black disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500",e),...t,children:fr(st.Indicator,{className:"flex items-center justify-center",children:fr(hn,{className:"h-3 w-3 text-white"})})}));vn.displayName=st.Root.displayName;import{Command as zt,CommandInput as is,CommandItem as ns,useCommandState as ss}from"cmdk";import{ChevronDown as ls}from"lucide-react";import{forwardRef as cs,isValidElement as ds,useCallback as ms,useEffect as It,useRef as us,useState as lt}from"react";import{motion as rs}from"framer-motion";import{forwardRef as os,useRef as as}from"react";import gr from"js-cookie";import{useEffect as bn,useState as yn}from"react";function ff(e,t,r){let[o,a]=yn(()=>{let c=gr.get(e);return c?JSON.parse(c):t});return bn(()=>{let c=()=>{let s=gr.get(e);s&&a(JSON.parse(s))};return window.addEventListener("storage",c),()=>{window.removeEventListener("storage",c)}},[e]),[o,c=>{a(c),gr.set(e,JSON.stringify(c),r)}]}import{useCallback as xn,useEffect as wn,useRef as Cn,useState as Nn}from"react";var je=(e=3e3)=>{let t=Cn(null),[r,o]=Nn(!1),a=()=>{t.current&&(clearTimeout(t.current),t.current=null)},l=xn(async c=>{a();try{typeof c=="string"?await navigator.clipboard.writeText(c):c instanceof ClipboardItem&&await navigator.clipboard.write([c]),o(!0),Number.isFinite(e)&&e>=0&&(t.current=setTimeout(()=>o(!1),e))}catch(s){console.error("Failed to copy: ",s)}},[e]);return wn(()=>()=>a(),[]),[r,l]};import{useEffect as kn,useState as Pn}from"react";function yf(){let[e,t]=Pn(null);return kn(()=>{let r=document.querySelector("[data-mdx-container]");if(!r)return;let o=r.offsetTop-1,a=new IntersectionObserver(s=>{var p,f,b;let d=s[0];if(!d)return;let m=(((p=d.rootBounds)==null?void 0:p.height)||0)*.3+o;for(let y=1;y<s.length;y++){let h=s[y];if(!h)break;(h.boundingClientRect.top<d.boundingClientRect.top||d.boundingClientRect.bottom<o)&&(d=h)}let i=d.target;for(;i&&i.getBoundingClientRect().bottom<o;)i=(f=l.get(i))==null?void 0:f.next;for(;i&&i.getBoundingClientRect().top>m;)i=(b=l.get(i))==null?void 0:b.prev;i&&t(i.getAttribute("href"))},{threshold:1,rootMargin:`-${o}px 0px 0px 0px`}),l=new Map;return(r==null?void 0:r.querySelectorAll("[data-mdx-heading]")).forEach(s=>a.observe(s)),()=>{a.disconnect()}},[]),e==null?void 0:e.replace("#","")}function wf(e){return{handleKeyDown:r=>{r.key==="Enter"&&r.metaKey&&(r.preventDefault(),e.current&&e.current.requestSubmit())}}}import{useEffect as Sn,useState as Rn}from"react";function Pf(e,t={}){let{root:r,defaultValue:o}=t,[a,l]=Rn(o??!1);return Sn(()=>{let c=()=>{let d=e.current;if(!d)return;let m=r==null?void 0:r.current,i=d.getBoundingClientRect(),p=m?m.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};l(i.top<p.bottom&&i.bottom>p.top&&i.left<p.right&&i.right>p.left)};((r==null?void 0:r.current)||window).addEventListener("scroll",c),window.addEventListener("resize",c);let s=null;return e.current&&(s=new IntersectionObserver(c),s.observe(e.current)),c(),()=>{((r==null?void 0:r.current)||window).removeEventListener("scroll",c),window.removeEventListener("resize",c),s==null||s.disconnect()}},[e,r]),a}import{useEffect as Mn,useState as Ln}from"react";function Mf(){let[e,t]=Ln(!1);return Mn(()=>{let r=()=>{let o=document.activeElement;t((o==null?void 0:o.tagName)!=null&&["INPUT","TEXTAREA"].includes(o.tagName))};return window.addEventListener("focusin",r),window.addEventListener("focusout",r),()=>{window.removeEventListener("focusin",r),window.removeEventListener("focusout",r)}},[]),e}import{useEffect as En,useState as Tn}from"react";function Af(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:a=!1}){let[l,c]=Tn(),s=(l==null?void 0:l.isIntersecting)&&a,d=([m])=>{c(m)};return En(()=>{let m=e==null?void 0:e.current;if(!!!window.IntersectionObserver||s||!m)return;let p={threshold:t,root:r,rootMargin:o},f=new IntersectionObserver(d,p);return f.observe(m),()=>f.disconnect()},[e,JSON.stringify(t),r,o,s]),l}import{createContext as An,useCallback as Dn,useContext as In,useEffect as ta,useId as zn,useState as On}from"react";import{jsx as Vn}from"react/jsx-runtime";var ra=An({listeners:[],setListeners:()=>{}});function _f({children:e}){let[t,r]=On([]);return Vn(ra.Provider,{value:{listeners:t,setListeners:r},children:e})}function Ye(e,t,r={}){let o=zn(),{listeners:a,setListeners:l}=In(ra),c=Dn(s=>{let d=s.target,m=document.getElementById("modal-backdrop");if(s.metaKey||s.ctrlKey||d.tagName==="INPUT"||d.tagName==="TEXTAREA"||!!m!=!!r.modal||(Array.isArray(e)?!e.includes(s.key):s.key!==e))return;let i=a.filter(f=>f.enabled!==!1&&(Array.isArray(f.key)?f.key.includes(s.key):f.key===s.key));!i.length||Xr(i,(f,b)=>(b.priority??0)-(f.priority??0)).slice(-1)[0].id!==o||(s.preventDefault(),t(s))},[e,a,o,t]);ta(()=>(document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)),[c]),ta(()=>(l(s=>[...s.filter(d=>d.id!==o),{id:o,key:e,...r}]),()=>l(s=>s.filter(d=>d.id!==o))),[JSON.stringify(e),r.enabled,r.priority])}import{useEffect as _n,useState as Hn}from"react";function oa(e){if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}function Bf(e,t){let[r,o]=Hn(oa(e)??t);return _n(()=>{let l=oa(e);l&&o(l)},[e]),[r,l=>{o(l),window.localStorage.setItem(e,JSON.stringify(l))}]}import{toast as Fn}from"sonner";import Bn from"swr";function Kf(e,t){let{data:r,isLoading:o,mutate:a}=Bn(e,me);return{data:r,isLoading:o,update:async(l,c)=>Fn.promise(a(l(r),{optimisticData:c,rollbackOnError:!0,populateCache:!0,revalidate:!0}),{loading:(t==null?void 0:t.loading)||"Updating...",success:(t==null?void 0:t.success)||"Successfully updated",error:(t==null?void 0:t.error)||"Failed to update"})}}import{useEffect as sa,useMemo as Kn}from"react";import{useEffect as aa,useState as Wn}from"react";function ia({pageSize:e,page:t,onPageChange:r}){let[o,a]=Wn({pageIndex:t,pageSize:e});return aa(()=>{a(l=>({...l,pageIndex:t}))},[t]),aa(()=>{r==null||r(o.pageIndex)},[o]),{pagination:o,setPagination:a}}import{usePathname as Un,useRouter as $n,useSearchParams as Gn}from"next/navigation";function na(){let e=Un(),t=$n(),r=Gn(),o=Object.fromEntries(r);return{pathname:e,router:t,searchParams:r,searchParamsObj:o,queryParams:({set:c,del:s,replace:d,scroll:m=!0,getNewPath:i,arrayDelimiter:p=","})=>{let f=new URLSearchParams(r);c&&Object.entries(c).forEach(([h,g])=>f.set(h,Array.isArray(g)?g.join(p):g)),s&&(Array.isArray(s)?s.forEach(h=>f.delete(h)):f.delete(s));let b=f.toString(),y=`${e}${b.length>0?`?${b}`:""}`;if(i)return y;d?t.replace(y,{scroll:!1}):t.push(y,{scroll:m})},getQueryString:(c,s)=>{let d=new URLSearchParams(r);c&&Object.entries(c).forEach(([i,p])=>d.set(i,p)),s!=null&&s.ignore&&s.ignore.forEach(i=>d.delete(i));let m=d.toString();return m.length>0?`?${m}`:""}}}function rg(e=Zr){let{searchParams:t,queryParams:r}=na(),o=Kn(()=>parseInt(t.get("page")||"1")||1,[t.get("page")]),{pagination:a,setPagination:l}=ia({pageSize:e,page:o,onPageChange:c=>{r(c===1?{del:"page"}:{set:{page:c.toString()}})}});return sa(()=>{let c=parseInt(t.get("page")||"1")||1;l(s=>({...s,pageIndex:c}))},[t.get("page")]),sa(()=>{r(a.pageIndex===1?{del:"page"}:{set:{page:a.pageIndex.toString()}})},[a]),{pagination:a,setPagination:l}}import{useEffect as jn,useState as Yn}from"react";function Tt(e){let[t,r]=Yn(),o=([a])=>{r(a)};return jn(()=>{let a=e==null?void 0:e.current;if(!a)return;let l=new ResizeObserver(o);return l.observe(a),()=>l.disconnect()},[e]),t}import{useCallback as qn,useEffect as la,useState as Zn}from"react";function ca(e){let[t,r]=Zn(!1),o=qn(()=>{r(window.scrollY>e)},[e]);return la(()=>(window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)),[o]),la(()=>{o()},[o]),t}import{useCallback as Qn,useEffect as Jn,useState as Xn}from"react";function qe(e){let[t,r]=Xn(1),o=Qn(()=>{if(!e.current)return;let{scrollTop:l,scrollHeight:c,clientHeight:s}=e.current;r(c===s?1:Math.min(l/(c-s),1))},[]),a=Tt(e);return Jn(o,[a]),{scrollProgress:t,updateScrollProgress:o}}import{useEffect as es}from"react";import{toast as ma}from"sonner";import{jsx as At,jsxs as da}from"react/jsx-runtime";function ts({id:e,message:t,undo:r}){let o=()=>{r(),ma.dismiss(e)},a=l=>{l.key==="z"&&(l.ctrlKey||l.metaKey)&&o()};return es(()=>(document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)),[]),da("div",{className:"flex w-full items-center justify-between space-x-2",children:[da("div",{className:"flex items-center space-x-2",children:[At(lo,{}),At("p",{className:"font-medium",children:t})]}),At("button",{className:"whitespace-nowrap rounded border border-black bg-black px-2 py-1 text-xs font-normal text-white transition-all duration-75 active:scale-95",onClick:o,children:"Undo"})]})}function hg(){return({id:t,message:r,undo:o,duration:a})=>ma(At(ts,{id:t,message:r,undo:o}),{id:t,...a&&{duration:a}})}import{jsx as ua}from"react/jsx-runtime";var ye=os(({width:e=!1,height:t=!1,className:r,transition:o,children:a,...l},c)=>{var m,i;let s=as(null),d=Tt(s);return ua(rs.div,{ref:c,className:n("overflow-hidden",r),animate:{width:e?((m=d==null?void 0:d.contentRect)==null?void 0:m.width)??"auto":"auto",height:t?((i=d==null?void 0:d.contentRect)==null?void 0:i.height)??"auto":"auto"},transition:o??{type:"spring",duration:.3},...l,children:ua("div",{ref:s,className:n(t&&"h-max",e&&"w-max"),children:a})})});ye.displayName="AnimatedSizeContainer";import*as Ne from"@radix-ui/react-popover";import{Drawer as Ze}from"vaul";import{jsx as xe,jsxs as Dt}from"react/jsx-runtime";function Qe({children:e,content:t,align:r="center",side:o="bottom",openPopover:a,setOpenPopover:l,mobileOnly:c,popoverContentClassName:s,collisionBoundary:d,sticky:m,onEscapeKeyDown:i,onWheel:p}){let{isMobile:f}=j();return c||f?Dt(Ze.Root,{open:a,onOpenChange:l,children:[xe(Ze.Trigger,{className:"sm:hidden",asChild:!0,children:e}),Dt(Ze.Portal,{children:[xe(Ze.Overlay,{className:"fixed inset-0 z-50 bg-gray-100 bg-opacity-10 backdrop-blur"}),Dt(Ze.Content,{className:"fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-[10px] border-t border-gray-200 bg-white",onEscapeKeyDown:i,onPointerDownOutside:b=>{b.target instanceof Element&&b.target.closest("[data-sonner-toast]")&&b.preventDefault()},children:[xe("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:xe("div",{className:"my-3 h-1 w-12 rounded-full bg-gray-300"})}),xe("div",{className:"flex min-h-[150px] w-full items-center justify-center overflow-hidden bg-white pb-8 align-middle shadow-xl",children:t})]}),xe(Ze.Overlay,{})]})]}):Dt(Ne.Root,{open:a,onOpenChange:l,children:[xe(Ne.Trigger,{className:"sm:inline-flex",asChild:!0,children:e}),xe(Ne.Portal,{children:xe(Ne.Content,{sideOffset:8,align:r,side:o,className:n("animate-slide-up-fade z-50 items-center rounded-lg border border-gray-200 bg-white drop-shadow-lg sm:block",s),sticky:m,collisionBoundary:d,onEscapeKeyDown:i,onWheel:p,children:t})})]})}import{Fragment as hr,jsx as A,jsxs as ke}from"react/jsx-runtime";function ps(e,t){return e===!0}function $g({multiple:e,selected:t,setSelected:r,options:o,icon:a,placeholder:l="Select...",searchPlaceholder:c="Search...",emptyState:s,createLabel:d,onCreate:m,buttonProps:i,shortcutHint:p,caret:f,side:b,open:y,onOpenChange:h,onSearchChange:g,shouldFilter:C=!0,inputClassName:P,optionRight:S,optionClassName:k,matchTriggerWidth:x,children:v}){let R=ps(e,r),I=Array.isArray(t)?t:t?[t]:[],{isMobile:D}=j(),[q,w]=lt(!1),z=y??q,ce=h??w,[L,de]=lt(""),[ee,nr]=lt(!1),[sr,yi]=lt(void 0),[xi,jr]=lt(!1),wi=O=>{var We;if(R){let lr=I.some(({value:at})=>at===O.value);r(lr?I.filter(({value:at})=>at!==O.value):[...I,O])}else r(I.length&&((We=I[0])==null?void 0:We.value)===O.value?null:O),ce(!1)},Yr=ms((O,We)=>We===""?[...I,...O.filter(lr=>I.findIndex(at=>at.value===lr.value)===-1)]:O,[I]);return It(()=>{ee&&(yi(o&&Yr(o,L)),nr(!1))},[ee,o,Yr,L]),It(()=>{nr(!0)},[o]),It(()=>{z||(de(""),nr(!0))},[z]),It(()=>g==null?void 0:g(L),[L]),A(Qe,{openPopover:z,setOpenPopover:ce,align:"start",side:b,onWheel:O=>{O.stopPropagation()},popoverContentClassName:n(x&&"sm:w-[var(--radix-popover-trigger-width)]"),content:A(ye,{width:!D&&!x,height:!0,style:{transform:"translateZ(0)"},transition:{ease:"easeInOut",duration:.1},className:"pointer-events-auto",children:ke(zt,{loop:!0,shouldFilter:C,children:[ke("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-gray-200",children:[A(is,{placeholder:c,value:L,onValueChange:de,className:n("grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-gray-400 focus:ring-0 sm:text-sm",P),onKeyDown:O=>{(O.key==="Escape"||O.key==="Backspace"&&!L)&&(O.preventDefault(),O.stopPropagation(),ce(!1))}}),p&&A("kbd",{className:"mr-2 hidden shrink-0 rounded border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-500 md:block",children:p})]}),A(fs,{children:A(zt.List,{className:n("flex w-full min-w-[100px] flex-col gap-1 p-1"),children:sr!==void 0?ke(hr,{children:[sr.map(O=>A(gs,{option:O,multiple:R,selected:I.some(({value:We})=>We===O.value),onSelect:()=>wi(O),right:S==null?void 0:S(O),className:k},`${O.label}, ${O.value}`)),L.length>0&&m&&ke(ns,{className:n("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm text-gray-700","data-[selected=true]:bg-gray-100",k),onSelect:async()=>{jr(!0),await(m==null?void 0:m(L))&&(de(""),ce(!1)),jr(!1)},children:[xi?A(be,{className:"size-4 shrink-0"}):A(St,{className:"size-4 shrink-0"}),A("div",{className:"grow truncate",children:(d==null?void 0:d(L))||`Create "${L}"`})]}),C?A(hs,{className:"flex min-h-12 items-center justify-center text-sm text-gray-500",children:s||"No matches"}):sr.length===0?A("div",{className:"flex min-h-12 items-center justify-center text-sm text-gray-500",children:s||"No matches"}):null]}):A(zt.Loading,{children:A("div",{className:"flex h-12 items-center justify-center",children:A(be,{})})})})})]})}),children:A(ie,{variant:"secondary",...i,className:n(i==null?void 0:i.className,"flex gap-2"),textWrapperClassName:n(i==null?void 0:i.textWrapperClassName,"w-full flex items-center justify-start"),text:ke(hr,{children:[A("div",{className:"min-w-0 grow truncate text-left",children:v||I.map(O=>O.label).join(", ")||l}),f&&A(ls,{className:"ml-1 size-4 shrink-0 text-gray-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}),icon:a?pa(a)?a:A(a,{className:"size-4 shrink-0"}):void 0})})}var fs=({children:e})=>{let t=us(null),{scrollProgress:r,updateScrollProgress:o}=qe(t);return ke(hr,{children:[A("div",{className:"scrollbar-hide max-h-[min(50vh,250px)] w-screen overflow-y-scroll sm:w-auto",ref:t,onScroll:o,children:e}),A("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full rounded-b-lg bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(r,2)}})]})};function gs({option:e,onSelect:t,multiple:r,selected:o,right:a,className:l}){return ke(zt.Item,{className:n("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-gray-100",l),onSelect:t,value:e.label+(e==null?void 0:e.value),children:[r&&A("div",{className:"shrink-0 text-gray-600",children:o?A(So,{className:"size-4 text-gray-600"}):A(Ro,{className:"size-4 text-gray-400"})}),ke("div",{className:"flex min-w-0 grow items-center gap-1",children:[e.icon&&A("span",{className:"shrink-0 text-gray-600",children:pa(e.icon)?e.icon:A(e.icon,{className:"h-4 w-4"})}),A("span",{className:"grow truncate",children:e.label})]}),a,!r&&o&&A(Po,{className:"size-4 shrink-0 text-gray-600"})]})}var pa=e=>ds(e),hs=cs((e,t)=>ss(o=>o.filtered.count===0)?A("div",{ref:t,"cmdk-empty":"",role:"presentation",...e}):null);import{addYears as Ot,format as vs,isSameMonth as bs}from"date-fns";import{ChevronLeft as fa,ChevronRight as ga,ChevronsLeft as ys,ChevronsRight as xs}from"lucide-react";import{forwardRef as ws,useRef as Cs}from"react";import{DayPicker as Ns,useDayPicker as ks,useDayRender as Ps,useNavigation as Ss}from"react-day-picker";import{Fragment as Rs,jsx as re,jsxs as Vt}from"react/jsx-runtime";var ct=ws(({onClick:e,icon:t,disabled:r,...o},a)=>re("button",{ref:a,type:"button",disabled:r,className:n("flex h-7 w-7 shrink-0 select-none items-center justify-center rounded border p-1 outline-none transition","border-gray-200 text-gray-600 hover:text-gray-800","hover:bg-gray-50 active:bg-gray-100","disabled:pointer-events-none disabled:text-gray-400"),onClick:e,...o,children:re(t,{className:"h-full w-full shrink-0"})}));ct.displayName="NavigationButton";function ha({mode:e="single",weekStartsOn:t=1,numberOfMonths:r=1,showYearNavigation:o=!1,disableNavigation:a,locale:l,className:c,classNames:s,...d}){return re(Ns,{mode:e,weekStartsOn:t,numberOfMonths:r,locale:l,showOutsideDays:r===1,className:c,classNames:{months:"flex space-y-0",month:"space-y-4 p-3 w-full",nav:"gap-1 flex items-center rounded-full w-full h-full justify-between p-4",table:"w-full border-separate border-spacing-y-1",head_cell:"w-9 font-medium text-xs text-center text-gray-400 pb-2",row:"w-full",cell:"relative p-0 text-center focus-within:relative text-gray-900",day:n("relative h-10 w-full sm:h-9 sm:w-9 rounded-md text-sm text-gray-900","hover:bg-gray-100 active:bg-gray-200 outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500"),day_today:"font-semibold",day_selected:"rounded aria-selected:bg-blue-500 aria-selected:text-white",day_disabled:"!text-gray-300 line-through disabled:hover:bg-transparent",day_outside:"text-gray-400",day_range_middle:"!rounded-none aria-selected:!bg-blue-100 aria-selected:!text-blue-900",day_range_start:"rounded-r-none !rounded-l",day_range_end:"rounded-l-none !rounded-r",day_hidden:"invisible",...s},components:{IconLeft:()=>re(fa,{className:"h-4 w-4"}),IconRight:()=>re(ga,{className:"h-4 w-4"}),Caption:({...m})=>{let{goToMonth:i,nextMonth:p,previousMonth:f,currentMonth:b,displayMonths:y}=Ss(),{numberOfMonths:h,fromDate:g,toDate:C}=ks(),P=y.findIndex(D=>bs(m.displayMonth,D)),S=P===0,k=P===y.length-1,x=h>1&&(S||!k),v=h>1&&(k||!S),R=()=>{let D=Ot(b,-1);f&&(!g||D.getTime()>=g.getTime())&&i(D)},I=()=>{let D=Ot(b,1);p&&(!C||D.getTime()<=C.getTime())&&i(D)};return Vt("div",{className:"flex items-center justify-between",children:[Vt("div",{className:"flex items-center gap-1",children:[o&&!v&&re(ct,{disabled:a||!f||g&&Ot(b,-1).getTime()<g.getTime(),"aria-label":"Go to previous year",onClick:R,icon:ys}),!v&&re(ct,{disabled:a||!f,"aria-label":"Go to previous month",onClick:()=>f&&i(f),icon:fa})]}),re("div",{role:"presentation","aria-live":"polite",className:"text-sm font-medium capitalize tabular-nums text-gray-900",children:vs(m.displayMonth,"LLLL yyy",{locale:l})}),Vt("div",{className:"flex items-center gap-1",children:[!x&&re(ct,{disabled:a||!p,"aria-label":"Go to next month",onClick:()=>p&&i(p),icon:ga}),o&&!x&&re(ct,{disabled:a||!p||C&&Ot(b,1).getTime()>C.getTime(),"aria-label":"Go to next year",onClick:I,icon:xs})]})]})},Day:({date:m,displayMonth:i})=>{let p=Cs(null),{activeModifiers:f,buttonProps:b,divProps:y,isButton:h,isHidden:g}=Ps(m,i,p),{selected:C,today:P,disabled:S,range_middle:k}=f;if(g)return re(Rs,{});if(!h)return re("div",{...y,className:n("flex items-center justify-center",y.className)});let{children:x,...v}=b;return Vt("button",{ref:p,...v,type:"button",children:[x,P&&re("span",{className:n("absolute inset-x-1/2 bottom-1.5 h-0.5 w-4 -translate-x-1/2 rounded-[2px]",{"bg-blue-500":!C,"!bg-white":C,"!bg-blue-400":C&&k,"text-gray-400":S})})]})}},...d})}import{enUS as _s}from"date-fns/locale";import{useEffect as Cr,useMemo as ba,useState as Ht}from"react";import{Command as vr}from"cmdk";import{Lock as Ms}from"lucide-react";import{jsx as Oe,jsxs as Ls}from"react/jsx-runtime";var br=({presets:e,onSelect:t,currentValue:r})=>{let o=d=>"dateRange"in d,a=d=>"date"in d,l=(d,m)=>d.getDate()===m.getDate()&&d.getMonth()===m.getMonth()&&d.getFullYear()===m.getFullYear(),c=(d,m)=>{let i=d.from,p=m.from,f=!1;i&&p&&l(i,p)&&(f=!0);let b=d.to,y=m.to,h=!1;return b&&y&&l(b,y)&&(h=!0),f&&h},s=d=>{if(o(d)){let m=r;return m&&c(m,d.dateRange)}else if(a(d)){let m=r;return m&&l(m,d.date)}return!1};return Oe(vr,{className:"w-full rounded ring-gray-200 ring-offset-2 focus:outline-none",tabIndex:0,autoFocus:!0,loop:!0,children:Oe(vr.List,{className:"[&>*]:flex [&>*]:w-full [&>*]:items-start [&>*]:gap-x-2 [&>*]:gap-y-0.5 [&>*]:sm:flex-col",children:e.map((d,m)=>Ls(vr.Item,{disabled:d.requiresUpgrade,onSelect:()=>t(d),title:d.label,value:d.id,className:n("group relative flex cursor-pointer items-center justify-between overflow-hidden text-ellipsis whitespace-nowrap rounded border border-gray-200","px-2.5 py-1.5 text-left text-sm text-gray-700 shadow-sm outline-none sm:w-full sm:border-none sm:py-2 sm:shadow-none","disabled:pointer-events-none disabled:opacity-50","sm:data-[selected=true]:bg-gray-100",s(d)&&"font-semibold text-gray-800"),children:[Oe("span",{children:d.label}),d.requiresUpgrade?Oe(Ms,{className:"h-3.5 w-3.5","aria-hidden":"true"}):d.shortcut?Oe("kbd",{className:"text-gray-4000 hidden rounded bg-gray-100 px-2 py-0.5 text-xs font-light group-data-[selected=true]:bg-gray-200 md:block",children:d.shortcut.toUpperCase()}):null,d.requiresUpgrade&&d.tooltipContent&&Oe(te,{side:"bottom",content:d.tooltipContent,children:Oe("div",{className:"absolute inset-0 cursor-not-allowed"})})]},m))})})};br.displayName="DatePicker.Presets";import{format as Pe}from"date-fns";import{createContext as Es}from"react";var yr=Es({isOpen:!1,setIsOpen:()=>{}}),Ts=()=>{let e=typeof window<"u"?window.navigator.language:"en-US",t=new Intl.DateTimeFormat(e,{hour:"numeric"}).format();return Number.isInteger(Number(t))},xr=(e,t,r=!1)=>{let o=!Ts(),a;return r?a=o?Pe(e,"d MMM, yyyy h:mm a",{locale:t}):Pe(e,"d MMM, yyyy HH:mm",{locale:t}):a=Pe(e,"d MMM, yyyy",{locale:t}),a},va=(e,t)=>{let{toYear:r,fromYear:o,fromMonth:a,toMonth:l,fromDay:c,toDay:s}=t;if(e&&e.length>0){let d=o,m=r;e.forEach(i=>{var p,f,b,y,h,g;if("date"in i){let C=i.date.getFullYear();if(o&&C<o)throw new Error(`Preset ${i.label} is before fromYear ${d}.`);if(r&&C>r)throw new Error(`Preset ${i.label} is after toYear ${m}.`);if(a&&i.date.getMonth()<a.getMonth())throw new Error(`Preset ${i.label} is before fromMonth ${a}.`);if(l&&i.date.getMonth()>l.getMonth())throw new Error(`Preset ${i.label} is after toMonth ${l}.`);if(c&&i.date.getDate()<c.getDate())throw new Error(`Preset ${i.label} is before fromDay ${c}.`);if(s&&i.date.getDate()>s.getDate())throw new Error(`Preset ${i.label} is after toDay ${Pe(s,"MMM dd, yyyy")}.`)}if("dateRange"in i){let C=(p=i.dateRange.from)==null?void 0:p.getFullYear(),P=(f=i.dateRange.to)==null?void 0:f.getFullYear();if(C&&o&&C<o)throw new Error(`Preset ${i.label}'s 'from' is before fromYear ${d}.`);if(P&&r&&P>r)throw new Error(`Preset ${i.label}'s 'to' is after toYear ${m}.`);if(a){let S=(b=i.dateRange.from)==null?void 0:b.getMonth();if(S&&S<a.getMonth())throw new Error(`Preset ${i.label}'s 'from' is before fromMonth ${Pe(a,"MMM, yyyy")}.`)}if(l){let S=(y=i.dateRange.to)==null?void 0:y.getMonth();if(S&&S>l.getMonth())throw new Error(`Preset ${i.label}'s 'to' is after toMonth ${Pe(l,"MMM, yyyy")}.`)}if(c){let S=(h=i.dateRange.from)==null?void 0:h.getDate();if(S&&S<c.getDate())throw new Error(`Preset ${i.dateRange.from}'s 'from' is before fromDay ${Pe(c,"MMM dd, yyyy")}.`)}if(s){let S=(g=i.dateRange.to)==null?void 0:g.getDate();if(S&&S>s.getDate())throw new Error(`Preset ${i.label}'s 'to' is after toDay ${Pe(s,"MMM dd, yyyy")}.`)}}})}};import{cva as As}from"class-variance-authority";import{Calendar as Ds,ChevronDown as Is}from"lucide-react";import{forwardRef as zs}from"react";import{jsx as _t,jsxs as Vs}from"react/jsx-runtime";var Os=As(["group peer flex cursor-pointer appearance-none items-center gap-x-2 truncate rounded-md border px-3 h-10 outline-none transition-all text-sm","bg-white border-gray-200 text-gray-900 placeholder-gray-400 transition-all","disabled:pointer-events-none disabled:bg-gray-100 disabled:text-gray-400","focus-visible:border-gray-500 data-[state=open]:border-gray-500 data-[state=open]:ring-4 data-[state=open]:ring-gray-200"],{variants:{hasError:{true:"ring-2 ring-red-200 border-red-500"}}}),wr=zs(({className:e,children:t,placeholder:r,hasError:o,...a},l)=>Vs("button",{ref:l,className:n(Os({hasError:o}),e),...a,children:[_t(Ds,{className:n("h-4 w-4 shrink-0 text-gray-400",!!t&&"text-gray-900")}),_t("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-gray-900",children:t||(r?_t("span",{className:"text-gray-400",children:r}):null)}),_t(Is,{className:"h-4 w-4 flex-shrink-0 text-gray-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}));wr.displayName="DatePicker.Trigger";import{jsx as fe,jsxs as Fs}from"react/jsx-runtime";var Hs=({value:e,defaultValue:t,presetId:r,onChange:o,presets:a,disabled:l,disableNavigation:c,disabledDays:s,showYearNavigation:d=!1,locale:m=_s,placeholder:i="Select date range",hasError:p,align:f="center",className:b,...y})=>{let{isDesktop:h}=j(),[g,C]=Ht(!1),[P,S]=Ht(a&&r?a==null?void 0:a.find(({id:L})=>L===r):void 0),[k,x]=Ht((P==null?void 0:P.dateRange)??e??t??void 0),[v,R]=Ht(k==null?void 0:k.to),I=ba(()=>k,[g]);Cr(()=>{x(e)},[e]),Cr(()=>{let L=a==null?void 0:a.find(({id:de})=>de===r);S(L),x((L==null?void 0:L.dateRange)??e??t)},[a,r]),Cr(()=>{g?k&&R(k.to):R(k==null?void 0:k.to)},[g]);let D=(L,de)=>{let ee=(k==null?void 0:k.from)&&(k==null?void 0:k.to)?{from:de}:L;x(ee),S(void 0),(ee==null?void 0:ee.from)&&(ee==null?void 0:ee.to)&&(o==null||o(ee),C(!1))},q=L=>{x(L.dateRange),S(L),o==null||o(L.dateRange,L),C(!1)},w=()=>{x(I),C(!1)},z=L=>{L||w(),C(L)},ce=ba(()=>k?`${k.from?xr(k.from,m):""} - ${k.to?xr(k.to,m):""}`:null,[k,m]);return Ye((a==null?void 0:a.filter(L=>L.shortcut).map(L=>L.shortcut))??[],L=>{let de=a==null?void 0:a.find(ee=>ee.shortcut===L.key);de&&q(de)}),fe(yr.Provider,{value:{isOpen:g,setIsOpen:C},children:fe(Qe,{align:f,openPopover:g,setOpenPopover:z,popoverContentClassName:"rounded-xl",content:fe("div",{className:"flex w-full",children:Fs("div",{className:"scrollbar-hide flex w-full flex-col overflow-x-scroll sm:flex-row-reverse sm:items-start",children:[a&&a.length>0&&fe("div",{className:n("relative flex h-16 w-full items-center sm:h-full sm:w-48","border-b border-gray-200 sm:border-b-0 sm:border-l","scrollbar-hide overflow-auto"),children:fe("div",{className:"absolute px-3 sm:inset-0 sm:left-0 sm:p-3",children:fe(br,{currentValue:k,presets:a,onSelect:q})})}),fe("div",{className:"scrollbar-hide overflow-x-scroll",children:fe(ha,{mode:"range",selected:k,onSelect:D,month:v,onMonthChange:R,numberOfMonths:h?2:1,disabled:s,disableNavigation:c,showYearNavigation:d,locale:m,className:"scrollbar-hide overflow-x-scroll",classNames:{months:"flex flex-row divide-x divide-gray-200 overflow-x-scroll scrollbar-hide"},...y})})]})}),children:fe(wr,{placeholder:i,disabled:l,className:b,hasError:p,"aria-required":y.required||y["aria-required"],"aria-invalid":y["aria-invalid"],"aria-label":y["aria-label"],"aria-labelledby":y["aria-labelledby"],children:(P==null?void 0:P.label)??ce})})})};function Rh({presets:e,...t}){return e&&va(e,t),fe(Hs,{presets:e,...t})}import{jsx as Ft,jsxs as ya}from"react/jsx-runtime";function Dh({icon:e,title:t,description:r,learnMore:o,children:a}){return ya("div",{className:"flex flex-col items-center justify-center gap-y-4",children:[Ft("div",{className:"flex size-16 items-center justify-center rounded-2xl border border-gray-200 bg-gray-50",children:Ft(e,{className:"size-6 text-gray-800"})}),Ft("p",{className:"text-center text-base font-medium text-gray-950",children:t}),r&&ya("p",{className:"max-w-sm text-balance text-center text-sm text-gray-500",children:[r," ",o&&Ft("a",{href:o,target:"_blank",className:"underline underline-offset-2 hover:text-gray-800",children:"Learn more \u2197"})]}),a]})}import{cva as Bs}from"class-variance-authority";import{useState as xa}from"react";import{toast as wa}from"sonner";import{Fragment as Us,jsx as ge,jsxs as kr}from"react/jsx-runtime";var Nr={any:{types:[]},images:{types:["image/png","image/jpeg"],errorMessage:"File type not supported (.png or .jpg only)"},csv:{types:["text/csv"],errorMessage:"File type not supported (.csv only)"}},Ws=Bs("group relative isolate flex aspect-[1200/630] w-full flex-col items-center justify-center overflow-hidden bg-white transition-all hover:bg-gray-50",{variants:{variant:{default:"rounded-md border border-gray-300 shadow-sm",plain:""}},defaultVariants:{variant:"default"}});function Uh({readFile:e,onChange:t,variant:r,className:o,iconClassName:a,previewClassName:l,customPreview:c,accept:s="any",imageSrc:d,loading:m=!1,clickToUpload:i=!0,showHoverOverlay:p=!0,content:f,maxFileSizeMB:b=0,targetResolution:y,accessibilityLabel:h="File upload",disabled:g=!1}){let[C,P]=xa(!1),[S,k]=xa(null),x=async v=>{let R="dataTransfer"in v?v.dataTransfer.files&&v.dataTransfer.files[0]:v.target.files&&v.target.files[0];if(!R)return;if(k(R.name),b>0&&R.size/1024/1024>b){wa.error(`File size too big (max ${b} MB)`);return}let I=Nr[s].types;if(I.length&&!I.includes(R.type)){wa.error(Nr[s].errorMessage??"File type not supported");return}let D=R;if(y&&R.type.startsWith("image/"))try{let q=await Jr(R,y),w=await fetch(q).then(z=>z.blob());D=new File([w],R.name,{type:R.type})}catch(q){console.error("Error resizing image:",q)}if(e){let q=new FileReader;q.onload=w=>{var z;return t==null?void 0:t({src:(z=w.target)==null?void 0:z.result,file:D})},q.readAsDataURL(D);return}t==null||t({file:D})};return kr("label",{className:n(Ws({variant:r}),g?"cursor-not-allowed":n(i&&"cursor-pointer"),o),children:[m&&ge("div",{className:"absolute inset-0 z-[5] flex items-center justify-center rounded-[inherit] bg-white",children:ge(it,{})}),ge("div",{className:"absolute inset-0 z-[5]",onDragOver:v=>{v.preventDefault(),v.stopPropagation(),P(!0)},onDragEnter:v=>{v.preventDefault(),v.stopPropagation(),P(!0)},onDragLeave:v=>{v.preventDefault(),v.stopPropagation(),P(!1)},onDrop:async v=>{v.preventDefault(),v.stopPropagation(),x(v),P(!1)}}),kr("div",{className:n("absolute inset-0 z-[3] flex flex-col items-center justify-center rounded-[inherit] border-2 border-transparent bg-white transition-all",g&&"bg-gray-50",C&&!g&&"cursor-copy border-black bg-gray-50 opacity-100",d?n("opacity-0",p&&!g&&"group-hover:opacity-100"):n(!g&&"group-hover:bg-gray-50")),children:[ge(Ao,{className:n("size-7 transition-all duration-75",g?"text-gray-400":n("text-gray-500 group-hover:scale-110 group-active:scale-95",C?"scale-110":"scale-100"),a)}),f!==null&&ge("div",{className:n("mt-2 text-center text-sm text-gray-500",g&&"text-gray-400"),children:f??ge(Us,{children:kr("p",{children:["Drag and drop ",i&&"or click"," to upload."]})})}),ge("span",{className:"sr-only",children:h})]}),d&&(c??ge("img",{src:d,alt:"Preview",className:n("h-full w-full rounded-[inherit] object-cover",l)})),i&&ge("div",{className:"sr-only mt-1 flex shadow-sm",children:ge("input",{type:"file",accept:Nr[s].types.join(","),onChange:x,disabled:g},S)})]})}import{AnimatePresence as $s,motion as Ca}from"framer-motion";import{X as Gs}from"lucide-react";import{isValidElement as Ks}from"react";import{Fragment as js,jsx as X,jsxs as dt}from"react/jsx-runtime";function ka({filters:e,activeFilters:t,onRemove:r,onRemoveAll:o,className:a}){return Ye("Escape",o,{priority:1}),X(ye,{height:!0,className:"w-full",transition:{type:"tween",duration:.3},children:dt("div",{className:n("flex w-full flex-wrap items-start gap-4 sm:flex-nowrap",a),children:[X("div",{className:"flex grow flex-wrap gap-x-4 gap-y-2",children:X($s,{children:t==null?void 0:t.map(({key:l,value:c})=>{if(l==="loader")return X(Ca.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"h-9 w-48 animate-pulse rounded-md border border-gray-200 bg-white"},`loader-${c}`);let s=e.find(d=>d.key===l);return s?(s.multiple&&Array.isArray(c)?c:[c]).map(d=>{var f,b,y;let m=(f=s.options)==null?void 0:f.find(h=>typeof h.value=="string"&&typeof d=="string"?h.value.toLowerCase()===d.toLowerCase():h.value===d),i=(m==null?void 0:m.icon)??((b=s.getOptionIcon)==null?void 0:b.call(s,d,{key:s.key,option:m}))??s.icon,p=(m==null?void 0:m.label)??((y=s.getOptionLabel)==null?void 0:y.call(s,d,{key:s.key,option:m}))??d;return dt(Ca.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"flex items-center divide-x rounded-md border border-gray-200 bg-white text-sm text-black",children:[dt("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[X("span",{className:"shrink-0 text-gray-600",children:Na(s.icon)?s.icon:X(s.icon,{className:"h-4 w-4"})}),s.label]}),X("div",{className:"px-3 py-2 text-gray-500",children:"is"}),X("div",{className:"flex items-center gap-2.5 px-3 py-2",children:s.options?dt(js,{children:[X("span",{className:"shrink-0 text-gray-600",children:Na(i)?i:X(i,{className:"h-4 w-4"})}),Ct(p,30)]}):X("div",{className:"h-5 w-12 animate-pulse rounded-md bg-gray-200"})}),X("button",{type:"button",className:"h-full rounded-r-md p-2 text-gray-500 ring-inset ring-gray-500 hover:bg-gray-100 hover:text-gray-800 focus:outline-none focus-visible:ring-1",onClick:()=>r(l,d),children:X(Gs,{className:"h-3.5 w-3.5"})})]},`${l}-${d}`)}):(console.error("Filter.List received an activeFilter without a corresponding filter"),null)})})}),(t==null?void 0:t.length)!==0&&dt("button",{type:"button",className:"group mt-px flex items-center gap-2 whitespace-nowrap rounded-lg border border-transparent px-3 py-2 text-sm text-gray-500 ring-inset ring-gray-500 transition-colors hover:border-gray-200 hover:bg-white hover:text-black focus:outline-none",onClick:o,children:["Clear Filters",X("kbd",{className:"rounded-md border border-gray-200 px-1.5 py-0.5 text-xs text-gray-950 group-hover:bg-gray-50",children:"ESC"})]})]})})}var Na=e=>Ks(e);import{Command as Se,useCommandState as Ys}from"cmdk";import{ChevronDown as qs,ListFilter as Zs}from"lucide-react";import{Fragment as Qs,forwardRef as Js,isValidElement as Sa,useCallback as Bt,useEffect as Wt,useImperativeHandle as Xs,useRef as Sr,useState as Pr}from"react";import{Fragment as il,jsx as _,jsxs as he}from"react/jsx-runtime";function Ra({filters:e,onSelect:t,onRemove:r,onOpenFilter:o,onSearchChange:a,onSelectedFilterChange:l,activeFilters:c,askAI:s,children:d,emptyState:m,className:i}){var D,q;let{isMobile:p}=j(),f=Sr(null),b=Sr(),[y,h]=Pr(!1);Ye("f",()=>h(!0),{enabled:!y});let[g,C]=Pr(""),[P,S]=Pr(null),k=Bt(()=>{C(""),S(null)},[]);Wt(()=>{y||k()},[y]);let x=P?e.find(({key:w})=>w===P):null,v=Bt(w=>{f.current&&(b.current={width:f.current.clientWidth,height:f.current.clientHeight}),C(""),S(w),o==null||o(w)},[]),R=Bt(w=>{if(!x||!c)return!1;let z=c.find(({key:ce})=>ce===P);return(z==null?void 0:z.value)===w||z&&x.multiple&&Array.isArray(z.value)&&z.value.includes(w)},[x]),I=Bt(w=>{x&&(R(w)?r(x.key,w):t(x.key,w),x.multiple||h(!1))},[c,x,s]);return Wt(()=>{a==null||a(g)},[g]),Wt(()=>{l==null||l(P)},[P]),Wt(()=>{(x==null?void 0:x.options)&&f.current&&(b.current={width:f.current.clientWidth,height:f.current.clientHeight})},[x==null?void 0:x.options]),_(Qe,{openPopover:y,setOpenPopover:h,onEscapeKeyDown:w=>{P&&(w.preventDefault(),k())},content:_(ye,{width:!p,height:!0,className:"rounded-[inherit]",style:{transform:"translateZ(0)"},children:he(Se,{loop:!0,shouldFilter:!x||x.shouldFilter!==!1,children:[he("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-gray-200",children:[_(tl,{placeholder:`${(x==null?void 0:x.label)||"Filter"}...`,value:g,onValueChange:C,onKeyDown:w=>{(w.key==="Escape"||w.key==="Backspace"&&!g)&&(w.preventDefault(),w.stopPropagation(),P?k():h(!1))},emptySubmit:w=>{w.preventDefault(),w.stopPropagation(),s?(t("ai",x?`${x.label} ${g}`:g),h(!1)):I(g)}}),!x&&_("kbd",{className:"mr-2 hidden shrink-0 rounded border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-500 md:block",children:"F"})]}),_(rl,{ref:f,children:he(Se.List,{className:n("flex w-full flex-col gap-1 p-1",x?"min-w-[100px]":"min-w-[180px]"),children:[x?((q=(D=x.options)==null?void 0:D.filter(w=>!g||!w.hideDuringSearch))==null?void 0:q.map(w=>{let z=R(w.value);return _(Pa,{filter:x,option:w,right:z?_(ko,{className:"h-4 w-4"}):w.right,onSelect:()=>I(w.value)},w.value)}))??_(Se.Loading,{children:_("div",{className:"-m-1 flex items-center justify-center",style:b.current,children:_(be,{})})}):e.map(w=>he(Qs,{children:[_(Pa,{filter:w,onSelect:()=>v(w.key)}),w.separatorAfter&&_(Se.Separator,{className:"-mx-1 my-1 border-b border-gray-200"})]},w.key)),(!x||x.options)&&_(ol,{search:g,askAI:s,children:m?el(m)?(m==null?void 0:m[P??"default"])??"No matches":m:"No matches"})]})},P)]})}),children:he("button",{type:"button",className:n("group flex h-10 cursor-pointer appearance-none items-center gap-x-2 truncate rounded-md border px-3 text-sm outline-none transition-all","border-gray-200 bg-white text-gray-900 placeholder-gray-400","focus-visible:border-gray-500 data-[state=open]:border-gray-500 data-[state=open]:ring-4 data-[state=open]:ring-gray-200",i),children:[_(Zs,{className:"size-4 shrink-0"}),_("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-gray-900",children:d??"Filter"}),c!=null&&c.length?_("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-black text-[0.625rem] text-white",children:c.length}):_(qs,{className:"size-4 shrink-0 text-gray-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]})})}function el(e){return typeof e=="object"&&e!==null&&!Sa(e)}var tl=e=>{let t=Ys(r=>r.filtered.count===0);return _(Se.Input,{...e,size:1,className:"grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-gray-400 focus:ring-0 sm:text-sm",onKeyDown:r=>{var o,a;(o=e.onKeyDown)==null||o.call(e,r),r.key==="Enter"&&t&&((a=e.emptySubmit)==null||a.call(e,r))},autoCapitalize:"none"})},rl=Js(({children:e},t)=>{let r=Sr(null);Xs(t,()=>r.current);let{scrollProgress:o,updateScrollProgress:a}=qe(r);return he(il,{children:[_("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",ref:r,onScroll:a,children:e}),_("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(o,2)}})]})});function Pa({filter:e,option:t,right:r,onSelect:o}){var s,d;let{isMobile:a}=j(),l=t?t.icon??((s=e.getOptionIcon)==null?void 0:s.call(e,t.value,{key:e.key,option:t}))??e.icon:e.icon,c=t?t.label??((d=e.getOptionLabel)==null?void 0:d.call(e,t.value,{key:e.key,option:t})):e.label;return he(Se.Item,{className:n("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-gray-100"),onPointerDown:m=>{m.preventDefault()},onPointerUp:m=>{m.preventDefault(),a?setTimeout(o,100):o()},onSelect:o,value:c+(t==null?void 0:t.value),children:[_("span",{className:"shrink-0 text-gray-600",children:al(l)?l:_(l,{className:"h-4 w-4"})}),Ct(c,48),_("div",{className:"ml-1 flex shrink-0 grow justify-end text-gray-500",children:r})]})}var ol=({search:e,askAI:t,children:r})=>t&&e?he(Se.Empty,{className:"flex min-w-[180px] items-center space-x-2 rounded-md bg-gray-100 px-3 py-2",children:[_(io,{className:"h-4 w-4"}),he("p",{className:"text-center text-sm text-gray-600",children:["Ask AI ",he("span",{className:"text-black",children:['"',e,'"']})]})]}):_(Se.Empty,{className:"p-2 text-center text-sm text-gray-400",children:r}),al=e=>Sa(e);var p1={Select:Ra,List:ka};import{useMemo as nl,useState as Ma}from"react";import{jsx as Ve,jsxs as Ut}from"react/jsx-runtime";function x1({title:e,description:t,inputAttrs:r,helpText:o,buttonText:a="Save Changes",disabledTooltip:l,handleSubmit:c}){let[s,d]=Ma(r.defaultValue),[m,i]=Ma(!1),p=nl(()=>m||!s||s===r.defaultValue,[m,s,r.defaultValue]);return Ut("form",{onSubmit:async f=>{f.preventDefault(),i(!0),await c({[r.name]:s}),i(!1)},className:"rounded-lg border border-gray-200 bg-white",children:[Ut("div",{className:"relative flex flex-col space-y-6 p-5 sm:p-10",children:[Ut("div",{className:"flex flex-col space-y-3",children:[Ve("h2",{className:"text-xl font-medium",children:e}),Ve("p",{className:"text-sm text-gray-500",children:t})]}),typeof r.defaultValue=="string"?Ve("input",{...r,type:r.type||"text",required:!0,disabled:!!l,onChange:f=>d(f.target.value),className:n("w-full max-w-md rounded-md border border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm",{"cursor-not-allowed bg-gray-100 text-gray-400":l})}):Ve("div",{className:"h-[2.35rem] w-full max-w-md animate-pulse rounded-md bg-gray-200"})]}),Ut("div",{className:"flex items-center justify-between space-x-4 rounded-b-lg border-t border-gray-200 bg-gray-50 p-3 sm:px-10",children:[typeof o=="string"?Ve("p",{className:"prose-sm prose-a:underline prose-a:underline-offset-4 hover:prose-a:text-gray-700 text-gray-500 transition-colors",dangerouslySetInnerHTML:{__html:o||""}}):o,Ve("div",{className:"shrink-0",children:Ve(ie,{text:a,loading:m,disabled:p,disabledTooltip:l})})]})]})}import{useId as sl}from"react";import{jsx as $t,jsxs as ll}from"react/jsx-runtime";function La({cellSize:e=12,strokeWidth:t=1,patternOffset:r=[0,0],className:o}){let a=sl();return ll("svg",{className:n("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[$t("defs",{children:$t("pattern",{id:`grid-${a}`,x:r[0]-1,y:r[1]-1,width:e,height:e,patternUnits:"userSpaceOnUse",children:$t("path",{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"transparent",stroke:"currentColor",strokeWidth:t})})}),$t("rect",{fill:`url(#grid-${a})`,width:"100%",height:"100%"})]})}import{AlertCircle as cl}from"lucide-react";import dl,{useCallback as ml,useState as ul}from"react";import{jsx as _e,jsxs as Rr}from"react/jsx-runtime";var pl=dl.forwardRef(({className:e,type:t,...r},o)=>{let[a,l]=ul(!1),c=ml(()=>l(!a),[a,l]);return Rr("div",{children:[Rr("div",{className:"relative flex",children:[_e("input",{type:a?"text":t,className:n("w-full max-w-md rounded-md border border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm",r.error&&"border-red-500 focus:border-red-500 focus:ring-red-500",e),ref:o,...r}),Rr("div",{className:"group",children:[r.error&&_e("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex flex-none items-center px-2.5",children:_e(cl,{className:n("size-5 text-white",t==="password"&&"transition-opacity group-hover:opacity-0"),fill:"#ef4444"})}),t==="password"&&_e("button",{className:n("absolute inset-y-0 right-0 flex items-center px-3",r.error&&"opacity-0 transition-opacity group-hover:opacity-100"),type:"button",onClick:()=>c(),"aria-label":a?"Hide password":"Show Password",children:a?_e(Do,{className:"size-4 flex-none text-gray-500 transition hover:text-gray-700","aria-hidden":!0}):_e(Io,{className:"size-4 flex-none text-gray-500 transition hover:text-gray-700","aria-hidden":!0})})]})]}),r.error&&_e("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});pl.displayName="Input";import{flip as vl,offset as bl,size as yl,useDismiss as xl,useFloating as wl,useInteractions as Cl}from"@floating-ui/react";import{Command as we,useCommandState as Nl}from"cmdk";import{Check as kl,ChevronDown as Pl,Search as Mr,X as Sl}from"lucide-react";import{createContext as Rl,forwardRef as Ml,useContext as Dr,useEffect as Lr,useMemo as Ll,useRef as Ta,useState as Er}from"react";import{Drawer as Je}from"vaul";import fl from"next/image";import{useEffect as gl,useState as Ea}from"react";import{jsx as hl}from"react/jsx-runtime";function Gt(e){let[t,r]=Ea(!0),[o,a]=Ea(e.src);gl(()=>a(e.src),[e.src]);let l=c=>{r(!1);let s=c.target;s.naturalWidth<=16&&s.naturalHeight<=16&&a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)};return hl(fl,{...e,src:o,alt:e.alt,className:n(t?"blur-[2px]":"blur-0",e.className),onLoad:l,onError:()=>{a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)},unoptimized:!0})}import{jsx as M,jsxs as Q}from"react/jsx-runtime";var Kt=Rl({inputAttrs:{},openCommandList:!1,setOpenCommandList:()=>{},inputValue:"",setInputValue:()=>{},disabled:!1,selectedItem:null,setSelectedItem:()=>{}});function q1({items:e,selectedItem:t,setSelectedItem:r,className:o,disabled:a,adjustForMobile:l,icon:c,inputAttrs:s,noItemsElement:d}){let m=Ta(null),[i,p]=Er(!1),[f,b]=Er(""),[y,h]=Er(!1);Lr(()=>{i&&h(!1)},[i]),Lr(()=>h(!0),[f]),Lr(()=>{t&&b(t.value)},[t]);let g=Ll(()=>{let w=f.toLowerCase();return y?e.filter(z=>z.value.toLowerCase().includes(w)):f?e.sort((z,ce)=>(ce.value.toLowerCase().includes(w)?1:0)-(z.value.toLowerCase().includes(w)?1:0)):e},[y,f,e]),{refs:C,floatingStyles:P,context:S}=wl({open:i,onOpenChange:p,middleware:[bl(8),yl({apply({elements:{floating:w},availableHeight:z}){Object.assign(w.style,{maxHeight:`${Math.max(75,Math.min(z,290))}px`})},padding:8}),vl({fallbackStrategy:"initialPlacement",padding:8})]}),k=xl(S),{getReferenceProps:x,getFloatingProps:v}=Cl([k]),R=Ta(null),{scrollProgress:I,updateScrollProgress:D}=qe(R),{isMobile:q}=j();return M(Kt.Provider,{value:{inputAttrs:s||{},openCommandList:i,setOpenCommandList:p,inputValue:f,setInputValue:b,disabled:Boolean(a),selectedItem:t,setSelectedItem:r},children:q&&l?Q(Je.Root,{open:i,onOpenChange:p,children:[M(Je.Trigger,{className:"sm:hidden",asChild:!0,children:M(we,{ref:m,className:"relative",shouldFilter:!1,loop:!0,children:Q("div",{className:n("group relative rounded-md border border-gray-300 bg-white px-1 focus-within:border-gray-500 focus-within:ring-1 focus-within:ring-gray-500 md:min-w-[140px]",o),children:[M("div",{className:"absolute inset-y-0 left-0 flex items-center justify-center pl-3 text-gray-400",children:t&&t.image?M("img",{src:t.image,alt:t.value,className:"h-4 w-4 rounded-full"}):c||M(Mr,{className:"h-4 w-4 text-gray-400"})}),Q("div",{className:"flex h-10 px-8",children:[M(Tr,{}),M(Ar,{})]})]})})}),M(Je.Overlay,{className:"fixed inset-0 z-40 bg-gray-100 bg-opacity-10 backdrop-blur"}),Q(Je.Portal,{children:[M(Je.Content,{className:"fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-lg border-t border-gray-200 bg-white",onPointerDownOutside:w=>{w.target instanceof Element&&w.target.closest("[data-sonner-toast]")&&w.preventDefault()},children:Q(we,{ref:m,className:"relative",shouldFilter:!1,loop:!0,children:[Q("div",{className:n("group relative mb-2 rounded-t-md border-b border-gray-300 bg-white p-1 sm:border sm:py-0 sm:focus-within:border-gray-500 sm:focus-within:ring-1 sm:focus-within:ring-gray-200",o),children:[M("div",{className:"absolute inset-y-0 left-0 flex items-center justify-center pl-3 text-gray-400",children:t&&t.image?M("img",{src:t.image,alt:t.value,className:"h-4 w-4 rounded-full"}):c||M(Mr,{className:"h-4 w-4 text-gray-400"})}),Q("div",{className:"flex h-10 px-8",children:[M(Tr,{}),M(Ar,{})]})]}),i&&Q(we.List,{className:"dub-scrollbar h-[70vh] overflow-y-auto p-2",children:[e.length===0&&f===""&&(d?M("div",{children:d}):M("p",{className:"px-4 py-2 text-sm text-gray-600",children:"No items found."})),f!==""&&M(we.Empty,{className:"px-4 py-2 text-sm text-gray-600",children:"No results found."}),M(Aa,{items:g})]})]})}),M(Je.Overlay,{})]})]}):Q(we,{ref:m,className:"relative",shouldFilter:!1,loop:!0,children:[Q("div",{className:n("group rounded-md border border-gray-200 bg-white px-1 transition-all focus-within:border-gray-500 focus-within:ring-4 focus-within:ring-gray-200",o),children:[M("div",{onClick:()=>p(w=>!w),className:"absolute inset-y-0 left-0 flex cursor-pointer items-center justify-center pl-3 text-gray-400",children:t&&t.image?M("img",{src:t.image,alt:t.value,className:"h-4 w-4 rounded-full"}):c||M(Mr,{className:"h-4 w-4 text-gray-400"})}),Q("div",{className:"flex h-10 px-8",children:[M(Tr,{ref:C.setReference,...x()}),M(Ar,{})]})]}),i&&Q("div",{ref:C.setFloating,style:P,...v(),className:"z-20 flex w-full min-w-[160px] flex-col overflow-hidden rounded-md border border-gray-200 bg-white shadow-md",children:[Q("div",{ref:R,onScroll:D,className:"grow overflow-y-auto p-2",children:[Q(we.List,{children:[e.length===0&&f===""&&(d?M("div",{children:d}):M("p",{className:"px-4 py-2 text-sm text-gray-600",children:"No items found."})),f!==""&&M(we.Empty,{className:"px-4 py-2 text-sm text-gray-600",children:"No results found."})]}),M(Aa,{items:g})]}),M("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(I,2)}})]})]})})}var Tr=Ml((e,t)=>{let r=Nl(m=>m.filtered.count===0),{inputAttrs:o,openCommandList:a,setOpenCommandList:l,inputValue:c,setInputValue:s,disabled:d}=Dr(Kt);return M(we.Input,{ref:t,placeholder:(o==null?void 0:o.placeholder)||"Search...",autoFocus:a,onFocus:()=>l(!0),value:c,onValueChange:s,onKeyDown:m=>{m.key==="Escape"?(m.preventDefault(),l(!1)):m.key==="Enter"&&r?l(!1):m.key.match(/^[a-z0-9]$/i)&&!m.metaKey&&l(!0)},disabled:d,className:"block w-full truncate rounded-md border-none px-0 text-base text-gray-900 placeholder-gray-400 outline-none outline-0 transition-all duration-300 focus:ring-0 md:text-sm",autoCapitalize:"none"})});function Ar(){let{setSelectedItem:e,openCommandList:t,setOpenCommandList:r,inputValue:o,setInputValue:a}=Dr(Kt);return M("button",{type:"button",onClick:()=>{r(l=>!l),e(null),a("")},className:"absolute inset-y-0 right-0 my-auto pr-3",children:o.length>0?M(Sl,{className:"h-4 w-4 text-gray-400 transition-all hover:text-gray-700"}):M(Pl,{className:n("h-4 w-4 text-gray-400 transition-all hover:text-gray-700",{"rotate-180 transform":t})})})}function Aa({items:e}){let{setSelectedItem:t,setOpenCommandList:r,setInputValue:o}=Dr(Kt);return e.map(a=>Q(we.Item,{value:a.value,disabled:a.disabled,onSelect:()=>{t(a),o(a.value),r(!1)},className:"group flex cursor-pointer items-center justify-between rounded-md px-4 py-2 text-sm text-gray-900 hover:bg-gray-100 hover:text-gray-900 active:bg-gray-200 aria-disabled:cursor-not-allowed aria-disabled:opacity-75 aria-disabled:hover:bg-white aria-selected:bg-gray-100 aria-selected:text-gray-900",children:[Q("div",{className:"flex items-center space-x-2",children:[a.image&&M(Gt,{src:a.image,alt:a.value,className:"h-4 w-4 rounded-full",width:16,height:16}),M("p",{className:n("whitespace-nowrap py-0.5 text-sm",a.color&&"rounded-md px-2",a.color==="red"&&"bg-red-100 text-red-600",a.color==="yellow"&&"bg-yellow-100 text-yellow-600",a.color==="green"&&"bg-green-100 text-green-600",a.color==="blue"&&"bg-blue-100 text-blue-600",a.color==="purple"&&"bg-purple-100 text-purple-600",a.color==="brown"&&"bg-brown-100 text-brown-600"),children:a.value}),a.label&&M(Et,{className:"text-xs",variant:"neutral",children:a.label})]}),M(kl,{className:"invisible h-5 w-5 text-gray-500 aria-selected:visible"})]},a.id))}import*as Ir from"@radix-ui/react-label";import{cva as El}from"class-variance-authority";import*as Da from"react";import{jsx as Dl}from"react/jsx-runtime";var Tl=El("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Al=Da.forwardRef(({className:e,...t},r)=>Dl(Ir.Root,{ref:r,className:n(Tl(),e),...t}));Al.displayName=Ir.Root.displayName;import{curveNatural as Ia}from"@visx/curve";import{LinearGradient as za}from"@visx/gradient";import{Group as Il}from"@visx/group";import{ParentSize as zl}from"@visx/responsive";import{scaleLinear as Ol,scaleUtc as Vl}from"@visx/scale";import{Area as _l,AreaClosed as Hl}from"@visx/shape";import{motion as Oa}from"framer-motion";import{useId as Fl,useMemo as Va}from"react";import{jsx as ve,jsxs as zr}from"react/jsx-runtime";function lv(e){return ve(zl,{className:"relative",children:({width:t,height:r})=>t>0&&r>0&&ve(Bl,{...{width:t,height:r,...e}})})}var Re={top:8,right:2,bottom:2,left:2};function Bl({width:e,height:t,data:r,curve:o=!0,color:a}){let l=Fl(),c=Va(()=>r.map(({date:m})=>({date:m,value:0})),[r]),{yScale:s,xScale:d}=Va(()=>{let m=r.map(({value:y})=>y),i=Math.max(...m),p=r.map(({date:y})=>y.getTime()),f=new Date(Math.min(...p)),b=new Date(Math.max(...p));return{yScale:Ol({domain:[-2,Math.max(i,2)],range:[t-Re.top-Re.bottom,0],nice:!0,clamp:!0}),xScale:Vl({domain:[f,b],range:[0,e-Re.left-Re.right],nice:!0})}},[r,t,e]);return zr("svg",{width:e,height:t,children:[zr("defs",{children:[ve(za,{id:`${l}-color-gradient`,from:a||"#7D3AEC",to:a||"#DA2778",x1:0,x2:e-Re.left-Re.right,gradientUnits:"userSpaceOnUse"}),ve(za,{id:`${l}-mask-gradient`,from:"white",to:"white",fromOpacity:.3,toOpacity:0,x1:0,x2:0,y1:0,y2:1}),ve("mask",{id:`${l}-mask`,maskContentUnits:"objectBoundingBox",children:ve("rect",{width:"1",height:"1",fill:`url(#${l}-mask-gradient)`})})]}),zr(Il,{left:Re.left,top:Re.top,children:[ve(_l,{data:r,x:({date:m})=>d(m),y:({value:m})=>s(m)??0,curve:o?Ia:void 0,children:({path:m})=>ve(Oa.path,{initial:{d:m(c)||"",opacity:0},animate:{d:m(r)||"",opacity:1},strokeWidth:1.5,stroke:`url(#${l}-color-gradient)`})}),ve(Hl,{data:r,x:({date:m})=>d(m),y:({value:m})=>s(m)??0,yScale:s,curve:o?Ia:void 0,children:({path:m})=>ve(Oa.path,{initial:{d:m(c)||"",opacity:0},animate:{d:m(r)||"",opacity:1},fill:`url(#${l}-color-gradient)`,mask:`url(#${l}-mask)`})})]})]},r.length)}import*as ne from"@radix-ui/react-dialog";import*as Or from"@radix-ui/react-visually-hidden";import{useRouter as Wl}from"next/navigation";import{Drawer as He}from"vaul";import{jsx as oe,jsxs as Xe}from"react/jsx-runtime";function fv({children:e,className:t,showModal:r,setShowModal:o,onClose:a,desktopOnly:l,preventDefaultClose:c,drawerRootProps:s}){let d=Wl(),m=({dragged:p}={})=>{c&&!p||(a&&a(),o?o(!1):d.back())},{isMobile:i}=j();return i&&!l?oe(He.Root,{open:o?r:!0,onOpenChange:p=>{p||m({dragged:!0})},...s,children:Xe(He.Portal,{children:[oe(He.Overlay,{className:"fixed inset-0 z-50 bg-gray-100 bg-opacity-10 backdrop-blur"}),oe(He.Content,{onPointerDownOutside:p=>{p.target instanceof Element&&p.target.closest("[data-sonner-toast]")&&p.preventDefault()},className:n("fixed bottom-0 left-0 right-0 z-50 flex flex-col","rounded-t-[10px] border-t border-gray-200 bg-white",t),children:Xe("div",{className:"scrollbar-hide flex-1 overflow-y-auto rounded-t-[10px] bg-inherit",children:[Xe(Or.Root,{children:[oe(He.Title,{children:"Modal"}),oe(He.Description,{children:"This is a modal"})]}),oe(Ul,{}),e]})}),oe(He.Overlay,{})]})}):oe(ne.Root,{open:o?r:!0,onOpenChange:p=>{p||m()},children:Xe(ne.Portal,{children:[oe(ne.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-gray-100 bg-opacity-50 backdrop-blur-md"}),Xe(ne.Content,{onOpenAutoFocus:p=>p.preventDefault(),onCloseAutoFocus:p=>p.preventDefault(),onPointerDownOutside:p=>{p.target instanceof Element&&p.target.closest("[data-sonner-toast]")&&p.preventDefault()},className:n("fixed inset-0 z-40 m-auto h-fit w-full max-w-md","border border-gray-200 bg-white p-0 shadow-xl sm:rounded-2xl","scrollbar-hide animate-scale-in overflow-y-auto",t),children:[Xe(Or.Root,{children:[oe(ne.Title,{children:"Modal"}),oe(ne.Description,{children:"This is a modal"})]}),e]})]})})}function Ul(){return oe("div",{className:"sticky top-0 z-20 flex items-center justify-center rounded-t-[10px] bg-inherit",children:oe("div",{className:"my-3 h-1 w-12 rounded-full bg-gray-300"})})}import{Fragment as $l,jsx as jt,jsxs as et}from"react/jsx-runtime";var _a=n("flex h-7 items-center justify-center gap-2 whitespace-nowrap rounded-md border border-gray-200 bg-white px-2 text-sm text-gray-600","outline-none hover:bg-gray-50 focus-visible:border-gray-500","disabled:cursor-not-allowed disabled:border-gray-200 disabled:text-gray-400 disabled:bg-gray-100");function vv({pagination:e,setPagination:t,totalCount:r,unit:o=c=>`item${c?"s":""}`,className:a,children:l}){return et("div",{className:n("flex items-center justify-between gap-2 text-sm leading-6 text-gray-600",a),children:[et("div",{className:"flex items-center gap-2",children:[et("div",{children:[jt("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",r>0&&et($l,{children:[et("span",{className:"font-medium",children:[(e.pageIndex-1)*e.pageSize+1,"-",Math.min((e.pageIndex-1)*e.pageSize+e.pageSize,r)]})," ","of"," "]}),jt("span",{className:"font-medium",children:xt(r,{full:!0})})," ",typeof o=="function"?o(r!==1):o]}),l]}),et("div",{className:"flex items-center gap-2",children:[jt("button",{type:"button",className:_a,onClick:()=>t({...e,pageIndex:e.pageIndex-1}),disabled:e.pageIndex===1,children:"Previous"}),jt("button",{type:"button",className:_a,onClick:()=>t({...e,pageIndex:e.pageIndex+1}),disabled:(e.pageIndex-1)*e.pageSize+e.pageSize>=r,children:"Next"})]})]})}import*as Me from"@radix-ui/react-radio-group";import{Circle as Gl}from"lucide-react";import*as Vr from"react";import{jsx as Yt}from"react/jsx-runtime";var Kl=Vr.forwardRef(({className:e,...t},r)=>Yt(Me.Root,{className:n("grid gap-2",e),...t,ref:r}));Kl.displayName=Me.Root.displayName;var jl=Vr.forwardRef(({className:e,...t},r)=>Yt(Me.Item,{ref:r,className:n("border-primary text-primary ring-offset-background focus-visible:ring-ring aspect-square h-4 w-4 rounded-full border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:Yt(Me.Indicator,{className:"flex items-center justify-center",children:Yt(Gl,{className:"h-2.5 w-2.5 fill-current text-current"})})}));jl.displayName=Me.Item.displayName;import{Drawer as Le}from"vaul";import{jsx as Fe,jsxs as Jl}from"react/jsx-runtime";function Yl({children:e,contentProps:t,nested:r=!1,...o}){let a=r?Le.NestedRoot:Le.Root;return Fe(a,{direction:"right",handleOnly:!0,...o,children:Jl(Le.Portal,{children:[Fe(Le.Overlay,{className:"fixed inset-0 bg-black/20"}),Fe(Le.Content,{...t,onPointerDownOutside:l=>{var c;l.target instanceof Element&&l.target.closest("[data-sonner-toast]")&&l.preventDefault(),(c=t==null?void 0:t.onPointerDownOutside)==null||c.call(t,l)},className:n("fixed bottom-2 right-2 top-2 z-10 flex w-[calc(100%-16px)] outline-none md:w-[540px]",t==null?void 0:t.className),style:{"--initial-transform":"calc(100% + 8px)","user-select":"auto",...t==null?void 0:t.style},children:Fe("div",{className:"scrollbar-hide flex size-full grow flex-col overflow-y-auto rounded-lg bg-white",children:e})})]})})}function ql({className:e,...t}){return Fe(Le.Title,{className:n("text-xl font-medium text-zinc-900",e),...t})}function Zl(e){return Fe(Le.Description,{...e})}function Ql(e){return Fe(Le.Close,{...e})}var Pv=Object.assign(Yl,{Title:ql,Description:Zl,Close:Ql});import{useEffect as Xl,useRef as ec,useState as tc}from"react";import{jsx as Ha}from"react/jsx-runtime";var rc=`
3
3
  attribute vec2 position;
4
4
 
5
5
  void main()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dub/ui",
3
3
  "description": "UI components for Dub.co",
4
- "version": "0.2.13",
4
+ "version": "0.2.14",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -56,17 +56,17 @@
56
56
  "dependencies": {
57
57
  "@floating-ui/react": "^0.26.20",
58
58
  "@internationalized/date": "^3.5.3",
59
- "@radix-ui/react-accordion": "^1.0.1",
60
- "@radix-ui/react-checkbox": "^1.0.4",
61
- "@radix-ui/react-dialog": "1.0.5",
62
- "@radix-ui/react-label": "^2.0.2",
63
- "@radix-ui/react-navigation-menu": "^1.1.2",
64
- "@radix-ui/react-popover": "1.0.7",
65
- "@radix-ui/react-radio-group": "^1.1.3",
66
- "@radix-ui/react-slot": "1.0.1",
67
- "@radix-ui/react-switch": "^1.0.1",
68
- "@radix-ui/react-tooltip": "^1.0.7",
69
- "@radix-ui/react-visually-hidden": "^1.1.0",
59
+ "@radix-ui/react-accordion": "^1.2.2",
60
+ "@radix-ui/react-checkbox": "^1.1.3",
61
+ "@radix-ui/react-dialog": "1.1.4",
62
+ "@radix-ui/react-label": "^2.1.1",
63
+ "@radix-ui/react-navigation-menu": "^1.2.3",
64
+ "@radix-ui/react-popover": "1.1.4",
65
+ "@radix-ui/react-radio-group": "^1.2.2",
66
+ "@radix-ui/react-slot": "1.1.1",
67
+ "@radix-ui/react-switch": "^1.1.2",
68
+ "@radix-ui/react-tooltip": "^1.1.6",
69
+ "@radix-ui/react-visually-hidden": "^1.1.1",
70
70
  "@react-aria/datepicker": "^3.10.0",
71
71
  "@react-stately/datepicker": "^3.9.3",
72
72
  "@tanstack/react-table": "^8.17.3",