@pixonui/react 0.5.12 → 0.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import*as ve from'react';import ve__default,{useRef,useState,useEffect,createContext,useCallback,useContext,useLayoutEffect,useMemo,useSyncExternalStore}from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {cva}from'class-variance-authority';import {createPortal,flushSync}from'react-dom';import {EyeOff,Eye,Upload,File,X as X$1,Minus,Plus,Info,Star,Lock,Trash2,GripVertical,Pause,Play,MessageSquare,Paperclip,Clock,Mic,Square,Sparkles,ArrowUp,ExternalLink,Copy,Share,Edit,RefreshCw,ThumbsUp,ThumbsDown,ChevronLeft,ChevronRight,Calendar,Loader2,ChevronDown,Search,ArrowDown,ArrowUpDown,Layout,List,Undo2,Redo2,Filter,SortAsc,MoreHorizontal,AlertCircle,MoreVertical,Check,CheckSquare,Send,FileIcon,Download,Tag,Users,Timer,RotateCcw,Archive,CheckCircle2,Circle,Menu,Settings,User,LogOut,AlertTriangle,Pin,BellOff,ArrowLeft,Phone,Video,VolumeX,Volume2,CheckCheck,Reply,Smile,Forward,Edit2,Image,MapPin,Gift,Bell,Ban,Sun,Moon,FileText,FolderOpen,Folder}from'lucide-react';import {io}from'socket.io-client';function l(...e){return twMerge(clsx(e))}var Ei=ve__default.forwardRef(({children:e,className:t,leftIcon:r,rightIcon:o,...n},a)=>jsxs("button",{ref:a,type:n.type??"button",className:l("group relative inline-flex items-center justify-center gap-2 rounded-2xl px-5 py-3","bg-gradient-to-r from-blue-600 via-purple-600 to-blue-600","text-white font-semibold tracking-tight","shadow-[0_12px_40px_rgba(99,102,241,.45)]","transition-all duration-300","hover:scale-[1.03] hover:shadow-[0_18px_60px_rgba(99,102,241,.6)]","active:scale-[0.98]","disabled:opacity-50 disabled:cursor-not-allowed","focus:outline-none focus:ring-2 focus:ring-purple-400/40",t),...n,children:[jsx("span",{className:"pointer-events-none absolute inset-0 rounded-2xl bg-gradient-to-r from-white/18 via-white/5 to-white/18 opacity-0 blur-lg transition-opacity duration-300 group-hover:opacity-100"}),jsxs("span",{className:"relative inline-flex items-center gap-2",children:[r,e,o]})]}));Ei.displayName="PrimaryButton";var xt=ve.forwardRef(({children:e,...t},r)=>{if(!ve.isValidElement(e))return null;let o=e;return ve.cloneElement(o,{...t,...o.props,ref:n=>{typeof r=="function"?r(n):r&&(r.current=n);let{ref:a}=o;typeof a=="function"?a(n):a&&"current"in a&&(a.current=n);},className:l(t.className,o.props.className)})});xt.displayName="Slot";var Ii=cva("group relative inline-flex items-center justify-center font-semibold tracking-tight transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-purple-400/40 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100 disabled:active:scale-100 hover:scale-[1.02] active:scale-[0.98]",{variants:{variant:{primary:"bg-gradient-to-r from-blue-600 via-purple-600 to-blue-600 text-white border-transparent",secondary:"bg-zinc-100 text-zinc-900 border border-zinc-200 hover:bg-zinc-200 dark:bg-white/[0.05] dark:text-white dark:border-white/10 dark:hover:bg-white/[0.10] dark:hover:border-white/20",outline:"bg-transparent text-zinc-900 border border-zinc-300 hover:bg-zinc-100 dark:text-white dark:border-white/20 dark:hover:bg-white/[0.05] dark:hover:border-white/30",ghost:"bg-transparent text-zinc-600 hover:text-zinc-900 hover:bg-zinc-100 dark:text-white/80 dark:hover:text-white dark:hover:bg-white/[0.05] border-transparent",danger:"bg-rose-500/10 text-rose-600 border border-rose-500/20 hover:bg-rose-500/20 hover:border-rose-500/30 hover:text-rose-700 dark:text-rose-400 dark:hover:text-rose-300",success:"bg-emerald-500/10 text-emerald-600 border border-emerald-500/20 hover:bg-emerald-500/20 hover:border-emerald-500/30 hover:text-emerald-700 dark:text-emerald-400 dark:hover:text-emerald-300",alert:"bg-amber-500/10 text-amber-600 border border-amber-500/20 hover:bg-amber-500/20 hover:border-amber-500/30 hover:text-amber-700 dark:text-amber-400 dark:hover:text-amber-300"},size:{sm:"h-9 px-3 text-xs gap-1.5",md:"h-11 px-5 text-sm gap-2",lg:"h-14 px-8 text-base gap-3",icon:"h-10 w-10 p-0 flex items-center justify-center"},shape:{default:"rounded-2xl",pill:"rounded-full",square:"rounded-lg"},shadow:{true:"",false:""}},compoundVariants:[{variant:"primary",shadow:true,class:"shadow-[0_12px_40px_rgba(99,102,241,.45)] hover:shadow-[0_18px_60px_rgba(99,102,241,.6)]"},{variant:"secondary",shadow:true,class:"shadow-sm"}],defaultVariants:{variant:"primary",size:"md",shape:"default",shadow:true}}),L=ve__default.forwardRef(({className:e,variant:t,size:r,shape:o,shadow:n,asChild:a=false,leftIcon:s,rightIcon:i,isLoading:c,children:d,disabled:m,...u},p)=>jsxs(a?xt:"button",{ref:p,disabled:m||c,className:l(Ii({variant:t,size:r,shape:o,shadow:n,className:e})),...u,children:[t==="primary"&&!a&&jsx("span",{className:"pointer-events-none absolute inset-0 rounded-[inherit] bg-gradient-to-r from-white/18 via-white/5 to-white/18 opacity-0 blur-lg transition-opacity duration-300 group-hover:opacity-100"}),jsxs("span",{className:"relative inline-flex items-center justify-center",children:[c&&jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-current",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),!c&&s&&jsx("span",{className:l("mr-2",r==="sm"&&"mr-1.5"),children:s}),d,!c&&i&&jsx("span",{className:l("ml-2",r==="sm"&&"ml-1.5"),children:i})]})]}));L.displayName="Button";var Bi=ve__default.forwardRef(({children:e,className:t,leftIcon:r,rightIcon:o,...n},a)=>{let s=useRef(null),i=c=>{let d=s.current;if(!d)return;let m=d.getBoundingClientRect(),u=c.clientX-m.left,p=c.clientY-m.top;d.style.setProperty("--mouse-x",`${u}px`),d.style.setProperty("--mouse-y",`${p}px`);};return ve__default.useImperativeHandle(a,()=>s.current),jsxs("button",{ref:s,onMouseMove:i,type:n.type??"button",className:l("group relative inline-flex items-center justify-center gap-2 rounded-2xl px-6 py-3","bg-zinc-100 border border-zinc-200 text-zinc-900","dark:bg-white/[0.03] dark:border-white/10 dark:text-white","font-semibold tracking-tight overflow-hidden","transition-all duration-300","hover:bg-zinc-200 dark:hover:bg-white/[0.05] hover:scale-[1.02]","active:scale-[0.98]","focus:outline-none focus:ring-2 focus:ring-purple-400/40",t),...n,children:[jsx("div",{className:"pointer-events-none absolute -inset-px opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(255,255,255,0.4), transparent 40%)"}}),jsx("div",{className:"pointer-events-none absolute -inset-px rounded-2xl opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(300px circle at var(--mouse-x) var(--mouse-y), rgba(255,255,255,0.6), transparent 40%)",maskImage:"linear-gradient(#fff, #fff), linear-gradient(#fff, #fff)",maskClip:"content-box, border-box",maskComposite:"exclude",WebkitMaskComposite:"xor",padding:"1px"}}),jsxs("span",{className:"relative inline-flex items-center gap-2 z-10",children:[r,e,o]})]})});Bi.displayName="GlowButton";function zi({accent:e="teal",children:t}){let r={teal:"bg-teal-500/90",amber:"bg-amber-400/95",violet:"bg-violet-500/90",blue:"bg-blue-500/90",rose:"bg-rose-500/90",emerald:"bg-emerald-500/90",indigo:"bg-indigo-500/90"};return jsx("div",{className:l("flex h-11 w-11 items-center justify-center rounded-2xl",r[e]??r.teal),children:t})}function Ki({accent:e="teal"}){let t={teal:"from-teal-400/25 via-teal-400/10 to-transparent",amber:"from-amber-300/25 via-amber-300/10 to-transparent",violet:"from-violet-400/25 via-violet-400/10 to-transparent",blue:"from-blue-400/25 via-blue-400/10 to-transparent",rose:"from-rose-400/25 via-rose-400/10 to-transparent",emerald:"from-emerald-400/25 via-emerald-400/10 to-transparent",indigo:"from-indigo-400/25 via-indigo-400/10 to-transparent"};return jsx("div",{className:l("pointer-events-none absolute -right-12 top-1/2 h-40 w-48 -translate-y-1/2 rotate-12","bg-gradient-to-l blur-2xl",t[e]??t.teal)})}function $i({color:e="currentColor"}){return jsx("svg",{viewBox:"0 0 120 40",className:"h-6 w-16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsx("path",{d:"M2 22c10 0 10-10 20-10s10 10 20 10 10-10 20-10 10 10 20 10 10-10 20-10",stroke:e,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.95"})})}var Fi=ve__default.forwardRef(({accent:e="teal",icon:t,title:r,value:o,subtext:n,showWave:a=false,onClick:s,className:i,...c},d)=>{let m=useRef(null),u=()=>{let v=m.current;if(!v)return;let b=v.getBoundingClientRect();v.style.setProperty("--x",`${Math.round(b.width/2)}px`),v.style.setProperty("--y",`${Math.round(b.height/2)}px`);},p=v=>{let b=m.current;if(!b)return;let f=b.getBoundingClientRect();b.style.setProperty("--x",`${v.clientX-f.left}px`),b.style.setProperty("--y",`${v.clientY-f.top}px`);},g={teal:"rgba(45,212,191,.95)",amber:"rgba(251,191,36,.95)",violet:"rgba(167,139,250,.95)",blue:"rgba(96,165,250,.95)",rose:"rgba(251,113,133,.95)",emerald:"rgba(52,211,153,.95)",indigo:"rgba(129,140,248,.95)"},h=g[e]??g.teal;return jsxs("div",{ref:v=>{m.current=v,typeof d=="function"?d(v):d&&(d.current=v);},onMouseEnter:u,onMouseMove:p,onClick:s,className:l("group relative overflow-hidden rounded-2xl","bg-white border border-gray-200 shadow-sm","dark:bg-transparent dark:bg-gradient-to-b dark:from-white/[0.06] dark:to-white/[0.03]","dark:border-white/[0.10]","dark:shadow-[0_18px_55px_rgba(0,0,0,.55)]","transition-transform duration-300 hover:scale-[1.015]",s&&"cursor-pointer",i),...c,children:[jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(180px at var(--x, 50%) var(--y, 50%), rgba(255,255,255,.16), transparent 60%)"}}),jsx("div",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(220px_140px_at_18%_18%,rgba(255,255,255,.08),transparent_60%)]"}),jsx(Ki,{accent:e}),jsxs("div",{className:"relative p-5",children:[jsxs("div",{className:"flex items-start justify-between gap-4",children:[jsx(zi,{accent:e,children:t}),r&&jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-gray-500 dark:text-white/40",children:r})]}),jsxs("div",{className:"mt-4 flex items-end justify-between gap-4",children:[jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate text-2xl font-semibold tracking-tight text-gray-900 dark:text-white",children:o}),n?jsx("div",{className:"mt-1 text-sm text-gray-500 dark:text-white/45",children:n}):null]}),a?jsx($i,{color:h}):null]})]})]})});Fi.displayName="MetricCard";var Yi=cva("rounded-2xl backdrop-blur-xl transition-all duration-300 bg-white/70 border border-zinc-200 shadow-sm text-zinc-900 dark:bg-white/[0.03] dark:border-white/10 dark:shadow-[0_18px_55px_rgba(0,0,0,.45)] dark:text-white",{variants:{variant:{default:"",ghost:"bg-transparent border-transparent shadow-none"}},defaultVariants:{variant:"default"}}),te=ve__default.forwardRef(({className:e,variant:t,asChild:r=false,...o},n)=>jsx(r?xt:"div",{ref:n,className:l(Yi({variant:t,className:e})),...o}));te.displayName="Surface";var Xi=ve__default.forwardRef(({className:e,...t},r)=>jsx(te,{ref:r,className:e,...t}));Xi.displayName="Card";var qi=ve__default.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:l("flex flex-col space-y-1.5 p-6",e),...t}));qi.displayName="CardHeader";var Gi=ve__default.forwardRef(({className:e,...t},r)=>jsx("h3",{ref:r,className:l("text-2xl font-semibold leading-none tracking-tight",e),...t}));Gi.displayName="CardTitle";var ji=ve__default.forwardRef(({className:e,...t},r)=>jsx("p",{ref:r,className:l("text-sm text-gray-500 dark:text-white/50",e),...t}));ji.displayName="CardDescription";var Qi=ve__default.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:l("p-6 pt-0",e),...t}));Qi.displayName="CardContent";var Ji=ve__default.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:l("flex items-center p-6 pt-0",e),...t}));Ji.displayName="CardFooter";var xe=ve__default.forwardRef(({as:e="p",variant:t="default",size:r="base",weight:o="normal",code:n=false,className:a,children:s,...i},c)=>jsx(e,{ref:c,className:l("leading-relaxed transition-colors duration-200",n&&"font-mono bg-zinc-100 dark:bg-white/[0.03] px-1.5 py-0.5 rounded text-[0.9em]",{"text-zinc-900 dark:text-white":t==="default","text-zinc-500 dark:text-zinc-400":t==="muted","text-zinc-400 dark:text-zinc-500":t==="subtle","text-lg md:text-xl text-zinc-600 dark:text-zinc-300 font-light":t==="lead","text-rose-600 dark:text-rose-400":t==="error","text-emerald-600 dark:text-emerald-400":t==="success","text-amber-600 dark:text-amber-400":t==="warning","text-sky-600 dark:text-sky-400":t==="info","text-xs":r==="xs","text-sm":r==="sm","text-base":r==="base","text-lg":r==="lg","text-xl":r==="xl","text-2xl":r==="2xl","font-light":o==="light","font-normal":o==="normal","font-medium":o==="medium","font-semibold":o==="semibold","font-bold":o==="bold"},a),...i,children:s}));xe.displayName="Text";var Ge=ve__default.forwardRef(({as:e="h2",weight:t="bold",className:r,children:o,...n},a)=>jsx(e,{ref:a,className:l("tracking-tight text-zinc-900 dark:text-white transition-colors duration-200",{"text-4xl md:text-5xl lg:text-6xl":e==="h1","text-3xl md:text-4xl":e==="h2","text-2xl md:text-3xl":e==="h3","text-xl md:text-2xl":e==="h4","text-lg md:text-xl":e==="h5","text-base md:text-lg":e==="h6"},{"font-normal":t==="normal","font-medium":t==="medium","font-semibold":t==="semibold","font-bold":t==="bold","font-extrabold":t==="extrabold","font-black":t==="black"},r),...n,children:o}));Ge.displayName="Heading";var al=ve__default.forwardRef(({from:e="from-blue-500",to:t="to-purple-500",via:r,direction:o="r",animate:n=false,className:a,children:s,...i},c)=>jsx("span",{ref:c,className:l("bg-clip-text text-transparent bg-gradient-to-"+o,e,t,r,n&&"animate-gradient bg-[length:200%_auto]",a),...i,children:s}));al.displayName="TextGradient";var il=ve__default.forwardRef(({shimmerColor:e="rgba(255,255,255,0.3)",duration:t="2s",baseColor:r="currentColor",className:o,children:n,...a},s)=>jsx("span",{ref:s,className:l("inline-block bg-clip-text text-transparent animate-shimmer will-change-[background-position]",o),style:{backgroundImage:`linear-gradient(90deg, ${r} 0%, ${r} 40%, ${e} 50%, ${r} 60%, ${r} 100%)`,backgroundSize:"200% 100%",animationDuration:t,animationIterationCount:"infinite",animationTimingFunction:"linear"},...a,children:n}));il.displayName="ShinyText";function Ke(e={threshold:.1,rootMargin:"0px",enabled:true}){let t=useRef(null),[r,o]=useState(false),[n,a]=useState(false),{enabled:s=true}=e;return useEffect(()=>{if(!s)return;let i=t.current;if(!i)return;let c=new IntersectionObserver(([d])=>{d&&d.isIntersecting?(o(true),a(true)):o(false);},e);return c.observe(i),()=>{c.disconnect();}},[e.threshold,e.rootMargin,e.root,s]),{ref:t,isInView:r,hasAnimated:n}}function Ja({children:e,direction:t="up",duration:r=.5,delay:o=0,boxColor:n="bg-blue-500",className:a,...s}){let{ref:i,hasAnimated:c}=Ke({threshold:.2}),d={up:"translate-y-full",down:"-translate-y-full",left:"translate-x-full",right:"-translate-x-full"};return jsxs("div",{ref:i,className:l("relative overflow-hidden inline-block",a),...s,children:[jsx("div",{className:l("transition-all ease-out",c?"translate-x-0 translate-y-0 opacity-100":l("opacity-0",d[t])),style:{transitionDuration:`${r}s`,transitionDelay:`${o}s`},children:e}),jsx("div",{className:l("absolute inset-0 z-10 transition-transform ease-in-out",n,c?t==="left"||t==="right"?"scale-x-0":"scale-y-0":"scale-100"),style:{transitionDuration:`${r}s`,transitionDelay:`${o}s`,transformOrigin:t==="up"?"top":t==="down"?"bottom":t==="left"?"left":"right"}})]})}var ul=({title:e,highlight:t,subtitle:r,gradient:o="from-blue-400 via-indigo-500 to-purple-600",animate:n=true,glow:a=true,className:s,...i})=>{let c=jsxs("div",{className:l("flex flex-col items-center text-center space-y-6",s),...i,children:[jsxs("h1",{className:"text-5xl md:text-7xl font-bold tracking-tight text-white leading-tight",children:[e," ",t&&jsxs("span",{className:"relative inline-block",children:[jsx("span",{className:l("bg-clip-text text-transparent bg-gradient-to-r",o),children:t}),a&&jsx("span",{className:l("absolute inset-0 blur-3xl opacity-40 -z-10 bg-gradient-to-r",o),"aria-hidden":"true",children:t})]})]}),r&&jsx("p",{className:"text-lg md:text-xl text-white/50 max-w-2xl mx-auto leading-relaxed",children:r})]});return n?jsx(Ja,{direction:"up",duration:1,children:c}):c};ul.displayName="HeroText";var pl=({text:e,delay:t=.05,className:r,...o})=>{let n=e.split("");return jsxs("div",{className:l("flex flex-wrap justify-center overflow-hidden py-2",r),...o,children:[n.map((a,s)=>jsx("span",{className:"inline-block animate-pullup opacity-0",style:{animation:"pullup 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards",animationDelay:`${s*t}s`,whiteSpace:a===" "?"pre":"normal"},children:a},s)),jsx("style",{children:`
1
+ import*as we from'react';import we__default,{useRef,useState,useEffect,createContext,useCallback,useContext,useLayoutEffect,useMemo,useSyncExternalStore}from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {cva}from'class-variance-authority';import {createPortal,flushSync}from'react-dom';import {EyeOff,Eye,Upload,File,X,Minus,Plus,Info,Star,Lock,Trash2,GripVertical,Pause,Play,MessageSquare,Paperclip,Clock,Mic,Square,Sparkles,ArrowUp,ExternalLink,Copy,Share,Edit,RefreshCw,ThumbsUp,ThumbsDown,ChevronLeft,ChevronRight,Calendar,Loader2,ChevronDown,Search,ArrowDown,ArrowUpDown,Layout,List,Undo2,Redo2,Filter,SortAsc,MoreHorizontal,AlertCircle,MoreVertical,Check,CheckSquare,Send,FileIcon,Download,Tag,Users,Timer,RotateCcw,Archive,CheckCircle2,Circle,Menu,Settings,User,LogOut,AlertTriangle,Pin,BellOff,ArrowLeft,Phone,Video,VolumeX,Volume2,CheckCheck,Reply,Smile,Forward,Edit2,Image,MapPin,AtSign,Gift,Bell,Ban,Sun,Moon,FileText,FolderOpen,Folder}from'lucide-react';import {io}from'socket.io-client';function l(...e){return twMerge(clsx(e))}var Di=we__default.forwardRef(({children:e,className:t,leftIcon:r,rightIcon:o,...n},a)=>jsxs("button",{ref:a,type:n.type??"button",className:l("group relative inline-flex items-center justify-center gap-2 rounded-2xl px-5 py-3","bg-gradient-to-r from-blue-600 via-purple-600 to-blue-600","text-white font-semibold tracking-tight","shadow-[0_12px_40px_rgba(99,102,241,.45)]","transition-all duration-300","hover:scale-[1.03] hover:shadow-[0_18px_60px_rgba(99,102,241,.6)]","active:scale-[0.98]","disabled:opacity-50 disabled:cursor-not-allowed","focus:outline-none focus:ring-2 focus:ring-purple-400/40",t),...n,children:[jsx("span",{className:"pointer-events-none absolute inset-0 rounded-2xl bg-gradient-to-r from-white/18 via-white/5 to-white/18 opacity-0 blur-lg transition-opacity duration-300 group-hover:opacity-100"}),jsxs("span",{className:"relative inline-flex items-center gap-2",children:[r,e,o]})]}));Di.displayName="PrimaryButton";var vt=we.forwardRef(({children:e,...t},r)=>{if(!we.isValidElement(e))return null;let o=e;return we.cloneElement(o,{...t,...o.props,ref:n=>{typeof r=="function"?r(n):r&&(r.current=n);let{ref:a}=o;typeof a=="function"?a(n):a&&"current"in a&&(a.current=n);},className:l(t.className,o.props.className)})});vt.displayName="Slot";var Bi=cva("group relative inline-flex items-center justify-center font-semibold tracking-tight transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-purple-400/40 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100 disabled:active:scale-100 hover:scale-[1.02] active:scale-[0.98]",{variants:{variant:{primary:"bg-gradient-to-r from-blue-600 via-purple-600 to-blue-600 text-white border-transparent",secondary:"bg-zinc-100 text-zinc-900 border border-zinc-200 hover:bg-zinc-200 dark:bg-white/[0.05] dark:text-white dark:border-white/10 dark:hover:bg-white/[0.10] dark:hover:border-white/20",outline:"bg-transparent text-zinc-900 border border-zinc-300 hover:bg-zinc-100 dark:text-white dark:border-white/20 dark:hover:bg-white/[0.05] dark:hover:border-white/30",ghost:"bg-transparent text-zinc-600 hover:text-zinc-900 hover:bg-zinc-100 dark:text-white/80 dark:hover:text-white dark:hover:bg-white/[0.05] border-transparent",danger:"bg-rose-500/10 text-rose-600 border border-rose-500/20 hover:bg-rose-500/20 hover:border-rose-500/30 hover:text-rose-700 dark:text-rose-400 dark:hover:text-rose-300",success:"bg-emerald-500/10 text-emerald-600 border border-emerald-500/20 hover:bg-emerald-500/20 hover:border-emerald-500/30 hover:text-emerald-700 dark:text-emerald-400 dark:hover:text-emerald-300",alert:"bg-amber-500/10 text-amber-600 border border-amber-500/20 hover:bg-amber-500/20 hover:border-amber-500/30 hover:text-amber-700 dark:text-amber-400 dark:hover:text-amber-300"},size:{sm:"h-9 px-3 text-xs gap-1.5",md:"h-11 px-5 text-sm gap-2",lg:"h-14 px-8 text-base gap-3",icon:"h-10 w-10 p-0 flex items-center justify-center"},shape:{default:"rounded-2xl",pill:"rounded-full",square:"rounded-lg"},shadow:{true:"",false:""}},compoundVariants:[{variant:"primary",shadow:true,class:"shadow-[0_12px_40px_rgba(99,102,241,.45)] hover:shadow-[0_18px_60px_rgba(99,102,241,.6)]"},{variant:"secondary",shadow:true,class:"shadow-sm"}],defaultVariants:{variant:"primary",size:"md",shape:"default",shadow:true}}),R=we__default.forwardRef(({className:e,variant:t,size:r,shape:o,shadow:n,asChild:a=false,leftIcon:s,rightIcon:i,isLoading:c,children:d,disabled:m,...u},f)=>jsxs(a?vt:"button",{ref:f,disabled:m||c,className:l(Bi({variant:t,size:r,shape:o,shadow:n,className:e})),...u,children:[t==="primary"&&!a&&jsx("span",{className:"pointer-events-none absolute inset-0 rounded-[inherit] bg-gradient-to-r from-white/18 via-white/5 to-white/18 opacity-0 blur-lg transition-opacity duration-300 group-hover:opacity-100"}),jsxs("span",{className:"relative inline-flex items-center justify-center",children:[c&&jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-current",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),!c&&s&&jsx("span",{className:l("mr-2",r==="sm"&&"mr-1.5"),children:s}),d,!c&&i&&jsx("span",{className:l("ml-2",r==="sm"&&"ml-1.5"),children:i})]})]}));R.displayName="Button";var Vi=we__default.forwardRef(({children:e,className:t,leftIcon:r,rightIcon:o,...n},a)=>{let s=useRef(null),i=c=>{let d=s.current;if(!d)return;let m=d.getBoundingClientRect(),u=c.clientX-m.left,f=c.clientY-m.top;d.style.setProperty("--mouse-x",`${u}px`),d.style.setProperty("--mouse-y",`${f}px`);};return we__default.useImperativeHandle(a,()=>s.current),jsxs("button",{ref:s,onMouseMove:i,type:n.type??"button",className:l("group relative inline-flex items-center justify-center gap-2 rounded-2xl px-6 py-3","bg-zinc-100 border border-zinc-200 text-zinc-900","dark:bg-white/[0.03] dark:border-white/10 dark:text-white","font-semibold tracking-tight overflow-hidden","transition-all duration-300","hover:bg-zinc-200 dark:hover:bg-white/[0.05] hover:scale-[1.02]","active:scale-[0.98]","focus:outline-none focus:ring-2 focus:ring-purple-400/40",t),...n,children:[jsx("div",{className:"pointer-events-none absolute -inset-px opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(255,255,255,0.4), transparent 40%)"}}),jsx("div",{className:"pointer-events-none absolute -inset-px rounded-2xl opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(300px circle at var(--mouse-x) var(--mouse-y), rgba(255,255,255,0.6), transparent 40%)",maskImage:"linear-gradient(#fff, #fff), linear-gradient(#fff, #fff)",maskClip:"content-box, border-box",maskComposite:"exclude",WebkitMaskComposite:"xor",padding:"1px"}}),jsxs("span",{className:"relative inline-flex items-center gap-2 z-10",children:[r,e,o]})]})});Vi.displayName="GlowButton";function $i({accent:e="teal",children:t}){let r={teal:"bg-teal-500/90",amber:"bg-amber-400/95",violet:"bg-violet-500/90",blue:"bg-blue-500/90",rose:"bg-rose-500/90",emerald:"bg-emerald-500/90",indigo:"bg-indigo-500/90"};return jsx("div",{className:l("flex h-11 w-11 items-center justify-center rounded-2xl",r[e]??r.teal),children:t})}function Fi({accent:e="teal"}){let t={teal:"from-teal-400/25 via-teal-400/10 to-transparent",amber:"from-amber-300/25 via-amber-300/10 to-transparent",violet:"from-violet-400/25 via-violet-400/10 to-transparent",blue:"from-blue-400/25 via-blue-400/10 to-transparent",rose:"from-rose-400/25 via-rose-400/10 to-transparent",emerald:"from-emerald-400/25 via-emerald-400/10 to-transparent",indigo:"from-indigo-400/25 via-indigo-400/10 to-transparent"};return jsx("div",{className:l("pointer-events-none absolute -right-12 top-1/2 h-40 w-48 -translate-y-1/2 rotate-12","bg-gradient-to-l blur-2xl",t[e]??t.teal)})}function Ui({color:e="currentColor"}){return jsx("svg",{viewBox:"0 0 120 40",className:"h-6 w-16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsx("path",{d:"M2 22c10 0 10-10 20-10s10 10 20 10 10-10 20-10 10 10 20 10 10-10 20-10",stroke:e,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.95"})})}var Wi=we__default.forwardRef(({accent:e="teal",icon:t,title:r,value:o,subtext:n,showWave:a=false,onClick:s,className:i,...c},d)=>{let m=useRef(null),u=()=>{let v=m.current;if(!v)return;let h=v.getBoundingClientRect();v.style.setProperty("--x",`${Math.round(h.width/2)}px`),v.style.setProperty("--y",`${Math.round(h.height/2)}px`);},f=v=>{let h=m.current;if(!h)return;let p=h.getBoundingClientRect();h.style.setProperty("--x",`${v.clientX-p.left}px`),h.style.setProperty("--y",`${v.clientY-p.top}px`);},g={teal:"rgba(45,212,191,.95)",amber:"rgba(251,191,36,.95)",violet:"rgba(167,139,250,.95)",blue:"rgba(96,165,250,.95)",rose:"rgba(251,113,133,.95)",emerald:"rgba(52,211,153,.95)",indigo:"rgba(129,140,248,.95)"},x=g[e]??g.teal;return jsxs("div",{ref:v=>{m.current=v,typeof d=="function"?d(v):d&&(d.current=v);},onMouseEnter:u,onMouseMove:f,onClick:s,className:l("group relative overflow-hidden rounded-2xl","bg-white border border-gray-200 shadow-sm","dark:bg-transparent dark:bg-gradient-to-b dark:from-white/[0.06] dark:to-white/[0.03]","dark:border-white/[0.10]","dark:shadow-[0_18px_55px_rgba(0,0,0,.55)]","transition-transform duration-300 hover:scale-[1.015]",s&&"cursor-pointer",i),...c,children:[jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(180px at var(--x, 50%) var(--y, 50%), rgba(255,255,255,.16), transparent 60%)"}}),jsx("div",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(220px_140px_at_18%_18%,rgba(255,255,255,.08),transparent_60%)]"}),jsx(Fi,{accent:e}),jsxs("div",{className:"relative p-5",children:[jsxs("div",{className:"flex items-start justify-between gap-4",children:[jsx($i,{accent:e,children:t}),r&&jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-gray-500 dark:text-white/40",children:r})]}),jsxs("div",{className:"mt-4 flex items-end justify-between gap-4",children:[jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate text-2xl font-semibold tracking-tight text-gray-900 dark:text-white",children:o}),n?jsx("div",{className:"mt-1 text-sm text-gray-500 dark:text-white/45",children:n}):null]}),a?jsx(Ui,{color:x}):null]})]})]})});Wi.displayName="MetricCard";var Xi=cva("rounded-2xl backdrop-blur-xl transition-all duration-300 bg-white/70 border border-zinc-200 shadow-sm text-zinc-900 dark:bg-white/[0.03] dark:border-white/10 dark:shadow-[0_18px_55px_rgba(0,0,0,.45)] dark:text-white",{variants:{variant:{default:"",ghost:"bg-transparent border-transparent shadow-none"}},defaultVariants:{variant:"default"}}),ne=we__default.forwardRef(({className:e,variant:t,asChild:r=false,...o},n)=>jsx(r?vt:"div",{ref:n,className:l(Xi({variant:t,className:e})),...o}));ne.displayName="Surface";var Gi=we__default.forwardRef(({className:e,...t},r)=>jsx(ne,{ref:r,className:e,...t}));Gi.displayName="Card";var ji=we__default.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:l("flex flex-col space-y-1.5 p-6",e),...t}));ji.displayName="CardHeader";var Qi=we__default.forwardRef(({className:e,...t},r)=>jsx("h3",{ref:r,className:l("text-2xl font-semibold leading-none tracking-tight",e),...t}));Qi.displayName="CardTitle";var Ji=we__default.forwardRef(({className:e,...t},r)=>jsx("p",{ref:r,className:l("text-sm text-gray-500 dark:text-white/50",e),...t}));Ji.displayName="CardDescription";var Zi=we__default.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:l("p-6 pt-0",e),...t}));Zi.displayName="CardContent";var el=we__default.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:l("flex items-center p-6 pt-0",e),...t}));el.displayName="CardFooter";var ve=we__default.forwardRef(({as:e="p",variant:t="default",size:r="base",weight:o="normal",code:n=false,className:a,children:s,...i},c)=>jsx(e,{ref:c,className:l("leading-relaxed transition-colors duration-200",n&&"font-mono bg-zinc-100 dark:bg-white/[0.03] px-1.5 py-0.5 rounded text-[0.9em]",{"text-zinc-900 dark:text-white":t==="default","text-zinc-500 dark:text-zinc-400":t==="muted","text-zinc-400 dark:text-zinc-500":t==="subtle","text-lg md:text-xl text-zinc-600 dark:text-zinc-300 font-light":t==="lead","text-rose-600 dark:text-rose-400":t==="error","text-emerald-600 dark:text-emerald-400":t==="success","text-amber-600 dark:text-amber-400":t==="warning","text-sky-600 dark:text-sky-400":t==="info","text-xs":r==="xs","text-sm":r==="sm","text-base":r==="base","text-lg":r==="lg","text-xl":r==="xl","text-2xl":r==="2xl","font-light":o==="light","font-normal":o==="normal","font-medium":o==="medium","font-semibold":o==="semibold","font-bold":o==="bold"},a),...i,children:s}));ve.displayName="Text";var je=we__default.forwardRef(({as:e="h2",weight:t="bold",className:r,children:o,...n},a)=>jsx(e,{ref:a,className:l("tracking-tight text-zinc-900 dark:text-white transition-colors duration-200",{"text-4xl md:text-5xl lg:text-6xl":e==="h1","text-3xl md:text-4xl":e==="h2","text-2xl md:text-3xl":e==="h3","text-xl md:text-2xl":e==="h4","text-lg md:text-xl":e==="h5","text-base md:text-lg":e==="h6"},{"font-normal":t==="normal","font-medium":t==="medium","font-semibold":t==="semibold","font-bold":t==="bold","font-extrabold":t==="extrabold","font-black":t==="black"},r),...n,children:o}));je.displayName="Heading";var sl=we__default.forwardRef(({from:e="from-blue-500",to:t="to-purple-500",via:r,direction:o="r",animate:n=false,className:a,children:s,...i},c)=>jsx("span",{ref:c,className:l("bg-clip-text text-transparent bg-gradient-to-"+o,e,t,r,n&&"animate-gradient bg-[length:200%_auto]",a),...i,children:s}));sl.displayName="TextGradient";var cl=we__default.forwardRef(({shimmerColor:e="rgba(255,255,255,0.3)",duration:t="2s",baseColor:r="currentColor",className:o,children:n,...a},s)=>jsx("span",{ref:s,className:l("inline-block bg-clip-text text-transparent animate-shimmer will-change-[background-position]",o),style:{backgroundImage:`linear-gradient(90deg, ${r} 0%, ${r} 40%, ${e} 50%, ${r} 60%, ${r} 100%)`,backgroundSize:"200% 100%",animationDuration:t,animationIterationCount:"infinite",animationTimingFunction:"linear"},...a,children:n}));cl.displayName="ShinyText";function $e(e={threshold:.1,rootMargin:"0px",enabled:true}){let t=useRef(null),[r,o]=useState(false),[n,a]=useState(false),{enabled:s=true}=e;return useEffect(()=>{if(!s)return;let i=t.current;if(!i)return;let c=new IntersectionObserver(([d])=>{d&&d.isIntersecting?(o(true),a(true)):o(false);},e);return c.observe(i),()=>{c.disconnect();}},[e.threshold,e.rootMargin,e.root,s]),{ref:t,isInView:r,hasAnimated:n}}function en({children:e,direction:t="up",duration:r=.5,delay:o=0,boxColor:n="bg-blue-500",className:a,...s}){let{ref:i,hasAnimated:c}=$e({threshold:.2}),d={up:"translate-y-full",down:"-translate-y-full",left:"translate-x-full",right:"-translate-x-full"};return jsxs("div",{ref:i,className:l("relative overflow-hidden inline-block",a),...s,children:[jsx("div",{className:l("transition-all ease-out",c?"translate-x-0 translate-y-0 opacity-100":l("opacity-0",d[t])),style:{transitionDuration:`${r}s`,transitionDelay:`${o}s`},children:e}),jsx("div",{className:l("absolute inset-0 z-10 transition-transform ease-in-out",n,c?t==="left"||t==="right"?"scale-x-0":"scale-y-0":"scale-100"),style:{transitionDuration:`${r}s`,transitionDelay:`${o}s`,transformOrigin:t==="up"?"top":t==="down"?"bottom":t==="left"?"left":"right"}})]})}var fl=({title:e,highlight:t,subtitle:r,gradient:o="from-blue-400 via-indigo-500 to-purple-600",animate:n=true,glow:a=true,className:s,...i})=>{let c=jsxs("div",{className:l("flex flex-col items-center text-center space-y-6",s),...i,children:[jsxs("h1",{className:"text-5xl md:text-7xl font-bold tracking-tight text-white leading-tight",children:[e," ",t&&jsxs("span",{className:"relative inline-block",children:[jsx("span",{className:l("bg-clip-text text-transparent bg-gradient-to-r",o),children:t}),a&&jsx("span",{className:l("absolute inset-0 blur-3xl opacity-40 -z-10 bg-gradient-to-r",o),"aria-hidden":"true",children:t})]})]}),r&&jsx("p",{className:"text-lg md:text-xl text-white/50 max-w-2xl mx-auto leading-relaxed",children:r})]});return n?jsx(en,{direction:"up",duration:1,children:c}):c};fl.displayName="HeroText";var gl=({text:e,delay:t=.05,className:r,...o})=>{let n=e.split("");return jsxs("div",{className:l("flex flex-wrap justify-center overflow-hidden py-2",r),...o,children:[n.map((a,s)=>jsx("span",{className:"inline-block animate-pullup opacity-0",style:{animation:"pullup 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards",animationDelay:`${s*t}s`,whiteSpace:a===" "?"pre":"normal"},children:a},s)),jsx("style",{children:`
2
2
  @keyframes pullup {
3
3
  from {
4
4
  opacity: 0;
@@ -9,7 +9,7 @@ import*as ve from'react';import ve__default,{useRef,useState,useEffect,createCon
9
9
  transform: translateY(0);
10
10
  }
11
11
  }
12
- `})]})};pl.displayName="LetterPullup";var U=ve__default.forwardRef(({className:e,children:t,required:r,...o},n)=>jsxs("label",{ref:n,className:l("text-sm font-medium leading-none text-gray-700 dark:text-white/80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...o,children:[t,r&&jsx("span",{className:"ml-1 text-rose-500",children:"*"})]}));U.displayName="Label";var vl=cva("w-full rounded-2xl bg-gray-50 dark:bg-white/[0.04] px-4 py-3 border border-gray-200 dark:border-white/[0.10] text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-white/30 focus:outline-none focus:ring-2 focus:ring-purple-400/30 disabled:cursor-not-allowed disabled:opacity-50 transition-all duration-200",{variants:{hasError:{true:"border-rose-400/25 focus:ring-rose-300/25",false:""},hasLeftIcon:{true:"pl-10",false:""},hasRightIcon:{true:"pr-10",false:""}},defaultVariants:{hasError:false,hasLeftIcon:false,hasRightIcon:false}}),vt=ve__default.forwardRef(({className:e,containerClassName:t,label:r,error:o,leftIcon:n,rightIcon:a,id:s,...i},c)=>{let d=s||ve__default.useId(),m=!!o;return jsxs("div",{className:l("flex flex-col gap-1.5",t),children:[r&&jsx(U,{htmlFor:d,required:i.required,children:r}),jsxs("div",{className:"relative flex items-center",children:[n&&jsx("div",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 dark:text-white/35",children:n}),jsx("input",{ref:c,id:d,className:l(vl({hasError:m,hasLeftIcon:!!n,hasRightIcon:!!a,className:e})),...i}),a&&jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2",children:a})]}),o&&jsx("p",{className:"text-xs text-rose-400 animate-in slide-in-from-top-1 fade-in duration-200",children:o})]})});vt.displayName="TextInput";var Lo=ve__default.forwardRef(({className:e,label:t,error:r,id:o,disabled:n,checked:a,defaultChecked:s,onChange:i,...c},d)=>{let m=o||ve__default.useId(),[u,p]=ve__default.useState(s||a||false);ve__default.useEffect(()=>{a!==void 0&&p(a);},[a]);let g=()=>{if(n)return;let h=!u;p(h),i&&i({target:{checked:h}});};return jsxs("div",{className:l("flex flex-col gap-1.5",e),children:[jsxs("button",{ref:d,type:"button",id:m,role:"checkbox","aria-checked":u,"aria-label":t,onClick:g,disabled:n,className:l("flex items-center gap-3 rounded-2xl border border-gray-200 dark:border-white/10 bg-gray-50 dark:bg-white/[0.03] px-4 py-3","hover:bg-gray-100 dark:hover:bg-white/[0.04] transition-colors",n&&"opacity-50 cursor-not-allowed"),...c,children:[jsx("span",{"aria-hidden":"true",className:l("grid h-6 w-6 place-items-center rounded-lg border",u?"border-emerald-400/30 bg-emerald-400/15":"border-gray-300 dark:border-white/10 bg-white dark:bg-white/[0.02]"),children:u?jsx("svg",{className:"h-4 w-4 text-emerald-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}):null}),t&&jsx("span",{className:"text-sm text-gray-700 dark:text-white/70",children:t})]}),r&&jsx("p",{className:"text-xs text-rose-500 mt-1 ml-1",children:r})]})});Lo.displayName="Checkbox";var Po=ve__default.forwardRef(({className:e,label:t,error:r,id:o,disabled:n,checked:a,defaultChecked:s,onChange:i,...c},d)=>{let m=o||ve__default.useId(),[u,p]=ve__default.useState(s||a||false);ve__default.useEffect(()=>{a!==void 0&&p(a);},[a]);let g=()=>{if(n)return;let h=!u;p(h),i&&i({target:{checked:h}});};return jsxs("div",{className:l("flex flex-col gap-1.5",e),children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",id:m,role:"switch","aria-checked":u,onClick:g,disabled:n,className:l("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-black disabled:cursor-not-allowed disabled:opacity-50",u?"bg-emerald-500":"bg-gray-200 dark:bg-white/[0.06]"),...c,children:jsx("span",{className:l("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform",u?"translate-x-5":"translate-x-0")})}),t&&jsx(U,{htmlFor:m,className:"cursor-pointer select-none text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",onClick:g,children:t})]}),r&&jsx("p",{className:"text-xs text-rose-500 mt-1 ml-1",children:r})]})});Po.displayName="Switch";var Wr=ve__default.forwardRef(({label:e,name:t,options:r,value:o,defaultValue:n,onChange:a,placeholder:s="Select an option",error:i,disabled:c,className:d},m)=>{let[u,p]=useState(false),[g,h]=useState(n),[v,b]=useState(-1),f=useRef(null),x=ve__default.useId(),w=o!==void 0,k=w?o:g,y=r.find(N=>N.value===k);useEffect(()=>{if(u){let N=r.findIndex(R=>R.value===k);b(N!==-1?N:0);}else b(-1);},[u,k,r]),useEffect(()=>{let N=R=>{f.current&&!f.current.contains(R.target)&&p(false);};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]);let T=N=>{c||(w||h(N),a?.(N),p(false));},C=N=>{c||(N.key==="Enter"||N.key===" "?(N.preventDefault(),u&&v!==-1?T(r[v].value):p(true)):N.key==="Escape"?p(false):N.key==="ArrowDown"?(N.preventDefault(),u?b(R=>(R+1)%r.length):p(true)):N.key==="ArrowUp"?(N.preventDefault(),u?b(R=>(R-1+r.length)%r.length):p(true)):N.key==="Home"?(N.preventDefault(),u&&b(0)):N.key==="End"&&(N.preventDefault(),u&&b(r.length-1)));};return jsxs("div",{ref:f,className:l("flex flex-col gap-1.5 relative",d),children:[e&&jsx(U,{htmlFor:x,className:l(c&&"opacity-50 cursor-not-allowed"),children:e}),jsxs("div",{ref:m,id:x,role:"combobox","aria-expanded":u,"aria-haspopup":"listbox","aria-controls":`${x}-listbox`,"aria-disabled":c,tabIndex:c?-1:0,onClick:()=>!c&&p(!u),onKeyDown:C,className:l("w-full appearance-none rounded-2xl bg-gray-50 dark:bg-white/[0.04] px-4 py-3","border border-gray-200 dark:border-white/[0.10]","text-gray-900 dark:text-white flex items-center","focus:outline-none focus:ring-2 focus:ring-purple-400/30","hover:bg-gray-100 dark:hover:bg-white/[0.05] cursor-pointer",c&&"cursor-not-allowed opacity-50 hover:bg-gray-50 dark:hover:bg-white/[0.04]",u&&"border-gray-300 dark:border-white/20 ring-2 ring-purple-400/20",i&&"border-rose-400/25 focus:ring-rose-300/25"),children:[jsx("span",{className:l("block truncate",!y&&"text-gray-400 dark:text-white/20"),children:y?y.label:s}),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:l("absolute right-4 top-1/2 -translate-y-1/2 text-gray-400 dark:text-white/40 transition-transform duration-200",u&&"rotate-180"),children:jsx("path",{d:"m6 9 6 6 6-6"})})]}),u&&jsx("div",{className:"absolute top-full left-0 z-[110] mt-1 w-full overflow-hidden rounded-2xl border border-gray-200 dark:border-white/10 bg-white dark:bg-[#0A0A0A] p-1 shadow-xl animate-in fade-in zoom-in-95 duration-100",children:jsx("ul",{id:`${x}-listbox`,role:"listbox","aria-activedescendant":v!==-1?`${x}-option-${v}`:void 0,className:"max-h-60 overflow-auto p-1 flex flex-col gap-2",children:r.map((N,R)=>jsx("li",{id:`${x}-option-${R}`,role:"option","aria-selected":k===N.value,onClick:()=>T(N.value),onMouseEnter:()=>b(R),className:l("w-full rounded-2xl px-3 py-2 text-left text-sm transition-colors cursor-pointer","hover:bg-gray-100 dark:hover:bg-white/[0.06] hover:text-gray-900 dark:hover:text-white",k===N.value||v===R?"bg-gray-100 dark:bg-white/[0.06] text-gray-900 dark:text-white/90":"text-gray-700 dark:text-white/80"),children:jsxs("div",{className:"flex items-center justify-between gap-3",children:[jsx("span",{className:"flex-1 truncate",children:N.label}),k===N.value&&jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-900 dark:text-white",children:jsx("polyline",{points:"20 6 9 17 4 12"})})]})},N.value))})}),i&&jsx("p",{className:"text-xs text-rose-400 animate-in slide-in-from-top-1 fade-in duration-200",children:i}),jsx("input",{type:"hidden",name:t,value:k||""})]})});Wr.displayName="Select";function Vt(e,t,r={}){let{side:o="bottom",align:n="center",sideOffset:a=4,alignOffset:s=0,isOpen:i=false}=r,[c,d]=useState({top:0,left:0}),[m,u]=useState(false),p=useCallback(()=>{if(!e.current||!t.current||!i)return;let g=e.current.getBoundingClientRect(),h=t.current.getBoundingClientRect(),v=0,b=0;switch(o){case "top":v=g.top-h.height-a;break;case "bottom":v=g.bottom+a;break;case "left":b=g.left-h.width-a;break;case "right":b=g.right+a;break}if(o==="top"||o==="bottom")switch(n){case "start":b=g.left+s;break;case "center":b=g.left+g.width/2-h.width/2+s;break;case "end":b=g.right-h.width+s;break}else switch(n){case "start":v=g.top+s;break;case "center":v=g.top+g.height/2-h.height/2+s;break;case "end":v=g.bottom-h.height+s;break}let f=8,x=window.innerWidth,w=window.innerHeight;b<f&&(b=f),b+h.width>x-f&&(b=x-h.width-f),v<f&&(v=f),v+h.height>w-f&&(v=w-h.height-f),d({top:v,left:b}),u(true);},[e,t,o,n,a,s,i]);return useLayoutEffect(()=>{if(!i){m&&u(false);return}p();let g=new ResizeObserver(()=>p());return e.current&&g.observe(e.current),t.current&&g.observe(t.current),window.addEventListener("resize",p),window.addEventListener("scroll",p,true),()=>{g.disconnect(),window.removeEventListener("resize",p),window.removeEventListener("scroll",p,true);}},[i,p,e,t]),{position:c,isPositioned:m,updatePosition:p}}var Do=createContext(void 0);function je({children:e,open:t,onOpenChange:r}){let[o,n]=useState(false),a=useRef(null),s=t!==void 0,i=s?t:o,c=d=>{s||n(d),r?.(d);};return jsx(Do.Provider,{value:{isOpen:i,setIsOpen:c,triggerRef:a},children:jsx("div",{className:"relative inline-block",children:e})})}function Qe({className:e,children:t,...r}){let o=useContext(Do);if(!o)throw new Error("PopoverTrigger must be used within Popover");let n=a=>{o.setIsOpen(!o.isOpen),r.onClick?.(a);};return jsx("button",{ref:o.triggerRef,type:"button","aria-haspopup":"dialog","aria-expanded":o.isOpen?"true":"false",onClick:n,className:l("inline-flex items-center justify-center",e),...r,children:t})}function Je({className:e,children:t,align:r="center",sideOffset:o=4,...n}){let a=useContext(Do);if(!a)throw new Error("PopoverContent must be used within Popover");let s=useRef(null),{position:i,isPositioned:c}=Vt(a.triggerRef,s,{side:"bottom",align:r,sideOffset:o,isOpen:a.isOpen});if(useEffect(()=>{if(a.isOpen){let m=u=>{s.current&&!s.current.contains(u.target)&&a.triggerRef.current&&!a.triggerRef.current.contains(u.target)&&a.setIsOpen(false);};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m);}}},[a.isOpen,a.setIsOpen,a.triggerRef]),!a.isOpen)return null;let d=()=>{let m=i.top>(a.triggerRef.current?.getBoundingClientRect().top||0)?"bottom":"top";return m==="bottom"?r==="start"?"top left":r==="end"?"top right":"top center":m==="top"?r==="start"?"bottom left":r==="end"?"bottom right":"bottom center":"center center"};return createPortal(jsx("div",{ref:s,style:{top:i.top,left:i.left,transformOrigin:d()},className:l("fixed z-[110] min-w-[12rem] rounded-2xl border border-gray-200 dark:border-white/10 bg-white/80 dark:bg-white/[0.03] backdrop-blur-xl p-4 shadow-xl outline-none duration-200",c?"animate-in fade-in zoom-in-95 opacity-100":"opacity-0",e),...n,children:t}),document.body)}var pr=createContext(void 0);function Ho({children:e,value:t,defaultValue:r="",onValueChange:o,filter:n=(s,i)=>s.toLowerCase().includes(i.toLowerCase()),usePopover:a=true}){let[s,i]=useState(r),[c,d]=useState(""),[m,u]=useState(false),[p,g]=useState(new Map),[h,v]=useState(-1),b=t!==void 0,f=b?t:s,x=T=>{b||i(T),o?.(T),u(false),d("");},w=ve__default.useCallback((T,C,N)=>(g(R=>{let H=new Map(R);return H.set(T,{text:C,value:N}),H}),()=>{g(R=>{let H=new Map(R);return H.delete(T),H});}),[]),k=useMemo(()=>Array.from(p.entries()).filter(([T,C])=>n(C.text,c)).map(([T,C])=>({id:T,value:C.value})),[p,c,n]),y=k.length>0;return useEffect(()=>{v(m?0:-1);},[m]),jsx(pr.Provider,{value:{value:f,onValueChange:x,searchTerm:c,setSearchTerm:d,isOpen:m,setIsOpen:u,registerItem:w,isItemVisible:(T,C)=>n(C,c),hasVisibleItems:y,activeIndex:h,setActiveIndex:v,visibleItems:k},children:a?jsx(je,{open:m,onOpenChange:u,children:e}):e})}function Ix({className:e,children:t,...r}){let o=useContext(pr);return jsxs(Qe,{role:"combobox","aria-expanded":o?.isOpen,"aria-haspopup":"listbox",className:l("flex h-10 w-full items-center justify-between rounded-2xl border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-900 placeholder:text-gray-500 focus:border-purple-500 focus:outline-none focus:ring-2 focus:ring-purple-500/20 disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:bg-white/[0.03] dark:text-white dark:placeholder:text-white/40 dark:focus:border-white/20 dark:focus:ring-white/10",e),...r,children:[t,jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-2 opacity-50",children:jsx("path",{d:"m6 9 6 6 6-6"})})]})}function Ax({className:e,children:t,...r}){return jsx(Je,{className:l("p-0 w-[200px]",e),align:"start",...r,children:t})}function un({className:e,placeholder:t="Search...",...r}){let o=useContext(pr);if(!o)throw new Error("ComboboxInput must be used within Combobox");let n=a=>{a.key==="ArrowDown"?(a.preventDefault(),o.setActiveIndex(s=>(s+1)%o.visibleItems.length)):a.key==="ArrowUp"?(a.preventDefault(),o.setActiveIndex(s=>(s-1+o.visibleItems.length)%o.visibleItems.length)):a.key==="Enter"?(a.preventDefault(),o.activeIndex!==-1&&o.visibleItems[o.activeIndex]&&o.onValueChange(o.visibleItems[o.activeIndex].value)):a.key==="Escape"&&o.setIsOpen(false),r.onKeyDown?.(a);};return jsxs("div",{className:"flex items-center border-b border-gray-200 dark:border-white/10 px-3",children:[jsxs("svg",{className:"mr-2 h-4 w-4 shrink-0 opacity-50",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("circle",{cx:"11",cy:"11",r:"8"}),jsx("path",{d:"m21 21-4.3-4.3"})]}),jsx("input",{className:l("flex h-10 w-full rounded-md bg-transparent py-3 text-sm text-gray-900 dark:text-white outline-none placeholder:text-gray-400 dark:placeholder:text-white/40 disabled:cursor-not-allowed disabled:opacity-50",e),placeholder:t,value:o.searchTerm,onChange:a=>o.setSearchTerm(a.target.value),onKeyDown:n,"aria-autocomplete":"list","aria-activedescendant":o.activeIndex!==-1?o.visibleItems[o.activeIndex]?.id:void 0,...r})]})}function pn({className:e,children:t,...r}){return jsx("div",{role:"listbox",className:l("max-h-[300px] overflow-y-auto overflow-x-hidden p-1",e),...r,children:t})}function fn({className:e,children:t,...r}){let o=useContext(pr);if(!o)throw new Error("ComboboxEmpty must be used within Combobox");return o.hasVisibleItems?null:jsx("div",{className:l("py-6 text-center text-sm text-gray-500 dark:text-white/40",e),...r,children:t})}function gn({className:e,value:t,children:r,textValue:o,...n}){let a=useContext(pr);if(!a)throw new Error("ComboboxItem must be used within Combobox");let s=ve__default.useId(),i=o||(typeof r=="string"?r:t),c=a.isItemVisible(s,i),d=a.value===t,m=a.visibleItems.findIndex(p=>p.id===s),u=a.activeIndex===m;return useEffect(()=>a.registerItem(s,i,t),[s,i,t,a.registerItem]),c?jsxs("div",{id:s,role:"option","aria-selected":d,onClick:()=>a.onValueChange(t),onMouseEnter:()=>a.setActiveIndex(m),className:l("relative flex cursor-default select-none items-center rounded-2xl px-3 py-2 text-sm outline-none transition-colors","text-gray-700 dark:text-white/80","aria-selected:bg-gray-100 aria-selected:text-gray-900 dark:aria-selected:bg-white/[0.06] dark:aria-selected:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-white/[0.06] dark:hover:text-white",(d||u)&&"bg-gray-100 text-gray-900 dark:bg-white/[0.06] dark:text-white",e),...n,children:[jsx("svg",{className:l("mr-2 h-4 w-4",d?"opacity-100":"opacity-0"),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("polyline",{points:"20 6 9 17 4 12"})}),r]}):null}var $x=ve__default.forwardRef(({className:e,value:t,defaultValue:r=0,min:o=0,max:n=100,step:a=1,onChange:s,disabled:i,...c},d)=>{let[m,u]=useState(r),p=t!==void 0,g=p?t:m,h=useRef(null),v=(g-o)/(n-o)*100,b=useCallback(k=>{if(i||!h.current)return;let y=h.current.getBoundingClientRect(),T=y.width,C=y.left,N=(k-C)/T*(n-o)+o;N=Math.min(Math.max(N,o),n);let R=Math.round((N-o)/a);N=o+R*a,N=Number(N.toFixed(10)),p||u(N),s?.(N);},[i,p,n,o,s,a]),f=k=>{if(i)return;b(k.clientX);let y=C=>{b(C.clientX);},T=()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",T);};document.addEventListener("mousemove",y),document.addEventListener("mouseup",T);},x=k=>{if(i)return;let y=k.touches[0];y&&b(y.clientX);let T=N=>{let R=N.touches[0];R&&b(R.clientX);},C=()=>{document.removeEventListener("touchmove",T),document.removeEventListener("touchend",C);};document.addEventListener("touchmove",T,{passive:false}),document.addEventListener("touchend",C);};return jsxs("div",{ref:d,role:"slider","aria-valuemin":o,"aria-valuemax":n,"aria-valuenow":g,"aria-disabled":i,tabIndex:i?-1:0,onKeyDown:k=>{if(i)return;let y=g;if(k.key==="ArrowRight"||k.key==="ArrowUp")y=Math.min(g+a,n);else if(k.key==="ArrowLeft"||k.key==="ArrowDown")y=Math.max(g-a,o);else if(k.key==="Home")y=o;else if(k.key==="End")y=n;else return;k.preventDefault(),y!==g&&(p||u(y),s?.(y));},className:l("relative flex w-full touch-none select-none items-center py-4 group",i&&"opacity-50 cursor-not-allowed",e),onMouseDown:f,onTouchStart:x,...c,children:[jsx("div",{ref:h,className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-gray-200 dark:bg-white/[0.06] backdrop-blur-sm border border-gray-200 dark:border-white/5",children:jsx("div",{className:"absolute h-full bg-gray-900 dark:bg-white transition-none dark:shadow-[0_0_10px_rgba(255,255,255,0.5)]",style:{width:`${v}%`}})}),jsx("div",{className:"absolute h-5 w-5 rounded-full border-2 border-gray-900 dark:border-white bg-white dark:bg-black shadow-md dark:shadow-[0_0_15px_rgba(255,255,255,0.5)] transition-transform hover:scale-110 focus:scale-110",style:{left:`calc(${v}% - 10px)`}})]})});var Bl=["Su","Mo","Tu","We","Th","Fr","Sa"],Ol=["January","February","March","April","May","June","July","August","September","October","November","December"];function Gr({className:e,value:t,onChange:r,minDate:o,maxDate:n}){let[a,s]=useState(t||new Date),[i,c]=useState(t||new Date),d=(f,x)=>new Date(f,x+1,0).getDate(),m=(f,x)=>new Date(f,x,1).getDay(),u=()=>{c(new Date(i.getFullYear(),i.getMonth()-1,1));},p=()=>{c(new Date(i.getFullYear(),i.getMonth()+1,1));},g=f=>{let x=new Date(i.getFullYear(),i.getMonth(),f);r&&r(x),s(x);},h=f=>t&&t.getDate()===f&&t.getMonth()===i.getMonth()&&t.getFullYear()===i.getFullYear(),v=f=>{let x=new Date;return x.getDate()===f&&x.getMonth()===i.getMonth()&&x.getFullYear()===i.getFullYear()},b=()=>{let f=d(i.getFullYear(),i.getMonth()),x=m(i.getFullYear(),i.getMonth()),w=[];for(let k=0;k<x;k++)w.push(jsx("div",{className:"h-9 w-9"},`empty-${k}`));for(let k=1;k<=f;k++){let y=h(k),T=v(k);w.push(jsx("button",{onClick:()=>g(k),type:"button",className:l("h-9 w-9 rounded-2xl text-sm font-medium transition-all duration-200","hover:bg-gray-100 dark:hover:bg-white/[0.06] focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/20",y&&"bg-gray-900 text-white dark:bg-white dark:text-black shadow-md dark:shadow-[0_0_15px_rgba(255,255,255,0.3)] hover:bg-gray-800 dark:hover:bg-white/90",!y&&T&&"bg-gray-100 dark:bg-white/[0.03] text-gray-900 dark:text-white border border-gray-200 dark:border-white/10",!y&&!T&&"text-gray-700 dark:text-white/70 hover:text-gray-900 dark:hover:text-white"),children:k},k));}return w};return jsxs("div",{className:l("p-4 bg-white dark:bg-black/40 backdrop-blur-xl border border-gray-200 dark:border-white/10 rounded-2xl w-fit",e),children:[jsxs("div",{className:"flex items-center justify-between mb-4 px-1",children:[jsxs("div",{className:"font-semibold text-gray-900 dark:text-white",children:[Ol[i.getMonth()]," ",jsx("span",{className:"text-gray-500 dark:text-white/50",children:i.getFullYear()})]}),jsxs("div",{className:"flex gap-1",children:[jsx("button",{onClick:u,type:"button",className:"p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/70 hover:text-gray-900 dark:hover:text-white transition-colors",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx("button",{onClick:p,type:"button",className:"p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/70 hover:text-gray-900 dark:hover:text-white transition-colors",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]}),jsx("div",{className:"grid grid-cols-7 gap-1 mb-2 text-center",children:Bl.map(f=>jsx("div",{className:"h-9 w-9 flex items-center justify-center text-xs font-medium text-gray-400 dark:text-white/40",children:f},f))}),jsx("div",{className:"grid grid-cols-7 gap-1",children:b()})]})}function rv({value:e,onChange:t,placeholder:r="Pick a date",className:o}){let[n,a]=useState(e),[s,i]=useState(false),c=u=>{a(u),t?.(u),i(false);},d=u=>u.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"});return jsxs(je,{open:s,onOpenChange:i,children:[jsxs(Qe,{onMouseMove:u=>{let p=u.currentTarget.getBoundingClientRect(),g=u.clientX-p.left,h=u.clientY-p.top;u.currentTarget.style.setProperty("--x",`${g}px`),u.currentTarget.style.setProperty("--y",`${h}px`);},className:l("group relative flex h-11 w-full items-center justify-between rounded-2xl border border-gray-200 dark:border-white/10 bg-gray-50 dark:bg-white/[0.03] px-4 py-2 text-sm text-gray-900 dark:text-white transition-all duration-200 overflow-hidden","hover:bg-gray-100 dark:hover:bg-white/[0.06] focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/15",!n&&"text-gray-400 dark:text-white/40",o),children:[jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none",style:{background:"radial-gradient(600px circle at var(--x) var(--y), rgba(255,255,255,0.06), transparent 40%)"}}),jsx("span",{className:"relative z-10",children:n?d(n):r}),jsx(Calendar,{className:"relative z-10 h-4 w-4 text-white/40"})]}),jsx(Je,{className:"w-auto p-0 border-none bg-transparent shadow-none",align:"start",children:jsx(Gr,{value:n,onChange:c,className:"shadow-2xl shadow-black/50"})})]})}var at=ve__default.forwardRef(({className:e,children:t,orientation:r="vertical",scrollbarSize:o="sm",...n},a)=>jsx("div",{ref:a,className:l("overflow-auto","[&::-webkit-scrollbar]:bg-transparent","[&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-thumb]:bg-white/[0.06]","[&::-webkit-scrollbar-thumb]:rounded-full","hover:[&::-webkit-scrollbar-thumb]:bg-gray-400 dark:hover:[&::-webkit-scrollbar-thumb]:bg-white/20","[&::-webkit-scrollbar-track]:bg-transparent","[scrollbar-width:thin] [scrollbar-color:rgba(0,0,0,0.2)_transparent] dark:[scrollbar-color:rgba(255,255,255,0.1)_transparent]",r==="vertical"&&"overflow-y-auto overflow-x-hidden",r==="horizontal"&&"overflow-x-auto overflow-y-hidden",r==="both"&&"overflow-auto",o==="sm"&&"[&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar]:h-1.5",o==="md"&&"[&::-webkit-scrollbar]:w-2.5 [&::-webkit-scrollbar]:h-2.5",o==="lg"&&"[&::-webkit-scrollbar]:w-4 [&::-webkit-scrollbar]:h-4",e),...n,children:t}));at.displayName="ScrollArea";function bv({value:e,onChange:t,placeholder:r="Pick date & time",className:o}){let[n,a]=useState(e),[s,i]=useState(false),[c,d]=useState(e?e.getHours():12),[m,u]=useState(e?e.getMinutes():0);useEffect(()=>{e&&(a(e),d(e.getHours()),u(e.getMinutes()));},[e]);let p=b=>{let f=new Date(b);f.setHours(c),f.setMinutes(m),a(f),t?.(f);},g=(b,f)=>{let x=parseInt(f,10);if(isNaN(x))return;let w=c,k=m;b==="hours"?(x=Math.max(0,Math.min(23,x)),d(x),w=x):(x=Math.max(0,Math.min(59,x)),u(x),k=x);let y=n||new Date,T=new Date(y);T.setHours(w),T.setMinutes(k),a(T),t?.(T);},h=b=>b.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"});return jsxs(je,{open:s,onOpenChange:i,children:[jsxs(Qe,{onMouseMove:b=>{let f=b.currentTarget.getBoundingClientRect(),x=b.clientX-f.left,w=b.clientY-f.top;b.currentTarget.style.setProperty("--x",`${x}px`),b.currentTarget.style.setProperty("--y",`${w}px`);},className:l("group relative flex h-11 w-full items-center justify-between rounded-2xl border border-gray-200 dark:border-white/10 bg-gray-50 dark:bg-white/[0.03] px-4 py-2 text-sm text-gray-900 dark:text-white transition-all duration-200 overflow-hidden","hover:bg-gray-100 dark:hover:bg-white/[0.06] focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/15",!n&&"text-gray-400 dark:text-white/40",o),children:[jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none",style:{background:"radial-gradient(600px circle at var(--x) var(--y), rgba(0,0,0,0.06), transparent 40%)"}}),jsx("span",{className:"relative z-10",children:n?h(n):r}),jsxs("div",{className:"flex items-center gap-2 text-gray-400 dark:text-white/40",children:[jsx(Calendar,{className:"h-4 w-4"}),jsx(Clock,{className:"h-4 w-4"})]})]}),jsx(Je,{className:"w-auto p-0 border-none bg-transparent shadow-none",align:"start",children:jsx("div",{className:"flex flex-col rounded-2xl border border-gray-200 dark:border-white/10 bg-white dark:bg-black/40 backdrop-blur-xl shadow-2xl dark:shadow-black/50",children:jsxs("div",{className:"flex",children:[jsx("div",{className:"p-4 border-r border-gray-200 dark:border-white/10",children:jsx(Gr,{value:n,onChange:p,className:"border-0 p-0 bg-transparent backdrop-blur-none shadow-none rounded-none"})}),jsxs("div",{className:"flex flex-col p-4 w-[160px] h-[340px]",children:[jsx("div",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-white/70",children:"Time"}),jsxs("div",{className:"flex flex-1 gap-2 min-h-0 overflow-hidden",children:[jsxs(at,{className:"flex-1 flex flex-col gap-1",scrollbarSize:"sm",children:[jsx("div",{className:"text-xs text-gray-400 dark:text-white/40 text-center mb-1 sticky top-0 bg-white dark:bg-[#0A0A0A] py-1 z-10",children:"Hr"}),jsx("div",{className:"flex flex-col gap-1",children:Array.from({length:24}).map((b,f)=>jsx("button",{onClick:()=>g("hours",f.toString()),className:l("w-full rounded-lg px-1 py-1.5 text-sm transition-colors text-center shrink-0",c===f?"bg-emerald-500 dark:bg-emerald-600/80 text-white font-medium":"text-gray-700 dark:text-white/70 hover:bg-gray-100 dark:hover:bg-white/[0.06] hover:text-gray-900 dark:hover:text-white"),children:f.toString().padStart(2,"0")},f))})]}),jsx("div",{className:"w-[1px] bg-gray-200 dark:bg-white/[0.06]"}),jsxs(at,{className:"flex-1 flex flex-col gap-1",scrollbarSize:"sm",children:[jsx("div",{className:"text-xs text-gray-400 dark:text-white/40 text-center mb-1 sticky top-0 bg-white dark:bg-[#0A0A0A] py-1 z-10",children:"Min"}),jsx("div",{className:"flex flex-col gap-1",children:Array.from({length:60}).map((b,f)=>jsx("button",{onClick:()=>g("minutes",f.toString()),className:l("w-full rounded-lg px-1 py-1.5 text-sm transition-colors text-center shrink-0",m===f?"bg-emerald-500 dark:bg-emerald-600/80 text-white font-medium":"text-gray-700 dark:text-white/70 hover:bg-gray-100 dark:hover:bg-white/[0.06] hover:text-gray-900 dark:hover:text-white"),children:f.toString().padStart(2,"0")},f))})]})]})]})]})})})]})}var gr=ve__default.forwardRef(({className:e,label:t,error:r,id:o,disabled:n,...a},s)=>{let i=ve__default.useId(),c=o||i;return jsxs("div",{className:"flex flex-col gap-1.5",children:[t&&jsx(U,{htmlFor:c,className:l(n&&"opacity-50 cursor-not-allowed"),children:t}),jsx("textarea",{ref:s,id:c,disabled:n,className:l("w-full rounded-2xl bg-gray-50 dark:bg-white/[0.04] px-4 py-3","border border-gray-200 dark:border-white/[0.10]","text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-white/30","focus:outline-none focus:ring-2 focus:ring-purple-400/30","resize-none","disabled:cursor-not-allowed disabled:opacity-50",r&&"border-rose-400/25 focus:ring-rose-300/25",e),...a}),r&&jsx("p",{className:"text-xs text-rose-400 animate-in slide-in-from-top-1 fade-in duration-200",children:r})]})});gr.displayName="Textarea";var Gl=ve__default.forwardRef((e,t)=>{let[r,o]=useState(false);return jsx(vt,{...e,ref:t,type:r?"text":"password",rightIcon:jsx(L,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-white/10",onClick:()=>o(!r),"aria-label":r?"Hide password":"Show password",children:r?jsx(EyeOff,{className:"h-4 w-4 text-gray-400 dark:text-white/35"}):jsx(Eye,{className:"h-4 w-4 text-gray-400 dark:text-white/35"})})})});Gl.displayName="PasswordInput";var Jl=cva("inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-xs font-medium whitespace-nowrap transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-gray-100 text-gray-700 border-gray-200 dark:bg-white/[0.06] dark:text-white/70 dark:border-white/10",neutral:"bg-gray-100 text-gray-700 border-gray-200 dark:bg-white/[0.06] dark:text-white/70 dark:border-white/10",success:"bg-emerald-100 text-emerald-700 border-emerald-200 dark:bg-emerald-400/15 dark:text-emerald-200 dark:border-emerald-400/20",warning:"bg-amber-100 text-amber-700 border-amber-200 dark:bg-amber-400/15 dark:text-amber-200 dark:border-amber-400/20",danger:"bg-rose-100 text-rose-700 border-rose-200 dark:bg-rose-400/15 dark:text-rose-200 dark:border-rose-400/20",info:"bg-sky-100 text-sky-700 border-sky-200 dark:bg-sky-400/15 dark:text-sky-200 dark:border-sky-400/20",outline:"bg-transparent text-white/60 border-white/10 hover:bg-white/[0.06]"}},defaultVariants:{variant:"default"}}),Oe=ve__default.forwardRef(({className:e,variant:t,...r},o)=>jsx("span",{ref:o,className:l(Jl({variant:t}),e),...r}));Oe.displayName="Badge";function Fv({label:e,placeholder:t="Add tag...",tags:r,onChange:o,error:n,className:a}){let[s,i]=useState(""),c=m=>{m.key==="Enter"&&s.trim()?(m.preventDefault(),r.includes(s.trim())||o([...r,s.trim()]),i("")):m.key==="Backspace"&&!s&&r.length>0&&o(r.slice(0,-1));},d=m=>{o(r.filter(u=>u!==m));};return jsxs("div",{className:l("flex flex-col gap-1.5",a),children:[e&&jsx(U,{children:e}),jsxs("div",{className:l("flex flex-wrap gap-2 rounded-2xl bg-gray-50 dark:bg-white/[0.04] px-3 py-2 border border-gray-200 dark:border-white/[0.10] focus-within:ring-2 focus-within:ring-purple-400/30 transition-all duration-200",n&&"border-rose-400/25"),children:[r.map(m=>jsxs(Oe,{variant:"default",className:"gap-1 pr-1",children:[m,jsx("button",{type:"button",onClick:()=>d(m),className:"rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10 transition-colors",children:jsx(X$1,{className:"h-3 w-3"})})]},m)),jsx("input",{type:"text",value:s,onChange:m=>i(m.target.value),onKeyDown:c,placeholder:r.length===0?t:"",className:"flex-1 bg-transparent py-1 text-sm outline-none placeholder:text-gray-400 dark:placeholder:text-white/30 min-w-[120px]"})]}),n&&jsx("p",{className:"text-xs text-rose-400 animate-in slide-in-from-top-1 fade-in duration-200",children:n})]})}function Xv({label:e,value:t,onChange:r,error:o,className:n}){return jsxs("div",{className:l("flex flex-col gap-1.5",n),children:[e&&jsx(U,{children:e}),jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:"h-10 w-10 rounded-xl border border-gray-200 dark:border-white/10 overflow-hidden relative",style:{backgroundColor:t},children:jsx("input",{type:"color",value:t,onChange:a=>r(a.target.value),className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full"})}),jsx("input",{type:"text",value:t,onChange:a=>r(a.target.value),className:"flex-1 rounded-2xl bg-gray-50 dark:bg-white/[0.04] px-4 py-2 border border-gray-200 dark:border-white/[0.10] text-sm focus:outline-none focus:ring-2 focus:ring-purple-400/30 transition-all"})]}),o&&jsx("p",{className:"text-xs text-rose-400",children:o})]})}var yn=createContext({}),ac=ve__default.forwardRef(({className:e,value:t,onChange:r,name:o,disabled:n,label:a,children:s,...i},c)=>{let d=ve__default.useId();return jsxs("div",{ref:c,className:l("flex flex-col gap-2",e),...i,children:[a&&jsx(U,{className:l(n&&"opacity-50 cursor-not-allowed"),children:a}),jsx("div",{className:"flex flex-col gap-2",role:"radiogroup",children:jsx(yn.Provider,{value:{value:t,onChange:r,name:o||d,disabled:n},children:s})})]})});ac.displayName="RadioGroup";var nc=ve__default.forwardRef(({className:e,value:t,label:r,disabled:o,...n},a)=>{let s=useContext(yn),i=s.value===t,c=s.disabled||o,d=ve__default.useId();return jsxs("label",{htmlFor:d,className:l("flex items-center gap-3 cursor-pointer group",c&&"cursor-not-allowed opacity-50",e),children:[jsxs("div",{className:"relative flex items-center justify-center",children:[jsx("input",{ref:a,id:d,type:"radio",name:s.name,value:t,checked:i,disabled:c,onChange:m=>{m.target.checked&&s.onChange?.(t);},className:"peer sr-only",...n}),jsx("div",{className:l("h-5 w-5 rounded-full border border-gray-300 dark:border-white/20 bg-gray-50 dark:bg-white/[0.03] transition-all duration-200","peer-focus-visible:ring-2 peer-focus-visible:ring-gray-400 dark:peer-focus-visible:ring-white/20 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-offset-[#0A0A0A]","group-hover:bg-gray-100 dark:group-hover:bg-white/[0.05]",i&&"border-gray-900 bg-gray-900 dark:border-white dark:bg-white"),children:i&&jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsx("div",{className:"h-2 w-2 rounded-full bg-white dark:bg-black"})})})]}),r&&jsx("span",{className:"text-sm text-gray-900 dark:text-white/90 select-none font-medium",children:r})]})});nc.displayName="RadioGroupItem";var xr=ve__default.createContext({}),sc=ve__default.forwardRef(({className:e,...t},r)=>{let o=ve__default.useId();return jsx(xr.Provider,{value:{id:o},children:jsx("div",{ref:r,className:l("space-y-2",e),...t})})});sc.displayName="FormItem";var ic=ve__default.forwardRef(({className:e,...t},r)=>{let{id:o}=ve__default.useContext(xr);return jsx(U,{ref:r,className:l("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),htmlFor:o,...t})});ic.displayName="FormLabel";var lc=ve__default.forwardRef(({...e},t)=>{let{id:r}=ve__default.useContext(xr),{children:o,...n}=e;return ve__default.isValidElement(o)?ve__default.cloneElement(o,{id:r,"aria-describedby":`${r}-description ${r}-message`,...n,...o.props}):jsx("div",{ref:t,...e})});lc.displayName="FormControl";var cc=ve__default.forwardRef(({className:e,...t},r)=>{let{id:o}=ve__default.useContext(xr);return jsx("p",{ref:r,id:`${o}-description`,className:l("text-xs text-white/50",e),...t})});cc.displayName="FormDescription";var dc=ve__default.forwardRef(({className:e,children:t,...r},o)=>{let{id:n}=ve__default.useContext(xr);return t?jsx("p",{ref:o,id:`${n}-message`,className:l("text-xs font-medium text-rose-500",e),...r,children:t}):null});dc.displayName="FormMessage";var gc=cva("relative flex flex-col items-center justify-center rounded-2xl border-2 border-dashed transition-all duration-200 text-center",{variants:{isDragActive:{true:"border-blue-500 bg-blue-50 dark:bg-blue-500/10",false:"border-gray-200 bg-gray-50 hover:bg-gray-100 dark:border-white/10 dark:bg-white/[0.02] dark:hover:bg-white/[0.05]"},error:{true:"border-rose-500 bg-rose-50 dark:bg-rose-500/10",false:""}},defaultVariants:{isDragActive:false,error:false}}),bc=ve__default.forwardRef(({className:e,onDrop:t,maxFiles:r=1,maxSize:o,label:n="Upload files",description:a="Drag & drop or click to upload",...s},i)=>{let[c,d]=useState(false),[m,u]=useState([]),[p,g]=useState(null),h=ve__default.useRef(null),v=y=>{y.preventDefault(),d(true);},b=y=>{y.preventDefault(),d(false);},f=y=>r&&y.length>r?(g(`Max ${r} files allowed`),false):o&&y.some(C=>C.size>o)?(g(`File too large (max ${o/1024/1024}MB)`),false):(g(null),true),x=y=>{y.preventDefault(),d(false);let T=Array.from(y.dataTransfer.files);f(T)&&(u(T),t?.(T));},w=y=>{if(y.target.files){let T=Array.from(y.target.files);f(T)&&(u(T),t?.(T));}},k=(y,T)=>{T.stopPropagation();let C=m.filter((N,R)=>R!==y);u(C),t?.(C);};return jsxs("div",{className:"w-full space-y-4",children:[jsxs("div",{ref:i,className:l(gc({isDragActive:c,error:!!p,className:e}),"p-8 cursor-pointer"),onDragOver:v,onDragLeave:b,onDrop:x,onClick:()=>h.current?.click(),...s,children:[jsx("input",{ref:h,type:"file",className:"hidden",multiple:r>1,onChange:w}),jsx("div",{className:"mb-4 rounded-full bg-gray-100 p-3 dark:bg-white/[0.06]",children:jsx(Upload,{className:"h-6 w-6 text-gray-500 dark:text-white/70"})}),jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:n}),jsx("div",{className:"mt-1 text-xs text-gray-500 dark:text-white/50",children:a}),p&&jsx("div",{className:"mt-2 text-xs font-medium text-rose-500",children:p})]}),m.length>0&&jsx("div",{className:"grid gap-2",children:m.map((y,T)=>jsxs("div",{className:"flex items-center justify-between rounded-xl border border-gray-200 bg-white p-3 dark:border-white/10 dark:bg-white/[0.03]",children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-gray-100 dark:bg-white/[0.06]",children:jsx(File,{className:"h-4 w-4 text-gray-500 dark:text-white/70"})}),jsxs("div",{className:"flex flex-col",children:[jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white truncate max-w-[200px]",children:y.name}),jsxs("span",{className:"text-xs text-gray-500 dark:text-white/50",children:[(y.size/1024).toFixed(1)," KB"]})]})]}),jsx("button",{onClick:C=>k(T,C),className:"rounded-full p-1 hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50",children:jsx(X$1,{className:"h-4 w-4"})})]},T))})]})});bc.displayName="FileDropzone";var kc=cva("flex items-center gap-2",{variants:{size:{sm:"[&>input]:h-8 [&>input]:w-8 [&>input]:text-sm",md:"[&>input]:h-10 [&>input]:w-10 [&>input]:text-base",lg:"[&>input]:h-12 [&>input]:w-12 [&>input]:text-lg"}},defaultVariants:{size:"md"}}),Nc=ve__default.forwardRef(({className:e,size:t,length:r=6,value:o="",onChange:n,onComplete:a,disabled:s,error:i,...c},d)=>{let[m,u]=useState(new Array(r).fill("")),p=useRef([]);useEffect(()=>{let b=o.split("").slice(0,r),f=[...b,...new Array(r-b.length).fill("")];u(f);},[o,r]);let g=(b,f)=>{let x=b.target.value;if(isNaN(Number(x)))return;let w=[...m];w[f]=x.substring(x.length-1),u(w);let k=w.join("");n?.(k),x&&f<r-1&&p.current[f+1]?.focus(),k.length===r&&a?.(k);},h=(b,f)=>{b.key==="Backspace"&&!m[f]&&f>0&&p.current[f-1]?.focus();},v=b=>{b.preventDefault();let f=b.clipboardData.getData("text/plain").slice(0,r);if(!/^\d+$/.test(f))return;let x=[...m];f.split("").forEach((k,y)=>{x[y]=k;}),u(x);let w=x.join("");n?.(w),w.length===r&&a?.(w),p.current[Math.min(f.length,r-1)]?.focus();};return jsx("div",{ref:d,className:l(kc({size:t,className:e})),...c,children:m.map((b,f)=>jsx("input",{ref:x=>p.current[f]=x,type:"text",inputMode:"numeric",maxLength:1,value:b,disabled:s,onChange:x=>g(x,f),onKeyDown:x=>h(x,f),onPaste:v,className:l("rounded-2xl border bg-gray-50 text-center font-semibold transition-all duration-200","focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 focus:outline-none","disabled:opacity-50 disabled:cursor-not-allowed","dark:bg-white/[0.03] dark:text-white",i?"border-rose-500 text-rose-500 focus:border-rose-500 focus:ring-rose-500/20":"border-gray-200 dark:border-white/10")},f))})});Nc.displayName="OTPInput";var Lc=cva("flex items-center rounded-2xl border bg-gray-50 dark:bg-white/[0.03] dark:border-white/10",{variants:{size:{sm:"h-8",md:"h-10",lg:"h-12"},error:{true:"border-rose-500",false:"border-gray-200"}},defaultVariants:{size:"md",error:false}}),Pc=ve__default.forwardRef(({className:e,size:t,error:r,value:o=0,onChange:n,min:a=-1/0,max:s=1/0,step:i=1,disabled:c,...d},m)=>{let u=()=>{o-i>=a&&n?.(o-i);},p=()=>{o+i<=s&&n?.(o+i);},g=h=>{let v=parseFloat(h.target.value);isNaN(v)||n?.(v);};return jsxs("div",{className:l(Lc({size:t,error:r,className:e})),children:[jsx("button",{type:"button",onClick:u,disabled:c||o<=a,className:"flex h-full items-center justify-center px-3 text-gray-500 hover:text-gray-900 disabled:opacity-50 dark:text-white/50 dark:hover:text-white",children:jsx(Minus,{className:"h-3.5 w-3.5"})}),jsx("div",{className:"h-full w-px bg-gray-200 dark:bg-white/[0.06]"}),jsx("input",{ref:m,type:"number",value:o,onChange:g,disabled:c,className:"h-full w-full min-w-[3rem] bg-transparent text-center text-sm font-medium text-gray-900 focus:outline-none dark:text-white",...d}),jsx("div",{className:"h-full w-px bg-gray-200 dark:bg-white/[0.06]"}),jsx("button",{type:"button",onClick:p,disabled:c||o>=s,className:"flex h-full items-center justify-center px-3 text-gray-500 hover:text-gray-900 disabled:opacity-50 dark:text-white/50 dark:hover:text-white",children:jsx(Plus,{className:"h-3.5 w-3.5"})})]})});Pc.displayName="NumberInput";var Dc=cva("inline-flex items-center rounded-2xl border border-gray-200 bg-gray-50 p-1 dark:border-white/10 dark:bg-white/[0.03]",{variants:{size:{sm:"h-8",md:"h-10",lg:"h-12"},fullWidth:{true:"w-full flex",false:""}},defaultVariants:{size:"md",fullWidth:false}}),Hc=cva("inline-flex items-center justify-center whitespace-nowrap rounded-2xl px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-gray-950 dark:focus-visible:ring-gray-300",{variants:{selected:{true:"bg-white text-gray-950 shadow-sm dark:bg-gray-800 dark:text-gray-50",false:"text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50"},fullWidth:{true:"flex-1",false:""}},defaultVariants:{selected:false,fullWidth:false}}),Ic=ve__default.forwardRef(({className:e,size:t,fullWidth:r,value:o,onChange:n,options:a,...s},i)=>jsx("div",{ref:i,className:l(Dc({size:t,fullWidth:r,className:e})),...s,children:a.map(c=>jsxs("button",{type:"button",onClick:()=>n?.(c.value),className:l(Hc({selected:o===c.value,fullWidth:r})),children:[c.icon&&jsx("span",{className:"mr-2",children:c.icon}),c.label]},c.value))}));Ic.displayName="ToggleGroup";var Mn={loading:jsx("svg",{className:"animate-spin text-blue-500",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),success:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-emerald-400",children:[jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),error:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-rose-400",children:[jsx("circle",{cx:"12",cy:"12",r:"10"}),jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),warning:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-amber-400",children:[jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),info:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-blue-400",children:[jsx("circle",{cx:"12",cy:"12",r:"10"}),jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})},Rn=({id:e,title:t,description:r,variant:o="default",duration:n=5e3,onDismiss:a})=>(useEffect(()=>{if(n===1/0)return;let s=setTimeout(()=>{a(e);},n);return ()=>clearTimeout(s)},[n,e,a]),jsxs("div",{role:"alert",className:l("pointer-events-auto relative flex w-full max-w-sm items-start gap-4 overflow-hidden rounded-2xl border p-4 shadow-lg transition-all","animate-in slide-in-from-right-full fade-in duration-300","bg-white dark:bg-[#0A0A0A]/90 backdrop-blur-md border-gray-200 dark:border-white/10",o==="error"&&"border-rose-200 dark:border-rose-500/30 bg-rose-50 dark:bg-rose-500/10",o==="success"&&"border-emerald-200 dark:border-emerald-500/20 bg-emerald-50 dark:bg-emerald-950/10",o==="warning"&&"border-amber-200 dark:border-amber-500/20 bg-amber-50 dark:bg-amber-950/10",o==="info"&&"border-blue-200 dark:border-blue-500/20 bg-blue-50 dark:bg-blue-950/10",o==="loading"&&"border-blue-200 dark:border-blue-500/20 bg-blue-50 dark:bg-blue-950/10"),children:[o!=="default"&&Mn[o]&&jsx("div",{className:"shrink-0 pt-0.5",children:Mn[o]}),jsxs("div",{className:"flex-1 gap-1",children:[t&&jsx("div",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:t}),r&&jsx("div",{className:"text-sm text-gray-600 dark:text-white/80",children:r})]}),jsx("button",{onClick:()=>a(e),className:"shrink-0 rounded-md p-1 text-gray-400 dark:text-white/50 opacity-0 transition-opacity hover:text-gray-900 dark:hover:text-white group-hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/20",children:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}));var zo=createContext(void 0);function Vw({children:e}){let[t,r]=useState([]),o=useCallback(i=>{r(c=>c.filter(d=>d.id!==i));},[]),n=useCallback(i=>{let c=Math.random().toString(36).substring(2,9);return r(d=>[...d,{...i,id:c,onDismiss:o}]),c},[o]),a=useCallback((i,c)=>{r(d=>d.map(m=>m.id===i?{...m,...c}:m));},[]),s=useCallback(async(i,c)=>{let d=typeof c.loading=="string"?{title:c.loading,variant:"loading"}:{variant:"loading",...c.loading},m=n({...d,duration:1/0});try{let u=await i,p=typeof c.success=="function"?c.success(u):typeof c.success=="string"?{title:c.success,variant:"success"}:c.success;return a(m,{...p,duration:5e3}),u}catch(u){let p=typeof c.error=="function"?c.error(u):typeof c.error=="string"?{title:c.error,variant:"error"}:c.error;throw a(m,{...p,duration:5e3}),u}},[n,a]);return jsxs(zo.Provider,{value:{toast:n,dismiss:o,promise:s},children:[e,jsx("div",{className:"fixed bottom-0 right-0 z-[150] flex max-h-screen w-full flex-col-reverse gap-2 p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",children:t.map(i=>jsx(Rn,{...i},i.id))})]})}var $c={success:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-emerald-400",children:[jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),error:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-rose-400",children:[jsx("circle",{cx:"12",cy:"12",r:"10"}),jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),warning:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-amber-400",children:[jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),info:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-blue-400",children:[jsx("circle",{cx:"12",cy:"12",r:"10"}),jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})},Fc=ve__default.forwardRef(({className:e,variant:t="default",icon:r,title:o,children:n,...a},s)=>{let i=r||(t!=="default"?$c[t]:null);return jsxs("div",{ref:s,role:"alert",className:l("relative w-full rounded-2xl border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-gray-900 dark:[&>svg]:text-white","bg-white dark:bg-[#0A0A0A]/50 backdrop-blur-md border-gray-200 dark:border-white/10 text-gray-900 dark:text-white",t==="error"&&"border-rose-200 dark:border-rose-500/20 bg-rose-50 dark:bg-rose-950/10 text-rose-900 dark:text-rose-50 [&>svg]:text-rose-600 dark:[&>svg]:text-rose-400",t==="success"&&"border-emerald-200 dark:border-emerald-500/20 bg-emerald-50 dark:bg-emerald-950/10 text-emerald-900 dark:text-emerald-50 [&>svg]:text-emerald-600 dark:[&>svg]:text-emerald-400",t==="warning"&&"border-amber-200 dark:border-amber-500/20 bg-amber-50 dark:bg-amber-950/10 text-amber-900 dark:text-amber-50 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-400",t==="info"&&"border-blue-200 dark:border-blue-500/20 bg-blue-50 dark:bg-blue-950/10 text-blue-900 dark:text-blue-50 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400",e),...a,children:[i,jsxs("div",{className:"flex flex-col gap-1",children:[o&&jsx("h5",{className:"mb-1 font-medium leading-none tracking-tight",children:o}),n&&jsx("div",{className:"text-sm opacity-90 [&_p]:leading-relaxed",children:n})]})]})});Fc.displayName="Alert";var Wc=ve__default.forwardRef(({className:e,value:t=0,max:r=100,variant:o="default",size:n="md",isIndeterminate:a=false,hasStripe:s=false,indicatorClassName:i,...c},d)=>{let m=a?0:Math.min(Math.max((t||0)/r,0),1)*100,u={default:"bg-gray-900 dark:bg-white dark:shadow-[0_0_10px_rgba(255,255,255,0.5)]",success:"bg-emerald-500 shadow-sm dark:shadow-[0_0_10px_rgba(16,185,129,0.5)]",warning:"bg-amber-500 shadow-sm dark:shadow-[0_0_10px_rgba(245,158,11,0.5)]",danger:"bg-rose-500 shadow-sm dark:shadow-[0_0_10px_rgba(244,63,94,0.5)]",gradient:"bg-gradient-to-r from-blue-600 via-purple-600 to-blue-600 shadow-sm dark:shadow-[0_0_15px_rgba(99,102,241,0.5)]"};return jsx("div",{ref:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":a?void 0:t,className:l("relative w-full overflow-hidden rounded-full bg-gray-200 dark:bg-white/[0.03] border border-gray-200 dark:border-white/5 backdrop-blur-sm",{sm:"h-1",md:"h-2",lg:"h-4"}[n],e),...c,children:jsx("div",{className:l("h-full w-full flex-1 transition-all duration-500 ease-in-out relative overflow-hidden",u[o],a&&"absolute inset-0 w-full origin-left animate-indeterminate-progress",i),style:{transform:a?void 0:`translateX(-${100-m}%)`},children:s&&!a&&jsx("div",{className:"absolute inset-0 w-full h-full animate-progress-stripe",style:{backgroundImage:"linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)",backgroundSize:"1rem 1rem"}})})})});Wc.displayName="Progress";var Xc=ve__default.forwardRef(({icon:e,title:t,description:r,action:o,className:n,...a},s)=>jsx(te,{ref:s,className:l("p-8 text-center",n),...a,children:jsxs("div",{className:"mx-auto w-full max-w-md space-y-3",children:[jsx("div",{className:"mx-auto grid h-12 w-12 place-items-center rounded-2xl border border-white/10 bg-white/[0.03] text-white/70",children:e??jsx(Info,{className:"h-5 w-5"})}),jsx("div",{className:"text-lg font-semibold text-white",children:t}),r?jsx("div",{className:"text-sm text-white/55",children:r}):null,o?jsx("div",{className:"pt-2 flex justify-center",children:o}):null]})}));Xc.displayName="EmptyState";function Pn({className:e,variant:t="default",...r}){return jsx("div",{className:l("animate-pulse bg-gray-200 dark:bg-white/[0.03]",t==="circle"&&"rounded-full",t==="default"&&"rounded-2xl",t==="text"&&"rounded h-4 w-full",e),...r})}var Zc=ve__default.forwardRef(({className:e,max:t=5,value:r=0,onChange:o,readOnly:n=false,size:a="md",...s},i)=>{let[c,d]=useState(null),m={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"};return jsx("div",{ref:i,className:l("flex items-center gap-1",e),...s,children:Array.from({length:t}).map((u,p)=>{let g=p+1,h=(c!==null?c:r)>=g;return jsx("button",{type:"button",disabled:n,onClick:()=>o?.(g),onMouseEnter:()=>!n&&d(g),onMouseLeave:()=>!n&&d(null),className:l("transition-transform hover:scale-110 focus:outline-none",n&&"cursor-default hover:scale-100"),children:jsx(Star,{className:l(m[a],"transition-colors duration-200",h?"fill-amber-400 text-amber-400":"fill-transparent text-gray-300 dark:text-white/20")})},p)})})});Zc.displayName="Rating";var En=cva("transition-all duration-700 ease-out",{variants:{preset:{fade:"opacity-0 translate-y-4",spring:"opacity-0 scale-95 translate-y-4","slide-right":"opacity-0 -translate-x-8","slide-left":"opacity-0 translate-x-8",blur:"opacity-0 blur-sm scale-105","3d-flip":"opacity-0 rotate-x-90"},visibleState:{fade:"opacity-100 translate-y-0",spring:"opacity-100 scale-100 translate-y-0 animate-enter-spring","slide-right":"opacity-100 translate-x-0","slide-left":"opacity-100 translate-x-0",blur:"opacity-100 blur-0 scale-100","3d-flip":"opacity-100 rotate-x-0"}},defaultVariants:{preset:"spring"}});function Sn({className:e,preset:t="spring",viewport:r=true,visible:o,delay:n=0,once:a=true,asChild:s=false,children:i,style:c,...d}){let{ref:m,isInView:u,hasAnimated:p}=Ke({threshold:.1,enabled:r&&o===void 0}),h=o!==void 0?o:r?a?p:u:true,v=En({preset:t}),b=h?En({visibleState:t}):"";return jsx(s?xt:"div",{ref:m,className:l(v,b,e),style:{transitionDelay:`${n}ms`,willChange:"transform, opacity",...c},...d,children:i})}function xy({children:e,stagger:t=100,delay:r=0,className:o,...n}){let{ref:a,hasAnimated:s}=Ke({threshold:.1});return jsx("div",{ref:a,className:l("relative",o),...n,children:ve__default.Children.map(e,(i,c)=>ve__default.isValidElement(i)?ve__default.cloneElement(i,{visible:s,viewport:false,delay:r+c*t}):i)})}function Ny({text:e,type:t="char",stagger:r=30,delay:o=0,className:n,...a}){let{ref:s,hasAnimated:i}=Ke({threshold:.2}),c=t==="char"?e.split(""):e.split(" ");return jsx("div",{ref:s,className:l("flex flex-wrap",n),"aria-label":e,...a,children:c.map((d,m)=>jsxs("span",{className:l("inline-block whitespace-pre transition-all duration-500 ease-out will-change-transform",i?"opacity-100 translate-y-0 blur-0":"opacity-0 translate-y-4 blur-sm"),style:{transitionDelay:`${o+m*r}ms`},children:[d,t==="word"&&m!==c.length-1?" ":""]},m))})}function Py({children:e,speed:t=.1,direction:r="vertical",className:o,...n}){let a=useRef(null);return useEffect(()=>{let s=a.current;if(!s)return;let i=()=>{let c=s.getBoundingClientRect(),d=window.innerHeight;if(c.top>d||c.bottom<0)return;let u=(d/2-(c.top+c.height/2))*t;r==="vertical"?s.style.transform=`translate3d(0, ${u}px, 0)`:s.style.transform=`translate3d(${u}px, 0, 0)`;};return window.addEventListener("scroll",i,{passive:true}),i(),()=>window.removeEventListener("scroll",i)},[t,r]),jsx("div",{ref:a,className:l("will-change-transform",o),...n,children:e})}function By({children:e,strength:t=.5,className:r}){let o=useRef(null),n=s=>{let i=o.current;if(!i)return;let{clientX:c,clientY:d}=s,{left:m,top:u,width:p,height:g}=i.getBoundingClientRect(),h=m+p/2,v=u+g/2,b=c-h,f=d-v,x=Math.max(p,g)*1.5;Math.abs(b)<x&&Math.abs(f)<x?(i.style.setProperty("--mag-x",`${b*t}px`),i.style.setProperty("--mag-y",`${f*t}px`)):(i.style.setProperty("--mag-x","0px"),i.style.setProperty("--mag-y","0px"));},a=()=>{let s=o.current;s&&(s.style.setProperty("--mag-x","0px"),s.style.setProperty("--mag-y","0px"));};return useEffect(()=>(window.addEventListener("mousemove",n),()=>window.removeEventListener("mousemove",n)),[t]),jsx("div",{ref:o,className:l("inline-block transition-transform duration-300 ease-out will-change-transform",r),onMouseLeave:a,style:{transform:"translate3d(var(--mag-x, 0px), var(--mag-y, 0px), 0)"},children:e})}function Uy({value:e,duration:t=2e3,delay:r=0,decimalPlaces:o=0,className:n,...a}){let[s,i]=useState(0),{ref:c,hasAnimated:d}=Ke({threshold:.1}),m=useRef(null);return useEffect(()=>{if(!d)return;let u=g=>{m.current||(m.current=g);let h=Math.min((g-m.current-r)/t,1);if(h>=0){let v=h*e;i(v);}h<1&&requestAnimationFrame(u);},p=setTimeout(()=>{requestAnimationFrame(u);},r);return ()=>clearTimeout(p)},[d,e,t,r]),jsx("span",{ref:c,className:l("tabular-nums tracking-tighter",n),...a,children:s.toFixed(o)})}function qy({variant:e="spinner",text:t,fullscreen:r=true,className:o,...n}){let a=r?"fixed inset-0 z-[200] flex items-center justify-center bg-white/80 dark:bg-black/80 backdrop-blur-sm":"flex items-center justify-center p-8 w-full h-full min-h-[200px]";return e==="bar"?jsx("div",{className:l("fixed top-0 left-0 right-0 z-[200] h-1 bg-transparent",o),...n,children:jsx("div",{className:"h-full bg-blue-500 animate-indeterminate-progress origin-left"})}):e==="dots"?jsxs("div",{className:l(a,o),...n,children:[jsxs("div",{className:"flex space-x-2",children:[jsx("div",{className:"h-3 w-3 rounded-full bg-blue-500 animate-bounce [animation-delay:-0.3s]"}),jsx("div",{className:"h-3 w-3 rounded-full bg-blue-500 animate-bounce [animation-delay:-0.15s]"}),jsx("div",{className:"h-3 w-3 rounded-full bg-blue-500 animate-bounce"})]}),t&&jsx("span",{className:"ml-4 text-sm font-medium text-gray-500 dark:text-white/70",children:t})]}):e==="logo"?jsx("div",{className:l(a,o),...n,children:jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center rounded-full bg-white dark:bg-white/[0.06] shadow-lg ring-1 ring-black/5",children:[jsx("div",{className:"absolute inset-0 rounded-full animate-ping bg-blue-500/20"}),jsx("div",{className:"h-8 w-8 rounded bg-blue-500"})]}),t&&jsx("span",{className:"text-sm font-medium text-gray-500 dark:text-white/70 animate-pulse",children:t})]})}):e==="glass"?jsx("div",{className:l(a,"bg-white/30 dark:bg-black/30 backdrop-blur-md",o),...n,children:jsxs("div",{className:"flex flex-col items-center gap-3",children:[jsx(Loader2,{className:"h-8 w-8 animate-spin text-white"}),t&&jsx("span",{className:"text-sm font-medium text-white tracking-wider",children:t})]})}):jsx("div",{className:l(a,o),...n,children:jsxs("div",{className:"flex flex-col items-center gap-3",children:[jsx(Loader2,{className:"h-8 w-8 animate-spin text-blue-500"}),t&&jsx("span",{className:"text-sm font-medium text-gray-500 dark:text-white/70",children:t})]})})}function ek({preset:e="fade",duration:t=300,useViewTransition:r=false,className:o,children:n,...a}){let[s,i]=useState(false);useEffect(()=>{if(r&&document.startViewTransition)document.startViewTransition(()=>{i(true);});else {let m=requestAnimationFrame(()=>{i(true);});return ()=>cancelAnimationFrame(m)}},[r]);let d={fade:{initial:"opacity-0",animate:"opacity-100"},"slide-up":{initial:"opacity-0 translate-y-8",animate:"opacity-100 translate-y-0"},scale:{initial:"opacity-0 scale-95",animate:"opacity-100 scale-100"},blur:{initial:"opacity-0 blur-sm",animate:"opacity-100 blur-0"},none:{initial:"",animate:""}}[e];return jsx("div",{className:l("transition-all ease-out",s?d.animate:d.initial,o),style:{transitionDuration:`${t}ms`,viewTransitionName:r?"page-content":void 0},...a,children:n})}var yd={sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-14 w-14 text-base",xl:"h-20 w-20 text-xl"},B=ve__default.forwardRef(({className:e,src:t,alt:r,fallback:o,size:n="md",...a},s)=>{let[i,c]=useState(false);return useEffect(()=>{c(false);},[t]),jsx("div",{ref:s,className:l("relative flex shrink-0 overflow-hidden rounded-full bg-gray-200 dark:bg-white/[0.06]",yd[n],e),...a,children:t&&!i?jsx("img",{src:t,alt:r,className:"aspect-square h-full w-full object-cover",onError:()=>c(true)}):jsx("div",{className:"flex h-full w-full items-center justify-center bg-gray-100 dark:bg-white/5 text-gray-600 dark:text-white/70 font-medium",children:o||(r?r.charAt(0).toUpperCase():"?")})})});B.displayName="Avatar";var Wo=createContext(void 0);function mk({type:e="single",defaultValue:t,value:r,onValueChange:o,className:n,children:a,...s}){let[i,c]=useState(t||(e==="multiple"?[]:"")),d=r!==void 0?r:i,m=u=>{let p;if(e==="multiple"){let g=Array.isArray(d)?d:[];g.includes(u)?p=g.filter(h=>h!==u):p=[...g,u];}else p=d===u?"":u;r===void 0&&c(p),o?.(p);};return jsx(Wo.Provider,{value:{value:d,onValueChange:m,type:e},children:jsx("div",{className:l("space-y-2",n),...s,children:a})})}var Yo=createContext({value:"",isOpen:false});function uk({className:e,value:t,children:r,...o}){let n=useContext(Wo),a=Array.isArray(n?.value)?n?.value.includes(t):n?.value===t;return jsx(Yo.Provider,{value:{value:t,isOpen:!!a},children:jsx("div",{className:l("overflow-hidden rounded-2xl border border-gray-200 dark:border-white/5 bg-gray-50 dark:bg-white/[0.03] transition-all duration-200",a&&"bg-white dark:bg-white/[0.04] border-gray-300 dark:border-white/10",e),...o,children:r})})}function pk({className:e,children:t,...r}){let o=useContext(Wo),{value:n,isOpen:a}=useContext(Yo);return jsxs("button",{type:"button",onClick:()=>o?.onValueChange(n),"aria-expanded":a,"aria-controls":`accordion-content-${n}`,id:`accordion-trigger-${n}`,className:l("flex w-full items-center justify-between px-4 py-3 text-sm font-medium text-gray-900 dark:text-white transition-all hover:text-gray-700 dark:hover:text-white/90 focus:outline-none",e),...r,children:[t,jsx(ChevronDown,{className:l("h-4 w-4 shrink-0 text-gray-400 dark:text-white/50 transition-transform duration-200",a&&"rotate-180 text-gray-900 dark:text-white")})]})}function fk({className:e,children:t,...r}){let{isOpen:o,value:n}=useContext(Yo);return o?jsx("div",{id:`accordion-content-${n}`,role:"region","aria-labelledby":`accordion-trigger-${n}`,className:l("px-4 pb-3 pt-0 text-sm text-gray-600 dark:text-white/70 animate-in slide-in-from-top-1 fade-in duration-200",e),...r,children:t}):null}ve__default.createContext(null);var vr=ve__default.forwardRef(({className:e,wrapperClassName:t,rounded:r=false,maxHeight:o,...n},a)=>jsx(at,{className:l("w-full",r&&"rounded-2xl border border-white/10",t),style:{maxHeight:o},orientation:o?"both":"horizontal",scrollbarSize:"sm",children:jsx("table",{ref:a,className:l("w-full caption-bottom text-sm text-left",e),...n})}));vr.displayName="Table";var wr=ve__default.forwardRef(({className:e,...t},r)=>jsx("thead",{ref:r,className:l("bg-white/[0.02] text-white/55",e),...t}));wr.displayName="TableHeader";var yr=ve__default.forwardRef(({className:e,...t},r)=>jsx("tbody",{ref:r,className:l("[&_tr:last-child]:border-0",e),...t}));yr.displayName="TableBody";var it=ve__default.forwardRef(({className:e,hoverable:t=true,optimized:r=false,...o},n)=>jsx("tr",{ref:n,className:l("border-t border-white/10 transition-colors data-[state=selected]:bg-white/[0.04]",t&&"hover:bg-white/[0.02]",e),style:r?{contentVisibility:"auto",containIntrinsicSize:"0 56px"}:void 0,...o}));it.displayName="TableRow";var Ze=ve__default.forwardRef(({className:e,...t},r)=>jsx("th",{ref:r,className:l("h-10 px-5 py-3 text-left align-middle font-semibold text-white/55 [&:has([role=checkbox])]:pr-0 whitespace-nowrap",e),...t}));Ze.displayName="TableHead";var Fe=ve__default.forwardRef(({className:e,...t},r)=>jsx("td",{ref:r,className:l("p-5 align-middle [&:has([role=checkbox])]:pr-0 text-white/85 whitespace-nowrap",e),...t}));Fe.displayName="TableCell";function Pk({data:e,columns:t,searchPlaceholder:r="Search...",searchKeys:o,onRowClick:n,className:a,maxHeight:s,rounded:i=true}){let[c,d]=useState(""),[m,u]=useState({key:"",direction:null}),p=useMemo(()=>{let h=[...e];return c&&o&&(h=h.filter(v=>o.some(b=>String(v[b]??"").toLowerCase().includes(c.toLowerCase())))),m.key&&m.direction&&h.sort((v,b)=>{let f=v[m.key],x=b[m.key];return f==null||x===void 0||x===null?0:f<x?m.direction==="asc"?-1:1:f>x?m.direction==="asc"?1:-1:0}),h},[e,c,o,m]),g=h=>{u(v=>({key:h,direction:v.key===h&&v.direction==="asc"?"desc":"asc"}));};return jsxs("div",{className:l("space-y-4",a),children:[o&&jsx("div",{className:"relative max-w-sm",children:jsx(vt,{placeholder:r,value:c,onChange:h=>d(h.target.value),leftIcon:jsx(Search,{className:"w-4 h-4 text-white/40"})})}),jsxs(vr,{rounded:i,maxHeight:s,children:[jsx(wr,{children:jsx(it,{children:t.map(h=>jsx(Ze,{className:l(h.sortable&&"cursor-pointer select-none hover:text-cyan-500 transition-colors",h.className),onClick:()=>h.sortable&&g(h.key),children:jsxs("div",{className:"flex items-center gap-2",children:[h.header,h.sortable&&jsx("span",{className:"text-white/30",children:m.key===h.key?m.direction==="asc"?jsx(ArrowUp,{className:"w-3 h-3 text-cyan-500"}):jsx(ArrowDown,{className:"w-3 h-3 text-cyan-500"}):jsx(ArrowUpDown,{className:"w-3 h-3"})})]})},String(h.key)))})}),jsxs(yr,{children:[p.map((h,v)=>jsx(it,{onClick:()=>n?.(h),className:l(n&&"cursor-pointer hover:bg-white/[0.03] transition-colors group"),children:t.map(b=>jsx(Fe,{className:b.className,children:b.render?b.render(h):h[b.key]},String(b.key)))},v)),p.length===0&&jsx(it,{children:jsxs(Fe,{colSpan:t.length,className:"h-32 text-center text-white/40",children:['No results found for "',c,'"']})})]})]})]})}var Xo=ve__default.forwardRef(({className:e,containerClassName:t,alt:r,src:o,fallback:n,onLoad:a,onError:s,...i},c)=>{let[d,m]=useState(true),[u,p]=useState(false),g=v=>{m(false),a?.(v);},h=v=>{m(false),p(true),s?.(v);};return u&&n?jsx(Fragment,{children:n}):jsxs("div",{className:l("relative overflow-hidden rounded-2xl bg-gray-100 dark:bg-white/[0.02] border border-gray-200 dark:border-white/10",t),children:[d&&jsx(Pn,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:c,src:o,alt:r,onLoad:g,onError:h,className:l("h-full w-full object-cover transition-opacity duration-300",d?"opacity-0":"opacity-100",e),...i})]})});Xo.displayName="Image";var Ad=cva("flex flex-col gap-4 rounded-2xl border p-4 transition-all duration-200",{variants:{variant:{default:"bg-white border-gray-200 dark:bg-white/[0.03] dark:border-white/10",glass:"backdrop-blur-md bg-white/80 border-white/20 dark:bg-black/40 dark:border-white/10"}},defaultVariants:{variant:"default"}}),Bd=ve__default.forwardRef(({className:e,variant:t,user:r,onFollow:o,onMessage:n,...a},s)=>jsxs("div",{ref:s,className:l(Ad({variant:t,className:e})),...a,children:[jsxs("div",{className:"flex items-start justify-between",children:[jsxs("div",{className:"flex gap-3",children:[jsx(B,{src:r.avatarSrc,alt:r.name,size:"lg"}),jsxs("div",{children:[jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:r.name}),r.role&&jsx("span",{className:"text-xs text-gray-500 dark:text-white/50",children:r.role}),r.email&&jsx("div",{className:"text-xs text-gray-400 dark:text-white/40 mt-0.5",children:r.email})]})]}),o&&jsx(L,{size:"sm",variant:"outline",onClick:o,children:"Follow"})]}),r.bio&&jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 line-clamp-2",children:r.bio}),r.stats&&jsx("div",{className:"flex gap-4 border-t border-gray-100 pt-3 dark:border-white/5",children:r.stats.map((i,c)=>jsxs("div",{className:"flex flex-col",children:[jsx("span",{className:"text-xs font-medium text-gray-900 dark:text-white",children:i.value}),jsx("span",{className:"text-[10px] text-gray-500 dark:text-white/40",children:i.label})]},c))}),n&&jsx(L,{className:"w-full mt-2",onClick:n,children:"Message"})]}));Bd.displayName="UserPreview";var zd=cva("relative pl-8 pb-8 last:pb-0",{variants:{status:{default:"[&>div:first-child]:bg-gray-200 dark:[&>div:first-child]:bg-white/20",active:"[&>div:first-child]:bg-blue-500",success:"[&>div:first-child]:bg-emerald-500",error:"[&>div:first-child]:bg-rose-500"}},defaultVariants:{status:"default"}}),Kd=ve__default.forwardRef(({className:e,status:t,title:r,date:o,description:n,icon:a,isLast:s,...i},c)=>jsxs("div",{ref:c,className:l(zd({status:t,className:e})),...i,children:[!s&&jsx("div",{className:"absolute left-[11px] top-[24px] bottom-0 w-px bg-gray-200 dark:bg-white/[0.06]"}),jsx("div",{className:l("absolute left-0 top-1.5 flex h-6 w-6 items-center justify-center rounded-full border-2 border-white dark:border-black ring-1 ring-transparent transition-colors",t==="active"?"bg-blue-500 ring-blue-500/30":t==="success"?"bg-emerald-500 ring-emerald-500/30":t==="error"?"bg-rose-500 ring-rose-500/30":"bg-gray-200 dark:bg-white/20"),children:a&&jsx("span",{className:"text-white text-[10px]",children:a})}),jsxs("div",{className:"flex flex-col gap-1",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:r}),o&&jsx("span",{className:"text-xs text-gray-500 dark:text-white/40",children:o})]}),n&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:n})]})]}));Kd.displayName="TimelineItem";var Xk=({children:e,className:t})=>jsx("div",{className:l("flex flex-col",t),children:e});var On=({node:e,depth:t=0,onSelect:r})=>{let[o,n]=useState(false),a=e.children&&e.children.length>0,s=i=>{i.stopPropagation(),a&&n(!o),r?.(e);};return jsxs("div",{children:[jsxs("div",{className:l("flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-gray-700 transition-colors hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-white/[0.03] cursor-pointer"),style:{paddingLeft:`${t*12+8}px`},onClick:s,children:[a?jsx("span",{className:"text-gray-400 dark:text-white/40",children:o?jsx(ChevronDown,{className:"h-4 w-4"}):jsx(ChevronRight,{className:"h-4 w-4"})}):jsx("span",{className:"w-4"}),e.icon?jsx("span",{className:"text-gray-500 dark:text-white/50",children:e.icon}):jsx("span",{className:"text-blue-500 dark:text-blue-400",children:a?o?jsx(FolderOpen,{className:"h-4 w-4"}):jsx(Folder,{className:"h-4 w-4"}):jsx(File,{className:"h-4 w-4"})}),jsx("span",{className:"truncate",children:e.label})]}),o&&a&&jsx("div",{className:"animate-in slide-in-from-top-1 fade-in duration-200",children:e.children.map(i=>jsx(On,{node:i,depth:t+1,onSelect:r},i.id))})]})},eN=({data:e,className:t,onSelect:r})=>jsx("div",{className:l("w-full select-none",t),children:e.map(o=>jsx(On,{node:o,onSelect:r},o.id))});function Vn({title:e,view:t="board",onViewChange:r,onFilter:o,onSort:n,onAddColumn:a,canUndo:s,canRedo:i,onUndo:c,onRedo:d,className:m}){let u=[{id:"board",icon:Layout,label:"Board"},{id:"list",icon:List,label:"List"},{id:"calendar",icon:Calendar,label:"Calendar"},{id:"timeline",icon:Clock,label:"Timeline"}];return jsxs("div",{className:l("flex items-center justify-between mb-8",m),children:[jsxs("div",{className:"flex items-center gap-6",children:[jsx("h1",{className:"text-2xl font-bold text-white tracking-tight",children:e}),jsx("div",{className:"flex items-center bg-white/5 rounded-xl p-1",children:u.map(p=>jsxs("button",{onClick:()=>r?.(p.id),className:l("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium transition-all",t===p.id?"bg-white/10 text-white shadow-lg":"text-white/40 hover:text-white/60"),children:[jsx(p.icon,{className:"h-3.5 w-3.5"}),p.label]},p.id))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("div",{className:"flex items-center gap-1 mr-2",children:[jsx(L,{variant:"ghost",size:"icon",onClick:c,disabled:!s,className:"h-8 w-8 text-white/40 disabled:opacity-20",children:jsx(Undo2,{className:"h-4 w-4"})}),jsx(L,{variant:"ghost",size:"icon",onClick:d,disabled:!i,className:"h-8 w-8 text-white/40 disabled:opacity-20",children:jsx(Redo2,{className:"h-4 w-4"})})]}),jsxs(L,{variant:"ghost",size:"sm",onClick:o,className:"gap-2 text-white/60",children:[jsx(Filter,{className:"h-4 w-4"}),"Filter"]}),jsxs(L,{variant:"ghost",size:"sm",onClick:n,className:"gap-2 text-white/60",children:[jsx(SortAsc,{className:"h-4 w-4"}),"Sort"]}),jsx("div",{className:"w-px h-4 bg-white/10 mx-2"}),jsxs(L,{size:"sm",onClick:a,className:"gap-2",children:[jsx(Plus,{className:"h-4 w-4"}),"Add Column"]}),jsx(L,{variant:"ghost",size:"icon",className:"h-9 w-9 text-white/40",children:jsx(MoreHorizontal,{className:"h-4 w-4"})})]})]})}function Kn({count:e,limit:t,className:r}){if(!t)return null;let o=e>t,n=Math.min(e/t*100,100);return jsxs("div",{className:l("flex items-center gap-3",r),children:[jsx("div",{className:"flex-1 h-1 bg-white/5 rounded-full overflow-hidden",children:jsx("div",{className:l("h-full transition-all duration-500",o?"bg-red-500":n>80?"bg-orange-500":"bg-blue-500"),style:{width:`${n}%`}})}),jsxs("div",{className:l("flex items-center gap-1.5 text-[10px] font-bold px-2 py-0.5 rounded-full",o?"bg-red-500/20 text-red-400":"bg-white/5 text-white/40"),children:[o&&jsx(AlertCircle,{className:"h-3 w-3"}),e,"/",t]})]})}var jo=ve__default.memo(({task:e,isSelected:t,showTimer:r,onEdit:o,onDelete:n,draggable:a=true,activeTimerTaskId:s,selectable:i,cardClassName:c,onTaskClick:d,onTaskSelectionChange:m,onTaskTimerToggle:u,onDragStart:p,onDragOver:g,onDrop:h,renderCard:v})=>{if(v)return jsx(Fragment,{children:v(e)});let b=f=>{switch(f){case "urgent":return "danger";case "high":return "warning";case "medium":return "info";case "low":return "success";default:return "neutral"}};return jsx(te,{onClick:f=>d?.(f,e),draggable:a,onDragStart:p,onDragOver:g,onDrop:h,className:l("p-6 border border-white/10 bg-white/[0.03] hover:bg-white/[0.06] transition-all duration-200 rounded-2xl group cursor-grab active:cursor-grabbing",e.blockedBy&&e.blockedBy.length>0&&"border-red-500/30 bg-red-500/[0.02]",t&&"ring-2 ring-cyan-500/50 bg-cyan-500/[0.02]",c),children:jsxs("div",{className:"flex flex-col gap-3",children:[jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i&&jsx(Lo,{checked:t,onChange:f=>{m?.(t?[]:[e.id]);},onClick:f=>f.stopPropagation(),className:"mr-1"}),e.blockedBy&&e.blockedBy.length>0&&jsx(Lock,{className:"h-3.5 w-3.5 text-red-500 flex-shrink-0"}),jsx(xe,{className:l("font-medium text-sm leading-tight group-hover:text-cyan-400 transition-colors truncate",e.blockedBy&&e.blockedBy.length>0&&"text-red-400/80"),children:e.title})]}),jsxs("div",{className:"flex items-center gap-1",children:[n&&jsx("button",{onClick:f=>{f.stopPropagation(),n(e.id);},className:"p-1 rounded-md hover:bg-red-500/20 text-white/20 hover:text-red-400 transition-colors",children:jsx(Trash2,{className:"h-3.5 w-3.5"})}),a&&jsx(GripVertical,{className:"h-4 w-4 text-white/20 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"})]})]}),e.description&&jsx(xe,{className:"text-xs text-white/50 line-clamp-2",children:e.description}),e.progress!==void 0&&jsxs("div",{className:"space-y-1.5",children:[jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[jsx("span",{className:"text-white/30 uppercase font-bold tracking-wider",children:"Progress"}),jsxs("span",{className:"text-white/50",children:[e.progress,"%"]})]}),jsx("div",{className:"h-1 w-full bg-white/[0.03] rounded-full overflow-hidden",children:jsx("div",{className:"h-full bg-cyan-500 transition-all duration-500",style:{width:`${e.progress}%`}})})]}),jsxs("div",{className:"flex flex-wrap gap-2 mt-1",children:[e.priority&&jsx(Oe,{variant:b(e.priority),className:"text-[10px] px-1.5 py-0 uppercase font-bold",children:e.priority}),e.tags?.map(f=>jsx(Oe,{variant:"neutral",className:"text-[10px] px-1.5 py-0 bg-white/[0.03] border-white/5",children:f},f))]}),jsxs("div",{className:"flex items-center justify-between mt-2 pt-3 border-t border-white/5",children:[jsxs("div",{className:"flex items-center gap-3 text-[10px] text-white/30",children:[e.timeSpent!==void 0&&jsxs("div",{className:l("flex items-center gap-1 px-1.5 py-0.5 rounded-md transition-colors",s===e.id?"bg-cyan-500/20 text-cyan-400":"bg-white/[0.03]"),children:[s===e.id?jsx(Pause,{className:"h-2.5 w-2.5 cursor-pointer hover:scale-110 transition-transform",onClick:f=>{f.stopPropagation(),u?.(e.id);}}):jsx(Play,{className:"h-2.5 w-2.5 cursor-pointer hover:scale-110 transition-transform",onClick:f=>{f.stopPropagation(),u?.(e.id);}}),jsxs("span",{className:"font-mono",children:[Math.floor(e.timeSpent/3600),"h ",Math.floor(e.timeSpent%3600/60),"m"]})]}),e.comments!==void 0&&jsxs("div",{className:"flex items-center gap-1",children:[jsx(MessageSquare,{className:"h-3 w-3"}),e.comments]}),e.attachments!==void 0&&jsxs("div",{className:"flex items-center gap-1",children:[jsx(Paperclip,{className:"h-3 w-3"}),e.attachments]}),e.dueDate&&jsxs("div",{className:"flex items-center gap-1",children:[jsx(Clock,{className:"h-3 w-3"}),e.dueDate]})]}),e.assignee&&jsx("div",{className:"flex -space-x-2",children:jsx("div",{className:"h-6 w-6 rounded-full border-2 border-[#0a0a0a] bg-white/[0.06] flex items-center justify-center text-[10px] font-bold overflow-hidden",children:e.assignee.avatar?jsx("img",{src:e.assignee.avatar,alt:e.assignee.name,className:"h-full w-full object-cover"}):e.assignee.name[0]})})]})]})})});jo.displayName="KanbanCard";function Qo({column:e,tasks:t,onAddTask:r,onCollapse:o,onTaskClick:n,onAction:a,onDragStart:s,onDragOver:i,onDrop:c,isCollapsed:d,children:m,className:u}){return jsxs("div",{className:l("flex flex-col h-full transition-all duration-300",d?"w-12":"w-80",u),onDragOver:p=>i?.(p),onDrop:p=>c?.(p),onDragStart:p=>s?.(p,e.id,"column"),draggable:!d,children:[jsxs("div",{className:l("flex items-center justify-between mb-4 px-2",d&&"flex-col gap-4"),children:[jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[jsx("button",{onClick:()=>o?.(e.id),className:"p-1 rounded hover:bg-white/5 text-white/40",children:d?jsx(ChevronRight,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"})}),!d&&jsxs(Fragment,{children:[jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:e.color||"#3b82f6"}}),jsx("h3",{className:"font-bold text-sm text-white truncate",children:e.title}),jsx("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded-md bg-white/5 text-white/40",children:t.length})]})]}),!d&&jsxs("div",{className:"flex items-center gap-1",children:[jsx(L,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white/40 hover:text-white",onClick:()=>r?.(e.id),children:jsx(Plus,{className:"h-4 w-4"})}),jsx(L,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white/40 hover:text-white",onClick:()=>a?.("more"),children:jsx(MoreVertical,{className:"h-4 w-4"})})]})]}),!d&&e.limit&&jsx("div",{className:"px-2 mb-4",children:jsx(Kn,{count:t.length,limit:e.limit})}),jsx("div",{className:l("flex-1 overflow-y-auto min-h-0 px-2 space-y-3 custom-scrollbar",d&&"hidden"),children:m||t.map(p=>jsx(jo,{task:p,onTaskClick:(g,h)=>n?.(h),onDragStart:g=>s?.(g,p.id,"task"),onDragOver:g=>i?.(g,p.id),onDrop:g=>c?.(g,p.id)},p.id))}),d&&jsx("div",{className:"flex-1 flex items-center justify-center",children:jsx("span",{className:"rotate-90 whitespace-nowrap text-[10px] font-bold uppercase tracking-widest text-white/20",children:e.title})})]})}function to({tasks:e,columns:t,onTaskClick:r,className:o}){let n=a=>t.find(s=>s.id===a);return jsx("div",{className:l("bg-white/[0.02] border border-white/5 rounded-2xl overflow-hidden",o),children:jsxs(vr,{children:[jsx(wr,{children:jsxs(it,{className:"hover:bg-transparent border-white/5",children:[jsx(Ze,{className:"text-white/40 uppercase text-[10px] font-bold",children:"Task"}),jsx(Ze,{className:"text-white/40 uppercase text-[10px] font-bold",children:"Status"}),jsx(Ze,{className:"text-white/40 uppercase text-[10px] font-bold",children:"Priority"}),jsx(Ze,{className:"text-white/40 uppercase text-[10px] font-bold",children:"Assignee"}),jsx(Ze,{className:"text-white/40 uppercase text-[10px] font-bold",children:"Due Date"})]})}),jsx(yr,{children:e.map(a=>{let s=n(a.columnId);return jsxs(it,{className:"border-white/5 hover:bg-white/[0.03] cursor-pointer transition-colors",onClick:()=>r?.(a),children:[jsx(Fe,{className:"font-medium text-white",children:a.title}),jsx(Fe,{children:jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:s?.color||"#3b82f6"}}),jsx("span",{className:"text-xs text-white/60",children:s?.title})]})}),jsx(Fe,{children:jsx(Oe,{variant:a.priority==="urgent"?"danger":a.priority==="high"?"warning":"info",className:"text-[10px] uppercase",children:a.priority||"medium"})}),jsx(Fe,{children:a.assignee&&jsxs("div",{className:"flex items-center gap-2",children:[jsx(B,{src:a.assignee.avatar,alt:a.assignee.name,size:"sm"}),jsx("span",{className:"text-xs text-white/60",children:a.assignee.name})]})}),jsx(Fe,{className:"text-xs text-white/40",children:a.dueDate?new Date(a.dueDate).toLocaleDateString():"-"})]},a.id)})})]})})}function Fn({tasks:e,className:t}){return jsxs("div",{className:l("p-8 bg-white/[0.02] border border-white/5 rounded-2xl flex flex-col items-center justify-center min-h-[400px]",t),children:[jsx("div",{className:"h-12 w-12 rounded-full bg-blue-500/10 flex items-center justify-center mb-4",children:jsx("div",{className:"h-6 w-6 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"})}),jsx("h3",{className:"text-lg font-bold text-white mb-2",children:"Timeline View"}),jsxs("p",{className:"text-sm text-white/40 text-center max-w-xs",children:["The timeline view is currently being optimized for high-performance rendering of ",e.length," tasks."]})]})}function Un({tasks:e,columns:t,onTaskClick:r,className:o}){return jsx(to,{tasks:e,columns:t,onTaskClick:r,className:o})}function Wn({tasks:e,onTaskClick:t,onAddTask:r,className:o}){let[n,a]=useState(new Date),s=(f,x)=>new Date(f,x+1,0).getDate(),i=(f,x)=>new Date(f,x,1).getDay(),c=n.getFullYear(),d=n.getMonth(),m=s(c,d),u=i(c,d),p=()=>a(new Date(c,d-1,1)),g=()=>a(new Date(c,d+1,1)),h=["January","February","March","April","May","June","July","August","September","October","November","December"],v=[];for(let f=0;f<u;f++)v.push(null);for(let f=1;f<=m;f++)v.push(new Date(c,d,f));let b=f=>e.filter(x=>{if(!x.dueDate)return false;let w=new Date(x.dueDate);return w.getDate()===f.getDate()&&w.getMonth()===f.getMonth()&&w.getFullYear()===f.getFullYear()});return jsxs("div",{className:l("flex flex-col h-full",o),children:[jsxs("div",{className:"flex items-center justify-between mb-6",children:[jsxs("div",{className:"flex items-center gap-4",children:[jsxs(Tm,{level:3,className:"text-white",children:[h[d]," ",c]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx(L,{variant:"ghost",size:"sm",onClick:p,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(L,{variant:"ghost",size:"sm",onClick:g,children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]}),jsx(L,{variant:"ghost",size:"sm",onClick:()=>a(new Date),children:"Today"})]}),jsxs("div",{className:"grid grid-cols-7 gap-px bg-white/5 border border-white/5 rounded-2xl overflow-hidden flex-1",children:[["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(f=>jsx("div",{className:"bg-white/[0.02] p-3 text-center",children:jsx(xe,{size:"xs",className:"text-white/40 font-medium uppercase tracking-wider",children:f})},f)),v.map((f,x)=>jsx("div",{className:l("bg-gray-900/50 min-h-[120px] p-2 group transition-colors hover:bg-white/[0.02]",!f&&"bg-transparent"),children:f&&jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("span",{className:l("text-xs font-medium w-6 h-6 flex items-center justify-center rounded-full",f.toDateString()===new Date().toDateString()?"bg-blue-500 text-white":"text-white/40"),children:f.getDate()}),jsx("button",{onClick:()=>r?.(f),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-white/10 rounded-lg transition-all",children:jsx(Plus,{className:"h-3 w-3 text-white/40"})})]}),jsx("div",{className:"space-y-1",children:b(f).map(w=>jsx("div",{onClick:()=>t?.(w),className:"px-2 py-1 rounded-lg bg-blue-500/10 border border-blue-500/20 cursor-pointer hover:bg-blue-500/20 transition-all",children:jsx(xe,{size:"xs",className:"text-blue-400 truncate",children:w.title})},w.id))})]})},x))]})]})}function Tm({children:e,level:t,className:r}){let o=`h${t}`;return jsx(o,{className:l("font-semibold",r),children:e})}function Yn({children:e,...t}){return jsx("div",{className:"flex h-full w-full flex-col overflow-hidden rounded-2xl bg-white dark:bg-black/90 text-gray-900 dark:text-white",children:jsx(Ho,{usePopover:false,...t,children:e})})}function t1({children:e,open:t,onOpenChange:r,...o}){let n=useRef(null);useEffect(()=>{let s=i=>{i.key==="Escape"&&r(false);};return t&&(document.addEventListener("keydown",s),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",s),document.body.style.overflow="unset";}},[t,r]);let a=s=>{s.target===n.current&&r(false);};return t?createPortal(jsx("div",{ref:n,onClick:a,className:"fixed inset-0 z-[100] flex items-start justify-center bg-black/60 backdrop-blur-sm animate-in fade-in duration-200 pt-[20vh]",children:jsx("div",{className:"relative w-full max-w-lg overflow-hidden rounded-2xl border border-gray-200 dark:border-white/10 bg-white dark:bg-black/90 shadow-2xl animate-in zoom-in-95 duration-200",children:jsx(Ho,{usePopover:false,...o,children:e})})}),document.body):null}function _n({className:e,...t}){return jsxs("div",{className:"flex items-center border-b border-gray-200 dark:border-white/10 px-3","cmdk-input-wrapper":"",children:[jsx(Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),jsx(un,{className:l("flex h-12 w-full rounded-md bg-transparent py-3 text-sm text-gray-900 dark:text-white outline-none placeholder:text-gray-400 dark:placeholder:text-white/50 disabled:cursor-not-allowed disabled:opacity-50 border-none focus:ring-0 px-0",e),...t})]})}function Xn({className:e,...t}){return jsx(pn,{className:l("max-h-[300px] overflow-y-auto overflow-x-hidden p-2",e),...t})}function r1(e){return jsx(fn,{className:"py-6 text-center text-sm",...e})}function qn({children:e,heading:t,className:r,...o}){return jsxs("div",{className:l("overflow-hidden p-1 text-gray-900 dark:text-white",r),...o,children:[t&&jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-gray-500 dark:text-white/50",children:t}),e]})}function Gn({className:e,...t}){return jsx(gn,{className:l("relative flex cursor-default select-none items-center rounded-2xl px-2 py-1.5 text-sm outline-none text-gray-900 dark:text-white aria-selected:bg-gray-100 dark:aria-selected:bg-white/[0.06] aria-selected:text-gray-900 dark:aria-selected:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t})}function o1({className:e,...t}){return jsx("span",{className:l("ml-auto text-xs tracking-widest text-gray-400 dark:text-white/50",e),...t})}function Qn({onSearchChange:e,onFilterChange:t,onSortChange:r,onViewChange:o,onGroupChange:n,priorityOptions:a=[],tagOptions:s=[],assigneeOptions:i=[],viewOptions:c=["board","list","calendar","timeline"],sortOptions:d=[],groupOptions:m=[],savedFilters:u=[],onSaveFilter:p,className:g}){let[h,v]=useState(""),[b,f]=useState({}),[x,w]=useState("board"),k=(C,N)=>{let R=b[C]||[],H=R.includes(N)?R.filter(D=>D!==N):[...R,N],E={...b,[C]:H};H.length===0&&delete E[C],f(E),t?.(E);},y=()=>{f({}),t?.({}),v(""),e?.("");},T=Object.values(b).flat().length;return jsxs(te,{className:l("p-2 flex flex-wrap items-center gap-3 bg-white/[0.02] border-white/5",g),children:[jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[jsx(Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-white/20"}),jsx("input",{type:"text",placeholder:"Search tasks...",className:"w-full pl-10 pr-4 py-2 text-sm rounded-2xl border border-white/10 bg-white/[0.03] focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all placeholder:text-white/20 text-white",value:h,onChange:C=>{v(C.target.value),e?.(C.target.value);}})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(ea,{label:"Priority",options:a,selected:b.priority||[],onSelect:C=>k("priority",C)}),jsx(ea,{label:"Tags",options:s,selected:b.tags||[],onSelect:C=>k("tags",C)}),jsx(ea,{label:"Assignee",options:i,selected:b.assignee||[],onSelect:C=>k("assignee",C)}),jsx("div",{className:"w-px h-4 bg-white/10 mx-1"}),jsxs(je,{children:[jsx(Qe,{children:jsxs(L,{variant:"ghost",size:"sm",className:"h-9 gap-2 text-white/60",children:[jsx(SortAsc,{className:"h-4 w-4"}),"Sort"]})}),jsx(Je,{className:"w-48 p-1 bg-gray-900 border-white/10",children:d.map(C=>jsx("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-white/60 hover:text-white hover:bg-white/5 rounded-lg text-left",onClick:()=>r?.(C.value,"asc"),children:C.label},C.value))})]}),T>0&&jsxs(L,{variant:"ghost",size:"sm",onClick:y,className:"h-9 px-3 text-xs text-white/40 hover:text-white gap-2",children:[jsx(X$1,{className:"h-3.5 w-3.5"})," Clear",jsx(Oe,{variant:"neutral",className:"bg-white/[0.06] border-white/10 ml-1",children:T})]})]})]})}function ea({label:e,options:t,selected:r,onSelect:o}){return jsxs(je,{children:[jsx(Qe,{children:jsxs(L,{variant:"ghost",size:"sm",className:l("h-9 gap-2 text-xs transition-all",r.length>0?"bg-blue-500/10 text-blue-400":"text-white/60 hover:text-white"),children:[e,r.length>0?jsx(Oe,{variant:"info",className:"h-4 min-w-[16px] px-1 bg-blue-500 text-white border-none",children:r.length}):jsx(ChevronDown,{className:"h-3.5 w-3.5 opacity-40"})]})}),jsx(Je,{className:"w-56 p-0 bg-gray-900 border-white/10 shadow-2xl",children:jsxs(Yn,{children:[jsx(_n,{placeholder:`Search ${e.toLowerCase()}...`,className:"border-none"}),jsx(Xn,{className:"max-h-[240px]",children:jsx(qn,{children:t.map(n=>jsxs(Gn,{value:n.value,onClick:()=>o(n.value),className:"flex items-center justify-between py-2 px-3 cursor-pointer hover:bg-white/5",children:[jsx("span",{className:"text-xs text-white/80",children:n.label}),r.includes(n.value)&&jsx(Check,{className:"h-3.5 w-3.5 text-blue-500"})]},n.value))})})]})})]})}function ro({isOpen:e,onClose:t,children:r,className:o}){let n=useRef(null),[a,s]=ve__default.useState(false);useEffect(()=>{s(true);},[]),useEffect(()=>{let c=n.current;c&&(e?c.open||(c.showModal(),document.body.style.overflow="hidden"):c.open&&(c.close(),document.body.style.overflow="unset"));},[e,a]),useEffect(()=>{let c=n.current;if(!c)return;let d=m=>{m.preventDefault(),t();};return c.addEventListener("cancel",d),()=>c.removeEventListener("cancel",d)},[t,a]);let i=c=>{c.target===n.current&&t();};return a?createPortal(jsx("dialog",{ref:n,onClick:i,className:l("fixed inset-0 z-[100] bg-transparent p-0 backdrop:bg-black/60 backdrop:backdrop-blur-sm open:grid open:place-items-center","animate-in fade-in duration-200",o),children:jsxs("div",{className:l("relative w-full max-w-lg scale-100 gap-4 border border-gray-200 dark:border-white/10 bg-white dark:bg-[#0A0A0A]/90 p-6 shadow-2xl backdrop-blur-xl transition-all sm:rounded-2xl","animate-in fade-in zoom-in-95 duration-200 slide-in-from-bottom-2"),children:[r,jsxs("button",{onClick:t,className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/20 disabled:pointer-events-none",children:[jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-900 dark:text-white",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),jsx("span",{className:"sr-only",children:"Close"})]})]})}),document.body):null}function oo({className:e,children:t}){return jsx("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left mb-4",e),children:t})}function ao({className:e,children:t}){return jsx("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-6",e),children:t})}function Jn({className:e,children:t}){return jsx(Ge,{as:"h2",className:l("text-lg font-semibold leading-none tracking-tight",e),children:t})}function R1({className:e,children:t}){return jsx(xe,{variant:"muted",className:l("text-sm",e),children:t})}function Zn({items:e,onToggle:t,className:r}){if(!e||e.length===0)return null;let o=e.filter(a=>a.completed).length,n=o/e.length*100;return jsxs("div",{className:l("space-y-3",r),children:[jsxs("div",{className:"flex items-center justify-between text-[10px] text-white/40 uppercase tracking-wider font-bold",children:[jsx("span",{children:"Checklist"}),jsxs("span",{children:[o,"/",e.length]})]}),jsx("div",{className:"h-1 w-full bg-white/5 rounded-full overflow-hidden",children:jsx("div",{className:"h-full bg-blue-500 transition-all duration-500",style:{width:`${n}%`}})}),jsx("div",{className:"space-y-2",children:e.map(a=>jsxs("div",{className:"flex items-center gap-2 group cursor-pointer",onClick:()=>t?.(a.id),children:[a.completed?jsx(CheckSquare,{className:"h-4 w-4 text-blue-500"}):jsx(Square,{className:"h-4 w-4 text-white/20 group-hover:text-white/40"}),jsx("span",{className:l("text-sm transition-colors",a.completed?"text-white/40 line-through":"text-white/80"),children:a.title})]},a.id))})]})}function es({comments:e,onAddComment:t,className:r}){let[o,n]=useState(""),a=()=>{o.trim()&&(t?.(o),n(""));};return jsxs("div",{className:l("space-y-6",r),children:[jsx("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold",children:"Comments"}),jsx("div",{className:"flex gap-3",children:jsxs("div",{className:"flex-1",children:[jsx(gr,{placeholder:"Write a comment...",value:o,onChange:s=>n(s.target.value),className:"min-h-[80px] bg-white/[0.03] border-white/10 text-sm"}),jsx("div",{className:"flex justify-end mt-2",children:jsxs(L,{size:"sm",onClick:a,disabled:!o.trim(),className:"gap-2",children:[jsx(Send,{className:"h-3.5 w-3.5"}),"Comment"]})})]})}),jsx("div",{className:"space-y-6",children:e.map(s=>jsxs("div",{className:"flex gap-3",children:[jsx(B,{src:s.user.avatar,alt:s.user.name,size:"sm"}),jsxs("div",{className:"flex-1 bg-white/[0.03] border border-white/5 rounded-2xl p-3",children:[jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsx("span",{className:"text-xs font-bold text-white",children:s.user.name}),jsx("span",{className:"text-[10px] text-white/30",children:s.timestamp.toLocaleString()})]}),jsx("p",{className:"text-sm text-white/70 leading-relaxed",children:s.content})]})]},s.id))})]})}function ts({attachments:e,onRemove:t,onDownload:r,className:o}){return jsxs("div",{className:l("space-y-4",o),children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold",children:"Attachments"}),jsxs(L,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-white/40 hover:text-white",children:[jsx(Paperclip,{className:"h-3 w-3"}),"Add"]})]}),jsx("div",{className:"grid grid-cols-2 gap-3",children:e.map(n=>jsxs("div",{className:"group relative bg-white/[0.03] border border-white/5 rounded-xl overflow-hidden hover:border-white/20 transition-all",children:[n.thumbnail?jsx("div",{className:"aspect-video w-full overflow-hidden",children:jsx("img",{src:n.thumbnail,alt:n.name,className:"w-full h-full object-cover"})}):jsx("div",{className:"aspect-video w-full flex items-center justify-center bg-white/5",children:jsx(FileIcon,{className:"h-8 w-8 text-white/20"})}),jsxs("div",{className:"p-2",children:[jsx("p",{className:"text-xs font-medium text-white truncate",children:n.name}),jsx("p",{className:"text-[10px] text-white/30 uppercase",children:n.size})]}),jsxs("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:[jsx(L,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full bg-white/10 hover:bg-white/20",onClick:()=>r?.(n),children:jsx(Download,{className:"h-4 w-4"})}),jsx(L,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full bg-red-500/20 hover:bg-red-500/40 text-red-400",onClick:()=>t?.(n.id),children:jsx(X$1,{className:"h-4 w-4"})})]})]},n.id))})]})}function rs({labels:e,selectedIds:t,onToggle:r,className:o}){return jsxs("div",{className:l("space-y-3",o),children:[jsxs("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold flex items-center gap-2",children:[jsx(Tag,{className:"h-3 w-3"}),"Labels"]}),jsx("div",{className:"flex flex-wrap gap-2",children:e.map(n=>{let a=t.includes(n.id);return jsxs("button",{onClick:()=>r(n.id),className:l("px-3 py-1.5 rounded-full text-xs font-medium transition-all flex items-center gap-2 border",a?"bg-white/10 border-white/20 text-white":"bg-transparent border-white/5 text-white/40 hover:border-white/10"),children:[jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.color}}),n.name,a&&jsx(Check,{className:"h-3 w-3"})]},n.id)})})]})}function os({users:e,selectedId:t,onSelect:r,className:o}){return jsxs("div",{className:l("space-y-3",o),children:[jsxs("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold flex items-center gap-2",children:[jsx(Users,{className:"h-3 w-3"}),"Assignee"]}),jsx("div",{className:"grid grid-cols-1 gap-1",children:e.map(n=>{let a=t===n.id;return jsxs("button",{onClick:()=>r(n.id),className:l("flex items-center gap-3 p-2 rounded-xl transition-all text-left",a?"bg-white/10 text-white":"text-white/60 hover:bg-white/5"),children:[jsx(B,{src:n.avatar,alt:n.name,size:"sm"}),jsx("span",{className:"text-sm flex-1 truncate",children:n.name}),a&&jsx(Check,{className:"h-4 w-4 text-blue-500"})]},n.id)})})]})}function ns({date:e,onChange:t,className:r}){return jsxs("div",{className:l("space-y-3",r),children:[jsxs("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold flex items-center gap-2",children:[jsx(Calendar,{className:"h-3 w-3"}),"Due Date"]}),e?jsxs("div",{className:"flex items-center gap-2 p-3 rounded-2xl bg-white/5 border border-white/10",children:[jsx("div",{className:"h-8 w-8 rounded-lg bg-blue-500/20 flex items-center justify-center text-blue-400",children:jsx(Clock,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1",children:[jsx("p",{className:"text-sm font-medium text-white",children:e.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}),jsx("p",{className:"text-[10px] text-white/40",children:e.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]}),jsx(L,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white/20 hover:text-red-400",onClick:()=>t(void 0),children:jsx(X$1,{className:"h-4 w-4"})})]}):jsxs(L,{variant:"ghost",className:"w-full justify-start gap-3 h-12 rounded-2xl border border-dashed border-white/10 text-white/40 hover:border-white/20 hover:bg-white/5",onClick:()=>t(new Date),children:[jsx(Calendar,{className:"h-4 w-4"}),"Set due date"]})]})}function is({initialSeconds:e=0,onTimeUpdate:t,className:r}){let[o,n]=useState(e),[a,s]=useState(false);useEffect(()=>{let c=null;return a?c=setInterval(()=>{n(d=>{let m=d+1;return t?.(m),m});},1e3):clearInterval(c),()=>clearInterval(c)},[a,t]);let i=c=>{let d=Math.floor(c/3600),m=Math.floor(c%3600/60),u=c%60;return `${d.toString().padStart(2,"0")}:${m.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}`};return jsxs("div",{className:l("space-y-3",r),children:[jsxs("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold flex items-center gap-2",children:[jsx(Timer,{className:"h-3 w-3"}),"Time Tracking"]}),jsxs("div",{className:"flex items-center gap-4 p-4 rounded-2xl bg-white/[0.03] border border-white/5",children:[jsxs("div",{className:"flex-1",children:[jsx("p",{className:"text-2xl font-mono font-bold text-white tracking-tight",children:i(o)}),jsx("p",{className:"text-[10px] text-white/30 uppercase font-bold mt-1",children:"Total Time Spent"})]}),jsxs("div",{className:"flex gap-2",children:[jsx(L,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-full bg-white/5 hover:bg-white/10",onClick:()=>n(0),children:jsx(RotateCcw,{className:"h-4 w-4"})}),jsx(L,{variant:a?"secondary":"primary",size:"icon",className:l("h-10 w-10 rounded-full shadow-lg transition-all",a?"bg-orange-500 hover:bg-orange-600":"bg-blue-600 hover:bg-blue-700"),onClick:()=>s(!a),children:a?jsx(Pause,{className:"h-4 w-4"}):jsx(Play,{className:"h-4 w-4 ml-0.5"})})]})]})]})}function ls({isOpen:e,onClose:t,onSave:r,onDelete:o,onDuplicate:n,onArchive:a,task:s,columnId:i,columns:c=[],users:d=[],availableLabels:m=[],showSubtasks:u=true,showChecklist:p=true,showAttachments:g=true,showComments:h=true,showActivity:v=true}){let[b,f]=useState(""),[x,w]=useState(""),[k,y]=useState("medium"),[T,C]=useState(""),[N,R]=useState(void 0),[H,E]=useState([]),[D,I]=useState(void 0);useEffect(()=>{s?(f(s.title||""),w(s.description||""),y(s.priority||"medium"),C(s.columnId||""),R(s.assignee?.id),E(s.labels?.map(M=>M.id)||[]),I(s.dueDate?new Date(s.dueDate):void 0)):(f(""),w(""),y("medium"),C(i||""),R(void 0),E([]),I(void 0));},[s,e,i]);let P=()=>{b.trim()&&(r({...s,title:b,description:x,priority:k,columnId:T,assignee:d.find(M=>M.id===N),labels:m.filter(M=>H.includes(M.id)),dueDate:D?.toISOString()}),t());};return jsxs(ro,{isOpen:e,onClose:t,children:[jsxs(oo,{className:"flex items-center justify-between pr-12",children:[jsx(Jn,{children:s?"Edit Task":"Create New Task"}),jsx("div",{className:"flex items-center gap-2",children:s&&jsxs(Fragment,{children:[jsx(L,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white/40 hover:text-white",onClick:()=>n?.(s),children:jsx(Copy,{className:"h-4 w-4"})}),jsx(L,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white/40 hover:text-white",onClick:()=>a?.(s.id),children:jsx(Archive,{className:"h-4 w-4"})}),jsx(L,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white/40 hover:text-red-400",onClick:()=>o?.(s.id),children:jsx(Trash2,{className:"h-4 w-4"})})]})})]}),jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8 py-6",children:[jsxs("div",{className:"lg:col-span-2 space-y-8",children:[jsxs("div",{className:"space-y-2",children:[jsx(U,{htmlFor:"task-title",className:"text-[10px] uppercase tracking-wider text-white/40 font-bold",children:"Title"}),jsx(vt,{id:"task-title",placeholder:"What needs to be done?",value:b,onChange:M=>f(M.target.value),className:"text-lg font-bold bg-transparent border-white/10 focus:border-blue-500",autoFocus:true})]}),jsxs("div",{className:"space-y-2",children:[jsx(U,{htmlFor:"task-desc",className:"text-[10px] uppercase tracking-wider text-white/40 font-bold",children:"Description"}),jsx(gr,{id:"task-desc",placeholder:"Add more details...",value:x,onChange:M=>w(M.target.value),rows:6,className:"bg-white/[0.03] border-white/10 text-sm leading-relaxed"})]}),p&&s?.checklist&&jsx(Zn,{items:s.checklist}),g&&s?.attachments&&jsx(ts,{attachments:[]}),h&&jsx(es,{comments:[]})]}),jsxs("div",{className:"space-y-8 bg-white/[0.02] p-6 rounded-3xl border border-white/5 h-fit",children:[jsxs("div",{className:"space-y-2",children:[jsx(U,{className:"text-[10px] uppercase tracking-wider text-white/40 font-bold",children:"Status"}),jsx(Wr,{value:T,onChange:M=>C(M),options:c.map(M=>({label:M.title,value:M.id})),className:"bg-white/5 border-white/10"})]}),jsxs("div",{className:"space-y-2",children:[jsx(U,{className:"text-[10px] uppercase tracking-wider text-white/40 font-bold",children:"Priority"}),jsx(Wr,{value:k,onChange:M=>y(M),options:[{label:"Low",value:"low"},{label:"Medium",value:"medium"},{label:"High",value:"high"},{label:"Urgent",value:"urgent"}],className:"bg-white/5 border-white/10"})]}),jsx(os,{users:d,selectedId:N,onSelect:R}),jsx(rs,{labels:m,selectedIds:H,onToggle:M=>E(G=>G.includes(M)?G.filter(se=>se!==M):[...G,M])}),jsx(ns,{date:D,onChange:I}),jsx(is,{initialSeconds:s?.timeSpent})]})]}),jsxs(ao,{className:"border-t border-white/5 pt-6",children:[jsx(L,{variant:"ghost",onClick:t,children:"Cancel"}),jsx(L,{onClick:P,className:"px-8",children:"Save Changes"})]})]})}function cs({title:e,count:t,isCollapsed:r,onToggle:o,children:n,className:a}){return jsxs("div",{className:l("space-y-4",a),children:[jsxs("button",{onClick:o,className:"flex items-center gap-3 w-full group",children:[jsxs("div",{className:"flex items-center gap-2",children:[r?jsx(ChevronRight,{className:"h-4 w-4 text-white/20"}):jsx(ChevronDown,{className:"h-4 w-4 text-white/20"}),jsx("h4",{className:"text-xs font-bold uppercase tracking-widest text-white/40 group-hover:text-white/60 transition-colors",children:e})]}),jsx("div",{className:"h-px flex-1 bg-white/5"}),jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-white/5 text-white/20",children:t})]}),!r&&jsx("div",{className:"animate-in fade-in slide-in-from-top-2 duration-300",children:n})]})}function us(e){let[t,r]=useState(""),[o,n]=useState({}),a=useMemo(()=>e.filter(c=>{if(t){let d=t.toLowerCase();if(!(c.title.toLowerCase().includes(d)||c.description?.toLowerCase().includes(d)||c.tags?.some(u=>u.toLowerCase().includes(d))))return false}for(let[d,m]of Object.entries(o))if(!(!m||m.length===0)&&(d==="priority"&&!m.includes(c.priority)||d==="assignee"&&(!c.assignee||!m.includes(c.assignee.id))||d==="tags"&&!c.tags?.some(u=>m.includes(u))))return false;return true}),[e,t,o]),s=useCallback((c,d)=>{n(m=>{let u=m[c]||[],p=u.includes(d)?u.filter(h=>h!==d):[...u,d],g={...m,[c]:p};return p.length===0&&delete g[c],g});},[]),i=useCallback(()=>{n({}),r("");},[]);return {searchQuery:t,setSearchQuery:r,activeFilters:o,setActiveFilters:n,filteredTasks:a,toggleFilter:s,clearFilters:i}}function ps(e){let[t,r]=useState({history:[e],currentIndex:0}),o=useRef(e);useEffect(()=>{let i=e.tasks.length!==o.current.tasks.length||e.tasks.some((d,m)=>d.id!==o.current.tasks[m]?.id||d.columnId!==o.current.tasks[m]?.columnId),c=e.columns.length!==o.current.columns.length||e.columns.some((d,m)=>d.id!==o.current.columns[m]?.id);if(i||c){let d=t.history[t.currentIndex];d&&e.tasks.length===d.tasks.length&&e.tasks.every((u,p)=>u.id===d.tasks[p]?.id&&u.columnId===d.tasks[p]?.columnId)||r({history:[e],currentIndex:0}),o.current=e;}},[e,t.history,t.currentIndex]);let n=useCallback(i=>{r(c=>({history:[...c.history.slice(0,c.currentIndex+1),i],currentIndex:c.currentIndex+1}));},[]),a=useCallback(()=>{r(i=>i.currentIndex>0?{...i,currentIndex:i.currentIndex-1}:i);},[]),s=useCallback(()=>{r(i=>i.currentIndex<i.history.length-1?{...i,currentIndex:i.currentIndex+1}:i);},[]);return {state:t.history[t.currentIndex],pushState:n,undo:a,redo:s,canUndo:t.currentIndex>0,canRedo:t.currentIndex<t.history.length-1}}function fs({onUndo:e,onRedo:t,onSearch:r,onNewTask:o,onNewColumn:n,enabled:a=true}){useEffect(()=>{if(!a)return;let s=i=>{(i.ctrlKey||i.metaKey)&&i.key==="z"&&!i.shiftKey&&(i.preventDefault(),e?.()),((i.ctrlKey||i.metaKey)&&i.key==="z"&&i.shiftKey||(i.ctrlKey||i.metaKey)&&i.key==="y")&&(i.preventDefault(),t?.()),((i.ctrlKey||i.metaKey)&&i.key==="f"||i.key==="/"&&document.activeElement===document.body)&&(i.preventDefault(),r?.()),i.key==="n"&&document.activeElement===document.body&&(i.preventDefault(),o?.()),i.key==="c"&&document.activeElement===document.body&&(i.preventDefault(),n?.());};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[a,e,t,r,o,n]);}function bs({tasks:e,columns:t,selectedTaskIds:r,onTaskMove:o,onColumnMove:n,onTaskDrop:a,onTaskDragStart:s,onTaskDragEnd:i}){let[c,d]=useState(null),[m,u]=useState(null),[p,g]=useState(null),[h,v]=useState(null),[b,f]=useState(null),x=useRef(null),w=useRef(null),k=(E,D,I)=>{I==="task"?(d(D),E.dataTransfer.setData("taskId",D),s?.(D)):(u(D),E.dataTransfer.setData("columnId",D)),E.dataTransfer.effectAllowed="move";},y=useCallback(()=>{c&&i?.(c),d(null),u(null),g(null),v(null),f(null);},[c,i]);return {draggedTaskId:c,draggedColumnId:m,dragOverColumnId:p,dragOverTaskId:h,dropPosition:b,handleDragStart:k,handleDragEnd:y,handleDragOver:(E,D,I)=>{if(E.preventDefault(),E.dataTransfer.dropEffect="move",m){g(D);let P=E.currentTarget.getBoundingClientRect(),M=P.left+P.width/2;f(E.clientX<M?"left":"right");}else if(g(D),I){v(I);let P=E.currentTarget.getBoundingClientRect(),M=P.top+P.height/2;f(E.clientY<M?"top":"bottom");}else E.target===E.currentTarget&&(v(null),f(null));},handleDrop:(E,D,I)=>{E.preventDefault();let P=c||E.dataTransfer.getData("taskId"),M=m||E.dataTransfer.getData("columnId");if(M&&n)n(M,D,b==="right"?"right":"left");else if(P&&o){if(!e.find(J=>J.id===P))return;(r.includes(P)?r:[P]).forEach(J=>{let Vr=e.find(ir=>ir.id===J)?.columnId||"";o(J,D,I,b==="bottom"?"bottom":"top"),a?.(J,Vr,D,0);});}y();},handleTouchStart:(E,D,I)=>{let P=E.touches[0];P&&(x.current=setTimeout(()=>{I==="task"?(d(D),s?.(D)):u(D),w.current={x:P.clientX,y:P.clientY};},500));},handleTouchMove:E=>{if(!c&&!m)return;E.preventDefault();let D=E.touches[0];if(!D)return;let I=document.elementFromPoint(D.clientX,D.clientY);if(!I)return;let P=I.closest("[data-column-id]"),M=I.closest("[data-task-id]");if(P){let G=P.getAttribute("data-column-id");if(g(G),m){let se=P.getBoundingClientRect(),J=se.left+se.width/2;f(D.clientX<J?"left":"right");}else if(M){let se=M.getAttribute("data-task-id");v(se);let J=M.getBoundingClientRect(),ht=J.top+J.height/2;f(D.clientY<ht?"top":"bottom");}}},handleTouchEnd:E=>{if(clearTimeout(x.current),c||m){if(p){let D=c,I=m;I&&n?n(I,p,b==="right"?"right":"left"):D&&o&&o(D,p,h||void 0,b==="bottom"?"bottom":"top");}y();}},setDraggedTaskId:d}}function bu({columns:e,tasks:t,onTaskMove:r,onColumnMove:o,onTaskClick:n,onTaskAdd:a,onColumnAction:s,swimlanes:i=false,swimlaneBy:c="priority",view:d,onViewChange:m,className:u,...p}){let[g,h]=useState(d||"board"),[v,b]=useState(null),[f,x]=useState([]),w=d||g,k=F=>{h(F),m?.(F);},{state:y,pushState:T,undo:C,redo:N,canUndo:R,canRedo:H}=ps({tasks:t,columns:e}),E=y?.tasks||[],D=y?.columns||[],{setSearchQuery:I,setActiveFilters:P,filteredTasks:M}=us(E),G=useMemo(()=>{if(!i)return null;let F={},j=(A,ie)=>ie.includes(".")?ie.split(".").reduce((V,le)=>V&&V[le],A):A[ie];return M.forEach(A=>{let ie=j(A,c),V=String(ie||"Uncategorized");F[V]||(F[V]=[]),F[V].push(A);}),F},[M,i,c]),{handleDragStart:se,handleDragOver:J,handleDrop:ht}=bs({columns:D,tasks:E,selectedTaskIds:[],onTaskMove:(F,j,A,ie)=>{let V=[...E],le=V.findIndex(zr=>zr.id===F);if(le===-1)return;let It={...V[le],columnId:j};if(V.splice(le,1),!A)V.push(It);else {let zr=V.findIndex(Mi=>Mi.id===A),Ci=ie==="bottom"?zr+1:zr;V.splice(Ci,0,It);}T({tasks:V,columns:D}),r?.(F,j,A,ie);}});fs({onUndo:C,onRedo:N,onSearch:()=>document.querySelector('input[placeholder*="Search"]')?.focus(),onNewTask:()=>a?.("todo","New Task")});let ir=useMemo(()=>E.find(F=>F.id===v),[E,v]),Ti=()=>{let F=j=>{b(j.id),n?.(j);};switch(w){case "list":return jsx(to,{tasks:M,columns:D,onTaskClick:F});case "timeline":return jsx(Fn,{tasks:M});case "table":return jsx(Un,{tasks:M,columns:D,onTaskClick:F});case "calendar":return jsx(Wn,{tasks:M,onTaskClick:F});default:if(i){let j=G&&Object.keys(G).length>0?G:{"All Tasks":[]};return jsx("div",{className:"flex flex-col gap-8 overflow-y-auto h-full pr-2 custom-scrollbar",children:Object.entries(j).map(([A,ie])=>jsx(cs,{title:A,count:ie.length,isCollapsed:f.includes(A),onToggle:()=>x(V=>V.includes(A)?V.filter(le=>le!==A):[...V,A]),children:jsx("div",{className:"flex gap-6 min-h-[200px]",children:D.map(V=>jsx(Qo,{column:V,tasks:ie.filter(le=>le.columnId===V.id),onTaskClick:F,onAddTask:()=>a?.(V.id,"New Task"),onAction:le=>s?.(V.id,le),onDragStart:se,onDragOver:(le,It)=>J(le,V.id,It),onDrop:(le,It)=>ht(le,V.id,It)},V.id))})},A))})}return jsx("div",{className:"flex gap-6 overflow-x-auto pb-4 min-h-[500px] scrollbar-thin scrollbar-thumb-white/10",children:D.map(j=>jsx(Qo,{column:j,tasks:M.filter(A=>A.columnId===j.id),onTaskClick:F,onAddTask:()=>a?.(j.id,"New Task"),onAction:A=>s?.(j.id,A),onDragStart:se,onDragOver:(A,ie)=>J(A,j.id,ie),onDrop:(A,ie)=>ht(A,j.id,ie)},j.id))})}};return jsxs("div",{className:l("flex flex-col gap-4 h-full",u),children:[jsx(Vn,{title:"Project Board",view:w,onViewChange:F=>k(F),canUndo:R,canRedo:H,onUndo:C,onRedo:N}),jsx(Qn,{onSearchChange:I,onFilterChange:P}),jsx("div",{className:"flex-1 overflow-hidden",children:Ti()}),ir&&jsx(ls,{isOpen:!!v,onClose:()=>b(null),task:ir,onSave:F=>{let j=E.map(A=>A.id===ir.id?{...A,...F}:A);T({tasks:j,columns:D}),b(null);}})]})}function wT({columnId:e,onAdd:t,placeholder:r="Add task...",className:o}){let[n,a]=useState(false),[s,i]=useState(""),c=d=>{d?.preventDefault(),s.trim()&&(t(e,s),i(""),a(false));};return n?jsxs("form",{onSubmit:c,className:l("bg-white/[0.03] border border-white/10 rounded-2xl p-3 space-y-3",o),children:[jsx("input",{autoFocus:true,value:s,onChange:d=>i(d.target.value),placeholder:"What needs to be done?",className:"w-full bg-transparent border-none outline-none text-sm text-white placeholder:text-white/20",onKeyDown:d=>{d.key==="Escape"&&a(false);}}),jsxs("div",{className:"flex items-center justify-end gap-2",children:[jsx(L,{variant:"ghost",size:"sm",onClick:()=>a(false),className:"h-8 text-white/40 hover:text-white",children:"Cancel"}),jsx(L,{size:"sm",onClick:()=>c(),disabled:!s.trim(),className:"h-8",children:"Add Task"})]})]}):jsxs("button",{onClick:()=>a(true),className:l("w-full flex items-center gap-2 p-3 rounded-2xl border border-dashed border-white/10 text-white/40 hover:border-white/20 hover:bg-white/5 transition-all text-sm",o),children:[jsx(Plus,{className:"h-4 w-4"}),r]})}function CT({onSync:e,interval:t=3e4,enabled:r=false}){let[o,n]=useState(null),[a,s]=useState(false),[i,c]=useState(null);return {sync:useCallback(async m=>{if(e){s(true),c(null);try{await e(m),n(new Date);}catch(u){c(u instanceof Error?u:new Error("Sync failed"));}finally{s(false);}}},[e]),isSyncing:a,lastSynced:o,error:i}}function LT(){let[e,t]=useState([]),r=useCallback(n=>{let a={...n,id:Math.random().toString(36).substr(2,9),timestamp:new Date};t(s=>[a,...s]);},[]),o=useCallback(()=>{t([]);},[]);return {history:e,addEntry:r,clearHistory:o}}function DT({subtasks:e,onToggle:t,className:r}){return !e||e.length===0?null:jsx("div",{className:l("space-y-1",r),children:e.map(o=>jsxs("div",{className:"flex items-center gap-2 group cursor-pointer",onClick:()=>t?.(o.id),children:[o.completed?jsx(CheckCircle2,{className:"h-3.5 w-3.5 text-green-500"}):jsx(Circle,{className:"h-3.5 w-3.5 text-white/20 group-hover:text-white/40"}),jsx("span",{className:l("text-xs transition-colors",o.completed?"text-white/40 line-through":"text-white/70"),children:o.title})]},o.id))})}function OT({activities:e,className:t}){return jsxs("div",{className:l("space-y-4",t),children:[jsx("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold",children:"Activity"}),jsx("div",{className:"space-y-4",children:e.map(r=>jsxs("div",{className:"flex gap-3",children:[jsx(B,{src:r.user.avatar,alt:r.user.name,size:"sm"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("p",{className:"text-xs text-white/80",children:[jsx("span",{className:"font-bold text-white",children:r.user.name})," ",r.action," ",r.target&&jsx("span",{className:"font-medium text-blue-400",children:r.target})]}),jsx("p",{className:"text-[10px] text-white/30 mt-0.5",children:r.timestamp.toLocaleString()})]})]},r.id))})]})}var Cu=ve__default.forwardRef(({className:e,title:t="Terminal",children:r,...o},n)=>jsxs("div",{ref:n,className:l("overflow-hidden rounded-2xl border border-gray-200 bg-gray-950 shadow-xl dark:border-white/10",e),...o,children:[jsxs("div",{className:"flex items-center justify-between border-b border-white/10 bg-white/[0.03] px-4 py-2",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[jsx("div",{className:"h-3 w-3 rounded-full bg-rose-500/80"}),jsx("div",{className:"h-3 w-3 rounded-full bg-amber-500/80"}),jsx("div",{className:"h-3 w-3 rounded-full bg-emerald-500/80"})]}),jsx("div",{className:"text-xs font-medium text-white/50",children:t}),jsx("div",{className:"w-10"})," "]}),jsx("div",{className:"p-4 font-mono text-sm text-gray-300",children:r})]}));Cu.displayName="Terminal";var x5=({children:e,prefix:t="$",className:r})=>jsxs("div",{className:l("flex gap-2",r),children:[jsx("span",{className:"select-none text-emerald-400",children:t}),jsx("span",{children:e})]});var k5=({className:e,pauseOnHover:t=false,direction:r="left",speed:o="normal",children:n,...a})=>{let s={slow:"40s",normal:"20s",fast:"10s"};return jsxs("div",{className:l("group flex overflow-hidden p-2 [--gap:1rem] [gap:var(--gap)]",e),...a,children:[jsx("div",{className:l("flex shrink-0 justify-around [gap:var(--gap)] min-w-full",r==="left"?"animate-marquee":"animate-marquee-reverse",t&&"group-hover:[animation-play-state:paused]"),style:{animationDuration:s[o]},children:n}),jsx("div",{"aria-hidden":"true",className:l("flex shrink-0 justify-around [gap:var(--gap)] min-w-full",r==="left"?"animate-marquee":"animate-marquee-reverse",t&&"group-hover:[animation-play-state:paused]"),style:{animationDuration:s[o]},children:n}),jsx("style",{children:`
12
+ `})]})};gl.displayName="LetterPullup";var _=we__default.forwardRef(({className:e,children:t,required:r,...o},n)=>jsxs("label",{ref:n,className:l("text-sm font-medium leading-none text-gray-700 dark:text-white/80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...o,children:[t,r&&jsx("span",{className:"ml-1 text-rose-500",children:"*"})]}));_.displayName="Label";var yl=cva("w-full rounded-2xl bg-gray-50 dark:bg-white/[0.04] px-4 py-3 border border-gray-200 dark:border-white/[0.10] text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-white/30 focus:outline-none focus:ring-2 focus:ring-purple-400/30 disabled:cursor-not-allowed disabled:opacity-50 transition-all duration-200",{variants:{hasError:{true:"border-rose-400/25 focus:ring-rose-300/25",false:""},hasLeftIcon:{true:"pl-10",false:""},hasRightIcon:{true:"pr-10",false:""}},defaultVariants:{hasError:false,hasLeftIcon:false,hasRightIcon:false}}),wt=we__default.forwardRef(({className:e,containerClassName:t,label:r,error:o,leftIcon:n,rightIcon:a,id:s,...i},c)=>{let d=s||we__default.useId(),m=!!o;return jsxs("div",{className:l("flex flex-col gap-1.5",t),children:[r&&jsx(_,{htmlFor:d,required:i.required,children:r}),jsxs("div",{className:"relative flex items-center",children:[n&&jsx("div",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 dark:text-white/35",children:n}),jsx("input",{ref:c,id:d,className:l(yl({hasError:m,hasLeftIcon:!!n,hasRightIcon:!!a,className:e})),...i}),a&&jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2",children:a})]}),o&&jsx("p",{className:"text-xs text-rose-400 animate-in slide-in-from-top-1 fade-in duration-200",children:o})]})});wt.displayName="TextInput";var Po=we__default.forwardRef(({className:e,label:t,error:r,id:o,disabled:n,checked:a,defaultChecked:s,onChange:i,...c},d)=>{let m=o||we__default.useId(),[u,f]=we__default.useState(s||a||false);we__default.useEffect(()=>{a!==void 0&&f(a);},[a]);let g=()=>{if(n)return;let x=!u;f(x),i&&i({target:{checked:x}});};return jsxs("div",{className:l("flex flex-col gap-1.5",e),children:[jsxs("button",{ref:d,type:"button",id:m,role:"checkbox","aria-checked":u,"aria-label":t,onClick:g,disabled:n,className:l("flex items-center gap-3 rounded-2xl border border-gray-200 dark:border-white/10 bg-gray-50 dark:bg-white/[0.03] px-4 py-3","hover:bg-gray-100 dark:hover:bg-white/[0.04] transition-colors",n&&"opacity-50 cursor-not-allowed"),...c,children:[jsx("span",{"aria-hidden":"true",className:l("grid h-6 w-6 place-items-center rounded-lg border",u?"border-emerald-400/30 bg-emerald-400/15":"border-gray-300 dark:border-white/10 bg-white dark:bg-white/[0.02]"),children:u?jsx("svg",{className:"h-4 w-4 text-emerald-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}):null}),t&&jsx("span",{className:"text-sm text-gray-700 dark:text-white/70",children:t})]}),r&&jsx("p",{className:"text-xs text-rose-500 mt-1 ml-1",children:r})]})});Po.displayName="Checkbox";var Eo=we__default.forwardRef(({className:e,label:t,error:r,id:o,disabled:n,checked:a,defaultChecked:s,onChange:i,...c},d)=>{let m=o||we__default.useId(),[u,f]=we__default.useState(s||a||false);we__default.useEffect(()=>{a!==void 0&&f(a);},[a]);let g=()=>{if(n)return;let x=!u;f(x),i&&i({target:{checked:x}});};return jsxs("div",{className:l("flex flex-col gap-1.5",e),children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",id:m,role:"switch","aria-checked":u,onClick:g,disabled:n,className:l("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-black disabled:cursor-not-allowed disabled:opacity-50",u?"bg-emerald-500":"bg-gray-200 dark:bg-white/[0.06]"),...c,children:jsx("span",{className:l("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform",u?"translate-x-5":"translate-x-0")})}),t&&jsx(_,{htmlFor:m,className:"cursor-pointer select-none text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",onClick:g,children:t})]}),r&&jsx("p",{className:"text-xs text-rose-500 mt-1 ml-1",children:r})]})});Eo.displayName="Switch";var Wr=we__default.forwardRef(({label:e,name:t,options:r,value:o,defaultValue:n,onChange:a,placeholder:s="Select an option",error:i,disabled:c,className:d},m)=>{let[u,f]=useState(false),[g,x]=useState(n),[v,h]=useState(-1),p=useRef(null),b=we__default.useId(),w=o!==void 0,k=w?o:g,y=r.find(T=>T.value===k);useEffect(()=>{if(u){let T=r.findIndex(L=>L.value===k);h(T!==-1?T:0);}else h(-1);},[u,k,r]),useEffect(()=>{let T=L=>{p.current&&!p.current.contains(L.target)&&f(false);};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);let N=T=>{c||(w||x(T),a?.(T),f(false));},C=T=>{c||(T.key==="Enter"||T.key===" "?(T.preventDefault(),u&&v!==-1?N(r[v].value):f(true)):T.key==="Escape"?f(false):T.key==="ArrowDown"?(T.preventDefault(),u?h(L=>(L+1)%r.length):f(true)):T.key==="ArrowUp"?(T.preventDefault(),u?h(L=>(L-1+r.length)%r.length):f(true)):T.key==="Home"?(T.preventDefault(),u&&h(0)):T.key==="End"&&(T.preventDefault(),u&&h(r.length-1)));};return jsxs("div",{ref:p,className:l("flex flex-col gap-1.5 relative",d),children:[e&&jsx(_,{htmlFor:b,className:l(c&&"opacity-50 cursor-not-allowed"),children:e}),jsxs("div",{ref:m,id:b,role:"combobox","aria-expanded":u,"aria-haspopup":"listbox","aria-controls":`${b}-listbox`,"aria-disabled":c,tabIndex:c?-1:0,onClick:()=>!c&&f(!u),onKeyDown:C,className:l("w-full appearance-none rounded-2xl bg-gray-50 dark:bg-white/[0.04] px-4 py-3","border border-gray-200 dark:border-white/[0.10]","text-gray-900 dark:text-white flex items-center","focus:outline-none focus:ring-2 focus:ring-purple-400/30","hover:bg-gray-100 dark:hover:bg-white/[0.05] cursor-pointer",c&&"cursor-not-allowed opacity-50 hover:bg-gray-50 dark:hover:bg-white/[0.04]",u&&"border-gray-300 dark:border-white/20 ring-2 ring-purple-400/20",i&&"border-rose-400/25 focus:ring-rose-300/25"),children:[jsx("span",{className:l("block truncate",!y&&"text-gray-400 dark:text-white/20"),children:y?y.label:s}),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:l("absolute right-4 top-1/2 -translate-y-1/2 text-gray-400 dark:text-white/40 transition-transform duration-200",u&&"rotate-180"),children:jsx("path",{d:"m6 9 6 6 6-6"})})]}),u&&jsx("div",{className:"absolute top-full left-0 z-[110] mt-1 w-full overflow-hidden rounded-2xl border border-gray-200 dark:border-white/10 bg-white dark:bg-[#0A0A0A] p-1 shadow-xl animate-in fade-in zoom-in-95 duration-100",children:jsx("ul",{id:`${b}-listbox`,role:"listbox","aria-activedescendant":v!==-1?`${b}-option-${v}`:void 0,className:"max-h-60 overflow-auto p-1 flex flex-col gap-2",children:r.map((T,L)=>jsx("li",{id:`${b}-option-${L}`,role:"option","aria-selected":k===T.value,onClick:()=>N(T.value),onMouseEnter:()=>h(L),className:l("w-full rounded-2xl px-3 py-2 text-left text-sm transition-colors cursor-pointer","hover:bg-gray-100 dark:hover:bg-white/[0.06] hover:text-gray-900 dark:hover:text-white",k===T.value||v===L?"bg-gray-100 dark:bg-white/[0.06] text-gray-900 dark:text-white/90":"text-gray-700 dark:text-white/80"),children:jsxs("div",{className:"flex items-center justify-between gap-3",children:[jsx("span",{className:"flex-1 truncate",children:T.label}),k===T.value&&jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-900 dark:text-white",children:jsx("polyline",{points:"20 6 9 17 4 12"})})]})},T.value))})}),i&&jsx("p",{className:"text-xs text-rose-400 animate-in slide-in-from-top-1 fade-in duration-200",children:i}),jsx("input",{type:"hidden",name:t,value:k||""})]})});Wr.displayName="Select";function Kt(e,t,r={}){let{side:o="bottom",align:n="center",sideOffset:a=4,alignOffset:s=0,isOpen:i=false}=r,[c,d]=useState({top:0,left:0}),[m,u]=useState(false),f=useCallback(()=>{if(!e.current||!t.current||!i)return;let g=e.current.getBoundingClientRect(),x=t.current.getBoundingClientRect(),v=0,h=0;switch(o){case "top":v=g.top-x.height-a;break;case "bottom":v=g.bottom+a;break;case "left":h=g.left-x.width-a;break;case "right":h=g.right+a;break}if(o==="top"||o==="bottom")switch(n){case "start":h=g.left+s;break;case "center":h=g.left+g.width/2-x.width/2+s;break;case "end":h=g.right-x.width+s;break}else switch(n){case "start":v=g.top+s;break;case "center":v=g.top+g.height/2-x.height/2+s;break;case "end":v=g.bottom-x.height+s;break}let p=8,b=window.innerWidth,w=window.innerHeight;h<p&&(h=p),h+x.width>b-p&&(h=b-x.width-p),v<p&&(v=p),v+x.height>w-p&&(v=w-x.height-p),d({top:v,left:h}),u(true);},[e,t,o,n,a,s,i]);return useLayoutEffect(()=>{if(!i){m&&u(false);return}f();let g=new ResizeObserver(()=>f());return e.current&&g.observe(e.current),t.current&&g.observe(t.current),window.addEventListener("resize",f),window.addEventListener("scroll",f,true),()=>{g.disconnect(),window.removeEventListener("resize",f),window.removeEventListener("scroll",f,true);}},[i,f,e,t]),{position:c,isPositioned:m,updatePosition:f}}var Ho=createContext(void 0);function Qe({children:e,open:t,onOpenChange:r}){let[o,n]=useState(false),a=useRef(null),s=t!==void 0,i=s?t:o,c=d=>{s||n(d),r?.(d);};return jsx(Ho.Provider,{value:{isOpen:i,setIsOpen:c,triggerRef:a},children:jsx("div",{className:"relative inline-block",children:e})})}function Je({className:e,children:t,...r}){let o=useContext(Ho);if(!o)throw new Error("PopoverTrigger must be used within Popover");let n=a=>{o.setIsOpen(!o.isOpen),r.onClick?.(a);};return jsx("button",{ref:o.triggerRef,type:"button","aria-haspopup":"dialog","aria-expanded":o.isOpen?"true":"false",onClick:n,className:l("inline-flex items-center justify-center",e),...r,children:t})}function Ze({className:e,children:t,align:r="center",sideOffset:o=4,...n}){let a=useContext(Ho);if(!a)throw new Error("PopoverContent must be used within Popover");let s=useRef(null),{position:i,isPositioned:c}=Kt(a.triggerRef,s,{side:"bottom",align:r,sideOffset:o,isOpen:a.isOpen});if(useEffect(()=>{if(a.isOpen){let m=u=>{s.current&&!s.current.contains(u.target)&&a.triggerRef.current&&!a.triggerRef.current.contains(u.target)&&a.setIsOpen(false);};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m);}}},[a.isOpen,a.setIsOpen,a.triggerRef]),!a.isOpen)return null;let d=()=>{let m=i.top>(a.triggerRef.current?.getBoundingClientRect().top||0)?"bottom":"top";return m==="bottom"?r==="start"?"top left":r==="end"?"top right":"top center":m==="top"?r==="start"?"bottom left":r==="end"?"bottom right":"bottom center":"center center"};return createPortal(jsx("div",{ref:s,style:{top:i.top,left:i.left,transformOrigin:d()},className:l("fixed z-[110] min-w-[12rem] rounded-2xl border border-gray-200 dark:border-white/10 bg-white/80 dark:bg-white/[0.03] backdrop-blur-xl p-4 shadow-xl outline-none duration-200",c?"animate-in fade-in zoom-in-95 opacity-100":"opacity-0",e),...n,children:t}),document.body)}var fr=createContext(void 0);function Io({children:e,value:t,defaultValue:r="",onValueChange:o,filter:n=(s,i)=>s.toLowerCase().includes(i.toLowerCase()),usePopover:a=true}){let[s,i]=useState(r),[c,d]=useState(""),[m,u]=useState(false),[f,g]=useState(new Map),[x,v]=useState(-1),h=t!==void 0,p=h?t:s,b=N=>{h||i(N),o?.(N),u(false),d("");},w=we__default.useCallback((N,C,T)=>(g(L=>{let I=new Map(L);return I.set(N,{text:C,value:T}),I}),()=>{g(L=>{let I=new Map(L);return I.delete(N),I});}),[]),k=useMemo(()=>Array.from(f.entries()).filter(([N,C])=>n(C.text,c)).map(([N,C])=>({id:N,value:C.value})),[f,c,n]),y=k.length>0;return useEffect(()=>{v(m?0:-1);},[m]),jsx(fr.Provider,{value:{value:p,onValueChange:b,searchTerm:c,setSearchTerm:d,isOpen:m,setIsOpen:u,registerItem:w,isItemVisible:(N,C)=>n(C,c),hasVisibleItems:y,activeIndex:x,setActiveIndex:v,visibleItems:k},children:a?jsx(Qe,{open:m,onOpenChange:u,children:e}):e})}function Ox({className:e,children:t,...r}){let o=useContext(fr);return jsxs(Je,{role:"combobox","aria-expanded":o?.isOpen,"aria-haspopup":"listbox",className:l("flex h-10 w-full items-center justify-between rounded-2xl border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-900 placeholder:text-gray-500 focus:border-purple-500 focus:outline-none focus:ring-2 focus:ring-purple-500/20 disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:bg-white/[0.03] dark:text-white dark:placeholder:text-white/40 dark:focus:border-white/20 dark:focus:ring-white/10",e),...r,children:[t,jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-2 opacity-50",children:jsx("path",{d:"m6 9 6 6 6-6"})})]})}function Vx({className:e,children:t,...r}){return jsx(Ze,{className:l("p-0 w-[200px]",e),align:"start",...r,children:t})}function fn({className:e,placeholder:t="Search...",...r}){let o=useContext(fr);if(!o)throw new Error("ComboboxInput must be used within Combobox");let n=a=>{a.key==="ArrowDown"?(a.preventDefault(),o.setActiveIndex(s=>(s+1)%o.visibleItems.length)):a.key==="ArrowUp"?(a.preventDefault(),o.setActiveIndex(s=>(s-1+o.visibleItems.length)%o.visibleItems.length)):a.key==="Enter"?(a.preventDefault(),o.activeIndex!==-1&&o.visibleItems[o.activeIndex]&&o.onValueChange(o.visibleItems[o.activeIndex].value)):a.key==="Escape"&&o.setIsOpen(false),r.onKeyDown?.(a);};return jsxs("div",{className:"flex items-center border-b border-gray-200 dark:border-white/10 px-3",children:[jsxs("svg",{className:"mr-2 h-4 w-4 shrink-0 opacity-50",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("circle",{cx:"11",cy:"11",r:"8"}),jsx("path",{d:"m21 21-4.3-4.3"})]}),jsx("input",{className:l("flex h-10 w-full rounded-md bg-transparent py-3 text-sm text-gray-900 dark:text-white outline-none placeholder:text-gray-400 dark:placeholder:text-white/40 disabled:cursor-not-allowed disabled:opacity-50",e),placeholder:t,value:o.searchTerm,onChange:a=>o.setSearchTerm(a.target.value),onKeyDown:n,"aria-autocomplete":"list","aria-activedescendant":o.activeIndex!==-1?o.visibleItems[o.activeIndex]?.id:void 0,...r})]})}function gn({className:e,children:t,...r}){return jsx("div",{role:"listbox",className:l("max-h-[300px] overflow-y-auto overflow-x-hidden p-1",e),...r,children:t})}function hn({className:e,children:t,...r}){let o=useContext(fr);if(!o)throw new Error("ComboboxEmpty must be used within Combobox");return o.hasVisibleItems?null:jsx("div",{className:l("py-6 text-center text-sm text-gray-500 dark:text-white/40",e),...r,children:t})}function bn({className:e,value:t,children:r,textValue:o,...n}){let a=useContext(fr);if(!a)throw new Error("ComboboxItem must be used within Combobox");let s=we__default.useId(),i=o||(typeof r=="string"?r:t),c=a.isItemVisible(s,i),d=a.value===t,m=a.visibleItems.findIndex(f=>f.id===s),u=a.activeIndex===m;return useEffect(()=>a.registerItem(s,i,t),[s,i,t,a.registerItem]),c?jsxs("div",{id:s,role:"option","aria-selected":d,onClick:()=>a.onValueChange(t),onMouseEnter:()=>a.setActiveIndex(m),className:l("relative flex cursor-default select-none items-center rounded-2xl px-3 py-2 text-sm outline-none transition-colors","text-gray-700 dark:text-white/80","aria-selected:bg-gray-100 aria-selected:text-gray-900 dark:aria-selected:bg-white/[0.06] dark:aria-selected:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-white/[0.06] dark:hover:text-white",(d||u)&&"bg-gray-100 text-gray-900 dark:bg-white/[0.06] dark:text-white",e),...n,children:[jsx("svg",{className:l("mr-2 h-4 w-4",d?"opacity-100":"opacity-0"),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("polyline",{points:"20 6 9 17 4 12"})}),r]}):null}var Wx=we__default.forwardRef(({className:e,value:t,defaultValue:r=0,min:o=0,max:n=100,step:a=1,onChange:s,disabled:i,...c},d)=>{let[m,u]=useState(r),f=t!==void 0,g=f?t:m,x=useRef(null),v=(g-o)/(n-o)*100,h=useCallback(k=>{if(i||!x.current)return;let y=x.current.getBoundingClientRect(),N=y.width,C=y.left,T=(k-C)/N*(n-o)+o;T=Math.min(Math.max(T,o),n);let L=Math.round((T-o)/a);T=o+L*a,T=Number(T.toFixed(10)),f||u(T),s?.(T);},[i,f,n,o,s,a]),p=k=>{if(i)return;h(k.clientX);let y=C=>{h(C.clientX);},N=()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",N);};document.addEventListener("mousemove",y),document.addEventListener("mouseup",N);},b=k=>{if(i)return;let y=k.touches[0];y&&h(y.clientX);let N=T=>{let L=T.touches[0];L&&h(L.clientX);},C=()=>{document.removeEventListener("touchmove",N),document.removeEventListener("touchend",C);};document.addEventListener("touchmove",N,{passive:false}),document.addEventListener("touchend",C);};return jsxs("div",{ref:d,role:"slider","aria-valuemin":o,"aria-valuemax":n,"aria-valuenow":g,"aria-disabled":i,tabIndex:i?-1:0,onKeyDown:k=>{if(i)return;let y=g;if(k.key==="ArrowRight"||k.key==="ArrowUp")y=Math.min(g+a,n);else if(k.key==="ArrowLeft"||k.key==="ArrowDown")y=Math.max(g-a,o);else if(k.key==="Home")y=o;else if(k.key==="End")y=n;else return;k.preventDefault(),y!==g&&(f||u(y),s?.(y));},className:l("relative flex w-full touch-none select-none items-center py-4 group",i&&"opacity-50 cursor-not-allowed",e),onMouseDown:p,onTouchStart:b,...c,children:[jsx("div",{ref:x,className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-gray-200 dark:bg-white/[0.06] backdrop-blur-sm border border-gray-200 dark:border-white/5",children:jsx("div",{className:"absolute h-full bg-gray-900 dark:bg-white transition-none dark:shadow-[0_0_10px_rgba(255,255,255,0.5)]",style:{width:`${v}%`}})}),jsx("div",{className:"absolute h-5 w-5 rounded-full border-2 border-gray-900 dark:border-white bg-white dark:bg-black shadow-md dark:shadow-[0_0_15px_rgba(255,255,255,0.5)] transition-transform hover:scale-110 focus:scale-110",style:{left:`calc(${v}% - 10px)`}})]})});var Vl=["Su","Mo","Tu","We","Th","Fr","Sa"],zl=["January","February","March","April","May","June","July","August","September","October","November","December"];function Gr({className:e,value:t,onChange:r,minDate:o,maxDate:n}){let[a,s]=useState(t||new Date),[i,c]=useState(t||new Date),d=(p,b)=>new Date(p,b+1,0).getDate(),m=(p,b)=>new Date(p,b,1).getDay(),u=()=>{c(new Date(i.getFullYear(),i.getMonth()-1,1));},f=()=>{c(new Date(i.getFullYear(),i.getMonth()+1,1));},g=p=>{let b=new Date(i.getFullYear(),i.getMonth(),p);r&&r(b),s(b);},x=p=>t&&t.getDate()===p&&t.getMonth()===i.getMonth()&&t.getFullYear()===i.getFullYear(),v=p=>{let b=new Date;return b.getDate()===p&&b.getMonth()===i.getMonth()&&b.getFullYear()===i.getFullYear()},h=()=>{let p=d(i.getFullYear(),i.getMonth()),b=m(i.getFullYear(),i.getMonth()),w=[];for(let k=0;k<b;k++)w.push(jsx("div",{className:"h-9 w-9"},`empty-${k}`));for(let k=1;k<=p;k++){let y=x(k),N=v(k);w.push(jsx("button",{onClick:()=>g(k),type:"button",className:l("h-9 w-9 rounded-2xl text-sm font-medium transition-all duration-200","hover:bg-gray-100 dark:hover:bg-white/[0.06] focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/20",y&&"bg-gray-900 text-white dark:bg-white dark:text-black shadow-md dark:shadow-[0_0_15px_rgba(255,255,255,0.3)] hover:bg-gray-800 dark:hover:bg-white/90",!y&&N&&"bg-gray-100 dark:bg-white/[0.03] text-gray-900 dark:text-white border border-gray-200 dark:border-white/10",!y&&!N&&"text-gray-700 dark:text-white/70 hover:text-gray-900 dark:hover:text-white"),children:k},k));}return w};return jsxs("div",{className:l("p-4 bg-white dark:bg-black/40 backdrop-blur-xl border border-gray-200 dark:border-white/10 rounded-2xl w-fit",e),children:[jsxs("div",{className:"flex items-center justify-between mb-4 px-1",children:[jsxs("div",{className:"font-semibold text-gray-900 dark:text-white",children:[zl[i.getMonth()]," ",jsx("span",{className:"text-gray-500 dark:text-white/50",children:i.getFullYear()})]}),jsxs("div",{className:"flex gap-1",children:[jsx("button",{onClick:u,type:"button",className:"p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/70 hover:text-gray-900 dark:hover:text-white transition-colors",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx("button",{onClick:f,type:"button",className:"p-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/70 hover:text-gray-900 dark:hover:text-white transition-colors",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]}),jsx("div",{className:"grid grid-cols-7 gap-1 mb-2 text-center",children:Vl.map(p=>jsx("div",{className:"h-9 w-9 flex items-center justify-center text-xs font-medium text-gray-400 dark:text-white/40",children:p},p))}),jsx("div",{className:"grid grid-cols-7 gap-1",children:h()})]})}function nv({value:e,onChange:t,placeholder:r="Pick a date",className:o}){let[n,a]=useState(e),[s,i]=useState(false),c=u=>{a(u),t?.(u),i(false);},d=u=>u.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"});return jsxs(Qe,{open:s,onOpenChange:i,children:[jsxs(Je,{onMouseMove:u=>{let f=u.currentTarget.getBoundingClientRect(),g=u.clientX-f.left,x=u.clientY-f.top;u.currentTarget.style.setProperty("--x",`${g}px`),u.currentTarget.style.setProperty("--y",`${x}px`);},className:l("group relative flex h-11 w-full items-center justify-between rounded-2xl border border-gray-200 dark:border-white/10 bg-gray-50 dark:bg-white/[0.03] px-4 py-2 text-sm text-gray-900 dark:text-white transition-all duration-200 overflow-hidden","hover:bg-gray-100 dark:hover:bg-white/[0.06] focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/15",!n&&"text-gray-400 dark:text-white/40",o),children:[jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none",style:{background:"radial-gradient(600px circle at var(--x) var(--y), rgba(255,255,255,0.06), transparent 40%)"}}),jsx("span",{className:"relative z-10",children:n?d(n):r}),jsx(Calendar,{className:"relative z-10 h-4 w-4 text-white/40"})]}),jsx(Ze,{className:"w-auto p-0 border-none bg-transparent shadow-none",align:"start",children:jsx(Gr,{value:n,onChange:c,className:"shadow-2xl shadow-black/50"})})]})}var st=we__default.forwardRef(({className:e,children:t,orientation:r="vertical",scrollbarSize:o="sm",...n},a)=>jsx("div",{ref:a,className:l("overflow-auto","[&::-webkit-scrollbar]:bg-transparent","[&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-thumb]:bg-white/[0.06]","[&::-webkit-scrollbar-thumb]:rounded-full","hover:[&::-webkit-scrollbar-thumb]:bg-gray-400 dark:hover:[&::-webkit-scrollbar-thumb]:bg-white/20","[&::-webkit-scrollbar-track]:bg-transparent","[scrollbar-width:thin] [scrollbar-color:rgba(0,0,0,0.2)_transparent] dark:[scrollbar-color:rgba(255,255,255,0.1)_transparent]",r==="vertical"&&"overflow-y-auto overflow-x-hidden",r==="horizontal"&&"overflow-x-auto overflow-y-hidden",r==="both"&&"overflow-auto",o==="sm"&&"[&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar]:h-1.5",o==="md"&&"[&::-webkit-scrollbar]:w-2.5 [&::-webkit-scrollbar]:h-2.5",o==="lg"&&"[&::-webkit-scrollbar]:w-4 [&::-webkit-scrollbar]:h-4",e),...n,children:t}));st.displayName="ScrollArea";function vv({value:e,onChange:t,placeholder:r="Pick date & time",className:o}){let[n,a]=useState(e),[s,i]=useState(false),[c,d]=useState(e?e.getHours():12),[m,u]=useState(e?e.getMinutes():0);useEffect(()=>{e&&(a(e),d(e.getHours()),u(e.getMinutes()));},[e]);let f=h=>{let p=new Date(h);p.setHours(c),p.setMinutes(m),a(p),t?.(p);},g=(h,p)=>{let b=parseInt(p,10);if(isNaN(b))return;let w=c,k=m;h==="hours"?(b=Math.max(0,Math.min(23,b)),d(b),w=b):(b=Math.max(0,Math.min(59,b)),u(b),k=b);let y=n||new Date,N=new Date(y);N.setHours(w),N.setMinutes(k),a(N),t?.(N);},x=h=>h.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"});return jsxs(Qe,{open:s,onOpenChange:i,children:[jsxs(Je,{onMouseMove:h=>{let p=h.currentTarget.getBoundingClientRect(),b=h.clientX-p.left,w=h.clientY-p.top;h.currentTarget.style.setProperty("--x",`${b}px`),h.currentTarget.style.setProperty("--y",`${w}px`);},className:l("group relative flex h-11 w-full items-center justify-between rounded-2xl border border-gray-200 dark:border-white/10 bg-gray-50 dark:bg-white/[0.03] px-4 py-2 text-sm text-gray-900 dark:text-white transition-all duration-200 overflow-hidden","hover:bg-gray-100 dark:hover:bg-white/[0.06] focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/15",!n&&"text-gray-400 dark:text-white/40",o),children:[jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none",style:{background:"radial-gradient(600px circle at var(--x) var(--y), rgba(0,0,0,0.06), transparent 40%)"}}),jsx("span",{className:"relative z-10",children:n?x(n):r}),jsxs("div",{className:"flex items-center gap-2 text-gray-400 dark:text-white/40",children:[jsx(Calendar,{className:"h-4 w-4"}),jsx(Clock,{className:"h-4 w-4"})]})]}),jsx(Ze,{className:"w-auto p-0 border-none bg-transparent shadow-none",align:"start",children:jsx("div",{className:"flex flex-col rounded-2xl border border-gray-200 dark:border-white/10 bg-white dark:bg-black/40 backdrop-blur-xl shadow-2xl dark:shadow-black/50",children:jsxs("div",{className:"flex",children:[jsx("div",{className:"p-4 border-r border-gray-200 dark:border-white/10",children:jsx(Gr,{value:n,onChange:f,className:"border-0 p-0 bg-transparent backdrop-blur-none shadow-none rounded-none"})}),jsxs("div",{className:"flex flex-col p-4 w-[160px] h-[340px]",children:[jsx("div",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-white/70",children:"Time"}),jsxs("div",{className:"flex flex-1 gap-2 min-h-0 overflow-hidden",children:[jsxs(st,{className:"flex-1 flex flex-col gap-1",scrollbarSize:"sm",children:[jsx("div",{className:"text-xs text-gray-400 dark:text-white/40 text-center mb-1 sticky top-0 bg-white dark:bg-[#0A0A0A] py-1 z-10",children:"Hr"}),jsx("div",{className:"flex flex-col gap-1",children:Array.from({length:24}).map((h,p)=>jsx("button",{onClick:()=>g("hours",p.toString()),className:l("w-full rounded-lg px-1 py-1.5 text-sm transition-colors text-center shrink-0",c===p?"bg-emerald-500 dark:bg-emerald-600/80 text-white font-medium":"text-gray-700 dark:text-white/70 hover:bg-gray-100 dark:hover:bg-white/[0.06] hover:text-gray-900 dark:hover:text-white"),children:p.toString().padStart(2,"0")},p))})]}),jsx("div",{className:"w-[1px] bg-gray-200 dark:bg-white/[0.06]"}),jsxs(st,{className:"flex-1 flex flex-col gap-1",scrollbarSize:"sm",children:[jsx("div",{className:"text-xs text-gray-400 dark:text-white/40 text-center mb-1 sticky top-0 bg-white dark:bg-[#0A0A0A] py-1 z-10",children:"Min"}),jsx("div",{className:"flex flex-col gap-1",children:Array.from({length:60}).map((h,p)=>jsx("button",{onClick:()=>g("minutes",p.toString()),className:l("w-full rounded-lg px-1 py-1.5 text-sm transition-colors text-center shrink-0",m===p?"bg-emerald-500 dark:bg-emerald-600/80 text-white font-medium":"text-gray-700 dark:text-white/70 hover:bg-gray-100 dark:hover:bg-white/[0.06] hover:text-gray-900 dark:hover:text-white"),children:p.toString().padStart(2,"0")},p))})]})]})]})]})})})]})}var hr=we__default.forwardRef(({className:e,label:t,error:r,id:o,disabled:n,...a},s)=>{let i=we__default.useId(),c=o||i;return jsxs("div",{className:"flex flex-col gap-1.5",children:[t&&jsx(_,{htmlFor:c,className:l(n&&"opacity-50 cursor-not-allowed"),children:t}),jsx("textarea",{ref:s,id:c,disabled:n,className:l("w-full rounded-2xl bg-gray-50 dark:bg-white/[0.04] px-4 py-3","border border-gray-200 dark:border-white/[0.10]","text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-white/30","focus:outline-none focus:ring-2 focus:ring-purple-400/30","resize-none","disabled:cursor-not-allowed disabled:opacity-50",r&&"border-rose-400/25 focus:ring-rose-300/25",e),...a}),r&&jsx("p",{className:"text-xs text-rose-400 animate-in slide-in-from-top-1 fade-in duration-200",children:r})]})});hr.displayName="Textarea";var Ql=we__default.forwardRef((e,t)=>{let[r,o]=useState(false);return jsx(wt,{...e,ref:t,type:r?"text":"password",rightIcon:jsx(R,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0 hover:bg-white/10",onClick:()=>o(!r),"aria-label":r?"Hide password":"Show password",children:r?jsx(EyeOff,{className:"h-4 w-4 text-gray-400 dark:text-white/35"}):jsx(Eye,{className:"h-4 w-4 text-gray-400 dark:text-white/35"})})})});Ql.displayName="PasswordInput";var ec=cva("inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-xs font-medium whitespace-nowrap transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-gray-100 text-gray-700 border-gray-200 dark:bg-white/[0.06] dark:text-white/70 dark:border-white/10",neutral:"bg-gray-100 text-gray-700 border-gray-200 dark:bg-white/[0.06] dark:text-white/70 dark:border-white/10",success:"bg-emerald-100 text-emerald-700 border-emerald-200 dark:bg-emerald-400/15 dark:text-emerald-200 dark:border-emerald-400/20",warning:"bg-amber-100 text-amber-700 border-amber-200 dark:bg-amber-400/15 dark:text-amber-200 dark:border-amber-400/20",danger:"bg-rose-100 text-rose-700 border-rose-200 dark:bg-rose-400/15 dark:text-rose-200 dark:border-rose-400/20",info:"bg-sky-100 text-sky-700 border-sky-200 dark:bg-sky-400/15 dark:text-sky-200 dark:border-sky-400/20",outline:"bg-transparent text-white/60 border-white/10 hover:bg-white/[0.06]"}},defaultVariants:{variant:"default"}}),Ve=we__default.forwardRef(({className:e,variant:t,...r},o)=>jsx("span",{ref:o,className:l(ec({variant:t}),e),...r}));Ve.displayName="Badge";function Yv({label:e,placeholder:t="Add tag...",tags:r,onChange:o,error:n,className:a}){let[s,i]=useState(""),c=m=>{m.key==="Enter"&&s.trim()?(m.preventDefault(),r.includes(s.trim())||o([...r,s.trim()]),i("")):m.key==="Backspace"&&!s&&r.length>0&&o(r.slice(0,-1));},d=m=>{o(r.filter(u=>u!==m));};return jsxs("div",{className:l("flex flex-col gap-1.5",a),children:[e&&jsx(_,{children:e}),jsxs("div",{className:l("flex flex-wrap gap-2 rounded-2xl bg-gray-50 dark:bg-white/[0.04] px-3 py-2 border border-gray-200 dark:border-white/[0.10] focus-within:ring-2 focus-within:ring-purple-400/30 transition-all duration-200",n&&"border-rose-400/25"),children:[r.map(m=>jsxs(Ve,{variant:"default",className:"gap-1 pr-1",children:[m,jsx("button",{type:"button",onClick:()=>d(m),className:"rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10 transition-colors",children:jsx(X,{className:"h-3 w-3"})})]},m)),jsx("input",{type:"text",value:s,onChange:m=>i(m.target.value),onKeyDown:c,placeholder:r.length===0?t:"",className:"flex-1 bg-transparent py-1 text-sm outline-none placeholder:text-gray-400 dark:placeholder:text-white/30 min-w-[120px]"})]}),n&&jsx("p",{className:"text-xs text-rose-400 animate-in slide-in-from-top-1 fade-in duration-200",children:n})]})}function jv({label:e,value:t,onChange:r,error:o,className:n}){return jsxs("div",{className:l("flex flex-col gap-1.5",n),children:[e&&jsx(_,{children:e}),jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:"h-10 w-10 rounded-xl border border-gray-200 dark:border-white/10 overflow-hidden relative",style:{backgroundColor:t},children:jsx("input",{type:"color",value:t,onChange:a=>r(a.target.value),className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full"})}),jsx("input",{type:"text",value:t,onChange:a=>r(a.target.value),className:"flex-1 rounded-2xl bg-gray-50 dark:bg-white/[0.04] px-4 py-2 border border-gray-200 dark:border-white/[0.10] text-sm focus:outline-none focus:ring-2 focus:ring-purple-400/30 transition-all"})]}),o&&jsx("p",{className:"text-xs text-rose-400",children:o})]})}var Nn=createContext({}),sc=we__default.forwardRef(({className:e,value:t,onChange:r,name:o,disabled:n,label:a,children:s,...i},c)=>{let d=we__default.useId();return jsxs("div",{ref:c,className:l("flex flex-col gap-2",e),...i,children:[a&&jsx(_,{className:l(n&&"opacity-50 cursor-not-allowed"),children:a}),jsx("div",{className:"flex flex-col gap-2",role:"radiogroup",children:jsx(Nn.Provider,{value:{value:t,onChange:r,name:o||d,disabled:n},children:s})})]})});sc.displayName="RadioGroup";var ic=we__default.forwardRef(({className:e,value:t,label:r,disabled:o,...n},a)=>{let s=useContext(Nn),i=s.value===t,c=s.disabled||o,d=we__default.useId();return jsxs("label",{htmlFor:d,className:l("flex items-center gap-3 cursor-pointer group",c&&"cursor-not-allowed opacity-50",e),children:[jsxs("div",{className:"relative flex items-center justify-center",children:[jsx("input",{ref:a,id:d,type:"radio",name:s.name,value:t,checked:i,disabled:c,onChange:m=>{m.target.checked&&s.onChange?.(t);},className:"peer sr-only",...n}),jsx("div",{className:l("h-5 w-5 rounded-full border border-gray-300 dark:border-white/20 bg-gray-50 dark:bg-white/[0.03] transition-all duration-200","peer-focus-visible:ring-2 peer-focus-visible:ring-gray-400 dark:peer-focus-visible:ring-white/20 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-white dark:peer-focus-visible:ring-offset-[#0A0A0A]","group-hover:bg-gray-100 dark:group-hover:bg-white/[0.05]",i&&"border-gray-900 bg-gray-900 dark:border-white dark:bg-white"),children:i&&jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsx("div",{className:"h-2 w-2 rounded-full bg-white dark:bg-black"})})})]}),r&&jsx("span",{className:"text-sm text-gray-900 dark:text-white/90 select-none font-medium",children:r})]})});ic.displayName="RadioGroupItem";var vr=we__default.createContext({}),lc=we__default.forwardRef(({className:e,...t},r)=>{let o=we__default.useId();return jsx(vr.Provider,{value:{id:o},children:jsx("div",{ref:r,className:l("space-y-2",e),...t})})});lc.displayName="FormItem";var cc=we__default.forwardRef(({className:e,...t},r)=>{let{id:o}=we__default.useContext(vr);return jsx(_,{ref:r,className:l("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),htmlFor:o,...t})});cc.displayName="FormLabel";var dc=we__default.forwardRef(({...e},t)=>{let{id:r}=we__default.useContext(vr),{children:o,...n}=e;return we__default.isValidElement(o)?we__default.cloneElement(o,{id:r,"aria-describedby":`${r}-description ${r}-message`,...n,...o.props}):jsx("div",{ref:t,...e})});dc.displayName="FormControl";var mc=we__default.forwardRef(({className:e,...t},r)=>{let{id:o}=we__default.useContext(vr);return jsx("p",{ref:r,id:`${o}-description`,className:l("text-xs text-white/50",e),...t})});mc.displayName="FormDescription";var uc=we__default.forwardRef(({className:e,children:t,...r},o)=>{let{id:n}=we__default.useContext(vr);return t?jsx("p",{ref:o,id:`${n}-message`,className:l("text-xs font-medium text-rose-500",e),...r,children:t}):null});uc.displayName="FormMessage";var bc=cva("relative flex flex-col items-center justify-center rounded-2xl border-2 border-dashed transition-all duration-200 text-center",{variants:{isDragActive:{true:"border-blue-500 bg-blue-50 dark:bg-blue-500/10",false:"border-gray-200 bg-gray-50 hover:bg-gray-100 dark:border-white/10 dark:bg-white/[0.02] dark:hover:bg-white/[0.05]"},error:{true:"border-rose-500 bg-rose-50 dark:bg-rose-500/10",false:""}},defaultVariants:{isDragActive:false,error:false}}),xc=we__default.forwardRef(({className:e,onDrop:t,maxFiles:r=1,maxSize:o,label:n="Upload files",description:a="Drag & drop or click to upload",...s},i)=>{let[c,d]=useState(false),[m,u]=useState([]),[f,g]=useState(null),x=we__default.useRef(null),v=y=>{y.preventDefault(),d(true);},h=y=>{y.preventDefault(),d(false);},p=y=>r&&y.length>r?(g(`Max ${r} files allowed`),false):o&&y.some(C=>C.size>o)?(g(`File too large (max ${o/1024/1024}MB)`),false):(g(null),true),b=y=>{y.preventDefault(),d(false);let N=Array.from(y.dataTransfer.files);p(N)&&(u(N),t?.(N));},w=y=>{if(y.target.files){let N=Array.from(y.target.files);p(N)&&(u(N),t?.(N));}},k=(y,N)=>{N.stopPropagation();let C=m.filter((T,L)=>L!==y);u(C),t?.(C);};return jsxs("div",{className:"w-full space-y-4",children:[jsxs("div",{ref:i,className:l(bc({isDragActive:c,error:!!f,className:e}),"p-8 cursor-pointer"),onDragOver:v,onDragLeave:h,onDrop:b,onClick:()=>x.current?.click(),...s,children:[jsx("input",{ref:x,type:"file",className:"hidden",multiple:r>1,onChange:w}),jsx("div",{className:"mb-4 rounded-full bg-gray-100 p-3 dark:bg-white/[0.06]",children:jsx(Upload,{className:"h-6 w-6 text-gray-500 dark:text-white/70"})}),jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:n}),jsx("div",{className:"mt-1 text-xs text-gray-500 dark:text-white/50",children:a}),f&&jsx("div",{className:"mt-2 text-xs font-medium text-rose-500",children:f})]}),m.length>0&&jsx("div",{className:"grid gap-2",children:m.map((y,N)=>jsxs("div",{className:"flex items-center justify-between rounded-xl border border-gray-200 bg-white p-3 dark:border-white/10 dark:bg-white/[0.03]",children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-gray-100 dark:bg-white/[0.06]",children:jsx(File,{className:"h-4 w-4 text-gray-500 dark:text-white/70"})}),jsxs("div",{className:"flex flex-col",children:[jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white truncate max-w-[200px]",children:y.name}),jsxs("span",{className:"text-xs text-gray-500 dark:text-white/50",children:[(y.size/1024).toFixed(1)," KB"]})]})]}),jsx("button",{onClick:C=>k(N,C),className:"rounded-full p-1 hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50",children:jsx(X,{className:"h-4 w-4"})})]},N))})]})});xc.displayName="FileDropzone";var Tc=cva("flex items-center gap-2",{variants:{size:{sm:"[&>input]:h-8 [&>input]:w-8 [&>input]:text-sm",md:"[&>input]:h-10 [&>input]:w-10 [&>input]:text-base",lg:"[&>input]:h-12 [&>input]:w-12 [&>input]:text-lg"}},defaultVariants:{size:"md"}}),Cc=we__default.forwardRef(({className:e,size:t,length:r=6,value:o="",onChange:n,onComplete:a,disabled:s,error:i,...c},d)=>{let[m,u]=useState(new Array(r).fill("")),f=useRef([]);useEffect(()=>{let h=o.split("").slice(0,r),p=[...h,...new Array(r-h.length).fill("")];u(p);},[o,r]);let g=(h,p)=>{let b=h.target.value;if(isNaN(Number(b)))return;let w=[...m];w[p]=b.substring(b.length-1),u(w);let k=w.join("");n?.(k),b&&p<r-1&&f.current[p+1]?.focus(),k.length===r&&a?.(k);},x=(h,p)=>{h.key==="Backspace"&&!m[p]&&p>0&&f.current[p-1]?.focus();},v=h=>{h.preventDefault();let p=h.clipboardData.getData("text/plain").slice(0,r);if(!/^\d+$/.test(p))return;let b=[...m];p.split("").forEach((k,y)=>{b[y]=k;}),u(b);let w=b.join("");n?.(w),w.length===r&&a?.(w),f.current[Math.min(p.length,r-1)]?.focus();};return jsx("div",{ref:d,className:l(Tc({size:t,className:e})),...c,children:m.map((h,p)=>jsx("input",{ref:b=>f.current[p]=b,type:"text",inputMode:"numeric",maxLength:1,value:h,disabled:s,onChange:b=>g(b,p),onKeyDown:b=>x(b,p),onPaste:v,className:l("rounded-2xl border bg-gray-50 text-center font-semibold transition-all duration-200","focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 focus:outline-none","disabled:opacity-50 disabled:cursor-not-allowed","dark:bg-white/[0.03] dark:text-white",i?"border-rose-500 text-rose-500 focus:border-rose-500 focus:ring-rose-500/20":"border-gray-200 dark:border-white/10")},p))})});Cc.displayName="OTPInput";var Ec=cva("flex items-center rounded-2xl border bg-gray-50 dark:bg-white/[0.03] dark:border-white/10",{variants:{size:{sm:"h-8",md:"h-10",lg:"h-12"},error:{true:"border-rose-500",false:"border-gray-200"}},defaultVariants:{size:"md",error:false}}),Sc=we__default.forwardRef(({className:e,size:t,error:r,value:o=0,onChange:n,min:a=-1/0,max:s=1/0,step:i=1,disabled:c,...d},m)=>{let u=()=>{o-i>=a&&n?.(o-i);},f=()=>{o+i<=s&&n?.(o+i);},g=x=>{let v=parseFloat(x.target.value);isNaN(v)||n?.(v);};return jsxs("div",{className:l(Ec({size:t,error:r,className:e})),children:[jsx("button",{type:"button",onClick:u,disabled:c||o<=a,className:"flex h-full items-center justify-center px-3 text-gray-500 hover:text-gray-900 disabled:opacity-50 dark:text-white/50 dark:hover:text-white",children:jsx(Minus,{className:"h-3.5 w-3.5"})}),jsx("div",{className:"h-full w-px bg-gray-200 dark:bg-white/[0.06]"}),jsx("input",{ref:m,type:"number",value:o,onChange:g,disabled:c,className:"h-full w-full min-w-[3rem] bg-transparent text-center text-sm font-medium text-gray-900 focus:outline-none dark:text-white",...d}),jsx("div",{className:"h-full w-px bg-gray-200 dark:bg-white/[0.06]"}),jsx("button",{type:"button",onClick:f,disabled:c||o>=s,className:"flex h-full items-center justify-center px-3 text-gray-500 hover:text-gray-900 disabled:opacity-50 dark:text-white/50 dark:hover:text-white",children:jsx(Plus,{className:"h-3.5 w-3.5"})})]})});Sc.displayName="NumberInput";var Ic=cva("inline-flex items-center rounded-2xl border border-gray-200 bg-gray-50 p-1 dark:border-white/10 dark:bg-white/[0.03]",{variants:{size:{sm:"h-8",md:"h-10",lg:"h-12"},fullWidth:{true:"w-full flex",false:""}},defaultVariants:{size:"md",fullWidth:false}}),Ac=cva("inline-flex items-center justify-center whitespace-nowrap rounded-2xl px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-gray-950 dark:focus-visible:ring-gray-300",{variants:{selected:{true:"bg-white text-gray-950 shadow-sm dark:bg-gray-800 dark:text-gray-50",false:"text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-50"},fullWidth:{true:"flex-1",false:""}},defaultVariants:{selected:false,fullWidth:false}}),Bc=we__default.forwardRef(({className:e,size:t,fullWidth:r,value:o,onChange:n,options:a,...s},i)=>jsx("div",{ref:i,className:l(Ic({size:t,fullWidth:r,className:e})),...s,children:a.map(c=>jsxs("button",{type:"button",onClick:()=>n?.(c.value),className:l(Ac({selected:o===c.value,fullWidth:r})),children:[c.icon&&jsx("span",{className:"mr-2",children:c.icon}),c.label]},c.value))}));Bc.displayName="ToggleGroup";var Ln={loading:jsx("svg",{className:"animate-spin text-blue-500",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),success:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-emerald-400",children:[jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),error:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-rose-400",children:[jsx("circle",{cx:"12",cy:"12",r:"10"}),jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),warning:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-amber-400",children:[jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),info:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-blue-400",children:[jsx("circle",{cx:"12",cy:"12",r:"10"}),jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})},Pn=({id:e,title:t,description:r,variant:o="default",duration:n=5e3,onDismiss:a})=>(useEffect(()=>{if(n===1/0)return;let s=setTimeout(()=>{a(e);},n);return ()=>clearTimeout(s)},[n,e,a]),jsxs("div",{role:"alert",className:l("pointer-events-auto relative flex w-full max-w-sm items-start gap-4 overflow-hidden rounded-2xl border p-4 shadow-lg transition-all","animate-in slide-in-from-right-full fade-in duration-300","bg-white dark:bg-[#0A0A0A]/90 backdrop-blur-md border-gray-200 dark:border-white/10",o==="error"&&"border-rose-200 dark:border-rose-500/30 bg-rose-50 dark:bg-rose-500/10",o==="success"&&"border-emerald-200 dark:border-emerald-500/20 bg-emerald-50 dark:bg-emerald-950/10",o==="warning"&&"border-amber-200 dark:border-amber-500/20 bg-amber-50 dark:bg-amber-950/10",o==="info"&&"border-blue-200 dark:border-blue-500/20 bg-blue-50 dark:bg-blue-950/10",o==="loading"&&"border-blue-200 dark:border-blue-500/20 bg-blue-50 dark:bg-blue-950/10"),children:[o!=="default"&&Ln[o]&&jsx("div",{className:"shrink-0 pt-0.5",children:Ln[o]}),jsxs("div",{className:"flex-1 gap-1",children:[t&&jsx("div",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:t}),r&&jsx("div",{className:"text-sm text-gray-600 dark:text-white/80",children:r})]}),jsx("button",{onClick:()=>a(e),className:"shrink-0 rounded-md p-1 text-gray-400 dark:text-white/50 opacity-0 transition-opacity hover:text-gray-900 dark:hover:text-white group-hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/20",children:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}));var Ko=createContext(void 0);function $w({children:e}){let[t,r]=useState([]),o=useCallback(i=>{r(c=>c.filter(d=>d.id!==i));},[]),n=useCallback(i=>{let c=Math.random().toString(36).substring(2,9);return r(d=>[...d,{...i,id:c,onDismiss:o}]),c},[o]),a=useCallback((i,c)=>{r(d=>d.map(m=>m.id===i?{...m,...c}:m));},[]),s=useCallback(async(i,c)=>{let d=typeof c.loading=="string"?{title:c.loading,variant:"loading"}:{variant:"loading",...c.loading},m=n({...d,duration:1/0});try{let u=await i,f=typeof c.success=="function"?c.success(u):typeof c.success=="string"?{title:c.success,variant:"success"}:c.success;return a(m,{...f,duration:5e3}),u}catch(u){let f=typeof c.error=="function"?c.error(u):typeof c.error=="string"?{title:c.error,variant:"error"}:c.error;throw a(m,{...f,duration:5e3}),u}},[n,a]);return jsxs(Ko.Provider,{value:{toast:n,dismiss:o,promise:s},children:[e,jsx("div",{className:"fixed bottom-0 right-0 z-[150] flex max-h-screen w-full flex-col-reverse gap-2 p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",children:t.map(i=>jsx(Pn,{...i},i.id))})]})}var Uc={success:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-emerald-400",children:[jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),error:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-rose-400",children:[jsx("circle",{cx:"12",cy:"12",r:"10"}),jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),warning:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-amber-400",children:[jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),info:jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-blue-400",children:[jsx("circle",{cx:"12",cy:"12",r:"10"}),jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})},Wc=we__default.forwardRef(({className:e,variant:t="default",icon:r,title:o,children:n,...a},s)=>{let i=r||(t!=="default"?Uc[t]:null);return jsxs("div",{ref:s,role:"alert",className:l("relative w-full rounded-2xl border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-gray-900 dark:[&>svg]:text-white","bg-white dark:bg-[#0A0A0A]/50 backdrop-blur-md border-gray-200 dark:border-white/10 text-gray-900 dark:text-white",t==="error"&&"border-rose-200 dark:border-rose-500/20 bg-rose-50 dark:bg-rose-950/10 text-rose-900 dark:text-rose-50 [&>svg]:text-rose-600 dark:[&>svg]:text-rose-400",t==="success"&&"border-emerald-200 dark:border-emerald-500/20 bg-emerald-50 dark:bg-emerald-950/10 text-emerald-900 dark:text-emerald-50 [&>svg]:text-emerald-600 dark:[&>svg]:text-emerald-400",t==="warning"&&"border-amber-200 dark:border-amber-500/20 bg-amber-50 dark:bg-amber-950/10 text-amber-900 dark:text-amber-50 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-400",t==="info"&&"border-blue-200 dark:border-blue-500/20 bg-blue-50 dark:bg-blue-950/10 text-blue-900 dark:text-blue-50 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400",e),...a,children:[i,jsxs("div",{className:"flex flex-col gap-1",children:[o&&jsx("h5",{className:"mb-1 font-medium leading-none tracking-tight",children:o}),n&&jsx("div",{className:"text-sm opacity-90 [&_p]:leading-relaxed",children:n})]})]})});Wc.displayName="Alert";var _c=we__default.forwardRef(({className:e,value:t=0,max:r=100,variant:o="default",size:n="md",isIndeterminate:a=false,hasStripe:s=false,indicatorClassName:i,...c},d)=>{let m=a?0:Math.min(Math.max((t||0)/r,0),1)*100,u={default:"bg-gray-900 dark:bg-white dark:shadow-[0_0_10px_rgba(255,255,255,0.5)]",success:"bg-emerald-500 shadow-sm dark:shadow-[0_0_10px_rgba(16,185,129,0.5)]",warning:"bg-amber-500 shadow-sm dark:shadow-[0_0_10px_rgba(245,158,11,0.5)]",danger:"bg-rose-500 shadow-sm dark:shadow-[0_0_10px_rgba(244,63,94,0.5)]",gradient:"bg-gradient-to-r from-blue-600 via-purple-600 to-blue-600 shadow-sm dark:shadow-[0_0_15px_rgba(99,102,241,0.5)]"};return jsx("div",{ref:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":a?void 0:t,className:l("relative w-full overflow-hidden rounded-full bg-gray-200 dark:bg-white/[0.03] border border-gray-200 dark:border-white/5 backdrop-blur-sm",{sm:"h-1",md:"h-2",lg:"h-4"}[n],e),...c,children:jsx("div",{className:l("h-full w-full flex-1 transition-all duration-500 ease-in-out relative overflow-hidden",u[o],a&&"absolute inset-0 w-full origin-left animate-indeterminate-progress",i),style:{transform:a?void 0:`translateX(-${100-m}%)`},children:s&&!a&&jsx("div",{className:"absolute inset-0 w-full h-full animate-progress-stripe",style:{backgroundImage:"linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)",backgroundSize:"1rem 1rem"}})})})});_c.displayName="Progress";var Gc=we__default.forwardRef(({icon:e,title:t,description:r,action:o,className:n,...a},s)=>jsx(ne,{ref:s,className:l("p-8 text-center",n),...a,children:jsxs("div",{className:"mx-auto w-full max-w-md space-y-3",children:[jsx("div",{className:"mx-auto grid h-12 w-12 place-items-center rounded-2xl border border-white/10 bg-white/[0.03] text-white/70",children:e??jsx(Info,{className:"h-5 w-5"})}),jsx("div",{className:"text-lg font-semibold text-white",children:t}),r?jsx("div",{className:"text-sm text-white/55",children:r}):null,o?jsx("div",{className:"pt-2 flex justify-center",children:o}):null]})}));Gc.displayName="EmptyState";function Sn({className:e,variant:t="default",...r}){return jsx("div",{className:l("animate-pulse bg-gray-200 dark:bg-white/[0.03]",t==="circle"&&"rounded-full",t==="default"&&"rounded-2xl",t==="text"&&"rounded h-4 w-full",e),...r})}var td=we__default.forwardRef(({className:e,max:t=5,value:r=0,onChange:o,readOnly:n=false,size:a="md",...s},i)=>{let[c,d]=useState(null),m={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"};return jsx("div",{ref:i,className:l("flex items-center gap-1",e),...s,children:Array.from({length:t}).map((u,f)=>{let g=f+1,x=(c!==null?c:r)>=g;return jsx("button",{type:"button",disabled:n,onClick:()=>o?.(g),onMouseEnter:()=>!n&&d(g),onMouseLeave:()=>!n&&d(null),className:l("transition-transform hover:scale-110 focus:outline-none",n&&"cursor-default hover:scale-100"),children:jsx(Star,{className:l(m[a],"transition-colors duration-200",x?"fill-amber-400 text-amber-400":"fill-transparent text-gray-300 dark:text-white/20")})},f)})})});td.displayName="Rating";var Dn=cva("transition-all duration-700 ease-out",{variants:{preset:{fade:"opacity-0 translate-y-4",spring:"opacity-0 scale-95 translate-y-4","slide-right":"opacity-0 -translate-x-8","slide-left":"opacity-0 translate-x-8",blur:"opacity-0 blur-sm scale-105","3d-flip":"opacity-0 rotate-x-90"},visibleState:{fade:"opacity-100 translate-y-0",spring:"opacity-100 scale-100 translate-y-0 animate-enter-spring","slide-right":"opacity-100 translate-x-0","slide-left":"opacity-100 translate-x-0",blur:"opacity-100 blur-0 scale-100","3d-flip":"opacity-100 rotate-x-0"}},defaultVariants:{preset:"spring"}});function Hn({className:e,preset:t="spring",viewport:r=true,visible:o,delay:n=0,once:a=true,asChild:s=false,children:i,style:c,...d}){let{ref:m,isInView:u,hasAnimated:f}=$e({threshold:.1,enabled:r&&o===void 0}),x=o!==void 0?o:r?a?f:u:true,v=Dn({preset:t}),h=x?Dn({visibleState:t}):"";return jsx(s?vt:"div",{ref:m,className:l(v,h,e),style:{transitionDelay:`${n}ms`,willChange:"transform, opacity",...c},...d,children:i})}function yy({children:e,stagger:t=100,delay:r=0,className:o,...n}){let{ref:a,hasAnimated:s}=$e({threshold:.1});return jsx("div",{ref:a,className:l("relative",o),...n,children:we__default.Children.map(e,(i,c)=>we__default.isValidElement(i)?we__default.cloneElement(i,{visible:s,viewport:false,delay:r+c*t}):i)})}function My({text:e,type:t="char",stagger:r=30,delay:o=0,className:n,...a}){let{ref:s,hasAnimated:i}=$e({threshold:.2}),c=t==="char"?e.split(""):e.split(" ");return jsx("div",{ref:s,className:l("flex flex-wrap",n),"aria-label":e,...a,children:c.map((d,m)=>jsxs("span",{className:l("inline-block whitespace-pre transition-all duration-500 ease-out will-change-transform",i?"opacity-100 translate-y-0 blur-0":"opacity-0 translate-y-4 blur-sm"),style:{transitionDelay:`${o+m*r}ms`},children:[d,t==="word"&&m!==c.length-1?" ":""]},m))})}function Dy({children:e,speed:t=.1,direction:r="vertical",className:o,...n}){let a=useRef(null);return useEffect(()=>{let s=a.current;if(!s)return;let i=()=>{let c=s.getBoundingClientRect(),d=window.innerHeight;if(c.top>d||c.bottom<0)return;let u=(d/2-(c.top+c.height/2))*t;r==="vertical"?s.style.transform=`translate3d(0, ${u}px, 0)`:s.style.transform=`translate3d(${u}px, 0, 0)`;};return window.addEventListener("scroll",i,{passive:true}),i(),()=>window.removeEventListener("scroll",i)},[t,r]),jsx("div",{ref:a,className:l("will-change-transform",o),...n,children:e})}function zy({children:e,strength:t=.5,className:r}){let o=useRef(null),n=s=>{let i=o.current;if(!i)return;let{clientX:c,clientY:d}=s,{left:m,top:u,width:f,height:g}=i.getBoundingClientRect(),x=m+f/2,v=u+g/2,h=c-x,p=d-v,b=Math.max(f,g)*1.5;Math.abs(h)<b&&Math.abs(p)<b?(i.style.setProperty("--mag-x",`${h*t}px`),i.style.setProperty("--mag-y",`${p*t}px`)):(i.style.setProperty("--mag-x","0px"),i.style.setProperty("--mag-y","0px"));},a=()=>{let s=o.current;s&&(s.style.setProperty("--mag-x","0px"),s.style.setProperty("--mag-y","0px"));};return useEffect(()=>(window.addEventListener("mousemove",n),()=>window.removeEventListener("mousemove",n)),[t]),jsx("div",{ref:o,className:l("inline-block transition-transform duration-300 ease-out will-change-transform",r),onMouseLeave:a,style:{transform:"translate3d(var(--mag-x, 0px), var(--mag-y, 0px), 0)"},children:e})}function _y({value:e,duration:t=2e3,delay:r=0,decimalPlaces:o=0,className:n,...a}){let[s,i]=useState(0),{ref:c,hasAnimated:d}=$e({threshold:.1}),m=useRef(null);return useEffect(()=>{if(!d)return;let u=g=>{m.current||(m.current=g);let x=Math.min((g-m.current-r)/t,1);if(x>=0){let v=x*e;i(v);}x<1&&requestAnimationFrame(u);},f=setTimeout(()=>{requestAnimationFrame(u);},r);return ()=>clearTimeout(f)},[d,e,t,r]),jsx("span",{ref:c,className:l("tabular-nums tracking-tighter",n),...a,children:s.toFixed(o)})}function Qy({variant:e="spinner",text:t,fullscreen:r=true,className:o,...n}){let a=r?"fixed inset-0 z-[200] flex items-center justify-center bg-white/80 dark:bg-black/80 backdrop-blur-sm":"flex items-center justify-center p-8 w-full h-full min-h-[200px]";return e==="bar"?jsx("div",{className:l("fixed top-0 left-0 right-0 z-[200] h-1 bg-transparent",o),...n,children:jsx("div",{className:"h-full bg-blue-500 animate-indeterminate-progress origin-left"})}):e==="dots"?jsxs("div",{className:l(a,o),...n,children:[jsxs("div",{className:"flex space-x-2",children:[jsx("div",{className:"h-3 w-3 rounded-full bg-blue-500 animate-bounce [animation-delay:-0.3s]"}),jsx("div",{className:"h-3 w-3 rounded-full bg-blue-500 animate-bounce [animation-delay:-0.15s]"}),jsx("div",{className:"h-3 w-3 rounded-full bg-blue-500 animate-bounce"})]}),t&&jsx("span",{className:"ml-4 text-sm font-medium text-gray-500 dark:text-white/70",children:t})]}):e==="logo"?jsx("div",{className:l(a,o),...n,children:jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center rounded-full bg-white dark:bg-white/[0.06] shadow-lg ring-1 ring-black/5",children:[jsx("div",{className:"absolute inset-0 rounded-full animate-ping bg-blue-500/20"}),jsx("div",{className:"h-8 w-8 rounded bg-blue-500"})]}),t&&jsx("span",{className:"text-sm font-medium text-gray-500 dark:text-white/70 animate-pulse",children:t})]})}):e==="glass"?jsx("div",{className:l(a,"bg-white/30 dark:bg-black/30 backdrop-blur-md",o),...n,children:jsxs("div",{className:"flex flex-col items-center gap-3",children:[jsx(Loader2,{className:"h-8 w-8 animate-spin text-white"}),t&&jsx("span",{className:"text-sm font-medium text-white tracking-wider",children:t})]})}):jsx("div",{className:l(a,o),...n,children:jsxs("div",{className:"flex flex-col items-center gap-3",children:[jsx(Loader2,{className:"h-8 w-8 animate-spin text-blue-500"}),t&&jsx("span",{className:"text-sm font-medium text-gray-500 dark:text-white/70",children:t})]})})}function ok({preset:e="fade",duration:t=300,useViewTransition:r=false,className:o,children:n,...a}){let[s,i]=useState(false);useEffect(()=>{if(r&&document.startViewTransition)document.startViewTransition(()=>{i(true);});else {let m=requestAnimationFrame(()=>{i(true);});return ()=>cancelAnimationFrame(m)}},[r]);let d={fade:{initial:"opacity-0",animate:"opacity-100"},"slide-up":{initial:"opacity-0 translate-y-8",animate:"opacity-100 translate-y-0"},scale:{initial:"opacity-0 scale-95",animate:"opacity-100 scale-100"},blur:{initial:"opacity-0 blur-sm",animate:"opacity-100 blur-0"},none:{initial:"",animate:""}}[e];return jsx("div",{className:l("transition-all ease-out",s?d.animate:d.initial,o),style:{transitionDuration:`${t}ms`,viewTransitionName:r?"page-content":void 0},...a,children:n})}var Nd={sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-14 w-14 text-base",xl:"h-20 w-20 text-xl"},z=we__default.forwardRef(({className:e,src:t,alt:r,fallback:o,size:n="md",...a},s)=>{let[i,c]=useState(false);return useEffect(()=>{c(false);},[t]),jsx("div",{ref:s,className:l("relative flex shrink-0 overflow-hidden rounded-full bg-gray-200 dark:bg-white/[0.06]",Nd[n],e),...a,children:t&&!i?jsx("img",{src:t,alt:r,className:"aspect-square h-full w-full object-cover",onError:()=>c(true)}):jsx("div",{className:"flex h-full w-full items-center justify-center bg-gray-100 dark:bg-white/5 text-gray-600 dark:text-white/70 font-medium",children:o||(r?r.charAt(0).toUpperCase():"?")})})});z.displayName="Avatar";var Yo=createContext(void 0);function fk({type:e="single",defaultValue:t,value:r,onValueChange:o,className:n,children:a,...s}){let[i,c]=useState(t||(e==="multiple"?[]:"")),d=r!==void 0?r:i,m=u=>{let f;if(e==="multiple"){let g=Array.isArray(d)?d:[];g.includes(u)?f=g.filter(x=>x!==u):f=[...g,u];}else f=d===u?"":u;r===void 0&&c(f),o?.(f);};return jsx(Yo.Provider,{value:{value:d,onValueChange:m,type:e},children:jsx("div",{className:l("space-y-2",n),...s,children:a})})}var _o=createContext({value:"",isOpen:false});function gk({className:e,value:t,children:r,...o}){let n=useContext(Yo),a=Array.isArray(n?.value)?n?.value.includes(t):n?.value===t;return jsx(_o.Provider,{value:{value:t,isOpen:!!a},children:jsx("div",{className:l("overflow-hidden rounded-2xl border border-gray-200 dark:border-white/5 bg-gray-50 dark:bg-white/[0.03] transition-all duration-200",a&&"bg-white dark:bg-white/[0.04] border-gray-300 dark:border-white/10",e),...o,children:r})})}function hk({className:e,children:t,...r}){let o=useContext(Yo),{value:n,isOpen:a}=useContext(_o);return jsxs("button",{type:"button",onClick:()=>o?.onValueChange(n),"aria-expanded":a,"aria-controls":`accordion-content-${n}`,id:`accordion-trigger-${n}`,className:l("flex w-full items-center justify-between px-4 py-3 text-sm font-medium text-gray-900 dark:text-white transition-all hover:text-gray-700 dark:hover:text-white/90 focus:outline-none",e),...r,children:[t,jsx(ChevronDown,{className:l("h-4 w-4 shrink-0 text-gray-400 dark:text-white/50 transition-transform duration-200",a&&"rotate-180 text-gray-900 dark:text-white")})]})}function bk({className:e,children:t,...r}){let{isOpen:o,value:n}=useContext(_o);return o?jsx("div",{id:`accordion-content-${n}`,role:"region","aria-labelledby":`accordion-trigger-${n}`,className:l("px-4 pb-3 pt-0 text-sm text-gray-600 dark:text-white/70 animate-in slide-in-from-top-1 fade-in duration-200",e),...r,children:t}):null}we__default.createContext(null);var wr=we__default.forwardRef(({className:e,wrapperClassName:t,rounded:r=false,maxHeight:o,...n},a)=>jsx(st,{className:l("w-full",r&&"rounded-2xl border border-white/10",t),style:{maxHeight:o},orientation:o?"both":"horizontal",scrollbarSize:"sm",children:jsx("table",{ref:a,className:l("w-full caption-bottom text-sm text-left",e),...n})}));wr.displayName="Table";var yr=we__default.forwardRef(({className:e,...t},r)=>jsx("thead",{ref:r,className:l("bg-white/[0.02] text-white/55",e),...t}));yr.displayName="TableHeader";var kr=we__default.forwardRef(({className:e,...t},r)=>jsx("tbody",{ref:r,className:l("[&_tr:last-child]:border-0",e),...t}));kr.displayName="TableBody";var ct=we__default.forwardRef(({className:e,hoverable:t=true,optimized:r=false,...o},n)=>jsx("tr",{ref:n,className:l("border-t border-white/10 transition-colors data-[state=selected]:bg-white/[0.04]",t&&"hover:bg-white/[0.02]",e),style:r?{contentVisibility:"auto",containIntrinsicSize:"0 56px"}:void 0,...o}));ct.displayName="TableRow";var et=we__default.forwardRef(({className:e,...t},r)=>jsx("th",{ref:r,className:l("h-10 px-5 py-3 text-left align-middle font-semibold text-white/55 [&:has([role=checkbox])]:pr-0 whitespace-nowrap",e),...t}));et.displayName="TableHead";var Ue=we__default.forwardRef(({className:e,...t},r)=>jsx("td",{ref:r,className:l("p-5 align-middle [&:has([role=checkbox])]:pr-0 text-white/85 whitespace-nowrap",e),...t}));Ue.displayName="TableCell";function Dk({data:e,columns:t,searchPlaceholder:r="Search...",searchKeys:o,onRowClick:n,className:a,maxHeight:s,rounded:i=true}){let[c,d]=useState(""),[m,u]=useState({key:"",direction:null}),f=useMemo(()=>{let x=[...e];return c&&o&&(x=x.filter(v=>o.some(h=>String(v[h]??"").toLowerCase().includes(c.toLowerCase())))),m.key&&m.direction&&x.sort((v,h)=>{let p=v[m.key],b=h[m.key];return p==null||b===void 0||b===null?0:p<b?m.direction==="asc"?-1:1:p>b?m.direction==="asc"?1:-1:0}),x},[e,c,o,m]),g=x=>{u(v=>({key:x,direction:v.key===x&&v.direction==="asc"?"desc":"asc"}));};return jsxs("div",{className:l("space-y-4",a),children:[o&&jsx("div",{className:"relative max-w-sm",children:jsx(wt,{placeholder:r,value:c,onChange:x=>d(x.target.value),leftIcon:jsx(Search,{className:"w-4 h-4 text-white/40"})})}),jsxs(wr,{rounded:i,maxHeight:s,children:[jsx(yr,{children:jsx(ct,{children:t.map(x=>jsx(et,{className:l(x.sortable&&"cursor-pointer select-none hover:text-cyan-500 transition-colors",x.className),onClick:()=>x.sortable&&g(x.key),children:jsxs("div",{className:"flex items-center gap-2",children:[x.header,x.sortable&&jsx("span",{className:"text-white/30",children:m.key===x.key?m.direction==="asc"?jsx(ArrowUp,{className:"w-3 h-3 text-cyan-500"}):jsx(ArrowDown,{className:"w-3 h-3 text-cyan-500"}):jsx(ArrowUpDown,{className:"w-3 h-3"})})]})},String(x.key)))})}),jsxs(kr,{children:[f.map((x,v)=>jsx(ct,{onClick:()=>n?.(x),className:l(n&&"cursor-pointer hover:bg-white/[0.03] transition-colors group"),children:t.map(h=>jsx(Ue,{className:h.className,children:h.render?h.render(x):x[h.key]},String(h.key)))},v)),f.length===0&&jsx(ct,{children:jsxs(Ue,{colSpan:t.length,className:"h-32 text-center text-white/40",children:['No results found for "',c,'"']})})]})]})]})}var qo=we__default.forwardRef(({className:e,containerClassName:t,alt:r,src:o,fallback:n,onLoad:a,onError:s,...i},c)=>{let[d,m]=useState(true),[u,f]=useState(false),g=v=>{m(false),a?.(v);},x=v=>{m(false),f(true),s?.(v);};return u&&n?jsx(Fragment,{children:n}):jsxs("div",{className:l("relative overflow-hidden rounded-2xl bg-gray-100 dark:bg-white/[0.02] border border-gray-200 dark:border-white/10",t),children:[d&&jsx(Sn,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:c,src:o,alt:r,onLoad:g,onError:x,className:l("h-full w-full object-cover transition-opacity duration-300",d?"opacity-0":"opacity-100",e),...i})]})});qo.displayName="Image";var Od=cva("flex flex-col gap-4 rounded-2xl border p-4 transition-all duration-200",{variants:{variant:{default:"bg-white border-gray-200 dark:bg-white/[0.03] dark:border-white/10",glass:"backdrop-blur-md bg-white/80 border-white/20 dark:bg-black/40 dark:border-white/10"}},defaultVariants:{variant:"default"}}),Vd=we__default.forwardRef(({className:e,variant:t,user:r,onFollow:o,onMessage:n,...a},s)=>jsxs("div",{ref:s,className:l(Od({variant:t,className:e})),...a,children:[jsxs("div",{className:"flex items-start justify-between",children:[jsxs("div",{className:"flex gap-3",children:[jsx(z,{src:r.avatarSrc,alt:r.name,size:"lg"}),jsxs("div",{children:[jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:r.name}),r.role&&jsx("span",{className:"text-xs text-gray-500 dark:text-white/50",children:r.role}),r.email&&jsx("div",{className:"text-xs text-gray-400 dark:text-white/40 mt-0.5",children:r.email})]})]}),o&&jsx(R,{size:"sm",variant:"outline",onClick:o,children:"Follow"})]}),r.bio&&jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 line-clamp-2",children:r.bio}),r.stats&&jsx("div",{className:"flex gap-4 border-t border-gray-100 pt-3 dark:border-white/5",children:r.stats.map((i,c)=>jsxs("div",{className:"flex flex-col",children:[jsx("span",{className:"text-xs font-medium text-gray-900 dark:text-white",children:i.value}),jsx("span",{className:"text-[10px] text-gray-500 dark:text-white/40",children:i.label})]},c))}),n&&jsx(R,{className:"w-full mt-2",onClick:n,children:"Message"})]}));Vd.displayName="UserPreview";var $d=cva("relative pl-8 pb-8 last:pb-0",{variants:{status:{default:"[&>div:first-child]:bg-gray-200 dark:[&>div:first-child]:bg-white/20",active:"[&>div:first-child]:bg-blue-500",success:"[&>div:first-child]:bg-emerald-500",error:"[&>div:first-child]:bg-rose-500"}},defaultVariants:{status:"default"}}),Fd=we__default.forwardRef(({className:e,status:t,title:r,date:o,description:n,icon:a,isLast:s,...i},c)=>jsxs("div",{ref:c,className:l($d({status:t,className:e})),...i,children:[!s&&jsx("div",{className:"absolute left-[11px] top-[24px] bottom-0 w-px bg-gray-200 dark:bg-white/[0.06]"}),jsx("div",{className:l("absolute left-0 top-1.5 flex h-6 w-6 items-center justify-center rounded-full border-2 border-white dark:border-black ring-1 ring-transparent transition-colors",t==="active"?"bg-blue-500 ring-blue-500/30":t==="success"?"bg-emerald-500 ring-emerald-500/30":t==="error"?"bg-rose-500 ring-rose-500/30":"bg-gray-200 dark:bg-white/20"),children:a&&jsx("span",{className:"text-white text-[10px]",children:a})}),jsxs("div",{className:"flex flex-col gap-1",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:r}),o&&jsx("span",{className:"text-xs text-gray-500 dark:text-white/40",children:o})]}),n&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:n})]})]}));Fd.displayName="TimelineItem";var jk=({children:e,className:t})=>jsx("div",{className:l("flex flex-col",t),children:e});var zn=({node:e,depth:t=0,onSelect:r})=>{let[o,n]=useState(false),a=e.children&&e.children.length>0,s=i=>{i.stopPropagation(),a&&n(!o),r?.(e);};return jsxs("div",{children:[jsxs("div",{className:l("flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-gray-700 transition-colors hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-white/[0.03] cursor-pointer"),style:{paddingLeft:`${t*12+8}px`},onClick:s,children:[a?jsx("span",{className:"text-gray-400 dark:text-white/40",children:o?jsx(ChevronDown,{className:"h-4 w-4"}):jsx(ChevronRight,{className:"h-4 w-4"})}):jsx("span",{className:"w-4"}),e.icon?jsx("span",{className:"text-gray-500 dark:text-white/50",children:e.icon}):jsx("span",{className:"text-blue-500 dark:text-blue-400",children:a?o?jsx(FolderOpen,{className:"h-4 w-4"}):jsx(Folder,{className:"h-4 w-4"}):jsx(File,{className:"h-4 w-4"})}),jsx("span",{className:"truncate",children:e.label})]}),o&&a&&jsx("div",{className:"animate-in slide-in-from-top-1 fade-in duration-200",children:e.children.map(i=>jsx(zn,{node:i,depth:t+1,onSelect:r},i.id))})]})},oN=({data:e,className:t,onSelect:r})=>jsx("div",{className:l("w-full select-none",t),children:e.map(o=>jsx(zn,{node:o,onSelect:r},o.id))});function Kn({title:e,view:t="board",onViewChange:r,onFilter:o,onSort:n,onAddColumn:a,canUndo:s,canRedo:i,onUndo:c,onRedo:d,className:m}){let u=[{id:"board",icon:Layout,label:"Board"},{id:"list",icon:List,label:"List"},{id:"calendar",icon:Calendar,label:"Calendar"},{id:"timeline",icon:Clock,label:"Timeline"}];return jsxs("div",{className:l("flex items-center justify-between mb-8",m),children:[jsxs("div",{className:"flex items-center gap-6",children:[jsx("h1",{className:"text-2xl font-bold text-white tracking-tight",children:e}),jsx("div",{className:"flex items-center bg-white/5 rounded-xl p-1",children:u.map(f=>jsxs("button",{onClick:()=>r?.(f.id),className:l("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium transition-all",t===f.id?"bg-white/10 text-white shadow-lg":"text-white/40 hover:text-white/60"),children:[jsx(f.icon,{className:"h-3.5 w-3.5"}),f.label]},f.id))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("div",{className:"flex items-center gap-1 mr-2",children:[jsx(R,{variant:"ghost",size:"icon",onClick:c,disabled:!s,className:"h-8 w-8 text-white/40 disabled:opacity-20",children:jsx(Undo2,{className:"h-4 w-4"})}),jsx(R,{variant:"ghost",size:"icon",onClick:d,disabled:!i,className:"h-8 w-8 text-white/40 disabled:opacity-20",children:jsx(Redo2,{className:"h-4 w-4"})})]}),jsxs(R,{variant:"ghost",size:"sm",onClick:o,className:"gap-2 text-white/60",children:[jsx(Filter,{className:"h-4 w-4"}),"Filter"]}),jsxs(R,{variant:"ghost",size:"sm",onClick:n,className:"gap-2 text-white/60",children:[jsx(SortAsc,{className:"h-4 w-4"}),"Sort"]}),jsx("div",{className:"w-px h-4 bg-white/10 mx-2"}),jsxs(R,{size:"sm",onClick:a,className:"gap-2",children:[jsx(Plus,{className:"h-4 w-4"}),"Add Column"]}),jsx(R,{variant:"ghost",size:"icon",className:"h-9 w-9 text-white/40",children:jsx(MoreHorizontal,{className:"h-4 w-4"})})]})]})}function Fn({count:e,limit:t,className:r}){if(!t)return null;let o=e>t,n=Math.min(e/t*100,100);return jsxs("div",{className:l("flex items-center gap-3",r),children:[jsx("div",{className:"flex-1 h-1 bg-white/5 rounded-full overflow-hidden",children:jsx("div",{className:l("h-full transition-all duration-500",o?"bg-red-500":n>80?"bg-orange-500":"bg-blue-500"),style:{width:`${n}%`}})}),jsxs("div",{className:l("flex items-center gap-1.5 text-[10px] font-bold px-2 py-0.5 rounded-full",o?"bg-red-500/20 text-red-400":"bg-white/5 text-white/40"),children:[o&&jsx(AlertCircle,{className:"h-3 w-3"}),e,"/",t]})]})}var Qo=we__default.memo(({task:e,isSelected:t,showTimer:r,onEdit:o,onDelete:n,draggable:a=true,activeTimerTaskId:s,selectable:i,cardClassName:c,onTaskClick:d,onTaskSelectionChange:m,onTaskTimerToggle:u,onDragStart:f,onDragOver:g,onDrop:x,renderCard:v})=>{if(v)return jsx(Fragment,{children:v(e)});let h=p=>{switch(p){case "urgent":return "danger";case "high":return "warning";case "medium":return "info";case "low":return "success";default:return "neutral"}};return jsx(ne,{onClick:p=>d?.(p,e),draggable:a,onDragStart:f,onDragOver:g,onDrop:x,className:l("p-6 border border-white/10 bg-white/[0.03] hover:bg-white/[0.06] transition-all duration-200 rounded-2xl group cursor-grab active:cursor-grabbing",e.blockedBy&&e.blockedBy.length>0&&"border-red-500/30 bg-red-500/[0.02]",t&&"ring-2 ring-cyan-500/50 bg-cyan-500/[0.02]",c),children:jsxs("div",{className:"flex flex-col gap-3",children:[jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i&&jsx(Po,{checked:t,onChange:p=>{m?.(t?[]:[e.id]);},onClick:p=>p.stopPropagation(),className:"mr-1"}),e.blockedBy&&e.blockedBy.length>0&&jsx(Lock,{className:"h-3.5 w-3.5 text-red-500 flex-shrink-0"}),jsx(ve,{className:l("font-medium text-sm leading-tight group-hover:text-cyan-400 transition-colors truncate",e.blockedBy&&e.blockedBy.length>0&&"text-red-400/80"),children:e.title})]}),jsxs("div",{className:"flex items-center gap-1",children:[n&&jsx("button",{onClick:p=>{p.stopPropagation(),n(e.id);},className:"p-1 rounded-md hover:bg-red-500/20 text-white/20 hover:text-red-400 transition-colors",children:jsx(Trash2,{className:"h-3.5 w-3.5"})}),a&&jsx(GripVertical,{className:"h-4 w-4 text-white/20 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"})]})]}),e.description&&jsx(ve,{className:"text-xs text-white/50 line-clamp-2",children:e.description}),e.progress!==void 0&&jsxs("div",{className:"space-y-1.5",children:[jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[jsx("span",{className:"text-white/30 uppercase font-bold tracking-wider",children:"Progress"}),jsxs("span",{className:"text-white/50",children:[e.progress,"%"]})]}),jsx("div",{className:"h-1 w-full bg-white/[0.03] rounded-full overflow-hidden",children:jsx("div",{className:"h-full bg-cyan-500 transition-all duration-500",style:{width:`${e.progress}%`}})})]}),jsxs("div",{className:"flex flex-wrap gap-2 mt-1",children:[e.priority&&jsx(Ve,{variant:h(e.priority),className:"text-[10px] px-1.5 py-0 uppercase font-bold",children:e.priority}),e.tags?.map(p=>jsx(Ve,{variant:"neutral",className:"text-[10px] px-1.5 py-0 bg-white/[0.03] border-white/5",children:p},p))]}),jsxs("div",{className:"flex items-center justify-between mt-2 pt-3 border-t border-white/5",children:[jsxs("div",{className:"flex items-center gap-3 text-[10px] text-white/30",children:[e.timeSpent!==void 0&&jsxs("div",{className:l("flex items-center gap-1 px-1.5 py-0.5 rounded-md transition-colors",s===e.id?"bg-cyan-500/20 text-cyan-400":"bg-white/[0.03]"),children:[s===e.id?jsx(Pause,{className:"h-2.5 w-2.5 cursor-pointer hover:scale-110 transition-transform",onClick:p=>{p.stopPropagation(),u?.(e.id);}}):jsx(Play,{className:"h-2.5 w-2.5 cursor-pointer hover:scale-110 transition-transform",onClick:p=>{p.stopPropagation(),u?.(e.id);}}),jsxs("span",{className:"font-mono",children:[Math.floor(e.timeSpent/3600),"h ",Math.floor(e.timeSpent%3600/60),"m"]})]}),e.comments!==void 0&&jsxs("div",{className:"flex items-center gap-1",children:[jsx(MessageSquare,{className:"h-3 w-3"}),e.comments]}),e.attachments!==void 0&&jsxs("div",{className:"flex items-center gap-1",children:[jsx(Paperclip,{className:"h-3 w-3"}),e.attachments]}),e.dueDate&&jsxs("div",{className:"flex items-center gap-1",children:[jsx(Clock,{className:"h-3 w-3"}),e.dueDate]})]}),e.assignee&&jsx("div",{className:"flex -space-x-2",children:jsx("div",{className:"h-6 w-6 rounded-full border-2 border-[#0a0a0a] bg-white/[0.06] flex items-center justify-center text-[10px] font-bold overflow-hidden",children:e.assignee.avatar?jsx("img",{src:e.assignee.avatar,alt:e.assignee.name,className:"h-full w-full object-cover"}):e.assignee.name[0]})})]})]})})});Qo.displayName="KanbanCard";function Jo({column:e,tasks:t,onAddTask:r,onCollapse:o,onTaskClick:n,onAction:a,onDragStart:s,onDragOver:i,onDrop:c,isCollapsed:d,children:m,className:u}){return jsxs("div",{className:l("flex flex-col h-full transition-all duration-300",d?"w-12":"w-80",u),onDragOver:f=>i?.(f),onDrop:f=>c?.(f),onDragStart:f=>s?.(f,e.id,"column"),draggable:!d,children:[jsxs("div",{className:l("flex items-center justify-between mb-4 px-2",d&&"flex-col gap-4"),children:[jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[jsx("button",{onClick:()=>o?.(e.id),className:"p-1 rounded hover:bg-white/5 text-white/40",children:d?jsx(ChevronRight,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"})}),!d&&jsxs(Fragment,{children:[jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:e.color||"#3b82f6"}}),jsx("h3",{className:"font-bold text-sm text-white truncate",children:e.title}),jsx("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded-md bg-white/5 text-white/40",children:t.length})]})]}),!d&&jsxs("div",{className:"flex items-center gap-1",children:[jsx(R,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white/40 hover:text-white",onClick:()=>r?.(e.id),children:jsx(Plus,{className:"h-4 w-4"})}),jsx(R,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white/40 hover:text-white",onClick:()=>a?.("more"),children:jsx(MoreVertical,{className:"h-4 w-4"})})]})]}),!d&&e.limit&&jsx("div",{className:"px-2 mb-4",children:jsx(Fn,{count:t.length,limit:e.limit})}),jsx("div",{className:l("flex-1 overflow-y-auto min-h-0 px-2 space-y-3 custom-scrollbar",d&&"hidden"),children:m||t.map(f=>jsx(Qo,{task:f,onTaskClick:(g,x)=>n?.(x),onDragStart:g=>s?.(g,f.id,"task"),onDragOver:g=>i?.(g,f.id),onDrop:g=>c?.(g,f.id)},f.id))}),d&&jsx("div",{className:"flex-1 flex items-center justify-center",children:jsx("span",{className:"rotate-90 whitespace-nowrap text-[10px] font-bold uppercase tracking-widest text-white/20",children:e.title})})]})}function to({tasks:e,columns:t,onTaskClick:r,className:o}){let n=a=>t.find(s=>s.id===a);return jsx("div",{className:l("bg-white/[0.02] border border-white/5 rounded-2xl overflow-hidden",o),children:jsxs(wr,{children:[jsx(yr,{children:jsxs(ct,{className:"hover:bg-transparent border-white/5",children:[jsx(et,{className:"text-white/40 uppercase text-[10px] font-bold",children:"Task"}),jsx(et,{className:"text-white/40 uppercase text-[10px] font-bold",children:"Status"}),jsx(et,{className:"text-white/40 uppercase text-[10px] font-bold",children:"Priority"}),jsx(et,{className:"text-white/40 uppercase text-[10px] font-bold",children:"Assignee"}),jsx(et,{className:"text-white/40 uppercase text-[10px] font-bold",children:"Due Date"})]})}),jsx(kr,{children:e.map(a=>{let s=n(a.columnId);return jsxs(ct,{className:"border-white/5 hover:bg-white/[0.03] cursor-pointer transition-colors",onClick:()=>r?.(a),children:[jsx(Ue,{className:"font-medium text-white",children:a.title}),jsx(Ue,{children:jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:s?.color||"#3b82f6"}}),jsx("span",{className:"text-xs text-white/60",children:s?.title})]})}),jsx(Ue,{children:jsx(Ve,{variant:a.priority==="urgent"?"danger":a.priority==="high"?"warning":"info",className:"text-[10px] uppercase",children:a.priority||"medium"})}),jsx(Ue,{children:a.assignee&&jsxs("div",{className:"flex items-center gap-2",children:[jsx(z,{src:a.assignee.avatar,alt:a.assignee.name,size:"sm"}),jsx("span",{className:"text-xs text-white/60",children:a.assignee.name})]})}),jsx(Ue,{className:"text-xs text-white/40",children:a.dueDate?new Date(a.dueDate).toLocaleDateString():"-"})]},a.id)})})]})})}function Wn({tasks:e,className:t}){return jsxs("div",{className:l("p-8 bg-white/[0.02] border border-white/5 rounded-2xl flex flex-col items-center justify-center min-h-[400px]",t),children:[jsx("div",{className:"h-12 w-12 rounded-full bg-blue-500/10 flex items-center justify-center mb-4",children:jsx("div",{className:"h-6 w-6 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"})}),jsx("h3",{className:"text-lg font-bold text-white mb-2",children:"Timeline View"}),jsxs("p",{className:"text-sm text-white/40 text-center max-w-xs",children:["The timeline view is currently being optimized for high-performance rendering of ",e.length," tasks."]})]})}function Yn({tasks:e,columns:t,onTaskClick:r,className:o}){return jsx(to,{tasks:e,columns:t,onTaskClick:r,className:o})}function _n({tasks:e,onTaskClick:t,onAddTask:r,className:o}){let[n,a]=useState(new Date),s=(p,b)=>new Date(p,b+1,0).getDate(),i=(p,b)=>new Date(p,b,1).getDay(),c=n.getFullYear(),d=n.getMonth(),m=s(c,d),u=i(c,d),f=()=>a(new Date(c,d-1,1)),g=()=>a(new Date(c,d+1,1)),x=["January","February","March","April","May","June","July","August","September","October","November","December"],v=[];for(let p=0;p<u;p++)v.push(null);for(let p=1;p<=m;p++)v.push(new Date(c,d,p));let h=p=>e.filter(b=>{if(!b.dueDate)return false;let w=new Date(b.dueDate);return w.getDate()===p.getDate()&&w.getMonth()===p.getMonth()&&w.getFullYear()===p.getFullYear()});return jsxs("div",{className:l("flex flex-col h-full",o),children:[jsxs("div",{className:"flex items-center justify-between mb-6",children:[jsxs("div",{className:"flex items-center gap-4",children:[jsxs(Mm,{level:3,className:"text-white",children:[x[d]," ",c]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx(R,{variant:"ghost",size:"sm",onClick:f,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(R,{variant:"ghost",size:"sm",onClick:g,children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]}),jsx(R,{variant:"ghost",size:"sm",onClick:()=>a(new Date),children:"Today"})]}),jsxs("div",{className:"grid grid-cols-7 gap-px bg-white/5 border border-white/5 rounded-2xl overflow-hidden flex-1",children:[["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(p=>jsx("div",{className:"bg-white/[0.02] p-3 text-center",children:jsx(ve,{size:"xs",className:"text-white/40 font-medium uppercase tracking-wider",children:p})},p)),v.map((p,b)=>jsx("div",{className:l("bg-gray-900/50 min-h-[120px] p-2 group transition-colors hover:bg-white/[0.02]",!p&&"bg-transparent"),children:p&&jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("span",{className:l("text-xs font-medium w-6 h-6 flex items-center justify-center rounded-full",p.toDateString()===new Date().toDateString()?"bg-blue-500 text-white":"text-white/40"),children:p.getDate()}),jsx("button",{onClick:()=>r?.(p),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-white/10 rounded-lg transition-all",children:jsx(Plus,{className:"h-3 w-3 text-white/40"})})]}),jsx("div",{className:"space-y-1",children:h(p).map(w=>jsx("div",{onClick:()=>t?.(w),className:"px-2 py-1 rounded-lg bg-blue-500/10 border border-blue-500/20 cursor-pointer hover:bg-blue-500/20 transition-all",children:jsx(ve,{size:"xs",className:"text-blue-400 truncate",children:w.title})},w.id))})]})},b))]})]})}function Mm({children:e,level:t,className:r}){let o=`h${t}`;return jsx(o,{className:l("font-semibold",r),children:e})}function Xn({children:e,...t}){return jsx("div",{className:"flex h-full w-full flex-col overflow-hidden rounded-2xl bg-white dark:bg-black/90 text-gray-900 dark:text-white",children:jsx(Io,{usePopover:false,...t,children:e})})}function a1({children:e,open:t,onOpenChange:r,...o}){let n=useRef(null);useEffect(()=>{let s=i=>{i.key==="Escape"&&r(false);};return t&&(document.addEventListener("keydown",s),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",s),document.body.style.overflow="unset";}},[t,r]);let a=s=>{s.target===n.current&&r(false);};return t?createPortal(jsx("div",{ref:n,onClick:a,className:"fixed inset-0 z-[100] flex items-start justify-center bg-black/60 backdrop-blur-sm animate-in fade-in duration-200 pt-[20vh]",children:jsx("div",{className:"relative w-full max-w-lg overflow-hidden rounded-2xl border border-gray-200 dark:border-white/10 bg-white dark:bg-black/90 shadow-2xl animate-in zoom-in-95 duration-200",children:jsx(Io,{usePopover:false,...o,children:e})})}),document.body):null}function qn({className:e,...t}){return jsxs("div",{className:"flex items-center border-b border-gray-200 dark:border-white/10 px-3","cmdk-input-wrapper":"",children:[jsx(Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),jsx(fn,{className:l("flex h-12 w-full rounded-md bg-transparent py-3 text-sm text-gray-900 dark:text-white outline-none placeholder:text-gray-400 dark:placeholder:text-white/50 disabled:cursor-not-allowed disabled:opacity-50 border-none focus:ring-0 px-0",e),...t})]})}function Gn({className:e,...t}){return jsx(gn,{className:l("max-h-[300px] overflow-y-auto overflow-x-hidden p-2",e),...t})}function n1(e){return jsx(hn,{className:"py-6 text-center text-sm",...e})}function jn({children:e,heading:t,className:r,...o}){return jsxs("div",{className:l("overflow-hidden p-1 text-gray-900 dark:text-white",r),...o,children:[t&&jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-gray-500 dark:text-white/50",children:t}),e]})}function Qn({className:e,...t}){return jsx(bn,{className:l("relative flex cursor-default select-none items-center rounded-2xl px-2 py-1.5 text-sm outline-none text-gray-900 dark:text-white aria-selected:bg-gray-100 dark:aria-selected:bg-white/[0.06] aria-selected:text-gray-900 dark:aria-selected:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t})}function s1({className:e,...t}){return jsx("span",{className:l("ml-auto text-xs tracking-widest text-gray-400 dark:text-white/50",e),...t})}function Zn({onSearchChange:e,onFilterChange:t,onSortChange:r,onViewChange:o,onGroupChange:n,priorityOptions:a=[],tagOptions:s=[],assigneeOptions:i=[],viewOptions:c=["board","list","calendar","timeline"],sortOptions:d=[],groupOptions:m=[],savedFilters:u=[],onSaveFilter:f,className:g}){let[x,v]=useState(""),[h,p]=useState({}),[b,w]=useState("board"),k=(C,T)=>{let L=h[C]||[],I=L.includes(T)?L.filter(D=>D!==T):[...L,T],P={...h,[C]:I};I.length===0&&delete P[C],p(P),t?.(P);},y=()=>{p({}),t?.({}),v(""),e?.("");},N=Object.values(h).flat().length;return jsxs(ne,{className:l("p-2 flex flex-wrap items-center gap-3 bg-white/[0.02] border-white/5",g),children:[jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[jsx(Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-white/20"}),jsx("input",{type:"text",placeholder:"Search tasks...",className:"w-full pl-10 pr-4 py-2 text-sm rounded-2xl border border-white/10 bg-white/[0.03] focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all placeholder:text-white/20 text-white",value:x,onChange:C=>{v(C.target.value),e?.(C.target.value);}})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(ta,{label:"Priority",options:a,selected:h.priority||[],onSelect:C=>k("priority",C)}),jsx(ta,{label:"Tags",options:s,selected:h.tags||[],onSelect:C=>k("tags",C)}),jsx(ta,{label:"Assignee",options:i,selected:h.assignee||[],onSelect:C=>k("assignee",C)}),jsx("div",{className:"w-px h-4 bg-white/10 mx-1"}),jsxs(Qe,{children:[jsx(Je,{children:jsxs(R,{variant:"ghost",size:"sm",className:"h-9 gap-2 text-white/60",children:[jsx(SortAsc,{className:"h-4 w-4"}),"Sort"]})}),jsx(Ze,{className:"w-48 p-1 bg-gray-900 border-white/10",children:d.map(C=>jsx("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-white/60 hover:text-white hover:bg-white/5 rounded-lg text-left",onClick:()=>r?.(C.value,"asc"),children:C.label},C.value))})]}),N>0&&jsxs(R,{variant:"ghost",size:"sm",onClick:y,className:"h-9 px-3 text-xs text-white/40 hover:text-white gap-2",children:[jsx(X,{className:"h-3.5 w-3.5"})," Clear",jsx(Ve,{variant:"neutral",className:"bg-white/[0.06] border-white/10 ml-1",children:N})]})]})]})}function ta({label:e,options:t,selected:r,onSelect:o}){return jsxs(Qe,{children:[jsx(Je,{children:jsxs(R,{variant:"ghost",size:"sm",className:l("h-9 gap-2 text-xs transition-all",r.length>0?"bg-blue-500/10 text-blue-400":"text-white/60 hover:text-white"),children:[e,r.length>0?jsx(Ve,{variant:"info",className:"h-4 min-w-[16px] px-1 bg-blue-500 text-white border-none",children:r.length}):jsx(ChevronDown,{className:"h-3.5 w-3.5 opacity-40"})]})}),jsx(Ze,{className:"w-56 p-0 bg-gray-900 border-white/10 shadow-2xl",children:jsxs(Xn,{children:[jsx(qn,{placeholder:`Search ${e.toLowerCase()}...`,className:"border-none"}),jsx(Gn,{className:"max-h-[240px]",children:jsx(jn,{children:t.map(n=>jsxs(Qn,{value:n.value,onClick:()=>o(n.value),className:"flex items-center justify-between py-2 px-3 cursor-pointer hover:bg-white/5",children:[jsx("span",{className:"text-xs text-white/80",children:n.label}),r.includes(n.value)&&jsx(Check,{className:"h-3.5 w-3.5 text-blue-500"})]},n.value))})})]})})]})}function ro({isOpen:e,onClose:t,children:r,className:o}){let n=useRef(null),[a,s]=we__default.useState(false);useEffect(()=>{s(true);},[]),useEffect(()=>{let c=n.current;c&&(e?c.open||(c.showModal(),document.body.style.overflow="hidden"):c.open&&(c.close(),document.body.style.overflow="unset"));},[e,a]),useEffect(()=>{let c=n.current;if(!c)return;let d=m=>{m.preventDefault(),t();};return c.addEventListener("cancel",d),()=>c.removeEventListener("cancel",d)},[t,a]);let i=c=>{c.target===n.current&&t();};return a?createPortal(jsx("dialog",{ref:n,onClick:i,className:l("fixed inset-0 z-[100] bg-transparent p-0 backdrop:bg-black/60 backdrop:backdrop-blur-sm open:grid open:place-items-center","animate-in fade-in duration-200",o),children:jsxs("div",{className:l("relative w-full max-w-lg scale-100 gap-4 border border-gray-200 dark:border-white/10 bg-white dark:bg-[#0A0A0A]/90 p-6 shadow-2xl backdrop-blur-xl transition-all sm:rounded-2xl","animate-in fade-in zoom-in-95 duration-200 slide-in-from-bottom-2"),children:[r,jsxs("button",{onClick:t,className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/20 disabled:pointer-events-none",children:[jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-900 dark:text-white",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),jsx("span",{className:"sr-only",children:"Close"})]})]})}),document.body):null}function oo({className:e,children:t}){return jsx("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left mb-4",e),children:t})}function ao({className:e,children:t}){return jsx("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-6",e),children:t})}function es({className:e,children:t}){return jsx(je,{as:"h2",className:l("text-lg font-semibold leading-none tracking-tight",e),children:t})}function E1({className:e,children:t}){return jsx(ve,{variant:"muted",className:l("text-sm",e),children:t})}function ts({items:e,onToggle:t,className:r}){if(!e||e.length===0)return null;let o=e.filter(a=>a.completed).length,n=o/e.length*100;return jsxs("div",{className:l("space-y-3",r),children:[jsxs("div",{className:"flex items-center justify-between text-[10px] text-white/40 uppercase tracking-wider font-bold",children:[jsx("span",{children:"Checklist"}),jsxs("span",{children:[o,"/",e.length]})]}),jsx("div",{className:"h-1 w-full bg-white/5 rounded-full overflow-hidden",children:jsx("div",{className:"h-full bg-blue-500 transition-all duration-500",style:{width:`${n}%`}})}),jsx("div",{className:"space-y-2",children:e.map(a=>jsxs("div",{className:"flex items-center gap-2 group cursor-pointer",onClick:()=>t?.(a.id),children:[a.completed?jsx(CheckSquare,{className:"h-4 w-4 text-blue-500"}):jsx(Square,{className:"h-4 w-4 text-white/20 group-hover:text-white/40"}),jsx("span",{className:l("text-sm transition-colors",a.completed?"text-white/40 line-through":"text-white/80"),children:a.title})]},a.id))})]})}function rs({comments:e,onAddComment:t,className:r}){let[o,n]=useState(""),a=()=>{o.trim()&&(t?.(o),n(""));};return jsxs("div",{className:l("space-y-6",r),children:[jsx("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold",children:"Comments"}),jsx("div",{className:"flex gap-3",children:jsxs("div",{className:"flex-1",children:[jsx(hr,{placeholder:"Write a comment...",value:o,onChange:s=>n(s.target.value),className:"min-h-[80px] bg-white/[0.03] border-white/10 text-sm"}),jsx("div",{className:"flex justify-end mt-2",children:jsxs(R,{size:"sm",onClick:a,disabled:!o.trim(),className:"gap-2",children:[jsx(Send,{className:"h-3.5 w-3.5"}),"Comment"]})})]})}),jsx("div",{className:"space-y-6",children:e.map(s=>jsxs("div",{className:"flex gap-3",children:[jsx(z,{src:s.user.avatar,alt:s.user.name,size:"sm"}),jsxs("div",{className:"flex-1 bg-white/[0.03] border border-white/5 rounded-2xl p-3",children:[jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsx("span",{className:"text-xs font-bold text-white",children:s.user.name}),jsx("span",{className:"text-[10px] text-white/30",children:s.timestamp.toLocaleString()})]}),jsx("p",{className:"text-sm text-white/70 leading-relaxed",children:s.content})]})]},s.id))})]})}function os({attachments:e,onRemove:t,onDownload:r,className:o}){return jsxs("div",{className:l("space-y-4",o),children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold",children:"Attachments"}),jsxs(R,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-white/40 hover:text-white",children:[jsx(Paperclip,{className:"h-3 w-3"}),"Add"]})]}),jsx("div",{className:"grid grid-cols-2 gap-3",children:e.map(n=>jsxs("div",{className:"group relative bg-white/[0.03] border border-white/5 rounded-xl overflow-hidden hover:border-white/20 transition-all",children:[n.thumbnail?jsx("div",{className:"aspect-video w-full overflow-hidden",children:jsx("img",{src:n.thumbnail,alt:n.name,className:"w-full h-full object-cover"})}):jsx("div",{className:"aspect-video w-full flex items-center justify-center bg-white/5",children:jsx(FileIcon,{className:"h-8 w-8 text-white/20"})}),jsxs("div",{className:"p-2",children:[jsx("p",{className:"text-xs font-medium text-white truncate",children:n.name}),jsx("p",{className:"text-[10px] text-white/30 uppercase",children:n.size})]}),jsxs("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:[jsx(R,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full bg-white/10 hover:bg-white/20",onClick:()=>r?.(n),children:jsx(Download,{className:"h-4 w-4"})}),jsx(R,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full bg-red-500/20 hover:bg-red-500/40 text-red-400",onClick:()=>t?.(n.id),children:jsx(X,{className:"h-4 w-4"})})]})]},n.id))})]})}function as({labels:e,selectedIds:t,onToggle:r,className:o}){return jsxs("div",{className:l("space-y-3",o),children:[jsxs("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold flex items-center gap-2",children:[jsx(Tag,{className:"h-3 w-3"}),"Labels"]}),jsx("div",{className:"flex flex-wrap gap-2",children:e.map(n=>{let a=t.includes(n.id);return jsxs("button",{onClick:()=>r(n.id),className:l("px-3 py-1.5 rounded-full text-xs font-medium transition-all flex items-center gap-2 border",a?"bg-white/10 border-white/20 text-white":"bg-transparent border-white/5 text-white/40 hover:border-white/10"),children:[jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.color}}),n.name,a&&jsx(Check,{className:"h-3 w-3"})]},n.id)})})]})}function ns({users:e,selectedId:t,onSelect:r,className:o}){return jsxs("div",{className:l("space-y-3",o),children:[jsxs("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold flex items-center gap-2",children:[jsx(Users,{className:"h-3 w-3"}),"Assignee"]}),jsx("div",{className:"grid grid-cols-1 gap-1",children:e.map(n=>{let a=t===n.id;return jsxs("button",{onClick:()=>r(n.id),className:l("flex items-center gap-3 p-2 rounded-xl transition-all text-left",a?"bg-white/10 text-white":"text-white/60 hover:bg-white/5"),children:[jsx(z,{src:n.avatar,alt:n.name,size:"sm"}),jsx("span",{className:"text-sm flex-1 truncate",children:n.name}),a&&jsx(Check,{className:"h-4 w-4 text-blue-500"})]},n.id)})})]})}function is({date:e,onChange:t,className:r}){return jsxs("div",{className:l("space-y-3",r),children:[jsxs("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold flex items-center gap-2",children:[jsx(Calendar,{className:"h-3 w-3"}),"Due Date"]}),e?jsxs("div",{className:"flex items-center gap-2 p-3 rounded-2xl bg-white/5 border border-white/10",children:[jsx("div",{className:"h-8 w-8 rounded-lg bg-blue-500/20 flex items-center justify-center text-blue-400",children:jsx(Clock,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1",children:[jsx("p",{className:"text-sm font-medium text-white",children:e.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}),jsx("p",{className:"text-[10px] text-white/40",children:e.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]}),jsx(R,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white/20 hover:text-red-400",onClick:()=>t(void 0),children:jsx(X,{className:"h-4 w-4"})})]}):jsxs(R,{variant:"ghost",className:"w-full justify-start gap-3 h-12 rounded-2xl border border-dashed border-white/10 text-white/40 hover:border-white/20 hover:bg-white/5",onClick:()=>t(new Date),children:[jsx(Calendar,{className:"h-4 w-4"}),"Set due date"]})]})}function cs({initialSeconds:e=0,onTimeUpdate:t,className:r}){let[o,n]=useState(e),[a,s]=useState(false);useEffect(()=>{let c=null;return a?c=setInterval(()=>{n(d=>{let m=d+1;return t?.(m),m});},1e3):clearInterval(c),()=>clearInterval(c)},[a,t]);let i=c=>{let d=Math.floor(c/3600),m=Math.floor(c%3600/60),u=c%60;return `${d.toString().padStart(2,"0")}:${m.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}`};return jsxs("div",{className:l("space-y-3",r),children:[jsxs("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold flex items-center gap-2",children:[jsx(Timer,{className:"h-3 w-3"}),"Time Tracking"]}),jsxs("div",{className:"flex items-center gap-4 p-4 rounded-2xl bg-white/[0.03] border border-white/5",children:[jsxs("div",{className:"flex-1",children:[jsx("p",{className:"text-2xl font-mono font-bold text-white tracking-tight",children:i(o)}),jsx("p",{className:"text-[10px] text-white/30 uppercase font-bold mt-1",children:"Total Time Spent"})]}),jsxs("div",{className:"flex gap-2",children:[jsx(R,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-full bg-white/5 hover:bg-white/10",onClick:()=>n(0),children:jsx(RotateCcw,{className:"h-4 w-4"})}),jsx(R,{variant:a?"secondary":"primary",size:"icon",className:l("h-10 w-10 rounded-full shadow-lg transition-all",a?"bg-orange-500 hover:bg-orange-600":"bg-blue-600 hover:bg-blue-700"),onClick:()=>s(!a),children:a?jsx(Pause,{className:"h-4 w-4"}):jsx(Play,{className:"h-4 w-4 ml-0.5"})})]})]})]})}function ds({isOpen:e,onClose:t,onSave:r,onDelete:o,onDuplicate:n,onArchive:a,task:s,columnId:i,columns:c=[],users:d=[],availableLabels:m=[],showSubtasks:u=true,showChecklist:f=true,showAttachments:g=true,showComments:x=true,showActivity:v=true}){let[h,p]=useState(""),[b,w]=useState(""),[k,y]=useState("medium"),[N,C]=useState(""),[T,L]=useState(void 0),[I,P]=useState([]),[D,V]=useState(void 0);useEffect(()=>{s?(p(s.title||""),w(s.description||""),y(s.priority||"medium"),C(s.columnId||""),L(s.assignee?.id),P(s.labels?.map(M=>M.id)||[]),V(s.dueDate?new Date(s.dueDate):void 0)):(p(""),w(""),y("medium"),C(i||""),L(void 0),P([]),V(void 0));},[s,e,i]);let A=()=>{h.trim()&&(r({...s,title:h,description:b,priority:k,columnId:N,assignee:d.find(M=>M.id===T),labels:m.filter(M=>I.includes(M.id)),dueDate:D?.toISOString()}),t());};return jsxs(ro,{isOpen:e,onClose:t,children:[jsxs(oo,{className:"flex items-center justify-between pr-12",children:[jsx(es,{children:s?"Edit Task":"Create New Task"}),jsx("div",{className:"flex items-center gap-2",children:s&&jsxs(Fragment,{children:[jsx(R,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white/40 hover:text-white",onClick:()=>n?.(s),children:jsx(Copy,{className:"h-4 w-4"})}),jsx(R,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white/40 hover:text-white",onClick:()=>a?.(s.id),children:jsx(Archive,{className:"h-4 w-4"})}),jsx(R,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white/40 hover:text-red-400",onClick:()=>o?.(s.id),children:jsx(Trash2,{className:"h-4 w-4"})})]})})]}),jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8 py-6",children:[jsxs("div",{className:"lg:col-span-2 space-y-8",children:[jsxs("div",{className:"space-y-2",children:[jsx(_,{htmlFor:"task-title",className:"text-[10px] uppercase tracking-wider text-white/40 font-bold",children:"Title"}),jsx(wt,{id:"task-title",placeholder:"What needs to be done?",value:h,onChange:M=>p(M.target.value),className:"text-lg font-bold bg-transparent border-white/10 focus:border-blue-500",autoFocus:true})]}),jsxs("div",{className:"space-y-2",children:[jsx(_,{htmlFor:"task-desc",className:"text-[10px] uppercase tracking-wider text-white/40 font-bold",children:"Description"}),jsx(hr,{id:"task-desc",placeholder:"Add more details...",value:b,onChange:M=>w(M.target.value),rows:6,className:"bg-white/[0.03] border-white/10 text-sm leading-relaxed"})]}),f&&s?.checklist&&jsx(ts,{items:s.checklist}),g&&s?.attachments&&jsx(os,{attachments:[]}),x&&jsx(rs,{comments:[]})]}),jsxs("div",{className:"space-y-8 bg-white/[0.02] p-6 rounded-3xl border border-white/5 h-fit",children:[jsxs("div",{className:"space-y-2",children:[jsx(_,{className:"text-[10px] uppercase tracking-wider text-white/40 font-bold",children:"Status"}),jsx(Wr,{value:N,onChange:M=>C(M),options:c.map(M=>({label:M.title,value:M.id})),className:"bg-white/5 border-white/10"})]}),jsxs("div",{className:"space-y-2",children:[jsx(_,{className:"text-[10px] uppercase tracking-wider text-white/40 font-bold",children:"Priority"}),jsx(Wr,{value:k,onChange:M=>y(M),options:[{label:"Low",value:"low"},{label:"Medium",value:"medium"},{label:"High",value:"high"},{label:"Urgent",value:"urgent"}],className:"bg-white/5 border-white/10"})]}),jsx(ns,{users:d,selectedId:T,onSelect:L}),jsx(as,{labels:m,selectedIds:I,onToggle:M=>P(J=>J.includes(M)?J.filter(ae=>ae!==M):[...J,M])}),jsx(is,{date:D,onChange:V}),jsx(cs,{initialSeconds:s?.timeSpent})]})]}),jsxs(ao,{className:"border-t border-white/5 pt-6",children:[jsx(R,{variant:"ghost",onClick:t,children:"Cancel"}),jsx(R,{onClick:A,className:"px-8",children:"Save Changes"})]})]})}function ms({title:e,count:t,isCollapsed:r,onToggle:o,children:n,className:a}){return jsxs("div",{className:l("space-y-4",a),children:[jsxs("button",{onClick:o,className:"flex items-center gap-3 w-full group",children:[jsxs("div",{className:"flex items-center gap-2",children:[r?jsx(ChevronRight,{className:"h-4 w-4 text-white/20"}):jsx(ChevronDown,{className:"h-4 w-4 text-white/20"}),jsx("h4",{className:"text-xs font-bold uppercase tracking-widest text-white/40 group-hover:text-white/60 transition-colors",children:e})]}),jsx("div",{className:"h-px flex-1 bg-white/5"}),jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-white/5 text-white/20",children:t})]}),!r&&jsx("div",{className:"animate-in fade-in slide-in-from-top-2 duration-300",children:n})]})}function fs(e){let[t,r]=useState(""),[o,n]=useState({}),a=useMemo(()=>e.filter(c=>{if(t){let d=t.toLowerCase();if(!(c.title.toLowerCase().includes(d)||c.description?.toLowerCase().includes(d)||c.tags?.some(u=>u.toLowerCase().includes(d))))return false}for(let[d,m]of Object.entries(o))if(!(!m||m.length===0)&&(d==="priority"&&!m.includes(c.priority)||d==="assignee"&&(!c.assignee||!m.includes(c.assignee.id))||d==="tags"&&!c.tags?.some(u=>m.includes(u))))return false;return true}),[e,t,o]),s=useCallback((c,d)=>{n(m=>{let u=m[c]||[],f=u.includes(d)?u.filter(x=>x!==d):[...u,d],g={...m,[c]:f};return f.length===0&&delete g[c],g});},[]),i=useCallback(()=>{n({}),r("");},[]);return {searchQuery:t,setSearchQuery:r,activeFilters:o,setActiveFilters:n,filteredTasks:a,toggleFilter:s,clearFilters:i}}function gs(e){let[t,r]=useState({history:[e],currentIndex:0}),o=useRef(e);useEffect(()=>{let i=e.tasks.length!==o.current.tasks.length||e.tasks.some((d,m)=>d.id!==o.current.tasks[m]?.id||d.columnId!==o.current.tasks[m]?.columnId),c=e.columns.length!==o.current.columns.length||e.columns.some((d,m)=>d.id!==o.current.columns[m]?.id);if(i||c){let d=t.history[t.currentIndex];d&&e.tasks.length===d.tasks.length&&e.tasks.every((u,f)=>u.id===d.tasks[f]?.id&&u.columnId===d.tasks[f]?.columnId)||r({history:[e],currentIndex:0}),o.current=e;}},[e,t.history,t.currentIndex]);let n=useCallback(i=>{r(c=>({history:[...c.history.slice(0,c.currentIndex+1),i],currentIndex:c.currentIndex+1}));},[]),a=useCallback(()=>{r(i=>i.currentIndex>0?{...i,currentIndex:i.currentIndex-1}:i);},[]),s=useCallback(()=>{r(i=>i.currentIndex<i.history.length-1?{...i,currentIndex:i.currentIndex+1}:i);},[]);return {state:t.history[t.currentIndex],pushState:n,undo:a,redo:s,canUndo:t.currentIndex>0,canRedo:t.currentIndex<t.history.length-1}}function hs({onUndo:e,onRedo:t,onSearch:r,onNewTask:o,onNewColumn:n,enabled:a=true}){useEffect(()=>{if(!a)return;let s=i=>{(i.ctrlKey||i.metaKey)&&i.key==="z"&&!i.shiftKey&&(i.preventDefault(),e?.()),((i.ctrlKey||i.metaKey)&&i.key==="z"&&i.shiftKey||(i.ctrlKey||i.metaKey)&&i.key==="y")&&(i.preventDefault(),t?.()),((i.ctrlKey||i.metaKey)&&i.key==="f"||i.key==="/"&&document.activeElement===document.body)&&(i.preventDefault(),r?.()),i.key==="n"&&document.activeElement===document.body&&(i.preventDefault(),o?.()),i.key==="c"&&document.activeElement===document.body&&(i.preventDefault(),n?.());};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[a,e,t,r,o,n]);}function xs({tasks:e,columns:t,selectedTaskIds:r,onTaskMove:o,onColumnMove:n,onTaskDrop:a,onTaskDragStart:s,onTaskDragEnd:i}){let[c,d]=useState(null),[m,u]=useState(null),[f,g]=useState(null),[x,v]=useState(null),[h,p]=useState(null),b=useRef(null),w=useRef(null),k=(P,D,V)=>{V==="task"?(d(D),P.dataTransfer.setData("taskId",D),s?.(D)):(u(D),P.dataTransfer.setData("columnId",D)),P.dataTransfer.effectAllowed="move";},y=useCallback(()=>{c&&i?.(c),d(null),u(null),g(null),v(null),p(null);},[c,i]);return {draggedTaskId:c,draggedColumnId:m,dragOverColumnId:f,dragOverTaskId:x,dropPosition:h,handleDragStart:k,handleDragEnd:y,handleDragOver:(P,D,V)=>{if(P.preventDefault(),P.dataTransfer.dropEffect="move",m){g(D);let A=P.currentTarget.getBoundingClientRect(),M=A.left+A.width/2;p(P.clientX<M?"left":"right");}else if(g(D),V){v(V);let A=P.currentTarget.getBoundingClientRect(),M=A.top+A.height/2;p(P.clientY<M?"top":"bottom");}else P.target===P.currentTarget&&(v(null),p(null));},handleDrop:(P,D,V)=>{P.preventDefault();let A=c||P.dataTransfer.getData("taskId"),M=m||P.dataTransfer.getData("columnId");if(M&&n)n(M,D,h==="right"?"right":"left");else if(A&&o){if(!e.find(F=>F.id===A))return;(r.includes(A)?r:[A]).forEach(F=>{let At=e.find(nt=>nt.id===F)?.columnId||"";o(F,D,V,h==="bottom"?"bottom":"top"),a?.(F,At,D,0);});}y();},handleTouchStart:(P,D,V)=>{let A=P.touches[0];A&&(b.current=setTimeout(()=>{V==="task"?(d(D),s?.(D)):u(D),w.current={x:A.clientX,y:A.clientY};},500));},handleTouchMove:P=>{if(!c&&!m)return;P.preventDefault();let D=P.touches[0];if(!D)return;let V=document.elementFromPoint(D.clientX,D.clientY);if(!V)return;let A=V.closest("[data-column-id]"),M=V.closest("[data-task-id]");if(A){let J=A.getAttribute("data-column-id");if(g(J),m){let ae=A.getBoundingClientRect(),F=ae.left+ae.width/2;p(D.clientX<F?"left":"right");}else if(M){let ae=M.getAttribute("data-task-id");v(ae);let F=M.getBoundingClientRect(),de=F.top+F.height/2;p(D.clientY<de?"top":"bottom");}}},handleTouchEnd:P=>{if(clearTimeout(b.current),c||m){if(f){let D=c,V=m;V&&n?n(V,f,h==="right"?"right":"left"):D&&o&&o(D,f,x||void 0,h==="bottom"?"bottom":"top");}y();}},setDraggedTaskId:d}}function xu({columns:e,tasks:t,onTaskMove:r,onColumnMove:o,onTaskClick:n,onTaskAdd:a,onColumnAction:s,swimlanes:i=false,swimlaneBy:c="priority",view:d,onViewChange:m,className:u,...f}){let[g,x]=useState(d||"board"),[v,h]=useState(null),[p,b]=useState([]),w=d||g,k=U=>{x(U),m?.(U);},{state:y,pushState:N,undo:C,redo:T,canUndo:L,canRedo:I}=gs({tasks:t,columns:e}),P=y?.tasks||[],D=y?.columns||[],{setSearchQuery:V,setActiveFilters:A,filteredTasks:M}=fs(P),J=useMemo(()=>{if(!i)return null;let U={},E=(H,ee)=>ee.includes(".")?ee.split(".").reduce((O,te)=>O&&O[te],H):H[ee];return M.forEach(H=>{let ee=E(H,c),O=String(ee||"Uncategorized");U[O]||(U[O]=[]),U[O].push(H);}),U},[M,i,c]),{handleDragStart:ae,handleDragOver:F,handleDrop:de}=xs({columns:D,tasks:P,selectedTaskIds:[],onTaskMove:(U,E,H,ee)=>{let O=[...P],te=O.findIndex(zr=>zr.id===U);if(te===-1)return;let Bt={...O[te],columnId:E};if(O.splice(te,1),!H)O.push(Bt);else {let zr=O.findIndex(Li=>Li.id===H),Ri=ee==="bottom"?zr+1:zr;O.splice(Ri,0,Bt);}N({tasks:O,columns:D}),r?.(U,E,H,ee);}});hs({onUndo:C,onRedo:T,onSearch:()=>document.querySelector('input[placeholder*="Search"]')?.focus(),onNewTask:()=>a?.("todo","New Task")});let nt=useMemo(()=>P.find(U=>U.id===v),[P,v]),Mo=()=>{let U=E=>{h(E.id),n?.(E);};switch(w){case "list":return jsx(to,{tasks:M,columns:D,onTaskClick:U});case "timeline":return jsx(Wn,{tasks:M});case "table":return jsx(Yn,{tasks:M,columns:D,onTaskClick:U});case "calendar":return jsx(_n,{tasks:M,onTaskClick:U});default:if(i){let E=J&&Object.keys(J).length>0?J:{"All Tasks":[]};return jsx("div",{className:"flex flex-col gap-8 overflow-y-auto h-full pr-2 custom-scrollbar",children:Object.entries(E).map(([H,ee])=>jsx(ms,{title:H,count:ee.length,isCollapsed:p.includes(H),onToggle:()=>b(O=>O.includes(H)?O.filter(te=>te!==H):[...O,H]),children:jsx("div",{className:"flex gap-6 min-h-[200px]",children:D.map(O=>jsx(Jo,{column:O,tasks:ee.filter(te=>te.columnId===O.id),onTaskClick:U,onAddTask:()=>a?.(O.id,"New Task"),onAction:te=>s?.(O.id,te),onDragStart:ae,onDragOver:(te,Bt)=>F(te,O.id,Bt),onDrop:(te,Bt)=>de(te,O.id,Bt)},O.id))})},H))})}return jsx("div",{className:"flex gap-6 overflow-x-auto pb-4 min-h-[500px] scrollbar-thin scrollbar-thumb-white/10",children:D.map(E=>jsx(Jo,{column:E,tasks:M.filter(H=>H.columnId===E.id),onTaskClick:U,onAddTask:()=>a?.(E.id,"New Task"),onAction:H=>s?.(E.id,H),onDragStart:ae,onDragOver:(H,ee)=>F(H,E.id,ee),onDrop:(H,ee)=>de(H,E.id,ee)},E.id))})}};return jsxs("div",{className:l("flex flex-col gap-4 h-full",u),children:[jsx(Kn,{title:"Project Board",view:w,onViewChange:U=>k(U),canUndo:L,canRedo:I,onUndo:C,onRedo:T}),jsx(Zn,{onSearchChange:V,onFilterChange:A}),jsx("div",{className:"flex-1 overflow-hidden",children:Mo()}),nt&&jsx(ds,{isOpen:!!v,onClose:()=>h(null),task:nt,onSave:U=>{let E=P.map(H=>H.id===nt.id?{...H,...U}:H);N({tasks:E,columns:D}),h(null);}})]})}function NT({columnId:e,onAdd:t,placeholder:r="Add task...",className:o}){let[n,a]=useState(false),[s,i]=useState(""),c=d=>{d?.preventDefault(),s.trim()&&(t(e,s),i(""),a(false));};return n?jsxs("form",{onSubmit:c,className:l("bg-white/[0.03] border border-white/10 rounded-2xl p-3 space-y-3",o),children:[jsx("input",{autoFocus:true,value:s,onChange:d=>i(d.target.value),placeholder:"What needs to be done?",className:"w-full bg-transparent border-none outline-none text-sm text-white placeholder:text-white/20",onKeyDown:d=>{d.key==="Escape"&&a(false);}}),jsxs("div",{className:"flex items-center justify-end gap-2",children:[jsx(R,{variant:"ghost",size:"sm",onClick:()=>a(false),className:"h-8 text-white/40 hover:text-white",children:"Cancel"}),jsx(R,{size:"sm",onClick:()=>c(),disabled:!s.trim(),className:"h-8",children:"Add Task"})]})]}):jsxs("button",{onClick:()=>a(true),className:l("w-full flex items-center gap-2 p-3 rounded-2xl border border-dashed border-white/10 text-white/40 hover:border-white/20 hover:bg-white/5 transition-all text-sm",o),children:[jsx(Plus,{className:"h-4 w-4"}),r]})}function LT({onSync:e,interval:t=3e4,enabled:r=false}){let[o,n]=useState(null),[a,s]=useState(false),[i,c]=useState(null);return {sync:useCallback(async m=>{if(e){s(true),c(null);try{await e(m),n(new Date);}catch(u){c(u instanceof Error?u:new Error("Sync failed"));}finally{s(false);}}},[e]),isSyncing:a,lastSynced:o,error:i}}function ST(){let[e,t]=useState([]),r=useCallback(n=>{let a={...n,id:Math.random().toString(36).substr(2,9),timestamp:new Date};t(s=>[a,...s]);},[]),o=useCallback(()=>{t([]);},[]);return {history:e,addEntry:r,clearHistory:o}}function AT({subtasks:e,onToggle:t,className:r}){return !e||e.length===0?null:jsx("div",{className:l("space-y-1",r),children:e.map(o=>jsxs("div",{className:"flex items-center gap-2 group cursor-pointer",onClick:()=>t?.(o.id),children:[o.completed?jsx(CheckCircle2,{className:"h-3.5 w-3.5 text-green-500"}):jsx(Circle,{className:"h-3.5 w-3.5 text-white/20 group-hover:text-white/40"}),jsx("span",{className:l("text-xs transition-colors",o.completed?"text-white/40 line-through":"text-white/70"),children:o.title})]},o.id))})}function KT({activities:e,className:t}){return jsxs("div",{className:l("space-y-4",t),children:[jsx("h4",{className:"text-[10px] text-white/40 uppercase tracking-wider font-bold",children:"Activity"}),jsx("div",{className:"space-y-4",children:e.map(r=>jsxs("div",{className:"flex gap-3",children:[jsx(z,{src:r.user.avatar,alt:r.user.name,size:"sm"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("p",{className:"text-xs text-white/80",children:[jsx("span",{className:"font-bold text-white",children:r.user.name})," ",r.action," ",r.target&&jsx("span",{className:"font-medium text-blue-400",children:r.target})]}),jsx("p",{className:"text-[10px] text-white/30 mt-0.5",children:r.timestamp.toLocaleString()})]})]},r.id))})]})}var Ru=we__default.forwardRef(({className:e,title:t="Terminal",children:r,...o},n)=>jsxs("div",{ref:n,className:l("overflow-hidden rounded-2xl border border-gray-200 bg-gray-950 shadow-xl dark:border-white/10",e),...o,children:[jsxs("div",{className:"flex items-center justify-between border-b border-white/10 bg-white/[0.03] px-4 py-2",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[jsx("div",{className:"h-3 w-3 rounded-full bg-rose-500/80"}),jsx("div",{className:"h-3 w-3 rounded-full bg-amber-500/80"}),jsx("div",{className:"h-3 w-3 rounded-full bg-emerald-500/80"})]}),jsx("div",{className:"text-xs font-medium text-white/50",children:t}),jsx("div",{className:"w-10"})," "]}),jsx("div",{className:"p-4 font-mono text-sm text-gray-300",children:r})]}));Ru.displayName="Terminal";var y5=({children:e,prefix:t="$",className:r})=>jsxs("div",{className:l("flex gap-2",r),children:[jsx("span",{className:"select-none text-emerald-400",children:t}),jsx("span",{children:e})]});var C5=({className:e,pauseOnHover:t=false,direction:r="left",speed:o="normal",children:n,...a})=>{let s={slow:"40s",normal:"20s",fast:"10s"};return jsxs("div",{className:l("group flex overflow-hidden p-2 [--gap:1rem] [gap:var(--gap)]",e),...a,children:[jsx("div",{className:l("flex shrink-0 justify-around [gap:var(--gap)] min-w-full",r==="left"?"animate-marquee":"animate-marquee-reverse",t&&"group-hover:[animation-play-state:paused]"),style:{animationDuration:s[o]},children:n}),jsx("div",{"aria-hidden":"true",className:l("flex shrink-0 justify-around [gap:var(--gap)] min-w-full",r==="left"?"animate-marquee":"animate-marquee-reverse",t&&"group-hover:[animation-play-state:paused]"),style:{animationDuration:s[o]},children:n}),jsx("style",{children:`
13
13
  @keyframes marquee {
14
14
  from { transform: translateX(0); }
15
15
  to { transform: translateX(calc(-100% - var(--gap))); }
@@ -24,7 +24,7 @@ import*as ve from'react';import ve__default,{useRef,useState,useEffect,createCon
24
24
  .animate-marquee-reverse {
25
25
  animation: marquee-reverse linear infinite;
26
26
  }
27
- `})]})};var Pu=cva("inline-block rounded-full",{variants:{variant:{success:"bg-emerald-500",warning:"bg-amber-500",error:"bg-rose-500",info:"bg-blue-500",neutral:"bg-gray-400"},size:{sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3"},animate:{true:"animate-pulse",false:""}},defaultVariants:{variant:"neutral",size:"md",animate:false}}),Eu=ve__default.forwardRef(({className:e,variant:t,size:r,animate:o,...n},a)=>jsx("span",{ref:a,className:l(Pu({variant:t,size:r,animate:o,className:e})),...n}));Eu.displayName="StatusDot";var Iu=cva("shrink-0 bg-gray-200 dark:bg-white/[0.03]",{variants:{orientation:{horizontal:"h-[1px] w-full",vertical:"h-full w-[1px]"}},defaultVariants:{orientation:"horizontal"}}),Er=ve__default.forwardRef(({className:e,orientation:t="horizontal",decorative:r=true,...o},n)=>jsx("div",{ref:n,role:r?"none":"separator","aria-orientation":r?void 0:t,className:l(Iu({orientation:t,className:e})),...o}));Er.displayName="Separator";function $5({title:e,open:t,defaultOpen:r=false,onOpenChange:o,disabled:n=false,children:a,className:s,triggerClassName:i,contentClassName:c,...d}){let[m,u]=useState(r),p=t!==void 0,g=p?t:m,h=()=>{if(n)return;let v=!g;p||u(v),o?.(v);};return jsxs("div",{className:l("w-full overflow-hidden rounded-2xl border border-gray-200 bg-white dark:border-white/10 dark:bg-white/[0.02]",s),...d,children:[e&&jsxs("button",{type:"button",onClick:h,disabled:n,className:l("flex w-full items-center justify-between px-4 py-3 text-sm font-medium transition-colors hover:bg-gray-50 dark:hover:bg-white/[0.02]",n&&"cursor-not-allowed opacity-50",i),children:[e,jsx(ChevronDown,{className:l("h-4 w-4 shrink-0 text-gray-500 transition-transform duration-200 dark:text-gray-400",g&&"rotate-180")})]}),jsx("div",{className:l("grid transition-all duration-300 ease-in-out",g?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsx("div",{className:"overflow-hidden",children:jsx("div",{className:l("px-4 pb-4 pt-0",e&&"pt-1",c),children:a})})})]})}var Ts=createContext(void 0);function Ce(){let e=useContext(Ts);if(!e)throw new Error("Chart components must be used within a ChartContainer");return e}function Gt(e,t,r){return t===0?0:e/t*r}function _5({data:e,height:t=300,padding:r={top:20,right:20,bottom:40,left:40},className:o,children:n,...a}){let[s,i]=useState(null),[c,d]=useState(0),m=ve__default.useRef(null);ve__default.useEffect(()=>{if(!m.current)return;let p=new ResizeObserver(g=>{g[0]&&d(g[0].contentRect.width);});return p.observe(m.current),()=>p.disconnect()},[]);let u=useMemo(()=>{if(!e||e.length===0)return 1;let p=Math.max(...e.map(g=>g.value));return p===0?1:p*1.1},[e]);return jsx(Ts.Provider,{value:{width:c,height:t,data:e,maxValue:u,padding:r,hoveredIndex:s,setHoveredIndex:i},children:jsx("div",{ref:m,className:l("relative w-full select-none",o),style:{height:t},...a,children:c>0&&jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${c} ${t}`,className:"overflow-visible",children:n})})})}function X5({lines:e=5}){let{width:t,height:r,padding:o}=Ce(),n=r-o.top-o.bottom;return jsx("g",{className:"text-gray-200 dark:text-white/5",children:Array.from({length:e+1}).map((a,s)=>{let i=o.top+n/e*s;return jsx("line",{x1:o.left,y1:i,x2:t-o.right,y2:i,stroke:"currentColor",strokeWidth:1,strokeDasharray:"4 4"},s)})})}function q5(){let{width:e,height:t,padding:r,data:o}=Ce(),a=(e-r.left-r.right)/o.length;return jsx("g",{children:o.map((s,i)=>{let c=r.left+a*i+a/2,d=t-r.bottom+20;return jsx("text",{x:c,y:d,textAnchor:"middle",className:"fill-gray-400 dark:fill-white/40 text-xs font-medium",children:s.label},i)})})}function G5({renderTooltip:e}){let{hoveredIndex:t,data:r,width:o,padding:n}=Ce();if(t===null)return null;let s=(o-n.left-n.right)/r.length,i=n.left+s*t+s/2,c=r[t];if(!c)return null;let d=e?e(c):jsxs("div",{className:"rounded-xl border border-gray-200 dark:border-white/10 bg-white/90 dark:bg-black/80 px-3 py-2 text-xs shadow-xl backdrop-blur-md",children:[jsx("div",{className:"font-semibold text-gray-900 dark:text-white",children:c.label}),jsxs("div",{className:"text-gray-500 dark:text-white/70",children:["Value: ",c.value]})]});return jsx("foreignObject",{x:i-75,y:0,width:150,height:"100%",className:"pointer-events-none overflow-visible",children:jsx("div",{className:"flex h-full flex-col justify-center items-center",children:jsx("div",{className:"animate-in fade-in zoom-in-95 duration-200",children:d})})})}function j5(){return jsx("div",{className:"w-full h-full flex items-end justify-between gap-2 p-4 animate-pulse bg-gray-100 dark:bg-white/[0.02] rounded-2xl border border-gray-200 dark:border-white/5",children:[...Array(12)].map((e,t)=>jsx("div",{className:"w-full bg-gray-200 dark:bg-white/[0.03] rounded-t-lg",style:{height:`${Math.random()*60+20}%`}},t))})}function tC({color:e="cyan",showValues:t=false,animationDelay:r=0,onValueClick:o}){let{width:n,height:a,padding:s,data:i,maxValue:c,setHoveredIndex:d,hoveredIndex:m}=Ce();if(!i||i.length===0)return null;let u=n-s.left-s.right,p=a-s.top-s.bottom,g=u/i.length,h=g*.6,v={cyan:"from-cyan-500 to-blue-600",purple:"from-purple-500 to-indigo-600",emerald:"from-emerald-500 to-teal-600",amber:"from-amber-400 to-orange-600",rose:"from-rose-500 to-pink-600"};return jsxs("g",{children:[i.map((b,f)=>{let x=Gt(b.value,c,p),w=s.left+g*f+(g-h)/2,k=a-s.bottom-x,y=m===f,T=f*.1+r;return jsxs("g",{onMouseEnter:()=>d(f),onMouseLeave:()=>d(null),onClick:()=>o?.(b),className:l("cursor-pointer",o&&"cursor-pointer"),children:[jsx("rect",{x:s.left+g*f,y:s.top,width:g,height:p,fill:"transparent"}),jsx("rect",{x:w,y:k,width:h,height:x,rx:4,className:l("transition-all duration-300 ease-out",y?"brightness-125 filter":"opacity-80"),style:{transformOrigin:`center ${a-s.bottom}px`,animation:`grow-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) ${T}s backwards`}}),jsx("rect",{x:w,y:k,width:h,height:x,rx:4,className:l("bg-gradient-to-b",v[e]),style:{pointerEvents:"none",transformOrigin:`center ${a-s.bottom}px`,animation:`grow-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) ${T}s backwards`}}),t&&jsx("text",{x:w+h/2,y:k-8,textAnchor:"middle",fill:"white",fontSize:12,fontWeight:500,style:{opacity:0,animation:`fade-in-up 0.5s ease-out ${T+.4}s forwards`,textShadow:"0 2px 4px rgba(0,0,0,0.5)"},children:b.value})]},f)}),jsx("style",{children:`
27
+ `})]})};var Su=cva("inline-block rounded-full",{variants:{variant:{success:"bg-emerald-500",warning:"bg-amber-500",error:"bg-rose-500",info:"bg-blue-500",neutral:"bg-gray-400"},size:{sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3"},animate:{true:"animate-pulse",false:""}},defaultVariants:{variant:"neutral",size:"md",animate:false}}),Du=we__default.forwardRef(({className:e,variant:t,size:r,animate:o,...n},a)=>jsx("span",{ref:a,className:l(Su({variant:t,size:r,animate:o,className:e})),...n}));Du.displayName="StatusDot";var Bu=cva("shrink-0 bg-gray-200 dark:bg-white/[0.03]",{variants:{orientation:{horizontal:"h-[1px] w-full",vertical:"h-full w-[1px]"}},defaultVariants:{orientation:"horizontal"}}),Sr=we__default.forwardRef(({className:e,orientation:t="horizontal",decorative:r=true,...o},n)=>jsx("div",{ref:n,role:r?"none":"separator","aria-orientation":r?void 0:t,className:l(Bu({orientation:t,className:e})),...o}));Sr.displayName="Separator";function W5({title:e,open:t,defaultOpen:r=false,onOpenChange:o,disabled:n=false,children:a,className:s,triggerClassName:i,contentClassName:c,...d}){let[m,u]=useState(r),f=t!==void 0,g=f?t:m,x=()=>{if(n)return;let v=!g;f||u(v),o?.(v);};return jsxs("div",{className:l("w-full overflow-hidden rounded-2xl border border-gray-200 bg-white dark:border-white/10 dark:bg-white/[0.02]",s),...d,children:[e&&jsxs("button",{type:"button",onClick:x,disabled:n,className:l("flex w-full items-center justify-between px-4 py-3 text-sm font-medium transition-colors hover:bg-gray-50 dark:hover:bg-white/[0.02]",n&&"cursor-not-allowed opacity-50",i),children:[e,jsx(ChevronDown,{className:l("h-4 w-4 shrink-0 text-gray-500 transition-transform duration-200 dark:text-gray-400",g&&"rotate-180")})]}),jsx("div",{className:l("grid transition-all duration-300 ease-in-out",g?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsx("div",{className:"overflow-hidden",children:jsx("div",{className:l("px-4 pb-4 pt-0",e&&"pt-1",c),children:a})})})]})}var Ms=createContext(void 0);function Me(){let e=useContext(Ms);if(!e)throw new Error("Chart components must be used within a ChartContainer");return e}function Qt(e,t,r){return t===0?0:e/t*r}function G5({data:e,height:t=300,padding:r={top:20,right:20,bottom:40,left:40},className:o,children:n,...a}){let[s,i]=useState(null),[c,d]=useState(0),m=we__default.useRef(null);we__default.useEffect(()=>{if(!m.current)return;let f=new ResizeObserver(g=>{g[0]&&d(g[0].contentRect.width);});return f.observe(m.current),()=>f.disconnect()},[]);let u=useMemo(()=>{if(!e||e.length===0)return 1;let f=Math.max(...e.map(g=>g.value));return f===0?1:f*1.1},[e]);return jsx(Ms.Provider,{value:{width:c,height:t,data:e,maxValue:u,padding:r,hoveredIndex:s,setHoveredIndex:i},children:jsx("div",{ref:m,className:l("relative w-full select-none",o),style:{height:t},...a,children:c>0&&jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${c} ${t}`,className:"overflow-visible",children:n})})})}function j5({lines:e=5}){let{width:t,height:r,padding:o}=Me(),n=r-o.top-o.bottom;return jsx("g",{className:"text-gray-200 dark:text-white/5",children:Array.from({length:e+1}).map((a,s)=>{let i=o.top+n/e*s;return jsx("line",{x1:o.left,y1:i,x2:t-o.right,y2:i,stroke:"currentColor",strokeWidth:1,strokeDasharray:"4 4"},s)})})}function Q5(){let{width:e,height:t,padding:r,data:o}=Me(),a=(e-r.left-r.right)/o.length;return jsx("g",{children:o.map((s,i)=>{let c=r.left+a*i+a/2,d=t-r.bottom+20;return jsx("text",{x:c,y:d,textAnchor:"middle",className:"fill-gray-400 dark:fill-white/40 text-xs font-medium",children:s.label},i)})})}function J5({renderTooltip:e}){let{hoveredIndex:t,data:r,width:o,padding:n}=Me();if(t===null)return null;let s=(o-n.left-n.right)/r.length,i=n.left+s*t+s/2,c=r[t];if(!c)return null;let d=e?e(c):jsxs("div",{className:"rounded-xl border border-gray-200 dark:border-white/10 bg-white/90 dark:bg-black/80 px-3 py-2 text-xs shadow-xl backdrop-blur-md",children:[jsx("div",{className:"font-semibold text-gray-900 dark:text-white",children:c.label}),jsxs("div",{className:"text-gray-500 dark:text-white/70",children:["Value: ",c.value]})]});return jsx("foreignObject",{x:i-75,y:0,width:150,height:"100%",className:"pointer-events-none overflow-visible",children:jsx("div",{className:"flex h-full flex-col justify-center items-center",children:jsx("div",{className:"animate-in fade-in zoom-in-95 duration-200",children:d})})})}function Z5(){return jsx("div",{className:"w-full h-full flex items-end justify-between gap-2 p-4 animate-pulse bg-gray-100 dark:bg-white/[0.02] rounded-2xl border border-gray-200 dark:border-white/5",children:[...Array(12)].map((e,t)=>jsx("div",{className:"w-full bg-gray-200 dark:bg-white/[0.03] rounded-t-lg",style:{height:`${Math.random()*60+20}%`}},t))})}function aC({color:e="cyan",showValues:t=false,animationDelay:r=0,onValueClick:o}){let{width:n,height:a,padding:s,data:i,maxValue:c,setHoveredIndex:d,hoveredIndex:m}=Me();if(!i||i.length===0)return null;let u=n-s.left-s.right,f=a-s.top-s.bottom,g=u/i.length,x=g*.6,v={cyan:"from-cyan-500 to-blue-600",purple:"from-purple-500 to-indigo-600",emerald:"from-emerald-500 to-teal-600",amber:"from-amber-400 to-orange-600",rose:"from-rose-500 to-pink-600"};return jsxs("g",{children:[i.map((h,p)=>{let b=Qt(h.value,c,f),w=s.left+g*p+(g-x)/2,k=a-s.bottom-b,y=m===p,N=p*.1+r;return jsxs("g",{onMouseEnter:()=>d(p),onMouseLeave:()=>d(null),onClick:()=>o?.(h),className:l("cursor-pointer",o&&"cursor-pointer"),children:[jsx("rect",{x:s.left+g*p,y:s.top,width:g,height:f,fill:"transparent"}),jsx("rect",{x:w,y:k,width:x,height:b,rx:4,className:l("transition-all duration-300 ease-out",y?"brightness-125 filter":"opacity-80"),style:{transformOrigin:`center ${a-s.bottom}px`,animation:`grow-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) ${N}s backwards`}}),jsx("rect",{x:w,y:k,width:x,height:b,rx:4,className:l("bg-gradient-to-b",v[e]),style:{pointerEvents:"none",transformOrigin:`center ${a-s.bottom}px`,animation:`grow-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) ${N}s backwards`}}),t&&jsx("text",{x:w+x/2,y:k-8,textAnchor:"middle",fill:"white",fontSize:12,fontWeight:500,style:{opacity:0,animation:`fade-in-up 0.5s ease-out ${N+.4}s forwards`,textShadow:"0 2px 4px rgba(0,0,0,0.5)"},children:h.value})]},p)}),jsx("style",{children:`
28
28
  @keyframes grow-up {
29
29
  from { transform: scaleY(0); }
30
30
  to { transform: scaleY(1); }
@@ -33,12 +33,12 @@ import*as ve from'react';import ve__default,{useRef,useState,useEffect,createCon
33
33
  from { opacity: 0; transform: translateY(10px); }
34
34
  to { opacity: 1; transform: translateY(0); }
35
35
  }
36
- `})]})}function sC({color:e="purple",showValues:t=false,animationDelay:r=0,onValueClick:o}){let{width:n,height:a,padding:s,data:i,maxValue:c,setHoveredIndex:d,hoveredIndex:m}=Ce();if(!i||i.length===0)return null;let u=n-s.left-s.right,p=a-s.top-s.bottom,g=i.length>1?u/(i.length-1):u,v={cyan:{stroke:"#06b6d4",fill:"rgba(6, 182, 212, 0.2)"},purple:{stroke:"#8b5cf6",fill:"rgba(139, 92, 246, 0.2)"},emerald:{stroke:"#10b981",fill:"rgba(16, 185, 129, 0.2)"},amber:{stroke:"#f59e0b",fill:"rgba(245, 158, 11, 0.2)"},rose:{stroke:"#f43f5e",fill:"rgba(244, 63, 94, 0.2)"}}[e],b=i.map((w,k)=>{let y=s.left+g*k,T=a-s.bottom-Gt(w.value,c,p);return {x:y,y:T,item:w}}),f=b.map((w,k)=>k===0?`M ${w.x} ${w.y}`:`L ${w.x} ${w.y}`).join(" "),x=`
37
- ${f}
36
+ `})]})}function cC({color:e="purple",showValues:t=false,animationDelay:r=0,onValueClick:o}){let{width:n,height:a,padding:s,data:i,maxValue:c,setHoveredIndex:d,hoveredIndex:m}=Me();if(!i||i.length===0)return null;let u=n-s.left-s.right,f=a-s.top-s.bottom,g=i.length>1?u/(i.length-1):u,v={cyan:{stroke:"#06b6d4",fill:"rgba(6, 182, 212, 0.2)"},purple:{stroke:"#8b5cf6",fill:"rgba(139, 92, 246, 0.2)"},emerald:{stroke:"#10b981",fill:"rgba(16, 185, 129, 0.2)"},amber:{stroke:"#f59e0b",fill:"rgba(245, 158, 11, 0.2)"},rose:{stroke:"#f43f5e",fill:"rgba(244, 63, 94, 0.2)"}}[e],h=i.map((w,k)=>{let y=s.left+g*k,N=a-s.bottom-Qt(w.value,c,f);return {x:y,y:N,item:w}}),p=h.map((w,k)=>k===0?`M ${w.x} ${w.y}`:`L ${w.x} ${w.y}`).join(" "),b=`
37
+ ${p}
38
38
  L ${n-s.right} ${a-s.bottom}
39
39
  L ${s.left} ${a-s.bottom}
40
40
  Z
41
- `;return jsxs("g",{children:[jsx("path",{d:x,fill:v.fill,style:{opacity:0,animation:`fade-in 1s ease-out ${r}s forwards`}}),jsx("path",{d:f,fill:"none",stroke:v.stroke,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",style:{strokeDasharray:2e3,strokeDashoffset:2e3,animation:`draw-line 2s ease-out ${r}s forwards`}}),b.map((w,k)=>jsxs("g",{onMouseEnter:()=>d(k),onMouseLeave:()=>d(null),onClick:()=>o?.(w.item),className:l("cursor-crosshair",o&&"cursor-pointer"),children:[jsx("rect",{x:w.x-g/2,y:s.top,width:g,height:p,fill:"transparent"}),(m===k||t)&&jsxs(Fragment,{children:[m===k&&jsx("line",{x1:w.x,y1:s.top,x2:w.x,y2:a-s.bottom,stroke:"white",strokeWidth:1,strokeDasharray:"4 4",className:"opacity-50"}),jsx("circle",{cx:w.x,cy:w.y,r:m===k?6:4,fill:v.stroke,stroke:"white",strokeWidth:2,style:{transition:"r 0.2s ease-out"}}),t&&jsx("text",{x:w.x,y:w.y-12,textAnchor:"middle",fill:"white",fontSize:12,fontWeight:500,style:{opacity:0,animation:`fade-in-up 0.5s ease-out ${r+1+k*.1}s forwards`,textShadow:"0 2px 4px rgba(0,0,0,0.5)"},children:i[k]?.value})]})]},k)),jsx("style",{children:`
41
+ `;return jsxs("g",{children:[jsx("path",{d:b,fill:v.fill,style:{opacity:0,animation:`fade-in 1s ease-out ${r}s forwards`}}),jsx("path",{d:p,fill:"none",stroke:v.stroke,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",style:{strokeDasharray:2e3,strokeDashoffset:2e3,animation:`draw-line 2s ease-out ${r}s forwards`}}),h.map((w,k)=>jsxs("g",{onMouseEnter:()=>d(k),onMouseLeave:()=>d(null),onClick:()=>o?.(w.item),className:l("cursor-crosshair",o&&"cursor-pointer"),children:[jsx("rect",{x:w.x-g/2,y:s.top,width:g,height:f,fill:"transparent"}),(m===k||t)&&jsxs(Fragment,{children:[m===k&&jsx("line",{x1:w.x,y1:s.top,x2:w.x,y2:a-s.bottom,stroke:"white",strokeWidth:1,strokeDasharray:"4 4",className:"opacity-50"}),jsx("circle",{cx:w.x,cy:w.y,r:m===k?6:4,fill:v.stroke,stroke:"white",strokeWidth:2,style:{transition:"r 0.2s ease-out"}}),t&&jsx("text",{x:w.x,y:w.y-12,textAnchor:"middle",fill:"white",fontSize:12,fontWeight:500,style:{opacity:0,animation:`fade-in-up 0.5s ease-out ${r+1+k*.1}s forwards`,textShadow:"0 2px 4px rgba(0,0,0,0.5)"},children:i[k]?.value})]})]},k)),jsx("style",{children:`
42
42
  @keyframes draw-line {
43
43
  to { stroke-dashoffset: 0; }
44
44
  }
@@ -50,7 +50,7 @@ import*as ve from'react';import ve__default,{useRef,useState,useEffect,createCon
50
50
  from { opacity: 0; transform: translateY(10px); }
51
51
  to { opacity: 1; transform: translateY(0); }
52
52
  }
53
- `})]})}function mC({color:e="cyan",showValues:t=false,animationDelay:r=0,curve:o="smooth",strokeWidth:n=3,align:a="edge",onValueClick:s}){let{width:i,height:c,padding:d,data:m,maxValue:u,setHoveredIndex:p,hoveredIndex:g}=Ce();if(!m||m.length===0)return null;let h=i-d.left-d.right,v=c-d.top-d.bottom,b=a==="center"?h/m.length:m.length>1?h/(m.length-1):h,x={cyan:"#06b6d4",purple:"#8b5cf6",emerald:"#10b981",amber:"#f59e0b",rose:"#f43f5e"}[e],w=m.map((y,T)=>{let C;a==="center"?C=d.left+b*T+b/2:C=d.left+b*T;let N=c-d.bottom-Gt(y.value,u,v);return {x:C,y:N,item:y}}),k="";if(w.length>0)if(k=`M ${w[0].x} ${w[0].y}`,o==="smooth")for(let y=0;y<w.length-1;y++){let T=w[y],C=w[y+1],N=T.x+(C.x-T.x)/2,R=T.y,H=T.x+(C.x-T.x)/2,E=C.y;k+=` C ${N} ${R}, ${H} ${E}, ${C.x} ${C.y}`;}else if(o==="step")for(let y=0;y<w.length-1;y++){let T=w[y],C=w[y+1];k+=` L ${C.x} ${T.y} L ${C.x} ${C.y}`;}else for(let y=1;y<w.length;y++)k+=` L ${w[y].x} ${w[y].y}`;return jsxs("g",{children:[jsx("path",{d:k,fill:"none",stroke:x,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",style:{strokeDasharray:3e3,strokeDashoffset:3e3,animation:`draw-line 2.5s ease-out ${r}s forwards`}}),w.map((y,T)=>jsxs("g",{onMouseEnter:()=>p(T),onMouseLeave:()=>p(null),onClick:()=>s?.(y.item),className:l("cursor-crosshair",s&&"cursor-pointer"),children:[jsx("rect",{x:y.x-b/2,y:d.top,width:b,height:v,fill:"transparent"}),(g===T||t)&&jsxs(Fragment,{children:[g===T&&jsx("line",{x1:y.x,y1:d.top,x2:y.x,y2:c-d.bottom,stroke:"white",strokeWidth:1,strokeDasharray:"4 4",className:"opacity-50"}),jsx("circle",{cx:y.x,cy:y.y,r:g===T?6:4,fill:x,stroke:"white",strokeWidth:2,style:{transition:"r 0.2s ease-out"}}),t&&jsx("text",{x:y.x,y:y.y-12,textAnchor:"middle",fill:"white",fontSize:12,fontWeight:500,style:{opacity:0,animation:`fade-in-up 0.5s ease-out ${r+1+T*.1}s forwards`,textShadow:"0 2px 4px rgba(0,0,0,0.5)"},children:m[T]?.value})]})]},T)),jsx("style",{children:`
53
+ `})]})}function fC({color:e="cyan",showValues:t=false,animationDelay:r=0,curve:o="smooth",strokeWidth:n=3,align:a="edge",onValueClick:s}){let{width:i,height:c,padding:d,data:m,maxValue:u,setHoveredIndex:f,hoveredIndex:g}=Me();if(!m||m.length===0)return null;let x=i-d.left-d.right,v=c-d.top-d.bottom,h=a==="center"?x/m.length:m.length>1?x/(m.length-1):x,b={cyan:"#06b6d4",purple:"#8b5cf6",emerald:"#10b981",amber:"#f59e0b",rose:"#f43f5e"}[e],w=m.map((y,N)=>{let C;a==="center"?C=d.left+h*N+h/2:C=d.left+h*N;let T=c-d.bottom-Qt(y.value,u,v);return {x:C,y:T,item:y}}),k="";if(w.length>0)if(k=`M ${w[0].x} ${w[0].y}`,o==="smooth")for(let y=0;y<w.length-1;y++){let N=w[y],C=w[y+1],T=N.x+(C.x-N.x)/2,L=N.y,I=N.x+(C.x-N.x)/2,P=C.y;k+=` C ${T} ${L}, ${I} ${P}, ${C.x} ${C.y}`;}else if(o==="step")for(let y=0;y<w.length-1;y++){let N=w[y],C=w[y+1];k+=` L ${C.x} ${N.y} L ${C.x} ${C.y}`;}else for(let y=1;y<w.length;y++)k+=` L ${w[y].x} ${w[y].y}`;return jsxs("g",{children:[jsx("path",{d:k,fill:"none",stroke:b,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",style:{strokeDasharray:3e3,strokeDashoffset:3e3,animation:`draw-line 2.5s ease-out ${r}s forwards`}}),w.map((y,N)=>jsxs("g",{onMouseEnter:()=>f(N),onMouseLeave:()=>f(null),onClick:()=>s?.(y.item),className:l("cursor-crosshair",s&&"cursor-pointer"),children:[jsx("rect",{x:y.x-h/2,y:d.top,width:h,height:v,fill:"transparent"}),(g===N||t)&&jsxs(Fragment,{children:[g===N&&jsx("line",{x1:y.x,y1:d.top,x2:y.x,y2:c-d.bottom,stroke:"white",strokeWidth:1,strokeDasharray:"4 4",className:"opacity-50"}),jsx("circle",{cx:y.x,cy:y.y,r:g===N?6:4,fill:b,stroke:"white",strokeWidth:2,style:{transition:"r 0.2s ease-out"}}),t&&jsx("text",{x:y.x,y:y.y-12,textAnchor:"middle",fill:"white",fontSize:12,fontWeight:500,style:{opacity:0,animation:`fade-in-up 0.5s ease-out ${r+1+N*.1}s forwards`,textShadow:"0 2px 4px rgba(0,0,0,0.5)"},children:m[N]?.value})]})]},N)),jsx("style",{children:`
54
54
  @keyframes draw-line {
55
55
  to { stroke-dashoffset: 0; }
56
56
  }
@@ -58,14 +58,14 @@ import*as ve from'react';import ve__default,{useRef,useState,useEffect,createCon
58
58
  from { opacity: 0; transform: translateY(10px); }
59
59
  to { opacity: 1; transform: translateY(0); }
60
60
  }
61
- `})]})}function xC({innerRadius:e=0,padAngle:t=.02,showLabels:r=false,colors:o=["#06b6d4","#8b5cf6","#10b981","#f59e0b","#f43f5e","#3b82f6","#ec4899"],onValueClick:n}){let{width:a,height:s,data:i,setHoveredIndex:c,hoveredIndex:d}=Ce(),m=Math.min(a,s)/2*.8,u=a/2,p=s/2,g=useMemo(()=>i.reduce((f,x)=>f+x.value,0),[i]),h=0,v=i.map((f,x)=>{let w=f.value/g,k=w*2*Math.PI,y=h,T=h+k;return h+=k,{...f,startAngle:y,endAngle:T,color:o[x%o.length],percentage:w}}),b=(f,x)=>{let w=u+x*Math.cos(f),k=p+x*Math.sin(f);return [w,k]};return jsxs("g",{children:[v.map((f,x)=>{let w=f.startAngle+(v.length>1?t/2:0),k=f.endAngle-(v.length>1?t/2:0);if(k<=w)return null;let[y,T]=b(w,m),[C,N]=b(k,m),R=k-w>Math.PI?1:0,H=m*e,[E,D]=b(k,H),[I,P]=b(w,H),M=[`M ${y} ${T}`,`A ${m} ${m} 0 ${R} 1 ${C} ${N}`,e>0?`L ${E} ${D}`:`L ${u} ${p}`,e>0?`A ${H} ${H} 0 ${R} 0 ${I} ${P}`:"","Z"].join(" "),G=d===x,se=(f.startAngle+f.endAngle)/2,J=m*(e>0?(1+e)/2:.7),[ht,Vr]=b(se,J);return jsxs("g",{onMouseEnter:()=>c(x),onMouseLeave:()=>c(null),className:"cursor-pointer",children:[jsx("path",{d:M,fill:f.color,className:l("transition-all duration-300 ease-out",G?"opacity-100 brightness-110":"opacity-90"),style:{transformOrigin:`${u}px ${p}px`,transform:G?"scale(1.05)":"scale(1)",animation:`pie-enter 0.6s ease-out ${x*.05}s backwards`}}),(r||G)&&jsxs("text",{x:ht,y:Vr,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontSize:12,fontWeight:600,className:"pointer-events-none",style:{textShadow:"0 1px 2px rgba(0,0,0,0.5)"},children:[Math.round(f.percentage*100),"%"]})]},x)}),jsx("style",{children:`
61
+ `})]})}function yC({innerRadius:e=0,padAngle:t=.02,showLabels:r=false,colors:o=["#06b6d4","#8b5cf6","#10b981","#f59e0b","#f43f5e","#3b82f6","#ec4899"],onValueClick:n}){let{width:a,height:s,data:i,setHoveredIndex:c,hoveredIndex:d}=Me(),m=Math.min(a,s)/2*.8,u=a/2,f=s/2,g=useMemo(()=>i.reduce((p,b)=>p+b.value,0),[i]),x=0,v=i.map((p,b)=>{let w=p.value/g,k=w*2*Math.PI,y=x,N=x+k;return x+=k,{...p,startAngle:y,endAngle:N,color:o[b%o.length],percentage:w}}),h=(p,b)=>{let w=u+b*Math.cos(p),k=f+b*Math.sin(p);return [w,k]};return jsxs("g",{children:[v.map((p,b)=>{let w=p.startAngle+(v.length>1?t/2:0),k=p.endAngle-(v.length>1?t/2:0);if(k<=w)return null;let[y,N]=h(w,m),[C,T]=h(k,m),L=k-w>Math.PI?1:0,I=m*e,[P,D]=h(k,I),[V,A]=h(w,I),M=[`M ${y} ${N}`,`A ${m} ${m} 0 ${L} 1 ${C} ${T}`,e>0?`L ${P} ${D}`:`L ${u} ${f}`,e>0?`A ${I} ${I} 0 ${L} 0 ${V} ${A}`:"","Z"].join(" "),J=d===b,ae=(p.startAngle+p.endAngle)/2,F=m*(e>0?(1+e)/2:.7),[de,At]=h(ae,F);return jsxs("g",{onMouseEnter:()=>c(b),onMouseLeave:()=>c(null),className:"cursor-pointer",children:[jsx("path",{d:M,fill:p.color,className:l("transition-all duration-300 ease-out",J?"opacity-100 brightness-110":"opacity-90"),style:{transformOrigin:`${u}px ${f}px`,transform:J?"scale(1.05)":"scale(1)",animation:`pie-enter 0.6s ease-out ${b*.05}s backwards`}}),(r||J)&&jsxs("text",{x:de,y:At,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontSize:12,fontWeight:600,className:"pointer-events-none",style:{textShadow:"0 1px 2px rgba(0,0,0,0.5)"},children:[Math.round(p.percentage*100),"%"]})]},b)}),jsx("style",{children:`
62
62
  @keyframes pie-enter {
63
63
  from { opacity: 0; transform: scale(0.8) rotate(-10deg); }
64
64
  to { opacity: 0.9; transform: scale(1) rotate(0); }
65
65
  }
66
- `})]})}function NC({data:e,keys:t,colors:r=["cyan","purple","emerald"],maxValue:o,height:n=300,className:a,...s}){let[i,c]=useState(0),d=ve__default.useRef(null);ve__default.useEffect(()=>{if(!d.current)return;let b=new ResizeObserver(f=>{f[0]&&c(f[0].contentRect.width);});return b.observe(d.current),()=>b.disconnect()},[]);let m={x:i/2,y:n/2},u=Math.min(i,n)/2-40,p=useMemo(()=>{if(o)return o;let b=0;return e.forEach(f=>{t.forEach(x=>{let w=Number(f[x])||0;w>b&&(b=w);});}),b*1.1||100},[e,t,o]),g=Math.PI*2/e.length,h={cyan:"rgba(6, 182, 212, 0.5)",purple:"rgba(139, 92, 246, 0.5)",emerald:"rgba(16, 185, 129, 0.5)",amber:"rgba(245, 158, 11, 0.5)",rose:"rgba(244, 63, 94, 0.5)"},v={cyan:"#06b6d4",purple:"#8b5cf6",emerald:"#10b981",amber:"#f59e0b",rose:"#f43f5e"};return i===0?jsx("div",{ref:d,style:{height:n}}):jsx("div",{ref:d,className:l("relative w-full select-none",a),style:{height:n},...s,children:jsxs("svg",{width:"100%",height:"100%",viewBox:`0 0 ${i} ${n}`,className:"overflow-visible",children:[[1,2,3,4,5].map(b=>{let f=u/5*b,x=e.map((w,k)=>{let y=g*k-Math.PI/2;return `${m.x+Math.cos(y)*f},${m.y+Math.sin(y)*f}`}).join(" ");return jsx("polygon",{points:x,fill:"none",stroke:"rgba(255,255,255,0.1)",strokeWidth:"1"},b)}),e.map((b,f)=>{let x=g*f-Math.PI/2,w=m.x+Math.cos(x)*u,k=m.y+Math.sin(x)*u,y=m.x+Math.cos(x)*(u+20),T=m.y+Math.sin(x)*(u+20);return jsxs("g",{children:[jsx("line",{x1:m.x,y1:m.y,x2:w,y2:k,stroke:"rgba(255,255,255,0.1)",strokeWidth:"1"}),jsx("text",{x:y,y:T,textAnchor:"middle",dominantBaseline:"middle",fill:"rgba(255,255,255,0.6)",fontSize:"12",children:b.subject})]},f)}),t.map((b,f)=>{let x=e.map((T,C)=>{let R=(Number(T[b])||0)/p*u,H=g*C-Math.PI/2;return `${m.x+Math.cos(H)*R},${m.y+Math.sin(H)*R}`}).join(" "),w=r[f%r.length]||"cyan",k=h[w],y=v[w];return jsx("polygon",{points:x,fill:k,fillOpacity:.3,stroke:y,strokeWidth:2,className:"transition-all duration-500 ease-out hover:fill-opacity-50"},b)})]})})}function RC({data:e,color:t="emerald",height:r=40,strokeWidth:o=2,fill:n=false,className:a,...s}){let i=Math.max(...e),c=Math.min(...e),d=i-c||1,u={cyan:"#06b6d4",purple:"#8b5cf6",emerald:"#10b981",amber:"#f59e0b",rose:"#f43f5e",white:"#ffffff"}[t],p=e.map((v,b)=>{let f=b/(e.length-1)*100,w=95-(v-c)/d*90;return {x:f,y:w}}),g="";if(p.length>0){g=`M ${p[0].x} ${p[0].y}`;for(let v=0;v<p.length-1;v++){let b=p[v],f=p[v+1],x=b.x+(f.x-b.x)/2,w=b.y,k=b.x+(f.x-b.x)/2,y=f.y;g+=` C ${x} ${w}, ${k} ${y}, ${f.x} ${f.y}`;}}let h=n?`${g} L 100 100 L 0 100 Z`:void 0;return jsx("div",{className:l("w-full overflow-hidden",a),style:{height:r},...s,children:jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"overflow-visible",children:[n&&jsx("path",{d:h,fill:u,fillOpacity:.1,stroke:"none"}),jsx("path",{d:g,fill:"none",stroke:u,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]})})}function SC({ticks:e=5,format:t=r=>r.toString()}){let{height:r,padding:o,maxValue:n}=Ce(),a=r-o.top-o.bottom;return jsx("g",{children:Array.from({length:e+1}).map((s,i)=>{let c=n/e*i,d=r-o.bottom-a/e*i;return jsx("text",{x:o.left-10,y:d,textAnchor:"end",dominantBaseline:"middle",className:"fill-gray-400 dark:fill-white/40 text-xs font-medium",children:t(Math.round(c))},i)})})}var ga=createContext(void 0);function OC({defaultValue:e,value:t,onValueChange:r,className:o,children:n,...a}){let[s,i]=useState(e),c=m=>{t===void 0&&i(m),r?.(m);},d=t!==void 0?t:s;return jsx(ga.Provider,{value:{value:d,onValueChange:c},children:jsx("div",{className:l("w-full",o),...a,children:n})})}function VC({className:e,children:t,...r}){return jsx("div",{role:"tablist",className:l("inline-flex h-10 items-center justify-center rounded-2xl bg-gray-100 p-1 text-gray-500 dark:bg-white/[0.03] dark:text-white/60",e),...r,children:t})}function zC({className:e,value:t,children:r,...o}){let n=useContext(ga);if(!n)throw new Error("TabsTrigger must be used within Tabs");let a=n.value===t;return jsx("button",{type:"button",role:"tab","aria-selected":a,"aria-controls":`tabs-content-${t}`,id:`tabs-trigger-${t}`,onClick:()=>n.onValueChange(t),className:l("inline-flex items-center justify-center whitespace-nowrap rounded-2xl px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-zinc-950 dark:focus-visible:ring-white/20",a?"bg-white text-gray-900 shadow-sm dark:bg-white/[0.06] dark:text-white dark:backdrop-blur-sm":"hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-white/[0.03] dark:hover:text-white",e),...o,children:r})}function KC({className:e,value:t,children:r,...o}){let n=useContext(ga);if(!n)throw new Error("TabsContent must be used within Tabs");return n.value!==t?null:jsx("div",{role:"tabpanel",id:`tabs-content-${t}`,"aria-labelledby":`tabs-trigger-${t}`,tabIndex:0,className:l("mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20 focus-visible:ring-offset-2",e),...o,children:r})}var YC=ve__default.forwardRef(({className:e,children:t,...r},o)=>jsx("aside",{ref:o,className:l("flex h-full w-64 flex-col border-r backdrop-blur-xl transition-colors duration-200","border-gray-200 bg-white/50","dark:border-white/10 dark:bg-black/20",e),...r,children:t})),_C=ve__default.forwardRef(({className:e,children:t,...r},o)=>jsx("div",{ref:o,className:l("flex h-16 items-center px-6 border-b border-gray-200 dark:border-white/5",e),...r,children:t})),XC=ve__default.forwardRef(({className:e,children:t,...r},o)=>jsx("div",{ref:o,className:l("flex-1 overflow-y-auto py-4 px-3 space-y-1",e),...r,children:t})),qC=ve__default.forwardRef(({className:e,children:t,...r},o)=>jsx("div",{ref:o,className:l("p-4 border-t border-gray-200 dark:border-white/5",e),...r,children:t})),GC=ve__default.forwardRef(({className:e,children:t,active:r,icon:o,badge:n,...a},s)=>jsxs("button",{ref:s,className:l("flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium transition-colors","hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-white/[0.03] dark:hover:text-white",r?"bg-gray-200 text-gray-900 dark:bg-white/[0.06] dark:text-white":"text-gray-600 dark:text-white/60",e),...a,children:[o&&jsx("span",{className:l("flex h-4 w-4 items-center justify-center",r?"text-gray-900 dark:text-white":"text-gray-500 dark:text-white/60"),children:o}),jsx("span",{className:"flex-1 text-left",children:t}),n&&jsx("span",{className:"flex h-5 min-w-5 items-center justify-center rounded-full bg-gray-200 dark:bg-white/[0.06] px-1.5 text-[10px] font-bold text-gray-900 dark:text-white",children:n})]})),jC=ve__default.forwardRef(({className:e,children:t,label:r,...o},n)=>jsxs("div",{ref:n,className:l("mb-6",e),...o,children:[r&&jsx("div",{className:"mb-2 px-3 text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-white/40",children:r}),jsx("div",{className:"space-y-1",children:t})]}));var Ju={sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl","2xl":"max-w-screen-2xl",full:"max-w-full"};function aM({logo:e,links:t=[],actions:r,className:o,maxWidth:n="xl"}){let[a,s]=useState(false),[i,c]=useState(false);return useEffect(()=>{let d=()=>{s(window.scrollY>20);};return window.addEventListener("scroll",d),()=>window.removeEventListener("scroll",d)},[]),jsx("nav",{className:l("fixed top-0 left-0 right-0 z-50 transition-all duration-300 px-4 py-4",a?"py-3":"py-6",o),children:jsxs("div",{className:l("mx-auto transition-all duration-300",Ju[n]),children:[jsxs(te,{className:l("flex items-center justify-between px-6 py-3 transition-all duration-300",a?"rounded-2xl border-white/10 bg-white/70 dark:bg-zinc-900/70 backdrop-blur-xl shadow-lg":"rounded-2xl border-transparent bg-transparent dark:bg-transparent backdrop-blur-none shadow-none"),children:[jsx("div",{className:"flex items-center gap-2",children:e||jsx("span",{className:"text-xl font-bold tracking-tighter",children:"PIXON"})}),jsx("div",{className:"hidden md:flex items-center gap-8",children:t.map(d=>jsx("a",{href:d.href,className:"text-sm font-medium text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white transition-colors",children:d.label},d.label))}),jsxs("div",{className:"flex items-center gap-4",children:[jsx("div",{className:"hidden md:flex items-center gap-2",children:r}),jsx("button",{className:"md:hidden p-2 text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-white/[0.03] rounded-2xl transition-colors",onClick:()=>c(!i),children:i?jsx(X$1,{size:20}):jsx(Menu,{size:20})})]})]}),jsx("div",{className:l("md:hidden absolute top-full left-4 right-4 mt-2 transition-all duration-300 origin-top",i?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 -translate-y-4 pointer-events-none"),children:jsxs(te,{className:"p-4 flex flex-col gap-4 shadow-2xl border-white/10 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-2xl",children:[t.map(d=>jsx("a",{href:d.href,className:"text-base font-medium px-4 py-2 rounded-2xl hover:bg-zinc-100 dark:hover:bg-white/[0.03] text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white transition-all",onClick:()=>c(false),children:d.label},d.label)),jsx("div",{className:"pt-4 border-t border-zinc-200 dark:border-white/10 flex flex-col gap-2",children:r})]})})]})})}var fo=createContext(void 0);function tt({children:e}){let[t,r]=useState(false),o=useRef(null);return jsx(fo.Provider,{value:{isOpen:t,setIsOpen:r,triggerRef:o},children:jsx("div",{className:"relative inline-block text-left",children:e})})}function rt({className:e,children:t,...r}){let o=useContext(fo);if(!o)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=a=>{o.setIsOpen(!o.isOpen),r.onClick?.(a);};return jsx("button",{ref:o.triggerRef,type:"button","aria-haspopup":"menu","aria-expanded":o.isOpen?"true":"false",onClick:n,className:l("inline-flex items-center justify-center",e),...r,children:t})}function ot({className:e,children:t,align:r="start",side:o="bottom",...n}){let a=useContext(fo);if(!a)throw new Error("DropdownMenuContent must be used within DropdownMenu");let s=useRef(null),{position:i,isPositioned:c}=Vt(a.triggerRef,s,{side:o,align:r,isOpen:a.isOpen});if(useEffect(()=>{if(a.isOpen){let m=p=>{s.current&&!s.current.contains(p.target)&&a.triggerRef.current&&!a.triggerRef.current.contains(p.target)&&a.setIsOpen(false);},u=p=>{if(p.key==="Escape"&&(a.setIsOpen(false),a.triggerRef.current?.focus()),p.key==="ArrowDown"||p.key==="ArrowUp"){p.preventDefault();let g=s.current?.querySelectorAll('[role="menuitem"]');if(!g.length)return;let h=Array.from(g).indexOf(document.activeElement),v=0;p.key==="ArrowDown"?v=(h+1)%g.length:v=(h-1+g.length)%g.length,g[v]?.focus();}};return document.addEventListener("mousedown",m),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",u);}}},[a.isOpen,a.setIsOpen,a.triggerRef]),!a.isOpen)return null;let d=()=>o==="bottom"?r==="start"?"top left":r==="end"?"top right":"top center":o==="top"?r==="start"?"bottom left":r==="end"?"bottom right":"bottom center":o==="left"?r==="start"?"top right":r==="end"?"bottom right":"center right":o==="right"?r==="start"?"top left":r==="end"?"bottom left":"center left":"center center";return createPortal(jsx("div",{ref:s,role:"menu","aria-orientation":"vertical",style:{top:i.top,left:i.left,transformOrigin:d()},className:l("fixed z-[110] min-w-[8rem] overflow-hidden rounded-2xl border border-gray-200 dark:border-white/10 bg-white/80 dark:bg-white/[0.03] backdrop-blur-xl p-1 shadow-md duration-100",c?"animate-in fade-in zoom-in-95 opacity-100":"opacity-0",e),...n,children:t}),document.body)}function X({className:e,children:t,...r}){let o=useContext(fo);return jsx("button",{type:"button",role:"menuitem",onClick:a=>{o?.setIsOpen(false),r.onClick?.(a);},className:l("relative flex w-full cursor-pointer select-none items-center rounded-2xl px-3 py-2 text-sm outline-none transition-colors","text-gray-700 dark:text-white/80","hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-white/[0.06] dark:hover:text-white","focus:bg-gray-100 focus:text-gray-900 dark:focus:bg-white/[0.06] dark:focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:t})}function Is({className:e,children:t,...r}){return jsx("div",{className:l("px-2 py-1.5 text-sm font-semibold text-gray-900 dark:text-white",e),...r,children:t})}function ha({className:e,...t}){return jsx("div",{className:l("-mx-1 my-1 h-px bg-gray-200 dark:bg-white/[0.03]",e),...t})}function vM({name:e,description:t,avatarSrc:r,avatarFallback:o,className:n,side:a="top",align:s="start"}){return jsxs(tt,{children:[jsx(rt,{className:l("w-full outline-none",n),children:jsxs("div",{className:"group flex w-full items-center gap-3 rounded-2xl border border-gray-200 dark:border-white/5 bg-white dark:bg-white/[0.03] p-3 transition-colors hover:bg-gray-50 dark:hover:bg-white/[0.06]",children:[jsx(B,{src:r,fallback:o||e.charAt(0),size:"sm"}),jsxs("div",{className:"flex flex-1 flex-col items-start text-left",children:[jsx("span",{className:"text-xs font-medium text-gray-900 dark:text-white",children:e}),t&&jsx("span",{className:"text-[10px] text-gray-500 dark:text-white/50",children:t})]}),jsx(Settings,{className:"h-4 w-4 text-gray-400 dark:text-white/50 transition-colors group-hover:text-gray-900 dark:group-hover:text-white"})]})}),jsxs(ot,{className:"w-56",align:s,side:a,children:[jsx(Is,{children:"My Account"}),jsx(ha,{}),jsxs(X,{children:[jsx(User,{className:"mr-2 h-4 w-4"}),jsx("span",{children:"Profile"})]}),jsxs(X,{children:[jsx(Settings,{className:"mr-2 h-4 w-4"}),jsx("span",{children:"Settings"})]}),jsx(ha,{}),jsxs(X,{className:"text-rose-400 focus:text-rose-400",children:[jsx(LogOut,{className:"mr-2 h-4 w-4"}),jsx("span",{children:"Log out"})]})]})]})}var np=ve__default.forwardRef(({...e},t)=>jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));np.displayName="Breadcrumb";var sp=ve__default.forwardRef(({className:e,...t},r)=>jsx("ol",{ref:r,className:l("flex flex-wrap items-center gap-1.5 break-words text-sm text-gray-500 dark:text-white/50 sm:gap-2.5",e),...t}));sp.displayName="BreadcrumbList";var ip=ve__default.forwardRef(({className:e,...t},r)=>jsx("li",{ref:r,className:l("inline-flex items-center gap-1.5",e),...t}));ip.displayName="BreadcrumbItem";var lp=ve__default.forwardRef(({className:e,...t},r)=>jsx("a",{ref:r,className:l("transition-colors hover:text-gray-900 dark:hover:text-white",e),...t}));lp.displayName="BreadcrumbLink";var cp=ve__default.forwardRef(({className:e,...t},r)=>jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:l("font-normal text-gray-900 dark:text-white",e),...t}));cp.displayName="BreadcrumbPage";var dp=({children:e,className:t,...r})=>jsx("li",{role:"presentation","aria-hidden":"true",className:l("[&>svg]:size-3.5",t),...r,children:e??jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:jsx("path",{d:"m9 18 6-6-6-6"})})});dp.displayName="BreadcrumbSeparator";var mp=({className:e,...t})=>jsxs("span",{role:"presentation","aria-hidden":"true",className:l("flex h-9 w-9 items-center justify-center",e),...t,children:[jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:[jsx("circle",{cx:"12",cy:"12",r:"1"}),jsx("circle",{cx:"19",cy:"12",r:"1"}),jsx("circle",{cx:"5",cy:"12",r:"1"})]}),jsx("span",{className:"sr-only",children:"More"})]});mp.displayName="BreadcrumbElipssis";function RM({contentId:e="main-content",className:t,children:r="Skip to content"}){return jsx("a",{href:`#${e}`,className:l("sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-[100] focus:px-4 focus:py-2 focus:bg-purple-600 focus:text-white focus:rounded-xl focus:shadow-2xl focus:outline-none focus:ring-2 focus:ring-white/20 transition-all",t),children:r})}var pp=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:l("mx-auto flex w-full justify-center",e),...t});pp.displayName="Pagination";var fp=ve__default.forwardRef(({className:e,...t},r)=>jsx("ul",{ref:r,className:l("flex flex-row items-center gap-1",e),...t}));fp.displayName="PaginationContent";var gp=ve__default.forwardRef(({className:e,...t},r)=>jsx("li",{ref:r,className:l("",e),...t}));gp.displayName="PaginationItem";var xa=({className:e,isActive:t,...r})=>jsx("a",{"aria-current":t?"page":void 0,className:l("inline-flex h-9 w-9 items-center justify-center rounded-2xl text-sm font-medium transition-colors","hover:bg-gray-100 dark:hover:bg-white/[0.03] hover:text-gray-900 dark:hover:text-white",t?"bg-gray-100 text-gray-900 dark:bg-white/[0.06] dark:text-white":"text-gray-500 dark:text-white/60",e),...r});xa.displayName="PaginationLink";var bp=({className:e,...t})=>jsxs(xa,{"aria-label":"Go to previous page",className:l("w-auto gap-1 px-2.5",e),...t,children:[jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:jsx("path",{d:"m15 18-6-6 6-6"})}),jsx("span",{children:"Previous"})]});bp.displayName="PaginationPrevious";var hp=({className:e,...t})=>jsxs(xa,{"aria-label":"Go to next page",className:l("w-auto gap-1 px-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:jsx("path",{d:"m9 18 6-6-6-6"})})]});hp.displayName="PaginationNext";var xp=({className:e,...t})=>jsxs("span",{"aria-hidden":true,className:l("flex h-9 w-9 items-center justify-center",e),...t,children:[jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:[jsx("circle",{cx:"12",cy:"12",r:"1"}),jsx("circle",{cx:"19",cy:"12",r:"1"}),jsx("circle",{cx:"5",cy:"12",r:"1"})]}),jsx("span",{className:"sr-only",children:"More pages"})]});xp.displayName="PaginationEllipsis";var BM=({steps:e,currentStep:t,className:r,onStepClick:o})=>jsx("div",{className:l("flex w-full flex-col gap-4 md:flex-row",r),children:e.map((n,a)=>{let s=t>a,i=t===a,c=!!o;return jsxs("div",{className:l("flex flex-1 flex-col gap-2 md:flex-row md:items-center md:gap-4",c&&"cursor-pointer"),onClick:()=>c&&o(a),children:[jsxs("div",{className:"flex items-center gap-4 md:flex-col md:gap-2",children:[jsxs("div",{className:"flex items-center",children:[jsx("div",{className:l("flex h-8 w-8 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors",s?"border-blue-600 bg-blue-600 text-white dark:border-blue-500 dark:bg-blue-500":i?"border-blue-600 text-blue-600 dark:border-blue-500 dark:text-blue-500":"border-gray-300 text-gray-500 dark:border-white/20 dark:text-white/40"),children:s?jsx(Check,{className:"h-4 w-4"}):a+1}),a<e.length-1&&jsx("div",{className:l("ml-4 h-px flex-1 bg-gray-200 md:hidden dark:bg-white/[0.03]",s&&"bg-blue-600 dark:bg-blue-500")})]}),jsxs("div",{className:"flex flex-col",children:[jsx("span",{className:l("text-sm font-medium",i||s?"text-gray-900 dark:text-white":"text-gray-500 dark:text-white/50"),children:n.title}),n.description&&jsx("span",{className:"text-xs text-gray-500 dark:text-white/40 hidden md:block",children:n.description})]})]}),a<e.length-1&&jsx("div",{className:l("hidden h-px flex-1 bg-gray-200 md:block dark:bg-white/[0.03]",s&&"bg-blue-600 dark:bg-blue-500")})]},a)})});function WM({isOpen:e,onClose:t,onConfirm:r,title:o,description:n,confirmText:a="Confirm",cancelText:s="Cancel",variant:i="primary",isLoading:c=false}){return jsxs(ro,{isOpen:e,onClose:t,children:[jsx(oo,{children:jsxs("div",{className:"flex items-center gap-3",children:[i==="danger"&&jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-rose-500/10 text-rose-500",children:jsx(AlertTriangle,{className:"h-5 w-5"})}),jsx(Ge,{as:"h3",children:o})]})}),jsx("div",{className:"py-2",children:jsx(xe,{className:"text-gray-500 dark:text-white/60",children:n})}),jsxs(ao,{children:[jsx(L,{variant:"ghost",onClick:t,disabled:c,children:s}),jsx(L,{variant:i==="danger"?"danger":"primary",onClick:r,isLoading:c,children:a})]})]})}function QM({isOpen:e,onClose:t,children:r,className:o}){let n=useRef(null),[a,s]=ve__default.useState(false);useEffect(()=>{s(true);},[]),useEffect(()=>{let c=n.current;c&&(e?c.open||c.showModal():c.open&&c.close());},[e,a]),useEffect(()=>{let c=n.current;if(!c)return;let d=m=>{m.preventDefault(),t();};return c.addEventListener("cancel",d),()=>c.removeEventListener("cancel",d)},[t,a]);let i=c=>{c.target===n.current&&t();};return a?createPortal(jsx("dialog",{ref:n,onClick:i,className:l("fixed inset-0 z-[100] bg-transparent p-0 backdrop:bg-black/60 backdrop:backdrop-blur-sm open:grid open:place-items-center","open:animate-in open:fade-in open:duration-200",o),children:jsxs("div",{className:l("relative w-full max-w-lg scale-100 gap-4 border border-gray-200 dark:border-white/10 bg-white dark:bg-[#0A0A0A]/90 p-6 shadow-2xl backdrop-blur-xl transition-all sm:rounded-2xl","animate-in fade-in zoom-in-95 duration-200 slide-in-from-bottom-2"),children:[r,jsxs("button",{onClick:t,className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/20 disabled:pointer-events-none",children:[jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-900 dark:text-white",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),jsx("span",{className:"sr-only",children:"Close"})]})]})}),document.body):null}function JM({className:e,children:t}){return jsx("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left mb-4",e),children:t})}function ZM({className:e,children:t}){return jsx("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-6",e),children:t})}function eR({className:e,children:t}){return jsx(Ge,{as:"h2",className:l("text-lg font-semibold leading-none tracking-tight",e),children:t})}function tR({className:e,children:t}){return jsx("p",{className:l("text-sm text-gray-500 dark:text-gray-400",e),children:t})}function dR({isOpen:e,onClose:t,position:r="right",children:o,className:n}){let[a,s]=useState(false),[i,c]=useState(false),d=useRef(null);useEffect(()=>{if(e)c(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{s(true);});}),document.body.style.overflow="hidden";else {s(false);let g=setTimeout(()=>{c(false),document.body.style.overflow="unset";},300);return ()=>clearTimeout(g)}},[e]),useEffect(()=>{let g=h=>{h.key==="Escape"&&t();};return e&&document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g);}},[e,t]);let m=g=>{g.target===d.current&&t();};if(!i)return null;let u={left:"left-0 h-full w-3/4 max-w-sm border-r",right:"right-0 h-full w-3/4 max-w-sm border-l",bottom:"bottom-0 w-full h-auto max-h-[90vh] border-t rounded-t-2xl"},p={left:a?"translate-x-0":"-translate-x-full",right:a?"translate-x-0":"translate-x-full",bottom:a?"translate-y-0":"translate-y-full"};return createPortal(jsx("div",{ref:d,onClick:m,className:l("fixed inset-0 z-[100] flex bg-black/60 backdrop-blur-sm transition-opacity duration-300",a?"opacity-100":"opacity-0"),role:"dialog","aria-modal":"true",children:jsx("div",{className:l("absolute bg-white dark:bg-[#0A0A0A] border-gray-200 dark:border-white/10 p-6 shadow-2xl transition-transform duration-300 ease-in-out",u[r],p[r],n),children:o})}),document.body)}function mR({className:e,children:t,...r}){return jsx("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left mb-6",e),...r,children:t})}function uR({className:e,children:t,...r}){return jsx("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-auto pt-6",e),...r,children:t})}function pR({className:e,children:t,...r}){return jsx(Ge,{as:"h2",className:l("text-lg font-semibold leading-none tracking-tight",e),...r,children:t})}function fR({className:e,children:t,...r}){return jsx(xe,{variant:"muted",className:l("text-sm",e),...r,children:t})}function kR({content:e,children:t,position:r="top",delay:o=200,className:n}){let[a,s]=useState(false),i=useRef(null),c=useRef(null),d=useRef(null),{position:m,isPositioned:u}=Vt(c,d,{side:r,align:"center",sideOffset:8,isOpen:a}),p=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>s(true),o);},g=()=>{i.current&&clearTimeout(i.current),s(false);};useEffect(()=>()=>{i.current&&clearTimeout(i.current);},[]);let h={top:"slide-in-from-bottom-2",bottom:"slide-in-from-top-2",left:"slide-in-from-right-2",right:"slide-in-from-left-2"};return jsxs("div",{ref:c,className:"relative inline-flex",onMouseEnter:p,onMouseLeave:g,onFocus:p,onBlur:g,children:[t,a&&createPortal(jsx("div",{ref:d,role:"tooltip",style:{top:m.top,left:m.left},className:l("fixed z-[120] min-w-max max-w-xs rounded-2xl border border-gray-200 dark:border-white/10 bg-white dark:bg-[#0A0A0A]/90 px-3 py-1.5 text-xs text-gray-900 dark:text-white shadow-xl backdrop-blur-md","duration-200",u?"animate-in fade-in opacity-100":"opacity-0",h[r],n),children:e}),document.body)]})}var Dp=ve__default.forwardRef(({className:e,size:t="lg",...r},o)=>jsx("div",{ref:o,className:l("mx-auto w-full px-4",{sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl",full:"max-w-full"}[t],e),...r}));Dp.displayName="Container";var Ap=ve__default.forwardRef(({className:e,direction:t="col",gap:r=4,align:o,justify:n,wrap:a,style:s,...i},c)=>jsx("div",{ref:c,className:l("flex",{"flex-row":t==="row","flex-col":t==="col","flex-row-reverse":t==="row-reverse","flex-col-reverse":t==="col-reverse","flex-wrap":a,"items-start":o==="start","items-end":o==="end","items-center":o==="center","items-baseline":o==="baseline","items-stretch":o==="stretch","justify-start":n==="start","justify-end":n==="end","justify-center":n==="center","justify-between":n==="between","justify-around":n==="around","justify-evenly":n==="evenly"},e),style:{gap:typeof r=="number"?`${r*.25}rem`:r,...s},...i}));Ap.displayName="Stack";var Vp=ve__default.forwardRef(({className:e,cols:t=1,sm:r,md:o,lg:n,xl:a,gap:s=4,style:i,...c},d)=>jsx("div",{ref:d,className:l("grid",r&&`sm:grid-cols-${r}`,o&&`md:grid-cols-${o}`,n&&`lg:grid-cols-${n}`,a&&`xl:grid-cols-${a}`,e),style:{gridTemplateColumns:t?`repeat(${t}, minmax(0, 1fr))`:void 0,gap:typeof s=="number"?`${s*.25}rem`:s,...i},...c}));Vp.displayName="Grid";var Kp=ve__default.forwardRef(({variant:e="none",noise:t=false,patternColor:r,size:o=24,mask:n="none",animate:a=false,followMouse:s=false,bgColor:i,className:c,children:d,style:m,...u},p)=>{let g=ve__default.useRef(null);ve__default.useEffect(()=>{if(!s)return;let b=f=>{let x=g.current;if(!x)return;let w=x.getBoundingClientRect(),k=f.clientX-w.left,y=f.clientY-w.top;x.style.setProperty("--mouse-x",`${k}px`),x.style.setProperty("--mouse-y",`${y}px`);};return window.addEventListener("mousemove",b),()=>window.removeEventListener("mousemove",b)},[s]);let h=()=>{let b={},f=r||"var(--pattern-color, rgba(255,255,255,0.08))";return e==="dots"?{...b,backgroundImage:`radial-gradient(${f} 1px, transparent 1px)`,backgroundSize:`${o}px ${o}px`,transform:s?"translate3d(calc((var(--mouse-x, 0) - 24px) / 40), calc((var(--mouse-y, 0) - 24px) / 40), 0)":void 0}:e==="grid"?{...b,backgroundImage:`
67
- linear-gradient(to right, ${f} 1px, transparent 1px),
68
- linear-gradient(to bottom, ${f} 1px, transparent 1px)
69
- `,backgroundSize:`${o}px ${o}px`,transform:s?"translate3d(calc((var(--mouse-x, 0) - 24px) / 40), calc((var(--mouse-y, 0) - 24px) / 40), 0)":void 0}:e==="gradient"?{...b,background:s?`radial-gradient(circle at var(--mouse-x, center) var(--mouse-y, center), ${f}, transparent)`:`radial-gradient(circle at center, ${f}, transparent)`}:e==="beams"?{...b,background:`radial-gradient(60% 40% at 50% 0%, ${f} 0%, transparent 100%)`}:b},v=n==="fade"?{maskImage:"radial-gradient(ellipse at center, black, transparent 90%)",WebkitMaskImage:"radial-gradient(ellipse at center, black, transparent 90%)"}:{};return jsxs("div",{ref:b=>{b&&(g.current=b),typeof p=="function"?p(b):p&&(p.current=b);},className:l("absolute inset-0 overflow-hidden pointer-events-none transition-transform duration-300 ease-out","z-0","[--pattern-color:rgba(0,0,0,0.05)] dark:[--pattern-color:rgba(255,255,255,0.08)]",i?.startsWith("bg-")?i:"",c),style:{...h(),...v,...m,backgroundColor:i&&!i.startsWith("bg-")?i:void 0},...u,children:[t&&jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none brightness-100 contrast-150",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`}}),e==="beams"&&jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[jsx("div",{className:"absolute top-0 left-1/4 w-px h-full bg-gradient-to-b from-transparent via-white/10 to-transparent"}),jsx("div",{className:"absolute top-0 right-1/4 w-px h-full bg-gradient-to-b from-transparent via-white/10 to-transparent"})]}),e==="mesh"&&jsxs("div",{className:l("absolute inset-0 opacity-30 blur-[100px]",a&&"animate-pulse"),children:[jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[50%] h-[50%] rounded-full bg-blue-500/20"}),jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[50%] h-[50%] rounded-full bg-purple-500/20"}),jsx("div",{className:"absolute top-[20%] right-[10%] w-[40%] h-[40%] rounded-full bg-indigo-500/10"})]}),d]})});Kp.displayName="Background";var _R=({children:e,className:t,size:r=300,color:o,fill:n,...a})=>{let s=useRef(null),i=n||o||"rgba(255, 255, 255, 0.1)";return jsxs("div",{ref:s,onMouseMove:u=>{let p=s.current;if(!p)return;let g=p.getBoundingClientRect(),h=u.clientX-g.left,v=u.clientY-g.top;p.style.setProperty("--mouse-x",`${h}px`),p.style.setProperty("--mouse-y",`${v}px`);},onMouseEnter:()=>{s.current?.style.setProperty("--opacity","1");},onMouseLeave:()=>{s.current?.style.setProperty("--opacity","0");},className:l("relative overflow-hidden rounded-2xl border border-gray-200 bg-white dark:border-white/10 dark:bg-black",t),...a,children:[jsx("div",{className:"pointer-events-none absolute -inset-px transition-opacity duration-300",style:{opacity:"var(--opacity, 0)",background:`radial-gradient(${r}px circle at var(--mouse-x, center) var(--mouse-y, center), ${i}, transparent 80%)`}}),e&&jsx("div",{className:"relative h-full",children:e})]})};var ef=cva("relative flex w-full flex-col rounded-2xl border transition-all duration-200 focus-within:ring-4",{variants:{variant:{default:"bg-white border-gray-200 shadow-sm focus-within:border-purple-500/50 focus-within:ring-purple-500/10 dark:bg-white/[0.03] dark:border-white/10 dark:shadow-none",ghost:"bg-transparent border-transparent shadow-none focus-within:bg-white/50 dark:focus-within:bg-white/5"}},defaultVariants:{variant:"default"}}),tf=ve__default.forwardRef(({className:e,variant:t,onSubmit:r,isGenerating:o,onAttach:n,onFilesSelected:a,onStop:s,onMic:i,maxLength:c,footer:d,attachments:m,onRemoveAttachment:u,accept:p,multiple:g,placeholder:h="Ask AI anything...",value:v,onChange:b,...f},x)=>{let[w,k]=useState(""),y=v!==void 0,T=y?v:w,C=useRef(null),N=useRef(null),R=()=>{C.current&&(C.current.style.height="auto",C.current.style.height=`${C.current.scrollHeight}px`);};useEffect(()=>{R();},[T]);let H=M=>{let G=M.target.value;c&&G.length>c||(y||k(G),b?.(M));},E=M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),T.trim()&&!o&&(r?.(T),y||k(""))),f.onKeyDown?.(M);},D=()=>{o&&s?s():T.trim()&&(r?.(T),y||k(""));},I=()=>{a&&N.current?N.current.click():n?.();},P=M=>{M.target.files&&M.target.files.length>0&&a?.(M.target.files),N.current&&(N.current.value="");};return jsxs("div",{className:l(ef({variant:t,className:e})),children:[jsx("input",{type:"file",ref:N,className:"hidden",onChange:P,accept:p,multiple:g}),m&&m.length>0&&jsx("div",{className:"flex flex-wrap gap-2 px-4 pt-4",children:m.map(M=>jsxs("div",{className:"group relative flex items-center gap-2 rounded-xl border border-gray-200 bg-gray-50 px-3 py-1.5 text-sm transition-colors hover:bg-gray-100 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/[0.06]",children:[jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-lg bg-white dark:bg-white/[0.06]",children:jsx(File,{className:"h-3 w-3 text-purple-500"})}),jsx("span",{className:"max-w-[120px] truncate text-gray-700 dark:text-gray-300",children:M.name}),jsx("button",{onClick:()=>u?.(M.id),className:"ml-1 rounded-full p-0.5 text-gray-400 opacity-0 transition-all hover:bg-gray-200 hover:text-gray-600 group-hover:opacity-100 dark:hover:bg-white/[0.06] dark:hover:text-white",type:"button",children:jsx(X$1,{className:"h-3 w-3"})})]},M.id))}),jsx("textarea",{ref:M=>{C.current=M,typeof x=="function"?x(M):x&&(x.current=M);},value:T,onChange:H,onKeyDown:E,placeholder:h,rows:1,className:l("w-full resize-none bg-transparent px-4 py-4 text-base outline-none max-h-[200px]","text-gray-900 placeholder:text-gray-400","dark:text-white dark:placeholder:text-white/40"),disabled:o&&!s,...f}),jsxs("div",{className:"flex items-center justify-between px-2 pb-2",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx(L,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-gray-600 dark:text-white/40 dark:hover:text-white",onClick:I,type:"button",title:"Attach file",children:jsx(Paperclip,{className:"h-5 w-5"})}),i&&jsx(L,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-gray-600 dark:text-white/40 dark:hover:text-white",onClick:i,type:"button",title:"Use microphone",children:jsx(Mic,{className:"h-5 w-5"})})]}),jsxs("div",{className:"flex items-center gap-3",children:[c&&jsxs("span",{className:"text-xs text-gray-400 dark:text-white/30",children:[T.length,"/",c]}),jsx(L,{size:"icon",disabled:!T.trim()&&!o||o&&!s,onClick:D,className:l("h-8 w-8 rounded-full transition-all duration-200",T.trim()||o?"bg-purple-600 text-white hover:bg-purple-500 shadow-lg shadow-purple-500/25":"bg-gray-100 text-gray-400 dark:bg-white/[0.06] dark:text-white/20"),children:o?s?jsx(Square,{className:"h-3 w-3 fill-current"}):jsx(Sparkles,{className:"h-4 w-4 animate-pulse"}):jsx(ArrowUp,{className:"h-4 w-4"})})]})]}),d&&jsx("div",{className:"border-t border-gray-100 px-4 py-2 text-xs text-gray-400 dark:border-white/5 dark:text-white/30",children:d})]})});tf.displayName="AIPromptInput";var pf=cva("group relative overflow-hidden rounded-2xl border transition-all duration-200",{variants:{variant:{default:"bg-gray-50 border-gray-200 dark:bg-white/[0.02] dark:border-white/10",ghost:"bg-transparent border-transparent",outline:"bg-transparent border-gray-200 dark:border-white/10"}},defaultVariants:{variant:"default"}}),ff=ve__default.forwardRef(({className:e,variant:t,children:r,onCopy:o,onRegenerate:n,onFeedback:a,onShare:s,onEdit:i,timestamp:c,sources:d,model:m,usage:u,...p},g)=>jsxs("div",{ref:g,className:l(pf({variant:t,className:e})),...p,children:[jsxs("div",{className:"absolute left-4 top-4 flex items-center gap-3",children:[jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-gradient-to-br from-purple-500 to-blue-500 shadow-lg shadow-purple-500/20",children:jsx(Sparkles,{className:"h-3.5 w-3.5 text-white"})}),c&&jsx("span",{className:"text-xs font-medium text-gray-400 dark:text-white/30",children:c})]}),jsxs("div",{className:"pl-14 pr-4 py-4",children:[jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-gray-700 dark:text-gray-300",children:r}),d&&d.length>0&&jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:d.map((h,v)=>jsxs("a",{href:h.url,target:"_blank",rel:"noopener noreferrer",className:l("flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs transition-colors","border-gray-200 bg-white text-gray-600 hover:bg-gray-50","dark:border-white/10 dark:bg-white/[0.03] dark:text-white/60 dark:hover:bg-white/[0.06]"),children:[jsx("span",{className:"max-w-[150px] truncate",children:h.title}),jsx(ExternalLink,{className:"h-3 w-3 opacity-50"})]},v))})]}),jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 bg-white/50 px-2 py-1.5 backdrop-blur dark:border-white/5 dark:bg-white/[0.02]",children:[jsxs("div",{className:"flex items-center gap-3 px-2 text-[10px] font-medium text-gray-400 dark:text-white/20",children:[m&&jsx("span",{children:m}),u&&jsx("span",{children:u})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsxs(L,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:o,children:[jsx(Copy,{className:"mr-1.5 h-3.5 w-3.5"}),"Copy"]}),s&&jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:s,title:"Share",children:jsx(Share,{className:"h-3.5 w-3.5"})}),i&&jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:i,title:"Edit",children:jsx(Edit,{className:"h-3.5 w-3.5"})}),jsx("div",{className:"mx-1 h-3 w-px bg-gray-200 dark:bg-white/10"}),jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:n,title:"Regenerate",children:jsx(RefreshCw,{className:"h-3.5 w-3.5"})}),jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:()=>a?.("up"),title:"Helpful",children:jsx(ThumbsUp,{className:"h-3.5 w-3.5"})}),jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:()=>a?.("down"),title:"Not helpful",children:jsx(ThumbsDown,{className:"h-3.5 w-3.5"})})]})]})]}));ff.displayName="AIResponse";function d4({children:e,className:t,...r}){return jsx("div",{className:l("flex h-[800px] w-full overflow-hidden rounded-3xl border border-gray-200 dark:border-white/10 bg-white dark:bg-black/40 backdrop-blur-xl shadow-2xl",t),...r,children:e})}function v4({conversations:e,activeId:t,onSelect:r,onNewChat:o,onSearch:n,onArchive:a,onPin:s,onMute:i,onDelete:c,filter:d="all",sortBy:m="recent",hideHeader:u=false,className:p,...g}){let[h,v]=useState(""),b=useMemo(()=>e.filter(x=>(x.user?.name||x.group?.name||"").toLowerCase().includes(h.toLowerCase())),[e,h]),f=x=>{let w=x.target.value;v(w),n?.(w);};return jsxs("div",{className:l("flex flex-col border-r border-gray-200 dark:border-white/10 bg-gray-50/50 dark:bg-white/[0.02]",!p?.includes("w-")&&"w-80",p),...g,children:[!u&&jsxs("div",{className:"p-4 space-y-4",children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Messages"}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",title:"Filter",children:jsx(Filter,{className:"h-4 w-4"})}),jsx("button",{onClick:o,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",title:"New Chat",children:jsx(Plus,{className:"h-5 w-5"})})]})]}),jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),jsx("input",{type:"text",value:h,onChange:f,placeholder:"Search messages...",className:"w-full h-10 pl-9 pr-4 rounded-2xl bg-white dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all placeholder:text-gray-400 dark:text-white"})]})]}),jsx("div",{className:"flex-1 overflow-y-auto [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-white/10 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-white/20 [&::-webkit-scrollbar-track]:bg-transparent",children:jsx("div",{className:"flex flex-col",children:b.map(x=>{let w=x.user?.name||x.group?.name||"Unknown",k=x.user?.avatar||x.group?.avatar,y=x.user?.status==="online",T=t===x.id;return jsx("div",{className:"p-2",children:jsxs("div",{onClick:()=>r?.(x.id),className:l("w-full h-16 flex items-center gap-3 p-3 rounded-2xl transition-all text-left group cursor-pointer",T?"bg-blue-500/10 dark:bg-white/[0.06] shadow-[0_0_15px_rgba(59,130,246,0.1)] dark:shadow-[0_0_15px_rgba(255,255,255,0.05)]":"hover:bg-gray-100 dark:hover:bg-white/[0.03]"),children:[jsxs("div",{className:"relative flex-shrink-0",children:[jsx(B,{src:k,alt:w,fallback:w[0]}),y&&jsx("div",{className:"absolute -bottom-0.5 -right-0.5 w-3.5 h-3.5 bg-green-500 border-2 border-white dark:border-[#0a0a0a] rounded-full"})]}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[jsx("span",{className:l("font-semibold truncate",T?"text-blue-600 dark:text-white":"text-gray-900 dark:text-white/90"),children:w}),x.lastMessage&&jsx("span",{className:"text-[10px] text-gray-400 dark:text-white/30 whitespace-nowrap",children:new Date(x.lastMessage.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsx("p",{className:"text-xs text-gray-500 dark:text-white/40 truncate",children:x.isTyping?jsx("span",{className:"text-blue-500 animate-pulse",children:"typing..."}):x.lastMessage?.content||"No messages yet"}),x.unreadCount>0&&jsx("span",{className:"flex-shrink-0 min-w-[18px] h-[18px] flex items-center justify-center bg-blue-500 text-white text-[10px] font-bold rounded-full px-1",children:x.unreadCount})]})]}),jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:C=>C.stopPropagation(),children:jsxs(tt,{children:[jsx(rt,{className:"p-1 rounded-lg hover:bg-gray-200 dark:hover:bg-white/10 text-gray-400",children:jsx(MoreVertical,{className:"h-4 w-4"})}),jsxs(ot,{align:"end",children:[jsxs(X,{onClick:()=>s?.(x.id),children:[jsx(Pin,{className:"h-4 w-4 mr-2"})," Pin"]}),jsxs(X,{onClick:()=>a?.(x.id),children:[jsx(Archive,{className:"h-4 w-4 mr-2"})," Archive"]}),jsxs(X,{onClick:()=>i?.(x.id),children:[jsx(BellOff,{className:"h-4 w-4 mr-2"})," Mute"]}),jsxs(X,{className:"text-red-500",onClick:()=>c?.(x.id),children:[jsx(Trash2,{className:"h-4 w-4 mr-2"})," Delete"]})]})]})})]})},x.id)})})})]})}function C4({user:e,onBack:t,onInfo:r,onCall:o,onVideoCall:n,onSearch:a,onMute:s,isTyping:i,isMuted:c,actions:d,className:m,...u}){return jsxs("div",{className:l("flex h-16 items-center justify-between border-b border-gray-200 dark:border-white/10 bg-white/80 dark:bg-black/40 backdrop-blur px-4 sticky top-0 z-10",m),...u,children:[jsxs("div",{className:"flex items-center gap-3",children:[t&&jsx("button",{onClick:t,className:"md:hidden p-2 -ml-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06]",children:jsx(ArrowLeft,{className:"h-5 w-5 text-gray-600 dark:text-white/70"})}),jsxs("div",{className:"relative cursor-pointer",onClick:r,children:[jsx(B,{src:e.avatar,alt:e.name,fallback:e.name[0]}),e.status==="online"&&jsx("span",{className:"absolute bottom-0 right-0 h-3 w-3 rounded-full bg-green-500 border-2 border-white dark:border-black"})]}),jsxs("div",{className:"cursor-pointer",onClick:r,children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("h3",{className:"font-semibold text-gray-900 dark:text-white leading-none",children:e.name}),c&&jsx(BellOff,{className:"h-3 w-3 text-gray-400"})]}),jsx("p",{className:l("text-xs mt-1 transition-colors",i?"text-blue-500 font-medium animate-pulse":"text-gray-500 dark:text-white/50"),children:i?"typing...":e.status==="online"?"Online":`Last seen ${e.lastSeen?.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`})]})]}),jsxs("div",{className:"flex items-center gap-1",children:[a&&jsx("button",{onClick:a,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(Search,{className:"h-5 w-5"})}),jsx("button",{onClick:o,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(Phone,{className:"h-5 w-5"})}),jsx("button",{onClick:n,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(Video,{className:"h-5 w-5"})}),d,jsx("button",{onClick:r,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(MoreVertical,{className:"h-5 w-5"})})]})]})}function Fs({src:e,duration:t,isMe:r,className:o,...n}){let[a,s]=useState(false),[i,c]=useState(0),[d,m]=useState(false),u=useRef(null),p=()=>{u.current&&(a?u.current.pause():u.current.play(),s(!a));},g=()=>{u.current&&c(u.current.currentTime);},h=()=>{s(false),c(0);},v=f=>{let x=Math.floor(f/60),w=Math.floor(f%60);return `${x}:${w.toString().padStart(2,"0")}`},b=t?i/t*100:0;return jsxs("div",{className:l("flex items-center gap-3 p-2 rounded-2xl min-w-[200px]",r?"bg-white/10":"bg-gray-100 dark:bg-white/[0.03]",o),...n,children:[jsx("audio",{ref:u,src:e,onTimeUpdate:g,onEnded:h}),jsx("button",{onClick:p,className:l("w-10 h-10 rounded-full flex items-center justify-center transition-all",r?"bg-white text-blue-600":"bg-blue-500 text-white"),children:a?jsx(Pause,{className:"h-5 w-5 fill-current"}):jsx(Play,{className:"h-5 w-5 fill-current ml-0.5"})}),jsxs("div",{className:"flex-1 space-y-1",children:[jsx("div",{className:"h-1.5 w-full bg-gray-300 dark:bg-white/10 rounded-full overflow-hidden",children:jsx("div",{className:l("h-full transition-all duration-100",r?"bg-white":"bg-blue-500"),style:{width:`${b}%`}})}),jsxs("div",{className:"flex justify-between text-[10px] font-medium opacity-60",children:[jsx("span",{children:v(i)}),jsx("span",{children:t?v(t):"--:--"})]})]}),jsx("button",{onClick:()=>m(!d),className:"p-1.5 rounded-full hover:bg-black/5 dark:hover:bg-white/5 opacity-60",children:d?jsx(VolumeX,{className:"h-4 w-4"}):jsx(Volume2,{className:"h-4 w-4"})})]})}function Ws({status:e,className:t,...r}){return e==="sending"?jsx("div",{className:l("w-3 h-3 border border-current border-t-transparent rounded-full animate-spin opacity-50",t),...r}):e==="failed"?jsx("span",{className:l("text-red-500 text-[10px] font-bold",t),...r,children:"!"}):jsxs("div",{className:l("flex items-center",t),...r,children:[e==="sent"&&jsx(Check,{className:"h-3 w-3 opacity-50"}),e==="delivered"&&jsx(CheckCheck,{className:"h-3 w-3 opacity-50"}),e==="read"&&jsx(CheckCheck,{className:"h-3 w-3 text-blue-500"})]})}function Ys({url:e,title:t,description:r,image:o,siteName:n,className:a,...s}){return jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:l("block overflow-hidden rounded-xl border border-gray-200 dark:border-white/10 bg-white dark:bg-white/[0.03] hover:bg-gray-50 dark:hover:bg-white/[0.05] transition-all group",a),...s,children:[o&&jsx("div",{className:"aspect-video w-full overflow-hidden border-b border-gray-200 dark:border-white/10",children:jsx("img",{src:o,alt:t,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"})}),jsxs("div",{className:"p-3 space-y-1",children:[n&&jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-blue-500",children:n}),jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white line-clamp-1",children:t||e}),r&&jsx("p",{className:"text-xs text-gray-500 dark:text-white/50 line-clamp-2",children:r}),jsxs("div",{className:"flex items-center gap-1 text-[10px] text-gray-400 pt-1",children:[jsx(ExternalLink,{className:"h-3 w-3"}),jsx("span",{className:"truncate",children:new URL(e).hostname})]})]})]})}function _s({data:e,isOwn:t,onAction:r}){return jsxs("div",{className:"space-y-2 max-w-sm",children:[(()=>{if(!e.header)return null;switch(e.header.type){case "text":return jsx("h4",{className:"font-bold mb-1 text-sm",children:e.header.text});case "image":return jsx("div",{className:"mb-2 rounded-lg overflow-hidden border border-white/10",children:jsx("img",{src:e.header.attachment?.url,alt:"Header",className:"w-full h-auto object-cover"})});default:return null}})(),jsx("p",{className:"text-sm leading-relaxed",children:e.body}),e.footer&&jsx("p",{className:"text-[10px] opacity-50 italic",children:e.footer}),e.type==="button"&&e.buttons&&jsx("div",{className:"flex flex-col gap-1 mt-3",children:e.buttons.map(n=>jsxs("button",{onClick:()=>r?.(n),className:l("flex items-center justify-center gap-2 p-2.5 rounded-xl text-sm font-medium transition-all","bg-white/10 hover:bg-white/20 border border-white/10 active:scale-[0.98]",t?"text-white":"text-blue-500 dark:text-blue-400"),children:[n.type==="url"&&jsx(ExternalLink,{className:"h-3.5 w-3.5"}),n.type==="call"&&jsx(Phone,{className:"h-3.5 w-3.5"}),n.type==="reply"&&jsx(Reply,{className:"h-3.5 w-3.5"}),n.text]},n.id))}),e.type==="list"&&e.sections&&jsx("div",{className:"mt-3 space-y-3",children:e.sections.map((n,a)=>jsxs("div",{className:"space-y-1",children:[n.title&&jsx("p",{className:"text-[10px] uppercase tracking-wider opacity-40 font-bold px-1",children:n.title}),jsx("div",{className:"flex flex-col gap-1",children:n.rows.map(s=>jsxs("button",{onClick:()=>r?.({id:s.id,text:s.title,type:"reply"}),className:"flex flex-col items-start p-3 rounded-xl bg-white/5 hover:bg-white/10 border border-white/5 transition-colors text-left",children:[jsx("span",{className:"text-sm font-medium",children:s.title}),s.description&&jsx("span",{className:"text-xs opacity-50 line-clamp-1",children:s.description})]},s.id))})]},a))})]})}function Xs({cards:e,isOwn:t,onAction:r}){let o=ve__default.useRef(null),n=a=>{o.current&&o.current.scrollBy({left:a==="left"?-240:240,behavior:"smooth"});};return jsxs("div",{className:"relative group/carousel max-w-[300px] sm:max-w-[400px]",children:[jsx("div",{ref:o,className:"flex gap-3 overflow-x-auto scrollbar-hide snap-x snap-mandatory pb-2",children:e.map((a,s)=>jsxs("div",{className:"flex-shrink-0 w-[240px] snap-start rounded-2xl bg-white/5 dark:bg-white/[0.03] border border-white/10 overflow-hidden flex flex-col",children:[a.header?.attachment&&jsx("div",{className:"aspect-video w-full overflow-hidden",children:jsx("img",{src:a.header.attachment.url,alt:"Card",className:"w-full h-full object-cover"})}),jsxs("div",{className:"p-3 flex-1 flex flex-col",children:[jsx("p",{className:"text-sm leading-relaxed mb-1",children:a.body}),a.footer&&jsx("p",{className:"text-[10px] opacity-50 italic mb-3",children:a.footer}),jsx("div",{className:"mt-auto flex flex-col gap-1",children:a.buttons.map(i=>jsxs("button",{onClick:()=>r?.(i),className:l("flex items-center justify-center gap-2 p-2 rounded-lg text-xs font-medium transition-all","bg-white/10 hover:bg-white/20 border border-white/10",t?"text-white":"text-blue-500 dark:text-blue-400"),children:[i.type==="url"&&jsx(ExternalLink,{className:"h-3 w-3"}),i.type==="call"&&jsx(Phone,{className:"h-3 w-3"}),i.type==="reply"&&jsx(Reply,{className:"h-3 w-3"}),i.text]},i.id))})]})]},s))}),e.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:()=>n("left"),className:"absolute left-[-12px] top-1/2 -translate-y-1/2 p-1.5 rounded-full bg-white dark:bg-gray-800 shadow-lg border border-white/10 opacity-0 group-hover/carousel:opacity-100 transition-opacity z-10",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx("button",{onClick:()=>n("right"),className:"absolute right-[-12px] top-1/2 -translate-y-1/2 p-1.5 rounded-full bg-white dark:bg-gray-800 shadow-lg border border-white/10 opacity-0 group-hover/carousel:opacity-100 transition-opacity z-10",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})}function js({message:e,isOwn:t,showAvatar:r,showStatus:o=true,className:n,onReply:a,onReact:s,onDelete:i,onEdit:c,onForward:d,onCopy:m,onPin:u,onSelect:p,isSelected:g}){let h=()=>!t||!o?null:jsx(Ws,{status:e.status||"sent",className:"ml-1"}),v=()=>{if(e.type==="revoked")return jsxs("p",{className:"text-sm italic opacity-50 flex items-center gap-2",children:[jsx(Trash2,{className:"h-3 w-3"})," This message was deleted"]});switch(e.type){case "audio":return jsx(Fs,{src:e.attachments?.[0]?.url||"",duration:e.attachments?.[0]?.duration,isMe:t});case "location":return jsxs("div",{className:"space-y-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(MapPin,{className:"h-4 w-4"}),jsx("span",{className:"text-sm font-medium",children:e.location?.address||"Shared Location"})]}),jsxs("div",{className:"aspect-video rounded-xl bg-gray-200 dark:bg-white/10 flex items-center justify-center overflow-hidden relative group/map",children:[jsx(MapPin,{className:"h-8 w-8 opacity-20 group-hover/map:scale-110 transition-transform"}),jsx("div",{className:"absolute inset-0 bg-blue-500/5 group-hover/map:bg-blue-500/10 transition-colors"})]})]});case "contact":return jsxs("div",{className:"flex items-center gap-3 p-2 rounded-xl bg-black/5 dark:bg-white/10 border border-white/5",children:[jsx("div",{className:"w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center text-white shadow-lg shadow-blue-500/20",children:jsx(User,{className:"h-5 w-5"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"text-sm font-bold truncate",children:e.contact?.name}),jsx("p",{className:"text-xs opacity-60 truncate",children:e.contact?.phone})]})]});case "file":return jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-black/5 dark:bg-white/10 border border-white/5 hover:bg-black/10 dark:hover:bg-white/20 transition-colors cursor-pointer",children:[jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-500/20 flex items-center justify-center text-blue-500",children:jsx(FileText,{className:"h-6 w-6"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"text-sm font-medium truncate",children:e.attachments?.[0]?.name||"File"}),jsx("p",{className:"text-[10px] opacity-60 uppercase",children:e.attachments?.[0]?.size||"Unknown size"})]})]});case "sticker":return jsx("div",{className:"relative group/sticker",children:jsx("img",{src:e.attachments?.[0]?.url,alt:"Sticker",className:"w-32 h-32 object-contain"})});case "image":return jsxs("div",{className:"space-y-2",children:[jsx("div",{className:"relative rounded-2xl overflow-hidden border border-white/5 group/image",children:jsx(Xo,{src:e.attachments?.[0]?.url||"",alt:e.content||"Image",className:"max-h-[300px] w-auto object-contain bg-black/20"})}),e.content&&jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words px-1",children:e.content})]});case "video":return jsxs("div",{className:"space-y-2",children:[jsx("div",{className:"relative rounded-2xl overflow-hidden border border-white/5 bg-black/20 aspect-video flex items-center justify-center group/video",children:jsx("video",{src:e.attachments?.[0]?.url,controls:true,className:"max-h-[300px] w-full"})}),e.content&&jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words px-1",children:e.content})]});case "interactive":return e.interactive?.type==="carousel"&&e.interactive.cards?jsx(Xs,{cards:e.interactive.cards,isOwn:t}):e.interactive?jsx(_s,{data:e.interactive,isOwn:t}):null;default:let b=/(https?:\/\/[^\s]+)/g,f=e.content.match(b);return jsxs("div",{className:"space-y-2",children:[e.replyTo&&jsxs("div",{className:"mb-2 p-2 rounded-lg bg-black/5 dark:bg-white/5 border-l-4 border-blue-500 text-xs",children:[jsx("p",{className:"font-bold text-blue-500 truncate",children:e.replyTo.senderId===e.senderId?"You":"Other"}),jsx("p",{className:"opacity-60 truncate",children:e.replyTo.content})]}),jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:e.content}),f&&f.map(x=>jsx(Ys,{url:x},x))]})}};return jsxs("div",{className:l("flex w-full mb-4 group/bubble",t?"justify-end":"justify-start",n),children:[!t&&r&&jsx("div",{className:"mr-2 mt-auto",children:jsx(B,{src:e.contact?.avatar,alt:e.contact?.name||"User",className:"w-8 h-8",fallback:(e.contact?.name||e.senderId||"?").charAt(0).toUpperCase()})}),jsxs("div",{className:l("relative max-w-[75%] sm:max-w-[60%] transition-all duration-300",g&&"scale-95 opacity-80"),children:[jsx(Sn,{preset:"spring",children:jsxs("div",{className:l("relative p-3 rounded-2xl shadow-sm backdrop-blur-md border",t?"bg-blue-600/90 dark:bg-blue-500/20 text-white border-blue-500/20 rounded-tr-none":"bg-white/80 dark:bg-white/[0.05] text-gray-900 dark:text-white border-white/10 rounded-tl-none","hover:shadow-lg hover:shadow-blue-500/5 transition-shadow"),children:[!t&&e.remoteJid?.endsWith("@g.us")&&e.contact?.name&&jsx("p",{className:"text-[11px] font-bold text-blue-500 dark:text-blue-400 mb-1 truncate",children:e.contact.name}),v(),jsxs("div",{className:"flex items-center justify-end gap-1 mt-1 opacity-60 text-[10px]",children:[jsx("span",{children:new Date(e.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),h()]}),e.reactions&&Object.keys(e.reactions).length>0&&jsx("div",{className:"absolute -bottom-3 right-2 flex -space-x-1",children:Object.entries(e.reactions).map(([b,f])=>jsx("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-white/10 rounded-full px-1.5 py-0.5 text-xs shadow-sm animate-in zoom-in-50",title:f.join(", "),children:b},b))})]})}),jsxs("div",{className:l("absolute top-0 opacity-0 group-hover/bubble:opacity-100 transition-opacity flex items-center gap-1",t?"right-full mr-2":"left-full ml-2"),children:[jsxs(tt,{children:[jsx(rt,{className:"p-1.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/10 text-gray-400 transition-colors",children:jsx(Smile,{className:"h-4 w-4"})}),jsx(ot,{side:"top",className:"flex gap-1 p-1",children:["\u{1F44D}","\u2764\uFE0F","\u{1F602}","\u{1F62E}","\u{1F622}","\u{1F64F}"].map(b=>jsx("button",{onClick:()=>s?.(b),className:"p-1.5 hover:bg-gray-100 dark:hover:bg-white/10 rounded-lg transition-transform hover:scale-125",children:b},b))})]}),jsxs(tt,{children:[jsx(rt,{className:"p-1.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/10 text-gray-400 transition-colors",children:jsx(MoreHorizontal,{className:"h-4 w-4"})}),jsxs(ot,{align:t?"end":"start",children:[jsxs(X,{onClick:a,children:[jsx(Reply,{className:"h-4 w-4 mr-2"})," Reply"]}),jsxs(X,{onClick:m,children:[jsx(Copy,{className:"h-4 w-4 mr-2"})," Copy"]}),jsxs(X,{onClick:d,children:[jsx(Forward,{className:"h-4 w-4 mr-2"})," Forward"]}),jsxs(X,{onClick:u,children:[jsx(Pin,{className:"h-4 w-4 mr-2"})," Pin"]}),t&&jsxs(Fragment,{children:[jsxs(X,{onClick:c,children:[jsx(Edit2,{className:"h-4 w-4 mr-2"})," Edit"]}),jsxs(X,{className:"text-red-500",onClick:i,children:[jsx(Trash2,{className:"h-4 w-4 mr-2"})," Delete"]})]})]})]})]})]})]})}function yL({messages:e,currentUserId:t,className:r,onReply:o,onReact:n,onDelete:a,onEdit:s,onForward:i,onCopy:c,onPin:d,onSelect:m,onLoadMore:u,hasMore:p,isLoadingMore:g,selectedMessages:h=[],dateFormat:v="MMMM d, yyyy",groupByDate:b=true,...f}){let[x,w]=useState(true),k=useRef(null),y=useRef(null),T=useCallback((N="auto")=>{y.current?.scrollIntoView({behavior:N});},[]);useEffect(()=>{x&&T("smooth");},[e.length,x,T]);let C=N=>{let R=N.currentTarget,H=Math.abs(R.scrollHeight-R.clientHeight-R.scrollTop)<100;w(H),R.scrollTop===0&&p&&!g&&u&&u();};return e.length===0&&!g?jsx("div",{className:l("flex-1 flex items-center justify-center p-8 text-center text-gray-500 dark:text-white/40",r),...f,children:jsxs("div",{className:"max-w-sm space-y-4",children:[jsx("div",{className:"w-24 h-24 bg-blue-500/10 dark:bg-white/[0.03] rounded-full flex items-center justify-center mx-auto mb-6 animate-pulse",children:jsx(MessageSquare,{className:"h-12 w-12 text-blue-500"})}),jsx("h3",{className:"text-xl font-medium text-gray-900 dark:text-white",children:"No messages yet"}),jsx("p",{children:"Start the conversation by sending a message below."})]})}):jsxs("div",{className:l("flex-1 relative overflow-hidden",r),...f,children:[jsx("div",{ref:k,onScroll:C,className:"h-full overflow-y-auto p-4 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-white/10 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-white/20 [&::-webkit-scrollbar-track]:bg-transparent",children:jsxs("div",{className:"flex flex-col gap-4",children:[e.map((N,R)=>{let H=N.senderId===t,E=R>0?e[R-1]:null,D=!H&&(!E||E.senderId!==N.senderId);return jsx(js,{message:N,isOwn:H,showAvatar:D,onReply:()=>o?.(N),onReact:I=>n?.(N,I),onDelete:()=>a?.(N),onEdit:()=>s?.(N),onForward:()=>i?.(N),onCopy:()=>c?.(N),onPin:()=>d?.(N),onSelect:()=>m?.(N),isSelected:h.includes(N.id)},N.id)}),jsx("div",{ref:y})]})}),!x&&jsx("button",{onClick:()=>T("smooth"),className:"absolute bottom-6 right-6 p-3 rounded-full bg-white dark:bg-white/10 backdrop-blur border border-gray-200 dark:border-white/10 shadow-lg text-gray-600 dark:text-white hover:scale-110 transition-all z-10",children:jsx(ArrowDown,{className:"h-5 w-5"})})]})}function DL({onSend:e,onChange:t,onAttach:r,onMic:o,onEmoji:n,onGif:a,onLocation:s,onCancelReply:i,placeholder:c="Type a message...",users:d=[],replyingTo:m,isRecording:u,maxLength:p,disabled:g,className:h,...v}){let[b,f]=useState(""),[x,w]=useState(false),[k,y]=useState(null),[T,C]=useState(0),N=useRef(null),R=useMemo(()=>k===null?[]:d.filter(P=>P.name.toLowerCase().includes(k.toLowerCase())).slice(0,5),[d,k]),H=P=>{if(g)return;let M=P.target.value;if(p&&M.length>p)return;f(M),t?.(M);M[P.target.selectionStart-1];let J=M.slice(0,P.target.selectionStart).match(/@(\w*)$/);J?(y(J[1]||""),C(0)):y(null),N.current&&(N.current.style.height="auto",N.current.style.height=`${Math.min(N.current.scrollHeight,120)}px`);},E=P=>{if(!N.current)return;let M=N.current.selectionStart,G=b.slice(0,M).replace(/@\w*$/,`@${P.name} `),se=b.slice(M);f(G+se),y(null),N.current.focus();},D=P=>{if(!g){if(k!==null&&R.length>0){P.key==="ArrowDown"?(P.preventDefault(),C(M=>(M+1)%R.length)):P.key==="ArrowUp"?(P.preventDefault(),C(M=>(M-1+R.length)%R.length)):P.key==="Enter"||P.key==="Tab"?(P.preventDefault(),E(R[T])):P.key==="Escape"&&y(null);return}P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),I());}},I=()=>{g||!b.trim()&&!u||(e?.(b),f(""),N.current&&(N.current.style.height="auto"));};return jsxs("div",{className:l("p-4 bg-white/80 dark:bg-black/40 backdrop-blur border-t border-gray-200 dark:border-white/10 relative",h),...v,children:[k!==null&&R.length>0&&jsx("div",{className:"absolute bottom-full left-4 mb-2 w-64 bg-white dark:bg-gray-900 border border-gray-200 dark:border-white/10 rounded-2xl shadow-2xl overflow-hidden animate-in slide-in-from-bottom-4",children:R.map((P,M)=>jsxs("button",{onClick:()=>E(P),className:l("w-full flex items-center gap-3 p-3 text-left transition-colors",M===T?"bg-blue-500/10 dark:bg-white/10":"hover:bg-gray-50 dark:hover:bg-white/5"),children:[jsx(B,{src:P.avatar,alt:P.name,className:"w-8 h-8"}),jsxs("div",{children:[jsx("p",{className:"text-sm font-bold dark:text-white",children:P.name}),jsxs("p",{className:"text-xs text-gray-500 dark:text-white/40",children:["@",P.name.toLowerCase().replace(/\s/g,"")]})]})]},P.id))}),m&&jsxs("div",{className:"mb-3 flex items-center justify-between p-3 rounded-2xl bg-blue-500/5 border-l-4 border-blue-500 animate-in slide-in-from-bottom-2",children:[jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"text-xs font-bold text-blue-500",children:"Replying to"}),jsx("p",{className:"text-sm text-gray-600 dark:text-white/60 truncate",children:m.content})]}),jsx("button",{onClick:i,className:"p-1.5 rounded-full hover:bg-gray-200 dark:hover:bg-white/10 text-gray-400",children:jsx(X$1,{className:"h-4 w-4"})})]}),jsxs("div",{className:"flex items-end gap-2",children:[jsxs("div",{className:"flex items-center gap-1 mb-1",children:[jsxs(tt,{children:[jsx(rt,{disabled:g,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50 transition-colors disabled:opacity-50",children:jsx(Paperclip,{className:"h-5 w-5"})}),jsxs(ot,{align:"start",side:"top",children:[jsxs(X,{onClick:r,children:[jsx(Image,{className:"h-4 w-4 mr-2"})," Image & Video"]}),jsxs(X,{onClick:r,children:[jsx(Paperclip,{className:"h-4 w-4 mr-2"})," Document"]}),jsxs(X,{onClick:s,children:[jsx(MapPin,{className:"h-4 w-4 mr-2"})," Location"]}),jsxs(X,{onClick:a,children:[jsx(Gift,{className:"h-4 w-4 mr-2"})," GIF"]})]})]}),jsx("button",{onClick:n,disabled:g,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50 transition-colors disabled:opacity-50",children:jsx(Smile,{className:"h-5 w-5"})})]}),jsx("div",{className:"flex-1 relative",children:u?jsxs("div",{className:"h-10 flex items-center px-4 bg-red-500/10 rounded-2xl border border-red-500/20 animate-pulse",children:[jsx("div",{className:"w-2 h-2 bg-red-500 rounded-full mr-3 animate-ping"}),jsx("span",{className:"text-sm font-medium text-red-500",children:"Recording Audio..."})]}):jsx("textarea",{ref:N,value:b,onChange:H,onKeyDown:D,placeholder:c,disabled:g,rows:1,className:"w-full p-2.5 max-h-[120px] rounded-2xl bg-gray-100 dark:bg-white/[0.03] border border-transparent focus:border-blue-500/50 focus:bg-white dark:focus:bg-white/[0.06] text-sm resize-none transition-all outline-none dark:text-white placeholder:text-gray-400"})}),jsx("div",{className:"flex items-center gap-1 mb-1",children:b.trim()||u?jsx("button",{onClick:I,disabled:g,className:"p-2.5 rounded-full bg-blue-500 text-white hover:bg-blue-600 shadow-lg shadow-blue-500/20 transition-all active:scale-90",children:jsx(Send,{className:"h-5 w-5"})}):jsx("button",{onClick:o,disabled:g,className:"p-2.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50 transition-colors disabled:opacity-50",children:jsx(Mic,{className:"h-5 w-5"})})})]})]})}function UL({user:e,onClose:t,className:r,...o}){return jsxs("div",{className:l("w-80 border-l border-gray-200 dark:border-white/10 bg-white dark:bg-black/20 flex flex-col",r),...o,children:[jsxs("div",{className:"h-16 flex items-center px-4 border-b border-gray-200 dark:border-white/10",children:[jsx("button",{onClick:t,className:"p-2 -ml-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06]",children:jsx(X$1,{className:"h-5 w-5 text-gray-500"})}),jsx("span",{className:"ml-2 font-semibold text-gray-900 dark:text-white",children:"Contact Info"})]}),jsxs(at,{className:"flex-1",children:[jsxs("div",{className:"p-6 flex flex-col items-center text-center",children:[jsx(B,{src:e.avatar,alt:e.name,fallback:e.name[0],className:"h-24 w-24 mb-4 text-2xl"}),jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:e.name}),jsx("p",{className:"text-sm text-gray-500 dark:text-white/50 mt-1",children:e.phone||"+1 (555) 000-0000"}),jsxs("div",{className:"mt-6 w-full",children:[jsx("p",{className:"text-sm text-gray-500 dark:text-white/50 mb-1 text-left",children:"About"}),jsx("p",{className:"text-sm text-gray-900 dark:text-white text-left",children:e.bio||"Hey there! I am using Pixon Chat."})]})]}),jsx(Er,{}),jsxs("div",{className:"p-4 space-y-4",children:[jsx("h3",{className:"text-xs font-semibold text-gray-500 dark:text-white/40 uppercase tracking-wider",children:"Media & Docs"}),jsx("div",{className:"grid grid-cols-3 gap-2",children:[1,2,3,4,5,6].map(n=>jsxs("div",{className:"aspect-square rounded-2xl bg-gray-100 dark:bg-white/[0.03] overflow-hidden relative group cursor-pointer",children:[jsx("div",{className:"absolute inset-0 flex items-center justify-center text-gray-400",children:jsx(Image,{className:"h-6 w-6"})}),jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity"})]},n))})]}),jsx(Er,{}),jsx("div",{className:"p-4 space-y-4",children:jsxs("div",{className:"flex items-center justify-between",children:[jsxs("div",{className:"flex items-center gap-3 text-gray-700 dark:text-white/80",children:[jsx(Bell,{className:"h-5 w-5"}),jsx("span",{className:"text-sm font-medium",children:"Mute Notifications"})]}),jsx(Po,{})]})}),jsx(Er,{}),jsxs("div",{className:"p-4 space-y-2",children:[jsxs("button",{className:"w-full flex items-center gap-3 p-3 rounded-2xl hover:bg-red-50 dark:hover:bg-red-500/10 text-red-600 dark:text-red-400 transition-colors text-sm font-medium",children:[jsx(Ban,{className:"h-5 w-5"}),"Block ",e.name]}),jsxs("button",{className:"w-full flex items-center gap-3 p-3 rounded-2xl hover:bg-red-50 dark:hover:bg-red-500/10 text-red-600 dark:text-red-400 transition-colors text-sm font-medium",children:[jsx(Trash2,{className:"h-5 w-5"}),"Delete Chat"]})]})]})]})}function XL({users:e=[],variant:t="default",className:r,...o}){let n=e.length===0?"Someone is typing":e.length===1?`${e[0]} is typing`:e.length===2?`${e[0]} and ${e[1]} are typing`:`${e[0]} and ${e.length-1} others are typing`;return t==="bubble"?jsx("div",{className:l("flex items-center gap-1 px-3 py-2 rounded-2xl bg-gray-100 dark:bg-white/[0.03] w-fit",r),...o,children:jsxs("div",{className:"flex gap-1",children:[jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 animate-bounce [animation-delay:-0.3s]"}),jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 animate-bounce [animation-delay:-0.15s]"}),jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 animate-bounce"})]})}):jsxs("div",{className:l("flex items-center gap-2 text-xs text-gray-500 dark:text-white/40 italic",r),...o,children:[jsxs("div",{className:"flex gap-0.5",children:[jsx("span",{className:"w-1 h-1 rounded-full bg-current animate-bounce [animation-delay:-0.3s]"}),jsx("span",{className:"w-1 h-1 rounded-full bg-current animate-bounce [animation-delay:-0.15s]"}),jsx("span",{className:"w-1 h-1 rounded-full bg-current animate-bounce"})]}),n]})}function JL({message:e,onCancel:t,className:r,...o}){return jsxs("div",{className:l("flex items-center gap-3 p-2 rounded-xl bg-blue-500/5 border-l-4 border-blue-500 animate-in slide-in-from-bottom-2",r),...o,children:[jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/10 text-blue-500",children:jsx(Reply,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"text-xs font-bold text-blue-500",children:"Replying to"}),jsx("p",{className:"text-sm text-gray-600 dark:text-white/60 truncate",children:e.content})]}),t&&jsx("button",{onClick:t,className:"p-1 rounded-full hover:bg-gray-200 dark:hover:bg-white/10 text-gray-400 transition-colors",children:jsx(X$1,{className:"h-4 w-4"})})]})}function oP({type:e="info",message:t,action:r,onClose:o,className:n,...a}){let s={info:Info,warning:AlertCircle,error:AlertCircle,success:CheckCircle2},i={info:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",warning:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",error:"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20",success:"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20"},c=s[e];return jsxs("div",{className:l("flex items-center gap-3 px-4 py-2 border-b text-sm animate-in slide-in-from-top duration-300",i[e],n),...a,children:[jsx(c,{className:"h-4 w-4 shrink-0"}),jsx("p",{className:"flex-1 font-medium",children:t}),r&&jsx("button",{onClick:r.onClick,className:"text-xs font-bold uppercase tracking-wider hover:underline",children:r.label}),o&&jsx("button",{onClick:o,className:"p-1 rounded-full hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:jsx(X$1,{className:"h-4 w-4"})})]})}function lP({date:e,className:t,...r}){return jsx("div",{className:l("flex justify-center sticky top-0 z-10 py-4",t),...r,children:jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-gray-100/80 dark:bg-white/5 backdrop-blur text-[10px] font-bold uppercase tracking-wider text-gray-500 dark:text-white/40 border border-gray-200 dark:border-white/10 shadow-sm",children:[jsx(Calendar,{className:"h-3 w-3"}),e]})})}function uP({status:e="offline",size:t="md",className:r,...o}){let n={online:"bg-green-500",offline:"bg-gray-400",away:"bg-amber-500",busy:"bg-red-500"},a={sm:"h-2 w-2",md:"h-3 w-3",lg:"h-4 w-4"};return jsx("span",{className:l("rounded-full border-2 border-white dark:border-black shrink-0",n[e],a[t],e==="online"&&"animate-pulse",r),...o})}function bP({content:e,className:t,...r}){return jsx("div",{className:l("flex justify-center py-2",t),...r,children:jsx("div",{className:"px-4 py-1 rounded-lg bg-gray-100/50 dark:bg-white/[0.02] text-[11px] font-medium text-gray-500 dark:text-white/30 border border-gray-200/50 dark:border-white/5",children:e})})}function NP({group:e,onBack:t,onInfo:r,isTyping:o,typingUsers:n=[],className:a,...s}){let i=n.length>0?`${n.join(", ")} ${n.length===1?"is":"are"} typing...`:"typing...";return jsxs("div",{className:l("flex h-16 items-center justify-between border-b border-gray-200 dark:border-white/10 bg-white/80 dark:bg-black/40 backdrop-blur px-4 sticky top-0 z-10",a),...s,children:[jsxs("div",{className:"flex items-center gap-3",children:[t&&jsx("button",{onClick:t,className:"md:hidden p-2 -ml-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06]",children:jsx(ArrowLeft,{className:"h-5 w-5 text-gray-600 dark:text-white/70"})}),jsx("div",{className:"relative cursor-pointer",onClick:r,children:jsxs("div",{className:"flex -space-x-3",children:[e.members.slice(0,2).map((c,d)=>jsx(B,{src:c.avatar,alt:c.name,fallback:c.name[0],className:l("border-2 border-white dark:border-black",d===0?"z-10":"z-0")},c.id)),e.members.length>2&&jsxs("div",{className:"w-10 h-10 rounded-full bg-gray-200 dark:bg-white/10 border-2 border-white dark:border-black flex items-center justify-center text-[10px] font-bold text-gray-600 dark:text-white/60 z-0",children:["+",e.members.length-2]})]})}),jsxs("div",{className:"cursor-pointer min-w-0",onClick:r,children:[jsx("h3",{className:"font-semibold text-gray-900 dark:text-white leading-none truncate",children:e.name}),jsx("p",{className:l("text-xs mt-1 truncate transition-colors",o?"text-blue-500 font-medium animate-pulse":"text-gray-500 dark:text-white/50"),children:o?i:`${e.members.length} members`})]})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(Phone,{className:"h-5 w-5"})}),jsx("button",{className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(Video,{className:"h-5 w-5"})}),jsx("button",{onClick:r,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(MoreVertical,{className:"h-5 w-5"})})]})]})}function PP({users:e,selectedIndex:t,onSelect:r,className:o,...n}){return e.length===0?null:jsx(te,{className:l("w-64 overflow-hidden shadow-xl animate-in fade-in slide-in-from-bottom-2",o),...n,children:jsxs("div",{className:"p-1",children:[jsx("div",{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-wider text-gray-400 border-b border-gray-200 dark:border-white/5 mb-1",children:"Mention someone"}),e.map((a,s)=>jsxs("button",{onClick:()=>r(a),className:l("w-full flex items-center gap-2 p-2 rounded-xl text-left transition-colors",s===t?"bg-blue-500 text-white":"hover:bg-gray-100 dark:hover:bg-white/[0.06]"),children:[jsx(B,{src:a.avatar,alt:a.name,fallback:a.name[0],size:"sm"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"text-sm font-medium truncate",children:a.name}),a.status&&jsx("p",{className:l("text-[10px]",s===t?"text-white/70":"text-gray-500"),children:a.status})]})]},a.id))]})})}var K0=[{name:"Smileys",emojis:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F602}","\u{1F923}","\u{1F60A}","\u{1F607}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60C}","\u{1F60D}","\u{1F970}","\u{1F618}","\u{1F617}","\u{1F619}","\u{1F61A}","\u{1F60B}","\u{1F61B}","\u{1F61D}","\u{1F61C}","\u{1F92A}","\u{1F928}","\u{1F9D0}","\u{1F913}","\u{1F60E}","\u{1F929}","\u{1F973}","\u{1F60F}","\u{1F612}","\u{1F61E}","\u{1F614}","\u{1F61F}","\u{1F615}","\u{1F641}","\u2639\uFE0F","\u{1F623}","\u{1F616}","\u{1F62B}","\u{1F629}","\u{1F97A}","\u{1F622}","\u{1F62D}","\u{1F624}","\u{1F620}","\u{1F621}","\u{1F92C}","\u{1F92F}","\u{1F633}","\u{1F975}","\u{1F976}","\u{1F631}","\u{1F628}","\u{1F630}","\u{1F625}","\u{1F613}","\u{1F917}","\u{1F914}","\u{1F92D}","\u{1F92B}","\u{1F925}","\u{1F636}","\u{1F610}","\u{1F611}","\u{1F62C}","\u{1F644}","\u{1F62F}","\u{1F626}","\u{1F627}","\u{1F62E}","\u{1F632}","\u{1F971}","\u{1F634}","\u{1F924}","\u{1F62A}","\u{1F635}","\u{1F910}","\u{1F974}","\u{1F922}","\u{1F92E}","\u{1F927}","\u{1F637}","\u{1F912}","\u{1F915}"]},{name:"Hearts",emojis:["\u2764\uFE0F","\u{1F9E1}","\u{1F49B}","\u{1F49A}","\u{1F499}","\u{1F49C}","\u{1F5A4}","\u{1F90D}","\u{1F90E}","\u{1F494}","\u2763\uFE0F","\u{1F495}","\u{1F49E}","\u{1F493}","\u{1F497}","\u{1F496}","\u{1F498}","\u{1F49D}","\u{1F49F}"]},{name:"Gestures",emojis:["\u{1F44D}","\u{1F44E}","\u{1F44C}","\u{1F90C}","\u{1F90F}","\u270C\uFE0F","\u{1F91E}","\u{1F91F}","\u{1F918}","\u{1F919}","\u{1F448}","\u{1F449}","\u{1F446}","\u{1F595}","\u{1F447}","\u261D\uFE0F","\u270A","\u{1F44A}","\u{1F91B}","\u{1F91C}","\u{1F44F}","\u{1F64C}","\u{1F450}","\u{1F932}","\u{1F91D}","\u{1F64F}","\u270D\uFE0F","\u{1F485}","\u{1F933}","\u{1F4AA}","\u{1F9BE}","\u{1F9B5}","\u{1F9BF}","\u{1F9B6}","\u{1F463}","\u{1F442}","\u{1F9BB}","\u{1F443}","\u{1F9E0}","\u{1FAC0}","\u{1FAC1}","\u{1F9B7}","\u{1F9B4}","\u{1F440}","\u{1F441}\uFE0F","\u{1F445}","\u{1F444}"]},{name:"Activities",emojis:["\u26BD","\u{1F3C0}","\u{1F3C8}","\u26BE","\u{1F94E}","\u{1F3BE}","\u{1F3D0}","\u{1F3C9}","\u{1F94F}","\u{1F3B1}","\u{1FA80}","\u{1F3D3}","\u{1F3F8}","\u{1F3D2}","\u{1F3D1}","\u{1F94D}","\u{1F3CF}","\u{1FA83}","\u{1F945}","\u26F3","\u{1FA81}","\u{1F3F9}","\u{1F3A3}","\u{1F93F}","\u{1F94A}","\u{1F94B}","\u{1F3BD}","\u{1F6F9}","\u{1F6FC}","\u{1F6F7}","\u26F8\uFE0F","\u{1F3BF}","\u26F7\uFE0F","\u{1F3C2}","\u{1FA82}","\u{1F3CB}\uFE0F","\u{1F93C}","\u{1F938}","\u26F9\uFE0F","\u{1F93A}","\u{1F93E}","\u{1F3CC}\uFE0F","\u{1F3C7}","\u{1F9D8}","\u{1F3C4}","\u{1F3CA}","\u{1F93D}","\u{1F6A3}","\u{1F9D7}","\u{1F6B5}","\u{1F6B4}"]},{name:"Nature",emojis:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\u{1F43B}\u200D\u2744\uFE0F","\u{1F428}","\u{1F42F}","\u{1F981}","\u{1F42E}","\u{1F437}","\u{1F43D}","\u{1F438}","\u{1F435}","\u{1F648}","\u{1F649}","\u{1F64A}","\u{1F412}","\u{1F414}","\u{1F427}","\u{1F426}","\u{1F424}","\u{1F423}","\u{1F425}","\u{1F986}","\u{1F985}","\u{1F989}","\u{1F987}","\u{1F43A}","\u{1F417}","\u{1F434}","\u{1F984}","\u{1F41D}","\u{1FAB1}","\u{1F41B}","\u{1F98B}","\u{1F40C}","\u{1F41E}","\u{1F41C}","\u{1F99F}","\u{1FAB0}","\u{1FAB2}","\u{1FAB3}","\u{1F997}","\u{1F577}\uFE0F","\u{1F578}\uFE0F","\u{1F982}","\u{1F422}","\u{1F40D}","\u{1F98E}","\u{1F996}","\u{1F995}","\u{1F419}","\u{1F991}","\u{1F990}","\u{1F99E}","\u{1F980}","\u{1F421}","\u{1F420}","\u{1F41F}","\u{1F42C}","\u{1F433}","\u{1F40B}","\u{1F988}","\u{1F40A}","\u{1F405}","\u{1F406}","\u{1F993}","\u{1F98D}","\u{1F9A7}","\u{1F9A3}","\u{1F418}","\u{1F99B}","\u{1F98F}","\u{1F42A}","\u{1F42B}","\u{1F992}","\u{1F998}","\u{1F9AC}","\u{1F403}","\u{1F402}","\u{1F404}","\u{1F40E}","\u{1F416}","\u{1F40F}","\u{1F411}","\u{1F410}","\u{1F98C}","\u{1F415}","\u{1F429}","\u{1F9AE}","\u{1F415}\u200D\u{1F9BA}","\u{1F408}","\u{1F408}\u200D\u2B1B","\u{1F413}","\u{1F983}","\u{1F99A}","\u{1F99C}","\u{1F9A2}","\u{1F9A9}","\u{1F54A}\uFE0F","\u{1F407}","\u{1F99D}","\u{1F9A8}","\u{1F9A1}","\u{1F9AB}","\u{1F9A6}","\u{1F9A5}","\u{1F401}","\u{1F400}","\u{1F43F}\uFE0F","\u{1F994}","\u{1F43E}","\u{1F409}","\u{1F432}","\u{1F335}","\u{1F384}","\u{1F332}","\u{1F333}","\u{1F334}","\u{1FAB5}","\u{1F331}","\u{1F33F}","\u2618\uFE0F","\u{1F340}","\u{1F38D}","\u{1FAB4}","\u{1F38B}","\u{1F343}","\u{1F342}","\u{1F341}","\u{1F344}","\u{1F41A}","\u{1FAA8}","\u{1F33E}","\u{1F490}","\u{1F337}","\u{1F339}","\u{1F940}","\u{1F33A}","\u{1F338}","\u{1F33C}","\u{1F33B}","\u{1F31E}","\u{1F31D}","\u{1F31B}","\u{1F31C}","\u{1F31A}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}","\u{1F311}","\u{1F312}","\u{1F313}","\u{1F314}","\u{1F319}","\u{1F30E}","\u{1F30D}","\u{1F30F}","\u{1FA90}","\u{1F4AB}","\u2B50\uFE0F","\u{1F31F}","\u2728","\u26A1\uFE0F","\u2604\uFE0F","\u{1F4A5}","\u{1F525}","\u{1F32A}\uFE0F","\u{1F308}","\u2600\uFE0F","\u{1F324}\uFE0F","\u26C5\uFE0F","\u{1F325}\uFE0F","\u2601\uFE0F","\u{1F326}\uFE0F","\u{1F327}\uFE0F","\u26C8\uFE0F","\u{1F329}\uFE0F","\u{1F328}\uFE0F","\u2744\uFE0F","\u2603\uFE0F","\u26C4\uFE0F","\u{1F32C}\uFE0F","\u{1F4A8}","\u{1F4A7}","\u{1F4A6}","\u2614\uFE0F","\u2602\uFE0F","\u{1F30A}","\u{1F32B}\uFE0F"]}];function OP({onSelect:e,className:t,...r}){let[o,n]=useState(""),a=K0.map(s=>({...s,emojis:s.emojis.filter(i=>o===""||i.includes(o))})).filter(s=>s.emojis.length>0);return jsxs(te,{className:l("w-72 h-96 flex flex-col overflow-hidden shadow-2xl",t),...r,children:[jsx("div",{className:"p-3 border-b border-gray-200 dark:border-white/10",children:jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400"}),jsx("input",{type:"text",value:o,onChange:s=>n(s.target.value),placeholder:"Search emoji...",className:"w-full h-8 pl-8 pr-3 rounded-lg bg-gray-100 dark:bg-white/5 text-xs focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all"})]})}),jsx("div",{className:"flex-1 overflow-y-auto p-2 custom-scrollbar",children:a.map(s=>jsxs("div",{className:"mb-4",children:[jsx("h4",{className:"text-[10px] font-bold uppercase tracking-wider text-gray-400 px-2 mb-2",children:s.name}),jsx("div",{className:"grid grid-cols-8 gap-1",children:s.emojis.map(i=>jsx("button",{onClick:()=>e(i),className:"h-8 w-8 flex items-center justify-center rounded-lg hover:bg-gray-100 dark:hover:bg-white/10 text-lg transition-colors",children:i},i))})]},s.name))})]})}function oi(){let[e,t]=useState(false),[r,o]=useState(0),[n,a]=useState(null),[s,i]=useState(null),c=useRef(null),d=useRef(null),m=useRef([]),u=useCallback(async()=>{try{let v=await navigator.mediaDevices.getUserMedia({audio:!0});c.current=new MediaRecorder(v),m.current=[],c.current.ondataavailable=b=>{b.data.size>0&&m.current.push(b.data);},c.current.onstop=()=>{let b=new Blob(m.current,{type:"audio/webm"}),f=URL.createObjectURL(b);a(b),i(f),v.getTracks().forEach(x=>x.stop());},c.current.start(),t(!0),o(0),d.current=window.setInterval(()=>{o(b=>b+1);},1e3);}catch(v){throw console.error("Failed to start recording",v),v}},[]),p=useCallback(()=>{c.current&&e&&(c.current.stop(),t(false),d.current&&clearInterval(d.current));},[e]),g=useCallback(()=>{c.current&&e&&(c.current.stop(),t(false),d.current&&clearInterval(d.current),a(null),i(null),o(0));},[e]),h=useCallback(()=>{a(null),i(null),o(0);},[]);return {isRecording:e,duration:r,audioBlob:n,audioUrl:s,startRecording:u,stopRecording:p,cancelRecording:g,clearAudio:h}}function jP({onSend:e,onCancel:t,className:r,...o}){let{isRecording:n,duration:a,audioBlob:s,startRecording:i,stopRecording:c,cancelRecording:d}=oi();useEffect(()=>(i(),()=>d()),[i,d]);let m=u=>{let p=Math.floor(u/60),g=u%60;return `${p}:${g.toString().padStart(2,"0")}`};return jsxs("div",{className:l("flex items-center gap-3 p-2 rounded-2xl bg-gray-100 dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 animate-in slide-in-from-bottom-2",r),...o,children:[jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-xl bg-red-500/10 text-red-500",children:[jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),jsx("span",{className:"text-sm font-mono font-bold",children:m(a)})]}),jsx("div",{className:"flex-1 h-8 flex items-center gap-0.5 px-2",children:[...Array(20)].map((u,p)=>jsx("div",{className:"w-1 bg-red-500/40 rounded-full transition-all duration-150",style:{height:n?`${20+Math.random()*80}%`:"20%",animationDelay:`${p*.05}s`}},p))}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{onClick:()=>{d(),t();},className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-white/10 text-gray-500 transition-colors",children:jsx(Trash2,{className:"h-5 w-5"})}),n?jsx(L,{size:"icon",variant:"ghost",onClick:c,className:"rounded-full bg-red-500 text-white hover:bg-red-600",children:jsx(Square,{className:"h-4 w-4 fill-current"})}):jsx(L,{size:"icon",onClick:()=>s&&e(s,a),className:"rounded-full bg-blue-500 text-white hover:bg-blue-600",children:jsx(Send,{className:"h-4 w-4"})})]})]})}function nE({onSearch:e,results:t,onResultClick:r,onClose:o,className:n,...a}){let[s,i]=useState(""),c=d=>{let m=d.target.value;i(m),e(m);};return jsxs("div",{className:l("flex flex-col h-full bg-white dark:bg-gray-900 border-l border-gray-200 dark:border-white/10 animate-in slide-in-from-right duration-300",n),...a,children:[jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-white/10 flex items-center justify-between",children:[jsx("h3",{className:"font-bold text-gray-900 dark:text-white",children:"Search Messages"}),jsx("button",{onClick:o,className:"p-1 rounded-full hover:bg-gray-100 dark:hover:bg-white/10",children:jsx(X$1,{className:"h-5 w-5 text-gray-500"})})]}),jsx("div",{className:"p-4",children:jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),jsx("input",{type:"text",value:s,onChange:c,placeholder:"Search in conversation...",className:"w-full h-10 pl-10 pr-4 rounded-xl bg-gray-100 dark:bg-white/5 border-none text-sm focus:ring-2 focus:ring-blue-500/50 transition-all",autoFocus:true})]})}),jsx("div",{className:"flex-1 overflow-y-auto p-2",children:s&&t.length===0?jsx("div",{className:"p-8 text-center text-gray-500 dark:text-white/30",children:jsxs("p",{className:"text-sm",children:['No messages found for "',s,'"']})}):jsx("div",{className:"space-y-1",children:t.map(d=>jsxs("button",{onClick:()=>r(d),className:"w-full p-3 rounded-xl hover:bg-gray-100 dark:hover:bg-white/5 text-left transition-all group",children:[jsxs("div",{className:"flex justify-between mb-1",children:[jsx("span",{className:"text-[10px] font-bold text-blue-500 uppercase",children:d.timestamp.toLocaleDateString()}),jsx("span",{className:"text-[10px] text-gray-400",children:d.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),jsx("p",{className:"text-sm text-gray-700 dark:text-white/70 line-clamp-2 group-hover:text-gray-900 dark:group-hover:text-white",children:d.content})]},d.id))})})]})}var Ia=class{constructor(){this.state={conversations:new Map,messages:new Map,activeChatId:null,presence:new Map};this.listeners=new Set;this.getState=()=>this.state;this.subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));}emitChange(t){this.state=t;for(let r of this.listeners)r();}setConversations(t){this.emitChange({...this.state,conversations:new Map(t.map(r=>[r.id,r]))});}upsertConversation(t){let r=new Map(this.state.conversations),o=r.get(t.id);r.set(t.id,{...o||{unreadCount:0},...t}),this.emitChange({...this.state,conversations:r});}setMessages(t,r){let o=new Map(this.state.messages);o.set(t,r),this.emitChange({...this.state,messages:o});}addMessage(t,r){let o=this.state.messages.get(t)||[];if(o.some(i=>i.id===r.id))return;let n=new Map(this.state.messages);n.set(t,[...o,r]);let a={...this.state,messages:n},s=this.state.conversations.get(t);if(s){let i=new Map(this.state.conversations);i.set(t,{...s,lastMessage:r,unreadCount:this.state.activeChatId===t?0:(s.unreadCount||0)+1}),a.conversations=i;}this.emitChange(a);}updateMessageStatus(t,r,o){let n=this.state.messages.get(t);if(!n)return;let a=n.findIndex(s=>s.id===r);if(a!==-1){let s=[...n],i=s[a];if(i){s[a]={...i,status:o};let c=new Map(this.state.messages);c.set(t,s),this.emitChange({...this.state,messages:c});}}}updateMessage(t,r,o){let n=this.state.messages.get(t);if(!n)return;let a=n.findIndex(s=>s.id===r);if(a!==-1){let s=[...n];s[a]={...s[a],...o};let i=new Map(this.state.messages);i.set(t,s),this.emitChange({...this.state,messages:i});}}addReaction(t,r,o,n){let a=this.state.messages.get(t);if(!a)return;let s=a.findIndex(i=>i.id===r);if(s!==-1){let i=[...a],c={...i[s]},d={...c.reactions||{}},m=[...d[o]||[]];if(!m.includes(n)){m.push(n),d[o]=m,c.reactions=d,i[s]=c;let u=new Map(this.state.messages);u.set(t,i),this.emitChange({...this.state,messages:u});}}}removeReaction(t,r,o,n){let a=this.state.messages.get(t);if(!a)return;let s=a.findIndex(i=>i.id===r);if(s!==-1){let i=[...a],c={...i[s]},d={...c.reactions||{}};if(d[o]){d[o]=d[o].filter(u=>u!==n),d[o].length===0&&delete d[o],c.reactions=d,i[s]=c;let m=new Map(this.state.messages);m.set(t,i),this.emitChange({...this.state,messages:m});}}}deleteMessage(t,r){let o=this.state.messages.get(t);if(!o)return;let n=o.findIndex(a=>a.id===r);if(n!==-1){let a=[...o];a[n]={...a[n],type:"revoked",content:"Esta mensagem foi apagada",attachments:[],reactions:{}};let s=new Map(this.state.messages);s.set(t,a),this.emitChange({...this.state,messages:s});}}setActiveChat(t){let r={...this.state,activeChatId:t};if(t){let o=this.state.conversations.get(t);if(o&&o.unreadCount>0){let n=new Map(this.state.conversations);n.set(t,{...o,unreadCount:0}),r.conversations=n;}}this.emitChange(r);}setUserPresence(t,r){let o=new Map(this.state.presence);o.set(t,r),this.emitChange({...this.state,presence:o});}},qe=new Ia;function yo(e){let t=useSyncExternalStore(qe.subscribe,qe.getState);return useMemo(()=>e(t),[t,e])}var j0=e=>Array.from(e.conversations.values()).sort((t,r)=>{if(t.isPinned&&!r.isPinned)return -1;if(!t.isPinned&&r.isPinned)return 1;let o=t.lastMessage?.timestamp.getTime()||0;return (r.lastMessage?.timestamp.getTime()||0)-o});function cE(){return yo(j0)}function dE(e){let t=useCallback(r=>e?r.messages.get(e)||[]:[],[e]);return yo(t)}function mE(){let e=useCallback(t=>t.activeChatId?t.conversations.get(t.activeChatId):null,[]);return yo(e)}function uE(e){let t=useCallback(r=>r.presence.get(e)||"unavailable",[e]);return yo(t)}function Ba({url:e,token:t,rooms:r=[],onConnect:o,onDisconnect:n,onError:a}){let s=useRef(null);useEffect(()=>{let d=io(e,{auth:{token:t},transports:["websocket"],reconnectionAttempts:5,reconnectionDelay:1e3});return s.current=d,d.on("connect",()=>{console.log("Socket connected:",d.id),r.forEach(m=>d.emit("join",m)),o?.();}),d.on("disconnect",m=>{console.log("Socket disconnected:",m),n?.();}),d.on("connect_error",m=>{console.error("Socket connection error:",m),a?.(m);}),()=>{d.disconnect();}},[e,t,r,o,n,a]);let i=useCallback((d,m)=>{s.current?.connected?s.current.emit(d,m):console.warn("Socket not connected. Event buffered or dropped:",d);},[]),c=useCallback((d,m)=>(s.current?.on(d,m),()=>{s.current?.off(d,m);}),[]);return {socket:s.current,emit:i,on:c,isConnected:s.current?.connected||false}}function yE(e,t){let{on:r,emit:o,isConnected:n}=Ba({url:e,token:t});return useEffect(()=>{r("chats.set",a=>{qe.setConversations(a);}),r("chats.upsert",a=>{a.forEach(s=>qe.upsertConversation(s));}),r("chats.update",a=>{a.forEach(s=>{s.id&&qe.upsertConversation(s);});}),r("messages.upsert",({chatId:a,messages:s})=>{s.forEach(i=>qe.addMessage(a,i));}),r("messages.update",({chatId:a,messageId:s,status:i})=>{qe.updateMessageStatus(a,s,i);}),r("presence.update",({userId:a,status:s})=>{qe.setUserPresence(a,s);}),r("groups.update",a=>{a.forEach(s=>{qe.upsertConversation({id:s.id,group:s});});});},[r]),{isConnected:n,emit:o}}function kE(e,t){let{emit:r}=Ba({url:""});return {setPresence:n=>{r("presence.send",{chatId:e,userId:t,status:n});}}}function NE(){return {uploadMedia:async(t,r)=>({url:"...",thumbnail:"...",blurhash:"..."})}}function TE(e){return {search:r=>r?e.filter(o=>o.content.toLowerCase().includes(r.toLowerCase())):e}}function RE({itemCount:e,itemHeight:t,overscan:r=5,initialScrollTop:o=0,startAtBottom:n=false}){let[a,s]=useState(o),[i,c]=useState(0),d=useRef(null),m=useRef(false),u=useCallback(f=>typeof t=="function"?t(f):t,[t]);useLayoutEffect(()=>{if(d.current){let f=new ResizeObserver(x=>{for(let w of x)c(w.contentRect.height);});return f.observe(d.current),o>0&&(d.current.scrollTop=o),()=>f.disconnect()}},[o]);let p=useCallback(f=>{s(f.currentTarget.scrollTop);},[]),{visibleItems:g,totalHeight:h,startIndex:v}=useMemo(()=>{let f=0,x=[];for(let N=0;N<e;N++)x.push(f),f+=u(N);let w=0,y=0,T=e-1;for(;y<=T;){let N=Math.floor((y+T)/2),R=x[N];R!==void 0&&R<=a?(w=N,y=N+1):T=N-1;}w=Math.max(0,w-r);let C=[];for(let N=w;N<e;N++){let R=x[N];if(R===void 0||R>a+i+r*u(N))break;C.push({index:N,offsetTop:R,height:u(N)});}return {visibleItems:C,totalHeight:f,startIndex:w}},[a,i,e,u,r]);useLayoutEffect(()=>{if(n&&!m.current&&h>0&&d.current&&i>0){let f=d.current,x=h-i;x>0&&(f.scrollTop=x,s(x)),m.current=true;}},[h,i,n]);let b=useCallback((f,x="auto")=>{if(d.current){let w=0;for(let k=0;k<f;k++)w+=u(k);d.current.scrollTo({top:w,behavior:x});}},[u]);return {containerRef:d,visibleItems:g,totalHeight:h,startIndex:v,onScroll:p,scrollToIndex:b,scrollToBottom:(f="auto")=>{d.current&&d.current.scrollTo({top:d.current.scrollHeight,behavior:f});}}}function li(){let[e,t]=useState({scrollX:0,scrollY:0,scrollProgressX:0,scrollProgressY:0}),r=useRef(false),o=useCallback(()=>{r.current||(window.requestAnimationFrame(()=>{let n=window.scrollX,a=window.scrollY,s=document.documentElement.scrollWidth-document.documentElement.clientWidth,i=document.documentElement.scrollHeight-document.documentElement.clientHeight;t({scrollX:n,scrollY:a,scrollProgressX:s>0?n/s:0,scrollProgressY:i>0?a/i:0}),r.current=false;}),r.current=true);},[]);return useEffect(()=>(window.addEventListener("scroll",o,{passive:true}),o(),()=>window.removeEventListener("scroll",o)),[o]),e}function HE({className:e,color:t="bg-blue-500",height:r=2,position:o="top",...n}){let{scrollProgressY:a}=li();return jsx("div",{className:l("fixed left-0 right-0 z-[100] w-full pointer-events-none",o==="top"?"top-0":"bottom-0",e),style:{height:r},...n,children:jsx("div",{className:l("h-full transition-all duration-75 ease-out",t),style:{width:`${a*100}%`,boxShadow:a>0?`0 0 10px ${t.replace("bg-","var(--")}`:"none"}})})}var ig=ve__default.forwardRef(({orientation:e="horizontal",className:t,...r},o)=>jsx("hr",{ref:o,className:l("border-0 bg-gray-200 dark:bg-white/10",{"h-px w-full":e==="horizontal","h-full w-px":e==="vertical"},t),...r}));ig.displayName="Divider";var dg=ve__default.forwardRef(({children:e,className:t,...r},o)=>jsx("kbd",{ref:o,className:l("rounded-lg border border-gray-200 dark:border-white/10 bg-gray-100 dark:bg-white/[0.03] px-2 py-1 text-[11px] font-semibold text-gray-500 dark:text-white/65",t),...r,children:e}));dg.displayName="Kbd";var gg={theme:"system",setTheme:()=>null},mi=createContext(gg);function _E({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...o}){let[n,a]=useState(t);useEffect(()=>{let i=localStorage.getItem(r);i&&a(i);},[r]),useEffect(()=>{let i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){let c=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{i.classList.remove("light","dark"),i.classList.add(c.matches?"dark":"light");};return d(),c.addEventListener("change",d),()=>c.removeEventListener("change",d)}i.classList.add(n);},[n]);let s={theme:n,setTheme:i=>{localStorage.setItem(r,i),a(i);}};return jsx(mi.Provider,{...o,value:s,children:e})}var ui=()=>{let e=useContext(mi);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function ZE({className:e}){let{setTheme:t,theme:r}=ui();return jsxs(L,{variant:"ghost",size:"icon",className:l("h-9 w-9",e),onClick:()=>t(r==="light"?"dark":"light"),children:[jsx(Sun,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),jsx(Moon,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function kg(e,t=true){let[r,o]=useState({data:null,error:null,isLoading:false}),n=useCallback(async()=>{o({data:null,error:null,isLoading:true});try{let a=await e();return o({data:a,error:null,isLoading:!1}),a}catch(a){throw o({data:null,error:a,isLoading:false}),a}},[e]);return useEffect(()=>{t&&n();},[n,t]),{...r,execute:n}}function oS(e,t){let r=useCallback(()=>fetch(e,t).then(o=>o.json()),[e,t]);return kg(r)}function sS({initialMessages:e=[],onSendMessage:t,scrollThreshold:r=100}={}){let[o,n]=useState(e),[a,s]=useState(false),[i,c]=useState(false),d=useRef(null),m=useRef(true),u=useCallback((v="smooth")=>{d.current&&d.current.scrollTo({top:d.current.scrollHeight,behavior:v});},[]),p=useCallback(()=>{if(d.current){let{scrollTop:v,scrollHeight:b,clientHeight:f}=d.current;m.current=b-v-f<r;}},[r]);useEffect(()=>{m.current&&u();},[o,u]);let g=useCallback(async(v,b)=>{if(!v.trim())return;let f=crypto.randomUUID(),x={id:f,content:v,senderId:b,timestamp:new Date,status:"sending"};n(w=>[...w,x]);try{t&&await t(v),n(w=>w.map(k=>k.id===f?{...k,status:"sent"}:k));}catch{n(k=>k.map(y=>y.id===f?{...y,status:"error"}:y));}},[t]),h=useCallback(()=>{n([]);},[]);return {messages:o,setMessages:n,sendMessage:g,clearMessages:h,isTyping:a,setIsTyping:s,isLoading:i,setIsLoading:c,scrollRef:d,handleScroll:p,scrollToBottom:u}}function dS(e=[]){let[t,r]=useState(e),o=useCallback(d=>{r(m=>[...m,d]);},[]),n=useCallback((d,m)=>{r(u=>u.map(p=>p.id===d?{...p,status:m}:p));},[]),a=useCallback(d=>{r(m=>m.filter(u=>u.id!==d));},[]),s=useCallback((d,m)=>{r(u=>u.map(p=>p.id===d?{...p,content:m,isEdited:true}:p));},[]),i=useCallback((d,m,u)=>{r(p=>p.map(g=>{if(g.id!==d)return g;let h={...g.reactions||{}},v=h[m]||[];return v.includes(u)?(h[m]=v.filter(b=>b!==u),h[m].length===0&&delete h[m]):h[m]=[...v,u],{...g,reactions:h}}));},[]),c=useCallback(()=>{r([]);},[]);return {messages:t,setMessages:r,addMessage:o,updateMessageStatus:n,deleteMessage:a,editMessage:s,addReaction:i,clearMessages:c}}function pS(e){let[t,r]=useState(""),o=useMemo(()=>{if(!t.trim())return [];let n=t.toLowerCase();return e.filter(a=>a.content.toLowerCase().includes(n))},[e,t]);return {query:t,setQuery:r,results:o}}function bS(e){let t=useRef(null);return useEffect(()=>{let r=o=>{let n=t.current;!n||n.contains(o?.target||null)||e(o);};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r);}},[e]),t}function vS({timeout:e=2e3}={}){let[t,r]=useState(false),[o,n]=useState(null);return {copy:useCallback(async s=>{if(!navigator?.clipboard){n(new Error("Clipboard API not supported"));return}try{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),e);}catch(i){n(i instanceof Error?i:new Error("Failed to copy"));}},[e]),copied:t,error:o}}function kS(e,t){let[r,o]=useState(e);return useEffect(()=>{let n=setTimeout(()=>{o(e);},t);return ()=>{clearTimeout(n);}},[e,t]),r}function CS(e){let[t,r]=useState(false),[o,n]=useState({x:0,y:0}),a=useRef({x:0,y:0}),s=useRef({x:0,y:0}),i=useRef(Date.now()),c=useRef({x:0,y:0}),d=useCallback((p,g)=>{r(true),a.current={x:p-o.x,y:g-o.y},s.current={x:p,y:g},i.current=Date.now();},[o]),m=useCallback((p,g)=>{if(!t)return;let h=p-a.current.x,v=g-a.current.y,b=Date.now(),f=b-i.current;f>0&&(c.current={x:(p-s.current.x)/f,y:(g-s.current.y)/f}),n({x:h,y:v}),s.current={x:p,y:g},i.current=b,e?.({isDragging:true,offset:{x:h,y:v},velocity:c.current});},[t,e]),u=useCallback(()=>{r(false),e?.({isDragging:false,offset:o,velocity:c.current});},[o,e]);return useEffect(()=>{let p=b=>m(b.clientX,b.clientY),g=b=>{b.touches[0]&&m(b.touches[0].clientX,b.touches[0].clientY);},h=()=>u(),v=()=>u();return t&&(window.addEventListener("mousemove",p),window.addEventListener("mouseup",h),window.addEventListener("touchmove",g),window.addEventListener("touchend",v)),()=>{window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",h),window.removeEventListener("touchmove",g),window.removeEventListener("touchend",v);}},[t,m,u]),{isDragging:t,offset:o,dragProps:{onMouseDown:p=>d(p.clientX,p.clientY),onTouchStart:p=>{p.touches[0]&&d(p.touches[0].clientX,p.touches[0].clientY);},style:{cursor:t?"grabbing":"grab",touchAction:"none"}}}}function LS(e){let[t,r]=useState({progress:0,scrollY:0,isIntersecting:false}),o=useRef(false);return useEffect(()=>{let n=e.current;if(!n)return;let a=()=>{o.current||(window.requestAnimationFrame(()=>{let s=n.getBoundingClientRect(),i=window.innerHeight,c=i+s.height,d=i-s.top,m=Math.max(0,Math.min(1,d/c));r({progress:m,scrollY:window.scrollY,isIntersecting:s.top<i&&s.bottom>0}),o.current=false;}),o.current=true);};return window.addEventListener("scroll",a,{passive:true}),window.addEventListener("resize",a),a(),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a);}},[e]),t}function SS(e,t){let r=useRef(null);return useLayoutEffect(()=>{let o=document.querySelector(`[data-flip-id="${e}"]`);if(!o)return;let n=r.current,a=o.getBoundingClientRect();if(n){let s=n.left-a.left,i=n.top-a.top,c=n.width/a.width,d=n.height/a.height;(Math.abs(s)>.5||Math.abs(i)>.5||Math.abs(c-1)>.01||Math.abs(d-1)>.01)&&o.animate([{transformOrigin:"top left",transform:`translate(${s}px, ${i}px) scale(${c}, ${d})`},{transformOrigin:"top left",transform:"none"}],{duration:400,easing:"cubic-bezier(0.2, 0.8, 0.2, 1)"});}r.current=a;},t),{"data-flip-id":e}}function IS({initialValues:e,onSubmit:t}){let[r,o]=useState(e),[n,a]=useState({}),[s,i]=useState(false),c=useCallback(u=>{let{name:p,value:g,type:h}=u.target,v=h==="checkbox"?u.target.checked:g;o(b=>({...b,[p]:v})),n[p]&&a(b=>({...b,[p]:""}));},[n]),d=useCallback(async u=>{u.preventDefault();let p=u.currentTarget;if(!p.checkValidity()){let g={};Array.from(p.elements).forEach(h=>{let v=h;v.name&&!v.validity.valid&&(g[v.name]=v.validationMessage);}),a(g);return}i(true);try{await t(r);}finally{i(false);}},[r,t]),m=useCallback(u=>({name:u,value:r[u],onChange:c,error:n[u]}),[r,n,c]);return {values:r,errors:n,isSubmitting:s,handleChange:c,handleSubmit:d,register:m,setValues:o,setErrors:a}}function VS(e){let[t,r]=useState({past:[],present:e,future:[]}),o=t.past.length>0,n=t.future.length>0,a=useCallback(()=>{o&&r(d=>{let m=d.past[d.past.length-1];return m===void 0?d:{past:d.past.slice(0,d.past.length-1),present:m,future:[d.present,...d.future]}});},[o]),s=useCallback(()=>{n&&r(d=>{let m=d.future[0];if(m===void 0)return d;let u=d.future.slice(1);return {past:[...d.past,d.present],present:m,future:u}});},[n]),i=useCallback(d=>{r(m=>{let u=typeof d=="function"?d(m.present):d;return m.present===u?m:{past:[...m.past,m.present],present:u,future:[]}});},[]),c=useCallback(()=>{r({past:[],present:e,future:[]});},[e]);return {state:t.present,set:i,undo:a,redo:s,clear:c,canUndo:o,canRedo:n,history:t}}function $S(e=3e3){let[t,r]=useState(false),o=useRef();return useEffect(()=>{let n=()=>{r(false),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(true);},e);},a=["mousemove","mousedown","keydown","touchstart","scroll"];return a.forEach(s=>{window.addEventListener(s,n);}),n(),()=>{a.forEach(s=>{window.removeEventListener(s,n);}),o.current&&clearTimeout(o.current);}},[e]),t}function WS({onLoadMore:e,isLoading:t,hasMore:r,threshold:o=100,root:n=null}){let a=useRef(null),s=useRef(null),i=useCallback(c=>{let d=c[0];d&&d.isIntersecting&&r&&!t&&e();},[r,t,e]);return useEffect(()=>{let c=s.current;if(c)return a.current=new IntersectionObserver(i,{root:n,rootMargin:`0px 0px ${o}px 0px`,threshold:.1}),a.current.observe(c),()=>{a.current&&a.current.disconnect();}},[i,n,o]),s}function qS(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:n=false}={}){let[a,s]=useState(),i=a?.isIntersecting&&n,c=([d])=>{s(d);};return useEffect(()=>{let d=e?.current;if(!!!window.IntersectionObserver||i||!d)return;let u={threshold:t,root:r,rootMargin:o},p=new IntersectionObserver(c,u);return p.observe(d),()=>p.disconnect()},[e,t,r,o,i]),a}function QS(e){let[t,r]=useState(e),o=useCallback((i,c,d,m)=>{r(u=>{let p=u.columns[c],g=u.columns[d],h=u.tasks[i];if(!p||!g||!h)return u;let v=Array.from(p.taskIds);v.splice(v.indexOf(i),1);let b={...p,taskIds:v},f=c===d?v:Array.from(g.taskIds);f.splice(m,0,i);let x={...g,taskIds:f};return {...u,columns:{...u.columns,[c]:b,[d]:x},tasks:{...u.tasks,[i]:{...h,columnId:d}}}});},[]),n=useCallback((i,c)=>{r(d=>{let m=Array.from(d.columnOrder);return m.splice(m.indexOf(i),1),m.splice(c,0,i),{...d,columnOrder:m}});},[]),a=useCallback((i,c)=>{r(d=>{let m=d.columns[i];if(!m)return d;let u={...m,taskIds:[...m.taskIds,c.id]};return {...d,tasks:{...d.tasks,[c.id]:c},columns:{...d.columns,[i]:u}}});},[]),s=useCallback(i=>{r(c=>{let d=c.tasks[i];if(!d)return c;let m=c.columns[d.columnId];if(!m)return c;let u={...c.tasks};delete u[i];let p={...m,taskIds:m.taskIds.filter(g=>g!==i)};return {...c,tasks:u,columns:{...c.columns,[d.columnId]:p}}});},[]);return {board:t,setBoard:r,moveTask:o,moveColumn:n,addTask:a,removeTask:s}}function eD(e){let t=useRef(e);t.current=e,useEffect(()=>{let r=o=>{let n=[];(o.ctrlKey||o.metaKey)&&n.push("mod"),o.shiftKey&&n.push("shift"),o.altKey&&n.push("alt");let s=o.key.toLowerCase();["control","meta","shift","alt"].includes(s)||n.push(s);let i=n.join("+"),c=t.current[i]||t.current[s];c&&c(o);};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]);}function oD(e){let t=useRef(false);useEffect(()=>{t.current||(t.current=true,e());},[]);}function aD(e){useEffect(()=>()=>{e();},[]);}function lD(e,t){let[r,o]=useState(()=>{if(typeof window>"u")return t;try{let a=window.localStorage.getItem(e);return a?JSON.parse(a):t}catch(a){return console.warn(`Error reading localStorage key "${e}":`,a),t}}),n=useCallback(a=>{try{let s=a instanceof Function?a(r):a;o(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s));}catch(s){console.warn(`Error setting localStorage key "${e}":`,s);}},[e,r]);return [r,n]}function mD(e){let[t,r]=useState({x:0,y:0,elementX:0,elementY:0,percentageX:0,percentageY:0}),o=useRef(),n=useRef({x:0,y:0});return useEffect(()=>{let a=i=>{n.current={x:i.clientX,y:i.clientY},o.current||(o.current=requestAnimationFrame(s));},s=()=>{let{x:i,y:c}=n.current,d=0,m=0,u=0,p=0;if(e?.current){let g=e.current.getBoundingClientRect();d=i-g.left,m=c-g.top,u=Math.max(0,Math.min(100,d/g.width*100)),p=Math.max(0,Math.min(100,m/g.height*100));}r({x:i,y:c,elementX:d,elementY:m,percentageX:u,percentageY:p}),o.current=void 0;};return window.addEventListener("mousemove",a),()=>{window.removeEventListener("mousemove",a),o.current&&cancelAnimationFrame(o.current);}},[e]),t}function fD(){let[e,t]=useState({alpha:null,beta:null,gamma:null,absolute:false});return useEffect(()=>{let r=o=>{t({alpha:o.alpha,beta:o.beta,gamma:o.gamma,absolute:o.absolute});};return typeof window<"u"&&"DeviceOrientationEvent"in window&&window.addEventListener("deviceorientation",r),()=>{window.removeEventListener("deviceorientation",r);}},[]),e}function hD(e){let t=useRef();return useEffect(()=>{t.current=e;},[e]),t.current}function wD(e){let t=useRef(null),r=useCallback((o,n,a)=>{!o||a||!t.current||(o.dataset.messageId=n,t.current.observe(o));},[]);return useEffect(()=>(t.current=new IntersectionObserver(o=>{o.forEach(n=>{if(n.isIntersecting){let a=n.target.dataset.messageId;a&&(e(a),t.current?.unobserve(n.target));}});},{threshold:.5}),()=>{t.current?.disconnect();}),[e]),{registerMessage:r}}function ND(){let[e,t]=useState(false);return useEffect(()=>{let r=window.matchMedia("(prefers-reduced-motion: reduce)");t(r.matches);let o=n=>{t(n.matches);};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),e}var mb={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function ub(e){let[t,r]=useState(false);return useEffect(()=>{let o=window.matchMedia(e);r(o.matches);let n=()=>r(o.matches);return o.addEventListener("change",n),()=>o.removeEventListener("change",n)},[e]),t}function MD(e){return ub(`(min-width: ${mb[e]}px)`)}function RD(e){let[t,r]=useState({width:0,height:0});return useLayoutEffect(()=>{if(!e.current)return;let o=new ResizeObserver(n=>{for(let a of n)r({width:a.contentRect.width,height:a.contentRect.height});});return o.observe(e.current),()=>o.disconnect()},[e]),t}function ED(e=10){let[t,r]=useState(null),o=useRef(0);return useEffect(()=>{let n=()=>{let s=window.scrollY;if(Math.abs(s-o.current)<e)return;let i=s>o.current?"down":"up";i!==t&&(s>0||i==="down")&&r(i),o.current=s>0?s:0;},a=()=>{window.requestAnimationFrame(n);};return window.addEventListener("scroll",a),()=>window.removeEventListener("scroll",a)},[t,e]),t}function HD(e=true){useLayoutEffect(()=>{if(!e)return;let t=window.getComputedStyle(document.body).overflow,r=window.getComputedStyle(document.body).paddingRight,o=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",o>0&&(document.body.style.paddingRight=`${parseFloat(r)+o}px`),()=>{document.body.style.overflow=t,document.body.style.paddingRight=r;}},[e]);}function hb(e,t,r){let[o,n]=t,[a,s]=r,i=(e-o)/(n-o),c=Math.max(0,Math.min(1,i));return a+c*(s-a)}function AD(e,t,r){return hb(e,t,r)}function VD(){let[e,t]=useState(0),r=useRef(0),o=useRef(Date.now()),n=useRef();return useEffect(()=>{let a=()=>{let i=window.scrollY,c=Date.now(),d=c-o.current;if(d>0){let u=(i-r.current)/d;t(u);}r.current=i,o.current=c,n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(s);},s=()=>{t(i=>Math.abs(i)<.01?0:i*.9),n.current=requestAnimationFrame(s);};return window.addEventListener("scroll",a,{passive:true}),()=>{window.removeEventListener("scroll",a),n.current&&cancelAnimationFrame(n.current);}},[]),e}function yb(e,t){let r=e.toLowerCase().replace(/\s/g,""),o=t.toLowerCase(),n=0;for(let a=0;a<o.length&&n<r.length;a++)o[a]===r[n]&&n++;return n===r.length}function $D(e,t,r){return useMemo(()=>t.trim()?e.filter(o=>r.some(n=>{let a=o[n];return a==null?false:yb(t,String(a))})):e,[e,t,r])}function WD(e,t){let r=useCallback(()=>{if(typeof window>"u")return t;try{let s=window.sessionStorage.getItem(e);return s?JSON.parse(s):t}catch(s){return console.warn(`Error reading sessionStorage key "${e}":`,s),t}},[t,e]),[o,n]=useState(r),a=useCallback(s=>{try{let i=s instanceof Function?s(o):s;n(i),typeof window<"u"&&window.sessionStorage.setItem(e,JSON.stringify(i));}catch(i){console.warn(`Error setting sessionStorage key "${e}":`,i);}},[e,o]);return useEffect(()=>{n(r());},[r]),[o,a]}function XD(e,t={}){let{stiffness:r=.15,damping:o=.8,mass:n=1,precision:a=.01}=t,[s,i]=useState(e),c=useRef(0),d=useRef(e),m=useRef();return useEffect(()=>{let u=()=>{let p=e-d.current,h=p*r/n;if(c.current=(c.current+h)*o,d.current+=c.current,Math.abs(p)<a&&Math.abs(c.current)<a){d.current=e,i(e),m.current=void 0;return}i(d.current),m.current=requestAnimationFrame(u);};return m.current&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(u),()=>{m.current&&cancelAnimationFrame(m.current);}},[e,r,o,n,a]),s}function GD(e,t=100,r=0){return r+e*t}function jD(e,t=100){return Array.from({length:e},(r,o)=>o*t)}var ki="01XYZ#%&@$+-/<>!_";function ZD(e,t=800,r=true){let[o,n]=useState(e),a=useRef();return useEffect(()=>{if(!r){n(e);return}let s=Date.now(),i=()=>{let c=Date.now()-s,d=Math.min(c/t,1),m=e.split("").map((u,p)=>u===" "?" ":d>p/e.length?u:ki[Math.floor(Math.random()*ki.length)]).join("");n(m),d<1&&(a.current=requestAnimationFrame(i));};return a.current=requestAnimationFrame(i),()=>{a.current&&cancelAnimationFrame(a.current);}},[e,t,r]),o}function rH(e,t){let[r,o]=useState(e),n=useRef(Date.now());return useEffect(()=>{let a=setTimeout(()=>{Date.now()-n.current>=t&&(o(e),n.current=Date.now());},t-(Date.now()-n.current));return ()=>{clearTimeout(a);}},[e,t]),r}function nH(e=0){let[t,r]=useState(e),[o,n]=useState(false),a=useRef(null),s=useCallback(()=>{o||(n(true),a.current=setInterval(()=>{r(m=>m+1);},1e3));},[o]),i=useCallback(()=>{o&&a.current&&(clearInterval(a.current),n(false));},[o]),c=useCallback(()=>{a.current&&clearInterval(a.current),n(false),r(0);},[]);return useEffect(()=>()=>{a.current&&clearInterval(a.current);},[]),{seconds:t,isActive:o,start:s,pause:i,reset:c,formattedTime:(m=>{let u=Math.floor(m/3600),p=Math.floor(m%3600/60),g=m%60;return [u,p,g].map(h=>h<10?"0"+h:h).filter((h,v)=>h!=="00"||v>0).join(":")})(t)}}function cH(){let e=useContext(zo);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function uH(e=false){let[t,r]=useState(e),o=useCallback(()=>{r(n=>!n);},[]);return [t,o,r]}function gH(e=3e3){let[t,r]=useState(false),o=useRef(null),n=useCallback(a=>{r(a),o.current&&clearTimeout(o.current),a&&(o.current=window.setTimeout(()=>{r(false);},e));},[e]);return useEffect(()=>()=>{o.current&&clearTimeout(o.current);},[]),{isTyping:t,setTyping:n}}function xH(){return {startTransition:t=>{if(!document.startViewTransition){t();return}document.startViewTransition(()=>{flushSync(()=>{t();});});}}}function wH(e,t={month:"short",day:"numeric",year:"numeric"}){let r=new Date(e);return new Intl.DateTimeFormat("en-US",t).format(r)}function yH(e){return new Intl.NumberFormat("en-US").format(e)}function kH(e,t="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}function TH(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function CH(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}
70
- export{tf as AIPromptInput,ff as AIResponse,mk as Accordion,fk as AccordionContent,uk as AccordionItem,pk as AccordionTrigger,Fc as Alert,sC as AreaChart,os as AssigneePicker,Fs as AudioPlayer,B as Avatar,Kp as Background,Oe as Badge,tC as BarChart,np as Breadcrumb,mp as BreadcrumbEllipsis,ip as BreadcrumbItem,lp as BreadcrumbLink,sp as BreadcrumbList,cp as BreadcrumbPage,dp as BreadcrumbSeparator,L as Button,Gr as Calendar,Xi as Card,Qi as CardContent,ji as CardDescription,Ji as CardFooter,qi as CardHeader,Gi as CardTitle,Xs as CarouselMessage,_5 as ChartContainer,X5 as ChartGrid,j5 as ChartSkeleton,G5 as ChartTooltip,q5 as ChartXAxis,SC as ChartYAxis,oP as ChatBanner,C4 as ChatHeader,DL as ChatInput,d4 as ChatLayout,UL as ChatProfile,v4 as ChatSidebar,Lo as Checkbox,Zn as Checklist,$5 as Collapse,Xv as ColorPicker,Kn as ColumnLimit,Ho as Combobox,Ax as ComboboxContent,fn as ComboboxEmpty,un as ComboboxInput,gn as ComboboxItem,pn as ComboboxList,Ix as ComboboxTrigger,Yn as Command,t1 as CommandDialog,r1 as CommandEmpty,qn as CommandGroup,_n as CommandInput,Gn as CommandItem,Xn as CommandList,o1 as CommandShortcut,WM as ConfirmDialog,Dp as Container,Pk as DataTable,rv as DatePicker,lP as DateSeparator,bv as DateTimePicker,QM as Dialog,tR as DialogDescription,ZM as DialogFooter,JM as DialogHeader,eR as DialogTitle,ig as Divider,dR as Drawer,fR as DrawerDescription,uR as DrawerFooter,mR as DrawerHeader,pR as DrawerTitle,tt as DropdownMenu,ot as DropdownMenuContent,X as DropdownMenuItem,Is as DropdownMenuLabel,ha as DropdownMenuSeparator,rt as DropdownMenuTrigger,ns as DueDatePicker,OP as EmojiPicker,Xc as EmptyState,bc as FileDropzone,lc as FormControl,cc as FormDescription,sc as FormItem,ic as FormLabel,dc as FormMessage,Bi as GlowButton,Vp as Grid,NP as GroupHeader,Ge as Heading,ul as HeroText,Xo as Image,_s as InteractiveMessage,bu as Kanban,bu as KanbanBoard,Wn as KanbanCalendarView,jo as KanbanCard,Qo as KanbanColumn,Qn as KanbanFilterBar,Vn as KanbanHeader,to as KanbanListView,wT as KanbanQuickAdd,cs as KanbanSwimlane,Un as KanbanTableView,ls as KanbanTaskModal,Fn as KanbanTimelineView,dg as Kbd,U as Label,rs as LabelPicker,pl as LetterPullup,mC as LineChart,Ys as LinkPreview,By as Magnetic,k5 as Marquee,PP as MentionList,js as MessageBubble,yL as MessageList,nE as MessageSearch,Fi as MetricCard,ro as Modal,R1 as ModalDescription,ao as ModalFooter,oo as ModalHeader,Jn as ModalTitle,Sn as Motion,xy as MotionGroup,aM as Navbar,Pc as NumberInput,Uy as NumberTicker,Nc as OTPInput,uP as OnlineIndicator,qy as PageLoader,ek as PageTransition,pp as Pagination,fp as PaginationContent,xp as PaginationEllipsis,gp as PaginationItem,xa as PaginationLink,hp as PaginationNext,bp as PaginationPrevious,Py as Parallax,Gl as PasswordInput,xC as PieChart,je as Popover,Je as PopoverContent,Qe as PopoverTrigger,Ei as PrimaryButton,Wc as Progress,NC as RadarChart,ac as RadioGroup,nc as RadioGroupItem,Zc as Rating,Ws as ReadReceipt,JL as ReplyPreview,Ja as Reveal,at as ScrollArea,HE as ScrollProgress,Wr as Select,Er as Separator,il as ShinyText,YC as Sidebar,XC as SidebarContent,qC as SidebarFooter,jC as SidebarGroup,_C as SidebarHeader,GC as SidebarItem,Pn as Skeleton,RM as SkipToContent,$x as Slider,RC as Sparkline,_R as Spotlight,Ap as Stack,Eu as StatusDot,BM as Stepper,DT as SubtaskList,te as Surface,Po as Switch,bP as SystemMessage,vr as Table,yr as TableBody,Fe as TableCell,Ze as TableHead,wr as TableHeader,it as TableRow,OC as Tabs,KC as TabsContent,VC as TabsList,zC as TabsTrigger,Fv as TagInput,OT as TaskActivity,ts as TaskAttachments,es as TaskComments,Cu as Terminal,x5 as TerminalLine,xe as Text,al as TextGradient,vt as TextInput,Ny as TextMotion,gr as Textarea,_E as ThemeProvider,ZE as ThemeToggle,is as TimeTracker,Xk as Timeline,Kd as TimelineItem,Rn as Toast,zo as ToastContext,Vw as ToastProvider,Ic as ToggleGroup,kR as Tooltip,eN as Tree,XL as TypingIndicator,vM as UserMenu,Bd as UserPreview,jP as VoiceRecorder,qe as chatStore,l as cn,kH as formatCurrency,wH as formatDate,yH as formatNumber,Gt as normalize,CH as slugify,TH as truncate,mE as useActiveChat,kg as useAsync,yE as useBaileysSync,MD as useBreakpoint,Ce as useChart,sS as useChat,NE as useChatMedia,dS as useChatMessages,kE as useChatPresence,pS as useChatSearch,TE as useChatSearchWorker,yo as useChatStore,bS as useClickOutside,vS as useClipboard,RD as useContainerQuery,cE as useConversations,kS as useDebounce,CS as useDrag,LS as useElementScroll,oS as useFetch,SS as useFlip,Vt as useFloating,IS as useForm,VS as useHistory,$S as useIdle,Ke as useInView,WS as useInfiniteScroll,qS as useIntersection,QS as useKanban,us as useKanbanFilters,LT as useKanbanHistory,fs as useKanbanKeyboard,CT as useKanbanSync,ps as useKanbanUndo,eD as useKeyboardShortcuts,lD as useLocalStorage,ub as useMediaQuery,dE as useMessages,mD as useMousePosition,oD as useOnMount,aD as useOnUnmount,fD as useOrientation,hD as usePrevious,wD as useReadReceipts,ND as useReducedMotion,li as useScroll,ED as useScrollDirection,HD as useScrollLock,AD as useScrollTransform,VD as useScrollVelocity,$D as useSearch,jD as useSequence,WD as useSessionStorage,Ba as useSocket,XD as useSpring,GD as useStagger,ZD as useTextScramble,ui as useTheme,rH as useThrottle,nH as useTimer,cH as useToast,uH as useToggle,gH as useTypingIndicator,uE as useUserPresence,xH as useViewTransition,RE as useVirtualList,oi as useVoiceRecorder};//# sourceMappingURL=index.mjs.map
66
+ `})]})}function MC({data:e,keys:t,colors:r=["cyan","purple","emerald"],maxValue:o,height:n=300,className:a,...s}){let[i,c]=useState(0),d=we__default.useRef(null);we__default.useEffect(()=>{if(!d.current)return;let h=new ResizeObserver(p=>{p[0]&&c(p[0].contentRect.width);});return h.observe(d.current),()=>h.disconnect()},[]);let m={x:i/2,y:n/2},u=Math.min(i,n)/2-40,f=useMemo(()=>{if(o)return o;let h=0;return e.forEach(p=>{t.forEach(b=>{let w=Number(p[b])||0;w>h&&(h=w);});}),h*1.1||100},[e,t,o]),g=Math.PI*2/e.length,x={cyan:"rgba(6, 182, 212, 0.5)",purple:"rgba(139, 92, 246, 0.5)",emerald:"rgba(16, 185, 129, 0.5)",amber:"rgba(245, 158, 11, 0.5)",rose:"rgba(244, 63, 94, 0.5)"},v={cyan:"#06b6d4",purple:"#8b5cf6",emerald:"#10b981",amber:"#f59e0b",rose:"#f43f5e"};return i===0?jsx("div",{ref:d,style:{height:n}}):jsx("div",{ref:d,className:l("relative w-full select-none",a),style:{height:n},...s,children:jsxs("svg",{width:"100%",height:"100%",viewBox:`0 0 ${i} ${n}`,className:"overflow-visible",children:[[1,2,3,4,5].map(h=>{let p=u/5*h,b=e.map((w,k)=>{let y=g*k-Math.PI/2;return `${m.x+Math.cos(y)*p},${m.y+Math.sin(y)*p}`}).join(" ");return jsx("polygon",{points:b,fill:"none",stroke:"rgba(255,255,255,0.1)",strokeWidth:"1"},h)}),e.map((h,p)=>{let b=g*p-Math.PI/2,w=m.x+Math.cos(b)*u,k=m.y+Math.sin(b)*u,y=m.x+Math.cos(b)*(u+20),N=m.y+Math.sin(b)*(u+20);return jsxs("g",{children:[jsx("line",{x1:m.x,y1:m.y,x2:w,y2:k,stroke:"rgba(255,255,255,0.1)",strokeWidth:"1"}),jsx("text",{x:y,y:N,textAnchor:"middle",dominantBaseline:"middle",fill:"rgba(255,255,255,0.6)",fontSize:"12",children:h.subject})]},p)}),t.map((h,p)=>{let b=e.map((N,C)=>{let L=(Number(N[h])||0)/f*u,I=g*C-Math.PI/2;return `${m.x+Math.cos(I)*L},${m.y+Math.sin(I)*L}`}).join(" "),w=r[p%r.length]||"cyan",k=x[w],y=v[w];return jsx("polygon",{points:b,fill:k,fillOpacity:.3,stroke:y,strokeWidth:2,className:"transition-all duration-500 ease-out hover:fill-opacity-50"},h)})]})})}function EC({data:e,color:t="emerald",height:r=40,strokeWidth:o=2,fill:n=false,className:a,...s}){let i=Math.max(...e),c=Math.min(...e),d=i-c||1,u={cyan:"#06b6d4",purple:"#8b5cf6",emerald:"#10b981",amber:"#f59e0b",rose:"#f43f5e",white:"#ffffff"}[t],f=e.map((v,h)=>{let p=h/(e.length-1)*100,w=95-(v-c)/d*90;return {x:p,y:w}}),g="";if(f.length>0){g=`M ${f[0].x} ${f[0].y}`;for(let v=0;v<f.length-1;v++){let h=f[v],p=f[v+1],b=h.x+(p.x-h.x)/2,w=h.y,k=h.x+(p.x-h.x)/2,y=p.y;g+=` C ${b} ${w}, ${k} ${y}, ${p.x} ${p.y}`;}}let x=n?`${g} L 100 100 L 0 100 Z`:void 0;return jsx("div",{className:l("w-full overflow-hidden",a),style:{height:r},...s,children:jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"overflow-visible",children:[n&&jsx("path",{d:x,fill:u,fillOpacity:.1,stroke:"none"}),jsx("path",{d:g,fill:"none",stroke:u,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]})})}function IC({ticks:e=5,format:t=r=>r.toString()}){let{height:r,padding:o,maxValue:n}=Me(),a=r-o.top-o.bottom;return jsx("g",{children:Array.from({length:e+1}).map((s,i)=>{let c=n/e*i,d=r-o.bottom-a/e*i;return jsx("text",{x:o.left-10,y:d,textAnchor:"end",dominantBaseline:"middle",className:"fill-gray-400 dark:fill-white/40 text-xs font-medium",children:t(Math.round(c))},i)})})}var ha=createContext(void 0);function KC({defaultValue:e,value:t,onValueChange:r,className:o,children:n,...a}){let[s,i]=useState(e),c=m=>{t===void 0&&i(m),r?.(m);},d=t!==void 0?t:s;return jsx(ha.Provider,{value:{value:d,onValueChange:c},children:jsx("div",{className:l("w-full",o),...a,children:n})})}function $C({className:e,children:t,...r}){return jsx("div",{role:"tablist",className:l("inline-flex h-10 items-center justify-center rounded-2xl bg-gray-100 p-1 text-gray-500 dark:bg-white/[0.03] dark:text-white/60",e),...r,children:t})}function FC({className:e,value:t,children:r,...o}){let n=useContext(ha);if(!n)throw new Error("TabsTrigger must be used within Tabs");let a=n.value===t;return jsx("button",{type:"button",role:"tab","aria-selected":a,"aria-controls":`tabs-content-${t}`,id:`tabs-trigger-${t}`,onClick:()=>n.onValueChange(t),className:l("inline-flex items-center justify-center whitespace-nowrap rounded-2xl px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-zinc-950 dark:focus-visible:ring-white/20",a?"bg-white text-gray-900 shadow-sm dark:bg-white/[0.06] dark:text-white dark:backdrop-blur-sm":"hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-white/[0.03] dark:hover:text-white",e),...o,children:r})}function UC({className:e,value:t,children:r,...o}){let n=useContext(ha);if(!n)throw new Error("TabsContent must be used within Tabs");return n.value!==t?null:jsx("div",{role:"tabpanel",id:`tabs-content-${t}`,"aria-labelledby":`tabs-trigger-${t}`,tabIndex:0,className:l("mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20 focus-visible:ring-offset-2",e),...o,children:r})}var qC=we__default.forwardRef(({className:e,children:t,...r},o)=>jsx("aside",{ref:o,className:l("flex h-full w-64 flex-col border-r backdrop-blur-xl transition-colors duration-200","border-gray-200 bg-white/50","dark:border-white/10 dark:bg-black/20",e),...r,children:t})),GC=we__default.forwardRef(({className:e,children:t,...r},o)=>jsx("div",{ref:o,className:l("flex h-16 items-center px-6 border-b border-gray-200 dark:border-white/5",e),...r,children:t})),jC=we__default.forwardRef(({className:e,children:t,...r},o)=>jsx("div",{ref:o,className:l("flex-1 overflow-y-auto py-4 px-3 space-y-1",e),...r,children:t})),QC=we__default.forwardRef(({className:e,children:t,...r},o)=>jsx("div",{ref:o,className:l("p-4 border-t border-gray-200 dark:border-white/5",e),...r,children:t})),JC=we__default.forwardRef(({className:e,children:t,active:r,icon:o,badge:n,...a},s)=>jsxs("button",{ref:s,className:l("flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium transition-colors","hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-white/[0.03] dark:hover:text-white",r?"bg-gray-200 text-gray-900 dark:bg-white/[0.06] dark:text-white":"text-gray-600 dark:text-white/60",e),...a,children:[o&&jsx("span",{className:l("flex h-4 w-4 items-center justify-center",r?"text-gray-900 dark:text-white":"text-gray-500 dark:text-white/60"),children:o}),jsx("span",{className:"flex-1 text-left",children:t}),n&&jsx("span",{className:"flex h-5 min-w-5 items-center justify-center rounded-full bg-gray-200 dark:bg-white/[0.06] px-1.5 text-[10px] font-bold text-gray-900 dark:text-white",children:n})]})),ZC=we__default.forwardRef(({className:e,children:t,label:r,...o},n)=>jsxs("div",{ref:n,className:l("mb-6",e),...o,children:[r&&jsx("div",{className:"mb-2 px-3 text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-white/40",children:r}),jsx("div",{className:"space-y-1",children:t})]}));var ep={sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl","2xl":"max-w-screen-2xl",full:"max-w-full"};function iM({logo:e,links:t=[],actions:r,className:o,maxWidth:n="xl"}){let[a,s]=useState(false),[i,c]=useState(false);return useEffect(()=>{let d=()=>{s(window.scrollY>20);};return window.addEventListener("scroll",d),()=>window.removeEventListener("scroll",d)},[]),jsx("nav",{className:l("fixed top-0 left-0 right-0 z-50 transition-all duration-300 px-4 py-4",a?"py-3":"py-6",o),children:jsxs("div",{className:l("mx-auto transition-all duration-300",ep[n]),children:[jsxs(ne,{className:l("flex items-center justify-between px-6 py-3 transition-all duration-300",a?"rounded-2xl border-white/10 bg-white/70 dark:bg-zinc-900/70 backdrop-blur-xl shadow-lg":"rounded-2xl border-transparent bg-transparent dark:bg-transparent backdrop-blur-none shadow-none"),children:[jsx("div",{className:"flex items-center gap-2",children:e||jsx("span",{className:"text-xl font-bold tracking-tighter",children:"PIXON"})}),jsx("div",{className:"hidden md:flex items-center gap-8",children:t.map(d=>jsx("a",{href:d.href,className:"text-sm font-medium text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white transition-colors",children:d.label},d.label))}),jsxs("div",{className:"flex items-center gap-4",children:[jsx("div",{className:"hidden md:flex items-center gap-2",children:r}),jsx("button",{className:"md:hidden p-2 text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-white/[0.03] rounded-2xl transition-colors",onClick:()=>c(!i),children:i?jsx(X,{size:20}):jsx(Menu,{size:20})})]})]}),jsx("div",{className:l("md:hidden absolute top-full left-4 right-4 mt-2 transition-all duration-300 origin-top",i?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 -translate-y-4 pointer-events-none"),children:jsxs(ne,{className:"p-4 flex flex-col gap-4 shadow-2xl border-white/10 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-2xl",children:[t.map(d=>jsx("a",{href:d.href,className:"text-base font-medium px-4 py-2 rounded-2xl hover:bg-zinc-100 dark:hover:bg-white/[0.03] text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white transition-all",onClick:()=>c(false),children:d.label},d.label)),jsx("div",{className:"pt-4 border-t border-zinc-200 dark:border-white/10 flex flex-col gap-2",children:r})]})})]})})}var fo=createContext(void 0);function rt({children:e}){let[t,r]=useState(false),o=useRef(null);return jsx(fo.Provider,{value:{isOpen:t,setIsOpen:r,triggerRef:o},children:jsx("div",{className:"relative inline-block text-left",children:e})})}function ot({className:e,children:t,...r}){let o=useContext(fo);if(!o)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=a=>{o.setIsOpen(!o.isOpen),r.onClick?.(a);};return jsx("button",{ref:o.triggerRef,type:"button","aria-haspopup":"menu","aria-expanded":o.isOpen?"true":"false",onClick:n,className:l("inline-flex items-center justify-center",e),...r,children:t})}function at({className:e,children:t,align:r="start",side:o="bottom",...n}){let a=useContext(fo);if(!a)throw new Error("DropdownMenuContent must be used within DropdownMenu");let s=useRef(null),{position:i,isPositioned:c}=Kt(a.triggerRef,s,{side:o,align:r,isOpen:a.isOpen});if(useEffect(()=>{if(a.isOpen){let m=f=>{s.current&&!s.current.contains(f.target)&&a.triggerRef.current&&!a.triggerRef.current.contains(f.target)&&a.setIsOpen(false);},u=f=>{if(f.key==="Escape"&&(a.setIsOpen(false),a.triggerRef.current?.focus()),f.key==="ArrowDown"||f.key==="ArrowUp"){f.preventDefault();let g=s.current?.querySelectorAll('[role="menuitem"]');if(!g.length)return;let x=Array.from(g).indexOf(document.activeElement),v=0;f.key==="ArrowDown"?v=(x+1)%g.length:v=(x-1+g.length)%g.length,g[v]?.focus();}};return document.addEventListener("mousedown",m),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",u);}}},[a.isOpen,a.setIsOpen,a.triggerRef]),!a.isOpen)return null;let d=()=>o==="bottom"?r==="start"?"top left":r==="end"?"top right":"top center":o==="top"?r==="start"?"bottom left":r==="end"?"bottom right":"bottom center":o==="left"?r==="start"?"top right":r==="end"?"bottom right":"center right":o==="right"?r==="start"?"top left":r==="end"?"bottom left":"center left":"center center";return createPortal(jsx("div",{ref:s,role:"menu","aria-orientation":"vertical",style:{top:i.top,left:i.left,transformOrigin:d()},className:l("fixed z-[110] min-w-[8rem] overflow-hidden rounded-2xl border border-gray-200 dark:border-white/10 bg-white/80 dark:bg-white/[0.03] backdrop-blur-xl p-1 shadow-md duration-100",c?"animate-in fade-in zoom-in-95 opacity-100":"opacity-0",e),...n,children:t}),document.body)}function K({className:e,children:t,...r}){let o=useContext(fo);return jsx("button",{type:"button",role:"menuitem",onClick:a=>{o?.setIsOpen(false),r.onClick?.(a);},className:l("relative flex w-full cursor-pointer select-none items-center rounded-2xl px-3 py-2 text-sm outline-none transition-colors","text-gray-700 dark:text-white/80","hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-white/[0.06] dark:hover:text-white","focus:bg-gray-100 focus:text-gray-900 dark:focus:bg-white/[0.06] dark:focus:text-white","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:t})}function Bs({className:e,children:t,...r}){return jsx("div",{className:l("px-2 py-1.5 text-sm font-semibold text-gray-900 dark:text-white",e),...r,children:t})}function xa({className:e,...t}){return jsx("div",{className:l("-mx-1 my-1 h-px bg-gray-200 dark:bg-white/[0.03]",e),...t})}function kM({name:e,description:t,avatarSrc:r,avatarFallback:o,className:n,side:a="top",align:s="start"}){return jsxs(rt,{children:[jsx(ot,{className:l("w-full outline-none",n),children:jsxs("div",{className:"group flex w-full items-center gap-3 rounded-2xl border border-gray-200 dark:border-white/5 bg-white dark:bg-white/[0.03] p-3 transition-colors hover:bg-gray-50 dark:hover:bg-white/[0.06]",children:[jsx(z,{src:r,fallback:o||e.charAt(0),size:"sm"}),jsxs("div",{className:"flex flex-1 flex-col items-start text-left",children:[jsx("span",{className:"text-xs font-medium text-gray-900 dark:text-white",children:e}),t&&jsx("span",{className:"text-[10px] text-gray-500 dark:text-white/50",children:t})]}),jsx(Settings,{className:"h-4 w-4 text-gray-400 dark:text-white/50 transition-colors group-hover:text-gray-900 dark:group-hover:text-white"})]})}),jsxs(at,{className:"w-56",align:s,side:a,children:[jsx(Bs,{children:"My Account"}),jsx(xa,{}),jsxs(K,{children:[jsx(User,{className:"mr-2 h-4 w-4"}),jsx("span",{children:"Profile"})]}),jsxs(K,{children:[jsx(Settings,{className:"mr-2 h-4 w-4"}),jsx("span",{children:"Settings"})]}),jsx(xa,{}),jsxs(K,{className:"text-rose-400 focus:text-rose-400",children:[jsx(LogOut,{className:"mr-2 h-4 w-4"}),jsx("span",{children:"Log out"})]})]})]})}var ip=we__default.forwardRef(({...e},t)=>jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));ip.displayName="Breadcrumb";var lp=we__default.forwardRef(({className:e,...t},r)=>jsx("ol",{ref:r,className:l("flex flex-wrap items-center gap-1.5 break-words text-sm text-gray-500 dark:text-white/50 sm:gap-2.5",e),...t}));lp.displayName="BreadcrumbList";var cp=we__default.forwardRef(({className:e,...t},r)=>jsx("li",{ref:r,className:l("inline-flex items-center gap-1.5",e),...t}));cp.displayName="BreadcrumbItem";var dp=we__default.forwardRef(({className:e,...t},r)=>jsx("a",{ref:r,className:l("transition-colors hover:text-gray-900 dark:hover:text-white",e),...t}));dp.displayName="BreadcrumbLink";var mp=we__default.forwardRef(({className:e,...t},r)=>jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:l("font-normal text-gray-900 dark:text-white",e),...t}));mp.displayName="BreadcrumbPage";var up=({children:e,className:t,...r})=>jsx("li",{role:"presentation","aria-hidden":"true",className:l("[&>svg]:size-3.5",t),...r,children:e??jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:jsx("path",{d:"m9 18 6-6-6-6"})})});up.displayName="BreadcrumbSeparator";var pp=({className:e,...t})=>jsxs("span",{role:"presentation","aria-hidden":"true",className:l("flex h-9 w-9 items-center justify-center",e),...t,children:[jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:[jsx("circle",{cx:"12",cy:"12",r:"1"}),jsx("circle",{cx:"19",cy:"12",r:"1"}),jsx("circle",{cx:"5",cy:"12",r:"1"})]}),jsx("span",{className:"sr-only",children:"More"})]});pp.displayName="BreadcrumbElipssis";function EM({contentId:e="main-content",className:t,children:r="Skip to content"}){return jsx("a",{href:`#${e}`,className:l("sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-[100] focus:px-4 focus:py-2 focus:bg-purple-600 focus:text-white focus:rounded-xl focus:shadow-2xl focus:outline-none focus:ring-2 focus:ring-white/20 transition-all",t),children:r})}var gp=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:l("mx-auto flex w-full justify-center",e),...t});gp.displayName="Pagination";var hp=we__default.forwardRef(({className:e,...t},r)=>jsx("ul",{ref:r,className:l("flex flex-row items-center gap-1",e),...t}));hp.displayName="PaginationContent";var bp=we__default.forwardRef(({className:e,...t},r)=>jsx("li",{ref:r,className:l("",e),...t}));bp.displayName="PaginationItem";var va=({className:e,isActive:t,...r})=>jsx("a",{"aria-current":t?"page":void 0,className:l("inline-flex h-9 w-9 items-center justify-center rounded-2xl text-sm font-medium transition-colors","hover:bg-gray-100 dark:hover:bg-white/[0.03] hover:text-gray-900 dark:hover:text-white",t?"bg-gray-100 text-gray-900 dark:bg-white/[0.06] dark:text-white":"text-gray-500 dark:text-white/60",e),...r});va.displayName="PaginationLink";var xp=({className:e,...t})=>jsxs(va,{"aria-label":"Go to previous page",className:l("w-auto gap-1 px-2.5",e),...t,children:[jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:jsx("path",{d:"m15 18-6-6 6-6"})}),jsx("span",{children:"Previous"})]});xp.displayName="PaginationPrevious";var vp=({className:e,...t})=>jsxs(va,{"aria-label":"Go to next page",className:l("w-auto gap-1 px-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:jsx("path",{d:"m9 18 6-6-6-6"})})]});vp.displayName="PaginationNext";var wp=({className:e,...t})=>jsxs("span",{"aria-hidden":true,className:l("flex h-9 w-9 items-center justify-center",e),...t,children:[jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:[jsx("circle",{cx:"12",cy:"12",r:"1"}),jsx("circle",{cx:"19",cy:"12",r:"1"}),jsx("circle",{cx:"5",cy:"12",r:"1"})]}),jsx("span",{className:"sr-only",children:"More pages"})]});wp.displayName="PaginationEllipsis";var zM=({steps:e,currentStep:t,className:r,onStepClick:o})=>jsx("div",{className:l("flex w-full flex-col gap-4 md:flex-row",r),children:e.map((n,a)=>{let s=t>a,i=t===a,c=!!o;return jsxs("div",{className:l("flex flex-1 flex-col gap-2 md:flex-row md:items-center md:gap-4",c&&"cursor-pointer"),onClick:()=>c&&o(a),children:[jsxs("div",{className:"flex items-center gap-4 md:flex-col md:gap-2",children:[jsxs("div",{className:"flex items-center",children:[jsx("div",{className:l("flex h-8 w-8 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors",s?"border-blue-600 bg-blue-600 text-white dark:border-blue-500 dark:bg-blue-500":i?"border-blue-600 text-blue-600 dark:border-blue-500 dark:text-blue-500":"border-gray-300 text-gray-500 dark:border-white/20 dark:text-white/40"),children:s?jsx(Check,{className:"h-4 w-4"}):a+1}),a<e.length-1&&jsx("div",{className:l("ml-4 h-px flex-1 bg-gray-200 md:hidden dark:bg-white/[0.03]",s&&"bg-blue-600 dark:bg-blue-500")})]}),jsxs("div",{className:"flex flex-col",children:[jsx("span",{className:l("text-sm font-medium",i||s?"text-gray-900 dark:text-white":"text-gray-500 dark:text-white/50"),children:n.title}),n.description&&jsx("span",{className:"text-xs text-gray-500 dark:text-white/40 hidden md:block",children:n.description})]})]}),a<e.length-1&&jsx("div",{className:l("hidden h-px flex-1 bg-gray-200 md:block dark:bg-white/[0.03]",s&&"bg-blue-600 dark:bg-blue-500")})]},a)})});function XM({isOpen:e,onClose:t,onConfirm:r,title:o,description:n,confirmText:a="Confirm",cancelText:s="Cancel",variant:i="primary",isLoading:c=false}){return jsxs(ro,{isOpen:e,onClose:t,children:[jsx(oo,{children:jsxs("div",{className:"flex items-center gap-3",children:[i==="danger"&&jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-rose-500/10 text-rose-500",children:jsx(AlertTriangle,{className:"h-5 w-5"})}),jsx(je,{as:"h3",children:o})]})}),jsx("div",{className:"py-2",children:jsx(ve,{className:"text-gray-500 dark:text-white/60",children:n})}),jsxs(ao,{children:[jsx(R,{variant:"ghost",onClick:t,disabled:c,children:s}),jsx(R,{variant:i==="danger"?"danger":"primary",onClick:r,isLoading:c,children:a})]})]})}function eR({isOpen:e,onClose:t,children:r,className:o}){let n=useRef(null),[a,s]=we__default.useState(false);useEffect(()=>{s(true);},[]),useEffect(()=>{let c=n.current;c&&(e?c.open||c.showModal():c.open&&c.close());},[e,a]),useEffect(()=>{let c=n.current;if(!c)return;let d=m=>{m.preventDefault(),t();};return c.addEventListener("cancel",d),()=>c.removeEventListener("cancel",d)},[t,a]);let i=c=>{c.target===n.current&&t();};return a?createPortal(jsx("dialog",{ref:n,onClick:i,className:l("fixed inset-0 z-[100] bg-transparent p-0 backdrop:bg-black/60 backdrop:backdrop-blur-sm open:grid open:place-items-center","open:animate-in open:fade-in open:duration-200",o),children:jsxs("div",{className:l("relative w-full max-w-lg scale-100 gap-4 border border-gray-200 dark:border-white/10 bg-white dark:bg-[#0A0A0A]/90 p-6 shadow-2xl backdrop-blur-xl transition-all sm:rounded-2xl","animate-in fade-in zoom-in-95 duration-200 slide-in-from-bottom-2"),children:[r,jsxs("button",{onClick:t,className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 dark:focus:ring-white/20 disabled:pointer-events-none",children:[jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-900 dark:text-white",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),jsx("span",{className:"sr-only",children:"Close"})]})]})}),document.body):null}function tR({className:e,children:t}){return jsx("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left mb-4",e),children:t})}function rR({className:e,children:t}){return jsx("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-6",e),children:t})}function oR({className:e,children:t}){return jsx(je,{as:"h2",className:l("text-lg font-semibold leading-none tracking-tight",e),children:t})}function aR({className:e,children:t}){return jsx("p",{className:l("text-sm text-gray-500 dark:text-gray-400",e),children:t})}function pR({isOpen:e,onClose:t,position:r="right",children:o,className:n}){let[a,s]=useState(false),[i,c]=useState(false),d=useRef(null);useEffect(()=>{if(e)c(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{s(true);});}),document.body.style.overflow="hidden";else {s(false);let g=setTimeout(()=>{c(false),document.body.style.overflow="unset";},300);return ()=>clearTimeout(g)}},[e]),useEffect(()=>{let g=x=>{x.key==="Escape"&&t();};return e&&document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g);}},[e,t]);let m=g=>{g.target===d.current&&t();};if(!i)return null;let u={left:"left-0 h-full w-3/4 max-w-sm border-r",right:"right-0 h-full w-3/4 max-w-sm border-l",bottom:"bottom-0 w-full h-auto max-h-[90vh] border-t rounded-t-2xl"},f={left:a?"translate-x-0":"-translate-x-full",right:a?"translate-x-0":"translate-x-full",bottom:a?"translate-y-0":"translate-y-full"};return createPortal(jsx("div",{ref:d,onClick:m,className:l("fixed inset-0 z-[100] flex bg-black/60 backdrop-blur-sm transition-opacity duration-300",a?"opacity-100":"opacity-0"),role:"dialog","aria-modal":"true",children:jsx("div",{className:l("absolute bg-white dark:bg-[#0A0A0A] border-gray-200 dark:border-white/10 p-6 shadow-2xl transition-transform duration-300 ease-in-out",u[r],f[r],n),children:o})}),document.body)}function fR({className:e,children:t,...r}){return jsx("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left mb-6",e),...r,children:t})}function gR({className:e,children:t,...r}){return jsx("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 mt-auto pt-6",e),...r,children:t})}function hR({className:e,children:t,...r}){return jsx(je,{as:"h2",className:l("text-lg font-semibold leading-none tracking-tight",e),...r,children:t})}function bR({className:e,children:t,...r}){return jsx(ve,{variant:"muted",className:l("text-sm",e),...r,children:t})}function CR({content:e,children:t,position:r="top",delay:o=200,className:n}){let[a,s]=useState(false),i=useRef(null),c=useRef(null),d=useRef(null),{position:m,isPositioned:u}=Kt(c,d,{side:r,align:"center",sideOffset:8,isOpen:a}),f=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>s(true),o);},g=()=>{i.current&&clearTimeout(i.current),s(false);};useEffect(()=>()=>{i.current&&clearTimeout(i.current);},[]);let x={top:"slide-in-from-bottom-2",bottom:"slide-in-from-top-2",left:"slide-in-from-right-2",right:"slide-in-from-left-2"};return jsxs("div",{ref:c,className:"relative inline-flex",onMouseEnter:f,onMouseLeave:g,onFocus:f,onBlur:g,children:[t,a&&createPortal(jsx("div",{ref:d,role:"tooltip",style:{top:m.top,left:m.left},className:l("fixed z-[120] min-w-max max-w-xs rounded-2xl border border-gray-200 dark:border-white/10 bg-white dark:bg-[#0A0A0A]/90 px-3 py-1.5 text-xs text-gray-900 dark:text-white shadow-xl backdrop-blur-md","duration-200",u?"animate-in fade-in opacity-100":"opacity-0",x[r],n),children:e}),document.body)]})}var Ip=we__default.forwardRef(({className:e,size:t="lg",...r},o)=>jsx("div",{ref:o,className:l("mx-auto w-full px-4",{sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl",full:"max-w-full"}[t],e),...r}));Ip.displayName="Container";var Op=we__default.forwardRef(({className:e,direction:t="col",gap:r=4,align:o,justify:n,wrap:a,style:s,...i},c)=>jsx("div",{ref:c,className:l("flex",{"flex-row":t==="row","flex-col":t==="col","flex-row-reverse":t==="row-reverse","flex-col-reverse":t==="col-reverse","flex-wrap":a,"items-start":o==="start","items-end":o==="end","items-center":o==="center","items-baseline":o==="baseline","items-stretch":o==="stretch","justify-start":n==="start","justify-end":n==="end","justify-center":n==="center","justify-between":n==="between","justify-around":n==="around","justify-evenly":n==="evenly"},e),style:{gap:typeof r=="number"?`${r*.25}rem`:r,...s},...i}));Op.displayName="Stack";var Kp=we__default.forwardRef(({className:e,cols:t=1,sm:r,md:o,lg:n,xl:a,gap:s=4,style:i,...c},d)=>jsx("div",{ref:d,className:l("grid",r&&`sm:grid-cols-${r}`,o&&`md:grid-cols-${o}`,n&&`lg:grid-cols-${n}`,a&&`xl:grid-cols-${a}`,e),style:{gridTemplateColumns:t?`repeat(${t}, minmax(0, 1fr))`:void 0,gap:typeof s=="number"?`${s*.25}rem`:s,...i},...c}));Kp.displayName="Grid";var Fp=we__default.forwardRef(({variant:e="none",noise:t=false,patternColor:r,size:o=24,mask:n="none",animate:a=false,followMouse:s=false,bgColor:i,className:c,children:d,style:m,...u},f)=>{let g=we__default.useRef(null);we__default.useEffect(()=>{if(!s)return;let h=p=>{let b=g.current;if(!b)return;let w=b.getBoundingClientRect(),k=p.clientX-w.left,y=p.clientY-w.top;b.style.setProperty("--mouse-x",`${k}px`),b.style.setProperty("--mouse-y",`${y}px`);};return window.addEventListener("mousemove",h),()=>window.removeEventListener("mousemove",h)},[s]);let x=()=>{let h={},p=r||"var(--pattern-color, rgba(255,255,255,0.08))";return e==="dots"?{...h,backgroundImage:`radial-gradient(${p} 1px, transparent 1px)`,backgroundSize:`${o}px ${o}px`,transform:s?"translate3d(calc((var(--mouse-x, 0) - 24px) / 40), calc((var(--mouse-y, 0) - 24px) / 40), 0)":void 0}:e==="grid"?{...h,backgroundImage:`
67
+ linear-gradient(to right, ${p} 1px, transparent 1px),
68
+ linear-gradient(to bottom, ${p} 1px, transparent 1px)
69
+ `,backgroundSize:`${o}px ${o}px`,transform:s?"translate3d(calc((var(--mouse-x, 0) - 24px) / 40), calc((var(--mouse-y, 0) - 24px) / 40), 0)":void 0}:e==="gradient"?{...h,background:s?`radial-gradient(circle at var(--mouse-x, center) var(--mouse-y, center), ${p}, transparent)`:`radial-gradient(circle at center, ${p}, transparent)`}:e==="beams"?{...h,background:`radial-gradient(60% 40% at 50% 0%, ${p} 0%, transparent 100%)`}:h},v=n==="fade"?{maskImage:"radial-gradient(ellipse at center, black, transparent 90%)",WebkitMaskImage:"radial-gradient(ellipse at center, black, transparent 90%)"}:{};return jsxs("div",{ref:h=>{h&&(g.current=h),typeof f=="function"?f(h):f&&(f.current=h);},className:l("absolute inset-0 overflow-hidden pointer-events-none transition-transform duration-300 ease-out","z-0","[--pattern-color:rgba(0,0,0,0.05)] dark:[--pattern-color:rgba(255,255,255,0.08)]",i?.startsWith("bg-")?i:"",c),style:{...x(),...v,...m,backgroundColor:i&&!i.startsWith("bg-")?i:void 0},...u,children:[t&&jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none brightness-100 contrast-150",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`}}),e==="beams"&&jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[jsx("div",{className:"absolute top-0 left-1/4 w-px h-full bg-gradient-to-b from-transparent via-white/10 to-transparent"}),jsx("div",{className:"absolute top-0 right-1/4 w-px h-full bg-gradient-to-b from-transparent via-white/10 to-transparent"})]}),e==="mesh"&&jsxs("div",{className:l("absolute inset-0 opacity-30 blur-[100px]",a&&"animate-pulse"),children:[jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[50%] h-[50%] rounded-full bg-blue-500/20"}),jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[50%] h-[50%] rounded-full bg-purple-500/20"}),jsx("div",{className:"absolute top-[20%] right-[10%] w-[40%] h-[40%] rounded-full bg-indigo-500/10"})]}),d]})});Fp.displayName="Background";var GR=({children:e,className:t,size:r=300,color:o,fill:n,...a})=>{let s=useRef(null),i=n||o||"rgba(255, 255, 255, 0.1)";return jsxs("div",{ref:s,onMouseMove:u=>{let f=s.current;if(!f)return;let g=f.getBoundingClientRect(),x=u.clientX-g.left,v=u.clientY-g.top;f.style.setProperty("--mouse-x",`${x}px`),f.style.setProperty("--mouse-y",`${v}px`);},onMouseEnter:()=>{s.current?.style.setProperty("--opacity","1");},onMouseLeave:()=>{s.current?.style.setProperty("--opacity","0");},className:l("relative overflow-hidden rounded-2xl border border-gray-200 bg-white dark:border-white/10 dark:bg-black",t),...a,children:[jsx("div",{className:"pointer-events-none absolute -inset-px transition-opacity duration-300",style:{opacity:"var(--opacity, 0)",background:`radial-gradient(${r}px circle at var(--mouse-x, center) var(--mouse-y, center), ${i}, transparent 80%)`}}),e&&jsx("div",{className:"relative h-full",children:e})]})};var rf=cva("relative flex w-full flex-col rounded-2xl border transition-all duration-200 focus-within:ring-4",{variants:{variant:{default:"bg-white border-gray-200 shadow-sm focus-within:border-purple-500/50 focus-within:ring-purple-500/10 dark:bg-white/[0.03] dark:border-white/10 dark:shadow-none",ghost:"bg-transparent border-transparent shadow-none focus-within:bg-white/50 dark:focus-within:bg-white/5"}},defaultVariants:{variant:"default"}}),of=we__default.forwardRef(({className:e,variant:t,onSubmit:r,isGenerating:o,onAttach:n,onFilesSelected:a,onStop:s,onMic:i,maxLength:c,footer:d,attachments:m,onRemoveAttachment:u,accept:f,multiple:g,placeholder:x="Ask AI anything...",value:v,onChange:h,...p},b)=>{let[w,k]=useState(""),y=v!==void 0,N=y?v:w,C=useRef(null),T=useRef(null),L=()=>{C.current&&(C.current.style.height="auto",C.current.style.height=`${C.current.scrollHeight}px`);};useEffect(()=>{L();},[N]);let I=M=>{let J=M.target.value;c&&J.length>c||(y||k(J),h?.(M));},P=M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),N.trim()&&!o&&(r?.(N),y||k(""))),p.onKeyDown?.(M);},D=()=>{o&&s?s():N.trim()&&(r?.(N),y||k(""));},V=()=>{a&&T.current?T.current.click():n?.();},A=M=>{M.target.files&&M.target.files.length>0&&a?.(M.target.files),T.current&&(T.current.value="");};return jsxs("div",{className:l(rf({variant:t,className:e})),children:[jsx("input",{type:"file",ref:T,className:"hidden",onChange:A,accept:f,multiple:g}),m&&m.length>0&&jsx("div",{className:"flex flex-wrap gap-2 px-4 pt-4",children:m.map(M=>jsxs("div",{className:"group relative flex items-center gap-2 rounded-xl border border-gray-200 bg-gray-50 px-3 py-1.5 text-sm transition-colors hover:bg-gray-100 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/[0.06]",children:[jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-lg bg-white dark:bg-white/[0.06]",children:jsx(File,{className:"h-3 w-3 text-purple-500"})}),jsx("span",{className:"max-w-[120px] truncate text-gray-700 dark:text-gray-300",children:M.name}),jsx("button",{onClick:()=>u?.(M.id),className:"ml-1 rounded-full p-0.5 text-gray-400 opacity-0 transition-all hover:bg-gray-200 hover:text-gray-600 group-hover:opacity-100 dark:hover:bg-white/[0.06] dark:hover:text-white",type:"button",children:jsx(X,{className:"h-3 w-3"})})]},M.id))}),jsx("textarea",{ref:M=>{C.current=M,typeof b=="function"?b(M):b&&(b.current=M);},value:N,onChange:I,onKeyDown:P,placeholder:x,rows:1,className:l("w-full resize-none bg-transparent px-4 py-4 text-base outline-none max-h-[200px]","text-gray-900 placeholder:text-gray-400","dark:text-white dark:placeholder:text-white/40"),disabled:o&&!s,...p}),jsxs("div",{className:"flex items-center justify-between px-2 pb-2",children:[jsxs("div",{className:"flex items-center gap-1",children:[jsx(R,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-gray-600 dark:text-white/40 dark:hover:text-white",onClick:V,type:"button",title:"Attach file",children:jsx(Paperclip,{className:"h-5 w-5"})}),i&&jsx(R,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-gray-600 dark:text-white/40 dark:hover:text-white",onClick:i,type:"button",title:"Use microphone",children:jsx(Mic,{className:"h-5 w-5"})})]}),jsxs("div",{className:"flex items-center gap-3",children:[c&&jsxs("span",{className:"text-xs text-gray-400 dark:text-white/30",children:[N.length,"/",c]}),jsx(R,{size:"icon",disabled:!N.trim()&&!o||o&&!s,onClick:D,className:l("h-8 w-8 rounded-full transition-all duration-200",N.trim()||o?"bg-purple-600 text-white hover:bg-purple-500 shadow-lg shadow-purple-500/25":"bg-gray-100 text-gray-400 dark:bg-white/[0.06] dark:text-white/20"),children:o?s?jsx(Square,{className:"h-3 w-3 fill-current"}):jsx(Sparkles,{className:"h-4 w-4 animate-pulse"}):jsx(ArrowUp,{className:"h-4 w-4"})})]})]}),d&&jsx("div",{className:"border-t border-gray-100 px-4 py-2 text-xs text-gray-400 dark:border-white/5 dark:text-white/30",children:d})]})});of.displayName="AIPromptInput";var gf=cva("group relative overflow-hidden rounded-2xl border transition-all duration-200",{variants:{variant:{default:"bg-gray-50 border-gray-200 dark:bg-white/[0.02] dark:border-white/10",ghost:"bg-transparent border-transparent",outline:"bg-transparent border-gray-200 dark:border-white/10"}},defaultVariants:{variant:"default"}}),hf=we__default.forwardRef(({className:e,variant:t,children:r,onCopy:o,onRegenerate:n,onFeedback:a,onShare:s,onEdit:i,timestamp:c,sources:d,model:m,usage:u,...f},g)=>jsxs("div",{ref:g,className:l(gf({variant:t,className:e})),...f,children:[jsxs("div",{className:"absolute left-4 top-4 flex items-center gap-3",children:[jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-gradient-to-br from-purple-500 to-blue-500 shadow-lg shadow-purple-500/20",children:jsx(Sparkles,{className:"h-3.5 w-3.5 text-white"})}),c&&jsx("span",{className:"text-xs font-medium text-gray-400 dark:text-white/30",children:c})]}),jsxs("div",{className:"pl-14 pr-4 py-4",children:[jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-gray-700 dark:text-gray-300",children:r}),d&&d.length>0&&jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:d.map((x,v)=>jsxs("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",className:l("flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs transition-colors","border-gray-200 bg-white text-gray-600 hover:bg-gray-50","dark:border-white/10 dark:bg-white/[0.03] dark:text-white/60 dark:hover:bg-white/[0.06]"),children:[jsx("span",{className:"max-w-[150px] truncate",children:x.title}),jsx(ExternalLink,{className:"h-3 w-3 opacity-50"})]},v))})]}),jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 bg-white/50 px-2 py-1.5 backdrop-blur dark:border-white/5 dark:bg-white/[0.02]",children:[jsxs("div",{className:"flex items-center gap-3 px-2 text-[10px] font-medium text-gray-400 dark:text-white/20",children:[m&&jsx("span",{children:m}),u&&jsx("span",{children:u})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsxs(R,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:o,children:[jsx(Copy,{className:"mr-1.5 h-3.5 w-3.5"}),"Copy"]}),s&&jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:s,title:"Share",children:jsx(Share,{className:"h-3.5 w-3.5"})}),i&&jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:i,title:"Edit",children:jsx(Edit,{className:"h-3.5 w-3.5"})}),jsx("div",{className:"mx-1 h-3 w-px bg-gray-200 dark:bg-white/10"}),jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:n,title:"Regenerate",children:jsx(RefreshCw,{className:"h-3.5 w-3.5"})}),jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:()=>a?.("up"),title:"Helpful",children:jsx(ThumbsUp,{className:"h-3.5 w-3.5"})}),jsx(R,{variant:"ghost",size:"icon",className:"h-7 w-7 text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",onClick:()=>a?.("down"),title:"Not helpful",children:jsx(ThumbsDown,{className:"h-3.5 w-3.5"})})]})]})]}));hf.displayName="AIResponse";function p4({children:e,className:t,...r}){return jsx("div",{className:l("flex h-[800px] w-full overflow-hidden rounded-3xl border border-gray-200 dark:border-white/10 bg-white dark:bg-black/40 backdrop-blur-xl shadow-2xl",t),...r,children:e})}function k4({conversations:e,activeId:t,onSelect:r,onNewChat:o,onSearch:n,onArchive:a,onPin:s,onMute:i,onDelete:c,filter:d="all",sortBy:m="recent",hideHeader:u=false,className:f,...g}){let[x,v]=useState(""),h=useMemo(()=>e.filter(b=>(b.user?.name||b.group?.name||"").toLowerCase().includes(x.toLowerCase())),[e,x]),p=b=>{let w=b.target.value;v(w),n?.(w);};return jsxs("div",{className:l("flex flex-col border-r border-gray-200 dark:border-white/10 bg-gray-50/50 dark:bg-white/[0.02]",!f?.includes("w-")&&"w-80",f),...g,children:[!u&&jsxs("div",{className:"p-4 space-y-4",children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Messages"}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",title:"Filter",children:jsx(Filter,{className:"h-4 w-4"})}),jsx("button",{onClick:o,className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",title:"New Chat",children:jsx(Plus,{className:"h-5 w-5"})})]})]}),jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),jsx("input",{type:"text",value:x,onChange:p,placeholder:"Search messages...",className:"w-full h-10 pl-9 pr-4 rounded-2xl bg-white dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all placeholder:text-gray-400 dark:text-white"})]})]}),jsx("div",{className:"flex-1 overflow-y-auto [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-white/10 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-white/20 [&::-webkit-scrollbar-track]:bg-transparent",children:jsx("div",{className:"flex flex-col",children:h.map(b=>{let w=b.user?.name||b.group?.name||"Unknown",k=b.user?.avatar||b.group?.avatar,y=b.user?.status==="online",N=t===b.id;return jsx("div",{className:"p-2",children:jsxs("div",{onClick:()=>r?.(b.id),className:l("w-full h-16 flex items-center gap-3 p-3 rounded-2xl transition-all text-left group cursor-pointer",N?"bg-blue-500/10 dark:bg-white/[0.06] shadow-[0_0_15px_rgba(59,130,246,0.1)] dark:shadow-[0_0_15px_rgba(255,255,255,0.05)]":"hover:bg-gray-100 dark:hover:bg-white/[0.03]"),children:[jsxs("div",{className:"relative flex-shrink-0",children:[jsx(z,{src:k,alt:w,fallback:w[0]}),y&&jsx("div",{className:"absolute -bottom-0.5 -right-0.5 w-3.5 h-3.5 bg-green-500 border-2 border-white dark:border-[#0a0a0a] rounded-full"})]}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[jsx("span",{className:l("font-semibold truncate",N?"text-blue-600 dark:text-white":"text-gray-900 dark:text-white/90"),children:w}),b.lastMessage&&jsx("span",{className:"text-[10px] text-gray-400 dark:text-white/30 whitespace-nowrap",children:new Date(b.lastMessage.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsx("p",{className:"text-xs text-gray-500 dark:text-white/40 truncate",children:b.isTyping?jsx("span",{className:"text-blue-500 animate-pulse",children:"typing..."}):b.lastMessage?.content||"No messages yet"}),b.unreadCount>0&&jsx("span",{className:"flex-shrink-0 min-w-[18px] h-[18px] flex items-center justify-center bg-blue-500 text-white text-[10px] font-bold rounded-full px-1",children:b.unreadCount})]})]}),jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",onClick:C=>C.stopPropagation(),children:jsxs(rt,{children:[jsx(ot,{className:"p-1 rounded-lg hover:bg-gray-200 dark:hover:bg-white/10 text-gray-400",children:jsx(MoreVertical,{className:"h-4 w-4"})}),jsxs(at,{align:"end",children:[jsxs(K,{onClick:()=>s?.(b.id),children:[jsx(Pin,{className:"h-4 w-4 mr-2"})," Pin"]}),jsxs(K,{onClick:()=>a?.(b.id),children:[jsx(Archive,{className:"h-4 w-4 mr-2"})," Archive"]}),jsxs(K,{onClick:()=>i?.(b.id),children:[jsx(BellOff,{className:"h-4 w-4 mr-2"})," Mute"]}),jsxs(K,{className:"text-red-500",onClick:()=>c?.(b.id),children:[jsx(Trash2,{className:"h-4 w-4 mr-2"})," Delete"]})]})]})})]})},b.id)})})})]})}function L4({user:e,onBack:t,onInfo:r,onCall:o,onVideoCall:n,onSearch:a,onMute:s,isTyping:i,isMuted:c,actions:d,className:m,...u}){return jsxs("div",{className:l("flex h-16 items-center justify-between border-b border-gray-200 dark:border-white/10 bg-white/80 dark:bg-black/40 backdrop-blur px-4 sticky top-0 z-10",m),...u,children:[jsxs("div",{className:"flex items-center gap-3",children:[t&&jsx("button",{onClick:t,className:"md:hidden p-2 -ml-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06]",children:jsx(ArrowLeft,{className:"h-5 w-5 text-gray-600 dark:text-white/70"})}),jsxs("div",{className:"relative cursor-pointer",onClick:r,children:[jsx(z,{src:e.avatar,alt:e.name,fallback:e.name[0]}),e.status==="online"&&jsx("span",{className:"absolute bottom-0 right-0 h-3 w-3 rounded-full bg-green-500 border-2 border-white dark:border-black"})]}),jsxs("div",{className:"cursor-pointer",onClick:r,children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("h3",{className:"font-semibold text-gray-900 dark:text-white leading-none",children:e.name}),c&&jsx(BellOff,{className:"h-3 w-3 text-gray-400"})]}),jsx("p",{className:l("text-xs mt-1 transition-colors",i?"text-blue-500 font-medium animate-pulse":"text-gray-500 dark:text-white/50"),children:i?"typing...":e.status==="online"?"Online":`Last seen ${e.lastSeen?.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`})]})]}),jsxs("div",{className:"flex items-center gap-1",children:[a&&jsx("button",{onClick:a,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(Search,{className:"h-5 w-5"})}),jsx("button",{onClick:o,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(Phone,{className:"h-5 w-5"})}),jsx("button",{onClick:n,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(Video,{className:"h-5 w-5"})}),d,jsx("button",{onClick:r,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(MoreVertical,{className:"h-5 w-5"})})]})]})}function Ws({src:e,duration:t,isMe:r,className:o,...n}){let[a,s]=useState(false),[i,c]=useState(0),[d,m]=useState(false),u=useRef(null),f=()=>{u.current&&(a?u.current.pause():u.current.play(),s(!a));},g=()=>{u.current&&c(u.current.currentTime);},x=()=>{s(false),c(0);},v=p=>{let b=Math.floor(p/60),w=Math.floor(p%60);return `${b}:${w.toString().padStart(2,"0")}`},h=t?i/t*100:0;return jsxs("div",{className:l("flex items-center gap-3 p-2 rounded-2xl min-w-[200px]",r?"bg-white/10":"bg-gray-100 dark:bg-white/[0.03]",o),...n,children:[jsx("audio",{ref:u,src:e,onTimeUpdate:g,onEnded:x}),jsx("button",{onClick:f,className:l("w-10 h-10 rounded-full flex items-center justify-center transition-all",r?"bg-white text-blue-600":"bg-blue-500 text-white"),children:a?jsx(Pause,{className:"h-5 w-5 fill-current"}):jsx(Play,{className:"h-5 w-5 fill-current ml-0.5"})}),jsxs("div",{className:"flex-1 space-y-1",children:[jsx("div",{className:"h-1.5 w-full bg-gray-300 dark:bg-white/10 rounded-full overflow-hidden",children:jsx("div",{className:l("h-full transition-all duration-100",r?"bg-white":"bg-blue-500"),style:{width:`${h}%`}})}),jsxs("div",{className:"flex justify-between text-[10px] font-medium opacity-60",children:[jsx("span",{children:v(i)}),jsx("span",{children:t?v(t):"--:--"})]})]}),jsx("button",{onClick:()=>m(!d),className:"p-1.5 rounded-full hover:bg-black/5 dark:hover:bg-white/5 opacity-60",children:d?jsx(VolumeX,{className:"h-4 w-4"}):jsx(Volume2,{className:"h-4 w-4"})})]})}function _s({status:e,className:t,...r}){return e==="sending"?jsx("div",{className:l("w-3 h-3 border border-current border-t-transparent rounded-full animate-spin opacity-50",t),...r}):e==="failed"?jsx("span",{className:l("text-red-500 text-[10px] font-bold",t),...r,children:"!"}):jsxs("div",{className:l("flex items-center",t),...r,children:[e==="sent"&&jsx(Check,{className:"h-3 w-3 opacity-50"}),e==="delivered"&&jsx(CheckCheck,{className:"h-3 w-3 opacity-50"}),e==="read"&&jsx(CheckCheck,{className:"h-3 w-3 text-blue-500"})]})}function Xs({url:e,title:t,description:r,image:o,siteName:n,className:a,...s}){return jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:l("block overflow-hidden rounded-xl border border-gray-200 dark:border-white/10 bg-white dark:bg-white/[0.03] hover:bg-gray-50 dark:hover:bg-white/[0.05] transition-all group",a),...s,children:[o&&jsx("div",{className:"aspect-video w-full overflow-hidden border-b border-gray-200 dark:border-white/10",children:jsx("img",{src:o,alt:t,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"})}),jsxs("div",{className:"p-3 space-y-1",children:[n&&jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-blue-500",children:n}),jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white line-clamp-1",children:t||e}),r&&jsx("p",{className:"text-xs text-gray-500 dark:text-white/50 line-clamp-2",children:r}),jsxs("div",{className:"flex items-center gap-1 text-[10px] text-gray-400 pt-1",children:[jsx(ExternalLink,{className:"h-3 w-3"}),jsx("span",{className:"truncate",children:new URL(e).hostname})]})]})]})}function qs({data:e,isOwn:t,onAction:r}){return jsxs("div",{className:"space-y-2 max-w-sm",children:[(()=>{if(!e.header)return null;switch(e.header.type){case "text":return jsx("h4",{className:"font-bold mb-1 text-sm",children:e.header.text});case "image":return jsx("div",{className:"mb-2 rounded-lg overflow-hidden border border-white/10",children:jsx("img",{src:e.header.attachment?.url,alt:"Header",className:"w-full h-auto object-cover"})});default:return null}})(),jsx("p",{className:"text-sm leading-relaxed",children:e.body}),e.footer&&jsx("p",{className:"text-[10px] opacity-50 italic",children:e.footer}),e.type==="button"&&e.buttons&&jsx("div",{className:"flex flex-col gap-1 mt-3",children:e.buttons.map(n=>jsxs("button",{onClick:()=>r?.(n),className:l("flex items-center justify-center gap-2 p-2.5 rounded-xl text-sm font-medium transition-all","bg-white/10 hover:bg-white/20 border border-white/10 active:scale-[0.98]",t?"text-white":"text-blue-500 dark:text-blue-400"),children:[n.type==="url"&&jsx(ExternalLink,{className:"h-3.5 w-3.5"}),n.type==="call"&&jsx(Phone,{className:"h-3.5 w-3.5"}),n.type==="reply"&&jsx(Reply,{className:"h-3.5 w-3.5"}),n.text]},n.id))}),e.type==="list"&&e.sections&&jsx("div",{className:"mt-3 space-y-3",children:e.sections.map((n,a)=>jsxs("div",{className:"space-y-1",children:[n.title&&jsx("p",{className:"text-[10px] uppercase tracking-wider opacity-40 font-bold px-1",children:n.title}),jsx("div",{className:"flex flex-col gap-1",children:n.rows.map(s=>jsxs("button",{onClick:()=>r?.({id:s.id,text:s.title,type:"reply"}),className:"flex flex-col items-start p-3 rounded-xl bg-white/5 hover:bg-white/10 border border-white/5 transition-colors text-left",children:[jsx("span",{className:"text-sm font-medium",children:s.title}),s.description&&jsx("span",{className:"text-xs opacity-50 line-clamp-1",children:s.description})]},s.id))})]},a))})]})}function Gs({cards:e,isOwn:t,onAction:r}){let o=we__default.useRef(null),n=a=>{o.current&&o.current.scrollBy({left:a==="left"?-240:240,behavior:"smooth"});};return jsxs("div",{className:"relative group/carousel max-w-[300px] sm:max-w-[400px]",children:[jsx("div",{ref:o,className:"flex gap-3 overflow-x-auto scrollbar-hide snap-x snap-mandatory pb-2",children:e.map((a,s)=>jsxs("div",{className:"flex-shrink-0 w-[240px] snap-start rounded-2xl bg-white/5 dark:bg-white/[0.03] border border-white/10 overflow-hidden flex flex-col",children:[a.header?.attachment&&jsx("div",{className:"aspect-video w-full overflow-hidden",children:jsx("img",{src:a.header.attachment.url,alt:"Card",className:"w-full h-full object-cover"})}),jsxs("div",{className:"p-3 flex-1 flex flex-col",children:[jsx("p",{className:"text-sm leading-relaxed mb-1",children:a.body}),a.footer&&jsx("p",{className:"text-[10px] opacity-50 italic mb-3",children:a.footer}),jsx("div",{className:"mt-auto flex flex-col gap-1",children:a.buttons.map(i=>jsxs("button",{onClick:()=>r?.(i),className:l("flex items-center justify-center gap-2 p-2 rounded-lg text-xs font-medium transition-all","bg-white/10 hover:bg-white/20 border border-white/10",t?"text-white":"text-blue-500 dark:text-blue-400"),children:[i.type==="url"&&jsx(ExternalLink,{className:"h-3 w-3"}),i.type==="call"&&jsx(Phone,{className:"h-3 w-3"}),i.type==="reply"&&jsx(Reply,{className:"h-3 w-3"}),i.text]},i.id))})]})]},s))}),e.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:()=>n("left"),className:"absolute left-[-12px] top-1/2 -translate-y-1/2 p-1.5 rounded-full bg-white dark:bg-gray-800 shadow-lg border border-white/10 opacity-0 group-hover/carousel:opacity-100 transition-opacity z-10",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx("button",{onClick:()=>n("right"),className:"absolute right-[-12px] top-1/2 -translate-y-1/2 p-1.5 rounded-full bg-white dark:bg-gray-800 shadow-lg border border-white/10 opacity-0 group-hover/carousel:opacity-100 transition-opacity z-10",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})}function Js({message:e,isOwn:t,showAvatar:r,showStatus:o=true,className:n,onReply:a,onReact:s,onDelete:i,onEdit:c,onForward:d,onCopy:m,onPin:u,onSelect:f,isSelected:g}){let x=()=>!t||!o?null:jsx(_s,{status:e.status||"sent",className:"ml-1"}),v=()=>{if(e.type==="revoked")return jsxs("p",{className:"text-sm italic opacity-50 flex items-center gap-2",children:[jsx(Trash2,{className:"h-3 w-3"})," This message was deleted"]});switch(e.type){case "audio":return jsx(Ws,{src:e.attachments?.[0]?.url||"",duration:e.attachments?.[0]?.duration,isMe:t});case "location":return jsxs("div",{className:"space-y-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(MapPin,{className:"h-4 w-4"}),jsx("span",{className:"text-sm font-medium",children:e.location?.address||"Shared Location"})]}),jsxs("div",{className:"aspect-video rounded-xl bg-gray-200 dark:bg-white/10 flex items-center justify-center overflow-hidden relative group/map",children:[jsx(MapPin,{className:"h-8 w-8 opacity-20 group-hover/map:scale-110 transition-transform"}),jsx("div",{className:"absolute inset-0 bg-blue-500/5 group-hover/map:bg-blue-500/10 transition-colors"})]})]});case "contact":return jsxs("div",{className:"flex items-center gap-3 p-2 rounded-xl bg-black/5 dark:bg-white/10 border border-white/5",children:[jsx("div",{className:"w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center text-white shadow-lg shadow-blue-500/20",children:jsx(User,{className:"h-5 w-5"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"text-sm font-bold truncate",children:e.contact?.name}),jsx("p",{className:"text-xs opacity-60 truncate",children:e.contact?.phone})]})]});case "file":return jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-black/5 dark:bg-white/10 border border-white/5 hover:bg-black/10 dark:hover:bg-white/20 transition-colors cursor-pointer",children:[jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-500/20 flex items-center justify-center text-blue-500",children:jsx(FileText,{className:"h-6 w-6"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"text-sm font-medium truncate",children:e.attachments?.[0]?.name||"File"}),jsx("p",{className:"text-[10px] opacity-60 uppercase",children:e.attachments?.[0]?.size||"Unknown size"})]})]});case "sticker":return jsx("div",{className:"relative group/sticker",children:jsx("img",{src:e.attachments?.[0]?.url,alt:"Sticker",className:"w-32 h-32 object-contain"})});case "image":return jsxs("div",{className:"space-y-2",children:[jsx("div",{className:"relative rounded-2xl overflow-hidden border border-white/5 group/image",children:jsx(qo,{src:e.attachments?.[0]?.url||"",alt:e.content||"Image",className:"max-h-[300px] w-auto object-contain bg-black/20"})}),e.content&&jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words px-1",children:e.content})]});case "video":return jsxs("div",{className:"space-y-2",children:[jsx("div",{className:"relative rounded-2xl overflow-hidden border border-white/5 bg-black/20 aspect-video flex items-center justify-center group/video",children:jsx("video",{src:e.attachments?.[0]?.url,controls:true,className:"max-h-[300px] w-full"})}),e.content&&jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words px-1",children:e.content})]});case "interactive":return e.interactive?.type==="carousel"&&e.interactive.cards?jsx(Gs,{cards:e.interactive.cards,isOwn:t}):e.interactive?jsx(qs,{data:e.interactive,isOwn:t}):null;default:let h=/(https?:\/\/[^\s]+)/g,p=e.content.match(h);return jsxs("div",{className:"space-y-2",children:[e.replyTo&&jsxs("div",{className:"mb-2 p-2 rounded-lg bg-black/5 dark:bg-white/5 border-l-4 border-blue-500 text-xs",children:[jsx("p",{className:"font-bold text-blue-500 truncate",children:e.replyTo.senderId===e.senderId?"You":"Other"}),jsx("p",{className:"opacity-60 truncate",children:e.replyTo.content})]}),jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words",children:e.content}),p&&p.map(b=>jsx(Xs,{url:b},b))]})}};return jsxs("div",{className:l("flex w-full mb-4 group/bubble",t?"justify-end":"justify-start",n),children:[!t&&r&&jsx("div",{className:"mr-2 mt-auto",children:jsx(z,{src:e.contact?.avatar,alt:e.contact?.name||"User",className:"w-8 h-8",fallback:(e.contact?.name||e.senderId||"?").charAt(0).toUpperCase()})}),jsxs("div",{className:l("relative max-w-[75%] sm:max-w-[60%] transition-all duration-300",g&&"scale-95 opacity-80"),children:[jsx(Hn,{preset:"spring",children:jsxs("div",{className:l("relative p-3 rounded-2xl shadow-sm backdrop-blur-md border",t?"bg-blue-600/90 dark:bg-blue-500/20 text-white border-blue-500/20 rounded-tr-none":"bg-white/80 dark:bg-white/[0.05] text-gray-900 dark:text-white border-white/10 rounded-tl-none","hover:shadow-lg hover:shadow-blue-500/5 transition-shadow"),children:[!t&&e.remoteJid?.endsWith("@g.us")&&e.contact?.name&&jsx("p",{className:"text-[11px] font-bold text-blue-500 dark:text-blue-400 mb-1 truncate",children:e.contact.name}),v(),jsxs("div",{className:"flex items-center justify-end gap-1 mt-1 opacity-60 text-[10px]",children:[jsx("span",{children:new Date(e.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),x()]}),e.reactions&&Object.keys(e.reactions).length>0&&jsx("div",{className:"absolute -bottom-3 right-2 flex -space-x-1",children:Object.entries(e.reactions).map(([h,p])=>jsx("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-white/10 rounded-full px-1.5 py-0.5 text-xs shadow-sm animate-in zoom-in-50",title:p.join(", "),children:h},h))})]})}),jsxs("div",{className:l("absolute top-0 opacity-0 group-hover/bubble:opacity-100 transition-opacity flex items-center gap-1",t?"right-full mr-2":"left-full ml-2"),children:[jsxs(rt,{children:[jsx(ot,{className:"p-1.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/10 text-gray-400 transition-colors",children:jsx(Smile,{className:"h-4 w-4"})}),jsx(at,{side:"top",className:"flex gap-1 p-1",children:["\u{1F44D}","\u2764\uFE0F","\u{1F602}","\u{1F62E}","\u{1F622}","\u{1F64F}"].map(h=>jsx("button",{onClick:()=>s?.(h),className:"p-1.5 hover:bg-gray-100 dark:hover:bg-white/10 rounded-lg transition-transform hover:scale-125",children:h},h))})]}),jsxs(rt,{children:[jsx(ot,{className:"p-1.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/10 text-gray-400 transition-colors",children:jsx(MoreHorizontal,{className:"h-4 w-4"})}),jsxs(at,{align:t?"end":"start",children:[jsxs(K,{onClick:a,children:[jsx(Reply,{className:"h-4 w-4 mr-2"})," Reply"]}),jsxs(K,{onClick:m,children:[jsx(Copy,{className:"h-4 w-4 mr-2"})," Copy"]}),jsxs(K,{onClick:d,children:[jsx(Forward,{className:"h-4 w-4 mr-2"})," Forward"]}),jsxs(K,{onClick:u,children:[jsx(Pin,{className:"h-4 w-4 mr-2"})," Pin"]}),t&&jsxs(Fragment,{children:[jsxs(K,{onClick:c,children:[jsx(Edit2,{className:"h-4 w-4 mr-2"})," Edit"]}),jsxs(K,{className:"text-red-500",onClick:i,children:[jsx(Trash2,{className:"h-4 w-4 mr-2"})," Delete"]})]})]})]})]})]})]})}function TL({messages:e,currentUserId:t,className:r,onReply:o,onReact:n,onDelete:a,onEdit:s,onForward:i,onCopy:c,onPin:d,onSelect:m,onLoadMore:u,hasMore:f,isLoadingMore:g,selectedMessages:x=[],dateFormat:v="MMMM d, yyyy",groupByDate:h=true,...p}){let[b,w]=useState(true),k=useRef(null),y=useRef(null),N=useCallback((T="auto")=>{y.current?.scrollIntoView({behavior:T});},[]);useEffect(()=>{b&&N("smooth");},[e.length,b,N]);let C=T=>{let L=T.currentTarget,I=Math.abs(L.scrollHeight-L.clientHeight-L.scrollTop)<100;w(I),L.scrollTop===0&&f&&!g&&u&&u();};return e.length===0&&!g?jsx("div",{className:l("flex-1 flex items-center justify-center p-8 text-center text-gray-500 dark:text-white/40",r),...p,children:jsxs("div",{className:"max-w-sm space-y-4",children:[jsx("div",{className:"w-24 h-24 bg-blue-500/10 dark:bg-white/[0.03] rounded-full flex items-center justify-center mx-auto mb-6 animate-pulse",children:jsx(MessageSquare,{className:"h-12 w-12 text-blue-500"})}),jsx("h3",{className:"text-xl font-medium text-gray-900 dark:text-white",children:"No messages yet"}),jsx("p",{children:"Start the conversation by sending a message below."})]})}):jsxs("div",{className:l("flex-1 relative overflow-hidden",r),...p,children:[jsx("div",{ref:k,onScroll:C,className:"h-full overflow-y-auto p-4 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-white/10 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-white/20 [&::-webkit-scrollbar-track]:bg-transparent",children:jsxs("div",{className:"flex flex-col gap-4",children:[e.map((T,L)=>{let I=T.senderId===t,P=L>0?e[L-1]:null,D=!I&&(!P||P.senderId!==T.senderId);return jsx(Js,{message:T,isOwn:I,showAvatar:D,onReply:()=>o?.(T),onReact:V=>n?.(T,V),onDelete:()=>a?.(T),onEdit:()=>s?.(T),onForward:()=>i?.(T),onCopy:()=>c?.(T),onPin:()=>d?.(T),onSelect:()=>m?.(T),isSelected:x.includes(T.id)},T.id)}),jsx("div",{ref:y})]})}),!b&&jsx("button",{onClick:()=>N("smooth"),className:"absolute bottom-6 right-6 p-3 rounded-full bg-white dark:bg-white/10 backdrop-blur border border-gray-200 dark:border-white/10 shadow-lg text-gray-600 dark:text-white hover:scale-110 transition-all z-10",children:jsx(ArrowDown,{className:"h-5 w-5"})})]})}function IL({value:e,onValueChange:t,onSend:r,onChange:o,onAttach:n,onMic:a,onEmoji:s,onGif:i,onLocation:c,onContact:d,onPoll:m,onPix:u,onCarousel:f,onButtons:g,onList:x,onCancelReply:v,placeholder:h="Type a message...",users:p=[],replyingTo:b,isRecording:w,maxLength:k,disabled:y,className:N,...C}){let[T,L]=useState(""),I=e!==void 0?e:T,P=E=>{t?t(E):L(E);},[D,V]=useState(false),[A,M]=useState(null),[J,ae]=useState(0),F=useRef(null),de=useMemo(()=>A===null?[]:p.filter(E=>E.name.toLowerCase().includes(A.toLowerCase())).slice(0,5),[p,A]),At=E=>{if(y)return;let H=E.target.value;if(k&&H.length>k)return;P(H),o?.(H);H[E.target.selectionStart-1];let te=H.slice(0,E.target.selectionStart).match(/@(\w*)$/);te?(M(te[1]||""),ae(0)):M(null),F.current&&(F.current.style.height="auto",F.current.style.height=`${Math.min(F.current.scrollHeight,120)}px`);},nt=E=>{if(!F.current)return;let H=F.current.selectionStart,ee=I.slice(0,H).replace(/@\w*$/,`@${E.name} `),O=I.slice(H);P(ee+O),M(null),F.current.focus();},Mo=E=>{if(!y){if(A!==null&&de.length>0){E.key==="ArrowDown"?(E.preventDefault(),ae(H=>(H+1)%de.length)):E.key==="ArrowUp"?(E.preventDefault(),ae(H=>(H-1+de.length)%de.length)):E.key==="Enter"||E.key==="Tab"?(E.preventDefault(),nt(de[J])):E.key==="Escape"&&M(null);return}E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),U());}},U=()=>{y||!I.trim()&&!w||(r?.(I),P(""),F.current&&(F.current.style.height="auto"));};return jsxs("div",{className:l("p-4 bg-white/80 dark:bg-black/40 backdrop-blur border-t border-gray-200 dark:border-white/10 relative",N),...C,children:[A!==null&&de.length>0&&jsx("div",{className:"absolute bottom-full left-4 mb-2 w-64 bg-white dark:bg-gray-900 border border-gray-200 dark:border-white/10 rounded-2xl shadow-2xl overflow-hidden animate-in slide-in-from-bottom-4",children:de.map((E,H)=>jsxs("button",{onClick:()=>nt(E),className:l("w-full flex items-center gap-3 p-3 text-left transition-colors",H===J?"bg-blue-500/10 dark:bg-white/10":"hover:bg-gray-50 dark:hover:bg-white/5"),children:[jsx(z,{src:E.avatar,alt:E.name,className:"w-8 h-8"}),jsxs("div",{children:[jsx("p",{className:"text-sm font-bold dark:text-white",children:E.name}),jsxs("p",{className:"text-xs text-gray-500 dark:text-white/40",children:["@",E.name.toLowerCase().replace(/\s/g,"")]})]})]},E.id))}),b&&jsxs("div",{className:"mb-3 flex items-center justify-between p-3 rounded-2xl bg-blue-500/5 border-l-4 border-blue-500 animate-in slide-in-from-bottom-2",children:[jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"text-xs font-bold text-blue-500",children:"Replying to"}),jsx("p",{className:"text-sm text-gray-600 dark:text-white/60 truncate",children:b.content})]}),jsx("button",{onClick:v,className:"p-1.5 rounded-full hover:bg-gray-200 dark:hover:bg-white/10 text-gray-400",children:jsx(X,{className:"h-4 w-4"})})]}),jsxs("div",{className:"flex items-end gap-2",children:[jsxs("div",{className:"flex items-center gap-1 mb-1",children:[jsxs(rt,{children:[jsx(ot,{disabled:y,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50 transition-colors disabled:opacity-50",children:jsx(Paperclip,{className:"h-5 w-5"})}),jsxs(at,{align:"start",side:"top",children:[jsxs(K,{onClick:n,children:[jsx(Image,{className:"h-4 w-4 mr-2"})," Image & Video"]}),jsxs(K,{onClick:n,children:[jsx(Paperclip,{className:"h-4 w-4 mr-2"})," Document"]}),jsxs(K,{onClick:c,children:[jsx(MapPin,{className:"h-4 w-4 mr-2"})," Location"]}),jsxs(K,{onClick:d,children:[jsx(AtSign,{className:"h-4 w-4 mr-2"})," Contact"]}),jsxs(K,{onClick:m,children:[jsx(AtSign,{className:"h-4 w-4 mr-2"})," Poll"]}),jsxs(K,{onClick:u,children:[jsx(AtSign,{className:"h-4 w-4 mr-2"})," PIX"]}),jsxs(K,{onClick:f,children:[jsx(Layout,{className:"h-4 w-4 mr-2"})," Carousel"]}),jsxs(K,{onClick:g,children:[jsx(Layout,{className:"h-4 w-4 mr-2"})," Buttons"]}),jsxs(K,{onClick:x,children:[jsx(List,{className:"h-4 w-4 mr-2"})," List Menu"]}),jsxs(K,{onClick:i,children:[jsx(Gift,{className:"h-4 w-4 mr-2"})," GIF"]})]})]}),jsx("button",{onClick:s,disabled:y,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50 transition-colors disabled:opacity-50",children:jsx(Smile,{className:"h-5 w-5"})})]}),jsx("div",{className:"flex-1 relative",children:w?jsxs("div",{className:"h-10 flex items-center px-4 bg-red-500/10 rounded-2xl border border-red-500/20 animate-pulse",children:[jsx("div",{className:"w-2 h-2 bg-red-500 rounded-full mr-3 animate-ping"}),jsx("span",{className:"text-sm font-medium text-red-500",children:"Recording Audio..."})]}):jsx("textarea",{ref:F,value:I,onChange:At,onKeyDown:Mo,placeholder:h,disabled:y,rows:1,className:"w-full p-2.5 max-h-[120px] rounded-2xl bg-gray-100 dark:bg-white/[0.03] border border-transparent focus:border-blue-500/50 focus:bg-white dark:focus:bg-white/[0.06] text-sm resize-none transition-all outline-none dark:text-white placeholder:text-gray-400"})}),jsx("div",{className:"flex items-center gap-1 mb-1",children:I.trim()||w?jsx("button",{onClick:U,disabled:y,className:"p-2.5 rounded-full bg-blue-500 text-white hover:bg-blue-600 shadow-lg shadow-blue-500/20 transition-all active:scale-90",children:jsx(Send,{className:"h-5 w-5"})}):jsx("button",{onClick:a,disabled:y,className:"p-2.5 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-500 dark:text-white/50 transition-colors disabled:opacity-50",children:jsx(Mic,{className:"h-5 w-5"})})})]})]})}function YL({user:e,onClose:t,className:r,...o}){return jsxs("div",{className:l("w-80 border-l border-gray-200 dark:border-white/10 bg-white dark:bg-black/20 flex flex-col",r),...o,children:[jsxs("div",{className:"h-16 flex items-center px-4 border-b border-gray-200 dark:border-white/10",children:[jsx("button",{onClick:t,className:"p-2 -ml-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06]",children:jsx(X,{className:"h-5 w-5 text-gray-500"})}),jsx("span",{className:"ml-2 font-semibold text-gray-900 dark:text-white",children:"Contact Info"})]}),jsxs(st,{className:"flex-1",children:[jsxs("div",{className:"p-6 flex flex-col items-center text-center",children:[jsx(z,{src:e.avatar,alt:e.name,fallback:e.name[0],className:"h-24 w-24 mb-4 text-2xl"}),jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:e.name}),jsx("p",{className:"text-sm text-gray-500 dark:text-white/50 mt-1",children:e.phone||"+1 (555) 000-0000"}),jsxs("div",{className:"mt-6 w-full",children:[jsx("p",{className:"text-sm text-gray-500 dark:text-white/50 mb-1 text-left",children:"About"}),jsx("p",{className:"text-sm text-gray-900 dark:text-white text-left",children:e.bio||"Hey there! I am using Pixon Chat."})]})]}),jsx(Sr,{}),jsxs("div",{className:"p-4 space-y-4",children:[jsx("h3",{className:"text-xs font-semibold text-gray-500 dark:text-white/40 uppercase tracking-wider",children:"Media & Docs"}),jsx("div",{className:"grid grid-cols-3 gap-2",children:[1,2,3,4,5,6].map(n=>jsxs("div",{className:"aspect-square rounded-2xl bg-gray-100 dark:bg-white/[0.03] overflow-hidden relative group cursor-pointer",children:[jsx("div",{className:"absolute inset-0 flex items-center justify-center text-gray-400",children:jsx(Image,{className:"h-6 w-6"})}),jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity"})]},n))})]}),jsx(Sr,{}),jsx("div",{className:"p-4 space-y-4",children:jsxs("div",{className:"flex items-center justify-between",children:[jsxs("div",{className:"flex items-center gap-3 text-gray-700 dark:text-white/80",children:[jsx(Bell,{className:"h-5 w-5"}),jsx("span",{className:"text-sm font-medium",children:"Mute Notifications"})]}),jsx(Eo,{})]})}),jsx(Sr,{}),jsxs("div",{className:"p-4 space-y-2",children:[jsxs("button",{className:"w-full flex items-center gap-3 p-3 rounded-2xl hover:bg-red-50 dark:hover:bg-red-500/10 text-red-600 dark:text-red-400 transition-colors text-sm font-medium",children:[jsx(Ban,{className:"h-5 w-5"}),"Block ",e.name]}),jsxs("button",{className:"w-full flex items-center gap-3 p-3 rounded-2xl hover:bg-red-50 dark:hover:bg-red-500/10 text-red-600 dark:text-red-400 transition-colors text-sm font-medium",children:[jsx(Trash2,{className:"h-5 w-5"}),"Delete Chat"]})]})]})]})}function GL({users:e=[],variant:t="default",className:r,...o}){let n=e.length===0?"Someone is typing":e.length===1?`${e[0]} is typing`:e.length===2?`${e[0]} and ${e[1]} are typing`:`${e[0]} and ${e.length-1} others are typing`;return t==="bubble"?jsx("div",{className:l("flex items-center gap-1 px-3 py-2 rounded-2xl bg-gray-100 dark:bg-white/[0.03] w-fit",r),...o,children:jsxs("div",{className:"flex gap-1",children:[jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 animate-bounce [animation-delay:-0.3s]"}),jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 animate-bounce [animation-delay:-0.15s]"}),jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-400 animate-bounce"})]})}):jsxs("div",{className:l("flex items-center gap-2 text-xs text-gray-500 dark:text-white/40 italic",r),...o,children:[jsxs("div",{className:"flex gap-0.5",children:[jsx("span",{className:"w-1 h-1 rounded-full bg-current animate-bounce [animation-delay:-0.3s]"}),jsx("span",{className:"w-1 h-1 rounded-full bg-current animate-bounce [animation-delay:-0.15s]"}),jsx("span",{className:"w-1 h-1 rounded-full bg-current animate-bounce"})]}),n]})}function eP({message:e,onCancel:t,className:r,...o}){return jsxs("div",{className:l("flex items-center gap-3 p-2 rounded-xl bg-blue-500/5 border-l-4 border-blue-500 animate-in slide-in-from-bottom-2",r),...o,children:[jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/10 text-blue-500",children:jsx(Reply,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"text-xs font-bold text-blue-500",children:"Replying to"}),jsx("p",{className:"text-sm text-gray-600 dark:text-white/60 truncate",children:e.content})]}),t&&jsx("button",{onClick:t,className:"p-1 rounded-full hover:bg-gray-200 dark:hover:bg-white/10 text-gray-400 transition-colors",children:jsx(X,{className:"h-4 w-4"})})]})}function nP({type:e="info",message:t,action:r,onClose:o,className:n,...a}){let s={info:Info,warning:AlertCircle,error:AlertCircle,success:CheckCircle2},i={info:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",warning:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",error:"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20",success:"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20"},c=s[e];return jsxs("div",{className:l("flex items-center gap-3 px-4 py-2 border-b text-sm animate-in slide-in-from-top duration-300",i[e],n),...a,children:[jsx(c,{className:"h-4 w-4 shrink-0"}),jsx("p",{className:"flex-1 font-medium",children:t}),r&&jsx("button",{onClick:r.onClick,className:"text-xs font-bold uppercase tracking-wider hover:underline",children:r.label}),o&&jsx("button",{onClick:o,className:"p-1 rounded-full hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:jsx(X,{className:"h-4 w-4"})})]})}function dP({date:e,className:t,...r}){return jsx("div",{className:l("flex justify-center sticky top-0 z-10 py-4",t),...r,children:jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-gray-100/80 dark:bg-white/5 backdrop-blur text-[10px] font-bold uppercase tracking-wider text-gray-500 dark:text-white/40 border border-gray-200 dark:border-white/10 shadow-sm",children:[jsx(Calendar,{className:"h-3 w-3"}),e]})})}function fP({status:e="offline",size:t="md",className:r,...o}){let n={online:"bg-green-500",offline:"bg-gray-400",away:"bg-amber-500",busy:"bg-red-500"},a={sm:"h-2 w-2",md:"h-3 w-3",lg:"h-4 w-4"};return jsx("span",{className:l("rounded-full border-2 border-white dark:border-black shrink-0",n[e],a[t],e==="online"&&"animate-pulse",r),...o})}function xP({content:e,className:t,...r}){return jsx("div",{className:l("flex justify-center py-2",t),...r,children:jsx("div",{className:"px-4 py-1 rounded-lg bg-gray-100/50 dark:bg-white/[0.02] text-[11px] font-medium text-gray-500 dark:text-white/30 border border-gray-200/50 dark:border-white/5",children:e})})}function CP({group:e,onBack:t,onInfo:r,isTyping:o,typingUsers:n=[],className:a,...s}){let i=n.length>0?`${n.join(", ")} ${n.length===1?"is":"are"} typing...`:"typing...";return jsxs("div",{className:l("flex h-16 items-center justify-between border-b border-gray-200 dark:border-white/10 bg-white/80 dark:bg-black/40 backdrop-blur px-4 sticky top-0 z-10",a),...s,children:[jsxs("div",{className:"flex items-center gap-3",children:[t&&jsx("button",{onClick:t,className:"md:hidden p-2 -ml-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06]",children:jsx(ArrowLeft,{className:"h-5 w-5 text-gray-600 dark:text-white/70"})}),jsx("div",{className:"relative cursor-pointer",onClick:r,children:jsxs("div",{className:"flex -space-x-3",children:[e.members.slice(0,2).map((c,d)=>jsx(z,{src:c.avatar,alt:c.name,fallback:c.name[0],className:l("border-2 border-white dark:border-black",d===0?"z-10":"z-0")},c.id)),e.members.length>2&&jsxs("div",{className:"w-10 h-10 rounded-full bg-gray-200 dark:bg-white/10 border-2 border-white dark:border-black flex items-center justify-center text-[10px] font-bold text-gray-600 dark:text-white/60 z-0",children:["+",e.members.length-2]})]})}),jsxs("div",{className:"cursor-pointer min-w-0",onClick:r,children:[jsx("h3",{className:"font-semibold text-gray-900 dark:text-white leading-none truncate",children:e.name}),jsx("p",{className:l("text-xs mt-1 truncate transition-colors",o?"text-blue-500 font-medium animate-pulse":"text-gray-500 dark:text-white/50"),children:o?i:`${e.members.length} members`})]})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(Phone,{className:"h-5 w-5"})}),jsx("button",{className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(Video,{className:"h-5 w-5"})}),jsx("button",{onClick:r,className:"p-2 rounded-full hover:bg-gray-100 dark:hover:bg-white/[0.06] text-gray-600 dark:text-white/60 transition-colors",children:jsx(MoreVertical,{className:"h-5 w-5"})})]})]})}function SP({users:e,selectedIndex:t,onSelect:r,className:o,...n}){return e.length===0?null:jsx(ne,{className:l("w-64 overflow-hidden shadow-xl animate-in fade-in slide-in-from-bottom-2",o),...n,children:jsxs("div",{className:"p-1",children:[jsx("div",{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-wider text-gray-400 border-b border-gray-200 dark:border-white/5 mb-1",children:"Mention someone"}),e.map((a,s)=>jsxs("button",{onClick:()=>r(a),className:l("w-full flex items-center gap-2 p-2 rounded-xl text-left transition-colors",s===t?"bg-blue-500 text-white":"hover:bg-gray-100 dark:hover:bg-white/[0.06]"),children:[jsx(z,{src:a.avatar,alt:a.name,fallback:a.name[0],size:"sm"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"text-sm font-medium truncate",children:a.name}),a.status&&jsx("p",{className:l("text-[10px]",s===t?"text-white/70":"text-gray-500"),children:a.status})]})]},a.id))]})})}var U0=[{name:"Smileys",emojis:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F602}","\u{1F923}","\u{1F60A}","\u{1F607}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60C}","\u{1F60D}","\u{1F970}","\u{1F618}","\u{1F617}","\u{1F619}","\u{1F61A}","\u{1F60B}","\u{1F61B}","\u{1F61D}","\u{1F61C}","\u{1F92A}","\u{1F928}","\u{1F9D0}","\u{1F913}","\u{1F60E}","\u{1F929}","\u{1F973}","\u{1F60F}","\u{1F612}","\u{1F61E}","\u{1F614}","\u{1F61F}","\u{1F615}","\u{1F641}","\u2639\uFE0F","\u{1F623}","\u{1F616}","\u{1F62B}","\u{1F629}","\u{1F97A}","\u{1F622}","\u{1F62D}","\u{1F624}","\u{1F620}","\u{1F621}","\u{1F92C}","\u{1F92F}","\u{1F633}","\u{1F975}","\u{1F976}","\u{1F631}","\u{1F628}","\u{1F630}","\u{1F625}","\u{1F613}","\u{1F917}","\u{1F914}","\u{1F92D}","\u{1F92B}","\u{1F925}","\u{1F636}","\u{1F610}","\u{1F611}","\u{1F62C}","\u{1F644}","\u{1F62F}","\u{1F626}","\u{1F627}","\u{1F62E}","\u{1F632}","\u{1F971}","\u{1F634}","\u{1F924}","\u{1F62A}","\u{1F635}","\u{1F910}","\u{1F974}","\u{1F922}","\u{1F92E}","\u{1F927}","\u{1F637}","\u{1F912}","\u{1F915}"]},{name:"Hearts",emojis:["\u2764\uFE0F","\u{1F9E1}","\u{1F49B}","\u{1F49A}","\u{1F499}","\u{1F49C}","\u{1F5A4}","\u{1F90D}","\u{1F90E}","\u{1F494}","\u2763\uFE0F","\u{1F495}","\u{1F49E}","\u{1F493}","\u{1F497}","\u{1F496}","\u{1F498}","\u{1F49D}","\u{1F49F}"]},{name:"Gestures",emojis:["\u{1F44D}","\u{1F44E}","\u{1F44C}","\u{1F90C}","\u{1F90F}","\u270C\uFE0F","\u{1F91E}","\u{1F91F}","\u{1F918}","\u{1F919}","\u{1F448}","\u{1F449}","\u{1F446}","\u{1F595}","\u{1F447}","\u261D\uFE0F","\u270A","\u{1F44A}","\u{1F91B}","\u{1F91C}","\u{1F44F}","\u{1F64C}","\u{1F450}","\u{1F932}","\u{1F91D}","\u{1F64F}","\u270D\uFE0F","\u{1F485}","\u{1F933}","\u{1F4AA}","\u{1F9BE}","\u{1F9B5}","\u{1F9BF}","\u{1F9B6}","\u{1F463}","\u{1F442}","\u{1F9BB}","\u{1F443}","\u{1F9E0}","\u{1FAC0}","\u{1FAC1}","\u{1F9B7}","\u{1F9B4}","\u{1F440}","\u{1F441}\uFE0F","\u{1F445}","\u{1F444}"]},{name:"Activities",emojis:["\u26BD","\u{1F3C0}","\u{1F3C8}","\u26BE","\u{1F94E}","\u{1F3BE}","\u{1F3D0}","\u{1F3C9}","\u{1F94F}","\u{1F3B1}","\u{1FA80}","\u{1F3D3}","\u{1F3F8}","\u{1F3D2}","\u{1F3D1}","\u{1F94D}","\u{1F3CF}","\u{1FA83}","\u{1F945}","\u26F3","\u{1FA81}","\u{1F3F9}","\u{1F3A3}","\u{1F93F}","\u{1F94A}","\u{1F94B}","\u{1F3BD}","\u{1F6F9}","\u{1F6FC}","\u{1F6F7}","\u26F8\uFE0F","\u{1F3BF}","\u26F7\uFE0F","\u{1F3C2}","\u{1FA82}","\u{1F3CB}\uFE0F","\u{1F93C}","\u{1F938}","\u26F9\uFE0F","\u{1F93A}","\u{1F93E}","\u{1F3CC}\uFE0F","\u{1F3C7}","\u{1F9D8}","\u{1F3C4}","\u{1F3CA}","\u{1F93D}","\u{1F6A3}","\u{1F9D7}","\u{1F6B5}","\u{1F6B4}"]},{name:"Nature",emojis:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\u{1F43B}\u200D\u2744\uFE0F","\u{1F428}","\u{1F42F}","\u{1F981}","\u{1F42E}","\u{1F437}","\u{1F43D}","\u{1F438}","\u{1F435}","\u{1F648}","\u{1F649}","\u{1F64A}","\u{1F412}","\u{1F414}","\u{1F427}","\u{1F426}","\u{1F424}","\u{1F423}","\u{1F425}","\u{1F986}","\u{1F985}","\u{1F989}","\u{1F987}","\u{1F43A}","\u{1F417}","\u{1F434}","\u{1F984}","\u{1F41D}","\u{1FAB1}","\u{1F41B}","\u{1F98B}","\u{1F40C}","\u{1F41E}","\u{1F41C}","\u{1F99F}","\u{1FAB0}","\u{1FAB2}","\u{1FAB3}","\u{1F997}","\u{1F577}\uFE0F","\u{1F578}\uFE0F","\u{1F982}","\u{1F422}","\u{1F40D}","\u{1F98E}","\u{1F996}","\u{1F995}","\u{1F419}","\u{1F991}","\u{1F990}","\u{1F99E}","\u{1F980}","\u{1F421}","\u{1F420}","\u{1F41F}","\u{1F42C}","\u{1F433}","\u{1F40B}","\u{1F988}","\u{1F40A}","\u{1F405}","\u{1F406}","\u{1F993}","\u{1F98D}","\u{1F9A7}","\u{1F9A3}","\u{1F418}","\u{1F99B}","\u{1F98F}","\u{1F42A}","\u{1F42B}","\u{1F992}","\u{1F998}","\u{1F9AC}","\u{1F403}","\u{1F402}","\u{1F404}","\u{1F40E}","\u{1F416}","\u{1F40F}","\u{1F411}","\u{1F410}","\u{1F98C}","\u{1F415}","\u{1F429}","\u{1F9AE}","\u{1F415}\u200D\u{1F9BA}","\u{1F408}","\u{1F408}\u200D\u2B1B","\u{1F413}","\u{1F983}","\u{1F99A}","\u{1F99C}","\u{1F9A2}","\u{1F9A9}","\u{1F54A}\uFE0F","\u{1F407}","\u{1F99D}","\u{1F9A8}","\u{1F9A1}","\u{1F9AB}","\u{1F9A6}","\u{1F9A5}","\u{1F401}","\u{1F400}","\u{1F43F}\uFE0F","\u{1F994}","\u{1F43E}","\u{1F409}","\u{1F432}","\u{1F335}","\u{1F384}","\u{1F332}","\u{1F333}","\u{1F334}","\u{1FAB5}","\u{1F331}","\u{1F33F}","\u2618\uFE0F","\u{1F340}","\u{1F38D}","\u{1FAB4}","\u{1F38B}","\u{1F343}","\u{1F342}","\u{1F341}","\u{1F344}","\u{1F41A}","\u{1FAA8}","\u{1F33E}","\u{1F490}","\u{1F337}","\u{1F339}","\u{1F940}","\u{1F33A}","\u{1F338}","\u{1F33C}","\u{1F33B}","\u{1F31E}","\u{1F31D}","\u{1F31B}","\u{1F31C}","\u{1F31A}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}","\u{1F311}","\u{1F312}","\u{1F313}","\u{1F314}","\u{1F319}","\u{1F30E}","\u{1F30D}","\u{1F30F}","\u{1FA90}","\u{1F4AB}","\u2B50\uFE0F","\u{1F31F}","\u2728","\u26A1\uFE0F","\u2604\uFE0F","\u{1F4A5}","\u{1F525}","\u{1F32A}\uFE0F","\u{1F308}","\u2600\uFE0F","\u{1F324}\uFE0F","\u26C5\uFE0F","\u{1F325}\uFE0F","\u2601\uFE0F","\u{1F326}\uFE0F","\u{1F327}\uFE0F","\u26C8\uFE0F","\u{1F329}\uFE0F","\u{1F328}\uFE0F","\u2744\uFE0F","\u2603\uFE0F","\u26C4\uFE0F","\u{1F32C}\uFE0F","\u{1F4A8}","\u{1F4A7}","\u{1F4A6}","\u2614\uFE0F","\u2602\uFE0F","\u{1F30A}","\u{1F32B}\uFE0F"]}];function zP({onSelect:e,className:t,...r}){let[o,n]=useState(""),a=U0.map(s=>({...s,emojis:s.emojis.filter(i=>o===""||i.includes(o))})).filter(s=>s.emojis.length>0);return jsxs(ne,{className:l("w-72 h-96 flex flex-col overflow-hidden shadow-2xl",t),...r,children:[jsx("div",{className:"p-3 border-b border-gray-200 dark:border-white/10",children:jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400"}),jsx("input",{type:"text",value:o,onChange:s=>n(s.target.value),placeholder:"Search emoji...",className:"w-full h-8 pl-8 pr-3 rounded-lg bg-gray-100 dark:bg-white/5 text-xs focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all"})]})}),jsx("div",{className:"flex-1 overflow-y-auto p-2 custom-scrollbar",children:a.map(s=>jsxs("div",{className:"mb-4",children:[jsx("h4",{className:"text-[10px] font-bold uppercase tracking-wider text-gray-400 px-2 mb-2",children:s.name}),jsx("div",{className:"grid grid-cols-8 gap-1",children:s.emojis.map(i=>jsx("button",{onClick:()=>e(i),className:"h-8 w-8 flex items-center justify-center rounded-lg hover:bg-gray-100 dark:hover:bg-white/10 text-lg transition-colors",children:i},i))})]},s.name))})]})}function si(){let[e,t]=useState(false),[r,o]=useState(0),[n,a]=useState(null),[s,i]=useState(null),c=useRef(null),d=useRef(null),m=useRef([]),u=useCallback(async()=>{try{let v=await navigator.mediaDevices.getUserMedia({audio:!0}),h=MediaRecorder.isTypeSupported("audio/ogg; codecs=opus")?"audio/ogg; codecs=opus":"audio/webm";c.current=new MediaRecorder(v,{mimeType:h}),m.current=[],c.current.ondataavailable=p=>{p.data.size>0&&m.current.push(p.data);},c.current.onstop=()=>{let p=new Blob(m.current,{type:h}),b=URL.createObjectURL(p);a(p),i(b),v.getTracks().forEach(w=>w.stop());},c.current.start(),t(!0),o(0),d.current=window.setInterval(()=>{o(p=>p+1);},1e3);}catch(v){throw console.error("Failed to start recording",v),v}},[]),f=useCallback(()=>{c.current&&e&&(c.current.stop(),t(false),d.current&&clearInterval(d.current));},[e]),g=useCallback(()=>{c.current&&e&&(c.current.stop(),t(false),d.current&&clearInterval(d.current),a(null),i(null),o(0));},[e]),x=useCallback(()=>{a(null),i(null),o(0);},[]);return {isRecording:e,duration:r,audioBlob:n,audioUrl:s,startRecording:u,stopRecording:f,cancelRecording:g,clearAudio:x}}function JP({onSend:e,onCancel:t,className:r,...o}){let{isRecording:n,duration:a,audioBlob:s,startRecording:i,stopRecording:c,cancelRecording:d}=si();useEffect(()=>(i(),()=>d()),[i,d]);let m=u=>{let f=Math.floor(u/60),g=u%60;return `${f}:${g.toString().padStart(2,"0")}`};return jsxs("div",{className:l("flex items-center gap-3 p-2 rounded-2xl bg-gray-100 dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 animate-in slide-in-from-bottom-2",r),...o,children:[jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-xl bg-red-500/10 text-red-500",children:[jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),jsx("span",{className:"text-sm font-mono font-bold",children:m(a)})]}),jsx("div",{className:"flex-1 h-8 flex items-center gap-0.5 px-2",children:[...Array(20)].map((u,f)=>jsx("div",{className:"w-1 bg-red-500/40 rounded-full transition-all duration-150",style:{height:n?`${20+Math.random()*80}%`:"20%",animationDelay:`${f*.05}s`}},f))}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{onClick:()=>{d(),t();},className:"p-2 rounded-full hover:bg-gray-200 dark:hover:bg-white/10 text-gray-500 transition-colors",children:jsx(Trash2,{className:"h-5 w-5"})}),n?jsx(R,{size:"icon",variant:"ghost",onClick:c,className:"rounded-full bg-red-500 text-white hover:bg-red-600",children:jsx(Square,{className:"h-4 w-4 fill-current"})}):jsx(R,{size:"icon",onClick:()=>s&&e(s,a),className:"rounded-full bg-blue-500 text-white hover:bg-blue-600",children:jsx(Send,{className:"h-4 w-4"})})]})]})}function iE({onSearch:e,results:t,onResultClick:r,onClose:o,className:n,...a}){let[s,i]=useState(""),c=d=>{let m=d.target.value;i(m),e(m);};return jsxs("div",{className:l("flex flex-col h-full bg-white dark:bg-gray-900 border-l border-gray-200 dark:border-white/10 animate-in slide-in-from-right duration-300",n),...a,children:[jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-white/10 flex items-center justify-between",children:[jsx("h3",{className:"font-bold text-gray-900 dark:text-white",children:"Search Messages"}),jsx("button",{onClick:o,className:"p-1 rounded-full hover:bg-gray-100 dark:hover:bg-white/10",children:jsx(X,{className:"h-5 w-5 text-gray-500"})})]}),jsx("div",{className:"p-4",children:jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),jsx("input",{type:"text",value:s,onChange:c,placeholder:"Search in conversation...",className:"w-full h-10 pl-10 pr-4 rounded-xl bg-gray-100 dark:bg-white/5 border-none text-sm focus:ring-2 focus:ring-blue-500/50 transition-all",autoFocus:true})]})}),jsx("div",{className:"flex-1 overflow-y-auto p-2",children:s&&t.length===0?jsx("div",{className:"p-8 text-center text-gray-500 dark:text-white/30",children:jsxs("p",{className:"text-sm",children:['No messages found for "',s,'"']})}):jsx("div",{className:"space-y-1",children:t.map(d=>jsxs("button",{onClick:()=>r(d),className:"w-full p-3 rounded-xl hover:bg-gray-100 dark:hover:bg-white/5 text-left transition-all group",children:[jsxs("div",{className:"flex justify-between mb-1",children:[jsx("span",{className:"text-[10px] font-bold text-blue-500 uppercase",children:d.timestamp.toLocaleDateString()}),jsx("span",{className:"text-[10px] text-gray-400",children:d.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),jsx("p",{className:"text-sm text-gray-700 dark:text-white/70 line-clamp-2 group-hover:text-gray-900 dark:group-hover:text-white",children:d.content})]},d.id))})})]})}var Ba=class{constructor(){this.state={conversations:new Map,messages:new Map,activeChatId:null,presence:new Map};this.listeners=new Set;this.getState=()=>this.state;this.subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));}emitChange(t){this.state=t;for(let r of this.listeners)r();}setConversations(t){this.emitChange({...this.state,conversations:new Map(t.map(r=>[r.id,r]))});}upsertConversation(t){let r=new Map(this.state.conversations),o=r.get(t.id);r.set(t.id,{...o||{unreadCount:0},...t}),this.emitChange({...this.state,conversations:r});}setMessages(t,r){let o=new Map(this.state.messages);o.set(t,r),this.emitChange({...this.state,messages:o});}addMessage(t,r){let o=this.state.messages.get(t)||[];if(o.some(i=>i.id===r.id))return;let n=new Map(this.state.messages);n.set(t,[...o,r]);let a={...this.state,messages:n},s=this.state.conversations.get(t);if(s){let i=new Map(this.state.conversations);i.set(t,{...s,lastMessage:r,unreadCount:this.state.activeChatId===t?0:(s.unreadCount||0)+1}),a.conversations=i;}this.emitChange(a);}updateMessageStatus(t,r,o){let n=this.state.messages.get(t);if(!n)return;let a=n.findIndex(s=>s.id===r);if(a!==-1){let s=[...n],i=s[a];if(i){s[a]={...i,status:o};let c=new Map(this.state.messages);c.set(t,s),this.emitChange({...this.state,messages:c});}}}updateMessage(t,r,o){let n=this.state.messages.get(t);if(!n)return;let a=n.findIndex(s=>s.id===r);if(a!==-1){let s=[...n];s[a]={...s[a],...o};let i=new Map(this.state.messages);i.set(t,s),this.emitChange({...this.state,messages:i});}}addReaction(t,r,o,n){let a=this.state.messages.get(t);if(!a)return;let s=a.findIndex(i=>i.id===r);if(s!==-1){let i=[...a],c={...i[s]},d={...c.reactions||{}},m=[...d[o]||[]];if(!m.includes(n)){m.push(n),d[o]=m,c.reactions=d,i[s]=c;let u=new Map(this.state.messages);u.set(t,i),this.emitChange({...this.state,messages:u});}}}removeReaction(t,r,o,n){let a=this.state.messages.get(t);if(!a)return;let s=a.findIndex(i=>i.id===r);if(s!==-1){let i=[...a],c={...i[s]},d={...c.reactions||{}};if(d[o]){d[o]=d[o].filter(u=>u!==n),d[o].length===0&&delete d[o],c.reactions=d,i[s]=c;let m=new Map(this.state.messages);m.set(t,i),this.emitChange({...this.state,messages:m});}}}deleteMessage(t,r){let o=this.state.messages.get(t);if(!o)return;let n=o.findIndex(a=>a.id===r);if(n!==-1){let a=[...o];a[n]={...a[n],type:"revoked",content:"Esta mensagem foi apagada",attachments:[],reactions:{}};let s=new Map(this.state.messages);s.set(t,a),this.emitChange({...this.state,messages:s});}}setActiveChat(t){let r={...this.state,activeChatId:t};if(t){let o=this.state.conversations.get(t);if(o&&o.unreadCount>0){let n=new Map(this.state.conversations);n.set(t,{...o,unreadCount:0}),r.conversations=n;}}this.emitChange(r);}setUserPresence(t,r){let o=new Map(this.state.presence);o.set(t,r),this.emitChange({...this.state,presence:o});}},Ge=new Ba;function yo(e){let t=useSyncExternalStore(Ge.subscribe,Ge.getState);return useMemo(()=>e(t),[t,e])}var Z0=e=>Array.from(e.conversations.values()).sort((t,r)=>{if(t.isPinned&&!r.isPinned)return -1;if(!t.isPinned&&r.isPinned)return 1;let o=t.lastMessage?.timestamp.getTime()||0;return (r.lastMessage?.timestamp.getTime()||0)-o});function mE(){return yo(Z0)}function uE(e){let t=useCallback(r=>e?r.messages.get(e)||[]:[],[e]);return yo(t)}function pE(){let e=useCallback(t=>t.activeChatId?t.conversations.get(t.activeChatId):null,[]);return yo(e)}function fE(e){let t=useCallback(r=>r.presence.get(e)||"unavailable",[e]);return yo(t)}function Va({url:e,token:t,rooms:r=[],onConnect:o,onDisconnect:n,onError:a}){let s=useRef(null);useEffect(()=>{let d=io(e,{auth:{token:t},transports:["websocket"],reconnectionAttempts:5,reconnectionDelay:1e3});return s.current=d,d.on("connect",()=>{console.log("Socket connected:",d.id),r.forEach(m=>d.emit("join",m)),o?.();}),d.on("disconnect",m=>{console.log("Socket disconnected:",m),n?.();}),d.on("connect_error",m=>{console.error("Socket connection error:",m),a?.(m);}),()=>{d.disconnect();}},[e,t,r,o,n,a]);let i=useCallback((d,m)=>{s.current?.connected?s.current.emit(d,m):console.warn("Socket not connected. Event buffered or dropped:",d);},[]),c=useCallback((d,m)=>(s.current?.on(d,m),()=>{s.current?.off(d,m);}),[]);return {socket:s.current,emit:i,on:c,isConnected:s.current?.connected||false}}function NE(e,t){let{on:r,emit:o,isConnected:n}=Va({url:e,token:t});return useEffect(()=>{r("chats.set",a=>{Ge.setConversations(a);}),r("chats.upsert",a=>{a.forEach(s=>Ge.upsertConversation(s));}),r("chats.update",a=>{a.forEach(s=>{s.id&&Ge.upsertConversation(s);});}),r("messages.upsert",({chatId:a,messages:s})=>{s.forEach(i=>Ge.addMessage(a,i));}),r("messages.update",({chatId:a,messageId:s,status:i})=>{Ge.updateMessageStatus(a,s,i);}),r("presence.update",({userId:a,status:s})=>{Ge.setUserPresence(a,s);}),r("groups.update",a=>{a.forEach(s=>{Ge.upsertConversation({id:s.id,group:s});});});},[r]),{isConnected:n,emit:o}}function TE(e,t){let{emit:r}=Va({url:""});return {setPresence:n=>{r("presence.send",{chatId:e,userId:t,status:n});}}}function CE(){return {uploadMedia:async(t,r)=>({url:"...",thumbnail:"...",blurhash:"..."})}}function ME(e){return {search:r=>r?e.filter(o=>o.content.toLowerCase().includes(r.toLowerCase())):e}}function PE({itemCount:e,itemHeight:t,overscan:r=5,initialScrollTop:o=0,startAtBottom:n=false}){let[a,s]=useState(o),[i,c]=useState(0),d=useRef(null),m=useRef(false),u=useCallback(p=>typeof t=="function"?t(p):t,[t]);useLayoutEffect(()=>{if(d.current){let p=new ResizeObserver(b=>{for(let w of b)c(w.contentRect.height);});return p.observe(d.current),o>0&&(d.current.scrollTop=o),()=>p.disconnect()}},[o]);let f=useCallback(p=>{s(p.currentTarget.scrollTop);},[]),{visibleItems:g,totalHeight:x,startIndex:v}=useMemo(()=>{let p=0,b=[];for(let T=0;T<e;T++)b.push(p),p+=u(T);let w=0,y=0,N=e-1;for(;y<=N;){let T=Math.floor((y+N)/2),L=b[T];L!==void 0&&L<=a?(w=T,y=T+1):N=T-1;}w=Math.max(0,w-r);let C=[];for(let T=w;T<e;T++){let L=b[T];if(L===void 0||L>a+i+r*u(T))break;C.push({index:T,offsetTop:L,height:u(T)});}return {visibleItems:C,totalHeight:p,startIndex:w}},[a,i,e,u,r]);useLayoutEffect(()=>{if(n&&!m.current&&x>0&&d.current&&i>0){let p=d.current,b=x-i;b>0&&(p.scrollTop=b,s(b)),m.current=true;}},[x,i,n]);let h=useCallback((p,b="auto")=>{if(d.current){let w=0;for(let k=0;k<p;k++)w+=u(k);d.current.scrollTo({top:w,behavior:b});}},[u]);return {containerRef:d,visibleItems:g,totalHeight:x,startIndex:v,onScroll:f,scrollToIndex:h,scrollToBottom:(p="auto")=>{d.current&&d.current.scrollTo({top:d.current.scrollHeight,behavior:p});}}}function mi(){let[e,t]=useState({scrollX:0,scrollY:0,scrollProgressX:0,scrollProgressY:0}),r=useRef(false),o=useCallback(()=>{r.current||(window.requestAnimationFrame(()=>{let n=window.scrollX,a=window.scrollY,s=document.documentElement.scrollWidth-document.documentElement.clientWidth,i=document.documentElement.scrollHeight-document.documentElement.clientHeight;t({scrollX:n,scrollY:a,scrollProgressX:s>0?n/s:0,scrollProgressY:i>0?a/i:0}),r.current=false;}),r.current=true);},[]);return useEffect(()=>(window.addEventListener("scroll",o,{passive:true}),o(),()=>window.removeEventListener("scroll",o)),[o]),e}function AE({className:e,color:t="bg-blue-500",height:r=2,position:o="top",...n}){let{scrollProgressY:a}=mi();return jsx("div",{className:l("fixed left-0 right-0 z-[100] w-full pointer-events-none",o==="top"?"top-0":"bottom-0",e),style:{height:r},...n,children:jsx("div",{className:l("h-full transition-all duration-75 ease-out",t),style:{width:`${a*100}%`,boxShadow:a>0?`0 0 10px ${t.replace("bg-","var(--")}`:"none"}})})}var dg=we__default.forwardRef(({orientation:e="horizontal",className:t,...r},o)=>jsx("hr",{ref:o,className:l("border-0 bg-gray-200 dark:bg-white/10",{"h-px w-full":e==="horizontal","h-full w-px":e==="vertical"},t),...r}));dg.displayName="Divider";var pg=we__default.forwardRef(({children:e,className:t,...r},o)=>jsx("kbd",{ref:o,className:l("rounded-lg border border-gray-200 dark:border-white/10 bg-gray-100 dark:bg-white/[0.03] px-2 py-1 text-[11px] font-semibold text-gray-500 dark:text-white/65",t),...r,children:e}));pg.displayName="Kbd";var xg={theme:"system",setTheme:()=>null},fi=createContext(xg);function qE({children:e,defaultTheme:t="system",storageKey:r="vite-ui-theme",...o}){let[n,a]=useState(t);useEffect(()=>{let i=localStorage.getItem(r);i&&a(i);},[r]),useEffect(()=>{let i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){let c=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{i.classList.remove("light","dark"),i.classList.add(c.matches?"dark":"light");};return d(),c.addEventListener("change",d),()=>c.removeEventListener("change",d)}i.classList.add(n);},[n]);let s={theme:n,setTheme:i=>{localStorage.setItem(r,i),a(i);}};return jsx(fi.Provider,{...o,value:s,children:e})}var gi=()=>{let e=useContext(fi);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function tS({className:e}){let{setTheme:t,theme:r}=gi();return jsxs(R,{variant:"ghost",size:"icon",className:l("h-9 w-9",e),onClick:()=>t(r==="light"?"dark":"light"),children:[jsx(Sun,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),jsx(Moon,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function Cg(e,t=true){let[r,o]=useState({data:null,error:null,isLoading:false}),n=useCallback(async()=>{o({data:null,error:null,isLoading:true});try{let a=await e();return o({data:a,error:null,isLoading:!1}),a}catch(a){throw o({data:null,error:a,isLoading:false}),a}},[e]);return useEffect(()=>{t&&n();},[n,t]),{...r,execute:n}}function nS(e,t){let r=useCallback(()=>fetch(e,t).then(o=>o.json()),[e,t]);return Cg(r)}function lS({initialMessages:e=[],onSendMessage:t,scrollThreshold:r=100}={}){let[o,n]=useState(e),[a,s]=useState(false),[i,c]=useState(false),d=useRef(null),m=useRef(true),u=useCallback((v="smooth")=>{d.current&&d.current.scrollTo({top:d.current.scrollHeight,behavior:v});},[]),f=useCallback(()=>{if(d.current){let{scrollTop:v,scrollHeight:h,clientHeight:p}=d.current;m.current=h-v-p<r;}},[r]);useEffect(()=>{m.current&&u();},[o,u]);let g=useCallback(async(v,h)=>{if(!v.trim())return;let p=crypto.randomUUID(),b={id:p,content:v,senderId:h,timestamp:new Date,status:"sending"};n(w=>[...w,b]);try{t&&await t(v),n(w=>w.map(k=>k.id===p?{...k,status:"sent"}:k));}catch{n(k=>k.map(y=>y.id===p?{...y,status:"error"}:y));}},[t]),x=useCallback(()=>{n([]);},[]);return {messages:o,setMessages:n,sendMessage:g,clearMessages:x,isTyping:a,setIsTyping:s,isLoading:i,setIsLoading:c,scrollRef:d,handleScroll:f,scrollToBottom:u}}function uS(e=[]){let[t,r]=useState(e),o=useCallback(d=>{r(m=>[...m,d]);},[]),n=useCallback((d,m)=>{r(u=>u.map(f=>f.id===d?{...f,status:m}:f));},[]),a=useCallback(d=>{r(m=>m.filter(u=>u.id!==d));},[]),s=useCallback((d,m)=>{r(u=>u.map(f=>f.id===d?{...f,content:m,isEdited:true}:f));},[]),i=useCallback((d,m,u)=>{r(f=>f.map(g=>{if(g.id!==d)return g;let x={...g.reactions||{}},v=x[m]||[];return v.includes(u)?(x[m]=v.filter(h=>h!==u),x[m].length===0&&delete x[m]):x[m]=[...v,u],{...g,reactions:x}}));},[]),c=useCallback(()=>{r([]);},[]);return {messages:t,setMessages:r,addMessage:o,updateMessageStatus:n,deleteMessage:a,editMessage:s,addReaction:i,clearMessages:c}}function gS(e){let[t,r]=useState(""),o=useMemo(()=>{if(!t.trim())return [];let n=t.toLowerCase();return e.filter(a=>a.content.toLowerCase().includes(n))},[e,t]);return {query:t,setQuery:r,results:o}}function xS(e){let t=useRef(null);return useEffect(()=>{let r=o=>{let n=t.current;!n||n.contains(o?.target||null)||e(o);};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r);}},[e]),t}function yS({timeout:e=2e3}={}){let[t,r]=useState(false),[o,n]=useState(null);return {copy:useCallback(async s=>{if(!navigator?.clipboard){n(new Error("Clipboard API not supported"));return}try{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),e);}catch(i){n(i instanceof Error?i:new Error("Failed to copy"));}},[e]),copied:t,error:o}}function TS(e,t){let[r,o]=useState(e);return useEffect(()=>{let n=setTimeout(()=>{o(e);},t);return ()=>{clearTimeout(n);}},[e,t]),r}function RS(e){let[t,r]=useState(false),[o,n]=useState({x:0,y:0}),a=useRef({x:0,y:0}),s=useRef({x:0,y:0}),i=useRef(Date.now()),c=useRef({x:0,y:0}),d=useCallback((f,g)=>{r(true),a.current={x:f-o.x,y:g-o.y},s.current={x:f,y:g},i.current=Date.now();},[o]),m=useCallback((f,g)=>{if(!t)return;let x=f-a.current.x,v=g-a.current.y,h=Date.now(),p=h-i.current;p>0&&(c.current={x:(f-s.current.x)/p,y:(g-s.current.y)/p}),n({x,y:v}),s.current={x:f,y:g},i.current=h,e?.({isDragging:true,offset:{x,y:v},velocity:c.current});},[t,e]),u=useCallback(()=>{r(false),e?.({isDragging:false,offset:o,velocity:c.current});},[o,e]);return useEffect(()=>{let f=h=>m(h.clientX,h.clientY),g=h=>{h.touches[0]&&m(h.touches[0].clientX,h.touches[0].clientY);},x=()=>u(),v=()=>u();return t&&(window.addEventListener("mousemove",f),window.addEventListener("mouseup",x),window.addEventListener("touchmove",g),window.addEventListener("touchend",v)),()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",x),window.removeEventListener("touchmove",g),window.removeEventListener("touchend",v);}},[t,m,u]),{isDragging:t,offset:o,dragProps:{onMouseDown:f=>d(f.clientX,f.clientY),onTouchStart:f=>{f.touches[0]&&d(f.touches[0].clientX,f.touches[0].clientY);},style:{cursor:t?"grabbing":"grab",touchAction:"none"}}}}function ES(e){let[t,r]=useState({progress:0,scrollY:0,isIntersecting:false}),o=useRef(false);return useEffect(()=>{let n=e.current;if(!n)return;let a=()=>{o.current||(window.requestAnimationFrame(()=>{let s=n.getBoundingClientRect(),i=window.innerHeight,c=i+s.height,d=i-s.top,m=Math.max(0,Math.min(1,d/c));r({progress:m,scrollY:window.scrollY,isIntersecting:s.top<i&&s.bottom>0}),o.current=false;}),o.current=true);};return window.addEventListener("scroll",a,{passive:true}),window.addEventListener("resize",a),a(),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a);}},[e]),t}function HS(e,t){let r=useRef(null);return useLayoutEffect(()=>{let o=document.querySelector(`[data-flip-id="${e}"]`);if(!o)return;let n=r.current,a=o.getBoundingClientRect();if(n){let s=n.left-a.left,i=n.top-a.top,c=n.width/a.width,d=n.height/a.height;(Math.abs(s)>.5||Math.abs(i)>.5||Math.abs(c-1)>.01||Math.abs(d-1)>.01)&&o.animate([{transformOrigin:"top left",transform:`translate(${s}px, ${i}px) scale(${c}, ${d})`},{transformOrigin:"top left",transform:"none"}],{duration:400,easing:"cubic-bezier(0.2, 0.8, 0.2, 1)"});}r.current=a;},t),{"data-flip-id":e}}function BS({initialValues:e,onSubmit:t}){let[r,o]=useState(e),[n,a]=useState({}),[s,i]=useState(false),c=useCallback(u=>{let{name:f,value:g,type:x}=u.target,v=x==="checkbox"?u.target.checked:g;o(h=>({...h,[f]:v})),n[f]&&a(h=>({...h,[f]:""}));},[n]),d=useCallback(async u=>{u.preventDefault();let f=u.currentTarget;if(!f.checkValidity()){let g={};Array.from(f.elements).forEach(x=>{let v=x;v.name&&!v.validity.valid&&(g[v.name]=v.validationMessage);}),a(g);return}i(true);try{await t(r);}finally{i(false);}},[r,t]),m=useCallback(u=>({name:u,value:r[u],onChange:c,error:n[u]}),[r,n,c]);return {values:r,errors:n,isSubmitting:s,handleChange:c,handleSubmit:d,register:m,setValues:o,setErrors:a}}function KS(e){let[t,r]=useState({past:[],present:e,future:[]}),o=t.past.length>0,n=t.future.length>0,a=useCallback(()=>{o&&r(d=>{let m=d.past[d.past.length-1];return m===void 0?d:{past:d.past.slice(0,d.past.length-1),present:m,future:[d.present,...d.future]}});},[o]),s=useCallback(()=>{n&&r(d=>{let m=d.future[0];if(m===void 0)return d;let u=d.future.slice(1);return {past:[...d.past,d.present],present:m,future:u}});},[n]),i=useCallback(d=>{r(m=>{let u=typeof d=="function"?d(m.present):d;return m.present===u?m:{past:[...m.past,m.present],present:u,future:[]}});},[]),c=useCallback(()=>{r({past:[],present:e,future:[]});},[e]);return {state:t.present,set:i,undo:a,redo:s,clear:c,canUndo:o,canRedo:n,history:t}}function US(e=3e3){let[t,r]=useState(false),o=useRef();return useEffect(()=>{let n=()=>{r(false),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(true);},e);},a=["mousemove","mousedown","keydown","touchstart","scroll"];return a.forEach(s=>{window.addEventListener(s,n);}),n(),()=>{a.forEach(s=>{window.removeEventListener(s,n);}),o.current&&clearTimeout(o.current);}},[e]),t}function _S({onLoadMore:e,isLoading:t,hasMore:r,threshold:o=100,root:n=null}){let a=useRef(null),s=useRef(null),i=useCallback(c=>{let d=c[0];d&&d.isIntersecting&&r&&!t&&e();},[r,t,e]);return useEffect(()=>{let c=s.current;if(c)return a.current=new IntersectionObserver(i,{root:n,rootMargin:`0px 0px ${o}px 0px`,threshold:.1}),a.current.observe(c),()=>{a.current&&a.current.disconnect();}},[i,n,o]),s}function jS(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:n=false}={}){let[a,s]=useState(),i=a?.isIntersecting&&n,c=([d])=>{s(d);};return useEffect(()=>{let d=e?.current;if(!!!window.IntersectionObserver||i||!d)return;let u={threshold:t,root:r,rootMargin:o},f=new IntersectionObserver(c,u);return f.observe(d),()=>f.disconnect()},[e,t,r,o,i]),a}function ZS(e){let[t,r]=useState(e),o=useCallback((i,c,d,m)=>{r(u=>{let f=u.columns[c],g=u.columns[d],x=u.tasks[i];if(!f||!g||!x)return u;let v=Array.from(f.taskIds);v.splice(v.indexOf(i),1);let h={...f,taskIds:v},p=c===d?v:Array.from(g.taskIds);p.splice(m,0,i);let b={...g,taskIds:p};return {...u,columns:{...u.columns,[c]:h,[d]:b},tasks:{...u.tasks,[i]:{...x,columnId:d}}}});},[]),n=useCallback((i,c)=>{r(d=>{let m=Array.from(d.columnOrder);return m.splice(m.indexOf(i),1),m.splice(c,0,i),{...d,columnOrder:m}});},[]),a=useCallback((i,c)=>{r(d=>{let m=d.columns[i];if(!m)return d;let u={...m,taskIds:[...m.taskIds,c.id]};return {...d,tasks:{...d.tasks,[c.id]:c},columns:{...d.columns,[i]:u}}});},[]),s=useCallback(i=>{r(c=>{let d=c.tasks[i];if(!d)return c;let m=c.columns[d.columnId];if(!m)return c;let u={...c.tasks};delete u[i];let f={...m,taskIds:m.taskIds.filter(g=>g!==i)};return {...c,tasks:u,columns:{...c.columns,[d.columnId]:f}}});},[]);return {board:t,setBoard:r,moveTask:o,moveColumn:n,addTask:a,removeTask:s}}function rD(e){let t=useRef(e);t.current=e,useEffect(()=>{let r=o=>{let n=[];(o.ctrlKey||o.metaKey)&&n.push("mod"),o.shiftKey&&n.push("shift"),o.altKey&&n.push("alt");let s=o.key.toLowerCase();["control","meta","shift","alt"].includes(s)||n.push(s);let i=n.join("+"),c=t.current[i]||t.current[s];c&&c(o);};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]);}function nD(e){let t=useRef(false);useEffect(()=>{t.current||(t.current=true,e());},[]);}function sD(e){useEffect(()=>()=>{e();},[]);}function dD(e,t){let[r,o]=useState(()=>{if(typeof window>"u")return t;try{let a=window.localStorage.getItem(e);return a?JSON.parse(a):t}catch(a){return console.warn(`Error reading localStorage key "${e}":`,a),t}}),n=useCallback(a=>{try{let s=a instanceof Function?a(r):a;o(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s));}catch(s){console.warn(`Error setting localStorage key "${e}":`,s);}},[e,r]);return [r,n]}function pD(e){let[t,r]=useState({x:0,y:0,elementX:0,elementY:0,percentageX:0,percentageY:0}),o=useRef(),n=useRef({x:0,y:0});return useEffect(()=>{let a=i=>{n.current={x:i.clientX,y:i.clientY},o.current||(o.current=requestAnimationFrame(s));},s=()=>{let{x:i,y:c}=n.current,d=0,m=0,u=0,f=0;if(e?.current){let g=e.current.getBoundingClientRect();d=i-g.left,m=c-g.top,u=Math.max(0,Math.min(100,d/g.width*100)),f=Math.max(0,Math.min(100,m/g.height*100));}r({x:i,y:c,elementX:d,elementY:m,percentageX:u,percentageY:f}),o.current=void 0;};return window.addEventListener("mousemove",a),()=>{window.removeEventListener("mousemove",a),o.current&&cancelAnimationFrame(o.current);}},[e]),t}function hD(){let[e,t]=useState({alpha:null,beta:null,gamma:null,absolute:false});return useEffect(()=>{let r=o=>{t({alpha:o.alpha,beta:o.beta,gamma:o.gamma,absolute:o.absolute});};return typeof window<"u"&&"DeviceOrientationEvent"in window&&window.addEventListener("deviceorientation",r),()=>{window.removeEventListener("deviceorientation",r);}},[]),e}function vD(e){let t=useRef();return useEffect(()=>{t.current=e;},[e]),t.current}function kD(e){let t=useRef(null),r=useCallback((o,n,a)=>{!o||a||!t.current||(o.dataset.messageId=n,t.current.observe(o));},[]);return useEffect(()=>(t.current=new IntersectionObserver(o=>{o.forEach(n=>{if(n.isIntersecting){let a=n.target.dataset.messageId;a&&(e(a),t.current?.unobserve(n.target));}});},{threshold:.5}),()=>{t.current?.disconnect();}),[e]),{registerMessage:r}}function CD(){let[e,t]=useState(false);return useEffect(()=>{let r=window.matchMedia("(prefers-reduced-motion: reduce)");t(r.matches);let o=n=>{t(n.matches);};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),e}var fh={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function gh(e){let[t,r]=useState(false);return useEffect(()=>{let o=window.matchMedia(e);r(o.matches);let n=()=>r(o.matches);return o.addEventListener("change",n),()=>o.removeEventListener("change",n)},[e]),t}function LD(e){return gh(`(min-width: ${fh[e]}px)`)}function PD(e){let[t,r]=useState({width:0,height:0});return useLayoutEffect(()=>{if(!e.current)return;let o=new ResizeObserver(n=>{for(let a of n)r({width:a.contentRect.width,height:a.contentRect.height});});return o.observe(e.current),()=>o.disconnect()},[e]),t}function DD(e=10){let[t,r]=useState(null),o=useRef(0);return useEffect(()=>{let n=()=>{let s=window.scrollY;if(Math.abs(s-o.current)<e)return;let i=s>o.current?"down":"up";i!==t&&(s>0||i==="down")&&r(i),o.current=s>0?s:0;},a=()=>{window.requestAnimationFrame(n);};return window.addEventListener("scroll",a),()=>window.removeEventListener("scroll",a)},[t,e]),t}function AD(e=true){useLayoutEffect(()=>{if(!e)return;let t=window.getComputedStyle(document.body).overflow,r=window.getComputedStyle(document.body).paddingRight,o=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",o>0&&(document.body.style.paddingRight=`${parseFloat(r)+o}px`),()=>{document.body.style.overflow=t,document.body.style.paddingRight=r;}},[e]);}function wh(e,t,r){let[o,n]=t,[a,s]=r,i=(e-o)/(n-o),c=Math.max(0,Math.min(1,i));return a+c*(s-a)}function OD(e,t,r){return wh(e,t,r)}function KD(){let[e,t]=useState(0),r=useRef(0),o=useRef(Date.now()),n=useRef();return useEffect(()=>{let a=()=>{let i=window.scrollY,c=Date.now(),d=c-o.current;if(d>0){let u=(i-r.current)/d;t(u);}r.current=i,o.current=c,n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(s);},s=()=>{t(i=>Math.abs(i)<.01?0:i*.9),n.current=requestAnimationFrame(s);};return window.addEventListener("scroll",a,{passive:true}),()=>{window.removeEventListener("scroll",a),n.current&&cancelAnimationFrame(n.current);}},[]),e}function Th(e,t){let r=e.toLowerCase().replace(/\s/g,""),o=t.toLowerCase(),n=0;for(let a=0;a<o.length&&n<r.length;a++)o[a]===r[n]&&n++;return n===r.length}function UD(e,t,r){return useMemo(()=>t.trim()?e.filter(o=>r.some(n=>{let a=o[n];return a==null?false:Th(t,String(a))})):e,[e,t,r])}function _D(e,t){let r=useCallback(()=>{if(typeof window>"u")return t;try{let s=window.sessionStorage.getItem(e);return s?JSON.parse(s):t}catch(s){return console.warn(`Error reading sessionStorage key "${e}":`,s),t}},[t,e]),[o,n]=useState(r),a=useCallback(s=>{try{let i=s instanceof Function?s(o):s;n(i),typeof window<"u"&&window.sessionStorage.setItem(e,JSON.stringify(i));}catch(i){console.warn(`Error setting sessionStorage key "${e}":`,i);}},[e,o]);return useEffect(()=>{n(r());},[r]),[o,a]}function GD(e,t={}){let{stiffness:r=.15,damping:o=.8,mass:n=1,precision:a=.01}=t,[s,i]=useState(e),c=useRef(0),d=useRef(e),m=useRef();return useEffect(()=>{let u=()=>{let f=e-d.current,x=f*r/n;if(c.current=(c.current+x)*o,d.current+=c.current,Math.abs(f)<a&&Math.abs(c.current)<a){d.current=e,i(e),m.current=void 0;return}i(d.current),m.current=requestAnimationFrame(u);};return m.current&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(u),()=>{m.current&&cancelAnimationFrame(m.current);}},[e,r,o,n,a]),s}function QD(e,t=100,r=0){return r+e*t}function JD(e,t=100){return Array.from({length:e},(r,o)=>o*t)}var Ci="01XYZ#%&@$+-/<>!_";function tH(e,t=800,r=true){let[o,n]=useState(e),a=useRef();return useEffect(()=>{if(!r){n(e);return}let s=Date.now(),i=()=>{let c=Date.now()-s,d=Math.min(c/t,1),m=e.split("").map((u,f)=>u===" "?" ":d>f/e.length?u:Ci[Math.floor(Math.random()*Ci.length)]).join("");n(m),d<1&&(a.current=requestAnimationFrame(i));};return a.current=requestAnimationFrame(i),()=>{a.current&&cancelAnimationFrame(a.current);}},[e,t,r]),o}function aH(e,t){let[r,o]=useState(e),n=useRef(Date.now());return useEffect(()=>{let a=setTimeout(()=>{Date.now()-n.current>=t&&(o(e),n.current=Date.now());},t-(Date.now()-n.current));return ()=>{clearTimeout(a);}},[e,t]),r}function iH(e=0){let[t,r]=useState(e),[o,n]=useState(false),a=useRef(null),s=useCallback(()=>{o||(n(true),a.current=setInterval(()=>{r(m=>m+1);},1e3));},[o]),i=useCallback(()=>{o&&a.current&&(clearInterval(a.current),n(false));},[o]),c=useCallback(()=>{a.current&&clearInterval(a.current),n(false),r(0);},[]);return useEffect(()=>()=>{a.current&&clearInterval(a.current);},[]),{seconds:t,isActive:o,start:s,pause:i,reset:c,formattedTime:(m=>{let u=Math.floor(m/3600),f=Math.floor(m%3600/60),g=m%60;return [u,f,g].map(x=>x<10?"0"+x:x).filter((x,v)=>x!=="00"||v>0).join(":")})(t)}}function mH(){let e=useContext(Ko);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function fH(e=false){let[t,r]=useState(e),o=useCallback(()=>{r(n=>!n);},[]);return [t,o,r]}function bH(e=3e3){let[t,r]=useState(false),o=useRef(null),n=useCallback(a=>{r(a),o.current&&clearTimeout(o.current),a&&(o.current=window.setTimeout(()=>{r(false);},e));},[e]);return useEffect(()=>()=>{o.current&&clearTimeout(o.current);},[]),{isTyping:t,setTyping:n}}function wH(){return {startTransition:t=>{if(!document.startViewTransition){t();return}document.startViewTransition(()=>{flushSync(()=>{t();});});}}}function kH(e,t={month:"short",day:"numeric",year:"numeric"}){let r=new Date(e);return new Intl.DateTimeFormat("en-US",t).format(r)}function NH(e){return new Intl.NumberFormat("en-US").format(e)}function TH(e,t="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}function MH(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function RH(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}
70
+ export{of as AIPromptInput,hf as AIResponse,fk as Accordion,bk as AccordionContent,gk as AccordionItem,hk as AccordionTrigger,Wc as Alert,cC as AreaChart,ns as AssigneePicker,Ws as AudioPlayer,z as Avatar,Fp as Background,Ve as Badge,aC as BarChart,ip as Breadcrumb,pp as BreadcrumbEllipsis,cp as BreadcrumbItem,dp as BreadcrumbLink,lp as BreadcrumbList,mp as BreadcrumbPage,up as BreadcrumbSeparator,R as Button,Gr as Calendar,Gi as Card,Zi as CardContent,Ji as CardDescription,el as CardFooter,ji as CardHeader,Qi as CardTitle,Gs as CarouselMessage,G5 as ChartContainer,j5 as ChartGrid,Z5 as ChartSkeleton,J5 as ChartTooltip,Q5 as ChartXAxis,IC as ChartYAxis,nP as ChatBanner,L4 as ChatHeader,IL as ChatInput,p4 as ChatLayout,YL as ChatProfile,k4 as ChatSidebar,Po as Checkbox,ts as Checklist,W5 as Collapse,jv as ColorPicker,Fn as ColumnLimit,Io as Combobox,Vx as ComboboxContent,hn as ComboboxEmpty,fn as ComboboxInput,bn as ComboboxItem,gn as ComboboxList,Ox as ComboboxTrigger,Xn as Command,a1 as CommandDialog,n1 as CommandEmpty,jn as CommandGroup,qn as CommandInput,Qn as CommandItem,Gn as CommandList,s1 as CommandShortcut,XM as ConfirmDialog,Ip as Container,Dk as DataTable,nv as DatePicker,dP as DateSeparator,vv as DateTimePicker,eR as Dialog,aR as DialogDescription,rR as DialogFooter,tR as DialogHeader,oR as DialogTitle,dg as Divider,pR as Drawer,bR as DrawerDescription,gR as DrawerFooter,fR as DrawerHeader,hR as DrawerTitle,rt as DropdownMenu,at as DropdownMenuContent,K as DropdownMenuItem,Bs as DropdownMenuLabel,xa as DropdownMenuSeparator,ot as DropdownMenuTrigger,is as DueDatePicker,zP as EmojiPicker,Gc as EmptyState,xc as FileDropzone,dc as FormControl,mc as FormDescription,lc as FormItem,cc as FormLabel,uc as FormMessage,Vi as GlowButton,Kp as Grid,CP as GroupHeader,je as Heading,fl as HeroText,qo as Image,qs as InteractiveMessage,xu as Kanban,xu as KanbanBoard,_n as KanbanCalendarView,Qo as KanbanCard,Jo as KanbanColumn,Zn as KanbanFilterBar,Kn as KanbanHeader,to as KanbanListView,NT as KanbanQuickAdd,ms as KanbanSwimlane,Yn as KanbanTableView,ds as KanbanTaskModal,Wn as KanbanTimelineView,pg as Kbd,_ as Label,as as LabelPicker,gl as LetterPullup,fC as LineChart,Xs as LinkPreview,zy as Magnetic,C5 as Marquee,SP as MentionList,Js as MessageBubble,TL as MessageList,iE as MessageSearch,Wi as MetricCard,ro as Modal,E1 as ModalDescription,ao as ModalFooter,oo as ModalHeader,es as ModalTitle,Hn as Motion,yy as MotionGroup,iM as Navbar,Sc as NumberInput,_y as NumberTicker,Cc as OTPInput,fP as OnlineIndicator,Qy as PageLoader,ok as PageTransition,gp as Pagination,hp as PaginationContent,wp as PaginationEllipsis,bp as PaginationItem,va as PaginationLink,vp as PaginationNext,xp as PaginationPrevious,Dy as Parallax,Ql as PasswordInput,yC as PieChart,Qe as Popover,Ze as PopoverContent,Je as PopoverTrigger,Di as PrimaryButton,_c as Progress,MC as RadarChart,sc as RadioGroup,ic as RadioGroupItem,td as Rating,_s as ReadReceipt,eP as ReplyPreview,en as Reveal,st as ScrollArea,AE as ScrollProgress,Wr as Select,Sr as Separator,cl as ShinyText,qC as Sidebar,jC as SidebarContent,QC as SidebarFooter,ZC as SidebarGroup,GC as SidebarHeader,JC as SidebarItem,Sn as Skeleton,EM as SkipToContent,Wx as Slider,EC as Sparkline,GR as Spotlight,Op as Stack,Du as StatusDot,zM as Stepper,AT as SubtaskList,ne as Surface,Eo as Switch,xP as SystemMessage,wr as Table,kr as TableBody,Ue as TableCell,et as TableHead,yr as TableHeader,ct as TableRow,KC as Tabs,UC as TabsContent,$C as TabsList,FC as TabsTrigger,Yv as TagInput,KT as TaskActivity,os as TaskAttachments,rs as TaskComments,Ru as Terminal,y5 as TerminalLine,ve as Text,sl as TextGradient,wt as TextInput,My as TextMotion,hr as Textarea,qE as ThemeProvider,tS as ThemeToggle,cs as TimeTracker,jk as Timeline,Fd as TimelineItem,Pn as Toast,Ko as ToastContext,$w as ToastProvider,Bc as ToggleGroup,CR as Tooltip,oN as Tree,GL as TypingIndicator,kM as UserMenu,Vd as UserPreview,JP as VoiceRecorder,Ge as chatStore,l as cn,TH as formatCurrency,kH as formatDate,NH as formatNumber,Qt as normalize,RH as slugify,MH as truncate,pE as useActiveChat,Cg as useAsync,NE as useBaileysSync,LD as useBreakpoint,Me as useChart,lS as useChat,CE as useChatMedia,uS as useChatMessages,TE as useChatPresence,gS as useChatSearch,ME as useChatSearchWorker,yo as useChatStore,xS as useClickOutside,yS as useClipboard,PD as useContainerQuery,mE as useConversations,TS as useDebounce,RS as useDrag,ES as useElementScroll,nS as useFetch,HS as useFlip,Kt as useFloating,BS as useForm,KS as useHistory,US as useIdle,$e as useInView,_S as useInfiniteScroll,jS as useIntersection,ZS as useKanban,fs as useKanbanFilters,ST as useKanbanHistory,hs as useKanbanKeyboard,LT as useKanbanSync,gs as useKanbanUndo,rD as useKeyboardShortcuts,dD as useLocalStorage,gh as useMediaQuery,uE as useMessages,pD as useMousePosition,nD as useOnMount,sD as useOnUnmount,hD as useOrientation,vD as usePrevious,kD as useReadReceipts,CD as useReducedMotion,mi as useScroll,DD as useScrollDirection,AD as useScrollLock,OD as useScrollTransform,KD as useScrollVelocity,UD as useSearch,JD as useSequence,_D as useSessionStorage,Va as useSocket,GD as useSpring,QD as useStagger,tH as useTextScramble,gi as useTheme,aH as useThrottle,iH as useTimer,mH as useToast,fH as useToggle,bH as useTypingIndicator,fE as useUserPresence,wH as useViewTransition,PE as useVirtualList,si as useVoiceRecorder};//# sourceMappingURL=index.mjs.map
71
71
  //# sourceMappingURL=index.mjs.map