@dub/ui 0.2.58 → 0.2.59
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/chunk-V6S4RZAX.mjs +2 -0
- package/dist/icons/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/icons/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import{$,$a,$b,$c,$d,A,Aa,Ab,Ac,Ad,B,Ba,Bb,Bc,Bd,C,Ca,Cb,Cc,Cd,D,Da,Db,Dc,Dd,E,Ea,Eb,Ec,Ed,F,Fa,Fb,Fc,Fd,G,Ga,Gb,Gc,Gd,H,Ha,Hb,Hc,Hd,I,Ia,Ib,Ic,Id,J,Ja,Jb,Jc,Jd,K,Ka,Kb,Kc,Kd,L,La,Lb,Lc,Ld,M,Ma,Mb,Mc,Md,N,Na,Nb,Nc,Nd,O,Oa,Ob,Oc,Od,P,Pa,Pb,Pc,Pd,Q,Qa,Qb,Qc,Qd,R,Ra,Rb,Rc,Rd,S,Sa,Sb,Sc,Sd,T,Ta,Tb,Tc,Td,U,Ua,Ub,Uc,Ud,V,Va,Vb,Vc,Vd,W,Wa,Wb,Wc,Wd,X,Xa,Xb,Xc,Xd,Y,Ya,Yb,Yc,Yd,Z,Za,Zb,Zc,Zd,_,_a,_b,_c,_d,a,aa,ab,ac,ad,ae,b,ba,bb,bc,bd,be,c,ca,cb,cc,cd,ce,d,da,db,dc,dd,de,e,ea,eb,ec,ed,ee,f,fa,fb,fc,fd,fe,g,ga,gb,gc,gd,ge,h,ha,hb,hc,hd,he,i,ia,ib,ic,id,ie,j,ja,jb,jc,jd,je,k,ka,kb,kc,kd,ke,l,la,lb,lc,ld,le,m,ma,mb,mc,md,me,n,na,nb,nc,nd,ne,o,oa,ob,oc,od,oe,p,pa,pb,pc,pd,pe,q,qa,qb,qc,qd,qe,r,ra,rb,rc,rd,re,s,sa,sb,sc,sd,se,t,ta,tb,tc,td,te,u,ua,ub,uc,ud,ue,v,va,vb,vc,vd,w,wa,wb,wc,wd,x,xa,xb,xc,xd,y,ya,yb,yc,yd,z,za,zb,zc,zd}from"../chunk-
|
|
2
|
+
import{$,$a,$b,$c,$d,A,Aa,Ab,Ac,Ad,B,Ba,Bb,Bc,Bd,C,Ca,Cb,Cc,Cd,D,Da,Db,Dc,Dd,E,Ea,Eb,Ec,Ed,F,Fa,Fb,Fc,Fd,G,Ga,Gb,Gc,Gd,H,Ha,Hb,Hc,Hd,I,Ia,Ib,Ic,Id,J,Ja,Jb,Jc,Jd,K,Ka,Kb,Kc,Kd,L,La,Lb,Lc,Ld,M,Ma,Mb,Mc,Md,N,Na,Nb,Nc,Nd,O,Oa,Ob,Oc,Od,P,Pa,Pb,Pc,Pd,Q,Qa,Qb,Qc,Qd,R,Ra,Rb,Rc,Rd,S,Sa,Sb,Sc,Sd,T,Ta,Tb,Tc,Td,U,Ua,Ub,Uc,Ud,V,Va,Vb,Vc,Vd,W,Wa,Wb,Wc,Wd,X,Xa,Xb,Xc,Xd,Y,Ya,Yb,Yc,Yd,Z,Za,Zb,Zc,Zd,_,_a,_b,_c,_d,a,aa,ab,ac,ad,ae,b,ba,bb,bc,bd,be,c,ca,cb,cc,cd,ce,d,da,db,dc,dd,de,e,ea,eb,ec,ed,ee,f,fa,fb,fc,fd,fe,g,ga,gb,gc,gd,ge,h,ha,hb,hc,hd,he,i,ia,ib,ic,id,ie,j,ja,jb,jc,jd,je,k,ka,kb,kc,kd,ke,l,la,lb,lc,ld,le,m,ma,mb,mc,md,me,n,na,nb,nc,nd,ne,o,oa,ob,oc,od,oe,p,pa,pb,pc,pd,pe,q,qa,qb,qc,qd,qe,r,ra,rb,rc,rd,re,s,sa,sb,sc,sd,se,t,ta,tb,tc,td,te,u,ua,ub,uc,ud,ue,v,va,vb,vc,vd,w,wa,wb,wc,wd,x,xa,xb,xc,xd,y,ya,yb,yc,yd,z,za,zb,zc,zd}from"../chunk-V6S4RZAX.mjs";import"../chunk-EY3HINQT.mjs";export{Q as Africa,aa as Airtm,W as Amazon,ha as AndroidLogo,ia as AppleLogo,ja as ArrowBoldUp,ka as ArrowRight,la as ArrowTrendUp,ma as ArrowTurnLeft,na as ArrowTurnRight2,oa as ArrowUpRight,pa as ArrowsOppositeDirectionX,qa as ArrowsOppositeDirectionY,R as Asia,ra as BadgeCheck,sa as BadgeCheck2Fill,ta as Bell,ua as Blog,va as Bolt,wa as BoltFill,ya as Book2,za as Book2Fill,Aa as Book2Small,xa as BookOpen,Ba as Books2,Ca as BoxArchive,Da as BracketsCurly,Ea as BriefcaseFill,Fa as Brush,Ga as BulletList,Ha as BulletListFill,Ia as Calculator,Ma as Calendar6,Ka as CalendarDays,Ja as CalendarIcon,La as CalendarRefresh,H as CardAmex,I as CardDiscover,J as CardMastercard,K as CardVisa,Na as Cards,Oa as CaretUpFill,ba as CashApp,Pa as ChartActivity2,Qa as ChartArea2,Ra as ChartLine,X as ChatGPT,Sa as Check,Ta as Check2,Ua as CheckboxCheckedFill,Va as CheckboxUnchecked,Wa as ChevronLeft,Xa as ChevronRight,Ya as CircleCheck,Za as CircleCheckFill,_a as CircleDollar,$a as CircleDotted,ab as CircleHalfDottedCheck,bb as CircleHalfDottedClock,cb as CircleInfo,db as CirclePercentage,eb as CirclePlay,fb as CirclePlayFill,gb as CircleQuestion,hb as CircleUser,ib as CircleWarning,jb as CircleXmark,kb as Circles,lb as Circles3,mb as CloudUpload,nb as Code,ob as ColorPalette2,pb as ConnectedDots,rb as ConnectedDots4,qb as ConnectedDotsFill,sb as Connections3,a as Copy,tb as CreditCard,ub as Crosshairs3,vb as Crown,b as CrownSmall,wb as Cube,xb as CubeSettings,yb as CubeSettingsFill,zb as CurrencyDollar,Ab as CursorRays,Bb as DatabaseKey,Cb as Desktop,Db as DiamondTurnRight,Eb as DiamondTurnRightFill,Fb as Directions,Gb as Discount,Hb as Dots,Ib as Download,c as DubAnalyticsIcon,d as DubApiIcon,e as DubCraftedShield,f as DubLinksIcon,g as DubPartnersIcon,h as DubProductIcon,Jb as Duplicate,Kb as Earth,Lb as EarthPosition,Mb as Envelope,Nb as EnvelopeAlert,Ob as EnvelopeArrowRight,Pb as EnvelopeFill,S as Europe,i as ExpandingArrow,Qb as Eye,Rb as EyeSlash,t as Facebook,Sb as FeatherFill,Y as Figma,Tb as FileContent,Ub as FileZip2,Wb as Filter2,Vb as FilterBars,Yb as Flag2,Zb as Flag6,Xb as FlagWavy,_b as Flask,$b as FlaskSmall,ac as Folder,fc as Folder5,bc as FolderBookmark,cc as FolderLock,dc as FolderPlus,ec as FolderShield,gc as GamingConsole,hc as Gauge6,ic as Gear,jc as Gear2,kc as Gear3,lc as Gem,mc as Gift,nc as GiftFill,Z as GitHubEnhanced,u as Github,oc as Globe,rc as Globe2,pc as GlobePointer,qc as GlobeSearch,L as Go,v as Google,_ as GoogleEnhanced,sc as GreekTemple,tc as GridIcon,uc as GridLayoutRows,vc as GridPlus,wc as GripDotsVertical,xc as Headset,yc as HeartFill,zc as HexadecagonStar,Ac as History,Bc as Hyperlink,Cc as Icosahedron,Dc as Incognito,Ec as InfinityIcon,Fc as InputField,Gc as InputPassword,Hc as InputPasswordPointer,Ic as InputSearch,w as Instagram,Jc as InvoiceDollar,Kc as Key,Lc as LayoutSidebar,Mc as License,Nc as LifeRing,Oc as LinesY,Qc as Link4,Pc as LinkBroken,x as LinkedIn,q as LoadingCircle,r as LoadingDots,s as LoadingSpinner,Rc as LocationPin,Sc as Lock,Tc as LockFill,j as Magic,Uc as Magnifier,Vc as MapPosition,k as MarkdownIcon,Wc as MarketingTarget,l as MatrixLines,Xc as Menu3,Yc as MessageSmile,Zc as MicrophoneFill,_c as Minus,$c as MobilePhone,ad as MoneyBill,bd as MoneyBill2,cd as MoneyBills2,dd as Msgs,T as NorthAmerica,ed as Note,nd as NucleoPhoto,U as Oceania,fd as OfficeBuilding,ue as PLAN_FEATURE_ICONS,gd as Page2,hd as Paintbrush,id as Palette2,jd as PaperPlane,ca as Payoneer,da as Paypal,ld as Pen2,kd as PenWriting,md as PercentageArrowDown,m as Photo,M as Php,od as Plug2,pd as Plus,qd as Plus2,rd as Post,y as Prisma,z as ProductHunt,sd as Pyramid,N as Python,td as QRCode,A as Raycast,ud as Receipt2,vd as ReferredVia,wd as Refresh2,xd as Robot,O as Ruby,yd as SatelliteDish,zd as ScanText,Ad as Scribble,Bd as ShieldAlert,Cd as ShieldCheck,Dd as ShieldKeyhole,Ed as ShieldSlash,Fd as ShieldUser,Gd as Shuffle,B as Slack,Hd as Sliders,n as SortOrder,V as SouthAmerica,Id as Sparkle3,$ as Spotify,Jd as SquareChart,Kd as SquareLayoutGrid5,Ld as SquareLayoutGrid6,Md as SquareUserSparkle2,Nd as SquareXmark,Od as Stars2,ea as Stripe,fa as StripeLink,o as Success,Zd as TV,Pd as TableIcon,Qd as TableRows2,Rd as Tablet,Sd as Tag,Td as Tags,p as Tick,C as TikTok,Ud as Timer2,D as Tinybird,Vd as Toggle2Fill,Wd as Toggles,Xd as Trash,Yd as TriangleWarning,E as Twitter,P as Typescript,_d as UiCard,F as Unsplash,$d as User,ae as UserCheck,be as UserCrown,ce as UserDelete,de as UserFocus,ee as UserMinus,fe as UserPlus,ge as UserXmark,he as Users,ke as Users2,le as Users6,ie as UsersFill,je as UsersSettings,ga as Venmo,me as Versions2,ne as Views,oe as Watch,pe as Webhook,qe as Window,re as WindowSearch,se as WindowSettings,te as Xmark,G as YouTube};
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import{$ as kp,$a as g0,$b as rf,$c as Kf,$d as Bg,A as da,Aa as Zp,Ab as Ra,Ac as Sf,Ad as bg,B as np,Ba as qp,Bb as V0,Bc as Rf,Bd as hg,C as ip,Ca as Xp,Cb as H0,Cc as Tf,Cd as vg,D as sp,Da as Jp,Db as _0,Dc as Ha,Dd as xg,E as tr,Ea as ha,Eb as nr,Ec as Lf,Ed as yg,F as lp,Fa as Qp,Fb as F0,Fc as Mf,Fd as wg,G as rr,Ga as e0,Gb as B0,Gc as Df,Gd as Ng,H as cp,Ha as va,Hb as W0,Hc as _a,Hd as Cg,I as dp,Ia as t0,Ib as $0,Ic as Fa,Id as kg,J as mp,Ja as r0,Jb as U0,Jc as Ef,Jd as Pg,K as up,Ka as o0,Kb as Ta,Kc as If,Kd as Sg,L as ma,La as a0,Lb as G0,Lc as Af,Ld as Rg,M as ua,Ma as n0,Mb as j0,Mc as Of,Md as Tg,N as pa,Na as i0,Nb as K0,Nc as ir,Nd as Lg,O as fa,Oa as s0,Ob as Y0,Oc as zf,Od as Mg,P as ga,Pa as l0,Pb as La,Pc as Vf,Pd as Dg,Q as pp,Qa as c0,Qb as Ma,Qc as Hf,Qd as Eg,R as fp,Ra as d0,Rb as Da,Rc as _f,Rd as Ig,S as gp,Sa as xa,Sb as Ea,Sc as Ff,Sd as Ag,T as bp,Ta as ar,Tb as Z0,Tc as Bf,Td as Og,U as hp,Ua as ya,Ub as q0,Uc as Wf,Ud as Ua,V as vp,Va as wa,Vb as X0,Vc as $f,Vd as Ga,W as xp,Wa as m0,Wb as J0,Wc as Uf,Wd as zg,X as yp,Xa as u0,Xb as Q0,Xc as Gf,Xd as Vg,Y as wp,Ya as Na,Yb as ef,Yc as jf,Yd as Hg,Z as Np,Za as p0,Zb as Ia,Zc as sr,Zd as _g,_ as Cp,_a as f0,_b as tf,_c as lr,_d as Fg,a as ra,aa as Pp,ab as Ca,ac as of,ad as Yf,ae as Wg,b as qu,ba as Sp,bb as ka,bc as af,bd as Zf,be as $g,c as it,ca as Rp,cb as Pa,cc as nf,cd as qf,ce as Ug,d as Jt,da as Tp,db as b0,dc as sf,dd as Xf,de as Gg,e as Xu,ea as Lp,eb as h0,ec as lf,ed as Jf,ee as jg,f as st,fa as Mp,fb as v0,fc as cf,fd as Qf,fe as Kg,g as lt,ga as Dp,gb as x0,gc as df,gd as Ba,ge as Yg,h as Yr,ha as Ep,hb as y0,hc as mf,hd as eg,he as Zg,i as oa,ia as Ip,ib as Zr,ic as Aa,id as tg,ie as Pt,j as aa,ja as Ap,jb as w0,jc as uf,jd as rg,je as qg,k as Ju,ka as Op,kb as N0,kc as pf,kd as og,ke as Xg,l as Qu,la as zp,lb as C0,lc as ff,ld as ag,le as Jg,m as na,ma as Vp,mb as Sa,mc as Oa,md as ng,me as Qg,n as ia,na as Hp,nb as k0,nc as gf,nd as ig,ne as ja,o as sa,oa as ba,ob as P0,oc as bf,od as sg,oe as eb,p as la,pa as _p,pb as S0,pc as za,pd as ct,pe as tb,q as kt,qa as Fp,qb as R0,qc as hf,qd as lg,qe as rb,r as ep,ra as Bp,rb as T0,rc as Va,rd as cg,re as ob,s as ke,sa as Wp,sb as L0,sc as vf,sd as dg,se as ab,t as tp,ta as $p,tb as M0,tc as xf,td as mg,te as nb,u as Qt,ua as Up,ub as D0,uc as yf,ud as ug,ue as ib,v as rp,va as Gp,vb as E0,vc as wf,vd as Wa,w as op,wa as jp,wb as I0,wc as Nf,wd as pg,x as er,xa as Kp,xb as A0,xc as Cf,xd as fg,y as ap,ya as Yp,yb as O0,yc as kf,yd as $a,z as ca,za as or,zb as z0,zc as Pf,zd as gg}from"./chunk-MPAUQNBI.mjs";import{a as Y}from"./chunk-NWME2ANF.mjs";import{a as jr,b as wt,c as Yo,d as Zo,e as Nt,f as qo,g as Xo,h as Ct,i as Kr,j as Jo,k as V,l as Ce,m as Qo,n as ge,o as qt,p as i,q as Xt,r as ea,s as ta}from"./chunk-EY3HINQT.mjs";import*as ie from"@radix-ui/react-accordion";import{ChevronDown as Hi}from"lucide-react";import*as dr from"react";import{jsx as cr,jsxs as Wi}from"react/jsx-runtime";var ub=ie.Root,_i=dr.forwardRef(({className:e,...t},r)=>cr(ie.Item,{ref:r,className:i("border-b border-b-slate-200 py-3 last:border-none",e),...t}));_i.displayName="AccordionItem";var Fi=dr.forwardRef(({className:e,children:t,variant:r="chevron",...o},a)=>{let n=r==="chevron"?Hi:ct;return cr(ie.Header,{className:"flex",children:Wi(ie.Trigger,{ref:a,className:i("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,cr(n,{className:"h-5 w-5 flex-none transition-transform duration-300"})]})})});Fi.displayName=ie.Trigger.displayName;var Bi=dr.forwardRef(({className:e,children:t,...r},o)=>cr(ie.Content,{ref:o,className:i("data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-neutral-500 transition-all sm:text-base",e),...r,children:t}));Bi.displayName=ie.Content.displayName;import{cva as $i}from"class-variance-authority";import*as mr from"react";import{jsx as qr}from"react/jsx-runtime";var Ui=$i("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"}}),Gi=mr.forwardRef(({className:e,variant:t,...r},o)=>qr("div",{ref:o,role:"alert",className:i(Ui({variant:t}),e),...r}));Gi.displayName="Alert";var ji=mr.forwardRef(({className:e,...t},r)=>qr("h5",{ref:r,className:i("text-md mb-2 font-medium leading-none tracking-tight",e),...t}));ji.displayName="AlertTitle";var Ki=mr.forwardRef(({className:e,...t},r)=>qr("div",{ref:r,className:i("text-sm [&_p]:leading-relaxed",e),...t}));Ki.displayName="AlertDescription";import{sha256 as Yi}from"js-sha256";import{useState as Zi}from"react";import{jsx as Xr}from"react/jsx-runtime";function qi(e){if(e!=null&&e.image)return e.image;if(!(e!=null&&e.id))return"https://api.dub.co/og/avatar";let t=`https://api.dub.co/og/avatar/${e.id}`;return e.email?`https://0.gravatar.com/avatar/${Yi(e.email)}?d=${t}`:t}function yb({user:e={},className:t}){if(!e)return Xr("div",{className:i("h-10 w-10 animate-pulse rounded-full border border-neutral-300 bg-neutral-100",t)});let[r,o]=Zi(qi(e));return Xr("img",{alt:`Avatar for ${e.name||e.email}`,referrerPolicy:"no-referrer",src:r,className:i("h-10 w-10 rounded-full border border-neutral-300",t),draggable:!1,onError:()=>{o(`https://api.dub.co/og/avatar/${e.id}`)}})}function wb({id:e,className:t}){return Xr("img",{src:`https://api.dicebear.com/9.x/shapes/svg?seed=${e}`,alt:"avatar",className:i("h-10 w-10 rounded-full",t),draggable:!1})}import{cva as Xi}from"class-variance-authority";import{jsx as Qi}from"react/jsx-runtime";var Ji=Xi("max-w-fit rounded-full border px-2 py-px text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"border-neutral-400 text-neutral-500",violet:"border-violet-600 bg-violet-600 text-white",blue:"border-blue-500 bg-blue-500 text-white",green:"border-green-100 bg-green-100 text-green-900",sky:"border-sky-900 bg-sky-900 text-white",black:"border-black bg-black text-white",gray:"border-neutral-200 bg-neutral-100 text-neutral-800",neutral:"border-neutral-400 text-neutral-500",amber:"border-amber-800 bg-amber-800 text-white",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 ur({className:e,variant:t,...r}){return Qi("span",{className:i(Ji({variant:t}),e),...r})}import{cva as ns}from"class-variance-authority";import{forwardRef as is}from"react";import*as be from"@radix-ui/react-tooltip";import es from"linkify-react";import{HelpCircle as ts}from"lucide-react";import rs from"next/link";import{useState as os}from"react";import{Fragment as as,jsx as U,jsxs as je}from"react/jsx-runtime";function Ob({children:e}){return U(be.Provider,{delayDuration:150,children:e})}function Q({children:e,content:t,contentClassName:r,disabled:o,side:a="top",disableHoverableContent:n,delayDuration:c=0,...s}){let[u,l]=os(!1);return je(be.Root,{open:o?!1:u,onOpenChange:l,delayDuration:c,disableHoverableContent:n,children:[U(be.Trigger,{asChild:!0,onClick:()=>{l(!0)},onBlur:()=>{l(!1)},children:e}),U(be.Portal,{children:U(be.Content,{sideOffset:8,side:a,className:"animate-slide-up-fade pointer-events-auto z-[99] items-center overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-sm",collisionPadding:0,...s,children:typeof t=="string"?U("span",{className:i("block max-w-xs text-pretty px-4 py-2 text-center text-sm text-neutral-700",r),children:t}):typeof t=="function"?t({setOpen:l}):t})})]})}function zb({title:e,cta:t,href:r,target:o,onClick:a}){return je("div",{className:"flex max-w-xs flex-col items-center space-y-3 p-4 text-center",children:[U("p",{className:"text-sm text-neutral-700",children:e}),t&&(r?U(rs,{href:r,...o?{target:o}:{},className:i(se({variant:"primary"}),"flex h-9 w-full items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm"),children:t}):a?U(te,{onClick:a,text:t,variant:"primary",className:"h-9"}):null)]})}function Vb({title:e,cta:t,href:r}){return je("div",{className:"max-w-xs px-4 py-2 text-center text-sm text-neutral-700",children:[e,t&&r&&je(as,{children:[" ",U("a",{href:r,target:"_blank",rel:"noopener noreferrer",onClick:o=>o.stopPropagation(),className:"inline-flex text-neutral-500 underline underline-offset-4 hover:text-neutral-800",children:t})]})]})}function Hb({children:e,className:t,tooltipClassName:r}){return U("div",{className:i("block max-w-xs whitespace-pre-wrap text-balance px-4 py-2 text-center text-sm text-neutral-700",r),children:U(es,{as:"p",options:{target:"_blank",rel:"noopener noreferrer nofollow",className:i("underline underline-offset-4 text-neutral-400 hover:text-neutral-700",t)},children:e})})}function _b(e){return U(Q,{...e,children:U(ts,{className:"h-4 w-4 text-neutral-500"})})}function Fb({value:e,unit:t="total clicks",prefix:r,children:o,lastClicked:a}){return(!e||e<1e3)&&!a?o:U(Q,{content:je("div",{className:"block max-w-xs px-4 py-2 text-center text-sm text-neutral-700",children:[je("p",{className:"text-sm font-semibold text-neutral-700",children:[r,Xt(e||0,{full:!0})," ",t]}),a&&je("p",{className:"mt-1 text-xs text-neutral-500",suppressHydrationWarning:!0,children:["Last clicked ",Xo(a,{withAgo:!0})]})]}),children:o})}function Bb({children:e,content:t,...r}){return U(Q,{content:t,...r,children:U("div",{className:"flex cursor-pointer items-center",children:U(ur,{variant:"gray",className:"border-neutral-300 transition-all hover:bg-neutral-200",children:e})})})}function Wb({children:e,tooltipProps:t,...r}){return U(Q,{...t,children:U("button",{type:"button",...r,className:i("flex h-6 w-6 items-center justify-center rounded-md text-neutral-500 transition-colors duration-75 hover:bg-neutral-100 active:bg-neutral-200 disabled:cursor-not-allowed disabled:hover:bg-transparent",r.className),children:e})})}function pr({children:e,tooltipProps:t}){return t?U(Q,{...t,children:U("div",{children:e})}):e}import{jsx as dt,jsxs as Ka}from"react/jsx-runtime";var se=ns("transition-all",{variants:{variant:{primary:"border-black bg-black dark:bg-white dark:border-white text-content-inverted hover:bg-inverted hover:ring-4 hover:ring-border-subtle",secondary:i("border-border-subtle bg-white dark:bg-black text-content-emphasis hover:bg-bg-muted focus-visible:border-border-emphasis outline-none","data-[state=open]:border-border-emphasis data-[state=open]:ring-4 data-[state=open]:ring-border-subtle"),outline:"border-transparent text-content-default hover:bg-bg-subtle",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"}}),te=is(({text:e,variant:t="primary",className:r,textWrapperClassName:o,shortcutClassName:a,loading:n,icon:c,shortcut:s,disabledTooltip:u,right:l,...d},m)=>u?dt(Q,{content:u,children:Ka("div",{className:i("flex h-10 w-full cursor-not-allowed items-center justify-center gap-x-2 rounded-md border border-neutral-200 bg-neutral-100 px-4 text-sm text-neutral-400 transition-all focus:outline-none",{"border-transparent bg-transparent":t==null?void 0:t.endsWith("outline")},r),children:[c,e&&dt("div",{className:i("min-w-0 truncate",s&&"flex-1 text-left",o),children:e}),s&&dt("kbd",{className:i("hidden rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-400 md:inline-block",{"bg-neutral-100":t==null?void 0:t.endsWith("outline")},a),children:s})]})}):Ka("button",{ref:m,type:d.onClick?"button":"submit",className:i("group flex h-10 w-full items-center justify-center gap-2 whitespace-nowrap rounded-md border px-4 text-sm",d.disabled||n?"cursor-not-allowed border-neutral-200 bg-neutral-100 text-neutral-400 outline-none":se({variant:t}),r),disabled:d.disabled||n,...d,children:[n?dt(ke,{}):c||null,e&&dt("div",{className:i("min-w-0 truncate",s&&"flex-1 text-left",o),children:e}),s&&dt("kbd",{className:i("hidden rounded px-2 py-0.5 text-xs font-light transition-all duration-75 md:inline-block",{"bg-neutral-700 text-neutral-400 group-hover:bg-neutral-600 group-hover:text-neutral-300":t==="primary","bg-neutral-200 text-neutral-400 group-hover:bg-neutral-100 group-hover:text-neutral-500":t==="secondary","bg-neutral-100 text-neutral-500 group-hover:bg-neutral-200":t==="outline","bg-red-100 text-red-600 group-hover:bg-red-500 group-hover:text-white":t==="danger-outline"},a),children:s}),l]}));te.displayName="Button";import{cva as ss}from"class-variance-authority";import{createContext as ls}from"react";import{jsx as Ya}from"react/jsx-runtime";var cs=ss("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"}}}),St=ls({variant:"loose",loading:!1});function Za({variant:e="loose",loading:t=!1,className:r,children:o}){return Ya("ul",{className:i(cs({variant:e,loading:t}),r),"data-variant":e,children:Ya(St.Provider,{value:{variant:e,loading:t},children:o})})}import{cva as ds}from"class-variance-authority";import{createContext as ms,useContext as us,useEffect as ps,useRef as fs,useState as gs}from"react";import{jsx as qa,jsxs as vs}from"react/jsx-runtime";var bs=ds("w-full group/card border-neutral-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-neutral-50 transition-colors",loose:"border rounded-xl transition-[filter] data-[hover-state-enabled=true]:hover:drop-shadow-card-hover"}}}),hs="w-full py-2.5 px-4",Jr=ms({hovered:!1});function Xa({outerClassName:e,innerClassName:t,children:r,onClick:o,onAuxClick:a,hoverStateEnabled:n=!0,banner:c}){let{variant:s}=us(St),u=fs(null),[l,d]=gs(!1);ps(()=>{if(!l||!u.current)return;let p=setInterval(()=>{var f;((f=u.current)==null?void 0:f.matches(":hover"))===!1&&d(!1)},1e3);return()=>clearInterval(p)},[l]);let m=p=>!(document.getElementById("modal-backdrop")||Ct(p));return vs("li",{ref:u,className:i(bs({variant:s}),e),onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),"data-hover-state-enabled":n,children:[c,qa("div",{className:i(hs,t),onClick:o?p=>{m(p)&&o(p)}:void 0,onAuxClick:a?p=>{m(p)&&a(p)}:void 0,children:qa(Jr.Provider,{value:{hovered:l},children:r})})]})}var u1=Object.assign(Za,{Card:Object.assign(Xa,{Context:Jr}),Context:St});import xs from"embla-carousel-autoplay";import ys from"embla-carousel-react";import{ArrowLeft as ws,ArrowRight as Ns}from"lucide-react";import{createContext as Cs,forwardRef as Tt,useCallback as Rt,useContext as ks,useEffect as Qr,useState as eo}from"react";import{jsx as Pe,jsxs as en}from"react/jsx-runtime";var to=2e3,Ja=Cs(null);function he(){let e=ks(Ja);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function Qa(){let{api:e}=he(),[t,r]=eo(0),o=Rt(a=>r((a==null?void 0:a.selectedScrollSnap())??0),[]);return Qr(()=>{!e||(o(e),e.on("reInit",o),e.on("select",o))},[e,o]),t}var Ps=Tt(({orientation:e="horizontal",opts:t,setApi:r,autoplay:o,plugins:a,className:n,children:c,...s},u)=>{let[l,d]=ys({...t,axis:e==="horizontal"?"x":"y"},[...o?[xs(typeof o=="object"?o:{delay:to})]:[],...a||[]]),[m,p]=eo(!1),[f,b]=eo(!1),h=Rt(P=>{!P||(p(P.canScrollPrev()),b(P.canScrollNext()))},[]),y=Rt(()=>{d==null||d.scrollPrev()},[d]),w=Rt(()=>{d==null||d.scrollNext()},[d]),x=Rt(P=>{P.key==="ArrowLeft"?(P.preventDefault(),y()):P.key==="ArrowRight"&&(P.preventDefault(),w())},[y,w]);return Qr(()=>{!d||!r||r(d)},[d,r]),Qr(()=>{if(!!d)return h(d),d.on("reInit",h),d.on("select",h),()=>{d==null||d.off("select",h)}},[d,h]),Pe(Ja.Provider,{value:{carouselRef:l,api:d,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:y,scrollNext:w,canScrollPrev:m,canScrollNext:f},children:Pe("div",{ref:u,onKeyDownCapture:x,className:i("relative",n),role:"region","aria-roledescription":"carousel",...s,children:c})})});Ps.displayName="Carousel";var Ss=Tt(({className:e,...t},r)=>{let{carouselRef:o,orientation:a}=he();return Pe("div",{ref:o,className:"overflow-hidden",children:Pe("div",{ref:r,className:i("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});Ss.displayName="CarouselContent";var Rs=Tt(({className:e,...t},r)=>{let{orientation:o}=he();return Pe("div",{ref:r,role:"group","aria-roledescription":"slide",className:i("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",e),...t})});Rs.displayName="CarouselItem";var Ts=Tt(({className:e,...t},r)=>{let{orientation:o,scrollPrev:a,canScrollPrev:n}=he();return en("button",{ref:r,className:i("absolute",o==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",se({variant:"secondary",className:"p-2"}),e),disabled:!n,onClick:a,...t,children:[Pe(ws,{className:"h-4 w-4"}),Pe("span",{className:"sr-only",children:"Previous slide"})]})});Ts.displayName="CarouselPrevious";var Ls=Tt(({className:e,...t},r)=>{let{orientation:o,scrollNext:a,canScrollNext:n}=he();return en("button",{ref:r,className:i("absolute",o==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",se({variant:"secondary",className:"p-2"}),e),disabled:!n,onClick:a,...t,children:[Pe(Ns,{className:"h-4 w-4"}),Pe("span",{className:"sr-only",children:"Next slide"})]})});Ls.displayName="CarouselNext";import{cva as Ms}from"class-variance-authority";import{motion as Ds}from"framer-motion";import{ChevronLeft as Es,ChevronRight as Is}from"lucide-react";import*as Ee from"react";import{jsx as Ke,jsxs as Lt}from"react/jsx-runtime";var As=Ms("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-neutral-800/10 bg-white sm:bottom-6 "}}}),M1=({variant:e="simple",className:t})=>{var b;let{scrollNext:r,scrollPrev:o,canScrollNext:a,canScrollPrev:n,api:c}=he(),s=(b=c==null?void 0:c.plugins())==null?void 0:b.autoplay,[u,l]=Ee.useState(0),[d,m]=Ee.useState(!1),p=Ee.useCallback(h=>{l((h==null?void 0:h.selectedScrollSnap())??0)},[]),f=Ee.useCallback(h=>()=>{s&&s.isPlaying()&&s.stop(),h()},[s]);return Ee.useEffect(()=>{!c||(p(c),m((s==null?void 0:s.isPlaying())??!1),c.on("reInit",p),c.on("select",p),c.on("autoplay:play",()=>m(!0)),c.on("autoplay:stop",()=>m(!1)))},[c,s,p]),Lt("div",{className:i(As({variant:e}),t),children:[e!=="simple"&&Lt("button",{className:"cursor-pointer rounded-full p-2 hover:bg-neutral-50 active:bg-neutral-100",disabled:!n,onClick:f(o),children:[Ke(Es,{className:"h-4 w-4"}),Ke("span",{className:"sr-only",children:"Previous slide"})]}),c!=null&&Ke("div",{className:"flex items-center gap-1",children:c.slideNodes().map((h,y)=>Lt("button",{onClick:f(()=>c.scrollTo(y)),className:"rounded-full p-0.5 hover:bg-neutral-100 active:bg-neutral-200 sm:p-1.5",children:[Ke("div",{className:i("relative isolate h-1.5 w-1.5 overflow-hidden rounded-full transition-all",y===u?"bg-black":"bg-black/20",d&&y===u&&"w-6 bg-black/20"),children:d&&y===u&&Ke(Ds.div,{initial:{x:"-100%"},animate:{x:0},transition:{type:"tween",duration:((s==null?void 0:s.options.delay)??to)/1e3},className:"animate-fill-width h-full w-full rounded-full bg-black"})}),Lt("span",{className:"sr-only",children:["Slide ",y+1]})]},y))}),e!=="simple"&&Lt("button",{className:"cursor-pointer rounded-full p-2 hover:bg-neutral-50 active:bg-neutral-100",disabled:!a,onClick:f(r),children:[Ke(Is,{className:"h-4 w-4"}),Ke("span",{className:"sr-only",children:"Next slide"})]})]})};import Os from"embla-carousel-react";import{forwardRef as zs,useCallback as Vs,useEffect as Hs}from"react";import{jsx as fr}from"react/jsx-runtime";var _1=({className:e,...t})=>{let{api:r}=he(),[o,a]=Os({dragFree:!0}),n=Vs(c=>{!c||!a||a==null||a.scrollTo(c.selectedScrollSnap())},[a]);return Hs(()=>{if(!(!r||!a))return n(r),r.on("reInit",n),r.on("select",n),()=>{r==null||r.off("reInit",n),r==null||r.off("select",n)}},[r,a,n]),fr("div",{className:"overflow-hidden",ref:o,children:fr("div",{className:i("mx-4 flex gap-4",e),...t})})},F1=zs(({index:e,className:t,...r},o)=>{let{api:a}=he(),n=Qa();return fr("div",{ref:o,children:fr("button",{type:"button",onClick:()=>{var s;if(!a)return;let c=(s=a.plugins())==null?void 0:s.autoplay;c&&c.isPlaying()&&c.stop(),a.scrollTo(e)},className:typeof t=="function"?t({active:e===n}):t,...r})})});import*as Mt from"@radix-ui/react-checkbox";import{forwardRef as _s}from"react";import{jsx as ro,jsxs as Fs}from"react/jsx-runtime";var mt=_s(({className:e,...t},r)=>ro(Mt.Root,{ref:r,className:i("peer h-5 w-5 shrink-0 rounded-md border border-neutral-200 bg-white outline-none focus-visible:border-black disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=indeterminate]:bg-blue-500",e),...t,children:Fs(Mt.Indicator,{className:"group/indicator flex items-center justify-center text-white",children:[ro(ar,{className:"size-3 group-data-[state=indeterminate]/indicator:hidden"}),ro(lr,{className:"size-3 group-data-[state=checked]/indicator:hidden"})]})}));mt.displayName=Mt.Root.displayName;import{Command as Et,CommandInput as El,CommandItem as Il,useCommandState as Al}from"cmdk";import{ChevronDown as Ol}from"lucide-react";import{forwardRef as zl,isValidElement as Vl,useCallback as Hl,useEffect as vr,useRef as _l,useState as Dt}from"react";import{motion as Ll}from"framer-motion";import{forwardRef as Ml,useRef as Dl}from"react";import{useEffect as Bs,useState as Ws}from"react";function tn(e){if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}function oo(e,t){let[r,o]=Ws(tn(e)??t);return Bs(()=>{let n=tn(e);n&&o(n)},[e]),[r,n=>{o(n),window.localStorage.setItem(e,JSON.stringify(n))}]}function $s(e){return e&&typeof e=="object"&&Array.isArray(e.all)&&Array.isArray(e.defaultVisible)}function Z1(e,t){if(!$s(t)){let o=t,a=u=>{let l=o[u];return Object.fromEntries(l.all.map(d=>[d,l.defaultVisible.includes(d)]))},n=Object.fromEntries(Object.keys(o).map(u=>[u,a(u)])),[c,s]=oo(e,n);return{columnVisibility:c,setColumnVisibility:(u,l)=>{let d=o[u].all,m=c[u]||{},p=Object.fromEntries(d.map(f=>[f,f in l?l[f]:m[f]??!1]));s({...c,[u]:p})}}}else{let o=t,a=Object.fromEntries(o.all.map(s=>[s,o.defaultVisible.includes(s)])),[n,c]=oo(e,a);return{columnVisibility:n,setColumnVisibility:s=>{let u=o.all,l=n||{},d=Object.fromEntries(u.map(m=>[m,m in s?s[m]:l[m]??!1]));c(d)}}}}import ao from"js-cookie";import{useEffect as Us,useState as Gs}from"react";function Q1(e,t,r){let[o,a]=Gs(()=>{let c=ao.get(e);return c?JSON.parse(c):t});return Us(()=>{let c=()=>{let s=ao.get(e);s&&a(JSON.parse(s))};return window.addEventListener("storage",c),()=>{window.removeEventListener("storage",c)}},[e]),[o,c=>{a(c),ao.set(e,JSON.stringify(c),r)}]}import{useCallback as js,useEffect as Ks,useRef as Ys,useState as Zs}from"react";var ut=(e=3e3)=>{let t=Ys(null),[r,o]=Zs(!1),a=()=>{t.current&&(clearTimeout(t.current),t.current=null)},n=js(async(c,{onSuccess:s,throwOnError:u}={})=>{a();try{typeof c=="string"?await navigator.clipboard.writeText(c):c instanceof ClipboardItem&&await navigator.clipboard.write([c]),o(!0),s==null||s(),Number.isFinite(e)&&e>=0&&(t.current=setTimeout(()=>o(!1),e))}catch(l){if(console.error("Failed to copy: ",l),u)throw l}},[e]);return Ks(()=>()=>a(),[]),[r,n]};import{useEffect as qs,useState as Xs}from"react";function ah(){let[e,t]=Xs(null);return qs(()=>{let r=document.querySelector("[data-mdx-container]");if(!r)return;let o=r.offsetTop-1,a=new IntersectionObserver(s=>{var m,p,f;let u=s[0];if(!u)return;let l=(((m=u.rootBounds)==null?void 0:m.height)||0)*.3+o;for(let b=1;b<s.length;b++){let h=s[b];if(!h)break;(h.boundingClientRect.top<u.boundingClientRect.top||u.boundingClientRect.bottom<o)&&(u=h)}let d=u.target;for(;d&&d.getBoundingClientRect().bottom<o;)d=(p=n.get(d))==null?void 0:p.next;for(;d&&d.getBoundingClientRect().top>l;)d=(f=n.get(d))==null?void 0:f.prev;d&&t(d.getAttribute("href"))},{threshold:1,rootMargin:`-${o}px 0px 0px 0px`}),n=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("#","")}import{useCallback as Js}from"react";function lh(e){return{handleKeyDown:Js(r=>{if(r.key==="Enter"&&r.metaKey){if(r.preventDefault(),e!=null&&e.current){e.current.requestSubmit();return}let o=r.target.form;o==null||o.requestSubmit()}},[])}}import{useEffect as Qs,useState as el}from"react";function uh(e,t={}){let{root:r,defaultValue:o}=t,[a,n]=el(o??!1);return Qs(()=>{let c=()=>{let u=e.current;if(!u)return;let l=r==null?void 0:r.current,d=u.getBoundingClientRect(),m=l?l.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};n(d.top<m.bottom&&d.bottom>m.top&&d.left<m.right&&d.right>m.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 tl,useState as rl}from"react";function gh(){let[e,t]=rl(!1);return tl(()=>{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 ol,useState as al}from"react";function xh(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:a=!1}={}){let[n,c]=al(),s=(n==null?void 0:n.isIntersecting)&&a,u=([l])=>{c(l)};return ol(()=>{let l=e==null?void 0:e.current;if(!!!window.IntersectionObserver||s||!l)return;let m={threshold:t,root:r,rootMargin:o},p=new IntersectionObserver(u,m);return p.observe(l),()=>p.disconnect()},[e,JSON.stringify(t),r,o,s]),n}import{createContext as nl,useCallback as il,useContext as sl,useEffect as rn,useId as ll,useState as cl}from"react";import{jsx as dl}from"react/jsx-runtime";var on=nl({listeners:[],setListeners:()=>{}});function Ph({children:e}){let[t,r]=cl([]);return dl(on.Provider,{value:{listeners:t,setListeners:r},children:e})}function Ie(e,t,r={}){let o=ll(),{listeners:a,setListeners:n}=sl(on),c=il(s=>{if(r.enabled===!1)return;let u=s.target,l=document.getElementById("modal-backdrop"),d=document.querySelector("[data-sheet-overlay]");if(u.tagName==="INPUT"||u.tagName==="TEXTAREA"||!!l!=!!r.modal||!!d!=!!r.sheet)return;let m=[...s.metaKey?["meta"]:[],...s.ctrlKey?["ctrl"]:[],...s.altKey?["alt"]:[],s.key].join("+");if(Array.isArray(e)?!e.includes(m):m!==e)return;let p=a.filter(b=>b.enabled!==!1&&!!l==!!b.modal&&!!d==!!b.sheet&&(Array.isArray(b.key)?b.key.includes(m):b.key===m));!p.length||qo(p,(b,h)=>(h.priority??0)-(b.priority??0))[0].id!==o||(s.preventDefault(),t(s))},[e,a,o,t,r.enabled,r.modal,r.sheet]);rn(()=>(document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)),[c]),rn(()=>(n(s=>[...s.filter(u=>u.id!==o),{id:o,key:e,...r}]),()=>n(s=>s.filter(u=>u.id!==o))),[JSON.stringify(e),r.enabled,r.priority])}import{toast as ml}from"sonner";import ul from"swr";function Mh(e,t){let{data:r,isLoading:o,mutate:a}=ul(e,ge);return{data:r,isLoading:o,update:async(n,c)=>ml.promise(a(n(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 ln,useMemo as vl}from"react";import{useEffect as an,useState as pl}from"react";function nn({pageSize:e,page:t,onPageChange:r}){let[o,a]=pl({pageIndex:t,pageSize:e});return an(()=>{a(n=>({...n,pageIndex:t}))},[t]),an(()=>{r==null||r(o.pageIndex)},[o]),{pagination:o,setPagination:a}}import{usePathname as fl,useRouter as gl,useSearchParams as bl}from"next/navigation";import{useCallback as hl}from"react";function sn(){let e=fl(),t=gl(),r=bl(),o=Object.fromEntries(r),a=(c,s)=>{let u=new URLSearchParams(r);if((s==null?void 0:s.include)&&Array.isArray(s.include)){let d=new URLSearchParams;r.forEach((m,p)=>{var f;(f=s.include)!=null&&f.includes(p)&&d.set(p,m)}),u=d}(s==null?void 0:s.exclude)&&Array.isArray(s.exclude)&&s.exclude.forEach(d=>u.delete(d)),c&&Object.entries(c).forEach(([d,m])=>u.set(d,m));let l=u.toString();return l.length>0?`?${l}`:""},n=hl(({set:c,del:s,replace:u,scroll:l=!0,getNewPath:d,arrayDelimiter:m=","})=>{let p=new URLSearchParams(r);c&&Object.entries(c).forEach(([h,y])=>p.set(h,Array.isArray(y)?y.join(m):y)),s&&(Array.isArray(s)?s.forEach(h=>p.delete(h)):p.delete(s));let f=p.toString(),b=`${e}${f.length>0?`?${f}`:""}`;if(d)return b;u?t.replace(b,{scroll:!1}):t.push(b,{scroll:l})},[r,e,t]);return{pathname:e,router:t,searchParams:r,searchParamsObj:o,queryParams:n,getQueryString:a}}function Wh(e=ta){let{searchParams:t,queryParams:r}=sn(),o=vl(()=>parseInt(t.get("page")||"1")||1,[t.get("page")]),{pagination:a,setPagination:n}=nn({pageSize:e,page:o,onPageChange:c=>{r(c===1?{del:"page",scroll:!1}:{set:{page:c.toString()},scroll:!1})}});return ln(()=>{let c=parseInt(t.get("page")||"1")||1;n(s=>({...s,pageIndex:c}))},[t.get("page")]),ln(()=>{r(a.pageIndex===1?{del:"page",scroll:!1}:{set:{page:a.pageIndex.toString()},scroll:!1})},[a]),{pagination:a,setPagination:n}}import{useEffect as xl}from"react";function Gh(){xl(()=>{let e=new URL(window.location.href);e.searchParams.has("_gl")&&setTimeout(()=>{e.searchParams.delete("_gl"),window.history.replaceState({},"",e.toString())},2e3)},[])}import{useEffect as yl,useState as wl}from"react";function gr(e){let[t,r]=wl(),o=([a])=>{r(a)};return yl(()=>{let a=e==null?void 0:e.current;if(!a)return;let n=new ResizeObserver(o);return n.observe(a),()=>n.disconnect()},[e]),t}import{useCallback as Nl,useEffect as cn,useState as Cl}from"react";function dn(e,{container:t}={}){let[r,o]=Cl(!1),a=Nl(()=>{o((t!=null&&t.current?t.current.scrollTop:window.scrollY)>e)},[e]);return cn(()=>{let n=(t==null?void 0:t.current)??window;return n.addEventListener("scroll",a),()=>n.removeEventListener("scroll",a)},[a]),cn(()=>{a()},[a]),r}import{useCallback as kl,useEffect as Pl,useState as Sl}from"react";function Ae(e){let[t,r]=Sl(1),o=kl(()=>{if(!e.current)return;let{scrollTop:n,scrollHeight:c,clientHeight:s}=e.current;r(c===s?1:Math.min(n/(c-s),1))},[]),a=gr(e);return Pl(o,[a]),{scrollProgress:t,updateScrollProgress:o}}import{useEffect as Rl}from"react";import{toast as un}from"sonner";import{jsx as br,jsxs as mn}from"react/jsx-runtime";function Tl({id:e,message:t,undo:r}){let o=()=>{r(),un.dismiss(e)},a=n=>{n.key==="z"&&(n.ctrlKey||n.metaKey)&&o()};return Rl(()=>(document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)),[]),mn("div",{className:"flex w-full items-center justify-between space-x-2",children:[mn("div",{className:"flex items-center space-x-2",children:[br(sa,{}),br("p",{className:"font-medium",children:t})]}),br("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 iv(){return({id:t,message:r,undo:o,duration:a})=>un(br(Tl,{id:t,message:r,undo:o}),{id:t,...a&&{duration:a}})}import{jsx as pn}from"react/jsx-runtime";var Se=Ml(({width:e=!1,height:t=!1,className:r,transition:o,children:a,...n},c)=>{var l,d;let s=Dl(null),u=gr(s);return pn(Ll.div,{ref:c,className:i("overflow-hidden",r),animate:{width:e?((l=u==null?void 0:u.contentRect)==null?void 0:l.width)??"auto":"auto",height:t?((d=u==null?void 0:u.contentRect)==null?void 0:d.height)??"auto":"auto"},transition:o??{type:"spring",duration:.3},...n,children:pn("div",{ref:s,className:i(t&&"h-max",e&&"w-max"),children:a})})});Se.displayName="AnimatedSizeContainer";import*as Oe from"@radix-ui/react-popover";import{Drawer as pt}from"vaul";import{jsx as Re,jsxs as hr}from"react/jsx-runtime";function ve({children:e,content:t,align:r="center",side:o="bottom",openPopover:a,setOpenPopover:n,mobileOnly:c,popoverContentClassName:s,onOpenAutoFocus:u,collisionBoundary:l,sticky:d,onEscapeKeyDown:m,onWheel:p}){let{isMobile:f}=Y();return c||f?hr(pt.Root,{open:a,onOpenChange:n,children:[Re(pt.Trigger,{className:"sm:hidden",asChild:!0,children:e}),hr(pt.Portal,{children:[Re(pt.Overlay,{className:"bg-bg-subtle fixed inset-0 z-50 bg-opacity-10 backdrop-blur"}),hr(pt.Content,{className:"border-border-subtle bg-bg-default fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-[10px] border-t",onEscapeKeyDown:m,onPointerDownOutside:b=>{b.target instanceof Element&&b.target.closest("[data-sonner-toast]")&&b.preventDefault()},children:[Re("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:Re("div",{className:"bg-border-default my-3 h-1 w-12 rounded-full"})}),Re("div",{className:"bg-bg-default flex min-h-[150px] w-full items-center justify-center overflow-hidden pb-8 align-middle shadow-xl",children:t})]}),Re(pt.Overlay,{})]})]}):hr(Oe.Root,{open:a,onOpenChange:n,children:[Re(Oe.Trigger,{className:"sm:inline-flex",asChild:!0,children:e}),Re(Oe.Portal,{children:Re(Oe.Content,{sideOffset:8,align:r,side:o,className:i("animate-slide-up-fade border-border-subtle bg-bg-default z-50 items-center rounded-lg border drop-shadow-lg sm:block",s),sticky:d,collisionBoundary:l,onOpenAutoFocus:u,onEscapeKeyDown:m,onWheel:p,children:t})})]})}import{Fragment as xr,jsx as M,jsxs as Te}from"react/jsx-runtime";function Fl(e,t){return e===!0}function Ov({multiple:e,selected:t,setSelected:r,onSelect:o,options:a,icon:n,placeholder:c="Select...",searchPlaceholder:s="Search...",emptyState:u,createLabel:l,onCreate:d,buttonProps:m,shortcutHint:p,caret:f,side:b,open:h,onOpenChange:y,onSearchChange:w,shouldFilter:x=!0,inputRight:P,inputClassName:k,optionRight:N,optionClassName:_,matchTriggerWidth:$,hideSearch:S=!1,children:R}){let K=Fl(e,r),v=Array.isArray(t)?t:t?[t]:[],{isMobile:C}=Y(),[F,L]=Dt(!1),I=h??F,J=y??L,[fe,$r]=Dt(""),[Go,Ur]=Dt(!1),[Gr,Oi]=Dt(void 0),[zi,jo]=Dt(!1),Vi=O=>{var nt;if(o==null||o(O),!!r)if(K){let Ue=v.some(({value:Ge})=>Ge===O.value);r(Ue?v.filter(({value:Ge})=>Ge!==O.value):[...v,O])}else r(v.length&&((nt=v[0])==null?void 0:nt.value)===O.value?null:O),J(!1)},Ko=Hl((O,nt)=>nt===""?[...O.filter(Ue=>Ue.first&&!v.some(Ge=>Ge.value===Ue.value)),...v,...O.filter(Ue=>!Ue.first&&!v.some(Ge=>Ge.value===Ue.value))]:O,[v]);return vr(()=>{Go&&(Oi(a&&Ko(a,fe)),Ur(!1))},[Go,a,Ko,fe]),vr(()=>{Ur(!0)},[a]),vr(()=>{I||($r(""),Ur(!0))},[I]),vr(()=>w==null?void 0:w(fe),[fe]),M(ve,{openPopover:I,setOpenPopover:J,align:"start",side:b,onWheel:O=>{O.stopPropagation()},popoverContentClassName:i($&&"sm:w-[var(--radix-popover-trigger-width)]"),content:M(Se,{width:!C&&!$,height:!0,style:{transform:"translateZ(0)"},transition:{ease:"easeInOut",duration:.1},className:"pointer-events-auto",children:Te(Et,{loop:!0,shouldFilter:x,children:[!S&&Te("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[M(El,{placeholder:s,value:fe,onValueChange:$r,className:i("grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-400 focus:ring-0 sm:text-sm",k),onKeyDown:O=>{(O.key==="Escape"||O.key==="Backspace"&&!fe)&&(O.preventDefault(),O.stopPropagation(),J(!1))}}),P&&M("div",{className:"mr-2",children:P}),p&&M("kbd",{className:"mr-2 hidden shrink-0 rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-500 md:block",children:p})]}),M(Bl,{children:M(Et.List,{className:i("flex w-full min-w-[100px] flex-col gap-1 p-1"),children:Gr!==void 0?Te(xr,{children:[Gr.map(O=>M(Wl,{option:O,multiple:K,selected:v.some(({value:nt})=>nt===O.value),onSelect:()=>Vi(O),right:N==null?void 0:N(O),className:_},`${O.label}, ${O.value}`)),fe.length>0&&d&&Te(Il,{className:i("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm text-neutral-700","data-[selected=true]:bg-neutral-100",_),onSelect:async()=>{jo(!0),await(d==null?void 0:d(fe))&&($r(""),J(!1)),jo(!1)},children:[zi?M(ke,{className:"size-4 shrink-0"}):M(ct,{className:"size-4 shrink-0"}),M("div",{className:"grow truncate",children:(l==null?void 0:l(fe))||`Create "${fe}"`})]}),x?M(Ul,{className:"flex min-h-12 items-center justify-center text-sm text-neutral-500",children:u||"No matches"}):Gr.length===0?M("div",{className:"flex min-h-12 items-center justify-center text-sm text-neutral-500",children:u||"No matches"}):null]}):M(Et.Loading,{children:M("div",{className:"flex h-12 items-center justify-center",children:M(ke,{})})})})})]})}),children:M(te,{variant:"secondary",...m,className:i(m==null?void 0:m.className,"flex gap-2"),textWrapperClassName:i(m==null?void 0:m.textWrapperClassName,"w-full flex items-center justify-start"),text:Te(xr,{children:[M("div",{className:"min-w-0 grow truncate text-left",children:R||v.map(O=>O.label).join(", ")||c}),f&&(f===!0?M(Ol,{className:"ml-1 size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"}):f)]}),icon:n?fn(n)?n:M(n,{className:"size-4 shrink-0"}):void 0})})}var Bl=({children:e})=>{let t=_l(null),{scrollProgress:r,updateScrollProgress:o}=Ae(t);return Te(xr,{children:[M("div",{className:"scrollbar-hide max-h-[min(50vh,250px)] w-screen overflow-y-scroll sm:w-auto",ref:t,onScroll:o,children:e}),M("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 Wl({option:e,onSelect:t,multiple:r,selected:o,right:a,className:n}){return Te(xr,{children:[M($l,{disabledTooltip:e.disabledTooltip,children:Te(Et.Item,{className:i("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-neutral-100",Boolean(e.disabledTooltip)&&"cursor-not-allowed opacity-50",n),disabled:!!e.disabledTooltip,onSelect:t,value:e.label+(e==null?void 0:e.value),children:[r&&M("div",{className:"shrink-0 text-neutral-600",children:o?M(ya,{className:"size-4 text-neutral-600"}):M(wa,{className:"size-4 text-neutral-400"})}),Te("div",{className:"flex min-w-0 grow items-center gap-1",children:[e.icon&&M("span",{className:"shrink-0 text-neutral-600",children:fn(e.icon)?e.icon:M(e.icon,{className:"h-4 w-4"})}),M("span",{className:"grow truncate",children:e.label})]}),a,!r&&o&&M(ar,{className:"size-4 shrink-0 text-neutral-600"})]})}),e.separatorAfter&&M(Et.Separator,{className:"-mx-1 my-1 h-px bg-neutral-200"})]})}var $l=({children:e,disabledTooltip:t})=>t?M(Q,{content:t,children:M("div",{children:e})}):e,fn=e=>Vl(e),Ul=zl((e,t)=>Al(o=>o.filtered.count===0)?M("div",{ref:t,"cmdk-empty":"",role:"presentation",...e}):null);import{addYears as yr,format as Gl,isSameMonth as jl}from"date-fns";import{ChevronLeft as gn,ChevronRight as bn,ChevronsLeft as Kl,ChevronsRight as Yl}from"lucide-react";import{forwardRef as Zl,useRef as ql}from"react";import{DayPicker as Xl,useDayPicker as Jl,useDayRender as Ql,useNavigation as ec}from"react-day-picker";import{Fragment as tc,jsx as oe,jsxs as wr}from"react/jsx-runtime";var It=Zl(({onClick:e,icon:t,disabled:r,...o},a)=>oe("button",{ref:a,type:"button",disabled:r,className:i("flex size-7 shrink-0 select-none items-center justify-center rounded border p-1 outline-none transition","border-neutral-200 text-neutral-600 hover:text-neutral-800","hover:bg-neutral-50 active:bg-neutral-100","disabled:pointer-events-none disabled:text-neutral-400"),onClick:e,...o,children:oe(t,{className:"h-full w-full shrink-0"})}));It.displayName="NavigationButton";function hn({mode:e="single",weekStartsOn:t=0,numberOfMonths:r=1,showYearNavigation:o=!1,disableNavigation:a,locale:n,className:c,classNames:s,...u}){return oe(Xl,{mode:e,weekStartsOn:t,numberOfMonths:r,locale:n,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-neutral-400 pb-2",row:"w-full",cell:"relative p-0 text-center focus-within:relative text-neutral-900",day:i("relative size-10 rounded-md text-sm text-neutral-900","hover:bg-neutral-100 active:bg-neutral-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-neutral-300 line-through disabled:hover:bg-transparent",day_outside:"text-neutral-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:()=>oe(gn,{className:"h-4 w-4"}),IconRight:()=>oe(bn,{className:"h-4 w-4"}),Caption:({...l})=>{let{goToMonth:d,nextMonth:m,previousMonth:p,currentMonth:f,displayMonths:b}=ec(),{numberOfMonths:h,fromDate:y,toDate:w}=Jl(),x=b.findIndex(R=>jl(l.displayMonth,R)),P=x===0,k=x===b.length-1,N=h>1&&(P||!k),_=h>1&&(k||!P),$=()=>{let R=yr(f,-1);p&&(!y||R.getTime()>=y.getTime())&&d(R)},S=()=>{let R=yr(f,1);m&&(!w||R.getTime()<=w.getTime())&&d(R)};return wr("div",{className:"flex items-center justify-between",children:[wr("div",{className:"flex items-center gap-1",children:[o&&!_&&oe(It,{disabled:a||!p||y&&yr(f,-1).getTime()<y.getTime(),"aria-label":"Go to previous year",onClick:$,icon:Kl}),!_&&oe(It,{disabled:a||!p,"aria-label":"Go to previous month",onClick:()=>p&&d(p),icon:gn})]}),oe("div",{role:"presentation","aria-live":"polite",className:"text-sm font-medium capitalize tabular-nums text-neutral-900",children:Gl(l.displayMonth,"LLLL yyy",{locale:n})}),wr("div",{className:"flex items-center gap-1",children:[!N&&oe(It,{disabled:a||!m,"aria-label":"Go to next month",onClick:()=>m&&d(m),icon:bn}),o&&!N&&oe(It,{disabled:a||!m||w&&yr(f,1).getTime()>w.getTime(),"aria-label":"Go to next year",onClick:S,icon:Yl})]})]})},Day:({date:l,displayMonth:d})=>{let m=ql(null),{activeModifiers:p,buttonProps:f,divProps:b,isButton:h,isHidden:y}=Ql(l,d,m),{selected:w,today:x,disabled:P,range_middle:k}=p;if(y)return oe(tc,{});if(!h)return oe("div",{...b,className:i("flex items-center justify-center",b.className)});let{children:N,..._}=f;return wr("button",{ref:m,..._,type:"button",children:[N,x&&oe("span",{className:i("absolute inset-x-1/2 bottom-1.5 h-0.5 w-4 -translate-x-1/2 rounded-[2px]",{"bg-blue-500":!w,"!bg-white":w,"!bg-blue-400":w&&k,"text-neutral-400":P})})]})}},...u})}import{enUS as uc}from"date-fns/locale";import{useEffect as mo,useMemo as xn,useRef as pc,useState as Cr}from"react";import{Command as no}from"cmdk";import{Lock as rc}from"lucide-react";import{jsx as Ye,jsxs as oc}from"react/jsx-runtime";var io=({presets:e,onSelect:t,currentValue:r,currentPresetId:o})=>{let a=l=>"dateRange"in l,n=l=>"date"in l,c=(l,d)=>l.getDate()===d.getDate()&&l.getMonth()===d.getMonth()&&l.getFullYear()===d.getFullYear(),s=(l,d)=>{let m=l.from,p=d.from,f=!1;m&&p&&c(m,p)&&(f=!0);let b=l.to,h=d.to,y=!1;return b&&h&&c(b,h)&&(y=!0),f&&y},u=l=>{if(o)return o===l.id;if(a(l)){let d=r;return d&&s(d,l.dateRange)}else if(n(l)){let d=r;return d&&c(d,l.date)}return!1};return Ye(no,{className:"w-full rounded ring-neutral-200 ring-offset-2 focus:outline-none",tabIndex:0,autoFocus:!0,loop:!0,children:Ye(no.List,{className:"[&>*]:flex [&>*]:w-full [&>*]:items-start [&>*]:gap-x-2 [&>*]:gap-y-0.5 [&>*]:sm:flex-col",children:e.map((l,d)=>oc(no.Item,{disabled:l.requiresUpgrade,onSelect:()=>t(l),title:l.label,value:l.id,className:i("group relative flex cursor-pointer items-center justify-between overflow-hidden text-ellipsis whitespace-nowrap rounded border border-neutral-200","px-2.5 py-1.5 text-left text-sm text-neutral-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-neutral-100",u(l)&&"font-semibold text-neutral-800"),children:[Ye("span",{children:l.label}),l.requiresUpgrade?Ye(rc,{className:"h-3.5 w-3.5","aria-hidden":"true"}):l.shortcut?Ye("kbd",{className:"text-neutral-4000 hidden rounded bg-neutral-100 px-2 py-0.5 text-xs font-light group-data-[selected=true]:bg-neutral-200 md:block",children:l.shortcut.toUpperCase()}):null,l.requiresUpgrade&&l.tooltipContent&&Ye(Q,{side:"bottom",content:l.tooltipContent,children:Ye("div",{className:"absolute inset-0 cursor-not-allowed"})})]},d))})})};io.displayName="DatePicker.Presets";import{format as ze}from"date-fns";import{createContext as ac}from"react";var so=ac({isOpen:!1,setIsOpen:()=>{}}),nc=()=>{let e=typeof window<"u"?window.navigator.language:"en-US",t=new Intl.DateTimeFormat(e,{hour:"numeric"}).format();return Number.isInteger(Number(t))},lo=(e,t,r=!1)=>{let o=!nc(),a;return r?a=o?ze(e,"d MMM, yyyy h:mm a",{locale:t}):ze(e,"d MMM, yyyy HH:mm",{locale:t}):a=ze(e,"d MMM, yyyy",{locale:t}),a},vn=(e,t)=>{let{toYear:r,fromYear:o,fromMonth:a,toMonth:n,fromDay:c,toDay:s}=t;if(e&&e.length>0){let u=o,l=r;e.forEach(d=>{var m,p,f,b,h,y;if("date"in d){let w=d.date.getFullYear();if(o&&w<o)throw new Error(`Preset ${d.label} is before fromYear ${u}.`);if(r&&w>r)throw new Error(`Preset ${d.label} is after toYear ${l}.`);if(a&&d.date.getMonth()<a.getMonth())throw new Error(`Preset ${d.label} is before fromMonth ${a}.`);if(n&&d.date.getMonth()>n.getMonth())throw new Error(`Preset ${d.label} is after toMonth ${n}.`);if(c&&d.date.getDate()<c.getDate())throw new Error(`Preset ${d.label} is before fromDay ${c}.`);if(s&&d.date.getDate()>s.getDate())throw new Error(`Preset ${d.label} is after toDay ${ze(s,"MMM dd, yyyy")}.`)}if("dateRange"in d){let w=(m=d.dateRange.from)==null?void 0:m.getFullYear(),x=(p=d.dateRange.to)==null?void 0:p.getFullYear();if(w&&o&&w<o)throw new Error(`Preset ${d.label}'s 'from' is before fromYear ${u}.`);if(x&&r&&x>r)throw new Error(`Preset ${d.label}'s 'to' is after toYear ${l}.`);if(a){let P=(f=d.dateRange.from)==null?void 0:f.getMonth();if(P&&P<a.getMonth())throw new Error(`Preset ${d.label}'s 'from' is before fromMonth ${ze(a,"MMM, yyyy")}.`)}if(n){let P=(b=d.dateRange.to)==null?void 0:b.getMonth();if(P&&P>n.getMonth())throw new Error(`Preset ${d.label}'s 'to' is after toMonth ${ze(n,"MMM, yyyy")}.`)}if(c){let P=(h=d.dateRange.from)==null?void 0:h.getDate();if(P&&P<c.getDate())throw new Error(`Preset ${d.dateRange.from}'s 'from' is before fromDay ${ze(c,"MMM dd, yyyy")}.`)}if(s){let P=(y=d.dateRange.to)==null?void 0:y.getDate();if(P&&P>s.getDate())throw new Error(`Preset ${d.label}'s 'to' is after toDay ${ze(s,"MMM dd, yyyy")}.`)}}})}};import{cva as ic}from"class-variance-authority";import{Calendar as sc,ChevronDown as lc}from"lucide-react";import{forwardRef as cc}from"react";import{jsx as Nr,jsxs as mc}from"react/jsx-runtime";var dc=ic(["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-neutral-200 text-neutral-900 placeholder-neutral-400 transition-all","disabled:pointer-events-none disabled:bg-neutral-100 disabled:text-neutral-400","focus-visible:border-neutral-500 data-[state=open]:border-neutral-500 data-[state=open]:ring-4 data-[state=open]:ring-neutral-200"],{variants:{hasError:{true:"ring-2 ring-red-200 border-red-500"}}}),co=cc(({className:e,children:t,placeholder:r,hasError:o,...a},n)=>mc("button",{ref:n,className:i(dc({hasError:o}),e),...a,children:[Nr(sc,{className:i("h-4 w-4 shrink-0 text-neutral-400",!!t&&"text-neutral-900")}),Nr("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-neutral-900",children:t||(r?Nr("span",{className:"text-neutral-400",children:r}):null)}),Nr(lc,{className:"h-4 w-4 flex-shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}));co.displayName="DatePicker.Trigger";import{jsx as ae,jsxs as yn}from"react/jsx-runtime";var fc=({value:e,defaultValue:t,presetId:r,onChange:o,presets:a,disabled:n,disableNavigation:c,disabledDays:s,showYearNavigation:u=!1,locale:l=uc,placeholder:d="Select date range",hasError:m,align:p="center",className:f,...b})=>{let{isDesktop:h}=Y(),[y,w]=Cr(!1),[x,P]=Cr(a&&r?a==null?void 0:a.find(({id:L})=>L===r):void 0),[k,N]=Cr((x==null?void 0:x.dateRange)??e??t??void 0),[_,$]=Cr(k==null?void 0:k.to),S=xn(()=>k,[y]);mo(()=>{N(e)},[e]),mo(()=>{let L=a==null?void 0:a.find(({id:I})=>I===r);P(L),N((L==null?void 0:L.dateRange)??e??t)},[a,r]),mo(()=>{y?k&&$(k.to):$(k==null?void 0:k.to)},[y]);let R=(L,I)=>{let J=(k==null?void 0:k.from)&&(k==null?void 0:k.to)?{from:I}:L;N(J),P(void 0),(J==null?void 0:J.from)&&(J==null?void 0:J.to)&&(o==null||o(J),w(!1))},K=L=>{N(L.dateRange),P(L),o==null||o(L.dateRange,L),w(!1)},v=()=>{N(S),w(!1)},C=L=>{L||v(),w(L)},F=xn(()=>k?`${k.from?lo(k.from,l):""} - ${k.to?lo(k.to,l):""}`:null,[k,l]);return Ie((a==null?void 0:a.filter(L=>L.shortcut).map(L=>L.shortcut))??[],L=>{let I=a==null?void 0:a.find(J=>J.shortcut===L.key);I&&K(I)}),ae(so.Provider,{value:{isOpen:y,setIsOpen:w},children:ae(ve,{align:p,openPopover:y,setOpenPopover:C,popoverContentClassName:"rounded-xl",content:ae("div",{className:"flex w-full",children:yn("div",{className:"scrollbar-hide relative flex w-full flex-col overflow-x-scroll sm:flex-row-reverse sm:items-start",children:[a&&a.length>0&&ae(gc,{children:ae("div",{className:"absolute px-3 sm:inset-0 sm:left-0",children:ae("div",{className:"sm:py-3",children:ae(io,{currentPresetId:r,currentValue:k,presets:a,onSelect:K})})})}),ae("div",{className:"scrollbar-hide overflow-x-scroll",children:ae(hn,{mode:"range",selected:k,onSelect:R,month:_,onMonthChange:$,numberOfMonths:h?2:1,disabled:s,disableNavigation:c,showYearNavigation:u,locale:l,className:"scrollbar-hide overflow-x-scroll",classNames:{months:"flex flex-row divide-x divide-neutral-200 overflow-x-scroll scrollbar-hide"},...b})})]})}),children:ae(co,{placeholder:d,disabled:n,className:f,hasError:m,"aria-required":b.required||b["aria-required"],"aria-invalid":b["aria-invalid"],"aria-label":b["aria-label"],"aria-labelledby":b["aria-labelledby"],children:(x==null?void 0:x.label)??F})})})};function xx({presets:e,...t}){return e&&vn(e,t),ae(fc,{presets:e,...t})}function gc({children:e}){let t=pc(null),{scrollProgress:r,updateScrollProgress:o}=Ae(t);return yn("div",{className:"relative sm:h-full",children:[ae("div",{ref:t,onScroll:o,className:i("relative flex h-16 w-full items-center sm:h-full sm:w-48","border-b border-neutral-200 sm:border-b-0 sm:border-l","scrollbar-hide overflow-auto"),children:e}),ae("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)}})]})}import{useId as bc}from"react";import{jsx as kr,jsxs as hc}from"react/jsx-runtime";function Rx({dotSize:e=2,gapSize:t=10,patternOffset:r=[0,0],className:o}){let a=bc();return hc("svg",{className:i("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[kr("defs",{children:kr("pattern",{id:`dots-${a}`,x:r[0]-1,y:r[1]-1,width:e+t,height:e+t,patternUnits:"userSpaceOnUse",children:kr("rect",{x:1,y:1,width:e,height:e,fill:"currentColor"})})}),kr("rect",{fill:`url(#dots-${a})`,width:"100%",height:"100%"})]})}import vc from"next/link";import{useEffect as xc,useState as wn}from"react";import yc from"swr";import{jsx as uo,jsxs as Nn}from"react/jsx-runtime";function Cn({className:e}){let{data:t}=yc("https://status.dub.co/api/v1/summary",ge),[r,o]=wn("bg-neutral-200"),[a,n]=wn("Loading status...");return xc(()=>{if(!t)return;let{ongoing_incidents:c}=t;if(c.length>0){let{current_worst_impact:s,name:u}=c[0],l=s==="degraded_performance"?"bg-yellow-500":"bg-red-500";n(u),o(l)}else n("All systems operational"),o("bg-green-500")},[t]),Nn(vc,{href:"https://status.dub.co",target:"_blank",className:i("group flex max-w-fit items-center gap-2 rounded-lg border border-neutral-200 bg-white py-2 pl-2 pr-2.5 transition-colors hover:bg-neutral-50 active:bg-neutral-100",e),children:[Nn("div",{className:"relative size-2",children:[uo("div",{className:i("absolute inset-0 m-auto size-2 animate-ping items-center justify-center rounded-full group-hover:animate-none",r,a==="Loading status..."&&"animate-none")}),uo("div",{className:i("absolute inset-0 z-10 m-auto size-2 rounded-full",r)})]}),uo("p",{className:"text-xs font-medium leading-none text-neutral-600",children:a})]})}import{jsx as Pr,jsxs as kn}from"react/jsx-runtime";function Ox({icon:e,title:t,description:r,learnMore:o,children:a}){return kn("div",{className:"flex flex-col items-center justify-center gap-y-4",children:[Pr("div",{className:"flex size-16 items-center justify-center rounded-2xl border border-neutral-200 bg-neutral-50",children:Pr(e,{className:"size-6 text-neutral-800"})}),Pr("p",{className:"text-center text-base font-medium text-neutral-950",children:t}),r&&kn("p",{className:"max-w-sm text-balance text-center text-sm text-neutral-500",children:[r," ",o&&Pr("a",{href:o,target:"_blank",className:"underline underline-offset-2 hover:text-neutral-800",children:"Learn more \u2197"})]}),a]})}import{cva as wc}from"class-variance-authority";import{useState as Pn}from"react";import{toast as Sn}from"sonner";import{Fragment as Cc,jsx as xe,jsxs as fo}from"react/jsx-runtime";var Rn=["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/csv"],po={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)"},documents:{types:Rn,errorMessage:"File type not supported (document files only)"},programResourceImages:{types:["image/svg+xml","image/png","image/jpeg","image/webp"],errorMessage:"File type not supported (.svg, .png, .jpg, or .webp only)"},programResourceFiles:{types:[...Rn,"application/zip"],errorMessage:"File type not supported (document or zip files only)"}},Nc=wc("group relative isolate flex aspect-[1200/630] w-full flex-col items-center justify-center overflow-hidden bg-white transition-all hover:bg-neutral-50",{variants:{variant:{default:"rounded-md border border-neutral-300 shadow-sm",plain:""}},defaultVariants:{variant:"default"}});function jx({id:e,readFile:t,onChange:r,variant:o,className:a,iconClassName:n,previewClassName:c,icon:s=Sa,customPreview:u,accept:l="any",imageSrc:d,loading:m=!1,clickToUpload:p=!0,showHoverOverlay:f=!0,content:b,maxFileSizeMB:h=0,targetResolution:y,accessibilityLabel:w="File upload",disabled:x=!1}){let[P,k]=Pn(!1),[N,_]=Pn(null),$=async S=>{let R="dataTransfer"in S?S.dataTransfer.files&&S.dataTransfer.files[0]:S.target.files&&S.target.files[0];if(!R)return;if(_(R.name),h>0&&R.size/1024/1024>h){Sn.error(`File size too big (max ${h} MB)`);return}let K=po[l].types;if(K.length&&!K.includes(R.type)){Sn.error(po[l].errorMessage??"File type not supported");return}let v=R;if(y&&R.type.startsWith("image/"))try{let C=await Zo(R,y),F=await fetch(C).then(L=>L.blob());v=new File([F],R.name,{type:R.type})}catch(C){console.error("Error resizing image:",C)}if(t){let C=new FileReader;C.onload=F=>{var L;return r==null?void 0:r({src:(L=F.target)==null?void 0:L.result,file:v})},C.readAsDataURL(v);return}r==null||r({file:v})};return fo("label",{className:i(Nc({variant:o}),x?"cursor-not-allowed":i(p&&"cursor-pointer"),a),children:[m&&xe("div",{className:"absolute inset-0 z-[5] flex items-center justify-center rounded-[inherit] bg-white",children:xe(kt,{})}),xe("div",{className:"absolute inset-0 z-[5]",onDragOver:S=>{S.preventDefault(),S.stopPropagation(),k(!0)},onDragEnter:S=>{S.preventDefault(),S.stopPropagation(),k(!0)},onDragLeave:S=>{S.preventDefault(),S.stopPropagation(),k(!1)},onDrop:async S=>{S.preventDefault(),S.stopPropagation(),$(S),k(!1)}}),fo("div",{className:i("absolute inset-0 z-[3] flex flex-col items-center justify-center rounded-[inherit] border-2 border-transparent bg-white transition-all",x&&"bg-neutral-50",P&&!x&&"cursor-copy border-black bg-neutral-50 opacity-100",d?i("opacity-0",f&&!x&&"group-hover:opacity-100"):i(!x&&"group-hover:bg-neutral-50")),children:[xe(s,{className:i("size-7 transition-all duration-75",x?"text-neutral-400":i("text-neutral-500 group-hover:scale-110 group-active:scale-95",P?"scale-110":"scale-100"),n)}),b!==null&&xe("div",{className:i("mt-2 text-center text-sm text-neutral-500",x&&"text-neutral-400"),children:b??xe(Cc,{children:fo("p",{children:["Drag and drop ",p&&"or click"," to upload."]})})}),xe("span",{className:"sr-only",children:w})]}),d&&(u??xe("img",{src:d,alt:"Preview",className:i("h-full w-full rounded-[inherit] object-cover",c)})),p&&xe("div",{className:"sr-only mt-1 flex shadow-sm",children:xe("input",{id:e,type:"file",accept:po[l].types.join(","),onChange:$,disabled:x},N)})]})}import{AnimatePresence as kc,motion as Tn}from"framer-motion";import{X as Pc}from"lucide-react";import Sc from"next/link";import{isValidElement as Rc}from"react";import{Fragment as Tc,jsx as ee,jsxs as At}from"react/jsx-runtime";function Mn({filters:e,activeFilters:t,onRemove:r,onRemoveAll:o,className:a}){return Ie("Escape",o,{priority:1}),ee(Se,{height:!0,className:"w-full",transition:{type:"tween",duration:.3},children:At("div",{className:i("flex w-full flex-wrap items-start gap-4 sm:flex-nowrap",a),children:[ee("div",{className:"flex grow flex-wrap gap-x-4 gap-y-2",children:ee(kc,{children:t==null?void 0:t.map(({key:n,value:c})=>{if(n==="loader")return ee(Tn.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"h-9 w-48 animate-pulse rounded-md border border-neutral-200 bg-white"},`loader-${c}`);let s=e.find(u=>u.key===n);return s?(s.multiple&&Array.isArray(c)?c:[c]).map(u=>{var f,b,h,y;let l=(f=s.options)==null?void 0:f.find(w=>typeof w.value=="string"&&typeof u=="string"?w.value.toLowerCase()===u.toLowerCase():w.value===u),d=(l==null?void 0:l.icon)??((b=s.getOptionIcon)==null?void 0:b.call(s,u,{key:s.key,option:l}))??s.icon,m=(l==null?void 0:l.label)??((h=s.getOptionLabel)==null?void 0:h.call(s,u,{key:s.key,option:l}))??u,p=(l==null?void 0:l.permalink)??((y=s.getOptionPermalink)==null?void 0:y.call(s,u))??null;return At(Tn.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"flex items-center divide-x rounded-md border border-neutral-200 bg-white text-sm text-black",children:[At("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[ee("span",{className:"shrink-0 text-neutral-600",children:Ln(s.icon)?s.icon:ee(s.icon,{className:"h-4 w-4"})}),s.label]}),ee("div",{className:"px-3 py-2 text-neutral-500",children:"is"}),ee("div",{className:"flex items-center gap-2.5 px-3 py-2",children:s.options?At(Tc,{children:[ee("span",{className:"shrink-0 text-neutral-600",children:Ln(d)?d:ee(d,{className:"h-4 w-4"})}),p?ee(Sc,{href:p,target:"_blank",className:"cursor-alias decoration-dotted underline-offset-2 hover:underline",children:Nt(m,30)}):Nt(m,30)]}):ee("div",{className:"h-5 w-12 animate-pulse rounded-md bg-neutral-200"})}),ee("button",{type:"button",className:"h-full rounded-r-md p-2 text-neutral-500 ring-inset ring-neutral-500 hover:bg-neutral-100 hover:text-neutral-800 focus:outline-none focus-visible:ring-1",onClick:()=>r(n,u),children:ee(Pc,{className:"h-3.5 w-3.5"})})]},`${n}-${u}`)}):(console.error("Filter.List received an activeFilter without a corresponding filter"),null)})})}),(t==null?void 0:t.length)!==0&&At("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-neutral-500 ring-inset ring-neutral-500 transition-colors hover:border-neutral-200 hover:bg-white hover:text-black focus:outline-none",onClick:o,children:["Clear Filters",ee("kbd",{className:"rounded-md border border-neutral-200 px-1.5 py-0.5 text-xs text-neutral-950 group-hover:bg-neutral-50",children:"ESC"})]})]})})}var Ln=e=>Rc(e);import{Command as Ve,useCommandState as Lc}from"cmdk";import{ChevronDown as Mc,ListFilter as Dc}from"lucide-react";import{Fragment as Ec,forwardRef as Ic,isValidElement as En,useCallback as Sr,useEffect as Rr,useImperativeHandle as Ac,useRef as bo,useState as go}from"react";import{Fragment as Fc,jsx as H,jsxs as ye}from"react/jsx-runtime";function In({filters:e,onSelect:t,onRemove:r,onOpenFilter:o,onSearchChange:a,onSelectedFilterChange:n,activeFilters:c,askAI:s,children:u,emptyState:l,className:d}){var R,K;let{isMobile:m}=Y(),p=bo(null),f=bo(),[b,h]=go(!1);Ie("f",()=>h(!0),{enabled:!b});let[y,w]=go(""),[x,P]=go(null),k=Sr(()=>{w(""),P(null)},[]);Rr(()=>{b||k()},[b]);let N=x?e.find(({key:v})=>v===x):null,_=Sr(v=>{p.current&&(f.current={width:p.current.clientWidth,height:p.current.clientHeight}),w(""),P(v),o==null||o(v)},[]),$=Sr(v=>{if(!N||!c)return!1;let C=c.find(({key:F})=>F===x);return(C==null?void 0:C.value)===v||C&&N.multiple&&Array.isArray(C.value)&&C.value.includes(v)},[N]),S=Sr(v=>{N&&($(v)?r(N.key,v):t(N.key,v),N.multiple||h(!1))},[c,N,s]);return Rr(()=>{a==null||a(y)},[y]),Rr(()=>{n==null||n(x)},[x]),Rr(()=>{(N==null?void 0:N.options)&&p.current&&(f.current={width:p.current.clientWidth,height:p.current.clientHeight})},[N==null?void 0:N.options]),H(ve,{openPopover:b,setOpenPopover:h,onEscapeKeyDown:v=>{x&&(v.preventDefault(),k())},content:H(Se,{width:!m,height:!0,className:"rounded-[inherit]",style:{transform:"translateZ(0)"},children:ye(Ve,{loop:!0,shouldFilter:!N||N.shouldFilter!==!1,children:[ye("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[H(zc,{placeholder:`${(N==null?void 0:N.label)||"Filter"}...`,value:y,onValueChange:w,onKeyDown:v=>{(v.key==="Escape"||v.key==="Backspace"&&!y)&&(v.preventDefault(),v.stopPropagation(),x?k():h(!1))},emptySubmit:v=>{v.preventDefault(),v.stopPropagation(),s?(t("ai",N?`${N.label} ${y}`:y),h(!1)):S(y)}}),!N&&H("kbd",{className:"mr-2 hidden shrink-0 rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-500 md:block",children:"F"})]}),H(Vc,{ref:p,children:ye(Ve.List,{className:i("flex w-full flex-col gap-1 p-1",N?"min-w-[100px]":"min-w-[180px]"),children:[N?((K=(R=N.options)==null?void 0:R.filter(v=>!y||!v.hideDuringSearch))==null?void 0:K.map(v=>{let C=$(v.value);return H(Dn,{filter:N,option:v,right:C?H(xa,{className:"h-4 w-4"}):v.right,onSelect:()=>S(v.value)},v.value)}))??H(Ve.Loading,{children:H("div",{className:"-m-1 flex items-center justify-center",style:f.current,children:H(ke,{})})}):e.filter(v=>!v.hideInFilterDropdown).map(v=>ye(Ec,{children:[H(Dn,{filter:v,onSelect:()=>_(v.key)}),v.separatorAfter&&H(Ve.Separator,{className:"-mx-1 my-1 border-b border-neutral-200"})]},v.key)),(!N||N.options)&&H(Hc,{search:y,askAI:s,children:l?Oc(l)?(l==null?void 0:l[x??"default"])??"No matches":l:"No matches"})]})},x)]})}),children:ye("button",{type:"button",className:i("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-neutral-200 bg-white text-neutral-900 placeholder-neutral-400","focus-visible:border-neutral-500 data-[state=open]:border-neutral-500 data-[state=open]:ring-4 data-[state=open]:ring-neutral-200",d),children:[H(Dc,{className:"size-4 shrink-0"}),H("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-neutral-900",children:u??"Filter"}),c!=null&&c.length?H("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-black text-[0.625rem] text-white",children:c.length}):H(Mc,{className:"size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]})})}function Oc(e){return typeof e=="object"&&e!==null&&!En(e)}var zc=e=>{let t=Lc(r=>r.filtered.count===0);return H(Ve.Input,{...e,size:1,className:"grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-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"})},Vc=Ic(({children:e},t)=>{let r=bo(null);Ac(t,()=>r.current);let{scrollProgress:o,updateScrollProgress:a}=Ae(r);return ye(Fc,{children:[H("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",ref:r,onScroll:a,children:e}),H("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 Dn({filter:e,option:t,right:r,onSelect:o}){var s,u;let{isMobile:a}=Y(),n=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??((u=e.getOptionLabel)==null?void 0:u.call(e,t.value,{key:e.key,option:t})):e.label;return ye(Ve.Item,{className:i("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-neutral-100"),onPointerDown:l=>{l.preventDefault()},onPointerUp:l=>{l.preventDefault(),a?setTimeout(o,100):o()},onSelect:o,value:c+(t==null?void 0:t.value),children:[H("span",{className:"shrink-0 text-neutral-600",children:_c(n)?n:H(n,{className:"h-4 w-4"})}),Nt(c,48),H("div",{className:"ml-1 flex shrink-0 grow justify-end text-neutral-500",children:r})]})}var Hc=({search:e,askAI:t,children:r})=>t&&e?ye(Ve.Empty,{className:"flex min-w-[180px] items-center space-x-2 rounded-md bg-neutral-100 px-3 py-2",children:[H(aa,{className:"h-4 w-4"}),ye("p",{className:"text-center text-sm text-neutral-600",children:["Ask AI ",ye("span",{className:"text-black",children:['"',e,'"']})]})]}):H(Ve.Empty,{className:"p-2 text-center text-sm text-neutral-400",children:r}),_c=e=>En(e);var h2={Select:In,List:Mn};import{useMemo as Bc,useState as An}from"react";import{jsx as Ze,jsxs as Tr}from"react/jsx-runtime";function k2({title:e,description:t,inputAttrs:r,helpText:o,buttonText:a="Save Changes",disabledTooltip:n,handleSubmit:c}){let[s,u]=An(r.defaultValue),[l,d]=An(!1),m=Bc(()=>l||!s||s===r.defaultValue,[l,s,r.defaultValue]);return Tr("form",{onSubmit:async p=>{p.preventDefault(),d(!0),await c({[r.name]:s}),d(!1)},className:"rounded-lg border border-neutral-200 bg-white",children:[Tr("div",{className:"relative flex flex-col space-y-6 p-5 sm:p-10",children:[Tr("div",{className:"flex flex-col space-y-3",children:[Ze("h2",{className:"text-xl font-medium",children:e}),Ze("p",{className:"text-sm text-neutral-500",children:t})]}),typeof r.defaultValue=="string"?Ze("input",{...r,type:r.type||"text",required:!0,disabled:!!n,onChange:p=>u(p.target.value),className:i("w-full max-w-md rounded-md border border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",{"cursor-not-allowed bg-neutral-100 text-neutral-400":n})}):Ze("div",{className:"h-[2.35rem] w-full max-w-md animate-pulse rounded-md bg-neutral-200"})]}),Tr("div",{className:"flex items-center justify-between space-x-4 rounded-b-lg border-t border-neutral-200 bg-neutral-50 p-3 sm:px-10",children:[typeof o=="string"?Ze("p",{className:"prose-sm prose-a:underline prose-a:underline-offset-4 hover:prose-a:text-neutral-700 text-neutral-500 transition-colors",dangerouslySetInnerHTML:{__html:o||""}}):o,Ze("div",{className:"shrink-0",children:Ze(te,{text:a,loading:l,disabled:m,disabledTooltip:n})})]})]})}import{useId as Wc}from"react";import{jsx as Lr,jsxs as $c}from"react/jsx-runtime";function qe({cellSize:e=12,strokeWidth:t=1,patternOffset:r=[0,0],className:o}){let a=Wc();return $c("svg",{className:i("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[Lr("defs",{children:Lr("pattern",{id:`grid-${a}`,x:r[0]-1,y:r[1]-1,width:e,height:e,patternUnits:"userSpaceOnUse",children:Lr("path",{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"transparent",stroke:"currentColor",strokeWidth:t})})}),Lr("rect",{fill:`url(#grid-${a})`,width:"100%",height:"100%"})]})}import{AlertCircle as Uc}from"lucide-react";import Gc,{useCallback as jc,useState as Kc}from"react";import{jsx as Xe,jsxs as ho}from"react/jsx-runtime";var Yc=Gc.forwardRef(({className:e,type:t,...r},o)=>{let[a,n]=Kc(!1),c=jc(()=>n(!a),[a,n]);return ho("div",{children:[ho("div",{className:"relative flex",children:[Xe("input",{type:a?"text":t,className:i("w-full max-w-md rounded-md border border-neutral-300 text-neutral-900 placeholder-neutral-400 read-only:bg-neutral-100 read-only:text-neutral-500 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",r.error&&"border-red-500 focus:border-red-500 focus:ring-red-500",e),ref:o,...r}),ho("div",{className:"group",children:[r.error&&Xe("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex flex-none items-center px-2.5",children:Xe(Uc,{className:i("size-5 text-white",t==="password"&&"transition-opacity group-hover:opacity-0"),fill:"#ef4444"})}),t==="password"&&Xe("button",{className:i("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?Xe(Ma,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0}):Xe(Da,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0})})]})]}),r.error&&Xe("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});Yc.displayName="Input";import{flip as Qc,offset as ed,size as td,useDismiss as rd,useFloating as od,useInteractions as ad}from"@floating-ui/react";import{Command as Le,useCommandState as nd}from"cmdk";import{Check as id,ChevronDown as sd,Search as ld,X as cd}from"lucide-react";import{createContext as dd,forwardRef as _n,useContext as wo,useEffect as vo,useMemo as zn,useRef as Vn,useState as xo}from"react";import{Drawer as ft}from"vaul";import Zc from"next/image";import{memo as qc,useEffect as Xc,useState as On}from"react";import{jsx as Jc}from"react/jsx-runtime";var Ot=qc(e=>{let[t,r]=On(!0),[o,a]=On(e.src);Xc(()=>a(e.src),[e.src]);let n=c=>{r(!1);let s=c.target;s.naturalWidth<=16&&s.naturalHeight<=16&&a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)};return Jc(Zc,{...e,src:o,alt:e.alt,className:i(t?"blur-[2px]":"blur-0",e.className),onLoad:n,onError:()=>{a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)},unoptimized:!0})});import{jsx as E,jsxs as le}from"react/jsx-runtime";var Mr=dd({inputAttrs:{},openCommandList:!1,setOpenCommandList:()=>{},inputValue:"",setInputValue:()=>{},disabled:!1,selectedItem:null,setSelectedItem:()=>{}});function e4({items:e,selectedItem:t,setSelectedItem:r,className:o,disabled:a,adjustForMobile:n,icon:c,inputAttrs:s,noItemsElement:u}){let{isMobile:l}=Y(),d=Vn(null),[m,p]=xo(!1),[f,b]=xo(""),[h,y]=xo(!1);vo(()=>{m&&y(!1)},[m]),vo(()=>y(!0),[f]),vo(()=>{t&&b(t.value)},[t]);let w=zn(()=>{let C=f.toLowerCase();return h?e.filter(F=>F.value.toLowerCase().includes(C)):f?e.sort((F,L)=>(L.value.toLowerCase().includes(C)?1:0)-(F.value.toLowerCase().includes(C)?1:0)):e},[h,f,e]),{refs:x,floatingStyles:P,context:k}=od({open:m,onOpenChange:p,middleware:[ed(8),td({apply({elements:{floating:C},availableHeight:F}){Object.assign(C.style,{maxHeight:`${Math.max(75,Math.min(F,290))}px`})},padding:8}),Qc({fallbackStrategy:"initialPlacement",padding:8})]}),N=rd(k,{enabled:!l||!n}),{getReferenceProps:_,getFloatingProps:$}=ad([N]),S=Vn(null),{scrollProgress:R,updateScrollProgress:K}=Ae(S),v=zn(()=>t&&t.icon?t.icon:t&&t.image?E(Ot,{src:t.image,alt:t.value,className:"size-4 rounded-full",width:16,height:16}):c||E(ld,{className:"size-4 text-neutral-400"}),[t,c]);return E(Mr.Provider,{value:{inputAttrs:s||{},openCommandList:m,setOpenCommandList:p,inputValue:f,setInputValue:b,disabled:Boolean(a),selectedItem:t,setSelectedItem:r},children:l&&n?le(ft.Root,{open:m,onOpenChange:p,children:[E(ft.Trigger,{className:"sm:hidden",asChild:!0,children:E(Le,{ref:d,className:"relative",shouldFilter:!1,loop:!0,children:E(yo,{className:o,iconElement:v})})}),E(ft.Overlay,{className:"fixed inset-0 z-40 bg-neutral-100 bg-opacity-10 backdrop-blur"}),le(ft.Portal,{children:[E(ft.Content,{className:"fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-lg border-t border-neutral-200 bg-white",onPointerDownOutside:C=>{C.target instanceof Element&&C.target.closest("[data-sonner-toast]")&&C.preventDefault()},children:le(Le,{ref:d,className:"relative",shouldFilter:!1,loop:!0,children:[E("div",{className:"p-2",children:E(yo,{className:o,iconElement:v})}),m&&le(Le.List,{className:"dub-scrollbar h-[70vh] overflow-y-auto p-2",children:[e.length===0&&f===""&&(u?E("div",{children:u}):E("p",{className:"px-4 py-2 text-sm text-neutral-600",children:"No items found."})),f!==""&&E(Le.Empty,{className:"px-4 py-2 text-sm text-neutral-600",children:"No results found."}),E(Hn,{items:w})]})]})}),E(ft.Overlay,{})]})]}):le(Le,{ref:d,className:"relative",shouldFilter:!1,loop:!0,children:[E(yo,{className:o,iconElement:v,ref:x.setReference,..._()}),m&&le("div",{ref:x.setFloating,style:P,...$(),className:"z-20 flex w-full min-w-[160px] flex-col overflow-hidden rounded-md border border-neutral-200 bg-white shadow-md",children:[le("div",{ref:S,onScroll:K,className:"grow overflow-y-auto p-2",children:[le(Le.List,{children:[e.length===0&&f===""&&(u?E("div",{children:u}):E("p",{className:"px-4 py-2 text-sm text-neutral-600",children:"No items found."})),f!==""&&E(Le.Empty,{className:"px-4 py-2 text-sm text-neutral-600",children:"No results found."})]}),E(Hn,{items:w})]}),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(R,2)}})]})]})})}var yo=_n(({iconElement:e,className:t,...r},o)=>le("label",{ref:o,className:i("group relative flex cursor-pointer gap-2 rounded-md border border-neutral-200 bg-white px-1 pl-3 transition-all focus-within:border-neutral-500 focus-within:ring-4 focus-within:ring-neutral-200",t),...r,children:[E("div",{className:"flex shrink-0 items-center justify-center text-neutral-400",children:e}),le("div",{className:"flex h-10 grow",children:[E(md,{}),E(ud,{})]})]})),md=_n((e,t)=>{let r=nd(l=>l.filtered.count===0),{inputAttrs:o,openCommandList:a,setOpenCommandList:n,inputValue:c,setInputValue:s,disabled:u}=wo(Mr);return E(Le.Input,{ref:t,placeholder:(o==null?void 0:o.placeholder)||"Search...",autoFocus:a,onFocus:()=>n(!0),value:c,onValueChange:s,onKeyDown:l=>{l.key==="Escape"?(l.preventDefault(),n(!1)):l.key==="Enter"&&r?n(!1):l.key.match(/^[a-z0-9]$/i)&&!l.metaKey&&n(!0)},disabled:u,className:"block w-full truncate rounded-md border-none px-0 text-base text-neutral-900 placeholder-neutral-400 outline-none outline-0 transition-all duration-300 focus:ring-0 md:text-sm",autoCapitalize:"none"})});function ud(){let{setSelectedItem:e,openCommandList:t,setOpenCommandList:r,inputValue:o,setInputValue:a}=wo(Mr);return E("button",{type:"button",onClick:()=>{r(n=>!n),e(null),a("")},className:"absolute inset-y-0 right-0 my-auto pr-3",children:o.length>0?E(cd,{className:"size-4 text-neutral-400 transition-all hover:text-neutral-700"}):E(sd,{className:i("size-4 text-neutral-400 transition-all hover:text-neutral-700",{"rotate-180 transform":t})})})}function Hn({items:e}){let{setSelectedItem:t,setOpenCommandList:r,setInputValue:o}=wo(Mr);return e.map(a=>le(Le.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-neutral-900 hover:bg-neutral-100 hover:text-neutral-900 active:bg-neutral-200 aria-disabled:cursor-not-allowed aria-disabled:opacity-75 aria-disabled:hover:bg-white aria-selected:bg-neutral-100 aria-selected:text-neutral-900",children:[le("div",{className:"flex items-center space-x-2",children:[a.icon||a.image&&E(Ot,{src:a.image,alt:a.value,className:"size-4 rounded-full",width:16,height:16}),E("p",{className:i("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&&E(ur,{className:"text-xs",variant:"neutral",children:a.label})]}),E(id,{className:"invisible h-5 w-5 text-neutral-500 aria-selected:visible"})]},a.id))}import*as No from"@radix-ui/react-label";import{cva as pd}from"class-variance-authority";import*as Fn from"react";import{jsx as bd}from"react/jsx-runtime";var fd=pd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),gd=Fn.forwardRef(({className:e,...t},r)=>bd(No.Root,{ref:r,className:i(fd(),e),...t}));gd.displayName=No.Root.displayName;import{cva as hd}from"class-variance-authority";import{isValidElement as vd}from"react";import{jsx as Bn,jsxs as Wn}from"react/jsx-runtime";var Co=hd(["flex h-9 w-full rounded-md px-2 items-center justify-center gap-2 transition-colors cursor-pointer","whitespace-nowrap text-sm font-medium text-content-default enabled:hover:bg-bg-subtle transition-colors","disabled:opacity-50 disabled:cursor-default"],{variants:{variant:{default:"text-content-default hover:bg-bg-subtle",danger:"text-content-error hover:bg-bg-error"}}});function u4({as:e,variant:t="default",children:r,icon:o,shortcut:a,className:n,...c}){return Wn(e||"button",{...e==="button"?{type:"button"}:{},className:i(Co({variant:t}),n),...c,children:[Wn("div",{className:"flex grow items-center gap-2",children:[o&&(xd(o)?o:Bn(o,{className:"size-4"})),r]}),a&&Bn("kbd",{className:i("bg-bg-inverted/5 group-hover:bg-bg-inverted/10 hidden rounded px-2 py-0.5 text-xs font-light transition-all duration-75 md:block"),children:a})]})}var xd=e=>vd(e);import{curveNatural as $n}from"@visx/curve";import{LinearGradient as Un}from"@visx/gradient";import{Group as yd}from"@visx/group";import{ParentSize as wd}from"@visx/responsive";import{scaleLinear as Nd,scaleUtc as Cd}from"@visx/scale";import{Area as kd,AreaClosed as Pd}from"@visx/shape";import{motion as Gn}from"framer-motion";import{useId as Sd,useMemo as jn}from"react";import{jsx as we,jsxs as ko}from"react/jsx-runtime";var Rd={top:8,right:2,bottom:2,left:2};function N4(e){return we(wd,{className:"relative",children:({width:t,height:r})=>t>0&&r>0&&we(Td,{...{width:t,height:r,...e}})})}function Td({width:e,height:t,data:r,curve:o=!0,color:a,padding:n}){let c={...Rd,...n},s=Sd(),u=jn(()=>r.map(({date:m})=>({date:m,value:0})),[r]),{yScale:l,xScale:d}=jn(()=>{let m=r.map(({value:y})=>y),p=Math.max(...m),f=r.map(({date:y})=>y.getTime()),b=new Date(Math.min(...f)),h=new Date(Math.max(...f));return{yScale:Nd({domain:[-2,Math.max(p,2)],range:[t-c.top-c.bottom,0],nice:!0,clamp:!0}),xScale:Cd({domain:[b,h],range:[0,e-c.left-c.right],nice:!0})}},[r,t,e]);return ko("svg",{width:e,height:t,children:[ko("defs",{children:[we(Un,{id:`${s}-color-gradient`,from:a||"#7D3AEC",to:a||"#DA2778",x1:0,x2:e-c.left-c.right,gradientUnits:"userSpaceOnUse"}),we(Un,{id:`${s}-mask-gradient`,from:"white",to:"white",fromOpacity:.3,toOpacity:0,x1:0,x2:0,y1:0,y2:1}),we("mask",{id:`${s}-mask`,maskContentUnits:"objectBoundingBox",children:we("rect",{width:"1",height:"1",fill:`url(#${s}-mask-gradient)`})})]}),ko(yd,{left:c.left,top:c.top,children:[we(kd,{data:r,x:({date:m})=>d(m),y:({value:m})=>l(m)??0,curve:o?$n:void 0,children:({path:m})=>we(Gn.path,{initial:{d:m(u)||"",opacity:0},animate:{d:m(r)||"",opacity:1},strokeWidth:1.5,stroke:`url(#${s}-color-gradient)`})}),we(Pd,{data:r,x:({date:m})=>d(m),y:({value:m})=>l(m)??0,yScale:l,curve:o?$n:void 0,children:({path:m})=>we(Gn.path,{initial:{d:m(u)||"",opacity:0},animate:{d:m(r)||"",opacity:1},fill:`url(#${s}-color-gradient)`,mask:`url(#${s}-mask)`})})]})]},r.length)}import*as ce from"@radix-ui/react-dialog";import*as Po from"@radix-ui/react-visually-hidden";import{useRouter as Ld}from"next/navigation";import{Drawer as Je}from"vaul";import{jsx as ne,jsxs as gt}from"react/jsx-runtime";function T4({children:e,className:t,showModal:r,setShowModal:o,onClose:a,desktopOnly:n,preventDefaultClose:c,drawerRootProps:s}){let u=Ld(),l=({dragged:m}={})=>{c&&!m||(a&&a(),o?o(!1):u.back())},{isMobile:d}=Y();return d&&!n?ne(Je.Root,{open:o?r:!0,onOpenChange:m=>{m||l({dragged:!0})},...s,children:gt(Je.Portal,{children:[ne(Je.Overlay,{className:"fixed inset-0 z-50 bg-neutral-100 bg-opacity-10 backdrop-blur"}),ne(Je.Content,{onPointerDownOutside:m=>{m.target instanceof Element&&m.target.closest("[data-sonner-toast]")&&m.preventDefault()},className:i("fixed bottom-0 left-0 right-0 z-50 flex flex-col","rounded-t-[10px] border-t border-neutral-200 bg-white",t),children:gt("div",{className:"scrollbar-hide flex-1 overflow-y-auto rounded-t-[10px] bg-inherit",children:[gt(Po.Root,{children:[ne(Je.Title,{children:"Modal"}),ne(Je.Description,{children:"This is a modal"})]}),ne(Md,{}),e]})}),ne(Je.Overlay,{})]})}):ne(ce.Root,{open:o?r:!0,onOpenChange:m=>{m||l()},children:gt(ce.Portal,{children:[ne(ce.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-neutral-100 bg-opacity-50 backdrop-blur-md"}),gt(ce.Content,{onOpenAutoFocus:m=>m.preventDefault(),onCloseAutoFocus:m=>m.preventDefault(),onPointerDownOutside:m=>{m.target instanceof Element&&m.target.closest("[data-sonner-toast]")&&m.preventDefault()},className:i("fixed inset-0 z-40 m-auto h-fit w-full max-w-md","border border-neutral-200 bg-white p-0 shadow-xl sm:rounded-2xl","scrollbar-hide animate-scale-in overflow-y-auto",t),children:[gt(Po.Root,{children:[ne(ce.Title,{children:"Modal"}),ne(ce.Description,{children:"This is a modal"})]}),e]})]})})}function Md(){return ne("div",{className:"sticky top-0 z-20 flex items-center justify-center rounded-t-[10px] bg-inherit",children:ne("div",{className:"my-3 h-1 w-12 rounded-full bg-neutral-300"})})}import{useCallback as So}from"react";import{jsx as zt,jsxs as Dd}from"react/jsx-runtime";function O4({value:e,onChange:t,min:r,max:o,step:a=1,disabled:n,className:c,id:s,formatValue:u,decrementAriaLabel:l="Decrease",incrementAriaLabel:d="Increase",...m}){let p=typeof r=="number"?e>r:!0,f=typeof o=="number"?e<o:!0,b=So(w=>{let x=w;return typeof r=="number"&&(x=Math.max(r,x)),typeof o=="number"&&(x=Math.min(o,x)),x},[r,o]),h=So(()=>{n||!p||t(b(e-a))},[n,p,b,t,a,e]),y=So(()=>{n||!f||t(b(e+a))},[n,f,b,t,a,e]);return Dd("div",{id:s,role:"group","aria-disabled":n,className:i("flex h-10 w-full select-none items-stretch overflow-hidden rounded-lg border border-neutral-200 bg-white",n&&"opacity-60",c),...m,children:[zt("button",{type:"button","aria-label":l,onClick:h,disabled:n||!p,className:i("flex h-full w-24 items-center justify-center border-r border-neutral-200 text-neutral-700 transition-colors",!(n||!p)&&"hover:bg-neutral-50"),children:zt(lr,{className:"block size-4"})}),zt("div",{role:"spinbutton","aria-valuenow":e,"aria-valuemin":r,"aria-valuemax":o,tabIndex:0,onKeyDown:w=>{n||((w.key==="ArrowLeft"||w.key==="ArrowDown")&&(w.preventDefault(),h()),(w.key==="ArrowRight"||w.key==="ArrowUp")&&(w.preventDefault(),y()))},className:i("flex min-w-0 flex-1 items-center justify-center px-3 text-sm text-neutral-900"),prefix:"",children:u?u(e):e}),zt("button",{type:"button","aria-label":d,onClick:y,disabled:n||!f,className:i("flex h-full w-24 items-center justify-center border-l border-neutral-200 text-neutral-700 transition-colors",!(n||!f)&&"hover:bg-neutral-50"),children:zt(ct,{className:"block size-4"})})]})}import{Fragment as Ed,jsx as Dr,jsxs as bt}from"react/jsx-runtime";var Kn=i("flex h-7 items-center justify-center gap-2 whitespace-nowrap rounded-md border border-neutral-200 bg-white px-2 text-sm text-neutral-600","outline-none hover:bg-neutral-50 focus-visible:border-neutral-500","disabled:cursor-not-allowed disabled:border-neutral-200 disabled:text-neutral-400 disabled:bg-neutral-100");function H4({pagination:e,setPagination:t,totalCount:r,unit:o=s=>`item${s?"s":""}`,className:a,children:n,showTotalCount:c=!0}){return bt("div",{className:i("flex items-center justify-between gap-2 text-sm leading-6 text-neutral-600",a),children:[bt("div",{className:"flex items-center gap-2",children:[bt("div",{children:[Dr("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",r>0&&bt(Ed,{children:[bt("span",{className:"font-medium",children:[((e.pageIndex-1)*e.pageSize+1).toLocaleString(),"-",Math.min((e.pageIndex-1)*e.pageSize+e.pageSize,r).toLocaleString()]})," ",c&&"of "]}),c&&Dr("span",{className:"font-medium",children:r.toLocaleString()})," ",typeof o=="function"?o(r!==1):o]}),n]}),bt("div",{className:"flex items-center gap-2",children:[Dr("button",{type:"button",className:Kn,onClick:()=>t({...e,pageIndex:e.pageIndex-1}),disabled:e.pageIndex===1,children:"Previous"}),Dr("button",{type:"button",className:Kn,onClick:()=>t({...e,pageIndex:e.pageIndex+1}),disabled:(e.pageIndex-1)*e.pageSize+e.pageSize>=r,children:"Next"})]})]})}import*as He from"@radix-ui/react-radio-group";import{Circle as Id}from"lucide-react";import*as Ro from"react";import{jsx as Er}from"react/jsx-runtime";var Ad=Ro.forwardRef(({className:e,...t},r)=>Er(He.Root,{className:i("grid gap-2",e),...t,ref:r}));Ad.displayName=He.Root.displayName;var Od=Ro.forwardRef(({className:e,...t},r)=>Er(He.Item,{ref:r,className:i("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:Er(He.Indicator,{className:"flex items-center justify-center",children:Er(Id,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Od.displayName=He.Item.displayName;import{Drawer as _e}from"vaul";import{jsx as Qe,jsxs as Fd}from"react/jsx-runtime";function zd({children:e,contentProps:t,nested:r=!1,...o}){let a=r?_e.NestedRoot:_e.Root;return Qe(a,{direction:"right",handleOnly:!0,...o,children:Fd(_e.Portal,{children:[Qe(_e.Overlay,{className:"fixed inset-0 bg-black/20","data-sheet-overlay":!0}),Qe(_e.Content,{...t,onPointerDownOutside:n=>{var c;n.target instanceof Element&&n.target.closest("[data-sonner-toast]")&&n.preventDefault(),(c=t==null?void 0:t.onPointerDownOutside)==null||c.call(t,n)},className:i("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)",userSelect:"auto",...t==null?void 0:t.style},children:Qe("div",{className:"scrollbar-hide flex size-full grow flex-col overflow-y-auto rounded-lg bg-white",children:e})})]})})}function Vd({className:e,...t}){return Qe(_e.Title,{className:i("text-lg font-semibold text-neutral-900",e),...t})}function Hd(e){return Qe(_e.Description,{...e})}function _d(e){return Qe(_e.Close,{...e})}var j4=Object.assign(zd,{Title:Vd,Description:Hd,Close:_d});import{useEffect as Bd,useRef as Wd,useState as $d}from"react";import{jsx as Yn}from"react/jsx-runtime";var Ud=`
|
|
2
|
+
import{$ as kp,$a as g0,$b as rf,$c as Kf,$d as Bg,A as da,Aa as Zp,Ab as Ra,Ac as Sf,Ad as bg,B as np,Ba as qp,Bb as V0,Bc as Rf,Bd as hg,C as ip,Ca as Xp,Cb as H0,Cc as Tf,Cd as vg,D as sp,Da as Jp,Db as _0,Dc as Ha,Dd as xg,E as tr,Ea as ha,Eb as nr,Ec as Lf,Ed as yg,F as lp,Fa as Qp,Fb as F0,Fc as Mf,Fd as wg,G as rr,Ga as e0,Gb as B0,Gc as Df,Gd as Ng,H as cp,Ha as va,Hb as W0,Hc as _a,Hd as Cg,I as dp,Ia as t0,Ib as $0,Ic as Fa,Id as kg,J as mp,Ja as r0,Jb as U0,Jc as Ef,Jd as Pg,K as up,Ka as o0,Kb as Ta,Kc as If,Kd as Sg,L as ma,La as a0,Lb as G0,Lc as Af,Ld as Rg,M as ua,Ma as n0,Mb as j0,Mc as Of,Md as Tg,N as pa,Na as i0,Nb as K0,Nc as ir,Nd as Lg,O as fa,Oa as s0,Ob as Y0,Oc as zf,Od as Mg,P as ga,Pa as l0,Pb as La,Pc as Vf,Pd as Dg,Q as pp,Qa as c0,Qb as Ma,Qc as Hf,Qd as Eg,R as fp,Ra as d0,Rb as Da,Rc as _f,Rd as Ig,S as gp,Sa as xa,Sb as Ea,Sc as Ff,Sd as Ag,T as bp,Ta as ar,Tb as Z0,Tc as Bf,Td as Og,U as hp,Ua as ya,Ub as q0,Uc as Wf,Ud as Ua,V as vp,Va as wa,Vb as X0,Vc as $f,Vd as Ga,W as xp,Wa as m0,Wb as J0,Wc as Uf,Wd as zg,X as yp,Xa as u0,Xb as Q0,Xc as Gf,Xd as Vg,Y as wp,Ya as Na,Yb as ef,Yc as jf,Yd as Hg,Z as Np,Za as p0,Zb as Ia,Zc as sr,Zd as _g,_ as Cp,_a as f0,_b as tf,_c as lr,_d as Fg,a as ra,aa as Pp,ab as Ca,ac as of,ad as Yf,ae as Wg,b as qu,ba as Sp,bb as ka,bc as af,bd as Zf,be as $g,c as it,ca as Rp,cb as Pa,cc as nf,cd as qf,ce as Ug,d as Jt,da as Tp,db as b0,dc as sf,dd as Xf,de as Gg,e as Xu,ea as Lp,eb as h0,ec as lf,ed as Jf,ee as jg,f as st,fa as Mp,fb as v0,fc as cf,fd as Qf,fe as Kg,g as lt,ga as Dp,gb as x0,gc as df,gd as Ba,ge as Yg,h as Yr,ha as Ep,hb as y0,hc as mf,hd as eg,he as Zg,i as oa,ia as Ip,ib as Zr,ic as Aa,id as tg,ie as Pt,j as aa,ja as Ap,jb as w0,jc as uf,jd as rg,je as qg,k as Ju,ka as Op,kb as N0,kc as pf,kd as og,ke as Xg,l as Qu,la as zp,lb as C0,lc as ff,ld as ag,le as Jg,m as na,ma as Vp,mb as Sa,mc as Oa,md as ng,me as Qg,n as ia,na as Hp,nb as k0,nc as gf,nd as ig,ne as ja,o as sa,oa as ba,ob as P0,oc as bf,od as sg,oe as eb,p as la,pa as _p,pb as S0,pc as za,pd as ct,pe as tb,q as kt,qa as Fp,qb as R0,qc as hf,qd as lg,qe as rb,r as ep,ra as Bp,rb as T0,rc as Va,rd as cg,re as ob,s as ke,sa as Wp,sb as L0,sc as vf,sd as dg,se as ab,t as tp,ta as $p,tb as M0,tc as xf,td as mg,te as nb,u as Qt,ua as Up,ub as D0,uc as yf,ud as ug,ue as ib,v as rp,va as Gp,vb as E0,vc as wf,vd as Wa,w as op,wa as jp,wb as I0,wc as Nf,wd as pg,x as er,xa as Kp,xb as A0,xc as Cf,xd as fg,y as ap,ya as Yp,yb as O0,yc as kf,yd as $a,z as ca,za as or,zb as z0,zc as Pf,zd as gg}from"./chunk-V6S4RZAX.mjs";import{a as Y}from"./chunk-NWME2ANF.mjs";import{a as jr,b as wt,c as Yo,d as Zo,e as Nt,f as qo,g as Xo,h as Ct,i as Kr,j as Jo,k as V,l as Ce,m as Qo,n as ge,o as qt,p as i,q as Xt,r as ea,s as ta}from"./chunk-EY3HINQT.mjs";import*as ie from"@radix-ui/react-accordion";import{ChevronDown as Hi}from"lucide-react";import*as dr from"react";import{jsx as cr,jsxs as Wi}from"react/jsx-runtime";var ub=ie.Root,_i=dr.forwardRef(({className:e,...t},r)=>cr(ie.Item,{ref:r,className:i("border-b border-b-slate-200 py-3 last:border-none",e),...t}));_i.displayName="AccordionItem";var Fi=dr.forwardRef(({className:e,children:t,variant:r="chevron",...o},a)=>{let n=r==="chevron"?Hi:ct;return cr(ie.Header,{className:"flex",children:Wi(ie.Trigger,{ref:a,className:i("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,cr(n,{className:"h-5 w-5 flex-none transition-transform duration-300"})]})})});Fi.displayName=ie.Trigger.displayName;var Bi=dr.forwardRef(({className:e,children:t,...r},o)=>cr(ie.Content,{ref:o,className:i("data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-neutral-500 transition-all sm:text-base",e),...r,children:t}));Bi.displayName=ie.Content.displayName;import{cva as $i}from"class-variance-authority";import*as mr from"react";import{jsx as qr}from"react/jsx-runtime";var Ui=$i("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"}}),Gi=mr.forwardRef(({className:e,variant:t,...r},o)=>qr("div",{ref:o,role:"alert",className:i(Ui({variant:t}),e),...r}));Gi.displayName="Alert";var ji=mr.forwardRef(({className:e,...t},r)=>qr("h5",{ref:r,className:i("text-md mb-2 font-medium leading-none tracking-tight",e),...t}));ji.displayName="AlertTitle";var Ki=mr.forwardRef(({className:e,...t},r)=>qr("div",{ref:r,className:i("text-sm [&_p]:leading-relaxed",e),...t}));Ki.displayName="AlertDescription";import{sha256 as Yi}from"js-sha256";import{useState as Zi}from"react";import{jsx as Xr}from"react/jsx-runtime";function qi(e){if(e!=null&&e.image)return e.image;if(!(e!=null&&e.id))return"https://api.dub.co/og/avatar";let t=`https://api.dub.co/og/avatar/${e.id}`;return e.email?`https://0.gravatar.com/avatar/${Yi(e.email)}?d=${t}`:t}function yb({user:e={},className:t}){if(!e)return Xr("div",{className:i("h-10 w-10 animate-pulse rounded-full border border-neutral-300 bg-neutral-100",t)});let[r,o]=Zi(qi(e));return Xr("img",{alt:`Avatar for ${e.name||e.email}`,referrerPolicy:"no-referrer",src:r,className:i("h-10 w-10 rounded-full border border-neutral-300",t),draggable:!1,onError:()=>{o(`https://api.dub.co/og/avatar/${e.id}`)}})}function wb({id:e,className:t}){return Xr("img",{src:`https://api.dicebear.com/9.x/shapes/svg?seed=${e}`,alt:"avatar",className:i("h-10 w-10 rounded-full",t),draggable:!1})}import{cva as Xi}from"class-variance-authority";import{jsx as Qi}from"react/jsx-runtime";var Ji=Xi("max-w-fit rounded-full border px-2 py-px text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"border-neutral-400 text-neutral-500",violet:"border-violet-600 bg-violet-600 text-white",blue:"border-blue-500 bg-blue-500 text-white",green:"border-green-100 bg-green-100 text-green-900",sky:"border-sky-900 bg-sky-900 text-white",black:"border-black bg-black text-white",gray:"border-neutral-200 bg-neutral-100 text-neutral-800",neutral:"border-neutral-400 text-neutral-500",amber:"border-amber-800 bg-amber-800 text-white",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 ur({className:e,variant:t,...r}){return Qi("span",{className:i(Ji({variant:t}),e),...r})}import{cva as ns}from"class-variance-authority";import{forwardRef as is}from"react";import*as be from"@radix-ui/react-tooltip";import es from"linkify-react";import{HelpCircle as ts}from"lucide-react";import rs from"next/link";import{useState as os}from"react";import{Fragment as as,jsx as U,jsxs as je}from"react/jsx-runtime";function Ob({children:e}){return U(be.Provider,{delayDuration:150,children:e})}function Q({children:e,content:t,contentClassName:r,disabled:o,side:a="top",disableHoverableContent:n,delayDuration:c=0,...s}){let[u,l]=os(!1);return je(be.Root,{open:o?!1:u,onOpenChange:l,delayDuration:c,disableHoverableContent:n,children:[U(be.Trigger,{asChild:!0,onClick:()=>{l(!0)},onBlur:()=>{l(!1)},children:e}),U(be.Portal,{children:U(be.Content,{sideOffset:8,side:a,className:"animate-slide-up-fade pointer-events-auto z-[99] items-center overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-sm",collisionPadding:0,...s,children:typeof t=="string"?U("span",{className:i("block max-w-xs text-pretty px-4 py-2 text-center text-sm text-neutral-700",r),children:t}):typeof t=="function"?t({setOpen:l}):t})})]})}function zb({title:e,cta:t,href:r,target:o,onClick:a}){return je("div",{className:"flex max-w-xs flex-col items-center space-y-3 p-4 text-center",children:[U("p",{className:"text-sm text-neutral-700",children:e}),t&&(r?U(rs,{href:r,...o?{target:o}:{},className:i(se({variant:"primary"}),"flex h-9 w-full items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm"),children:t}):a?U(te,{onClick:a,text:t,variant:"primary",className:"h-9"}):null)]})}function Vb({title:e,cta:t,href:r}){return je("div",{className:"max-w-xs px-4 py-2 text-center text-sm text-neutral-700",children:[e,t&&r&&je(as,{children:[" ",U("a",{href:r,target:"_blank",rel:"noopener noreferrer",onClick:o=>o.stopPropagation(),className:"inline-flex text-neutral-500 underline underline-offset-4 hover:text-neutral-800",children:t})]})]})}function Hb({children:e,className:t,tooltipClassName:r}){return U("div",{className:i("block max-w-xs whitespace-pre-wrap text-balance px-4 py-2 text-center text-sm text-neutral-700",r),children:U(es,{as:"p",options:{target:"_blank",rel:"noopener noreferrer nofollow",className:i("underline underline-offset-4 text-neutral-400 hover:text-neutral-700",t)},children:e})})}function _b(e){return U(Q,{...e,children:U(ts,{className:"h-4 w-4 text-neutral-500"})})}function Fb({value:e,unit:t="total clicks",prefix:r,children:o,lastClicked:a}){return(!e||e<1e3)&&!a?o:U(Q,{content:je("div",{className:"block max-w-xs px-4 py-2 text-center text-sm text-neutral-700",children:[je("p",{className:"text-sm font-semibold text-neutral-700",children:[r,Xt(e||0,{full:!0})," ",t]}),a&&je("p",{className:"mt-1 text-xs text-neutral-500",suppressHydrationWarning:!0,children:["Last clicked ",Xo(a,{withAgo:!0})]})]}),children:o})}function Bb({children:e,content:t,...r}){return U(Q,{content:t,...r,children:U("div",{className:"flex cursor-pointer items-center",children:U(ur,{variant:"gray",className:"border-neutral-300 transition-all hover:bg-neutral-200",children:e})})})}function Wb({children:e,tooltipProps:t,...r}){return U(Q,{...t,children:U("button",{type:"button",...r,className:i("flex h-6 w-6 items-center justify-center rounded-md text-neutral-500 transition-colors duration-75 hover:bg-neutral-100 active:bg-neutral-200 disabled:cursor-not-allowed disabled:hover:bg-transparent",r.className),children:e})})}function pr({children:e,tooltipProps:t}){return t?U(Q,{...t,children:U("div",{children:e})}):e}import{jsx as dt,jsxs as Ka}from"react/jsx-runtime";var se=ns("transition-all",{variants:{variant:{primary:"border-black bg-black dark:bg-white dark:border-white text-content-inverted hover:bg-inverted hover:ring-4 hover:ring-border-subtle",secondary:i("border-border-subtle bg-white dark:bg-black text-content-emphasis hover:bg-bg-muted focus-visible:border-border-emphasis outline-none","data-[state=open]:border-border-emphasis data-[state=open]:ring-4 data-[state=open]:ring-border-subtle"),outline:"border-transparent text-content-default hover:bg-bg-subtle",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"}}),te=is(({text:e,variant:t="primary",className:r,textWrapperClassName:o,shortcutClassName:a,loading:n,icon:c,shortcut:s,disabledTooltip:u,right:l,...d},m)=>u?dt(Q,{content:u,children:Ka("div",{className:i("flex h-10 w-full cursor-not-allowed items-center justify-center gap-x-2 rounded-md border border-neutral-200 bg-neutral-100 px-4 text-sm text-neutral-400 transition-all focus:outline-none",{"border-transparent bg-transparent":t==null?void 0:t.endsWith("outline")},r),children:[c,e&&dt("div",{className:i("min-w-0 truncate",s&&"flex-1 text-left",o),children:e}),s&&dt("kbd",{className:i("hidden rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-400 md:inline-block",{"bg-neutral-100":t==null?void 0:t.endsWith("outline")},a),children:s})]})}):Ka("button",{ref:m,type:d.onClick?"button":"submit",className:i("group flex h-10 w-full items-center justify-center gap-2 whitespace-nowrap rounded-md border px-4 text-sm",d.disabled||n?"cursor-not-allowed border-neutral-200 bg-neutral-100 text-neutral-400 outline-none":se({variant:t}),r),disabled:d.disabled||n,...d,children:[n?dt(ke,{}):c||null,e&&dt("div",{className:i("min-w-0 truncate",s&&"flex-1 text-left",o),children:e}),s&&dt("kbd",{className:i("hidden rounded px-2 py-0.5 text-xs font-light transition-all duration-75 md:inline-block",{"bg-neutral-700 text-neutral-400 group-hover:bg-neutral-600 group-hover:text-neutral-300":t==="primary","bg-neutral-200 text-neutral-400 group-hover:bg-neutral-100 group-hover:text-neutral-500":t==="secondary","bg-neutral-100 text-neutral-500 group-hover:bg-neutral-200":t==="outline","bg-red-100 text-red-600 group-hover:bg-red-500 group-hover:text-white":t==="danger-outline"},a),children:s}),l]}));te.displayName="Button";import{cva as ss}from"class-variance-authority";import{createContext as ls}from"react";import{jsx as Ya}from"react/jsx-runtime";var cs=ss("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"}}}),St=ls({variant:"loose",loading:!1});function Za({variant:e="loose",loading:t=!1,className:r,children:o}){return Ya("ul",{className:i(cs({variant:e,loading:t}),r),"data-variant":e,children:Ya(St.Provider,{value:{variant:e,loading:t},children:o})})}import{cva as ds}from"class-variance-authority";import{createContext as ms,useContext as us,useEffect as ps,useRef as fs,useState as gs}from"react";import{jsx as qa,jsxs as vs}from"react/jsx-runtime";var bs=ds("w-full group/card border-neutral-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-neutral-50 transition-colors",loose:"border rounded-xl transition-[filter] data-[hover-state-enabled=true]:hover:drop-shadow-card-hover"}}}),hs="w-full py-2.5 px-4",Jr=ms({hovered:!1});function Xa({outerClassName:e,innerClassName:t,children:r,onClick:o,onAuxClick:a,hoverStateEnabled:n=!0,banner:c}){let{variant:s}=us(St),u=fs(null),[l,d]=gs(!1);ps(()=>{if(!l||!u.current)return;let p=setInterval(()=>{var f;((f=u.current)==null?void 0:f.matches(":hover"))===!1&&d(!1)},1e3);return()=>clearInterval(p)},[l]);let m=p=>!(document.getElementById("modal-backdrop")||Ct(p));return vs("li",{ref:u,className:i(bs({variant:s}),e),onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),"data-hover-state-enabled":n,children:[c,qa("div",{className:i(hs,t),onClick:o?p=>{m(p)&&o(p)}:void 0,onAuxClick:a?p=>{m(p)&&a(p)}:void 0,children:qa(Jr.Provider,{value:{hovered:l},children:r})})]})}var u1=Object.assign(Za,{Card:Object.assign(Xa,{Context:Jr}),Context:St});import xs from"embla-carousel-autoplay";import ys from"embla-carousel-react";import{ArrowLeft as ws,ArrowRight as Ns}from"lucide-react";import{createContext as Cs,forwardRef as Tt,useCallback as Rt,useContext as ks,useEffect as Qr,useState as eo}from"react";import{jsx as Pe,jsxs as en}from"react/jsx-runtime";var to=2e3,Ja=Cs(null);function he(){let e=ks(Ja);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function Qa(){let{api:e}=he(),[t,r]=eo(0),o=Rt(a=>r((a==null?void 0:a.selectedScrollSnap())??0),[]);return Qr(()=>{!e||(o(e),e.on("reInit",o),e.on("select",o))},[e,o]),t}var Ps=Tt(({orientation:e="horizontal",opts:t,setApi:r,autoplay:o,plugins:a,className:n,children:c,...s},u)=>{let[l,d]=ys({...t,axis:e==="horizontal"?"x":"y"},[...o?[xs(typeof o=="object"?o:{delay:to})]:[],...a||[]]),[m,p]=eo(!1),[f,b]=eo(!1),h=Rt(P=>{!P||(p(P.canScrollPrev()),b(P.canScrollNext()))},[]),y=Rt(()=>{d==null||d.scrollPrev()},[d]),w=Rt(()=>{d==null||d.scrollNext()},[d]),x=Rt(P=>{P.key==="ArrowLeft"?(P.preventDefault(),y()):P.key==="ArrowRight"&&(P.preventDefault(),w())},[y,w]);return Qr(()=>{!d||!r||r(d)},[d,r]),Qr(()=>{if(!!d)return h(d),d.on("reInit",h),d.on("select",h),()=>{d==null||d.off("select",h)}},[d,h]),Pe(Ja.Provider,{value:{carouselRef:l,api:d,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:y,scrollNext:w,canScrollPrev:m,canScrollNext:f},children:Pe("div",{ref:u,onKeyDownCapture:x,className:i("relative",n),role:"region","aria-roledescription":"carousel",...s,children:c})})});Ps.displayName="Carousel";var Ss=Tt(({className:e,...t},r)=>{let{carouselRef:o,orientation:a}=he();return Pe("div",{ref:o,className:"overflow-hidden",children:Pe("div",{ref:r,className:i("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});Ss.displayName="CarouselContent";var Rs=Tt(({className:e,...t},r)=>{let{orientation:o}=he();return Pe("div",{ref:r,role:"group","aria-roledescription":"slide",className:i("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",e),...t})});Rs.displayName="CarouselItem";var Ts=Tt(({className:e,...t},r)=>{let{orientation:o,scrollPrev:a,canScrollPrev:n}=he();return en("button",{ref:r,className:i("absolute",o==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",se({variant:"secondary",className:"p-2"}),e),disabled:!n,onClick:a,...t,children:[Pe(ws,{className:"h-4 w-4"}),Pe("span",{className:"sr-only",children:"Previous slide"})]})});Ts.displayName="CarouselPrevious";var Ls=Tt(({className:e,...t},r)=>{let{orientation:o,scrollNext:a,canScrollNext:n}=he();return en("button",{ref:r,className:i("absolute",o==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",se({variant:"secondary",className:"p-2"}),e),disabled:!n,onClick:a,...t,children:[Pe(Ns,{className:"h-4 w-4"}),Pe("span",{className:"sr-only",children:"Next slide"})]})});Ls.displayName="CarouselNext";import{cva as Ms}from"class-variance-authority";import{motion as Ds}from"framer-motion";import{ChevronLeft as Es,ChevronRight as Is}from"lucide-react";import*as Ee from"react";import{jsx as Ke,jsxs as Lt}from"react/jsx-runtime";var As=Ms("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-neutral-800/10 bg-white sm:bottom-6 "}}}),M1=({variant:e="simple",className:t})=>{var b;let{scrollNext:r,scrollPrev:o,canScrollNext:a,canScrollPrev:n,api:c}=he(),s=(b=c==null?void 0:c.plugins())==null?void 0:b.autoplay,[u,l]=Ee.useState(0),[d,m]=Ee.useState(!1),p=Ee.useCallback(h=>{l((h==null?void 0:h.selectedScrollSnap())??0)},[]),f=Ee.useCallback(h=>()=>{s&&s.isPlaying()&&s.stop(),h()},[s]);return Ee.useEffect(()=>{!c||(p(c),m((s==null?void 0:s.isPlaying())??!1),c.on("reInit",p),c.on("select",p),c.on("autoplay:play",()=>m(!0)),c.on("autoplay:stop",()=>m(!1)))},[c,s,p]),Lt("div",{className:i(As({variant:e}),t),children:[e!=="simple"&&Lt("button",{className:"cursor-pointer rounded-full p-2 hover:bg-neutral-50 active:bg-neutral-100",disabled:!n,onClick:f(o),children:[Ke(Es,{className:"h-4 w-4"}),Ke("span",{className:"sr-only",children:"Previous slide"})]}),c!=null&&Ke("div",{className:"flex items-center gap-1",children:c.slideNodes().map((h,y)=>Lt("button",{onClick:f(()=>c.scrollTo(y)),className:"rounded-full p-0.5 hover:bg-neutral-100 active:bg-neutral-200 sm:p-1.5",children:[Ke("div",{className:i("relative isolate h-1.5 w-1.5 overflow-hidden rounded-full transition-all",y===u?"bg-black":"bg-black/20",d&&y===u&&"w-6 bg-black/20"),children:d&&y===u&&Ke(Ds.div,{initial:{x:"-100%"},animate:{x:0},transition:{type:"tween",duration:((s==null?void 0:s.options.delay)??to)/1e3},className:"animate-fill-width h-full w-full rounded-full bg-black"})}),Lt("span",{className:"sr-only",children:["Slide ",y+1]})]},y))}),e!=="simple"&&Lt("button",{className:"cursor-pointer rounded-full p-2 hover:bg-neutral-50 active:bg-neutral-100",disabled:!a,onClick:f(r),children:[Ke(Is,{className:"h-4 w-4"}),Ke("span",{className:"sr-only",children:"Next slide"})]})]})};import Os from"embla-carousel-react";import{forwardRef as zs,useCallback as Vs,useEffect as Hs}from"react";import{jsx as fr}from"react/jsx-runtime";var _1=({className:e,...t})=>{let{api:r}=he(),[o,a]=Os({dragFree:!0}),n=Vs(c=>{!c||!a||a==null||a.scrollTo(c.selectedScrollSnap())},[a]);return Hs(()=>{if(!(!r||!a))return n(r),r.on("reInit",n),r.on("select",n),()=>{r==null||r.off("reInit",n),r==null||r.off("select",n)}},[r,a,n]),fr("div",{className:"overflow-hidden",ref:o,children:fr("div",{className:i("mx-4 flex gap-4",e),...t})})},F1=zs(({index:e,className:t,...r},o)=>{let{api:a}=he(),n=Qa();return fr("div",{ref:o,children:fr("button",{type:"button",onClick:()=>{var s;if(!a)return;let c=(s=a.plugins())==null?void 0:s.autoplay;c&&c.isPlaying()&&c.stop(),a.scrollTo(e)},className:typeof t=="function"?t({active:e===n}):t,...r})})});import*as Mt from"@radix-ui/react-checkbox";import{forwardRef as _s}from"react";import{jsx as ro,jsxs as Fs}from"react/jsx-runtime";var mt=_s(({className:e,...t},r)=>ro(Mt.Root,{ref:r,className:i("peer h-5 w-5 shrink-0 rounded-md border border-neutral-200 bg-white outline-none focus-visible:border-black disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=indeterminate]:bg-blue-500",e),...t,children:Fs(Mt.Indicator,{className:"group/indicator flex items-center justify-center text-white",children:[ro(ar,{className:"size-3 group-data-[state=indeterminate]/indicator:hidden"}),ro(lr,{className:"size-3 group-data-[state=checked]/indicator:hidden"})]})}));mt.displayName=Mt.Root.displayName;import{Command as Et,CommandInput as El,CommandItem as Il,useCommandState as Al}from"cmdk";import{ChevronDown as Ol}from"lucide-react";import{forwardRef as zl,isValidElement as Vl,useCallback as Hl,useEffect as vr,useRef as _l,useState as Dt}from"react";import{motion as Ll}from"framer-motion";import{forwardRef as Ml,useRef as Dl}from"react";import{useEffect as Bs,useState as Ws}from"react";function tn(e){if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}function oo(e,t){let[r,o]=Ws(tn(e)??t);return Bs(()=>{let n=tn(e);n&&o(n)},[e]),[r,n=>{o(n),window.localStorage.setItem(e,JSON.stringify(n))}]}function $s(e){return e&&typeof e=="object"&&Array.isArray(e.all)&&Array.isArray(e.defaultVisible)}function Z1(e,t){if(!$s(t)){let o=t,a=u=>{let l=o[u];return Object.fromEntries(l.all.map(d=>[d,l.defaultVisible.includes(d)]))},n=Object.fromEntries(Object.keys(o).map(u=>[u,a(u)])),[c,s]=oo(e,n);return{columnVisibility:c,setColumnVisibility:(u,l)=>{let d=o[u].all,m=c[u]||{},p=Object.fromEntries(d.map(f=>[f,f in l?l[f]:m[f]??!1]));s({...c,[u]:p})}}}else{let o=t,a=Object.fromEntries(o.all.map(s=>[s,o.defaultVisible.includes(s)])),[n,c]=oo(e,a);return{columnVisibility:n,setColumnVisibility:s=>{let u=o.all,l=n||{},d=Object.fromEntries(u.map(m=>[m,m in s?s[m]:l[m]??!1]));c(d)}}}}import ao from"js-cookie";import{useEffect as Us,useState as Gs}from"react";function Q1(e,t,r){let[o,a]=Gs(()=>{let c=ao.get(e);return c?JSON.parse(c):t});return Us(()=>{let c=()=>{let s=ao.get(e);s&&a(JSON.parse(s))};return window.addEventListener("storage",c),()=>{window.removeEventListener("storage",c)}},[e]),[o,c=>{a(c),ao.set(e,JSON.stringify(c),r)}]}import{useCallback as js,useEffect as Ks,useRef as Ys,useState as Zs}from"react";var ut=(e=3e3)=>{let t=Ys(null),[r,o]=Zs(!1),a=()=>{t.current&&(clearTimeout(t.current),t.current=null)},n=js(async(c,{onSuccess:s,throwOnError:u}={})=>{a();try{typeof c=="string"?await navigator.clipboard.writeText(c):c instanceof ClipboardItem&&await navigator.clipboard.write([c]),o(!0),s==null||s(),Number.isFinite(e)&&e>=0&&(t.current=setTimeout(()=>o(!1),e))}catch(l){if(console.error("Failed to copy: ",l),u)throw l}},[e]);return Ks(()=>()=>a(),[]),[r,n]};import{useEffect as qs,useState as Xs}from"react";function ah(){let[e,t]=Xs(null);return qs(()=>{let r=document.querySelector("[data-mdx-container]");if(!r)return;let o=r.offsetTop-1,a=new IntersectionObserver(s=>{var m,p,f;let u=s[0];if(!u)return;let l=(((m=u.rootBounds)==null?void 0:m.height)||0)*.3+o;for(let b=1;b<s.length;b++){let h=s[b];if(!h)break;(h.boundingClientRect.top<u.boundingClientRect.top||u.boundingClientRect.bottom<o)&&(u=h)}let d=u.target;for(;d&&d.getBoundingClientRect().bottom<o;)d=(p=n.get(d))==null?void 0:p.next;for(;d&&d.getBoundingClientRect().top>l;)d=(f=n.get(d))==null?void 0:f.prev;d&&t(d.getAttribute("href"))},{threshold:1,rootMargin:`-${o}px 0px 0px 0px`}),n=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("#","")}import{useCallback as Js}from"react";function lh(e){return{handleKeyDown:Js(r=>{if(r.key==="Enter"&&r.metaKey){if(r.preventDefault(),e!=null&&e.current){e.current.requestSubmit();return}let o=r.target.form;o==null||o.requestSubmit()}},[])}}import{useEffect as Qs,useState as el}from"react";function uh(e,t={}){let{root:r,defaultValue:o}=t,[a,n]=el(o??!1);return Qs(()=>{let c=()=>{let u=e.current;if(!u)return;let l=r==null?void 0:r.current,d=u.getBoundingClientRect(),m=l?l.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};n(d.top<m.bottom&&d.bottom>m.top&&d.left<m.right&&d.right>m.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 tl,useState as rl}from"react";function gh(){let[e,t]=rl(!1);return tl(()=>{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 ol,useState as al}from"react";function xh(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:a=!1}={}){let[n,c]=al(),s=(n==null?void 0:n.isIntersecting)&&a,u=([l])=>{c(l)};return ol(()=>{let l=e==null?void 0:e.current;if(!!!window.IntersectionObserver||s||!l)return;let m={threshold:t,root:r,rootMargin:o},p=new IntersectionObserver(u,m);return p.observe(l),()=>p.disconnect()},[e,JSON.stringify(t),r,o,s]),n}import{createContext as nl,useCallback as il,useContext as sl,useEffect as rn,useId as ll,useState as cl}from"react";import{jsx as dl}from"react/jsx-runtime";var on=nl({listeners:[],setListeners:()=>{}});function Ph({children:e}){let[t,r]=cl([]);return dl(on.Provider,{value:{listeners:t,setListeners:r},children:e})}function Ie(e,t,r={}){let o=ll(),{listeners:a,setListeners:n}=sl(on),c=il(s=>{if(r.enabled===!1)return;let u=s.target,l=document.getElementById("modal-backdrop"),d=document.querySelector("[data-sheet-overlay]");if(u.tagName==="INPUT"||u.tagName==="TEXTAREA"||!!l!=!!r.modal||!!d!=!!r.sheet)return;let m=[...s.metaKey?["meta"]:[],...s.ctrlKey?["ctrl"]:[],...s.altKey?["alt"]:[],s.key].join("+");if(Array.isArray(e)?!e.includes(m):m!==e)return;let p=a.filter(b=>b.enabled!==!1&&!!l==!!b.modal&&!!d==!!b.sheet&&(Array.isArray(b.key)?b.key.includes(m):b.key===m));!p.length||qo(p,(b,h)=>(h.priority??0)-(b.priority??0))[0].id!==o||(s.preventDefault(),t(s))},[e,a,o,t,r.enabled,r.modal,r.sheet]);rn(()=>(document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)),[c]),rn(()=>(n(s=>[...s.filter(u=>u.id!==o),{id:o,key:e,...r}]),()=>n(s=>s.filter(u=>u.id!==o))),[JSON.stringify(e),r.enabled,r.priority])}import{toast as ml}from"sonner";import ul from"swr";function Mh(e,t){let{data:r,isLoading:o,mutate:a}=ul(e,ge);return{data:r,isLoading:o,update:async(n,c)=>ml.promise(a(n(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 ln,useMemo as vl}from"react";import{useEffect as an,useState as pl}from"react";function nn({pageSize:e,page:t,onPageChange:r}){let[o,a]=pl({pageIndex:t,pageSize:e});return an(()=>{a(n=>({...n,pageIndex:t}))},[t]),an(()=>{r==null||r(o.pageIndex)},[o]),{pagination:o,setPagination:a}}import{usePathname as fl,useRouter as gl,useSearchParams as bl}from"next/navigation";import{useCallback as hl}from"react";function sn(){let e=fl(),t=gl(),r=bl(),o=Object.fromEntries(r),a=(c,s)=>{let u=new URLSearchParams(r);if((s==null?void 0:s.include)&&Array.isArray(s.include)){let d=new URLSearchParams;r.forEach((m,p)=>{var f;(f=s.include)!=null&&f.includes(p)&&d.set(p,m)}),u=d}(s==null?void 0:s.exclude)&&Array.isArray(s.exclude)&&s.exclude.forEach(d=>u.delete(d)),c&&Object.entries(c).forEach(([d,m])=>u.set(d,m));let l=u.toString();return l.length>0?`?${l}`:""},n=hl(({set:c,del:s,replace:u,scroll:l=!0,getNewPath:d,arrayDelimiter:m=","})=>{let p=new URLSearchParams(r);c&&Object.entries(c).forEach(([h,y])=>p.set(h,Array.isArray(y)?y.join(m):y)),s&&(Array.isArray(s)?s.forEach(h=>p.delete(h)):p.delete(s));let f=p.toString(),b=`${e}${f.length>0?`?${f}`:""}`;if(d)return b;u?t.replace(b,{scroll:!1}):t.push(b,{scroll:l})},[r,e,t]);return{pathname:e,router:t,searchParams:r,searchParamsObj:o,queryParams:n,getQueryString:a}}function Wh(e=ta){let{searchParams:t,queryParams:r}=sn(),o=vl(()=>parseInt(t.get("page")||"1")||1,[t.get("page")]),{pagination:a,setPagination:n}=nn({pageSize:e,page:o,onPageChange:c=>{r(c===1?{del:"page",scroll:!1}:{set:{page:c.toString()},scroll:!1})}});return ln(()=>{let c=parseInt(t.get("page")||"1")||1;n(s=>({...s,pageIndex:c}))},[t.get("page")]),ln(()=>{r(a.pageIndex===1?{del:"page",scroll:!1}:{set:{page:a.pageIndex.toString()},scroll:!1})},[a]),{pagination:a,setPagination:n}}import{useEffect as xl}from"react";function Gh(){xl(()=>{let e=new URL(window.location.href);e.searchParams.has("_gl")&&setTimeout(()=>{e.searchParams.delete("_gl"),window.history.replaceState({},"",e.toString())},2e3)},[])}import{useEffect as yl,useState as wl}from"react";function gr(e){let[t,r]=wl(),o=([a])=>{r(a)};return yl(()=>{let a=e==null?void 0:e.current;if(!a)return;let n=new ResizeObserver(o);return n.observe(a),()=>n.disconnect()},[e]),t}import{useCallback as Nl,useEffect as cn,useState as Cl}from"react";function dn(e,{container:t}={}){let[r,o]=Cl(!1),a=Nl(()=>{o((t!=null&&t.current?t.current.scrollTop:window.scrollY)>e)},[e]);return cn(()=>{let n=(t==null?void 0:t.current)??window;return n.addEventListener("scroll",a),()=>n.removeEventListener("scroll",a)},[a]),cn(()=>{a()},[a]),r}import{useCallback as kl,useEffect as Pl,useState as Sl}from"react";function Ae(e){let[t,r]=Sl(1),o=kl(()=>{if(!e.current)return;let{scrollTop:n,scrollHeight:c,clientHeight:s}=e.current;r(c===s?1:Math.min(n/(c-s),1))},[]),a=gr(e);return Pl(o,[a]),{scrollProgress:t,updateScrollProgress:o}}import{useEffect as Rl}from"react";import{toast as un}from"sonner";import{jsx as br,jsxs as mn}from"react/jsx-runtime";function Tl({id:e,message:t,undo:r}){let o=()=>{r(),un.dismiss(e)},a=n=>{n.key==="z"&&(n.ctrlKey||n.metaKey)&&o()};return Rl(()=>(document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)),[]),mn("div",{className:"flex w-full items-center justify-between space-x-2",children:[mn("div",{className:"flex items-center space-x-2",children:[br(sa,{}),br("p",{className:"font-medium",children:t})]}),br("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 iv(){return({id:t,message:r,undo:o,duration:a})=>un(br(Tl,{id:t,message:r,undo:o}),{id:t,...a&&{duration:a}})}import{jsx as pn}from"react/jsx-runtime";var Se=Ml(({width:e=!1,height:t=!1,className:r,transition:o,children:a,...n},c)=>{var l,d;let s=Dl(null),u=gr(s);return pn(Ll.div,{ref:c,className:i("overflow-hidden",r),animate:{width:e?((l=u==null?void 0:u.contentRect)==null?void 0:l.width)??"auto":"auto",height:t?((d=u==null?void 0:u.contentRect)==null?void 0:d.height)??"auto":"auto"},transition:o??{type:"spring",duration:.3},...n,children:pn("div",{ref:s,className:i(t&&"h-max",e&&"w-max"),children:a})})});Se.displayName="AnimatedSizeContainer";import*as Oe from"@radix-ui/react-popover";import{Drawer as pt}from"vaul";import{jsx as Re,jsxs as hr}from"react/jsx-runtime";function ve({children:e,content:t,align:r="center",side:o="bottom",openPopover:a,setOpenPopover:n,mobileOnly:c,popoverContentClassName:s,onOpenAutoFocus:u,collisionBoundary:l,sticky:d,onEscapeKeyDown:m,onWheel:p}){let{isMobile:f}=Y();return c||f?hr(pt.Root,{open:a,onOpenChange:n,children:[Re(pt.Trigger,{className:"sm:hidden",asChild:!0,children:e}),hr(pt.Portal,{children:[Re(pt.Overlay,{className:"bg-bg-subtle fixed inset-0 z-50 bg-opacity-10 backdrop-blur"}),hr(pt.Content,{className:"border-border-subtle bg-bg-default fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-[10px] border-t",onEscapeKeyDown:m,onPointerDownOutside:b=>{b.target instanceof Element&&b.target.closest("[data-sonner-toast]")&&b.preventDefault()},children:[Re("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:Re("div",{className:"bg-border-default my-3 h-1 w-12 rounded-full"})}),Re("div",{className:"bg-bg-default flex min-h-[150px] w-full items-center justify-center overflow-hidden pb-8 align-middle shadow-xl",children:t})]}),Re(pt.Overlay,{})]})]}):hr(Oe.Root,{open:a,onOpenChange:n,children:[Re(Oe.Trigger,{className:"sm:inline-flex",asChild:!0,children:e}),Re(Oe.Portal,{children:Re(Oe.Content,{sideOffset:8,align:r,side:o,className:i("animate-slide-up-fade border-border-subtle bg-bg-default z-50 items-center rounded-lg border drop-shadow-lg sm:block",s),sticky:d,collisionBoundary:l,onOpenAutoFocus:u,onEscapeKeyDown:m,onWheel:p,children:t})})]})}import{Fragment as xr,jsx as M,jsxs as Te}from"react/jsx-runtime";function Fl(e,t){return e===!0}function Ov({multiple:e,selected:t,setSelected:r,onSelect:o,options:a,icon:n,placeholder:c="Select...",searchPlaceholder:s="Search...",emptyState:u,createLabel:l,onCreate:d,buttonProps:m,shortcutHint:p,caret:f,side:b,open:h,onOpenChange:y,onSearchChange:w,shouldFilter:x=!0,inputRight:P,inputClassName:k,optionRight:N,optionClassName:_,matchTriggerWidth:$,hideSearch:S=!1,children:R}){let K=Fl(e,r),v=Array.isArray(t)?t:t?[t]:[],{isMobile:C}=Y(),[F,L]=Dt(!1),I=h??F,J=y??L,[fe,$r]=Dt(""),[Go,Ur]=Dt(!1),[Gr,Oi]=Dt(void 0),[zi,jo]=Dt(!1),Vi=O=>{var nt;if(o==null||o(O),!!r)if(K){let Ue=v.some(({value:Ge})=>Ge===O.value);r(Ue?v.filter(({value:Ge})=>Ge!==O.value):[...v,O])}else r(v.length&&((nt=v[0])==null?void 0:nt.value)===O.value?null:O),J(!1)},Ko=Hl((O,nt)=>nt===""?[...O.filter(Ue=>Ue.first&&!v.some(Ge=>Ge.value===Ue.value)),...v,...O.filter(Ue=>!Ue.first&&!v.some(Ge=>Ge.value===Ue.value))]:O,[v]);return vr(()=>{Go&&(Oi(a&&Ko(a,fe)),Ur(!1))},[Go,a,Ko,fe]),vr(()=>{Ur(!0)},[a]),vr(()=>{I||($r(""),Ur(!0))},[I]),vr(()=>w==null?void 0:w(fe),[fe]),M(ve,{openPopover:I,setOpenPopover:J,align:"start",side:b,onWheel:O=>{O.stopPropagation()},popoverContentClassName:i($&&"sm:w-[var(--radix-popover-trigger-width)]"),content:M(Se,{width:!C&&!$,height:!0,style:{transform:"translateZ(0)"},transition:{ease:"easeInOut",duration:.1},className:"pointer-events-auto",children:Te(Et,{loop:!0,shouldFilter:x,children:[!S&&Te("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[M(El,{placeholder:s,value:fe,onValueChange:$r,className:i("grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-400 focus:ring-0 sm:text-sm",k),onKeyDown:O=>{(O.key==="Escape"||O.key==="Backspace"&&!fe)&&(O.preventDefault(),O.stopPropagation(),J(!1))}}),P&&M("div",{className:"mr-2",children:P}),p&&M("kbd",{className:"mr-2 hidden shrink-0 rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-500 md:block",children:p})]}),M(Bl,{children:M(Et.List,{className:i("flex w-full min-w-[100px] flex-col gap-1 p-1"),children:Gr!==void 0?Te(xr,{children:[Gr.map(O=>M(Wl,{option:O,multiple:K,selected:v.some(({value:nt})=>nt===O.value),onSelect:()=>Vi(O),right:N==null?void 0:N(O),className:_},`${O.label}, ${O.value}`)),fe.length>0&&d&&Te(Il,{className:i("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm text-neutral-700","data-[selected=true]:bg-neutral-100",_),onSelect:async()=>{jo(!0),await(d==null?void 0:d(fe))&&($r(""),J(!1)),jo(!1)},children:[zi?M(ke,{className:"size-4 shrink-0"}):M(ct,{className:"size-4 shrink-0"}),M("div",{className:"grow truncate",children:(l==null?void 0:l(fe))||`Create "${fe}"`})]}),x?M(Ul,{className:"flex min-h-12 items-center justify-center text-sm text-neutral-500",children:u||"No matches"}):Gr.length===0?M("div",{className:"flex min-h-12 items-center justify-center text-sm text-neutral-500",children:u||"No matches"}):null]}):M(Et.Loading,{children:M("div",{className:"flex h-12 items-center justify-center",children:M(ke,{})})})})})]})}),children:M(te,{variant:"secondary",...m,className:i(m==null?void 0:m.className,"flex gap-2"),textWrapperClassName:i(m==null?void 0:m.textWrapperClassName,"w-full flex items-center justify-start"),text:Te(xr,{children:[M("div",{className:"min-w-0 grow truncate text-left",children:R||v.map(O=>O.label).join(", ")||c}),f&&(f===!0?M(Ol,{className:"ml-1 size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"}):f)]}),icon:n?fn(n)?n:M(n,{className:"size-4 shrink-0"}):void 0})})}var Bl=({children:e})=>{let t=_l(null),{scrollProgress:r,updateScrollProgress:o}=Ae(t);return Te(xr,{children:[M("div",{className:"scrollbar-hide max-h-[min(50vh,250px)] w-screen overflow-y-scroll sm:w-auto",ref:t,onScroll:o,children:e}),M("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 Wl({option:e,onSelect:t,multiple:r,selected:o,right:a,className:n}){return Te(xr,{children:[M($l,{disabledTooltip:e.disabledTooltip,children:Te(Et.Item,{className:i("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-neutral-100",Boolean(e.disabledTooltip)&&"cursor-not-allowed opacity-50",n),disabled:!!e.disabledTooltip,onSelect:t,value:e.label+(e==null?void 0:e.value),children:[r&&M("div",{className:"shrink-0 text-neutral-600",children:o?M(ya,{className:"size-4 text-neutral-600"}):M(wa,{className:"size-4 text-neutral-400"})}),Te("div",{className:"flex min-w-0 grow items-center gap-1",children:[e.icon&&M("span",{className:"shrink-0 text-neutral-600",children:fn(e.icon)?e.icon:M(e.icon,{className:"h-4 w-4"})}),M("span",{className:"grow truncate",children:e.label})]}),a,!r&&o&&M(ar,{className:"size-4 shrink-0 text-neutral-600"})]})}),e.separatorAfter&&M(Et.Separator,{className:"-mx-1 my-1 h-px bg-neutral-200"})]})}var $l=({children:e,disabledTooltip:t})=>t?M(Q,{content:t,children:M("div",{children:e})}):e,fn=e=>Vl(e),Ul=zl((e,t)=>Al(o=>o.filtered.count===0)?M("div",{ref:t,"cmdk-empty":"",role:"presentation",...e}):null);import{addYears as yr,format as Gl,isSameMonth as jl}from"date-fns";import{ChevronLeft as gn,ChevronRight as bn,ChevronsLeft as Kl,ChevronsRight as Yl}from"lucide-react";import{forwardRef as Zl,useRef as ql}from"react";import{DayPicker as Xl,useDayPicker as Jl,useDayRender as Ql,useNavigation as ec}from"react-day-picker";import{Fragment as tc,jsx as oe,jsxs as wr}from"react/jsx-runtime";var It=Zl(({onClick:e,icon:t,disabled:r,...o},a)=>oe("button",{ref:a,type:"button",disabled:r,className:i("flex size-7 shrink-0 select-none items-center justify-center rounded border p-1 outline-none transition","border-neutral-200 text-neutral-600 hover:text-neutral-800","hover:bg-neutral-50 active:bg-neutral-100","disabled:pointer-events-none disabled:text-neutral-400"),onClick:e,...o,children:oe(t,{className:"h-full w-full shrink-0"})}));It.displayName="NavigationButton";function hn({mode:e="single",weekStartsOn:t=0,numberOfMonths:r=1,showYearNavigation:o=!1,disableNavigation:a,locale:n,className:c,classNames:s,...u}){return oe(Xl,{mode:e,weekStartsOn:t,numberOfMonths:r,locale:n,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-neutral-400 pb-2",row:"w-full",cell:"relative p-0 text-center focus-within:relative text-neutral-900",day:i("relative size-10 rounded-md text-sm text-neutral-900","hover:bg-neutral-100 active:bg-neutral-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-neutral-300 line-through disabled:hover:bg-transparent",day_outside:"text-neutral-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:()=>oe(gn,{className:"h-4 w-4"}),IconRight:()=>oe(bn,{className:"h-4 w-4"}),Caption:({...l})=>{let{goToMonth:d,nextMonth:m,previousMonth:p,currentMonth:f,displayMonths:b}=ec(),{numberOfMonths:h,fromDate:y,toDate:w}=Jl(),x=b.findIndex(R=>jl(l.displayMonth,R)),P=x===0,k=x===b.length-1,N=h>1&&(P||!k),_=h>1&&(k||!P),$=()=>{let R=yr(f,-1);p&&(!y||R.getTime()>=y.getTime())&&d(R)},S=()=>{let R=yr(f,1);m&&(!w||R.getTime()<=w.getTime())&&d(R)};return wr("div",{className:"flex items-center justify-between",children:[wr("div",{className:"flex items-center gap-1",children:[o&&!_&&oe(It,{disabled:a||!p||y&&yr(f,-1).getTime()<y.getTime(),"aria-label":"Go to previous year",onClick:$,icon:Kl}),!_&&oe(It,{disabled:a||!p,"aria-label":"Go to previous month",onClick:()=>p&&d(p),icon:gn})]}),oe("div",{role:"presentation","aria-live":"polite",className:"text-sm font-medium capitalize tabular-nums text-neutral-900",children:Gl(l.displayMonth,"LLLL yyy",{locale:n})}),wr("div",{className:"flex items-center gap-1",children:[!N&&oe(It,{disabled:a||!m,"aria-label":"Go to next month",onClick:()=>m&&d(m),icon:bn}),o&&!N&&oe(It,{disabled:a||!m||w&&yr(f,1).getTime()>w.getTime(),"aria-label":"Go to next year",onClick:S,icon:Yl})]})]})},Day:({date:l,displayMonth:d})=>{let m=ql(null),{activeModifiers:p,buttonProps:f,divProps:b,isButton:h,isHidden:y}=Ql(l,d,m),{selected:w,today:x,disabled:P,range_middle:k}=p;if(y)return oe(tc,{});if(!h)return oe("div",{...b,className:i("flex items-center justify-center",b.className)});let{children:N,..._}=f;return wr("button",{ref:m,..._,type:"button",children:[N,x&&oe("span",{className:i("absolute inset-x-1/2 bottom-1.5 h-0.5 w-4 -translate-x-1/2 rounded-[2px]",{"bg-blue-500":!w,"!bg-white":w,"!bg-blue-400":w&&k,"text-neutral-400":P})})]})}},...u})}import{enUS as uc}from"date-fns/locale";import{useEffect as mo,useMemo as xn,useRef as pc,useState as Cr}from"react";import{Command as no}from"cmdk";import{Lock as rc}from"lucide-react";import{jsx as Ye,jsxs as oc}from"react/jsx-runtime";var io=({presets:e,onSelect:t,currentValue:r,currentPresetId:o})=>{let a=l=>"dateRange"in l,n=l=>"date"in l,c=(l,d)=>l.getDate()===d.getDate()&&l.getMonth()===d.getMonth()&&l.getFullYear()===d.getFullYear(),s=(l,d)=>{let m=l.from,p=d.from,f=!1;m&&p&&c(m,p)&&(f=!0);let b=l.to,h=d.to,y=!1;return b&&h&&c(b,h)&&(y=!0),f&&y},u=l=>{if(o)return o===l.id;if(a(l)){let d=r;return d&&s(d,l.dateRange)}else if(n(l)){let d=r;return d&&c(d,l.date)}return!1};return Ye(no,{className:"w-full rounded ring-neutral-200 ring-offset-2 focus:outline-none",tabIndex:0,autoFocus:!0,loop:!0,children:Ye(no.List,{className:"[&>*]:flex [&>*]:w-full [&>*]:items-start [&>*]:gap-x-2 [&>*]:gap-y-0.5 [&>*]:sm:flex-col",children:e.map((l,d)=>oc(no.Item,{disabled:l.requiresUpgrade,onSelect:()=>t(l),title:l.label,value:l.id,className:i("group relative flex cursor-pointer items-center justify-between overflow-hidden text-ellipsis whitespace-nowrap rounded border border-neutral-200","px-2.5 py-1.5 text-left text-sm text-neutral-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-neutral-100",u(l)&&"font-semibold text-neutral-800"),children:[Ye("span",{children:l.label}),l.requiresUpgrade?Ye(rc,{className:"h-3.5 w-3.5","aria-hidden":"true"}):l.shortcut?Ye("kbd",{className:"text-neutral-4000 hidden rounded bg-neutral-100 px-2 py-0.5 text-xs font-light group-data-[selected=true]:bg-neutral-200 md:block",children:l.shortcut.toUpperCase()}):null,l.requiresUpgrade&&l.tooltipContent&&Ye(Q,{side:"bottom",content:l.tooltipContent,children:Ye("div",{className:"absolute inset-0 cursor-not-allowed"})})]},d))})})};io.displayName="DatePicker.Presets";import{format as ze}from"date-fns";import{createContext as ac}from"react";var so=ac({isOpen:!1,setIsOpen:()=>{}}),nc=()=>{let e=typeof window<"u"?window.navigator.language:"en-US",t=new Intl.DateTimeFormat(e,{hour:"numeric"}).format();return Number.isInteger(Number(t))},lo=(e,t,r=!1)=>{let o=!nc(),a;return r?a=o?ze(e,"d MMM, yyyy h:mm a",{locale:t}):ze(e,"d MMM, yyyy HH:mm",{locale:t}):a=ze(e,"d MMM, yyyy",{locale:t}),a},vn=(e,t)=>{let{toYear:r,fromYear:o,fromMonth:a,toMonth:n,fromDay:c,toDay:s}=t;if(e&&e.length>0){let u=o,l=r;e.forEach(d=>{var m,p,f,b,h,y;if("date"in d){let w=d.date.getFullYear();if(o&&w<o)throw new Error(`Preset ${d.label} is before fromYear ${u}.`);if(r&&w>r)throw new Error(`Preset ${d.label} is after toYear ${l}.`);if(a&&d.date.getMonth()<a.getMonth())throw new Error(`Preset ${d.label} is before fromMonth ${a}.`);if(n&&d.date.getMonth()>n.getMonth())throw new Error(`Preset ${d.label} is after toMonth ${n}.`);if(c&&d.date.getDate()<c.getDate())throw new Error(`Preset ${d.label} is before fromDay ${c}.`);if(s&&d.date.getDate()>s.getDate())throw new Error(`Preset ${d.label} is after toDay ${ze(s,"MMM dd, yyyy")}.`)}if("dateRange"in d){let w=(m=d.dateRange.from)==null?void 0:m.getFullYear(),x=(p=d.dateRange.to)==null?void 0:p.getFullYear();if(w&&o&&w<o)throw new Error(`Preset ${d.label}'s 'from' is before fromYear ${u}.`);if(x&&r&&x>r)throw new Error(`Preset ${d.label}'s 'to' is after toYear ${l}.`);if(a){let P=(f=d.dateRange.from)==null?void 0:f.getMonth();if(P&&P<a.getMonth())throw new Error(`Preset ${d.label}'s 'from' is before fromMonth ${ze(a,"MMM, yyyy")}.`)}if(n){let P=(b=d.dateRange.to)==null?void 0:b.getMonth();if(P&&P>n.getMonth())throw new Error(`Preset ${d.label}'s 'to' is after toMonth ${ze(n,"MMM, yyyy")}.`)}if(c){let P=(h=d.dateRange.from)==null?void 0:h.getDate();if(P&&P<c.getDate())throw new Error(`Preset ${d.dateRange.from}'s 'from' is before fromDay ${ze(c,"MMM dd, yyyy")}.`)}if(s){let P=(y=d.dateRange.to)==null?void 0:y.getDate();if(P&&P>s.getDate())throw new Error(`Preset ${d.label}'s 'to' is after toDay ${ze(s,"MMM dd, yyyy")}.`)}}})}};import{cva as ic}from"class-variance-authority";import{Calendar as sc,ChevronDown as lc}from"lucide-react";import{forwardRef as cc}from"react";import{jsx as Nr,jsxs as mc}from"react/jsx-runtime";var dc=ic(["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-neutral-200 text-neutral-900 placeholder-neutral-400 transition-all","disabled:pointer-events-none disabled:bg-neutral-100 disabled:text-neutral-400","focus-visible:border-neutral-500 data-[state=open]:border-neutral-500 data-[state=open]:ring-4 data-[state=open]:ring-neutral-200"],{variants:{hasError:{true:"ring-2 ring-red-200 border-red-500"}}}),co=cc(({className:e,children:t,placeholder:r,hasError:o,...a},n)=>mc("button",{ref:n,className:i(dc({hasError:o}),e),...a,children:[Nr(sc,{className:i("h-4 w-4 shrink-0 text-neutral-400",!!t&&"text-neutral-900")}),Nr("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-neutral-900",children:t||(r?Nr("span",{className:"text-neutral-400",children:r}):null)}),Nr(lc,{className:"h-4 w-4 flex-shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}));co.displayName="DatePicker.Trigger";import{jsx as ae,jsxs as yn}from"react/jsx-runtime";var fc=({value:e,defaultValue:t,presetId:r,onChange:o,presets:a,disabled:n,disableNavigation:c,disabledDays:s,showYearNavigation:u=!1,locale:l=uc,placeholder:d="Select date range",hasError:m,align:p="center",className:f,...b})=>{let{isDesktop:h}=Y(),[y,w]=Cr(!1),[x,P]=Cr(a&&r?a==null?void 0:a.find(({id:L})=>L===r):void 0),[k,N]=Cr((x==null?void 0:x.dateRange)??e??t??void 0),[_,$]=Cr(k==null?void 0:k.to),S=xn(()=>k,[y]);mo(()=>{N(e)},[e]),mo(()=>{let L=a==null?void 0:a.find(({id:I})=>I===r);P(L),N((L==null?void 0:L.dateRange)??e??t)},[a,r]),mo(()=>{y?k&&$(k.to):$(k==null?void 0:k.to)},[y]);let R=(L,I)=>{let J=(k==null?void 0:k.from)&&(k==null?void 0:k.to)?{from:I}:L;N(J),P(void 0),(J==null?void 0:J.from)&&(J==null?void 0:J.to)&&(o==null||o(J),w(!1))},K=L=>{N(L.dateRange),P(L),o==null||o(L.dateRange,L),w(!1)},v=()=>{N(S),w(!1)},C=L=>{L||v(),w(L)},F=xn(()=>k?`${k.from?lo(k.from,l):""} - ${k.to?lo(k.to,l):""}`:null,[k,l]);return Ie((a==null?void 0:a.filter(L=>L.shortcut).map(L=>L.shortcut))??[],L=>{let I=a==null?void 0:a.find(J=>J.shortcut===L.key);I&&K(I)}),ae(so.Provider,{value:{isOpen:y,setIsOpen:w},children:ae(ve,{align:p,openPopover:y,setOpenPopover:C,popoverContentClassName:"rounded-xl",content:ae("div",{className:"flex w-full",children:yn("div",{className:"scrollbar-hide relative flex w-full flex-col overflow-x-scroll sm:flex-row-reverse sm:items-start",children:[a&&a.length>0&&ae(gc,{children:ae("div",{className:"absolute px-3 sm:inset-0 sm:left-0",children:ae("div",{className:"sm:py-3",children:ae(io,{currentPresetId:r,currentValue:k,presets:a,onSelect:K})})})}),ae("div",{className:"scrollbar-hide overflow-x-scroll",children:ae(hn,{mode:"range",selected:k,onSelect:R,month:_,onMonthChange:$,numberOfMonths:h?2:1,disabled:s,disableNavigation:c,showYearNavigation:u,locale:l,className:"scrollbar-hide overflow-x-scroll",classNames:{months:"flex flex-row divide-x divide-neutral-200 overflow-x-scroll scrollbar-hide"},...b})})]})}),children:ae(co,{placeholder:d,disabled:n,className:f,hasError:m,"aria-required":b.required||b["aria-required"],"aria-invalid":b["aria-invalid"],"aria-label":b["aria-label"],"aria-labelledby":b["aria-labelledby"],children:(x==null?void 0:x.label)??F})})})};function xx({presets:e,...t}){return e&&vn(e,t),ae(fc,{presets:e,...t})}function gc({children:e}){let t=pc(null),{scrollProgress:r,updateScrollProgress:o}=Ae(t);return yn("div",{className:"relative sm:h-full",children:[ae("div",{ref:t,onScroll:o,className:i("relative flex h-16 w-full items-center sm:h-full sm:w-48","border-b border-neutral-200 sm:border-b-0 sm:border-l","scrollbar-hide overflow-auto"),children:e}),ae("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)}})]})}import{useId as bc}from"react";import{jsx as kr,jsxs as hc}from"react/jsx-runtime";function Rx({dotSize:e=2,gapSize:t=10,patternOffset:r=[0,0],className:o}){let a=bc();return hc("svg",{className:i("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[kr("defs",{children:kr("pattern",{id:`dots-${a}`,x:r[0]-1,y:r[1]-1,width:e+t,height:e+t,patternUnits:"userSpaceOnUse",children:kr("rect",{x:1,y:1,width:e,height:e,fill:"currentColor"})})}),kr("rect",{fill:`url(#dots-${a})`,width:"100%",height:"100%"})]})}import vc from"next/link";import{useEffect as xc,useState as wn}from"react";import yc from"swr";import{jsx as uo,jsxs as Nn}from"react/jsx-runtime";function Cn({className:e}){let{data:t}=yc("https://status.dub.co/api/v1/summary",ge),[r,o]=wn("bg-neutral-200"),[a,n]=wn("Loading status...");return xc(()=>{if(!t)return;let{ongoing_incidents:c}=t;if(c.length>0){let{current_worst_impact:s,name:u}=c[0],l=s==="degraded_performance"?"bg-yellow-500":"bg-red-500";n(u),o(l)}else n("All systems operational"),o("bg-green-500")},[t]),Nn(vc,{href:"https://status.dub.co",target:"_blank",className:i("group flex max-w-fit items-center gap-2 rounded-lg border border-neutral-200 bg-white py-2 pl-2 pr-2.5 transition-colors hover:bg-neutral-50 active:bg-neutral-100",e),children:[Nn("div",{className:"relative size-2",children:[uo("div",{className:i("absolute inset-0 m-auto size-2 animate-ping items-center justify-center rounded-full group-hover:animate-none",r,a==="Loading status..."&&"animate-none")}),uo("div",{className:i("absolute inset-0 z-10 m-auto size-2 rounded-full",r)})]}),uo("p",{className:"text-xs font-medium leading-none text-neutral-600",children:a})]})}import{jsx as Pr,jsxs as kn}from"react/jsx-runtime";function Ox({icon:e,title:t,description:r,learnMore:o,children:a}){return kn("div",{className:"flex flex-col items-center justify-center gap-y-4",children:[Pr("div",{className:"flex size-16 items-center justify-center rounded-2xl border border-neutral-200 bg-neutral-50",children:Pr(e,{className:"size-6 text-neutral-800"})}),Pr("p",{className:"text-center text-base font-medium text-neutral-950",children:t}),r&&kn("p",{className:"max-w-sm text-balance text-center text-sm text-neutral-500",children:[r," ",o&&Pr("a",{href:o,target:"_blank",className:"underline underline-offset-2 hover:text-neutral-800",children:"Learn more \u2197"})]}),a]})}import{cva as wc}from"class-variance-authority";import{useState as Pn}from"react";import{toast as Sn}from"sonner";import{Fragment as Cc,jsx as xe,jsxs as fo}from"react/jsx-runtime";var Rn=["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/csv"],po={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)"},documents:{types:Rn,errorMessage:"File type not supported (document files only)"},programResourceImages:{types:["image/svg+xml","image/png","image/jpeg","image/webp"],errorMessage:"File type not supported (.svg, .png, .jpg, or .webp only)"},programResourceFiles:{types:[...Rn,"application/zip"],errorMessage:"File type not supported (document or zip files only)"}},Nc=wc("group relative isolate flex aspect-[1200/630] w-full flex-col items-center justify-center overflow-hidden bg-white transition-all hover:bg-neutral-50",{variants:{variant:{default:"rounded-md border border-neutral-300 shadow-sm",plain:""}},defaultVariants:{variant:"default"}});function jx({id:e,readFile:t,onChange:r,variant:o,className:a,iconClassName:n,previewClassName:c,icon:s=Sa,customPreview:u,accept:l="any",imageSrc:d,loading:m=!1,clickToUpload:p=!0,showHoverOverlay:f=!0,content:b,maxFileSizeMB:h=0,targetResolution:y,accessibilityLabel:w="File upload",disabled:x=!1}){let[P,k]=Pn(!1),[N,_]=Pn(null),$=async S=>{let R="dataTransfer"in S?S.dataTransfer.files&&S.dataTransfer.files[0]:S.target.files&&S.target.files[0];if(!R)return;if(_(R.name),h>0&&R.size/1024/1024>h){Sn.error(`File size too big (max ${h} MB)`);return}let K=po[l].types;if(K.length&&!K.includes(R.type)){Sn.error(po[l].errorMessage??"File type not supported");return}let v=R;if(y&&R.type.startsWith("image/"))try{let C=await Zo(R,y),F=await fetch(C).then(L=>L.blob());v=new File([F],R.name,{type:R.type})}catch(C){console.error("Error resizing image:",C)}if(t){let C=new FileReader;C.onload=F=>{var L;return r==null?void 0:r({src:(L=F.target)==null?void 0:L.result,file:v})},C.readAsDataURL(v);return}r==null||r({file:v})};return fo("label",{className:i(Nc({variant:o}),x?"cursor-not-allowed":i(p&&"cursor-pointer"),a),children:[m&&xe("div",{className:"absolute inset-0 z-[5] flex items-center justify-center rounded-[inherit] bg-white",children:xe(kt,{})}),xe("div",{className:"absolute inset-0 z-[5]",onDragOver:S=>{S.preventDefault(),S.stopPropagation(),k(!0)},onDragEnter:S=>{S.preventDefault(),S.stopPropagation(),k(!0)},onDragLeave:S=>{S.preventDefault(),S.stopPropagation(),k(!1)},onDrop:async S=>{S.preventDefault(),S.stopPropagation(),$(S),k(!1)}}),fo("div",{className:i("absolute inset-0 z-[3] flex flex-col items-center justify-center rounded-[inherit] border-2 border-transparent bg-white transition-all",x&&"bg-neutral-50",P&&!x&&"cursor-copy border-black bg-neutral-50 opacity-100",d?i("opacity-0",f&&!x&&"group-hover:opacity-100"):i(!x&&"group-hover:bg-neutral-50")),children:[xe(s,{className:i("size-7 transition-all duration-75",x?"text-neutral-400":i("text-neutral-500 group-hover:scale-110 group-active:scale-95",P?"scale-110":"scale-100"),n)}),b!==null&&xe("div",{className:i("mt-2 text-center text-sm text-neutral-500",x&&"text-neutral-400"),children:b??xe(Cc,{children:fo("p",{children:["Drag and drop ",p&&"or click"," to upload."]})})}),xe("span",{className:"sr-only",children:w})]}),d&&(u??xe("img",{src:d,alt:"Preview",className:i("h-full w-full rounded-[inherit] object-cover",c)})),p&&xe("div",{className:"sr-only mt-1 flex shadow-sm",children:xe("input",{id:e,type:"file",accept:po[l].types.join(","),onChange:$,disabled:x},N)})]})}import{AnimatePresence as kc,motion as Tn}from"framer-motion";import{X as Pc}from"lucide-react";import Sc from"next/link";import{isValidElement as Rc}from"react";import{Fragment as Tc,jsx as ee,jsxs as At}from"react/jsx-runtime";function Mn({filters:e,activeFilters:t,onRemove:r,onRemoveAll:o,className:a}){return Ie("Escape",o,{priority:1}),ee(Se,{height:!0,className:"w-full",transition:{type:"tween",duration:.3},children:At("div",{className:i("flex w-full flex-wrap items-start gap-4 sm:flex-nowrap",a),children:[ee("div",{className:"flex grow flex-wrap gap-x-4 gap-y-2",children:ee(kc,{children:t==null?void 0:t.map(({key:n,value:c})=>{if(n==="loader")return ee(Tn.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"h-9 w-48 animate-pulse rounded-md border border-neutral-200 bg-white"},`loader-${c}`);let s=e.find(u=>u.key===n);return s?(s.multiple&&Array.isArray(c)?c:[c]).map(u=>{var f,b,h,y;let l=(f=s.options)==null?void 0:f.find(w=>typeof w.value=="string"&&typeof u=="string"?w.value.toLowerCase()===u.toLowerCase():w.value===u),d=(l==null?void 0:l.icon)??((b=s.getOptionIcon)==null?void 0:b.call(s,u,{key:s.key,option:l}))??s.icon,m=(l==null?void 0:l.label)??((h=s.getOptionLabel)==null?void 0:h.call(s,u,{key:s.key,option:l}))??u,p=(l==null?void 0:l.permalink)??((y=s.getOptionPermalink)==null?void 0:y.call(s,u))??null;return At(Tn.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"flex items-center divide-x rounded-md border border-neutral-200 bg-white text-sm text-black",children:[At("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[ee("span",{className:"shrink-0 text-neutral-600",children:Ln(s.icon)?s.icon:ee(s.icon,{className:"h-4 w-4"})}),s.label]}),ee("div",{className:"px-3 py-2 text-neutral-500",children:"is"}),ee("div",{className:"flex items-center gap-2.5 px-3 py-2",children:s.options?At(Tc,{children:[ee("span",{className:"shrink-0 text-neutral-600",children:Ln(d)?d:ee(d,{className:"h-4 w-4"})}),p?ee(Sc,{href:p,target:"_blank",className:"cursor-alias decoration-dotted underline-offset-2 hover:underline",children:Nt(m,30)}):Nt(m,30)]}):ee("div",{className:"h-5 w-12 animate-pulse rounded-md bg-neutral-200"})}),ee("button",{type:"button",className:"h-full rounded-r-md p-2 text-neutral-500 ring-inset ring-neutral-500 hover:bg-neutral-100 hover:text-neutral-800 focus:outline-none focus-visible:ring-1",onClick:()=>r(n,u),children:ee(Pc,{className:"h-3.5 w-3.5"})})]},`${n}-${u}`)}):(console.error("Filter.List received an activeFilter without a corresponding filter"),null)})})}),(t==null?void 0:t.length)!==0&&At("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-neutral-500 ring-inset ring-neutral-500 transition-colors hover:border-neutral-200 hover:bg-white hover:text-black focus:outline-none",onClick:o,children:["Clear Filters",ee("kbd",{className:"rounded-md border border-neutral-200 px-1.5 py-0.5 text-xs text-neutral-950 group-hover:bg-neutral-50",children:"ESC"})]})]})})}var Ln=e=>Rc(e);import{Command as Ve,useCommandState as Lc}from"cmdk";import{ChevronDown as Mc,ListFilter as Dc}from"lucide-react";import{Fragment as Ec,forwardRef as Ic,isValidElement as En,useCallback as Sr,useEffect as Rr,useImperativeHandle as Ac,useRef as bo,useState as go}from"react";import{Fragment as Fc,jsx as H,jsxs as ye}from"react/jsx-runtime";function In({filters:e,onSelect:t,onRemove:r,onOpenFilter:o,onSearchChange:a,onSelectedFilterChange:n,activeFilters:c,askAI:s,children:u,emptyState:l,className:d}){var R,K;let{isMobile:m}=Y(),p=bo(null),f=bo(),[b,h]=go(!1);Ie("f",()=>h(!0),{enabled:!b});let[y,w]=go(""),[x,P]=go(null),k=Sr(()=>{w(""),P(null)},[]);Rr(()=>{b||k()},[b]);let N=x?e.find(({key:v})=>v===x):null,_=Sr(v=>{p.current&&(f.current={width:p.current.clientWidth,height:p.current.clientHeight}),w(""),P(v),o==null||o(v)},[]),$=Sr(v=>{if(!N||!c)return!1;let C=c.find(({key:F})=>F===x);return(C==null?void 0:C.value)===v||C&&N.multiple&&Array.isArray(C.value)&&C.value.includes(v)},[N]),S=Sr(v=>{N&&($(v)?r(N.key,v):t(N.key,v),N.multiple||h(!1))},[c,N,s]);return Rr(()=>{a==null||a(y)},[y]),Rr(()=>{n==null||n(x)},[x]),Rr(()=>{(N==null?void 0:N.options)&&p.current&&(f.current={width:p.current.clientWidth,height:p.current.clientHeight})},[N==null?void 0:N.options]),H(ve,{openPopover:b,setOpenPopover:h,onEscapeKeyDown:v=>{x&&(v.preventDefault(),k())},content:H(Se,{width:!m,height:!0,className:"rounded-[inherit]",style:{transform:"translateZ(0)"},children:ye(Ve,{loop:!0,shouldFilter:!N||N.shouldFilter!==!1,children:[ye("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[H(zc,{placeholder:`${(N==null?void 0:N.label)||"Filter"}...`,value:y,onValueChange:w,onKeyDown:v=>{(v.key==="Escape"||v.key==="Backspace"&&!y)&&(v.preventDefault(),v.stopPropagation(),x?k():h(!1))},emptySubmit:v=>{v.preventDefault(),v.stopPropagation(),s?(t("ai",N?`${N.label} ${y}`:y),h(!1)):S(y)}}),!N&&H("kbd",{className:"mr-2 hidden shrink-0 rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-500 md:block",children:"F"})]}),H(Vc,{ref:p,children:ye(Ve.List,{className:i("flex w-full flex-col gap-1 p-1",N?"min-w-[100px]":"min-w-[180px]"),children:[N?((K=(R=N.options)==null?void 0:R.filter(v=>!y||!v.hideDuringSearch))==null?void 0:K.map(v=>{let C=$(v.value);return H(Dn,{filter:N,option:v,right:C?H(xa,{className:"h-4 w-4"}):v.right,onSelect:()=>S(v.value)},v.value)}))??H(Ve.Loading,{children:H("div",{className:"-m-1 flex items-center justify-center",style:f.current,children:H(ke,{})})}):e.filter(v=>!v.hideInFilterDropdown).map(v=>ye(Ec,{children:[H(Dn,{filter:v,onSelect:()=>_(v.key)}),v.separatorAfter&&H(Ve.Separator,{className:"-mx-1 my-1 border-b border-neutral-200"})]},v.key)),(!N||N.options)&&H(Hc,{search:y,askAI:s,children:l?Oc(l)?(l==null?void 0:l[x??"default"])??"No matches":l:"No matches"})]})},x)]})}),children:ye("button",{type:"button",className:i("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-neutral-200 bg-white text-neutral-900 placeholder-neutral-400","focus-visible:border-neutral-500 data-[state=open]:border-neutral-500 data-[state=open]:ring-4 data-[state=open]:ring-neutral-200",d),children:[H(Dc,{className:"size-4 shrink-0"}),H("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-neutral-900",children:u??"Filter"}),c!=null&&c.length?H("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-black text-[0.625rem] text-white",children:c.length}):H(Mc,{className:"size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]})})}function Oc(e){return typeof e=="object"&&e!==null&&!En(e)}var zc=e=>{let t=Lc(r=>r.filtered.count===0);return H(Ve.Input,{...e,size:1,className:"grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-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"})},Vc=Ic(({children:e},t)=>{let r=bo(null);Ac(t,()=>r.current);let{scrollProgress:o,updateScrollProgress:a}=Ae(r);return ye(Fc,{children:[H("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",ref:r,onScroll:a,children:e}),H("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 Dn({filter:e,option:t,right:r,onSelect:o}){var s,u;let{isMobile:a}=Y(),n=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??((u=e.getOptionLabel)==null?void 0:u.call(e,t.value,{key:e.key,option:t})):e.label;return ye(Ve.Item,{className:i("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-neutral-100"),onPointerDown:l=>{l.preventDefault()},onPointerUp:l=>{l.preventDefault(),a?setTimeout(o,100):o()},onSelect:o,value:c+(t==null?void 0:t.value),children:[H("span",{className:"shrink-0 text-neutral-600",children:_c(n)?n:H(n,{className:"h-4 w-4"})}),Nt(c,48),H("div",{className:"ml-1 flex shrink-0 grow justify-end text-neutral-500",children:r})]})}var Hc=({search:e,askAI:t,children:r})=>t&&e?ye(Ve.Empty,{className:"flex min-w-[180px] items-center space-x-2 rounded-md bg-neutral-100 px-3 py-2",children:[H(aa,{className:"h-4 w-4"}),ye("p",{className:"text-center text-sm text-neutral-600",children:["Ask AI ",ye("span",{className:"text-black",children:['"',e,'"']})]})]}):H(Ve.Empty,{className:"p-2 text-center text-sm text-neutral-400",children:r}),_c=e=>En(e);var h2={Select:In,List:Mn};import{useMemo as Bc,useState as An}from"react";import{jsx as Ze,jsxs as Tr}from"react/jsx-runtime";function k2({title:e,description:t,inputAttrs:r,helpText:o,buttonText:a="Save Changes",disabledTooltip:n,handleSubmit:c}){let[s,u]=An(r.defaultValue),[l,d]=An(!1),m=Bc(()=>l||!s||s===r.defaultValue,[l,s,r.defaultValue]);return Tr("form",{onSubmit:async p=>{p.preventDefault(),d(!0),await c({[r.name]:s}),d(!1)},className:"rounded-lg border border-neutral-200 bg-white",children:[Tr("div",{className:"relative flex flex-col space-y-6 p-5 sm:p-10",children:[Tr("div",{className:"flex flex-col space-y-3",children:[Ze("h2",{className:"text-xl font-medium",children:e}),Ze("p",{className:"text-sm text-neutral-500",children:t})]}),typeof r.defaultValue=="string"?Ze("input",{...r,type:r.type||"text",required:!0,disabled:!!n,onChange:p=>u(p.target.value),className:i("w-full max-w-md rounded-md border border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",{"cursor-not-allowed bg-neutral-100 text-neutral-400":n})}):Ze("div",{className:"h-[2.35rem] w-full max-w-md animate-pulse rounded-md bg-neutral-200"})]}),Tr("div",{className:"flex items-center justify-between space-x-4 rounded-b-lg border-t border-neutral-200 bg-neutral-50 p-3 sm:px-10",children:[typeof o=="string"?Ze("p",{className:"prose-sm prose-a:underline prose-a:underline-offset-4 hover:prose-a:text-neutral-700 text-neutral-500 transition-colors",dangerouslySetInnerHTML:{__html:o||""}}):o,Ze("div",{className:"shrink-0",children:Ze(te,{text:a,loading:l,disabled:m,disabledTooltip:n})})]})]})}import{useId as Wc}from"react";import{jsx as Lr,jsxs as $c}from"react/jsx-runtime";function qe({cellSize:e=12,strokeWidth:t=1,patternOffset:r=[0,0],className:o}){let a=Wc();return $c("svg",{className:i("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[Lr("defs",{children:Lr("pattern",{id:`grid-${a}`,x:r[0]-1,y:r[1]-1,width:e,height:e,patternUnits:"userSpaceOnUse",children:Lr("path",{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"transparent",stroke:"currentColor",strokeWidth:t})})}),Lr("rect",{fill:`url(#grid-${a})`,width:"100%",height:"100%"})]})}import{AlertCircle as Uc}from"lucide-react";import Gc,{useCallback as jc,useState as Kc}from"react";import{jsx as Xe,jsxs as ho}from"react/jsx-runtime";var Yc=Gc.forwardRef(({className:e,type:t,...r},o)=>{let[a,n]=Kc(!1),c=jc(()=>n(!a),[a,n]);return ho("div",{children:[ho("div",{className:"relative flex",children:[Xe("input",{type:a?"text":t,className:i("w-full max-w-md rounded-md border border-neutral-300 text-neutral-900 placeholder-neutral-400 read-only:bg-neutral-100 read-only:text-neutral-500 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",r.error&&"border-red-500 focus:border-red-500 focus:ring-red-500",e),ref:o,...r}),ho("div",{className:"group",children:[r.error&&Xe("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex flex-none items-center px-2.5",children:Xe(Uc,{className:i("size-5 text-white",t==="password"&&"transition-opacity group-hover:opacity-0"),fill:"#ef4444"})}),t==="password"&&Xe("button",{className:i("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?Xe(Ma,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0}):Xe(Da,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0})})]})]}),r.error&&Xe("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});Yc.displayName="Input";import{flip as Qc,offset as ed,size as td,useDismiss as rd,useFloating as od,useInteractions as ad}from"@floating-ui/react";import{Command as Le,useCommandState as nd}from"cmdk";import{Check as id,ChevronDown as sd,Search as ld,X as cd}from"lucide-react";import{createContext as dd,forwardRef as _n,useContext as wo,useEffect as vo,useMemo as zn,useRef as Vn,useState as xo}from"react";import{Drawer as ft}from"vaul";import Zc from"next/image";import{memo as qc,useEffect as Xc,useState as On}from"react";import{jsx as Jc}from"react/jsx-runtime";var Ot=qc(e=>{let[t,r]=On(!0),[o,a]=On(e.src);Xc(()=>a(e.src),[e.src]);let n=c=>{r(!1);let s=c.target;s.naturalWidth<=16&&s.naturalHeight<=16&&a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)};return Jc(Zc,{...e,src:o,alt:e.alt,className:i(t?"blur-[2px]":"blur-0",e.className),onLoad:n,onError:()=>{a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)},unoptimized:!0})});import{jsx as E,jsxs as le}from"react/jsx-runtime";var Mr=dd({inputAttrs:{},openCommandList:!1,setOpenCommandList:()=>{},inputValue:"",setInputValue:()=>{},disabled:!1,selectedItem:null,setSelectedItem:()=>{}});function e4({items:e,selectedItem:t,setSelectedItem:r,className:o,disabled:a,adjustForMobile:n,icon:c,inputAttrs:s,noItemsElement:u}){let{isMobile:l}=Y(),d=Vn(null),[m,p]=xo(!1),[f,b]=xo(""),[h,y]=xo(!1);vo(()=>{m&&y(!1)},[m]),vo(()=>y(!0),[f]),vo(()=>{t&&b(t.value)},[t]);let w=zn(()=>{let C=f.toLowerCase();return h?e.filter(F=>F.value.toLowerCase().includes(C)):f?e.sort((F,L)=>(L.value.toLowerCase().includes(C)?1:0)-(F.value.toLowerCase().includes(C)?1:0)):e},[h,f,e]),{refs:x,floatingStyles:P,context:k}=od({open:m,onOpenChange:p,middleware:[ed(8),td({apply({elements:{floating:C},availableHeight:F}){Object.assign(C.style,{maxHeight:`${Math.max(75,Math.min(F,290))}px`})},padding:8}),Qc({fallbackStrategy:"initialPlacement",padding:8})]}),N=rd(k,{enabled:!l||!n}),{getReferenceProps:_,getFloatingProps:$}=ad([N]),S=Vn(null),{scrollProgress:R,updateScrollProgress:K}=Ae(S),v=zn(()=>t&&t.icon?t.icon:t&&t.image?E(Ot,{src:t.image,alt:t.value,className:"size-4 rounded-full",width:16,height:16}):c||E(ld,{className:"size-4 text-neutral-400"}),[t,c]);return E(Mr.Provider,{value:{inputAttrs:s||{},openCommandList:m,setOpenCommandList:p,inputValue:f,setInputValue:b,disabled:Boolean(a),selectedItem:t,setSelectedItem:r},children:l&&n?le(ft.Root,{open:m,onOpenChange:p,children:[E(ft.Trigger,{className:"sm:hidden",asChild:!0,children:E(Le,{ref:d,className:"relative",shouldFilter:!1,loop:!0,children:E(yo,{className:o,iconElement:v})})}),E(ft.Overlay,{className:"fixed inset-0 z-40 bg-neutral-100 bg-opacity-10 backdrop-blur"}),le(ft.Portal,{children:[E(ft.Content,{className:"fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-lg border-t border-neutral-200 bg-white",onPointerDownOutside:C=>{C.target instanceof Element&&C.target.closest("[data-sonner-toast]")&&C.preventDefault()},children:le(Le,{ref:d,className:"relative",shouldFilter:!1,loop:!0,children:[E("div",{className:"p-2",children:E(yo,{className:o,iconElement:v})}),m&&le(Le.List,{className:"dub-scrollbar h-[70vh] overflow-y-auto p-2",children:[e.length===0&&f===""&&(u?E("div",{children:u}):E("p",{className:"px-4 py-2 text-sm text-neutral-600",children:"No items found."})),f!==""&&E(Le.Empty,{className:"px-4 py-2 text-sm text-neutral-600",children:"No results found."}),E(Hn,{items:w})]})]})}),E(ft.Overlay,{})]})]}):le(Le,{ref:d,className:"relative",shouldFilter:!1,loop:!0,children:[E(yo,{className:o,iconElement:v,ref:x.setReference,..._()}),m&&le("div",{ref:x.setFloating,style:P,...$(),className:"z-20 flex w-full min-w-[160px] flex-col overflow-hidden rounded-md border border-neutral-200 bg-white shadow-md",children:[le("div",{ref:S,onScroll:K,className:"grow overflow-y-auto p-2",children:[le(Le.List,{children:[e.length===0&&f===""&&(u?E("div",{children:u}):E("p",{className:"px-4 py-2 text-sm text-neutral-600",children:"No items found."})),f!==""&&E(Le.Empty,{className:"px-4 py-2 text-sm text-neutral-600",children:"No results found."})]}),E(Hn,{items:w})]}),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(R,2)}})]})]})})}var yo=_n(({iconElement:e,className:t,...r},o)=>le("label",{ref:o,className:i("group relative flex cursor-pointer gap-2 rounded-md border border-neutral-200 bg-white px-1 pl-3 transition-all focus-within:border-neutral-500 focus-within:ring-4 focus-within:ring-neutral-200",t),...r,children:[E("div",{className:"flex shrink-0 items-center justify-center text-neutral-400",children:e}),le("div",{className:"flex h-10 grow",children:[E(md,{}),E(ud,{})]})]})),md=_n((e,t)=>{let r=nd(l=>l.filtered.count===0),{inputAttrs:o,openCommandList:a,setOpenCommandList:n,inputValue:c,setInputValue:s,disabled:u}=wo(Mr);return E(Le.Input,{ref:t,placeholder:(o==null?void 0:o.placeholder)||"Search...",autoFocus:a,onFocus:()=>n(!0),value:c,onValueChange:s,onKeyDown:l=>{l.key==="Escape"?(l.preventDefault(),n(!1)):l.key==="Enter"&&r?n(!1):l.key.match(/^[a-z0-9]$/i)&&!l.metaKey&&n(!0)},disabled:u,className:"block w-full truncate rounded-md border-none px-0 text-base text-neutral-900 placeholder-neutral-400 outline-none outline-0 transition-all duration-300 focus:ring-0 md:text-sm",autoCapitalize:"none"})});function ud(){let{setSelectedItem:e,openCommandList:t,setOpenCommandList:r,inputValue:o,setInputValue:a}=wo(Mr);return E("button",{type:"button",onClick:()=>{r(n=>!n),e(null),a("")},className:"absolute inset-y-0 right-0 my-auto pr-3",children:o.length>0?E(cd,{className:"size-4 text-neutral-400 transition-all hover:text-neutral-700"}):E(sd,{className:i("size-4 text-neutral-400 transition-all hover:text-neutral-700",{"rotate-180 transform":t})})})}function Hn({items:e}){let{setSelectedItem:t,setOpenCommandList:r,setInputValue:o}=wo(Mr);return e.map(a=>le(Le.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-neutral-900 hover:bg-neutral-100 hover:text-neutral-900 active:bg-neutral-200 aria-disabled:cursor-not-allowed aria-disabled:opacity-75 aria-disabled:hover:bg-white aria-selected:bg-neutral-100 aria-selected:text-neutral-900",children:[le("div",{className:"flex items-center space-x-2",children:[a.icon||a.image&&E(Ot,{src:a.image,alt:a.value,className:"size-4 rounded-full",width:16,height:16}),E("p",{className:i("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&&E(ur,{className:"text-xs",variant:"neutral",children:a.label})]}),E(id,{className:"invisible h-5 w-5 text-neutral-500 aria-selected:visible"})]},a.id))}import*as No from"@radix-ui/react-label";import{cva as pd}from"class-variance-authority";import*as Fn from"react";import{jsx as bd}from"react/jsx-runtime";var fd=pd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),gd=Fn.forwardRef(({className:e,...t},r)=>bd(No.Root,{ref:r,className:i(fd(),e),...t}));gd.displayName=No.Root.displayName;import{cva as hd}from"class-variance-authority";import{isValidElement as vd}from"react";import{jsx as Bn,jsxs as Wn}from"react/jsx-runtime";var Co=hd(["flex h-9 w-full rounded-md px-2 items-center justify-center gap-2 transition-colors cursor-pointer","whitespace-nowrap text-sm font-medium text-content-default enabled:hover:bg-bg-subtle transition-colors","disabled:opacity-50 disabled:cursor-default"],{variants:{variant:{default:"text-content-default hover:bg-bg-subtle",danger:"text-content-error hover:bg-bg-error"}}});function u4({as:e,variant:t="default",children:r,icon:o,shortcut:a,className:n,...c}){return Wn(e||"button",{...e==="button"?{type:"button"}:{},className:i(Co({variant:t}),n),...c,children:[Wn("div",{className:"flex grow items-center gap-2",children:[o&&(xd(o)?o:Bn(o,{className:"size-4"})),r]}),a&&Bn("kbd",{className:i("bg-bg-inverted/5 group-hover:bg-bg-inverted/10 hidden rounded px-2 py-0.5 text-xs font-light transition-all duration-75 md:block"),children:a})]})}var xd=e=>vd(e);import{curveNatural as $n}from"@visx/curve";import{LinearGradient as Un}from"@visx/gradient";import{Group as yd}from"@visx/group";import{ParentSize as wd}from"@visx/responsive";import{scaleLinear as Nd,scaleUtc as Cd}from"@visx/scale";import{Area as kd,AreaClosed as Pd}from"@visx/shape";import{motion as Gn}from"framer-motion";import{useId as Sd,useMemo as jn}from"react";import{jsx as we,jsxs as ko}from"react/jsx-runtime";var Rd={top:8,right:2,bottom:2,left:2};function N4(e){return we(wd,{className:"relative",children:({width:t,height:r})=>t>0&&r>0&&we(Td,{...{width:t,height:r,...e}})})}function Td({width:e,height:t,data:r,curve:o=!0,color:a,padding:n}){let c={...Rd,...n},s=Sd(),u=jn(()=>r.map(({date:m})=>({date:m,value:0})),[r]),{yScale:l,xScale:d}=jn(()=>{let m=r.map(({value:y})=>y),p=Math.max(...m),f=r.map(({date:y})=>y.getTime()),b=new Date(Math.min(...f)),h=new Date(Math.max(...f));return{yScale:Nd({domain:[-2,Math.max(p,2)],range:[t-c.top-c.bottom,0],nice:!0,clamp:!0}),xScale:Cd({domain:[b,h],range:[0,e-c.left-c.right],nice:!0})}},[r,t,e]);return ko("svg",{width:e,height:t,children:[ko("defs",{children:[we(Un,{id:`${s}-color-gradient`,from:a||"#7D3AEC",to:a||"#DA2778",x1:0,x2:e-c.left-c.right,gradientUnits:"userSpaceOnUse"}),we(Un,{id:`${s}-mask-gradient`,from:"white",to:"white",fromOpacity:.3,toOpacity:0,x1:0,x2:0,y1:0,y2:1}),we("mask",{id:`${s}-mask`,maskContentUnits:"objectBoundingBox",children:we("rect",{width:"1",height:"1",fill:`url(#${s}-mask-gradient)`})})]}),ko(yd,{left:c.left,top:c.top,children:[we(kd,{data:r,x:({date:m})=>d(m),y:({value:m})=>l(m)??0,curve:o?$n:void 0,children:({path:m})=>we(Gn.path,{initial:{d:m(u)||"",opacity:0},animate:{d:m(r)||"",opacity:1},strokeWidth:1.5,stroke:`url(#${s}-color-gradient)`})}),we(Pd,{data:r,x:({date:m})=>d(m),y:({value:m})=>l(m)??0,yScale:l,curve:o?$n:void 0,children:({path:m})=>we(Gn.path,{initial:{d:m(u)||"",opacity:0},animate:{d:m(r)||"",opacity:1},fill:`url(#${s}-color-gradient)`,mask:`url(#${s}-mask)`})})]})]},r.length)}import*as ce from"@radix-ui/react-dialog";import*as Po from"@radix-ui/react-visually-hidden";import{useRouter as Ld}from"next/navigation";import{Drawer as Je}from"vaul";import{jsx as ne,jsxs as gt}from"react/jsx-runtime";function T4({children:e,className:t,showModal:r,setShowModal:o,onClose:a,desktopOnly:n,preventDefaultClose:c,drawerRootProps:s}){let u=Ld(),l=({dragged:m}={})=>{c&&!m||(a&&a(),o?o(!1):u.back())},{isMobile:d}=Y();return d&&!n?ne(Je.Root,{open:o?r:!0,onOpenChange:m=>{m||l({dragged:!0})},...s,children:gt(Je.Portal,{children:[ne(Je.Overlay,{className:"fixed inset-0 z-50 bg-neutral-100 bg-opacity-10 backdrop-blur"}),ne(Je.Content,{onPointerDownOutside:m=>{m.target instanceof Element&&m.target.closest("[data-sonner-toast]")&&m.preventDefault()},className:i("fixed bottom-0 left-0 right-0 z-50 flex flex-col","rounded-t-[10px] border-t border-neutral-200 bg-white",t),children:gt("div",{className:"scrollbar-hide flex-1 overflow-y-auto rounded-t-[10px] bg-inherit",children:[gt(Po.Root,{children:[ne(Je.Title,{children:"Modal"}),ne(Je.Description,{children:"This is a modal"})]}),ne(Md,{}),e]})}),ne(Je.Overlay,{})]})}):ne(ce.Root,{open:o?r:!0,onOpenChange:m=>{m||l()},children:gt(ce.Portal,{children:[ne(ce.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-neutral-100 bg-opacity-50 backdrop-blur-md"}),gt(ce.Content,{onOpenAutoFocus:m=>m.preventDefault(),onCloseAutoFocus:m=>m.preventDefault(),onPointerDownOutside:m=>{m.target instanceof Element&&m.target.closest("[data-sonner-toast]")&&m.preventDefault()},className:i("fixed inset-0 z-40 m-auto h-fit w-full max-w-md","border border-neutral-200 bg-white p-0 shadow-xl sm:rounded-2xl","scrollbar-hide animate-scale-in overflow-y-auto",t),children:[gt(Po.Root,{children:[ne(ce.Title,{children:"Modal"}),ne(ce.Description,{children:"This is a modal"})]}),e]})]})})}function Md(){return ne("div",{className:"sticky top-0 z-20 flex items-center justify-center rounded-t-[10px] bg-inherit",children:ne("div",{className:"my-3 h-1 w-12 rounded-full bg-neutral-300"})})}import{useCallback as So}from"react";import{jsx as zt,jsxs as Dd}from"react/jsx-runtime";function O4({value:e,onChange:t,min:r,max:o,step:a=1,disabled:n,className:c,id:s,formatValue:u,decrementAriaLabel:l="Decrease",incrementAriaLabel:d="Increase",...m}){let p=typeof r=="number"?e>r:!0,f=typeof o=="number"?e<o:!0,b=So(w=>{let x=w;return typeof r=="number"&&(x=Math.max(r,x)),typeof o=="number"&&(x=Math.min(o,x)),x},[r,o]),h=So(()=>{n||!p||t(b(e-a))},[n,p,b,t,a,e]),y=So(()=>{n||!f||t(b(e+a))},[n,f,b,t,a,e]);return Dd("div",{id:s,role:"group","aria-disabled":n,className:i("flex h-10 w-full select-none items-stretch overflow-hidden rounded-lg border border-neutral-200 bg-white",n&&"opacity-60",c),...m,children:[zt("button",{type:"button","aria-label":l,onClick:h,disabled:n||!p,className:i("flex h-full w-24 items-center justify-center border-r border-neutral-200 text-neutral-700 transition-colors",!(n||!p)&&"hover:bg-neutral-50"),children:zt(lr,{className:"block size-4"})}),zt("div",{role:"spinbutton","aria-valuenow":e,"aria-valuemin":r,"aria-valuemax":o,tabIndex:0,onKeyDown:w=>{n||((w.key==="ArrowLeft"||w.key==="ArrowDown")&&(w.preventDefault(),h()),(w.key==="ArrowRight"||w.key==="ArrowUp")&&(w.preventDefault(),y()))},className:i("flex min-w-0 flex-1 items-center justify-center px-3 text-sm text-neutral-900"),prefix:"",children:u?u(e):e}),zt("button",{type:"button","aria-label":d,onClick:y,disabled:n||!f,className:i("flex h-full w-24 items-center justify-center border-l border-neutral-200 text-neutral-700 transition-colors",!(n||!f)&&"hover:bg-neutral-50"),children:zt(ct,{className:"block size-4"})})]})}import{Fragment as Ed,jsx as Dr,jsxs as bt}from"react/jsx-runtime";var Kn=i("flex h-7 items-center justify-center gap-2 whitespace-nowrap rounded-md border border-neutral-200 bg-white px-2 text-sm text-neutral-600","outline-none hover:bg-neutral-50 focus-visible:border-neutral-500","disabled:cursor-not-allowed disabled:border-neutral-200 disabled:text-neutral-400 disabled:bg-neutral-100");function H4({pagination:e,setPagination:t,totalCount:r,unit:o=s=>`item${s?"s":""}`,className:a,children:n,showTotalCount:c=!0}){return bt("div",{className:i("flex items-center justify-between gap-2 text-sm leading-6 text-neutral-600",a),children:[bt("div",{className:"flex items-center gap-2",children:[bt("div",{children:[Dr("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",r>0&&bt(Ed,{children:[bt("span",{className:"font-medium",children:[((e.pageIndex-1)*e.pageSize+1).toLocaleString(),"-",Math.min((e.pageIndex-1)*e.pageSize+e.pageSize,r).toLocaleString()]})," ",c&&"of "]}),c&&Dr("span",{className:"font-medium",children:r.toLocaleString()})," ",typeof o=="function"?o(r!==1):o]}),n]}),bt("div",{className:"flex items-center gap-2",children:[Dr("button",{type:"button",className:Kn,onClick:()=>t({...e,pageIndex:e.pageIndex-1}),disabled:e.pageIndex===1,children:"Previous"}),Dr("button",{type:"button",className:Kn,onClick:()=>t({...e,pageIndex:e.pageIndex+1}),disabled:(e.pageIndex-1)*e.pageSize+e.pageSize>=r,children:"Next"})]})]})}import*as He from"@radix-ui/react-radio-group";import{Circle as Id}from"lucide-react";import*as Ro from"react";import{jsx as Er}from"react/jsx-runtime";var Ad=Ro.forwardRef(({className:e,...t},r)=>Er(He.Root,{className:i("grid gap-2",e),...t,ref:r}));Ad.displayName=He.Root.displayName;var Od=Ro.forwardRef(({className:e,...t},r)=>Er(He.Item,{ref:r,className:i("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:Er(He.Indicator,{className:"flex items-center justify-center",children:Er(Id,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Od.displayName=He.Item.displayName;import{Drawer as _e}from"vaul";import{jsx as Qe,jsxs as Fd}from"react/jsx-runtime";function zd({children:e,contentProps:t,nested:r=!1,...o}){let a=r?_e.NestedRoot:_e.Root;return Qe(a,{direction:"right",handleOnly:!0,...o,children:Fd(_e.Portal,{children:[Qe(_e.Overlay,{className:"fixed inset-0 bg-black/20","data-sheet-overlay":!0}),Qe(_e.Content,{...t,onPointerDownOutside:n=>{var c;n.target instanceof Element&&n.target.closest("[data-sonner-toast]")&&n.preventDefault(),(c=t==null?void 0:t.onPointerDownOutside)==null||c.call(t,n)},className:i("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)",userSelect:"auto",...t==null?void 0:t.style},children:Qe("div",{className:"scrollbar-hide flex size-full grow flex-col overflow-y-auto rounded-lg bg-white",children:e})})]})})}function Vd({className:e,...t}){return Qe(_e.Title,{className:i("text-lg font-semibold text-neutral-900",e),...t})}function Hd(e){return Qe(_e.Description,{...e})}function _d(e){return Qe(_e.Close,{...e})}var j4=Object.assign(zd,{Title:Vd,Description:Hd,Close:_d});import{useEffect as Bd,useRef as Wd,useState as $d}from"react";import{jsx as Yn}from"react/jsx-runtime";var Ud=`
|
|
3
3
|
attribute vec2 position;
|
|
4
4
|
|
|
5
5
|
void main()
|