@reeverdev/ui 0.2.172 → 0.2.174

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import*as _ from'react';import {createContext,useState,useEffect,useContext,useCallback,useRef,useMemo}from'react';import {cva}from'class-variance-authority';import {AlertCircle,AlertTriangle,CheckCircle2,Info,Minus,Check,X,ChevronDown,Search,ChevronRight,Circle,ChevronsUpDown,PanelLeft,PanelLeftOpen,PanelRightOpen,PanelLeftClose,PanelRightClose,EyeOff,Eye,Plus,Heart,Star,TrendingUp,TrendingDown,Upload,Clock,Menu,ExternalLink,ArrowUp,File,Folder,FolderOpen,Loader2,Copy,Calendar,ZoomOut,ZoomIn,RotateCw,Download,Minimize2,Maximize2,ChevronLeft,GripVertical,Undo,Redo,Heading1,Heading2,Heading3,Bold,Italic,Underline,Strikethrough,List,ListOrdered,AlignLeft,AlignCenter,AlignRight,Quote,Code,Link,Unlink,Moon,Sun,Monitor,MoreHorizontal,HelpCircle,ArrowRight,Hash,User,Settings,Bell,CheckCircle,Trash2,Image as Image$1,FileVideo,FileAudio,FileText,FileArchive,ChevronUp,ArrowDown}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as Oa from'react-dom';import {Toaster}from'sonner';export{toast}from'sonner';import {Drawer}from'vaul';import {DayPicker,useDayPicker}from'react-day-picker';import {getMonth,getYear,setMonth,setYear}from'date-fns';import {Command}from'cmdk';import {Panel,Group,Separator}from'react-resizable-panels';import {HexColorPicker,HexColorInput}from'react-colorful';import {themes,Highlight}from'prism-react-renderer';import {ResponsiveContainer,LineChart,CartesianGrid,XAxis,YAxis,Tooltip,Legend,Line,BarChart,Bar,PieChart,Pie,Cell,AreaChart,Area}from'recharts';import {useSensors,useSensor,PointerSensor,KeyboardSensor,DndContext,closestCorners,DragOverlay}from'@dnd-kit/core';import {sortableKeyboardCoordinates,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import {CSS}from'@dnd-kit/utilities';import XM from'embla-carousel-react';import {useEditor,EditorContent}from'@tiptap/react';import oN from'@tiptap/starter-kit';import aN from'@tiptap/extension-link';import sN from'@tiptap/extension-underline';import iN from'@tiptap/extension-text-align';import lN from'@tiptap/extension-placeholder';import EN,{centerCrop,makeAspectCrop}from'react-image-crop';import'react-image-crop/dist/ReactCrop.css';import zN from'react-qr-code';import {useTheme,ThemeProvider}from'next-themes';export{useTheme}from'next-themes';import {motion,AnimatePresence,useInView,useMotionValue,useTransform,animate,useScroll,useSpring}from'framer-motion';import Eo from'canvas-confetti';function m(...e){return twMerge(clsx(e))}var s0=cva("relative w-full p-4",{variants:{variant:{solid:"border",bordered:"border bg-transparent",flat:""},type:{default:"",success:"",warning:"",error:""},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},compoundVariants:[{variant:"solid",type:"default",className:"!border-primary bg-primary text-primary-foreground [&>svg]:text-primary-foreground"},{variant:"bordered",type:"default",className:"!border-primary text-primary [&>svg]:text-primary"},{variant:"flat",type:"default",className:"bg-primary/10 text-primary [&>svg]:text-primary"},{variant:"solid",type:"success",className:"!border-green-600 bg-green-600 text-white dark:!border-green-500 dark:bg-green-500 [&>svg]:text-white"},{variant:"bordered",type:"success",className:"!border-green-600 text-green-600 dark:!border-green-500 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"flat",type:"success",className:"bg-green-600/10 text-green-600 dark:bg-green-500/10 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"solid",type:"warning",className:"!border-amber-600 bg-amber-600 text-white dark:!border-amber-500 dark:bg-amber-500 [&>svg]:text-white"},{variant:"bordered",type:"warning",className:"!border-amber-600 text-amber-600 dark:!border-amber-500 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"flat",type:"warning",className:"bg-amber-600/10 text-amber-600 dark:bg-amber-500/10 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"solid",type:"error",className:"!border-red-600 bg-red-600 text-white dark:!border-red-500 dark:bg-red-500 [&>svg]:text-white"},{variant:"bordered",type:"error",className:"!border-red-600 text-red-600 dark:!border-red-500 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"},{variant:"flat",type:"error",className:"bg-red-600/10 text-red-600 dark:bg-red-500/10 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"}],defaultVariants:{variant:"solid",type:"default",radius:"md"}}),i0={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},l0=_.forwardRef(({className:e,variant:t="solid",type:n="default",radius:r="md",icon:o,hideIcon:a=false,endContent:s,children:i,...l},c)=>{let d=i0[n],u=!a,f=o!==void 0?o:d?jsx(d,{className:"h-4 w-4"}):null;return jsxs("div",{ref:c,role:"alert",className:m(s0({variant:t,type:n,radius:r}),s&&"flex items-center justify-between",e),...l,children:[jsxs("div",{className:"flex items-start gap-3",children:[u&&f&&jsx("span",{className:"mt-0.5 shrink-0",children:f}),jsx("div",{children:i})]}),s&&jsx("div",{className:"shrink-0 ml-4",children:s})]})});l0.displayName="Alert";var c0=_.forwardRef(({className:e,...t},n)=>jsx("h5",{ref:n,className:m("mb-1 font-medium leading-none tracking-tight",e),...t}));c0.displayName="AlertTitle";var d0=_.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("text-sm [&_p]:leading-relaxed",e),...t}));d0.displayName="AlertDescription";var u0=cva("absolute rounded-full flex items-center justify-center font-semibold",{variants:{variant:{solid:"",bordered:"border-2"},color:{default:"",success:"",warning:"",danger:"",info:""},size:{sm:"",md:"",lg:""},placement:{"top-right":"-top-1 -right-1","top-left":"-top-1 -left-1","bottom-right":"-bottom-1 -right-1","bottom-left":"-bottom-1 -left-1"}},compoundVariants:[{variant:"solid",color:"default",className:"bg-zinc-800 text-white dark:bg-zinc-200 dark:text-zinc-900"},{variant:"solid",color:"success",className:"bg-green-600 text-white dark:bg-green-500"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white dark:bg-amber-500"},{variant:"solid",color:"danger",className:"bg-red-600 text-white dark:bg-red-500"},{variant:"solid",color:"info",className:"bg-blue-600 text-white dark:bg-blue-500"},{variant:"bordered",color:"default",className:"bg-white border-zinc-800 text-zinc-800 dark:bg-zinc-900 dark:border-zinc-200 dark:text-zinc-200"},{variant:"bordered",color:"success",className:"bg-white border-green-600 text-green-600 dark:bg-zinc-900 dark:border-green-500 dark:text-green-500"},{variant:"bordered",color:"warning",className:"bg-white border-amber-600 text-amber-600 dark:bg-zinc-900 dark:border-amber-500 dark:text-amber-500"},{variant:"bordered",color:"danger",className:"bg-white border-red-600 text-red-600 dark:bg-zinc-900 dark:border-red-500 dark:text-red-500"},{variant:"bordered",color:"info",className:"bg-white border-blue-600 text-blue-600 dark:bg-zinc-900 dark:border-blue-500 dark:text-blue-500"},{size:"sm",className:"min-w-4 h-4 text-[10px] px-1"},{size:"md",className:"min-w-5 h-5 text-xs px-1"},{size:"lg",className:"min-w-6 h-6 text-sm px-1.5"}],defaultVariants:{variant:"solid",color:"default",size:"md",placement:"top-right"}}),m0={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},p0=_.forwardRef(({className:e,children:t,content:n,variant:r="solid",color:o="default",size:a="md",placement:s="top-right",isDot:i=false,...l},c)=>jsxs("div",{ref:c,className:m("relative inline-flex",e),...l,children:[t,jsx("span",{className:m(u0({variant:r,color:o,size:i?void 0:a,placement:s}),i&&m0[a||"md"],i&&"min-w-0 p-0"),children:!i&&n})]}));p0.displayName="Badge";var f0=cva("inline-flex items-center gap-1 font-medium rounded-full",{variants:{color:{default:"bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-white",success:"bg-green-600/20 text-green-700 dark:bg-green-500/20 dark:text-green-500",warning:"bg-amber-600/20 text-amber-700 dark:bg-amber-500/20 dark:text-amber-500",danger:"bg-red-600/20 text-red-700 dark:bg-red-500/20 dark:text-red-500",info:"bg-blue-600/20 text-blue-700 dark:bg-blue-500/20 dark:text-blue-500"},size:{sm:"px-2 py-0.5 text-[10px]",md:"px-2.5 py-0.5 text-xs",lg:"px-3 py-1 text-sm"}},defaultVariants:{color:"default",size:"md"}}),g0=_.forwardRef(({className:e,color:t,size:n,...r},o)=>jsx("span",{ref:o,className:m(f0({color:t,size:n}),e),...r}));g0.displayName="TextBadge";var ed=cva("animate-spin",{variants:{size:{sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},color:{default:"text-foreground",primary:"text-primary",muted:"text-muted-foreground",success:"text-success",warning:"text-warning",danger:"text-danger",white:"text-white"}},defaultVariants:{size:"md",color:"default"}}),h0={sm:"text-xs",md:"text-sm",lg:"text-base"},Ma=_.forwardRef(({className:e,size:t="md",color:n,label:r="Loading",text:o,textPosition:a="right",customColor:s,...i},l)=>{let c=jsxs("svg",{className:m(ed({size:t,color:s?void 0:n})),style:s?{color:s}:void 0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",role:"status","aria-label":r,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"})]});if(!o)return jsx("div",{ref:l,className:m("inline-flex",e),...i,children:c});let d=jsx("span",{className:m("text-muted-foreground",h0[t]),children:o}),u=a==="top"||a==="bottom";return jsxs("div",{ref:l,className:m("inline-flex items-center",u?"flex-col gap-2":"flex-row gap-3",(a==="left"||a==="top")&&(u?"flex-col-reverse":"flex-row-reverse"),e),...i,children:[c,d]})});Ma.displayName="Spinner";var nd=cva("inline-flex",{variants:{variant:{default:"",attached:""},orientation:{horizontal:"flex-row",vertical:"flex-col"},spacing:{none:"gap-0",sm:"gap-1",md:"gap-2",lg:"gap-3"}},compoundVariants:[{variant:"attached",spacing:["sm","md","lg"],className:"gap-0"},{variant:"attached",orientation:"horizontal",className:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px"},{variant:"attached",orientation:"vertical",className:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px"}],defaultVariants:{variant:"default",orientation:"horizontal",spacing:"sm"}}),rd=_.createContext({});function wi(){return _.useContext(rd)}var od=_.forwardRef(({className:e,variant:t,orientation:n,spacing:r,disabled:o,children:a,...s},i)=>jsx(rd.Provider,{value:{disabled:o},children:jsx("div",{ref:i,role:"group",className:m(nd({variant:t,orientation:n,spacing:r,className:e})),...s,children:a})}));od.displayName="ButtonGroup";var qr=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-all duration-200 ease-out cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed active:scale-[0.97] [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{solid:"",bordered:"border-2 border-current bg-transparent hover:opacity-70",light:"bg-transparent hover:bg-zinc-100 dark:hover:bg-zinc-800",flat:"bg-zinc-100 dark:bg-zinc-800 hover:opacity-70",ghost:"border-2 border-current bg-transparent"},color:{default:"",success:"",warning:"",danger:"",info:""},size:{sm:"h-9 px-3 text-xs",md:"h-10 px-4",lg:"h-11 px-5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},compoundVariants:[{variant:"solid",color:"default",className:"bg-zinc-800 text-white hover:bg-zinc-700 dark:bg-zinc-200 dark:text-zinc-900 dark:hover:bg-zinc-300"},{variant:"bordered",color:"default",className:"text-zinc-900 dark:text-white"},{variant:"light",color:"default",className:"text-zinc-900 hover:bg-zinc-100 dark:text-white dark:hover:bg-zinc-800"},{variant:"flat",color:"default",className:"bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-white"},{variant:"ghost",color:"default",className:"text-zinc-900 hover:bg-zinc-900 hover:text-white dark:text-white dark:hover:bg-white dark:hover:text-zinc-900"},{variant:"solid",color:"success",className:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-700 dark:text-white dark:hover:bg-green-600"},{variant:"bordered",color:"success",className:"text-green-600 dark:text-green-500"},{variant:"light",color:"success",className:"text-green-600 hover:bg-green-600/10 dark:text-green-500 dark:hover:bg-green-500/10"},{variant:"flat",color:"success",className:"bg-green-600/20 text-green-700 dark:bg-green-500/20 dark:text-green-500"},{variant:"ghost",color:"success",className:"text-green-600 hover:bg-green-600 hover:text-white dark:text-green-500 dark:hover:bg-green-500 dark:hover:text-white"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white hover:bg-amber-700 dark:bg-amber-700 dark:text-white dark:hover:bg-amber-600"},{variant:"bordered",color:"warning",className:"text-amber-600 dark:text-amber-500"},{variant:"light",color:"warning",className:"text-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:hover:bg-amber-500/10"},{variant:"flat",color:"warning",className:"bg-amber-600/20 text-amber-700 dark:bg-amber-500/20 dark:text-amber-500"},{variant:"ghost",color:"warning",className:"text-amber-600 hover:bg-amber-600 hover:text-white dark:text-amber-500 dark:hover:bg-amber-500 dark:hover:text-white"},{variant:"solid",color:"danger",className:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:text-white dark:hover:bg-red-600"},{variant:"bordered",color:"danger",className:"text-red-600 dark:text-red-500"},{variant:"light",color:"danger",className:"text-red-600 hover:bg-red-600/10 dark:text-red-500 dark:hover:bg-red-500/10"},{variant:"flat",color:"danger",className:"bg-red-600/20 text-red-700 dark:bg-red-500/20 dark:text-red-500"},{variant:"ghost",color:"danger",className:"text-red-600 hover:bg-red-600 hover:text-white dark:text-red-500 dark:hover:bg-red-500 dark:hover:text-white"},{variant:"solid",color:"info",className:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-700 dark:text-white dark:hover:bg-blue-600"},{variant:"bordered",color:"info",className:"text-blue-600 dark:text-blue-500"},{variant:"light",color:"info",className:"text-blue-600 hover:bg-blue-600/10 dark:text-blue-500 dark:hover:bg-blue-500/10"},{variant:"flat",color:"info",className:"bg-blue-600/20 text-blue-700 dark:bg-blue-500/20 dark:text-blue-500"},{variant:"ghost",color:"info",className:"text-blue-600 hover:bg-blue-600 hover:text-white dark:text-blue-500 dark:hover:bg-blue-500 dark:hover:text-white"}],defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md"}}),ae=_.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,href:a,loading:s=false,startContent:i,endContent:l,children:c,disabled:d,style:u,isIconOnly:f,...p},g)=>{let h=wi(),v=d||h.disabled||s,b=u,w=f?r==="sm"?"!px-0 !w-9":r==="lg"?"!px-0 !w-11":"!px-0 !w-10":"",R=s?jsxs(Fragment,{children:[jsx(Ma,{size:"sm",color:t==="solid"?"white":"default"}),c]}):jsxs(Fragment,{children:[i,c,l]});return a?v?jsx("span",{role:"link","aria-disabled":"true",className:m(qr({variant:t,color:n,size:r,radius:o,className:e}),w,"pointer-events-none opacity-50 cursor-not-allowed"),style:b,children:R}):jsx("a",{href:a,className:m(qr({variant:t,color:n,size:r,radius:o,className:e}),w),style:b,...p,children:R}):jsx("button",{type:"button",className:m(qr({variant:t,color:n,size:r,radius:o,className:e}),w),ref:g,disabled:v,style:b,...p,children:R})});ae.displayName="Button";var ld=cva("border bg-card text-card-foreground shadow-sm",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg"}},defaultVariants:{radius:"lg"}}),cd=_.forwardRef(({className:e,radius:t,...n},r)=>jsx("div",{ref:r,className:m(ld({radius:t,className:e})),...n}));cd.displayName="Card";var dd=_.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex flex-col space-y-1.5 p-6",e),...t}));dd.displayName="CardHeader";var ud=_.forwardRef(({className:e,...t},n)=>jsx("h3",{ref:n,className:m("text-2xl font-semibold leading-none tracking-tight",e),...t}));ud.displayName="CardTitle";var md=_.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:m("text-sm text-muted-foreground",e),...t}));md.displayName="CardDescription";var pd=_.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("p-6 pt-0",e),...t}));pd.displayName="CardContent";var fd=_.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center p-6 pt-0",e),...t}));fd.displayName="CardFooter";var Ao=_.forwardRef(({className:e,checked:t,defaultChecked:n=false,onCheckedChange:r,disabled:o,required:a,name:s,value:i="on",text:l,description:c,onKeyDown:d,...u},f)=>{let[p,g]=_.useState(n),h=t!==void 0,v=h?t:p,[b,w]=_.useState(false),x=_.useId(),R=()=>{if(o)return;let k=v==="indeterminate"?true:!v;h||g(k),r?.(k);},C=k=>{k.key==="Enter"&&k.preventDefault(),d?.(k);},y=v===true,N=v==="indeterminate",T=jsxs(Fragment,{children:[jsx("button",{type:"button",role:"checkbox",id:l?x:void 0,"aria-checked":N?"mixed":y,"aria-required":a,disabled:o,ref:f,className:m("peer h-4 w-4 shrink-0 rounded-sm border border-primary focus-visible:outline-none cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 transition-colors",y&&"bg-primary text-primary-foreground",N&&"bg-background text-foreground",!l&&e),style:{borderColor:b?"var(--color-foreground)":void 0},onClick:R,onKeyDown:C,onFocus:()=>w(true),onBlur:()=>w(false),...u,children:(y||N)&&jsx("span",{className:"flex items-center justify-center text-current",children:N?jsx(Minus,{className:"h-4 w-4"}):jsx(Check,{className:"h-4 w-4"})})}),s&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:s,value:i,checked:y,required:a,disabled:o,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]});return l?jsxs("div",{className:m("flex items-start gap-2",e),children:[T,jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("label",{htmlFor:x,className:m("text-sm font-medium leading-none cursor-pointer",o&&"cursor-not-allowed opacity-50"),children:l}),c&&jsx("p",{className:"text-xs text-muted-foreground",children:c})]})]}):T});Ao.displayName="Checkbox";var N0=cva("flex h-10 w-full border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"md"}}),ka=_.forwardRef(({className:e,type:t,radius:n,label:r,isRequired:o,description:a,errorMessage:s,isInvalid:i,onFocus:l,onBlur:c,style:d,...u},f)=>{let[p,g]=_.useState(false),h=_.useId(),v=u.id||h,b=i||!!s,w=jsx("input",{id:v,type:t,className:m(N0({radius:n}),b&&"border-danger focus:border-danger",!r&&e),ref:f,required:o,"aria-invalid":b,"aria-describedby":a||s?`${v}-description`:void 0,style:{...d,borderColor:b?void 0:p?"var(--color-foreground)":void 0},onFocus:x=>{g(true),l?.(x);},onBlur:x=>{g(false),c?.(x);},...u});return !r&&!a&&!s?w:jsxs("div",{className:m("flex flex-col gap-1.5",e),children:[r&&jsxs("label",{htmlFor:v,className:"text-sm font-medium leading-none",children:[r,o&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),w,(a||s)&&jsx("p",{id:`${v}-description`,className:m("text-xs",b?"text-danger":"text-muted-foreground"),children:s||a})]})});ka.displayName="Input";var P0=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),wr=_.forwardRef(({className:e,...t},n)=>jsx("label",{ref:n,className:m(P0(),e),...t}));wr.displayName="Label";var Wn=_.forwardRef(({className:e,orientation:t="horizontal",decorative:n=true,text:r,...o},a)=>{let s=n?{role:"none"}:{role:"separator","aria-orientation":t};return r&&t==="horizontal"?jsxs("div",{className:m("flex items-center gap-4",e),children:[jsx("div",{...s,className:"shrink-0 bg-border h-[1px] flex-1"}),jsx("span",{className:"text-sm text-muted-foreground",children:r}),jsx("div",{...s,className:"shrink-0 bg-border h-[1px] flex-1"})]}):jsx("div",{ref:a,...s,className:m("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o})});Wn.displayName="Separator";var S0="peer inline-flex 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-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",Ea={default:"bg-zinc-800 dark:bg-zinc-200",success:"bg-green-600 dark:bg-green-500",warning:"bg-amber-600 dark:bg-amber-500",danger:"bg-red-600 dark:bg-red-500",info:"bg-blue-600 dark:bg-blue-500"},hd={sm:{track:"h-5 w-9",thumb:"h-4 w-4",translate:"translate-x-4"},md:{track:"h-6 w-11",thumb:"h-5 w-5",translate:"translate-x-5"},lg:{track:"h-7 w-14",thumb:"h-6 w-6",translate:"translate-x-7"}},xd=_.forwardRef(({className:e,color:t,size:n="md",customColor:r,checked:o,defaultChecked:a=false,onCheckedChange:s,disabled:i,required:l,name:c,value:d="on",onKeyDown:u,style:f,...p},g)=>{let[h,v]=_.useState(a),b=o!==void 0,w=b?o:h,x=()=>{if(i)return;let N=!w;b||v(N),s?.(N);},R=N=>{N.key==="Enter"&&N.preventDefault(),u?.(N);},C=t&&Ea[t]?Ea[t]:Ea.default,y=hd[n]||hd.md;return jsxs(Fragment,{children:[jsx("button",{type:"button",role:"switch","aria-checked":w,"aria-required":l,"data-state":w?"checked":"unchecked",disabled:i,ref:g,className:m(S0,y.track,w?r?"":C:"bg-input",e),style:r&&w?{backgroundColor:r,...f}:f,onClick:x,onKeyDown:R,...p,children:jsx("span",{className:m("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",y.thumb,w?y.translate:"translate-x-0")})}),c&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:c,value:d,checked:w,required:l,disabled:i,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]})});xd.displayName="Switch";var V0=cva("flex min-h-[80px] w-full border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg"}},defaultVariants:{radius:"md"}}),yd=_.forwardRef(({className:e,radius:t,onFocus:n,onBlur:r,style:o,...a},s)=>{let[i,l]=_.useState(false);return jsx("textarea",{className:m(V0({radius:t,className:e})),ref:s,style:{...o,borderColor:i?"var(--color-foreground)":void 0},onFocus:c=>{l(true),n?.(c);},onBlur:c=>{l(false),r?.(c);},...a})});yd.displayName="Textarea";var wd=cva("rounded-md bg-muted",{variants:{variant:{pulse:"animate-pulse",shimmer:"skeleton-shimmer",static:""}},defaultVariants:{variant:"pulse"}}),Da=_.forwardRef(({className:e,variant:t,...n},r)=>jsx("div",{ref:r,className:m(wd({variant:t,className:e})),...n}));Da.displayName="Skeleton";var F0=cva("relative flex shrink-0 overflow-hidden cursor-pointer",{variants:{size:{sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{size:"md",radius:"full"}}),Cd=_.createContext(null),Td=()=>{let e=_.useContext(Cd);if(!e)throw new Error("Avatar components must be used within an Avatar");return e},Cr=_.forwardRef(({className:e,size:t,radius:n,...r},o)=>{let[a,s]=_.useState("idle");return jsx(Cd.Provider,{value:{imageLoadingStatus:a,onImageLoadingStatusChange:s},children:jsx("span",{ref:o,className:m(F0({size:t,radius:n,className:e})),...r})})});Cr.displayName="Avatar";var Jr=_.forwardRef(({className:e,src:t,alt:n,onLoadingStatusChange:r,...o},a)=>{let{imageLoadingStatus:s,onImageLoadingStatusChange:i}=Td();return _.useEffect(()=>{if(!t){i("error");return}i("loading"),r?.("loading");let l=new Image;l.src=t,l.onload=()=>{i("loaded"),r?.("loaded");},l.onerror=()=>{i("error"),r?.("error");};},[t,i,r]),s!=="loaded"?null:jsx("img",{ref:a,src:t,alt:n,className:m("aspect-square h-full w-full object-cover",e),...o})});Jr.displayName="AvatarImage";var Tr=_.forwardRef(({className:e,delayMs:t=0,children:n,...r},o)=>{let{imageLoadingStatus:a}=Td(),[s,i]=_.useState(t===0);return _.useEffect(()=>{if(t>0){let l=setTimeout(()=>i(true),t);return ()=>clearTimeout(l)}},[t]),a==="loaded"||!s?null:jsx("span",{ref:o,className:m("flex h-full w-full items-center justify-center bg-muted",e),...r,children:n})});Tr.displayName="AvatarFallback";var Nd=_.createContext({delayDuration:700,skipDelayDuration:300}),jn=({children:e,delayDuration:t=700,skipDelayDuration:n=300})=>jsx(Nd.Provider,{value:{delayDuration:t,skipDelayDuration:n},children:e});jn.displayName="TooltipProvider";var kd=_.createContext(null),Pd=()=>{let e=_.useContext(kd);if(!e)throw new Error("Tooltip components must be used within a Tooltip");return e},_n=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,delayDuration:o})=>{let a=_.useContext(Nd),[s,i]=_.useState(n),l=t!==void 0,c=l?t:s,d=_.useRef(null),u=_.useId(),f=_.useRef(null),p=o??a.delayDuration,g=_.useCallback(h=>{f.current&&clearTimeout(f.current),h?f.current=setTimeout(()=>{l||i(true),r?.(true);},p):(l||i(false),r?.(false));},[l,r,p]);return _.useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx(kd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentId:u},children:e})};_n.displayName="Tooltip";var Yn=_.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l,contentId:c,open:d}=Pd();return jsx("button",{ref:h=>{l.current=h,typeof s=="function"?s(h):s&&(s.current=h);},type:"button","aria-describedby":d?c:void 0,onMouseEnter:h=>{t?.(h),i(true);},onMouseLeave:h=>{n?.(h),i(false);},onFocus:h=>{r?.(h),i(true);},onBlur:h=>{o?.(h),i(false);},...a,children:e})});Yn.displayName="TooltipTrigger";var Xn=_.forwardRef(({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:o=0,children:a,...s},i)=>{let{open:l,triggerRef:c,contentId:d}=Pd(),[u,f]=_.useState({top:0,left:0}),[p,g]=_.useState(false),h=_.useRef(null);if(_.useEffect(()=>{g(true);},[]),_.useEffect(()=>{if(!l||!c.current||!h.current)return;let b=c.current.getBoundingClientRect(),w=h.current.getBoundingClientRect(),x=0,R=0;switch(t){case "top":x=b.top-w.height-n;break;case "bottom":x=b.bottom+n;break;case "left":R=b.left-w.width-n;break;case "right":R=b.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":R=b.left+o;break;case "center":R=b.left+b.width/2-w.width/2;break;case "end":R=b.right-w.width-o;break}else switch(r){case "start":x=b.top+o;break;case "center":x=b.top+b.height/2-w.height/2;break;case "end":x=b.bottom-w.height-o;break}f({top:x,left:R});},[l,t,n,r,o,c]),!p||!l)return null;let v={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[t];return Oa.createPortal(jsx("div",{ref:b=>{h.current=b,typeof i=="function"?i(b):i&&(i.current=b);},id:d,role:"tooltip","data-side":t,className:m("fixed z-50 overflow-hidden rounded-md px-3 py-1.5 text-xs bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",v,e),style:{top:u.top,left:u.left},...s,children:a}),document.body)});Xn.displayName="TooltipContent";var De=_.forwardRef(({className:e,orientation:t="vertical",visibility:n="visible",children:r,style:o,...a},s)=>{let[i,l]=_.useState(false),c=_.useId().replace(/:/g,""),d=n==="visible"||n==="hover"&&i,u=d?"rgba(0,0,0,0.3)":"transparent",f=d?"rgba(255,255,255,0.3)":"transparent",p=`
1
+ import*as _ from'react';import {createContext,useState,useEffect,useContext,useCallback,useRef,useMemo}from'react';import {cva}from'class-variance-authority';import {AlertCircle,AlertTriangle,CheckCircle2,Info,Minus,Check,X,ChevronDown,Search,ChevronRight,Circle,ChevronsUpDown,PanelLeft,PanelLeftOpen,PanelRightOpen,PanelLeftClose,PanelRightClose,EyeOff,Eye,Plus,Heart,Star,TrendingUp,TrendingDown,Upload,Clock,Menu,ExternalLink,ArrowUp,File,Folder,FolderOpen,Loader2,Copy,Calendar,ZoomOut,ZoomIn,RotateCw,Download,Minimize2,Maximize2,ChevronLeft,GripVertical,Undo,Redo,Heading1,Heading2,Heading3,Bold,Italic,Underline,Strikethrough,List,ListOrdered,AlignLeft,AlignCenter,AlignRight,Quote,Code,Link,Unlink,Moon,Sun,Monitor,MoreHorizontal,HelpCircle,ArrowRight,Hash,User,Settings,Bell,CheckCircle,Trash2,Image as Image$1,FileVideo,FileAudio,FileText,FileArchive,ChevronUp,ArrowDown}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as Oa from'react-dom';import {Toaster}from'sonner';export{toast}from'sonner';import {Drawer}from'vaul';import {DayPicker,useDayPicker}from'react-day-picker';import {getMonth,getYear,setMonth,setYear}from'date-fns';import {Command}from'cmdk';import {Panel,Group,Separator}from'react-resizable-panels';import {HexColorPicker,HexColorInput}from'react-colorful';import {themes,Highlight}from'prism-react-renderer';import {ResponsiveContainer,LineChart,CartesianGrid,XAxis,YAxis,Tooltip,Legend,Line,BarChart,Bar,PieChart,Pie,Cell,AreaChart,Area}from'recharts';import {useSensors,useSensor,PointerSensor,KeyboardSensor,DndContext,closestCorners,DragOverlay}from'@dnd-kit/core';import {sortableKeyboardCoordinates,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import {CSS}from'@dnd-kit/utilities';import XM from'embla-carousel-react';import {useEditor,EditorContent}from'@tiptap/react';import oN from'@tiptap/starter-kit';import aN from'@tiptap/extension-link';import sN from'@tiptap/extension-underline';import iN from'@tiptap/extension-text-align';import lN from'@tiptap/extension-placeholder';import EN,{centerCrop,makeAspectCrop}from'react-image-crop';import'react-image-crop/dist/ReactCrop.css';import zN from'react-qr-code';import {useTheme,ThemeProvider}from'next-themes';export{useTheme}from'next-themes';import {motion,AnimatePresence,useInView,useMotionValue,useTransform,animate,useScroll,useSpring}from'framer-motion';import Eo from'canvas-confetti';function m(...e){return twMerge(clsx(e))}var s0=cva("relative w-full p-4",{variants:{variant:{solid:"border",bordered:"border bg-transparent",flat:""},type:{default:"",success:"",warning:"",error:""},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},compoundVariants:[{variant:"solid",type:"default",className:"!border-primary bg-primary text-primary-foreground [&>svg]:text-primary-foreground"},{variant:"bordered",type:"default",className:"!border-primary text-primary [&>svg]:text-primary"},{variant:"flat",type:"default",className:"bg-primary/10 text-primary [&>svg]:text-primary"},{variant:"solid",type:"success",className:"!border-green-600 bg-green-600 text-white dark:!border-green-500 dark:bg-green-500 [&>svg]:text-white"},{variant:"bordered",type:"success",className:"!border-green-600 text-green-600 dark:!border-green-500 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"flat",type:"success",className:"bg-green-600/10 text-green-600 dark:bg-green-500/10 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"solid",type:"warning",className:"!border-amber-600 bg-amber-600 text-white dark:!border-amber-500 dark:bg-amber-500 [&>svg]:text-white"},{variant:"bordered",type:"warning",className:"!border-amber-600 text-amber-600 dark:!border-amber-500 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"flat",type:"warning",className:"bg-amber-600/10 text-amber-600 dark:bg-amber-500/10 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"solid",type:"error",className:"!border-red-600 bg-red-600 text-white dark:!border-red-500 dark:bg-red-500 [&>svg]:text-white"},{variant:"bordered",type:"error",className:"!border-red-600 text-red-600 dark:!border-red-500 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"},{variant:"flat",type:"error",className:"bg-red-600/10 text-red-600 dark:bg-red-500/10 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"}],defaultVariants:{variant:"solid",type:"default",radius:"md"}}),i0={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},l0=_.forwardRef(({className:e,variant:t="solid",type:n="default",radius:r="md",icon:o,hideIcon:a=false,endContent:s,children:i,...l},c)=>{let d=i0[n],u=!a,f=o!==void 0?o:d?jsx(d,{className:"h-4 w-4"}):null;return jsxs("div",{ref:c,role:"alert",className:m(s0({variant:t,type:n,radius:r}),s&&"flex items-center justify-between",e),...l,children:[jsxs("div",{className:"flex items-start gap-3",children:[u&&f&&jsx("span",{className:"mt-0.5 shrink-0",children:f}),jsx("div",{children:i})]}),s&&jsx("div",{className:"shrink-0 ml-4",children:s})]})});l0.displayName="Alert";var c0=_.forwardRef(({className:e,...t},n)=>jsx("h5",{ref:n,className:m("mb-1 font-medium leading-none tracking-tight",e),...t}));c0.displayName="AlertTitle";var d0=_.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("text-sm [&_p]:leading-relaxed",e),...t}));d0.displayName="AlertDescription";var u0=cva("absolute rounded-full flex items-center justify-center font-semibold",{variants:{variant:{solid:"",bordered:"border-2"},color:{default:"",success:"",warning:"",danger:"",info:""},size:{sm:"",md:"",lg:""},placement:{"top-right":"-top-1 -right-1","top-left":"-top-1 -left-1","bottom-right":"-bottom-1 -right-1","bottom-left":"-bottom-1 -left-1"}},compoundVariants:[{variant:"solid",color:"default",className:"bg-zinc-800 text-white dark:bg-zinc-200 dark:text-zinc-900"},{variant:"solid",color:"success",className:"bg-green-600 text-white dark:bg-green-500"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white dark:bg-amber-500"},{variant:"solid",color:"danger",className:"bg-red-600 text-white dark:bg-red-500"},{variant:"solid",color:"info",className:"bg-blue-600 text-white dark:bg-blue-500"},{variant:"bordered",color:"default",className:"bg-white border-zinc-800 text-zinc-800 dark:bg-zinc-900 dark:border-zinc-200 dark:text-zinc-200"},{variant:"bordered",color:"success",className:"bg-white border-green-600 text-green-600 dark:bg-zinc-900 dark:border-green-500 dark:text-green-500"},{variant:"bordered",color:"warning",className:"bg-white border-amber-600 text-amber-600 dark:bg-zinc-900 dark:border-amber-500 dark:text-amber-500"},{variant:"bordered",color:"danger",className:"bg-white border-red-600 text-red-600 dark:bg-zinc-900 dark:border-red-500 dark:text-red-500"},{variant:"bordered",color:"info",className:"bg-white border-blue-600 text-blue-600 dark:bg-zinc-900 dark:border-blue-500 dark:text-blue-500"},{size:"sm",className:"min-w-4 h-4 text-[10px] px-1"},{size:"md",className:"min-w-5 h-5 text-xs px-1"},{size:"lg",className:"min-w-6 h-6 text-sm px-1.5"}],defaultVariants:{variant:"solid",color:"default",size:"md",placement:"top-right"}}),m0={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},p0=_.forwardRef(({className:e,children:t,content:n,variant:r="solid",color:o="default",size:a="md",placement:s="top-right",isDot:i=false,...l},c)=>jsxs("div",{ref:c,className:m("relative inline-flex",e),...l,children:[t,jsx("span",{className:m(u0({variant:r,color:o,size:i?void 0:a,placement:s}),i&&m0[a||"md"],i&&"min-w-0 p-0"),children:!i&&n})]}));p0.displayName="Badge";var f0=cva("inline-flex items-center gap-1 font-medium rounded-full",{variants:{color:{default:"bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-white",success:"bg-green-600/20 text-green-700 dark:bg-green-500/20 dark:text-green-500",warning:"bg-amber-600/20 text-amber-700 dark:bg-amber-500/20 dark:text-amber-500",danger:"bg-red-600/20 text-red-700 dark:bg-red-500/20 dark:text-red-500",info:"bg-blue-600/20 text-blue-700 dark:bg-blue-500/20 dark:text-blue-500"},size:{sm:"px-2 py-0.5 text-[10px]",md:"px-2.5 py-0.5 text-xs",lg:"px-3 py-1 text-sm"}},defaultVariants:{color:"default",size:"md"}}),g0=_.forwardRef(({className:e,color:t,size:n,...r},o)=>jsx("span",{ref:o,className:m(f0({color:t,size:n}),e),...r}));g0.displayName="TextBadge";var ed=cva("animate-spin",{variants:{size:{sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},color:{default:"text-foreground",primary:"text-primary",muted:"text-muted-foreground",success:"text-success",warning:"text-warning",danger:"text-danger",white:"text-white"}},defaultVariants:{size:"md",color:"default"}}),h0={sm:"text-xs",md:"text-sm",lg:"text-base"},Ma=_.forwardRef(({className:e,size:t="md",color:n,label:r="Loading",text:o,textPosition:a="right",customColor:s,...i},l)=>{let c=jsxs("svg",{className:m(ed({size:t,color:s?void 0:n})),style:s?{color:s}:void 0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",role:"status","aria-label":r,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"})]});if(!o)return jsx("div",{ref:l,className:m("inline-flex",e),...i,children:c});let d=jsx("span",{className:m("text-muted-foreground",h0[t]),children:o}),u=a==="top"||a==="bottom";return jsxs("div",{ref:l,className:m("inline-flex items-center",u?"flex-col gap-2":"flex-row gap-3",(a==="left"||a==="top")&&(u?"flex-col-reverse":"flex-row-reverse"),e),...i,children:[c,d]})});Ma.displayName="Spinner";var nd=cva("inline-flex",{variants:{variant:{default:"",attached:""},orientation:{horizontal:"flex-row",vertical:"flex-col"},spacing:{none:"gap-0",sm:"gap-1",md:"gap-2",lg:"gap-3"}},compoundVariants:[{variant:"attached",spacing:["sm","md","lg"],className:"gap-0"},{variant:"attached",orientation:"horizontal",className:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px"},{variant:"attached",orientation:"vertical",className:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px"}],defaultVariants:{variant:"default",orientation:"horizontal",spacing:"sm"}}),rd=_.createContext({});function wi(){return _.useContext(rd)}var od=_.forwardRef(({className:e,variant:t,orientation:n,spacing:r,disabled:o,children:a,...s},i)=>jsx(rd.Provider,{value:{disabled:o},children:jsx("div",{ref:i,role:"group",className:m(nd({variant:t,orientation:n,spacing:r,className:e})),...s,children:a})}));od.displayName="ButtonGroup";var qr=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-all duration-200 ease-out cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed active:scale-[0.97] [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{solid:"",bordered:"border bg-transparent hover:opacity-70",light:"bg-transparent hover:bg-zinc-100 dark:hover:bg-zinc-800",flat:"bg-zinc-100 dark:bg-zinc-800 hover:opacity-70",ghost:"border-2 border-current bg-transparent"},color:{default:"",success:"",warning:"",danger:"",info:""},size:{sm:"h-9 px-3 text-xs",md:"h-10 px-4",lg:"h-11 px-5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},compoundVariants:[{variant:"solid",color:"default",className:"bg-zinc-800 text-white hover:bg-zinc-700 dark:bg-zinc-200 dark:text-zinc-900 dark:hover:bg-zinc-300"},{variant:"bordered",color:"default",className:"border-zinc-300 dark:border-zinc-700 text-zinc-900 dark:text-white"},{variant:"light",color:"default",className:"text-zinc-900 hover:bg-zinc-100 dark:text-white dark:hover:bg-zinc-800"},{variant:"flat",color:"default",className:"bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-white"},{variant:"ghost",color:"default",className:"text-zinc-900 hover:bg-zinc-900 hover:text-white dark:text-white dark:hover:bg-white dark:hover:text-zinc-900"},{variant:"solid",color:"success",className:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-700 dark:text-white dark:hover:bg-green-600"},{variant:"bordered",color:"success",className:"border-green-600 dark:border-green-500 text-green-600 dark:text-green-500"},{variant:"light",color:"success",className:"text-green-600 hover:bg-green-600/10 dark:text-green-500 dark:hover:bg-green-500/10"},{variant:"flat",color:"success",className:"bg-green-600/20 text-green-700 dark:bg-green-500/20 dark:text-green-500"},{variant:"ghost",color:"success",className:"text-green-600 hover:bg-green-600 hover:text-white dark:text-green-500 dark:hover:bg-green-500 dark:hover:text-white"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white hover:bg-amber-700 dark:bg-amber-700 dark:text-white dark:hover:bg-amber-600"},{variant:"bordered",color:"warning",className:"border-amber-600 dark:border-amber-500 text-amber-600 dark:text-amber-500"},{variant:"light",color:"warning",className:"text-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:hover:bg-amber-500/10"},{variant:"flat",color:"warning",className:"bg-amber-600/20 text-amber-700 dark:bg-amber-500/20 dark:text-amber-500"},{variant:"ghost",color:"warning",className:"text-amber-600 hover:bg-amber-600 hover:text-white dark:text-amber-500 dark:hover:bg-amber-500 dark:hover:text-white"},{variant:"solid",color:"danger",className:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:text-white dark:hover:bg-red-600"},{variant:"bordered",color:"danger",className:"border-red-600 dark:border-red-500 text-red-600 dark:text-red-500"},{variant:"light",color:"danger",className:"text-red-600 hover:bg-red-600/10 dark:text-red-500 dark:hover:bg-red-500/10"},{variant:"flat",color:"danger",className:"bg-red-600/20 text-red-700 dark:bg-red-500/20 dark:text-red-500"},{variant:"ghost",color:"danger",className:"text-red-600 hover:bg-red-600 hover:text-white dark:text-red-500 dark:hover:bg-red-500 dark:hover:text-white"},{variant:"solid",color:"info",className:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-700 dark:text-white dark:hover:bg-blue-600"},{variant:"bordered",color:"info",className:"border-blue-600 dark:border-blue-500 text-blue-600 dark:text-blue-500"},{variant:"light",color:"info",className:"text-blue-600 hover:bg-blue-600/10 dark:text-blue-500 dark:hover:bg-blue-500/10"},{variant:"flat",color:"info",className:"bg-blue-600/20 text-blue-700 dark:bg-blue-500/20 dark:text-blue-500"},{variant:"ghost",color:"info",className:"text-blue-600 hover:bg-blue-600 hover:text-white dark:text-blue-500 dark:hover:bg-blue-500 dark:hover:text-white"}],defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md"}}),ae=_.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,href:a,loading:s=false,startContent:i,endContent:l,children:c,disabled:d,style:u,isIconOnly:f,...p},g)=>{let h=wi(),v=d||h.disabled||s,b=u,w=f?r==="sm"?"!px-0 !w-9":r==="lg"?"!px-0 !w-11":"!px-0 !w-10":"",R=s?jsxs(Fragment,{children:[jsx(Ma,{size:"sm",color:t==="solid"?"white":"default"}),c]}):jsxs(Fragment,{children:[i,c,l]});return a?v?jsx("span",{role:"link","aria-disabled":"true",className:m(qr({variant:t,color:n,size:r,radius:o,className:e}),w,"pointer-events-none opacity-50 cursor-not-allowed"),style:b,children:R}):jsx("a",{href:a,className:m(qr({variant:t,color:n,size:r,radius:o,className:e}),w),style:b,...p,children:R}):jsx("button",{type:"button",className:m(qr({variant:t,color:n,size:r,radius:o,className:e}),w),ref:g,disabled:v,style:b,...p,children:R})});ae.displayName="Button";var ld=cva("border bg-card text-card-foreground shadow-sm",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg"}},defaultVariants:{radius:"lg"}}),cd=_.forwardRef(({className:e,radius:t,...n},r)=>jsx("div",{ref:r,className:m(ld({radius:t,className:e})),...n}));cd.displayName="Card";var dd=_.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex flex-col space-y-1.5 p-6",e),...t}));dd.displayName="CardHeader";var ud=_.forwardRef(({className:e,...t},n)=>jsx("h3",{ref:n,className:m("text-2xl font-semibold leading-none tracking-tight",e),...t}));ud.displayName="CardTitle";var md=_.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:m("text-sm text-muted-foreground",e),...t}));md.displayName="CardDescription";var pd=_.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("p-6 pt-0",e),...t}));pd.displayName="CardContent";var fd=_.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center p-6 pt-0",e),...t}));fd.displayName="CardFooter";var Ao=_.forwardRef(({className:e,checked:t,defaultChecked:n=false,onCheckedChange:r,disabled:o,required:a,name:s,value:i="on",text:l,description:c,onKeyDown:d,...u},f)=>{let[p,g]=_.useState(n),h=t!==void 0,v=h?t:p,[b,w]=_.useState(false),x=_.useId(),R=()=>{if(o)return;let k=v==="indeterminate"?true:!v;h||g(k),r?.(k);},C=k=>{k.key==="Enter"&&k.preventDefault(),d?.(k);},y=v===true,N=v==="indeterminate",T=jsxs(Fragment,{children:[jsx("button",{type:"button",role:"checkbox",id:l?x:void 0,"aria-checked":N?"mixed":y,"aria-required":a,disabled:o,ref:f,className:m("peer h-4 w-4 shrink-0 rounded-sm border border-primary focus-visible:outline-none cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 transition-colors",y&&"bg-primary text-primary-foreground",N&&"bg-background text-foreground",!l&&e),style:{borderColor:b?"var(--color-foreground)":void 0},onClick:R,onKeyDown:C,onFocus:()=>w(true),onBlur:()=>w(false),...u,children:(y||N)&&jsx("span",{className:"flex items-center justify-center text-current",children:N?jsx(Minus,{className:"h-4 w-4"}):jsx(Check,{className:"h-4 w-4"})})}),s&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:s,value:i,checked:y,required:a,disabled:o,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]});return l?jsxs("div",{className:m("flex items-start gap-2",e),children:[T,jsxs("div",{className:"flex flex-col gap-0.5",children:[jsx("label",{htmlFor:x,className:m("text-sm font-medium leading-none cursor-pointer",o&&"cursor-not-allowed opacity-50"),children:l}),c&&jsx("p",{className:"text-xs text-muted-foreground",children:c})]})]}):T});Ao.displayName="Checkbox";var N0=cva("flex h-10 w-full border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"md"}}),ka=_.forwardRef(({className:e,type:t,radius:n,label:r,isRequired:o,description:a,errorMessage:s,isInvalid:i,onFocus:l,onBlur:c,style:d,...u},f)=>{let[p,g]=_.useState(false),h=_.useId(),v=u.id||h,b=i||!!s,w=jsx("input",{id:v,type:t,className:m(N0({radius:n}),b&&"border-danger focus:border-danger",!r&&e),ref:f,required:o,"aria-invalid":b,"aria-describedby":a||s?`${v}-description`:void 0,style:{...d,borderColor:b?void 0:p?"var(--color-foreground)":void 0},onFocus:x=>{g(true),l?.(x);},onBlur:x=>{g(false),c?.(x);},...u});return !r&&!a&&!s?w:jsxs("div",{className:m("flex flex-col gap-1.5",e),children:[r&&jsxs("label",{htmlFor:v,className:"text-sm font-medium leading-none",children:[r,o&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),w,(a||s)&&jsx("p",{id:`${v}-description`,className:m("text-xs",b?"text-danger":"text-muted-foreground"),children:s||a})]})});ka.displayName="Input";var P0=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),wr=_.forwardRef(({className:e,...t},n)=>jsx("label",{ref:n,className:m(P0(),e),...t}));wr.displayName="Label";var Wn=_.forwardRef(({className:e,orientation:t="horizontal",decorative:n=true,text:r,...o},a)=>{let s=n?{role:"none"}:{role:"separator","aria-orientation":t};return r&&t==="horizontal"?jsxs("div",{className:m("flex items-center gap-4",e),children:[jsx("div",{...s,className:"shrink-0 bg-border h-[1px] flex-1"}),jsx("span",{className:"text-sm text-muted-foreground",children:r}),jsx("div",{...s,className:"shrink-0 bg-border h-[1px] flex-1"})]}):jsx("div",{ref:a,...s,className:m("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o})});Wn.displayName="Separator";var S0="peer inline-flex 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-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",Ea={default:"bg-zinc-800 dark:bg-zinc-200",success:"bg-green-600 dark:bg-green-500",warning:"bg-amber-600 dark:bg-amber-500",danger:"bg-red-600 dark:bg-red-500",info:"bg-blue-600 dark:bg-blue-500"},hd={sm:{track:"h-5 w-9",thumb:"h-4 w-4",translate:"translate-x-4"},md:{track:"h-6 w-11",thumb:"h-5 w-5",translate:"translate-x-5"},lg:{track:"h-7 w-14",thumb:"h-6 w-6",translate:"translate-x-7"}},xd=_.forwardRef(({className:e,color:t,size:n="md",customColor:r,checked:o,defaultChecked:a=false,onCheckedChange:s,disabled:i,required:l,name:c,value:d="on",onKeyDown:u,style:f,...p},g)=>{let[h,v]=_.useState(a),b=o!==void 0,w=b?o:h,x=()=>{if(i)return;let N=!w;b||v(N),s?.(N);},R=N=>{N.key==="Enter"&&N.preventDefault(),u?.(N);},C=t&&Ea[t]?Ea[t]:Ea.default,y=hd[n]||hd.md;return jsxs(Fragment,{children:[jsx("button",{type:"button",role:"switch","aria-checked":w,"aria-required":l,"data-state":w?"checked":"unchecked",disabled:i,ref:g,className:m(S0,y.track,w?r?"":C:"bg-input",e),style:r&&w?{backgroundColor:r,...f}:f,onClick:x,onKeyDown:R,...p,children:jsx("span",{className:m("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",y.thumb,w?y.translate:"translate-x-0")})}),c&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:c,value:d,checked:w,required:l,disabled:i,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]})});xd.displayName="Switch";var V0=cva("flex min-h-[80px] w-full border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg"}},defaultVariants:{radius:"md"}}),yd=_.forwardRef(({className:e,radius:t,onFocus:n,onBlur:r,style:o,...a},s)=>{let[i,l]=_.useState(false);return jsx("textarea",{className:m(V0({radius:t,className:e})),ref:s,style:{...o,borderColor:i?"var(--color-foreground)":void 0},onFocus:c=>{l(true),n?.(c);},onBlur:c=>{l(false),r?.(c);},...a})});yd.displayName="Textarea";var wd=cva("rounded-md bg-muted",{variants:{variant:{pulse:"animate-pulse",shimmer:"skeleton-shimmer",static:""}},defaultVariants:{variant:"pulse"}}),Da=_.forwardRef(({className:e,variant:t,...n},r)=>jsx("div",{ref:r,className:m(wd({variant:t,className:e})),...n}));Da.displayName="Skeleton";var F0=cva("relative flex shrink-0 overflow-hidden cursor-pointer",{variants:{size:{sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{size:"md",radius:"full"}}),Cd=_.createContext(null),Td=()=>{let e=_.useContext(Cd);if(!e)throw new Error("Avatar components must be used within an Avatar");return e},Cr=_.forwardRef(({className:e,size:t,radius:n,...r},o)=>{let[a,s]=_.useState("idle");return jsx(Cd.Provider,{value:{imageLoadingStatus:a,onImageLoadingStatusChange:s},children:jsx("span",{ref:o,className:m(F0({size:t,radius:n,className:e})),...r})})});Cr.displayName="Avatar";var Jr=_.forwardRef(({className:e,src:t,alt:n,onLoadingStatusChange:r,...o},a)=>{let{imageLoadingStatus:s,onImageLoadingStatusChange:i}=Td();return _.useEffect(()=>{if(!t){i("error");return}i("loading"),r?.("loading");let l=new Image;l.src=t,l.onload=()=>{i("loaded"),r?.("loaded");},l.onerror=()=>{i("error"),r?.("error");};},[t,i,r]),s!=="loaded"?null:jsx("img",{ref:a,src:t,alt:n,className:m("aspect-square h-full w-full object-cover",e),...o})});Jr.displayName="AvatarImage";var Tr=_.forwardRef(({className:e,delayMs:t=0,children:n,...r},o)=>{let{imageLoadingStatus:a}=Td(),[s,i]=_.useState(t===0);return _.useEffect(()=>{if(t>0){let l=setTimeout(()=>i(true),t);return ()=>clearTimeout(l)}},[t]),a==="loaded"||!s?null:jsx("span",{ref:o,className:m("flex h-full w-full items-center justify-center bg-muted",e),...r,children:n})});Tr.displayName="AvatarFallback";var Nd=_.createContext({delayDuration:700,skipDelayDuration:300}),jn=({children:e,delayDuration:t=700,skipDelayDuration:n=300})=>jsx(Nd.Provider,{value:{delayDuration:t,skipDelayDuration:n},children:e});jn.displayName="TooltipProvider";var kd=_.createContext(null),Pd=()=>{let e=_.useContext(kd);if(!e)throw new Error("Tooltip components must be used within a Tooltip");return e},_n=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,delayDuration:o})=>{let a=_.useContext(Nd),[s,i]=_.useState(n),l=t!==void 0,c=l?t:s,d=_.useRef(null),u=_.useId(),f=_.useRef(null),p=o??a.delayDuration,g=_.useCallback(h=>{f.current&&clearTimeout(f.current),h?f.current=setTimeout(()=>{l||i(true),r?.(true);},p):(l||i(false),r?.(false));},[l,r,p]);return _.useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx(kd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentId:u},children:e})};_n.displayName="Tooltip";var Yn=_.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l,contentId:c,open:d}=Pd();return jsx("button",{ref:h=>{l.current=h,typeof s=="function"?s(h):s&&(s.current=h);},type:"button","aria-describedby":d?c:void 0,onMouseEnter:h=>{t?.(h),i(true);},onMouseLeave:h=>{n?.(h),i(false);},onFocus:h=>{r?.(h),i(true);},onBlur:h=>{o?.(h),i(false);},...a,children:e})});Yn.displayName="TooltipTrigger";var Xn=_.forwardRef(({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:o=0,children:a,...s},i)=>{let{open:l,triggerRef:c,contentId:d}=Pd(),[u,f]=_.useState({top:0,left:0}),[p,g]=_.useState(false),h=_.useRef(null);if(_.useEffect(()=>{g(true);},[]),_.useEffect(()=>{if(!l||!c.current||!h.current)return;let b=c.current.getBoundingClientRect(),w=h.current.getBoundingClientRect(),x=0,R=0;switch(t){case "top":x=b.top-w.height-n;break;case "bottom":x=b.bottom+n;break;case "left":R=b.left-w.width-n;break;case "right":R=b.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":R=b.left+o;break;case "center":R=b.left+b.width/2-w.width/2;break;case "end":R=b.right-w.width-o;break}else switch(r){case "start":x=b.top+o;break;case "center":x=b.top+b.height/2-w.height/2;break;case "end":x=b.bottom-w.height-o;break}f({top:x,left:R});},[l,t,n,r,o,c]),!p||!l)return null;let v={top:"animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",bottom:"animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",left:"animate-in fade-in-0 zoom-in-95 slide-in-from-right-2",right:"animate-in fade-in-0 zoom-in-95 slide-in-from-left-2"}[t];return Oa.createPortal(jsx("div",{ref:b=>{h.current=b,typeof i=="function"?i(b):i&&(i.current=b);},id:d,role:"tooltip","data-side":t,className:m("fixed z-50 overflow-hidden rounded-md px-3 py-1.5 text-xs bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",v,e),style:{top:u.top,left:u.left},...s,children:a}),document.body)});Xn.displayName="TooltipContent";var De=_.forwardRef(({className:e,orientation:t="vertical",visibility:n="visible",children:r,style:o,...a},s)=>{let[i,l]=_.useState(false),c=_.useId().replace(/:/g,""),d=n==="visible"||n==="hover"&&i,u=d?"rgba(0,0,0,0.3)":"transparent",f=d?"rgba(255,255,255,0.3)":"transparent",p=`
2
2
  #${c} {
3
3
  scrollbar-width: thin;
4
4
  scrollbar-color: ${u} transparent;
@@ -52,7 +52,7 @@ import*as _ from'react';import {createContext,useState,useEffect,useContext,useC
52
52
  width: ${Se.offsetWidth}px;
53
53
  opacity: 1;
54
54
  z-index: 9999;
55
- `,document.body.appendChild(de),X.dataTransfer.setDragImage(de,20,15),setTimeout(()=>{document.body.removeChild(de);},0),h(e),C?.({event:X,node:e});},me=X=>{if(X.preventDefault(),X.stopPropagation(),!g||g.key===e.key||oe)return;let Se=X.currentTarget.getBoundingClientRect(),de=X.clientY-Se.top,We=Se.height,je;de<We*.25?je=-1:de>We*.75?je=1:je=0,!(R&&!R({dropNode:e,dropPosition:je,dragNode:g}))&&(w(e.key,je),y?.({event:X,node:e}));},wt=X=>{X.preventDefault(),X.stopPropagation(),!(!g||g.key===e.key)&&N?.({event:X,node:e,expandedKeys:F()});},gt=X=>{X.stopPropagation(),T?.({event:X,node:e});},yn=X=>{X.preventDefault(),X.stopPropagation(),!(!g||g.key===e.key||oe)&&(b!==null&&x(e,b),h(null),w(null,null));},Fe=X=>{h(null),w(null,null),k?.({event:X,node:e});},on=X=>{oe||ge&&i(e.key,e,X);},Ct=X=>{X.stopPropagation(),!oe&&!Y&&a(e.key,e);},U=_.useMemo(()=>{if(!j||b===null)return "";switch(b){case -1:return "before:absolute before:left-0 before:right-0 before:top-0 before:h-0.5 before:bg-foreground";case 1:return "after:absolute after:left-0 after:right-0 after:bottom-0 after:h-0.5 after:bg-foreground";case 0:return "ring-2 ring-foreground ring-inset";default:return ""}},[j,b]),re=[...r,n];return jsxs("div",{className:"relative",children:[E&&t>0&&jsxs(Fragment,{children:[r.map((X,Se)=>!X&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${Se} * var(--tree-indent) + 12px)`,top:0,bottom:0}},Se)),jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:0,height:n?"calc(var(--tree-item-height) / 2)":"100%"}}),jsx("div",{className:"absolute border-t border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:"calc(var(--tree-item-height) / 2)",width:"calc(var(--tree-indent) - 4px)"}})]}),jsxs("div",{role:"treeitem","aria-expanded":Y?void 0:q,"aria-selected":ge?$:void 0,"aria-disabled":oe,draggable:Pe,onDragStart:Be,onDragOver:me,onDragEnter:wt,onDragLeave:gt,onDrop:yn,onDragEnd:Fe,onClick:on,className:m("relative",Vg({size:I,isSelected:$,isDragging:z,isDisabled:oe,isHoverable:ge&&!oe}),U,A&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[Pe&&P&&Z!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:Z}),jsx("button",{type:"button",onClick:Ct,className:m("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",Y&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:m("h-4 w-4 transition-transform duration-200",q&&"rotate-90")})}),G&&jsx(eT,{checked:O,indeterminate:W,disabled:oe,onClick:X=>u(e.key,e,X)}),M&&le&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:le}),jsx("div",{className:m("flex-1 min-w-0 truncate ml-1",A&&"flex-none"),children:e.label})]}),K&&q&&jsx("div",{role:"group",children:e.children.map((X,Se)=>jsx(zg,{node:X,level:t+1,isLast:Se===e.children.length-1,parentIsLastPath:re},X.key))})]})},tT=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return n(e),t},nT=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return e.children&&n(e.children),t},Og=(e,t)=>{if(!e.children)return false;for(let n of e.children)if(n.key===t||Og(n,t))return true;return false},Bg=_.forwardRef(({className:e,variant:t,size:n,data:r,draggable:o=false,allowDrop:a,expandedKeys:s,defaultExpandedKeys:i=[],defaultExpandAll:l=false,onExpand:c,selectable:d=true,multiple:u=false,selectedKeys:f,defaultSelectedKeys:p=[],onSelect:g,checkable:h=false,checkStrictly:v=false,checkedKeys:b,defaultCheckedKeys:w=[],onCheck:x,showLine:R=false,showIcon:C=false,showHandle:y=true,dragIcon:N,icon:T,leafIcon:k=jsx(File,{className:"h-4 w-4"}),folderIcon:E=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:M=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:P,onDragEnter:S,onDragOver:H,onDragLeave:D,onDragEnd:L,onDrop:V,blockNode:A=false,disabled:B=false,...I},F)=>{let K=_.useCallback(()=>l?new Set(tT(r)):new Set(i),[l,i,r]),[Y,q]=_.useState(K),$=s!==void 0,O=$?new Set(s):Y,W=_.useCallback((ve,Ye)=>{let Kt=new Set(O),Ae=!Kt.has(ve);Ae?Kt.add(ve):Kt.delete(ve),$||q(Kt),c?.(Array.from(Kt),{expanded:Ae,node:Ye});},[O,$,c]),[z,j]=_.useState(new Set(p)),oe=f!==void 0,ge=oe?new Set(f):z,G=_.useCallback((ve,Ye,Kt)=>{let Ae=new Set(ge),Rn=!Ae.has(ve);u?Rn?Ae.add(ve):Ae.delete(ve):(Ae.clear(),Rn&&Ae.add(ve)),oe||j(Ae);let jr=[],Vo=wa=>{for(let _r of wa)Ae.has(_r.key)&&jr.push(_r),_r.children&&Vo(_r.children);};Vo(r),g?.(Array.from(Ae),{selected:Rn,selectedNodes:jr,node:Ye,event:Kt});},[ge,u,oe,g,r]),[Pe,Z]=_.useState(new Set(w)),[le,Be]=_.useState(new Set),me=b!==void 0,wt=me?new Set(Array.isArray(b)?b:b.checked):Pe,gt=me&&!Array.isArray(b)?new Set(b.halfChecked):le,yn=_.useCallback((ve,Ye,Kt)=>{let Ae=new Set(wt),Rn=new Set(gt),jr=!Ae.has(ve);if(jr?(Ae.add(ve),Rn.delete(ve)):Ae.delete(ve),!v&&Ye.children){let yi=nT(Ye);for(let Un of yi)jr?(Ae.add(Un),Rn.delete(Un)):Ae.delete(Un);}me||(Z(Ae),Be(Rn));let Vo=[],wa=yi=>{for(let Un of yi)Ae.has(Un.key)&&Vo.push(Un),Un.children&&wa(Un.children);};wa(r);let _r=v?{checked:Array.from(Ae),halfChecked:Array.from(Rn)}:Array.from(Ae);x?.(_r,{checked:jr,checkedNodes:Vo,node:Ye,event:Kt,halfCheckedKeys:Array.from(Rn)});},[wt,gt,v,me,x,r]),[Fe,on]=_.useState(null),[Ct,U]=_.useState(null),[re,X]=_.useState(null),Se=_.useCallback((ve,Ye)=>{U(ve),X(Ye);},[]),de=_.useCallback((ve,Ye)=>{!Fe||!V||Ye===0&&Og(Fe,ve.key)||V({event:{},node:ve,dragNode:Fe,dropPosition:Ye,dropToGap:Ye!==0});},[Fe,V]),We=_.useCallback(()=>Array.from(O),[O]),je={expandedKeys:O,toggleExpand:W,selectedKeys:ge,handleSelect:G,selectable:d,multiple:u,checkedKeys:wt,halfCheckedKeys:gt,handleCheck:yn,checkable:h,checkStrictly:v,draggable:o,draggedNode:Fe,setDraggedNode:on,dragOverKey:Ct,dragOverPosition:re,setDragOver:Se,handleDrop:de,allowDrop:a,onDragStart:P,onDragEnter:S,onDragOver:H,onDragLeave:D,onDragEnd:L,showLine:R,showIcon:C,showHandle:y,dragIcon:N,icon:T,leafIcon:k,folderIcon:E,folderOpenIcon:M,blockNode:A,disabled:B,size:n,data:r,getAllKeys:We},Gn=ve=>{let Ye=ve.relatedTarget,Kt=ve.currentTarget;(!Ye||!Kt.contains(Ye))&&Se(null,null);};return jsx(Ag.Provider,{value:je,children:jsx("div",{ref:F,role:"tree","aria-multiselectable":u||h,className:m(Ig({variant:t,size:n,className:e})),onDragLeave:Gn,...I,children:r.map((ve,Ye)=>jsx(zg,{node:ve,level:0,isLast:Ye===r.length-1},ve.key))})})});Bg.displayName="Tree";var Kg=cva("flex rounded-md border border-input bg-background text-sm placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"},fullWidth:{true:"w-full",false:"w-fit min-w-48"}},defaultVariants:{size:"md",fullWidth:false}}),lT=({text:e,query:t})=>{if(!t)return jsx(Fragment,{children:e});let n=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),r=e.split(n);return jsx(Fragment,{children:r.map((o,a)=>n.test(o)?jsx("mark",{className:"bg-primary/20 text-foreground rounded-sm",children:o},a):jsx("span",{children:o},a))})},cT=(e,t)=>{let[n,r]=_.useState(e);return _.useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n},$g=_.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,onSelect:a,options:s=[],loadOptions:i,debounceMs:l=300,minChars:c=0,placeholder:d="Type to search...",emptyText:u="No results found.",loadingText:f="Loading...",clearable:p=false,allowCustomValue:g=true,maxHeight:h=200,highlightMatch:v=true,fullWidth:b=false,disabled:w,...x},R)=>{let[C,y]=_.useState(false),[N,T]=_.useState(r),[k,E]=_.useState([]),[M,P]=_.useState(false),[S,H]=_.useState(false),[D,L]=_.useState(0),V=_.useRef(null),A=_.useRef(null),B=n!==void 0?n:N,I=cT(B,l);_.useEffect(()=>{let G=A.current;if(!G)return;let Pe=()=>{L(G.offsetWidth);};Pe();let Z=new ResizeObserver(Pe);return Z.observe(G),()=>{Z.disconnect();}},[]),_.useImperativeHandle(R,()=>V.current);let F=i?k:s,K=_.useMemo(()=>i?F:F.filter(G=>G.label.toLowerCase().includes(B.toLowerCase())),[F,B,i]);_.useEffect(()=>{if(!i)return;if(I.length<c){E([]);return}let G=false;return (async()=>{P(true);try{let Z=await i(I);G||E(Z);}catch{G||E([]);}finally{G||P(false);}})(),()=>{G=true;}},[I,i,c]);let Y=G=>{n===void 0&&T(G),o?.(G);},q=G=>{let Pe=G.target.value;Y(Pe),Pe.length>=c&&y(true);},$=G=>{Y(G.label),a?.(G),y(false);},O=()=>{Y(""),V.current?.focus();},W=()=>{H(true),y(true);},z=()=>{H(false);},j=G=>{G.key==="Escape"&&y(false),G.key==="ArrowDown"&&!C&&K.length>0&&y(true);},oe=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",ge=p&&B?"pr-8":"pr-3";return jsxs(ot,{open:C,onOpenChange:y,children:[jsxs(an,{ref:A,className:m("relative",b?"w-full":"w-fit"),children:[jsx("input",{ref:V,type:"text",value:B,onChange:q,onFocus:W,onBlur:z,onKeyDown:j,disabled:w,placeholder:d,className:m(Kg({size:t,fullWidth:b}),ge,e),style:{borderColor:S?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":C,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...x}),p&&B&&!w&&jsx("button",{type:"button",onClick:O,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:oe})})]}),jsx(at,{className:"p-0",align:"start",style:{width:D>0?D:void 0},onOpenAutoFocus:G=>G.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(De,{style:{maxHeight:h},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:M?jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[jsx(Loader2,{className:m(oe,"animate-spin")}),f]}):K.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:u}):K.map(G=>jsxs(Command.Item,{value:G.value,disabled:G.disabled,onSelect:()=>$(G),className:m("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground"),children:[jsx(Check,{className:m("mr-2 h-4 w-4 shrink-0",B===G.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:v?jsx(lT,{text:G.label,query:B}):G.label})]},G.value))})})})})]})});$g.displayName="Autocomplete";var fl=_.createContext(null),gl=_.createContext(null),bl=()=>{let e=_.useContext(fl);if(!e)throw new Error("useFormContext must be used within a Form");return e},gs=()=>{let e=_.useContext(gl);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},dT={required:(e="This field is required")=>({validate:t=>typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.length>0:t!=null,message:e}),minLength:(e,t)=>({validate:n=>typeof n=="string"&&n.length>=e,message:t??`Must be at least ${e} characters`}),maxLength:(e,t)=>({validate:n=>typeof n=="string"&&n.length<=e,message:t??`Must be at most ${e} characters`}),min:(e,t)=>({validate:n=>typeof n=="number"&&n>=e,message:t??`Must be at least ${e}`}),max:(e,t)=>({validate:n=>typeof n=="number"&&n<=e,message:t??`Must be at most ${e}`}),email:(e="Invalid email address")=>({validate:t=>typeof t=="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),message:e}),pattern:(e,t="Invalid format")=>({validate:n=>typeof n=="string"&&e.test(n),message:t}),custom:(e,t)=>({validate:e,message:t})},Gg=_.forwardRef(({defaultValues:e={},onSubmit:t,onError:n,validateOnBlur:r=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=_.useState(e),[u,f]=_.useState({}),[p,g]=_.useState({}),[h,v]=_.useState({}),[b,w]=_.useState(false),x=_.useRef(new Map),R=_.useCallback((D,L)=>{x.current.set(D,L);},[]),C=_.useCallback(D=>{x.current.delete(D);},[]),y=_.useCallback(D=>{let L=x.current.get(D)||[],V=c[D];for(let A of L)if(!A.validate(V))return f(B=>({...B,[D]:A.message})),false;return f(A=>({...A,[D]:null})),true},[c]),N=_.useCallback(()=>{let D=true,L={};return x.current.forEach((V,A)=>{let B=c[A];for(let I of V)if(!I.validate(B)){L[A]=I.message,D=false;break}L[A]||(L[A]=null);}),f(L),D},[c]),T=_.useCallback((D,L)=>{d(V=>({...V,[D]:L})),v(V=>({...V,[D]:true})),o&&setTimeout(()=>{y(D);},0);},[o,y]),k=_.useCallback((D,L)=>{f(V=>({...V,[D]:L}));},[]),E=_.useCallback((D,L)=>{g(V=>({...V,[D]:L})),L&&r&&y(D);},[r,y]),M=_.useCallback(D=>({value:c[D],error:u[D]??null,touched:p[D]??false,dirty:h[D]??false}),[c,u,p,h]),P=_.useCallback(()=>{d(e),f({}),g({}),v({});},[e]),S=async D=>{D.preventDefault();let L={};if(x.current.forEach((A,B)=>{L[B]=true;}),g(L),!N()){n?.(u);return}if(t){w(true);try{await t(c);}finally{w(false);}}},H={values:c,errors:u,touched:p,dirty:h,isSubmitting:b,setValue:T,setError:k,setTouched:E,validateField:y,validateAll:N,registerField:R,unregisterField:C,getFieldState:M,reset:P};return jsx(fl.Provider,{value:H,children:jsx("form",{ref:l,onSubmit:S,className:m("space-y-4",s),...i,children:a})})});Gg.displayName="Form";var Ug=({name:e,rules:t=[],defaultValue:n,children:r})=>{let o=bl(),a=_.useId();_.useEffect(()=>(o.registerField(e,t),n!==void 0&&o.values[e]===void 0&&o.setValue(e,n),()=>{o.unregisterField(e);}),[e,t,n,o]);let s=o.getFieldState(e),i={name:e,id:`${a}-${e}`,value:s.value,error:s.error,touched:s.touched,dirty:s.dirty};return jsx(gl.Provider,{value:i,children:r})};Ug.displayName="FormField";var Wg=_.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("space-y-1.5",e),...t}));Wg.displayName="FormItem";var jg=_.forwardRef(({className:e,required:t,children:n,...r},o)=>{let{id:a,error:s,touched:i}=gs();return jsxs(wr,{ref:o,htmlFor:a,className:m(s&&i&&"text-danger",e),...r,children:[n,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});jg.displayName="FormLabel";var _g=({children:e})=>{let{name:t,id:n,error:r,touched:o}=gs(),a=bl(),s=a.getFieldState(t),i=c=>{let d=c.target,u=d.type==="checkbox"?d.checked:d.value;a.setValue(t,u);},l=()=>{a.setTouched(t,true);};return _.cloneElement(e,{id:n,name:t,value:s.value??"",onChange:i,onBlur:l,"aria-invalid":r&&o?"true":void 0,"aria-describedby":r&&o?`${n}-error`:void 0})};_g.displayName="FormControl";var Yg=_.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:m("text-xs text-muted-foreground",e),...t}));Yg.displayName="FormDescription";var Xg=_.forwardRef(({className:e,message:t,...n},r)=>{let{id:o,error:a,touched:s}=gs(),i=t??(s?a:null);return i?jsx("p",{ref:r,id:`${o}-error`,className:m("text-xs text-danger",e),role:"alert",...n,children:i}):null});Xg.displayName="FormMessage";var Zg=cva("inline-flex items-center gap-3",{variants:{size:{sm:"[&_[data-user-avatar]]:h-8 [&_[data-user-avatar]]:w-8",md:"[&_[data-user-avatar]]:h-10 [&_[data-user-avatar]]:w-10",lg:"[&_[data-user-avatar]]:h-12 [&_[data-user-avatar]]:w-12"}},defaultVariants:{size:"md"}}),Qg=_.forwardRef(({className:e,size:t,name:n,description:r,avatarUrl:o,avatarFallback:a,trailing:s,...i},l)=>{let c=a||n.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return jsxs("div",{ref:l,className:m(Zg({size:t,className:e})),...i,children:[jsxs(Cr,{"data-user-avatar":true,children:[o&&jsx(Jr,{src:o,alt:n}),jsx(Tr,{children:c})]}),jsxs("div",{className:"flex flex-col min-w-0",children:[jsx("span",{className:"text-sm font-medium leading-none truncate",children:n}),r&&jsx("span",{className:"text-sm text-muted-foreground truncate",children:r})]}),s&&jsx("div",{className:"ml-auto flex-shrink-0",children:s})]})});Qg.displayName="User";var eb=cva("font-mono",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-transparent",light:"bg-muted/50 text-foreground",flat:"bg-muted text-foreground",ghost:"bg-transparent text-foreground"},size:{sm:"px-1 py-0.5 text-xs",md:"px-1.5 py-0.5 text-sm",lg:"px-2 py-1 text-base"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{variant:"flat",size:"md",radius:"sm"}}),tb=_.forwardRef(({className:e,variant:t,size:n,radius:r,...o},a)=>jsx("code",{ref:a,className:m(eb({variant:t,size:n,radius:r,className:e})),...o}));tb.displayName="Code";function ab(e){let[t,n]=useState(false);return useEffect(()=>{if(e){n(e==="dark");return}let r=()=>{n(document.documentElement.classList.contains("dark"));};r();let o=new MutationObserver(r);return o.observe(document.documentElement,{attributes:true,attributeFilter:["class"]}),()=>o.disconnect()},[e]),t}var sb=_.forwardRef(({code:e,language:t="bash",showLineNumbers:n=false,className:r,noBorder:o=false,filename:a,theme:s,hideCopyButton:i=false},l)=>{let[c,d]=useState(false),f=ab(s)?themes.oneDark:themes.oneLight,p=async()=>{await navigator.clipboard.writeText(e),d(true),setTimeout(()=>d(false),2e3);};return jsxs("div",{ref:l,className:m("overflow-hidden",!o&&"rounded-lg border border-border",r),children:[a&&jsx("div",{className:"flex items-center px-4 py-2 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:jsx("span",{className:"text-sm text-muted-foreground font-mono",children:a})}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:f,code:e.trim(),language:t,children:({tokens:g,getLineProps:h,getTokenProps:v})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:g.map((b,w)=>jsxs("div",{...h({line:b}),children:[n&&jsx("span",{className:"inline-block w-8 text-zinc-400 dark:text-zinc-600 select-none text-right mr-4",children:w+1}),b.map((x,R)=>jsx("span",{...v({token:x})},R))]},w))})}),!i&&jsx("button",{onClick:p,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:c?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});sb.displayName="CodeBlock";var ib=_.forwardRef(({tabs:e,className:t,theme:n},r)=>{let[o,a]=useState(0),[s,i]=useState(false),c=ab(n)?themes.oneDark:themes.oneLight,d=async()=>{await navigator.clipboard.writeText(e[o].code),i(true),setTimeout(()=>i(false),2e3);},u=e[o],f=u.language||"bash";return jsxs("div",{ref:r,className:m("rounded-lg border border-border overflow-hidden",t),children:[jsx("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:e.map((p,g)=>jsxs("button",{type:"button",onClick:()=>a(g),className:m("flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-colors cursor-pointer",o===g?"bg-zinc-200 dark:bg-zinc-800 text-zinc-900 dark:text-white":"text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-200 hover:bg-zinc-200/50 dark:hover:bg-zinc-800/50"),children:[p.icon,p.name]},p.name))}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:c,code:u.code.trim(),language:f,children:({tokens:p,getLineProps:g,getTokenProps:h})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:p.map((v,b)=>jsx("div",{...g({line:v}),children:v.map((w,x)=>jsx("span",{...h({token:w})},x))},b))})}),jsx("button",{onClick:d,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:s?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});ib.displayName="TabbedCodeBlock";var lb=cva("relative flex items-center gap-2 font-mono rounded-lg border",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",bordered:"bg-transparent border-current",ghost:"bg-transparent border-transparent",soft:"bg-muted border-muted",surface:"bg-muted/50 border-border"},size:{sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-base"}},defaultVariants:{variant:"surface",size:"md"}}),cb=_.forwardRef(({className:e,variant:t,size:n,code:r,copyable:o=true,copyLabel:a="Copy",onCopy:s,symbol:i="$",hideSymbol:l=false,...c},d)=>{let[u,f]=_.useState(false),p=async()=>{try{await navigator.clipboard.writeText(r),f(!0),s?.(),setTimeout(()=>f(!1),2e3);}catch(g){console.error("Failed to copy:",g);}};return jsxs("div",{ref:d,className:m(lb({variant:t,size:n,className:e})),...c,children:[!l&&jsx("span",{className:"text-muted-foreground select-none",children:i}),jsx("code",{className:"flex-1 truncate",children:r}),o&&jsx("button",{type:"button",onClick:p,className:m("flex-shrink-0 rounded p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-label":u?"Copied":a,children:u?jsx(Check,{className:"h-4 w-4 text-green-500"}):jsx(Copy,{className:"h-4 w-4 text-muted-foreground"})})]})});cb.displayName="Snippet";var yl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"md"}}),db=_.forwardRef(({className:e,radius:t,src:n,alt:r,fallback:o,showSkeleton:a=true,onLoad:s,onError:i,fit:l="cover",aspectRatio:c,style:d,...u},f)=>{let[p,g]=_.useState("loading");_.useEffect(()=>{n&&g("loading");},[n]);let h=()=>{g("loaded"),s?.();},v=()=>{g("error"),i?.();},b={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"}[l];return p==="error"&&o?jsx("div",{className:m(yl({radius:t}),"flex items-center justify-center bg-muted",e),style:{aspectRatio:c,...d},children:o}):jsxs("div",{className:m(yl({radius:t}),"relative",e),style:{aspectRatio:c,...d},children:[p==="loading"&&a&&jsx(Da,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:f,src:n,alt:r,onLoad:h,onError:v,className:m("h-full w-full transition-opacity duration-300",b,p==="loading"?"opacity-0":"opacity-100"),...u})]})});db.displayName="Image";var pb=cva("flex flex-col rounded-lg border bg-background",{variants:{size:{sm:"p-1 gap-0.5",md:"p-1.5 gap-1",lg:"p-2 gap-1.5"}},defaultVariants:{size:"md"}}),fb=cva("relative flex cursor-pointer select-none items-center rounded-md outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{size:{sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"}},defaultVariants:{size:"md"}}),gb=_.createContext({value:"",onValueChange:()=>{},multiple:false,size:"md"}),bb=_.forwardRef(({className:e,size:t="md",value:n,defaultValue:r="",onValueChange:o,multiple:a=false,children:s,...i},l)=>{let[c,d]=_.useState(r),u=n??c,f=p=>{let g;if(a){let h=Array.isArray(u)?u:[u].filter(Boolean);h.includes(p)?g=h.filter(v=>v!==p):g=[...h,p];}else g=p;o?o(g):d(g);};return jsx(gb.Provider,{value:{value:u,onValueChange:f,multiple:a,size:t??"md"},children:jsx("div",{ref:l,role:"listbox","aria-multiselectable":a,className:m(pb({size:t,className:e})),...i,children:s})})});bb.displayName="Listbox";var vb=_.forwardRef(({className:e,value:t,disabled:n,icon:r,description:o,children:a,...s},i)=>{let{value:l,onValueChange:c,multiple:d,size:u}=_.useContext(gb),f=d?Array.isArray(l)&&l.includes(t):l===t,p=()=>{n||c(t);},g=h=>{(h.key==="Enter"||h.key===" ")&&!n&&(h.preventDefault(),c(t));};return jsxs("div",{ref:i,role:"option","aria-selected":f,"data-disabled":n?"":void 0,tabIndex:n?-1:0,className:m(fb({size:u}),f&&"bg-accent text-accent-foreground",e),onClick:p,onKeyDown:g,...s,children:[r&&jsx("span",{className:"mr-2 flex-shrink-0",children:r}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"truncate",children:a}),o&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:o})]}),f&&jsx(Check,{className:"ml-2 h-4 w-4 flex-shrink-0"})]})});vb.displayName="ListboxItem";var xb=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",cards:"gap-2"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),yb=cva("flex items-center gap-3 bg-background transition-all",{variants:{variant:{default:"rounded-lg border p-3",bordered:"p-3",cards:"rounded-lg border p-3 shadow-sm"},size:{sm:"p-2 text-sm",md:"p-3 text-sm",lg:"p-4 text-base"},isDragging:{true:"opacity-50 scale-[1.02] shadow-lg z-10",false:""},isDragOver:{true:"border-primary border-dashed",false:""}},defaultVariants:{variant:"default",size:"md",isDragging:false,isDragOver:false}});function TT({className:e,variant:t,size:n,items:r,onReorder:o,renderItem:a,showHandle:s=true,disabled:i=false,...l},c){let[d,u]=_.useState(null),[f,p]=_.useState(null),g=(x,R)=>{i||(u(R),x.dataTransfer.effectAllowed="move",x.dataTransfer.setData("text/plain",String(R)));},h=(x,R)=>{x.preventDefault(),!(i||d===null||d===R)&&p(R);},v=()=>{p(null);},b=(x,R)=>{if(x.preventDefault(),i||d===null||d===R){u(null),p(null);return}let C=[...r],[y]=C.splice(d,1);C.splice(R,0,y),o?.(C),u(null),p(null);},w=()=>{u(null),p(null);};return jsx("div",{ref:c,className:m(xb({variant:t,size:n,className:e})),...l,children:r.map((x,R)=>jsxs("div",{draggable:!i,onDragStart:C=>g(C,R),onDragOver:C=>h(C,R),onDragLeave:v,onDrop:C=>b(C,R),onDragEnd:w,className:m(yb({variant:t,size:n,isDragging:d===R,isDragOver:f===R}),!i&&"cursor-move"),children:[s&&jsx("div",{className:m("flex-shrink-0 text-muted-foreground",i?"opacity-30":"cursor-grab active:cursor-grabbing"),children:jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:a(x,R)})]},x.id))})}var MT=_.forwardRef(TT);var Cb=cva("absolute inset-0 z-50 flex items-center justify-center transition-opacity",{variants:{variant:{solid:"bg-background",soft:"bg-background/80 backdrop-blur-sm",ghost:"bg-background/50"},visible:{true:"opacity-100 pointer-events-auto",false:"opacity-0 pointer-events-none"}},defaultVariants:{variant:"soft",visible:true}}),ET={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},Tb=_.forwardRef(({className:e,variant:t,loading:n=true,size:r="md",spinner:o,text:a,children:s,...i},l)=>jsxs("div",{ref:l,className:m("relative",e),...i,children:[s,jsx("div",{className:m(Cb({variant:t,visible:n})),"aria-hidden":!n,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[o||jsx(Loader2,{className:m(ET[r],"animate-spin text-primary")}),a&&jsx("span",{className:"text-sm text-muted-foreground",children:a})]})})]}));Tb.displayName="LoadingOverlay";var Mb=cva("fixed top-0 left-0 z-[9999] h-0.5 transition-all duration-200 ease-out",{variants:{color:{primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"}},defaultVariants:{color:"primary"}}),Nb=_.forwardRef(({className:e,color:t,isLoading:n=false,progress:r,showSpinner:o=false,...a},s)=>{let[i,l]=_.useState(0),[c,d]=_.useState(false),u=_.useRef(null);return _.useEffect(()=>{if(r!==void 0){l(r),d(r>0&&r<100);return}return n?(d(true),l(10),u.current=setInterval(()=>{l(f=>{if(f>=90)return f;let p=Math.random()*10;return Math.min(f+p,90)});},500)):i>0&&(l(100),setTimeout(()=>{d(false),l(0);},200)),()=>{u.current&&clearInterval(u.current);}},[n,r]),!c&&r===void 0||r!==void 0&&(r<=0||r>=100)?null:jsxs(Fragment,{children:[jsx("div",{ref:s,className:m(Mb({color:t,className:e})),style:{width:`${i}%`},role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,...a,children:jsx("div",{className:"absolute right-0 h-full w-24 -translate-y-1 rotate-3 bg-inherit opacity-50 blur-sm"})}),o&&c&&jsx("div",{className:"fixed top-4 right-4 z-[9999]",children:jsx("div",{className:m("h-4 w-4 animate-spin rounded-full border-2 border-transparent",t==="primary"&&"border-t-primary",t==="secondary"&&"border-t-secondary",t==="success"&&"border-t-success",t==="warning"&&"border-t-warning",t==="danger"&&"border-t-danger",t==="info"&&"border-t-info")})})]})});Nb.displayName="NProgress";var Lb=cva("flex items-center justify-center",{variants:{variant:{spinner:"",dots:"",pulse:"",skeleton:""},size:{sm:"gap-1",md:"gap-2",lg:"gap-3"},fullScreen:{true:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",false:""}},defaultVariants:{variant:"spinner",size:"md",fullScreen:false}}),kb={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},VT={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},Sb=_.forwardRef(({className:e,variant:t="spinner",size:n="md",fullScreen:r,text:o,color:a="primary",...s},i)=>{let l={primary:"text-primary",secondary:"text-secondary",muted:"text-muted-foreground"}[a],c=()=>{switch(t){case "dots":return jsx("div",{className:"flex items-center gap-1",children:[0,1,2].map(d=>jsx("div",{className:m(VT[n||"md"],"animate-bounce rounded-full bg-current",l),style:{animationDelay:`${d*.15}s`}},d))});case "pulse":return jsx("div",{className:m(kb[n||"md"],"animate-pulse rounded-full bg-current",l)});case "skeleton":return jsxs("div",{className:"w-full space-y-2",children:[jsx("div",{className:"h-4 w-3/4 animate-pulse rounded bg-muted"}),jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-muted"}),jsx("div",{className:"h-4 w-5/6 animate-pulse rounded bg-muted"})]});default:return jsx(Loader2,{className:m(kb[n||"md"],"animate-spin",l)})}};return jsx("div",{ref:i,className:m(Lb({variant:t,size:n,fullScreen:r,className:e})),role:"status","aria-label":o||"Loading",...s,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[c(),o&&jsx("span",{className:m("text-sm",l),children:o})]})})});Sb.displayName="Loading";var zT=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),OT=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"},showPickerIcon:{true:"",false:""}},compoundVariants:[{size:"sm",showPickerIcon:true,className:"pl-3 pr-8"},{size:"sm",showPickerIcon:false,className:"px-3"},{size:"md",showPickerIcon:true,className:"pl-3 pr-10"},{size:"md",showPickerIcon:false,className:"px-3"},{size:"lg",showPickerIcon:true,className:"pl-4 pr-12"},{size:"lg",showPickerIcon:false,className:"px-4"}],defaultVariants:{size:"md",isInvalid:false,fullWidth:false,showPickerIcon:true}}),BT=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),FT=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Ts={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},Cl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},wl=(e,t)=>String(e).padStart(t,"0"),Db=(e,t)=>{if(!e)return "";let n=wl(e.getDate(),2),r=wl(e.getMonth()+1,2),o=wl(e.getFullYear(),4),a=Ts[t],s=Cl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Rs=(e,t)=>{let n=Ts[t],r=e.split(n);if(r.length!==3)return null;let o=Cl[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(r[l],10);}),isNaN(a.day)||isNaN(a.month)||isNaN(a.year)||a.month<1||a.month>12||a.day<1||a.day>31||a.year<1e3||a.year>9999)return null;let s=new Date(a.year,a.month-1,a.day);return s.getFullYear()!==a.year||s.getMonth()!==a.month-1||s.getDate()!==a.day?null:s},KT=e=>{let t=Ts[e];return Cl[e].map(r=>r==="year"?"####":"##").join(t)},ea=(e,t)=>{if(!e?.from)return "";let n=Db(e.from,t),r=e.to?Db(e.to,t):"";return n&&r?`${n} - ${r}`:n},Hb=_.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:v="dd.MM.yyyy",showPickerIcon:b=true,mode:w="text",fullWidth:x=false,numberOfMonths:R=2,align:C="start",disabled:y,placeholder:N,id:T,...k},E)=>{let M=_.useId(),P=T||M,S=`${P}-description`,H=`${P}-error`,[D,L]=_.useState(f),[V,A]=_.useState(""),[B,I]=_.useState(false),[F,K]=_.useState(false),Y=u!==void 0?u:D,q=a&&r,$=KT(v),O=Ts[v],W=" - ";_.useEffect(()=>{F||A(ea(Y,v));},[Y,v,F]);let z=le=>{u===void 0&&L(le),p?.(le);},j=le=>{z(le),A(ea(le,v)),le?.from&&le?.to&&I(false);},oe=le=>{let Be=le.target.value;Be=Be.replace(new RegExp(`[^0-9\\${O}\\s-]`,"g"),"");let me=`${$}${W}${$}`,wt=Be.replace(new RegExp(`[\\${O}\\s-]`,"g"),""),gt="",yn=0;for(let Fe=0;Fe<me.length&&yn<wt.length;Fe++)me[Fe]==="#"?(gt+=wt[yn],yn++):gt+=me[Fe];if(A(gt),gt.length===me.length){let Fe=gt.split(W);if(Fe.length===2){let on=Rs(Fe[0].trim(),v),Ct=Rs(Fe[1].trim(),v);if(on&&Ct){if(g&&(on<g||Ct<g)||h&&(on>h||Ct>h))return;on<=Ct&&z({from:on,to:Ct});}}}},ge=()=>{K(true);},G=()=>{K(false);let le=`${$}${W}${$}`;if(V.length!==le.length)A(ea(Y,v));else {let Be=V.split(W);if(Be.length!==2)A(ea(Y,v));else {let me=Rs(Be[0].trim(),v),wt=Rs(Be[1].trim(),v);(!me||!wt||me>wt)&&A(ea(Y,v));}}},Pe=()=>{y||I(true);},Z=()=>{!y&&w==="picker"&&b&&I(true);};return jsxs("div",{className:m(zT({size:s}),e),children:[t&&jsxs("label",{htmlFor:P,className:m(FT({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(ot,{open:b&&B,onOpenChange:I,children:[jsxs(an,{className:m("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:E,id:P,type:"text",inputMode:w==="text"?"numeric":void 0,value:V,onChange:w==="text"?oe:void 0,onClick:Z,onFocus:ge,onBlur:G,readOnly:w==="picker","aria-invalid":a,"aria-describedby":q?H:n?S:void 0,"aria-required":o,disabled:y,placeholder:N||`${v.toLowerCase()} - ${v.toLowerCase()}`,className:m(OT({size:s,isInvalid:a,fullWidth:x,showPickerIcon:b}),w==="picker"&&b&&"cursor-pointer",l),style:{borderColor:F||b&&B?"var(--color-foreground)":void 0},...k}),b&&jsx("button",{type:"button",onClick:Pe,disabled:y,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:m(BT({size:s}))})})]}),b&&jsx(at,{className:"w-auto p-0",align:C,children:jsx(no,{mode:"range",selected:Y,onSelect:j,numberOfMonths:R,disabled:le=>!!(g&&le<g||h&&le>h),defaultMonth:Y?.from,showMonthAndYearPickers:true})})]}),n&&!q&&jsx("p",{id:S,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),q&&jsx("p",{id:H,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Hb.displayName="DateRangePicker";var mo=e=>String(e).padStart(2,"0"),Ib=_.forwardRef(({value:e,onValueChange:t,placeholder:n="Pick a time",use24Hour:r=true,minuteStep:o=1,disabled:a=false,className:s},i)=>{let[l,c]=_.useState(false),d=r?Array.from({length:24},(x,R)=>R):Array.from({length:12},(x,R)=>R+1),u=Array.from({length:Math.floor(60/o)},(x,R)=>R*o),f=x=>{if(!x)return n;if(r)return `${mo(x.hours)}:${mo(x.minutes)}`;let R=x.hours%12||12,C=x.hours>=12?"PM":"AM";return `${mo(R)}:${mo(x.minutes)} ${C}`},p=x=>{let R=e?.minutes??0,C=x;if(!r&&e){let y=e.hours>=12;y&&x!==12?C=x+12:!y&&x===12&&(C=0);}t?.({hours:C,minutes:R});},g=x=>{let R=e?.hours??0;t?.({hours:R,minutes:x});},h=x=>{if(!e)return;let R=e.hours;x==="AM"&&e.hours>=12?R=e.hours-12:x==="PM"&&e.hours<12&&(R=e.hours+12),t?.({hours:R,minutes:e.minutes});},v=()=>{let x=new Date;t?.({hours:x.getHours(),minutes:x.getMinutes()});},b=e?e.hours>=12?"PM":"AM":void 0,w=e?r?e.hours:e.hours%12||12:void 0;return jsxs(ot,{open:l,onOpenChange:c,children:[jsxs(qn,{ref:i,disabled:a,className:m("inline-flex items-center justify-start gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-normal hover:bg-accent hover:text-accent-foreground w-full text-left",!e&&"text-muted-foreground",a&&"cursor-not-allowed opacity-50",s),children:[jsx(Clock,{className:"h-4 w-4"}),f(e)]}),jsxs(at,{className:"w-auto p-0",align:"start",children:[jsxs("div",{className:"flex",children:[jsxs("div",{className:"flex flex-col",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Hour"}),jsx(De,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:d.map(x=>jsx(ae,{variant:w===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>p(x),children:mo(x)},x))})})]}),jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Min"}),jsx(De,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:u.map(x=>jsx(ae,{variant:e?.minutes===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>g(x),children:mo(x)},x))})})]}),!r&&jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"\xA0"}),jsxs("div",{className:"flex flex-col gap-1 p-1",children:[jsx(ae,{variant:b==="AM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("AM"),children:"AM"}),jsx(ae,{variant:b==="PM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("PM"),children:"PM"})]})]})]}),jsxs("div",{className:"flex justify-between border-t p-2",children:[jsx(ae,{variant:"ghost",size:"sm",onClick:v,children:"Now"}),jsx(ae,{size:"sm",onClick:()=>c(false),children:"Done"})]})]})]})});Ib.displayName="TimePicker";var Vb=cva("overflow-auto",{variants:{variant:{default:"",bordered:"border rounded-lg",cards:""}},defaultVariants:{variant:"default"}});function UT({className:e,variant:t,items:n,itemHeight:r,height:o,overscan:a=3,renderItem:s,getItemKey:i,gap:l=0,onScrollChange:c,...d},u){let f=_.useRef(null),[p,g]=_.useState(0);_.useImperativeHandle(u,()=>f.current);let h=n.length*(r+l)-l,v=r+l,b=Math.max(0,Math.floor(p/v)-a),w=Math.ceil(o/v)+2*a,x=Math.min(n.length-1,b+w),R=y=>{let N=y.currentTarget.scrollTop;g(N),c?.(N);},C=_.useMemo(()=>{let y=[];for(let N=b;N<=x;N++)n[N]!==void 0&&y.push({item:n[N],index:N,style:{position:"absolute",top:N*v,left:0,right:0,height:r}});return y},[n,b,x,v,r]);return jsx("div",{ref:f,className:m(Vb({variant:t,className:e})),style:{height:o,position:"relative"},onScroll:R,...d,children:jsx("div",{style:{height:h,position:"relative"},children:C.map(({item:y,index:N,style:T})=>jsx("div",{style:T,children:s(y,N)},i?i(y,N):N))})})}var WT=_.forwardRef(UT);var zb=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),Ml=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),Ob=_.forwardRef(({className:e,variant:t,size:n,children:r,onLoadMore:o,hasMore:a,isLoading:s=false,loader:i,threshold:l=100,rootMargin:c,useWindow:d=false,endMessage:u,...f},p)=>{let g=_.useRef(null),h=_.useRef(null),v=_.useRef(false);_.useImperativeHandle(p,()=>g.current),_.useEffect(()=>{let w=h.current;if(!w)return;let x=new IntersectionObserver(R=>{let[C]=R;C.isIntersecting&&a&&!s&&!v.current&&(v.current=true,Promise.resolve(o()).finally(()=>{v.current=false;}));},{root:d?null:g.current,rootMargin:c||`${l}px`,threshold:0});return x.observe(w),()=>{x.disconnect();}},[a,s,o,l,c,d]);let b=jsx("div",{className:m(Ml({size:n})),children:jsx(Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})});return jsxs("div",{ref:g,className:m(zb({variant:t,className:e})),...f,children:[r,jsx("div",{ref:h,className:"h-px w-full"}),s&&(i||b),!a&&!s&&u&&jsx("div",{className:m(Ml({size:n}),"text-muted-foreground text-sm"),children:u})]})});Ob.displayName="InfiniteScroll";var rM=e=>e.map(t=>typeof t=="string"?{src:t}:t),Nl=_.forwardRef(({images:e,open:t,onOpenChange:n,initialIndex:r=0,onIndexChange:o,trigger:a,showThumbnails:s=true,showZoom:i=true,showRotate:l=true,showDownload:c=true,showFullscreen:d=true,showNavigation:u=true,showCounter:f=true,closeOnBackdropClick:p=true,className:g},h)=>{let v=_.useMemo(()=>rM(e),[e]),[b,w]=_.useState(r),[x,R]=_.useState(1),[C,y]=_.useState(0),[N,T]=_.useState(false),[k,E]=_.useState(false),[M,P]=_.useState({x:0,y:0}),[S,H]=_.useState({x:0,y:0}),[D,L]=_.useState(false),V=_.useRef(null),A=v[b];_.useEffect(()=>{L(true);},[]),_.useEffect(()=>{w(r);},[r]),_.useEffect(()=>{o?.(b);},[b,o]),_.useEffect(()=>{R(1),y(0),P({x:0,y:0});},[b]),_.useEffect(()=>{if(t)return Gt(),()=>Ut()},[t]);let B=_.useCallback(()=>{w(Z=>Z>0?Z-1:v.length-1);},[v.length]),I=_.useCallback(()=>{w(Z=>Z<v.length-1?Z+1:0);},[v.length]),F=()=>{R(Z=>Math.min(Z+.5,4));},K=()=>{R(Z=>{let le=Math.max(Z-.5,.5);return le===1&&P({x:0,y:0}),le});},Y=()=>{y(Z=>(Z+90)%360);},q=async()=>{if(A)try{let le=await(await fetch(A.src)).blob(),Be=URL.createObjectURL(le),me=document.createElement("a");me.href=Be,me.download=A.alt||`image-${b+1}`,document.body.appendChild(me),me.click(),document.body.removeChild(me),URL.revokeObjectURL(Be);}catch{window.open(A.src,"_blank");}},$=async()=>{if(V.current)if(N)try{await document.exitFullscreen(),T(!1);}catch{}else try{await V.current.requestFullscreen(),T(!0);}catch{}},O=Z=>{x>1&&(E(true),H({x:Z.clientX-M.x,y:Z.clientY-M.y}));},W=Z=>{k&&x>1&&P({x:Z.clientX-S.x,y:Z.clientY-S.y});},z=()=>{E(false);},j=()=>{n?.(false);},oe=Z=>{p&&Z.target===Z.currentTarget&&j();},ge=_.useCallback(Z=>{switch(Z.key){case "ArrowLeft":B();break;case "ArrowRight":I();break;case "Escape":n?.(false);break;case "+":case "=":F();break;case "-":K();break}},[B,I,n]);if(_.useEffect(()=>{if(t)return window.addEventListener("keydown",ge),()=>window.removeEventListener("keydown",ge)},[t,ge]),_.useEffect(()=>{let Z=()=>{T(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",Z),()=>document.removeEventListener("fullscreenchange",Z)},[]),v.length===0)return null;let G=a?_.isValidElement(a)?_.cloneElement(a,{onClick:Z=>{a.props.onClick?.(Z),n?.(true);}}):jsx("button",{type:"button",onClick:()=>n?.(true),children:a}):null;return jsxs(Fragment,{children:[G,!D||!t?null:Oa.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/90 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":t?"open":"closed",onClick:oe}),jsxs("div",{ref:h,className:m("fixed inset-0 z-50 flex flex-col outline-none",g),children:[jsxs("div",{className:"flex items-center justify-between p-4 text-white",children:[jsxs("div",{className:"flex items-center gap-2",children:[f&&v.length>1&&jsxs("span",{className:"text-sm",children:[b+1," / ",v.length]}),A?.title&&jsx("span",{className:"ml-4 text-sm font-medium",children:A.title})]}),jsxs("div",{className:"flex items-center gap-1",children:[i&&jsxs(Fragment,{children:[jsx("button",{onClick:K,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom out",children:jsx(ZoomOut,{className:"h-5 w-5"})}),jsxs("span",{className:"min-w-[3rem] text-center text-sm",children:[Math.round(x*100),"%"]}),jsx("button",{onClick:F,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom in",children:jsx(ZoomIn,{className:"h-5 w-5"})})]}),l&&jsx("button",{onClick:Y,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Rotate",children:jsx(RotateCw,{className:"h-5 w-5"})}),c&&jsx("button",{onClick:q,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Download",children:jsx(Download,{className:"h-5 w-5"})}),d&&jsx("button",{onClick:$,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:N?"Exit fullscreen":"Fullscreen",children:N?jsx(Minimize2,{className:"h-5 w-5"}):jsx(Maximize2,{className:"h-5 w-5"})}),jsxs("button",{onClick:j,className:"rounded-full p-2 hover:bg-white/10 transition-colors ml-2",children:[jsx(X,{className:"h-5 w-5"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]}),jsxs("div",{ref:V,className:"relative flex-1 flex items-center justify-center overflow-hidden",onMouseDown:O,onMouseMove:W,onMouseUp:z,onMouseLeave:z,children:[u&&v.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:B,className:"absolute left-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronLeft,{className:"h-6 w-6"})}),jsx("button",{onClick:I,className:"absolute right-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronRight,{className:"h-6 w-6"})})]}),jsx("img",{src:A?.src,alt:A?.alt||"",className:m("max-h-full max-w-full object-contain transition-transform duration-200",k?"cursor-grabbing":x>1?"cursor-grab":""),style:{transform:`translate(${M.x}px, ${M.y}px) scale(${x}) rotate(${C}deg)`},draggable:false})]}),A?.description&&jsx("div",{className:"p-4 text-center text-white text-sm",children:A.description}),s&&v.length>1&&jsx("div",{className:"flex justify-center gap-2 p-4 overflow-x-auto",children:v.map((Z,le)=>jsx("button",{onClick:()=>w(le),className:m("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",b===le?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:Z.src,alt:Z.alt||`Thumbnail ${le+1}`,className:"h-full w-full object-cover"})},le))})]})]}),document.body)]})});Nl.displayName="ImageViewer";var Fb=({children:e,images:t,index:n=0,className:r})=>{let[o,a]=_.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:m("cursor-zoom-in",r),children:e}),jsx(Nl,{images:t,open:o,onOpenChange:a,initialIndex:n})]})};Fb.displayName="ImageViewerTrigger";var Kb=cva("absolute rounded-full border-2 border-background",{variants:{color:{default:"bg-muted-foreground",primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},size:{sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3"},position:{"top-right":"top-0 right-0 -translate-y-1/3 translate-x-1/3","top-left":"top-0 left-0 -translate-y-1/3 -translate-x-1/3","bottom-right":"bottom-0 right-0 translate-y-1/3 translate-x-1/3","bottom-left":"bottom-0 left-0 translate-y-1/3 -translate-x-1/3"},ping:{true:"",false:""}},defaultVariants:{color:"primary",size:"md",position:"top-right",ping:false}}),$b=_.forwardRef(({className:e,color:t,size:n,position:r,ping:o,content:a,show:s=true,offset:i,style:l,...c},d)=>{if(!s)return null;let u=a!=null;return jsxs("span",{ref:d,className:m(Kb({color:t,size:u?void 0:n,position:r,ping:o}),u&&"flex h-auto w-auto min-w-[1.25rem] items-center justify-center px-1 py-0.5 text-[10px] font-medium text-white",e),style:{...l,...i!==void 0&&{transform:`translate(${r?.includes("right")?i:-i}px, ${r?.includes("top")?-i:i}px)`}},...c,children:[o&&jsx("span",{className:m("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75",t==="default"&&"bg-muted-foreground",t==="primary"&&"bg-primary",t==="secondary"&&"bg-secondary",t==="success"&&"bg-success",t==="warning"&&"bg-warning",t==="danger"&&"bg-danger")}),a]})});$b.displayName="Indicator";var Gb=_.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:m("relative inline-flex",e),...n,children:t}));Gb.displayName="IndicatorWrapper";var Wb=cva("relative overflow-auto",{variants:{orientation:{vertical:"",horizontal:"",both:""},size:{sm:"",md:"",lg:""}},defaultVariants:{orientation:"vertical",size:"md"}}),jb=_.forwardRef(({className:e,orientation:t,size:n,hideScrollbar:r=false,shadowColor:o="rgba(0, 0, 0, 0.1)",children:a,...s},i)=>{let l=_.useRef(null),[c,d]=_.useState({top:false,bottom:false,left:false,right:false});_.useImperativeHandle(i,()=>l.current);let u=_.useCallback(()=>{let b=l.current;if(!b)return;let{scrollTop:w,scrollLeft:x,scrollHeight:R,scrollWidth:C,clientHeight:y,clientWidth:N}=b;d({top:w>0,bottom:w<R-y-1,left:x>0,right:x<C-N-1});},[]);_.useEffect(()=>{let b=l.current;if(b)return u(),b.addEventListener("scroll",u),window.addEventListener("resize",u),()=>{b.removeEventListener("scroll",u),window.removeEventListener("resize",u);}},[u]);let p={sm:"20px",md:"40px",lg:"60px"}[n??"md"],g=t==="vertical"||t==="both",h=t==="horizontal"||t==="both",v={maskImage:[g&&c.top&&`linear-gradient(to bottom, transparent, black ${p})`,g&&c.bottom&&`linear-gradient(to top, transparent, black ${p})`,h&&c.left&&`linear-gradient(to right, transparent, black ${p})`,h&&c.right&&`linear-gradient(to left, transparent, black ${p})`].filter(Boolean).join(", ")||void 0,maskComposite:"intersect",WebkitMaskComposite:"source-in"};return jsx("div",{ref:l,className:m(Wb({orientation:t,size:n}),r&&"scrollbar-hide [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",e),style:v,...s,children:a})});jb.displayName="ScrollShadow";var _b=cva("inline-flex items-center justify-center font-mono font-medium",{variants:{variant:{default:"rounded border border-border bg-muted text-muted-foreground shadow-sm",bordered:"rounded border border-current text-foreground",ghost:"text-muted-foreground"},size:{sm:"min-w-[1.25rem] px-1 py-0.5 text-[10px]",md:"min-w-[1.5rem] px-1.5 py-0.5 text-xs",lg:"min-w-[2rem] px-2 py-1 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),cM={cmd:"\u2318",command:"\u2318",meta:"\u2318",ctrl:"\u2303",control:"\u2303",alt:"\u2325",option:"\u2325",shift:"\u21E7",enter:"\u21B5",return:"\u21B5",backspace:"\u232B",delete:"\u2326",escape:"\u238B",esc:"\u238B",tab:"\u21E5",space:"\u2423",up:"\u2191",down:"\u2193",left:"\u2190",right:"\u2192",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2912",end:"\u2913",capslock:"\u21EA"},dM={cmd:"meta",command:"meta",ctrl:"control",alt:"alt",option:"alt",shift:"shift",enter:"enter",return:"enter",backspace:"backspace",delete:"delete",escape:"escape",esc:"escape",tab:"tab",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",pageup:"pageup",pagedown:"pagedown",home:"home",end:"end"},uM=e=>{let t=e.toLowerCase();return cM[t]||e.toUpperCase()},na=e=>{let t=e.toLowerCase();return dM[t]||t},ks=e=>{let t=na(e);return ["meta","control","alt","shift"].includes(t)},Yb=_.forwardRef(({className:e,variant:t,size:n,keys:r,children:o,onPress:a,disabled:s,preventDefault:i=true,...l},c)=>{_.useEffect(()=>{if(!a||!r||s)return;let u=Array.isArray(r)?r:[r],f=u.filter(ks).map(na),p=u.filter(h=>!ks(h)).map(na),g=h=>{let v=f.includes("meta")===h.metaKey,b=f.includes("control")===h.ctrlKey,w=f.includes("alt")===h.altKey,x=f.includes("shift")===h.shiftKey,R=p.length===0||p.includes(h.key.toLowerCase());v&&b&&w&&x&&R&&(i&&h.preventDefault(),a(h));};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[r,a,s,i]);let d=()=>r?(Array.isArray(r)?r:[r]).map((f,p)=>jsxs(_.Fragment,{children:[p>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:uM(f)})]},p)):o;return jsx("kbd",{ref:c,className:m(_b({variant:t,size:n}),s&&"opacity-50",e),...l,children:d()})});Yb.displayName="Kbd";function mM(e,t,n={}){let{disabled:r=false,preventDefault:o=true}=n;_.useEffect(()=>{if(r)return;let a=Array.isArray(e)?e:[e],s=a.filter(ks).map(na),i=a.filter(c=>!ks(c)).map(na),l=c=>{let d=s.includes("meta")===c.metaKey,u=s.includes("control")===c.ctrlKey,f=s.includes("alt")===c.altKey,p=s.includes("shift")===c.shiftKey,g=i.length===0||i.includes(c.key.toLowerCase());d&&u&&f&&p&&g&&(o&&c.preventDefault(),t(c));};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t,r,o]);}var Xb=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),qb=_.forwardRef(({className:e,size:t,value:n,successDuration:r=2e3,onCopySuccess:o,onCopyError:a,copyIcon:s,successIcon:i,...l},c)=>{let[d,u]=_.useState(false),p={sm:14,md:16,lg:20}[t??"md"],g=async()=>{try{await navigator.clipboard.writeText(n),u(!0),o?.(),setTimeout(()=>{u(!1);},r);}catch(h){a?.(h);}};return jsx("button",{ref:c,type:"button",className:m(Xb({size:t}),e),onClick:g,"aria-label":d?"Copied":"Copy to clipboard",...l,children:d?i??jsx(Check,{className:"text-success",style:{width:p,height:p}}):s??jsx(Copy,{style:{width:p,height:p}})})});qb.displayName="CopyButton";var Qb=cva("flex flex-col bg-background",{variants:{variant:{default:"border rounded-lg",bordered:"border-2 rounded-lg",ghost:""},size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{variant:"default",size:"md"}}),yM=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"}],RM=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wM=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function CM(e,t,n){let r=new Date(e,t,1),o=new Date(e,t+1,0),a=[],s=r.getDay()-n;s<0&&(s+=7);for(let l=s-1;l>=0;l--)a.push(new Date(e,t,-l));for(let l=1;l<=o.getDate();l++)a.push(new Date(e,t,l));let i=42-a.length;for(let l=1;l<=i;l++)a.push(new Date(e,t+1,l));return a}function TM(e,t){let n=[],o=e.getDay()-t;o<0&&(o+=7);let a=new Date(e);a.setDate(e.getDate()-o);for(let s=0;s<7;s++){let i=new Date(a);i.setDate(a.getDate()+s),n.push(i);}return n}function Ls(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Es(e){return Ls(e,new Date)}function Zb(e,t){return e.filter(n=>{let r=new Date(n.start),o=new Date(n.end);return Ls(r,t)||Ls(o,t)||r<t&&o>t})}var Jb=_.forwardRef(({className:e,variant:t,size:n,events:r=[],view:o="month",onViewChange:a,viewOptions:s=yM,date:i,onDateChange:l,onEventClick:c,onSlotClick:d,weekStartsOn:u=0,locale:f="en-US",...p},g)=>{let[h,v]=_.useState(new Date),b=i??h,w=M=>{l?l(M):v(M);},x=u===1?wM:RM,R=()=>{let M=new Date(b);o==="month"?M.setMonth(M.getMonth()-1):o==="week"?M.setDate(M.getDate()-7):M.setDate(M.getDate()-1),w(M);},C=()=>{let M=new Date(b);o==="month"?M.setMonth(M.getMonth()+1):o==="week"?M.setDate(M.getDate()+7):M.setDate(M.getDate()+1),w(M);},y=()=>{w(new Date);},N=()=>o==="day"?b.toLocaleDateString(f,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):b.toLocaleDateString(f,{year:"numeric",month:"long"}),T=()=>{let M=CM(b.getFullYear(),b.getMonth(),u);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:x.map(P=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:P},P))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:M.map((P,S)=>{let H=Zb(r,P),D=P.getMonth()===b.getMonth();return jsxs("div",{className:m("min-h-[80px] border-b border-r p-1 cursor-pointer hover:bg-accent/50 transition-colors",!D&&"bg-muted/30"),onClick:()=>d?.(P),children:[jsx("div",{className:m("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",Es(P)&&"bg-primary text-primary-foreground",!D&&"text-muted-foreground"),children:P.getDate()}),jsxs("div",{className:"space-y-0.5",children:[H.slice(0,3).map(L=>jsx("div",{className:"text-xs px-1 py-0.5 rounded truncate cursor-pointer hover:opacity-80",style:{backgroundColor:L.color||"hsl(var(--primary))",color:"white"},onClick:V=>{V.stopPropagation(),c?.(L);},children:L.title},L.id)),H.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",H.length-3," more"]})]})]},S)})})]})},k=()=>{let M=TM(b,u),P=Array.from({length:24},(S,H)=>H);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxs("div",{className:"grid grid-cols-[60px_repeat(7,1fr)] border-b",children:[jsx("div",{className:"p-2"}),M.map((S,H)=>jsxs("div",{className:m("p-2 text-center border-l",Es(S)&&"bg-primary/10"),children:[jsx("div",{className:"text-xs text-muted-foreground",children:x[H]}),jsx("div",{className:m("text-lg font-semibold",Es(S)&&"text-primary"),children:S.getDate()})]},H))]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:P.map(S=>jsxs(_.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[S.toString().padStart(2,"0"),":00"]}),M.map((H,D)=>{let L=new Date(H);L.setHours(S,0,0,0);let V=r.filter(A=>{let B=new Date(A.start);return Ls(B,H)&&B.getHours()===S});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>d?.(L),children:V.map(A=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:A.color||"hsl(var(--primary))",color:"white"},onClick:B=>{B.stopPropagation(),c?.(A);},children:A.title},A.id))},D)})]},S))})})]})},E=()=>{let M=Array.from({length:24},(S,H)=>H),P=Zb(r,b);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsx("div",{className:"p-4 border-b text-center",children:jsx("div",{className:m("inline-flex items-center justify-center w-12 h-12 rounded-full text-2xl font-semibold",Es(b)&&"bg-primary text-primary-foreground"),children:b.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:M.map(S=>{let H=new Date(b);H.setHours(S,0,0,0);let D=P.filter(L=>new Date(L.start).getHours()===S);return jsxs(_.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[S.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>d?.(H),children:D.map(L=>jsx("div",{className:"absolute inset-x-1 top-0.5 text-xs px-2 py-1 rounded truncate cursor-pointer",style:{backgroundColor:L.color||"hsl(var(--primary))",color:"white"},onClick:V=>{V.stopPropagation(),c?.(L);},children:L.title},L.id))})]},S)})})})]})};return jsxs("div",{ref:g,className:m(Qb({variant:t,size:n,className:e})),...p,children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(ae,{variant:"flat",size:"sm",onClick:y,children:"Today"}),jsx(ae,{variant:"flat",size:"sm",isIconOnly:true,onClick:R,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(ae,{variant:"flat",size:"sm",isIconOnly:true,onClick:C,children:jsx(ChevronRight,{className:"h-4 w-4"})}),jsx("h2",{className:"text-lg font-semibold ml-2",children:N()})]}),jsx(Va,{options:s,value:o,onValueChange:M=>a?.(M),className:"w-[120px]"})]}),o==="month"&&T(),o==="week"&&k(),o==="day"&&E()]})});Jb.displayName="FullCalendar";var Is=({active:e,payload:t,label:n})=>!e||!t||!t.length?null:jsxs("div",{className:"border bg-card text-card-foreground shadow-sm rounded-lg p-3 min-w-[120px]",children:[n&&jsx("p",{className:"text-sm font-medium mb-2 text-card-foreground",children:n}),jsx("div",{className:"space-y-1",children:t.map((r,o)=>jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsx("span",{className:"text-sm",style:{color:r.color},children:r.name}),jsx("span",{className:"text-sm font-medium text-card-foreground",children:typeof r.value=="number"?r.value.toLocaleString():r.value})]},o))})]}),oa=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),aa=["hsl(var(--primary))","hsl(var(--chart-1, 220 70% 50%))","hsl(var(--chart-2, 160 60% 45%))","hsl(var(--chart-3, 30 80% 55%))","hsl(var(--chart-4, 280 65% 60%))"],ev=_.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=aa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},u)=>jsx("div",{ref:u,className:m(oa({size:t,className:e})),...d,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(LineChart,{data:n,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(Is,{})}),s&&jsx(Legend,{}),r.map((f,p)=>jsx(Line,{type:c,dataKey:f,stroke:o[p%o.length],strokeWidth:2,dot:{fill:o[p%o.length],strokeWidth:0},activeDot:{r:6}},f))]})})}));ev.displayName="LineChart";var tv=_.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=aa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,layout:d="horizontal",...u},f)=>jsx("div",{ref:f,className:m(oa({size:t,className:e})),...u,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(BarChart,{data:n,layout:d,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:d==="horizontal"?l:void 0,type:d==="horizontal"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{dataKey:d==="vertical"?l:void 0,type:d==="vertical"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(Is,{})}),s&&jsx(Legend,{}),r.map((p,g)=>jsx(Bar,{dataKey:p,fill:o[g%o.length],stackId:c?"stack":void 0,radius:[4,4,0,0]},p))]})})}));tv.displayName="BarChart";var nv=_.forwardRef(({className:e,size:t,data:n,dataKey:r="value",nameKey:o="name",colors:a=aa,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...u},f)=>jsx("div",{ref:f,className:m(oa({size:t,className:e})),...u,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{content:jsx(Is,{})}),l&&jsx(Legend,{}),jsx(Pie,{data:n,dataKey:r,nameKey:o,cx:"50%",cy:"50%",innerRadius:s,outerRadius:i,label:d,labelLine:d,children:n.map((p,g)=>jsx(Cell,{fill:a[g%a.length]},`cell-${g}`))})]})})}));nv.displayName="PieChart";var rv=_.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=aa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,curveType:d="monotone",...u},f)=>jsx("div",{ref:f,className:m(oa({size:t,className:e})),...u,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(AreaChart,{data:n,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(Is,{})}),s&&jsx(Legend,{}),r.map((p,g)=>jsx(Area,{type:d,dataKey:p,stroke:o[g%o.length],fill:o[g%o.length],fillOpacity:.3,stackId:c?"stack":void 0},p))]})})}));rv.displayName="AreaChart";var sv=cva("flex gap-4 overflow-x-auto p-4",{variants:{variant:{default:"bg-muted/30",bordered:"border rounded-lg bg-background",ghost:""}},defaultVariants:{variant:"default"}}),iv=cva("flex flex-col min-w-[280px] w-[280px] rounded-lg",{variants:{variant:{default:"bg-muted/50",bordered:"border bg-background",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),Il=cva("rounded-lg p-3 cursor-grab active:cursor-grabbing transition-all",{variants:{variant:{default:"bg-background border shadow-sm hover:shadow-md",bordered:"border-2 bg-background hover:border-primary/50",ghost:"bg-muted/50 hover:bg-muted"},isDragging:{true:"opacity-50 scale-[1.02] shadow-lg",false:""}},defaultVariants:{variant:"default",isDragging:false}});function _M({card:e,columnId:t,variant:n,renderCard:r,onCardClick:o}){let{attributes:a,listeners:s,setNodeRef:i,transform:l,transition:c,isDragging:d}=useSortable({id:e.id,data:{columnId:t}}),u={transform:CSS.Transform.toString(l),transition:c};return jsx("div",{ref:i,style:u,className:m(Il({variant:n,isDragging:d})),onClick:()=>o?.(e,t),...a,...s,children:r?r(e,t):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:e.title}),e.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description})]})]})})}function YM({column:e,variant:t,renderCard:n,onCardClick:r,onAddCard:o,showAddCard:a,columnHeight:s}){return jsxs("div",{className:m(iv({variant:t})),children:[jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[jsxs("div",{className:"flex items-center gap-2",children:[e.color&&jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),jsx("h3",{className:"font-semibold text-sm",children:e.title}),jsx("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:e.cards.length})]}),a&&jsx(ae,{variant:"ghost",size:"sm",isIconOnly:true,className:"h-7 w-7",onClick:()=>o?.(e.id),children:jsx(Plus,{className:"h-4 w-4"})})]}),jsx(De,{style:{height:s},children:jsxs("div",{className:"p-2 space-y-2",children:[jsx(SortableContext,{items:e.cards.map(i=>i.id),strategy:verticalListSortingStrategy,children:e.cards.map(i=>jsx(_M,{card:i,columnId:e.id,variant:t,renderCard:n,onCardClick:r},i.id))}),e.cards.length===0&&jsx("div",{className:"h-20 border-2 border-dashed rounded-lg flex items-center justify-center text-muted-foreground text-sm",children:"Drop here"})]})})]})}var lv=_.forwardRef(({className:e,variant:t,columns:n,onCardMove:r,onCardClick:o,onAddCard:a,renderCard:s,showAddCard:i=true,columnHeight:l=500,...c},d)=>{let[u,f]=_.useState(null),[p,g]=_.useState(null),h=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),v=R=>n.find(C=>C.cards.some(y=>y.id===R));return jsxs(DndContext,{sensors:h,collisionDetection:closestCorners,onDragStart:R=>{let{active:C}=R,y=v(C.id);if(y){let N=y.cards.find(T=>T.id===C.id);N&&(f(N),g(y.id));}},onDragOver:R=>{let{active:C,over:y}=R;if(!y)return;let N=C.id,T=y.id,k=v(N),E=v(T)||n.find(S=>S.id===T);if(!k||!E||k.id===E.id)return;let M=E.cards.findIndex(S=>S.id===T),P=M===-1?E.cards.length:M;r?.(N,k.id,E.id,P);},onDragEnd:R=>{let{active:C,over:y}=R;if(y&&C.id!==y.id){let N=v(C.id),T=v(y.id)||n.find(k=>k.id===y.id);if(N&&T){let k=T.cards.findIndex(M=>M.id===y.id),E=k===-1?T.cards.length:k;r?.(C.id,N.id,T.id,E);}}f(null),g(null);},children:[jsx("div",{ref:d,className:m(sv({variant:t,className:e})),...c,children:n.map(R=>jsx(YM,{column:R,variant:t,renderCard:s,onCardClick:o,onAddCard:a,showAddCard:i,columnHeight:l},R.id))}),jsx(DragOverlay,{children:u&&p&&jsx("div",{className:m(Il({variant:t,isDragging:true})),children:s?s(u,p):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:u.title}),u.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:u.description})]})]})})})]})});lv.displayName="KanbanBoard";var cv=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),dv=_.createContext(null);function As(){let e=_.useContext(dv);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var uv=_.forwardRef(({className:e,variant:t,children:n,opts:r,plugins:o,orientation:a="horizontal",showArrows:s=true,showDots:i=true,setApi:l,...c},d)=>{let[u,f]=XM({...r,axis:a==="horizontal"?"x":"y"},o),[p,g]=_.useState(false),[h,v]=_.useState(false),[b,w]=_.useState(0),[x,R]=_.useState([]),C=_.useCallback(E=>{E&&(w(E.selectedScrollSnap()),g(E.canScrollPrev()),v(E.canScrollNext()));},[]),y=_.useCallback(()=>{f?.scrollPrev();},[f]),N=_.useCallback(()=>{f?.scrollNext();},[f]),T=_.useCallback(E=>{f?.scrollTo(E);},[f]),k=_.useCallback(E=>{E.key==="ArrowLeft"?(E.preventDefault(),y()):E.key==="ArrowRight"&&(E.preventDefault(),N());},[y,N]);return _.useEffect(()=>{!f||!l||l(f);},[f,l]),_.useEffect(()=>{if(f)return R(f.scrollSnapList()),C(f),f.on("reInit",C),f.on("select",C),()=>{f?.off("select",C);}},[f,C]),jsx(dv.Provider,{value:{carouselRef:u,api:f,scrollPrev:y,scrollNext:N,canScrollPrev:p,canScrollNext:h,selectedIndex:b,scrollSnaps:x,scrollTo:T,orientation:a},children:jsxs("div",{ref:d,className:m(cv({variant:t,className:e})),onKeyDownCapture:k,role:"region","aria-roledescription":"carousel",...c,children:[jsx("div",{ref:u,className:"overflow-hidden",children:jsx("div",{className:m("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col"),children:n})}),s&&jsxs(Fragment,{children:[jsx(Vl,{}),jsx(Al,{})]}),i&&x.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:x.map((E,M)=>jsx("button",{className:m("w-2 h-2 rounded-full transition-all",M===b?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>T(M),"aria-label":`Go to slide ${M+1}`},M))})]})})});uv.displayName="Carousel";var mv=_.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex",e),...t}));mv.displayName="CarouselContent";var pv=_.forwardRef(({className:e,basis:t="basis-full",...n},r)=>{let{orientation:o}=As();return jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:m("min-w-0 shrink-0 grow-0",o==="horizontal"?"pl-4":"pt-4",t,e),...n})});pv.displayName="CarouselItem";var Vl=_.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollPrev:s,canScrollPrev:i}=As();return jsxs(ae,{ref:a,variant:t,size:n,isIconOnly:r,className:m("absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!i,onClick:s,...o,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Previous slide"})]})});Vl.displayName="CarouselPrevious";var Al=_.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollNext:s,canScrollNext:i}=As();return jsxs(ae,{ref:a,variant:t,size:n,isIconOnly:r,className:m("absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!i,onClick:s,...o,children:[jsx(ChevronRight,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Next slide"})]})});Al.displayName="CarouselNext";var fv=cva("flex flex-col bg-popover border rounded-lg shadow-md",{variants:{size:{sm:"w-64 h-72",md:"w-80 h-96",lg:"w-96 h-[480px]"}},defaultVariants:{size:"md"}}),zs={recent:{icon:"\u{1F550}",name:"Recent"},smileys:{icon:"\u{1F600}",name:"Smileys & Emotion"},people:{icon:"\u{1F44B}",name:"People & Body"},animals:{icon:"\u{1F43B}",name:"Animals & Nature"},food:{icon:"\u{1F354}",name:"Food & Drink"},travel:{icon:"\u{1F697}",name:"Travel & Places"},activities:{icon:"\u26BD",name:"Activities"},objects:{icon:"\u{1F4A1}",name:"Objects"},symbols:{icon:"\u2764\uFE0F",name:"Symbols"},flags:{icon:"\u{1F3F3}\uFE0F",name:"Flags"}},Ol={smileys:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F923}","\u{1F602}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60A}","\u{1F607}","\u{1F970}","\u{1F60D}","\u{1F929}","\u{1F618}","\u{1F617}","\u263A\uFE0F","\u{1F61A}","\u{1F60B}","\u{1F61B}","\u{1F61C}","\u{1F92A}","\u{1F61D}","\u{1F911}","\u{1F917}","\u{1F92D}","\u{1F92B}","\u{1F914}","\u{1F910}","\u{1F928}","\u{1F610}","\u{1F611}","\u{1F636}","\u{1F60F}","\u{1F612}","\u{1F644}","\u{1F62C}","\u{1F925}","\u{1F60C}","\u{1F614}","\u{1F62A}","\u{1F924}","\u{1F634}","\u{1F637}","\u{1F912}","\u{1F915}","\u{1F922}","\u{1F92E}","\u{1F927}","\u{1F975}","\u{1F976}","\u{1F974}","\u{1F635}","\u{1F92F}","\u{1F920}","\u{1F973}","\u{1F978}","\u{1F60E}","\u{1F913}","\u{1F9D0}","\u{1F615}","\u{1F61F}","\u{1F641}","\u2639\uFE0F","\u{1F62E}","\u{1F62F}","\u{1F632}","\u{1F633}","\u{1F97A}","\u{1F626}","\u{1F627}","\u{1F628}","\u{1F630}","\u{1F625}","\u{1F622}","\u{1F62D}","\u{1F631}","\u{1F616}","\u{1F623}","\u{1F61E}","\u{1F613}","\u{1F629}","\u{1F62B}","\u{1F971}","\u{1F624}","\u{1F621}","\u{1F620}","\u{1F92C}","\u{1F608}","\u{1F47F}","\u{1F480}","\u2620\uFE0F","\u{1F4A9}","\u{1F921}","\u{1F479}","\u{1F47A}","\u{1F47B}","\u{1F47D}"],people:["\u{1F44B}","\u{1F91A}","\u{1F590}\uFE0F","\u270B","\u{1F596}","\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","\u{1F44D}","\u{1F44E}","\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{1F9BF}","\u{1F9B5}","\u{1F9B6}","\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}","\u{1F476}","\u{1F9D2}","\u{1F466}","\u{1F467}","\u{1F9D1}","\u{1F471}","\u{1F468}","\u{1F9D4}","\u{1F469}","\u{1F9D3}","\u{1F474}","\u{1F475}","\u{1F64D}","\u{1F64E}","\u{1F645}","\u{1F646}","\u{1F481}","\u{1F64B}","\u{1F9CF}","\u{1F647}","\u{1F926}","\u{1F937}","\u{1F46E}","\u{1F575}\uFE0F","\u{1F482}","\u{1F977}","\u{1F477}","\u{1F934}","\u{1F478}"],animals:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\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{1FAB0}","\u{1FAB2}","\u{1FAB3}","\u{1F99F}","\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}"],food:["\u{1F347}","\u{1F348}","\u{1F349}","\u{1F34A}","\u{1F34B}","\u{1F34C}","\u{1F34D}","\u{1F96D}","\u{1F34E}","\u{1F34F}","\u{1F350}","\u{1F351}","\u{1F352}","\u{1F353}","\u{1FAD0}","\u{1F95D}","\u{1F345}","\u{1FAD2}","\u{1F965}","\u{1F951}","\u{1F346}","\u{1F954}","\u{1F955}","\u{1F33D}","\u{1F336}\uFE0F","\u{1FAD1}","\u{1F952}","\u{1F96C}","\u{1F966}","\u{1F9C4}","\u{1F9C5}","\u{1F344}","\u{1F95C}","\u{1F330}","\u{1F35E}","\u{1F950}","\u{1F956}","\u{1FAD3}","\u{1F968}","\u{1F96F}","\u{1F95E}","\u{1F9C7}","\u{1F9C0}","\u{1F356}","\u{1F357}","\u{1F969}","\u{1F953}","\u{1F354}","\u{1F35F}","\u{1F355}","\u{1F32D}","\u{1F96A}","\u{1F32E}","\u{1F32F}","\u{1FAD4}","\u{1F959}","\u{1F9C6}","\u{1F95A}","\u{1F373}","\u{1F958}","\u{1F372}","\u{1FAD5}","\u{1F963}","\u{1F957}","\u{1F37F}","\u{1F9C8}","\u{1F9C2}","\u{1F96B}","\u{1F371}","\u{1F358}","\u{1F359}","\u{1F35A}","\u{1F35B}","\u{1F35C}","\u{1F35D}","\u{1F360}","\u{1F362}","\u{1F363}","\u{1F364}","\u{1F365}"],travel:["\u{1F697}","\u{1F695}","\u{1F699}","\u{1F68C}","\u{1F68E}","\u{1F3CE}\uFE0F","\u{1F693}","\u{1F691}","\u{1F692}","\u{1F690}","\u{1F6FB}","\u{1F69A}","\u{1F69B}","\u{1F69C}","\u{1F9AF}","\u{1F9BD}","\u{1F9BC}","\u{1F6F4}","\u{1F6B2}","\u{1F6F5}","\u{1F3CD}\uFE0F","\u{1F6FA}","\u{1F6A8}","\u{1F694}","\u{1F68D}","\u{1F698}","\u{1F696}","\u{1F6A1}","\u{1F6A0}","\u{1F69F}","\u{1F683}","\u{1F68B}","\u{1F69E}","\u{1F69D}","\u{1F684}","\u{1F685}","\u{1F688}","\u{1F682}","\u{1F686}","\u{1F687}","\u{1F68A}","\u{1F689}","\u2708\uFE0F","\u{1F6EB}","\u{1F6EC}","\u{1F6E9}\uFE0F","\u{1F4BA}","\u{1F6F0}\uFE0F","\u{1F680}","\u{1F6F8}","\u{1F681}","\u{1F6F6}","\u26F5","\u{1F6A4}","\u{1F6E5}\uFE0F","\u{1F6F3}\uFE0F","\u26F4\uFE0F","\u{1F6A2}","\u2693","\u{1FA9D}","\u26FD","\u{1F6A7}","\u{1F6A6}","\u{1F6A5}","\u{1F68F}","\u{1F5FA}\uFE0F","\u{1F5FF}","\u{1F5FD}","\u{1F5FC}","\u{1F3F0}","\u{1F3EF}","\u{1F3DF}\uFE0F","\u{1F3A1}","\u{1F3A2}","\u{1F3A0}","\u26F2","\u26F1\uFE0F","\u{1F3D6}\uFE0F","\u{1F3DD}\uFE0F","\u{1F3DC}\uFE0F"],activities:["\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{1F94C}","\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}","\u26D1\uFE0F","\u{1F9D8}","\u{1F3C4}","\u{1F3CA}","\u{1F93D}","\u{1F6A3}","\u{1F9D7}","\u{1F6B5}","\u{1F6B4}","\u{1F3C6}","\u{1F947}","\u{1F948}","\u{1F949}","\u{1F3C5}","\u{1F396}\uFE0F","\u{1F3F5}\uFE0F","\u{1F397}\uFE0F","\u{1F3AB}","\u{1F39F}\uFE0F","\u{1F3AA}","\u{1F939}","\u{1F3AD}","\u{1FA70}","\u{1F3A8}","\u{1F3AC}","\u{1F3A4}","\u{1F3A7}","\u{1F3BC}","\u{1F3B9}","\u{1F941}","\u{1FA98}","\u{1F3B7}","\u{1F3BA}","\u{1FA97}","\u{1F3B8}","\u{1FA95}"],objects:["\u231A","\u{1F4F1}","\u{1F4F2}","\u{1F4BB}","\u2328\uFE0F","\u{1F5A5}\uFE0F","\u{1F5A8}\uFE0F","\u{1F5B1}\uFE0F","\u{1F5B2}\uFE0F","\u{1F579}\uFE0F","\u{1F5DC}\uFE0F","\u{1F4BD}","\u{1F4BE}","\u{1F4BF}","\u{1F4C0}","\u{1F4FC}","\u{1F4F7}","\u{1F4F8}","\u{1F4F9}","\u{1F3A5}","\u{1F4FD}\uFE0F","\u{1F39E}\uFE0F","\u{1F4DE}","\u260E\uFE0F","\u{1F4DF}","\u{1F4E0}","\u{1F4FA}","\u{1F4FB}","\u{1F399}\uFE0F","\u{1F39A}\uFE0F","\u{1F39B}\uFE0F","\u{1F9ED}","\u23F1\uFE0F","\u23F2\uFE0F","\u23F0","\u{1F570}\uFE0F","\u231B","\u23F3","\u{1F4E1}","\u{1F50B}","\u{1F50C}","\u{1F4A1}","\u{1F526}","\u{1F56F}\uFE0F","\u{1FA94}","\u{1F9EF}","\u{1F6E2}\uFE0F","\u{1F4B8}","\u{1F4B5}","\u{1F4B4}","\u{1F4B6}","\u{1F4B7}","\u{1FA99}","\u{1F4B0}","\u{1F4B3}","\u{1F48E}","\u2696\uFE0F","\u{1FA9C}","\u{1F9F0}","\u{1FA9B}","\u{1F527}","\u{1F528}","\u2692\uFE0F","\u{1F6E0}\uFE0F","\u26CF\uFE0F","\u{1FA9A}","\u{1F529}","\u2699\uFE0F","\u{1FAA4}","\u{1F9F1}","\u26D3\uFE0F","\u{1F9F2}","\u{1F52B}","\u{1F4A3}","\u{1F9E8}","\u{1FA93}","\u{1F52A}","\u{1F5E1}\uFE0F","\u2694\uFE0F","\u{1F6E1}\uFE0F"],symbols:["\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}","\u262E\uFE0F","\u271D\uFE0F","\u262A\uFE0F","\u{1F549}\uFE0F","\u2638\uFE0F","\u2721\uFE0F","\u{1F52F}","\u{1F54E}","\u262F\uFE0F","\u2626\uFE0F","\u{1F6D0}","\u26CE","\u2648","\u2649","\u264A","\u264B","\u264C","\u264D","\u264E","\u264F","\u2650","\u2651","\u2652","\u2653","\u{1F194}","\u269B\uFE0F","\u{1F251}","\u2622\uFE0F","\u2623\uFE0F","\u{1F4F4}","\u{1F4F3}","\u{1F236}","\u{1F21A}","\u{1F238}","\u{1F23A}","\u{1F237}\uFE0F","\u2734\uFE0F","\u{1F19A}","\u{1F4AE}","\u{1F250}","\u3299\uFE0F","\u3297\uFE0F","\u{1F234}","\u{1F235}","\u{1F239}","\u{1F232}","\u{1F170}\uFE0F","\u{1F171}\uFE0F","\u{1F18E}","\u{1F191}","\u{1F17E}\uFE0F","\u{1F198}","\u274C","\u2B55","\u{1F6D1}","\u26D4","\u{1F4DB}","\u{1F6AB}","\u{1F4AF}","\u{1F4A2}","\u2668\uFE0F"],flags:["\u{1F3F3}\uFE0F","\u{1F3F4}","\u{1F3C1}","\u{1F6A9}","\u{1F3F3}\uFE0F\u200D\u{1F308}","\u{1F3F3}\uFE0F\u200D\u26A7\uFE0F","\u{1F1FA}\u{1F1F3}","\u{1F1E6}\u{1F1EB}","\u{1F1E6}\u{1F1F1}","\u{1F1E9}\u{1F1FF}","\u{1F1E6}\u{1F1F8}","\u{1F1E6}\u{1F1E9}","\u{1F1E6}\u{1F1F4}","\u{1F1E6}\u{1F1EE}","\u{1F1E6}\u{1F1F6}","\u{1F1E6}\u{1F1EC}","\u{1F1E6}\u{1F1F7}","\u{1F1E6}\u{1F1F2}","\u{1F1E6}\u{1F1FC}","\u{1F1E6}\u{1F1FA}","\u{1F1E6}\u{1F1F9}","\u{1F1E6}\u{1F1FF}","\u{1F1E7}\u{1F1F8}","\u{1F1E7}\u{1F1ED}","\u{1F1E7}\u{1F1E9}","\u{1F1E7}\u{1F1E7}","\u{1F1E7}\u{1F1FE}","\u{1F1E7}\u{1F1EA}","\u{1F1E7}\u{1F1FF}","\u{1F1E7}\u{1F1EF}","\u{1F1E7}\u{1F1F2}","\u{1F1E7}\u{1F1F9}","\u{1F1E7}\u{1F1F4}","\u{1F1E7}\u{1F1E6}","\u{1F1E7}\u{1F1FC}","\u{1F1E7}\u{1F1F7}","\u{1F1E7}\u{1F1F3}","\u{1F1E7}\u{1F1EC}","\u{1F1E7}\u{1F1EB}","\u{1F1E7}\u{1F1EE}","\u{1F1E8}\u{1F1FB}","\u{1F1F0}\u{1F1ED}","\u{1F1E8}\u{1F1F2}","\u{1F1E8}\u{1F1E6}","\u{1F1E8}\u{1F1EB}","\u{1F1F9}\u{1F1E9}","\u{1F1E8}\u{1F1F1}","\u{1F1E8}\u{1F1F3}","\u{1F1E8}\u{1F1F4}","\u{1F1F0}\u{1F1F2}","\u{1F1E8}\u{1F1EC}","\u{1F1E8}\u{1F1E9}","\u{1F1E8}\u{1F1F7}","\u{1F1ED}\u{1F1F7}","\u{1F1E8}\u{1F1FA}","\u{1F1E8}\u{1F1FE}","\u{1F1E8}\u{1F1FF}","\u{1F1E9}\u{1F1F0}","\u{1F1E9}\u{1F1EF}","\u{1F1E9}\u{1F1F2}","\u{1F1E9}\u{1F1F4}","\u{1F1EA}\u{1F1E8}","\u{1F1EA}\u{1F1EC}","\u{1F1F8}\u{1F1FB}","\u{1F1EC}\u{1F1F6}","\u{1F1EA}\u{1F1F7}","\u{1F1EA}\u{1F1EA}","\u{1F1EA}\u{1F1F9}","\u{1F1EA}\u{1F1FA}","\u{1F1EB}\u{1F1EF}","\u{1F1EB}\u{1F1EE}","\u{1F1EB}\u{1F1F7}","\u{1F1EC}\u{1F1E6}","\u{1F1EC}\u{1F1F2}","\u{1F1EC}\u{1F1EA}","\u{1F1E9}\u{1F1EA}","\u{1F1EC}\u{1F1ED}","\u{1F1EC}\u{1F1F7}","\u{1F1EC}\u{1F1F9}","\u{1F1EC}\u{1F1F3}"]},gv=_.forwardRef(({className:e,size:t,onEmojiSelect:n,recentEmojis:r=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=_.useState(r.length>0?"recent":o),[u,f]=_.useState(""),g=u?Object.values(Ol).flat().filter(v=>v.toLowerCase().includes(u.toLowerCase())):c==="recent"?r:Ol[c]||[],h=v=>{n?.(v);};return jsxs("div",{ref:l,className:m(fv({size:t,className:e})),...i,children:[a&&jsx("div",{className:"p-2 border-b",children:jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),jsx(ka,{placeholder:"Search emojis...",value:u,onChange:v=>f(v.target.value),className:"pl-8 h-8"})]})}),s&&!u&&jsx(De,{orientation:"horizontal",className:"border-b",children:jsx("div",{className:"flex px-1",children:Object.entries(zs).map(([v,{icon:b}])=>v==="recent"&&r.length===0?null:jsx("button",{className:m("shrink-0 p-2 text-lg hover:bg-accent rounded transition-colors",c===v&&"bg-accent"),onClick:()=>d(v),title:zs[v].name,children:b},v))})}),!u&&jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-muted-foreground",children:zs[c].name}),jsx(De,{className:"flex-1",children:jsxs("div",{className:"grid grid-cols-8 gap-1 p-2",children:[g.map((v,b)=>jsx("button",{className:"w-8 h-8 flex items-center justify-center text-xl hover:bg-accent rounded transition-colors",onClick:()=>h(v),children:v},`${v}-${b}`)),g.length===0&&jsx("div",{className:"col-span-8 py-8 text-center text-muted-foreground text-sm",children:"No emojis found"})]})})]})});gv.displayName="EmojiPicker";var bv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border-2",ghost:"border-transparent"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),kN=cva("flex flex-wrap items-center gap-0.5 p-1 border-b",{variants:{size:{sm:"p-0.5",md:"p-1",lg:"p-1.5"}},defaultVariants:{size:"md"}}),PN=cva("flex-1 overflow-auto prose prose-sm max-w-none dark:prose-invert [&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[inherit] [&_.ProseMirror.is-editor-empty:first-child::before]:text-muted-foreground [&_.ProseMirror.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.ProseMirror.is-editor-empty:first-child::before]:float-left [&_.ProseMirror.is-editor-empty:first-child::before]:pointer-events-none [&_.ProseMirror.is-editor-empty:first-child::before]:h-0",{variants:{size:{sm:"min-h-[100px] [&_.ProseMirror]:p-2 text-sm",md:"min-h-[150px] [&_.ProseMirror]:p-3 text-sm",lg:"min-h-[200px] [&_.ProseMirror]:p-4 text-base"}},defaultVariants:{size:"md"}}),Xe=({icon:e,title:t,isActive:n,onClick:r,disabled:o})=>jsxs(_n,{children:[jsx(Yn,{children:jsx(ae,{type:"button",variant:n?"solid":"ghost",size:"sm",isIconOnly:true,className:"h-7 w-7",onClick:r,disabled:o,children:e})}),jsx(Xn,{side:"top",className:"text-xs",children:t})]}),vv=_.forwardRef(({className:e,variant:t,size:n,value:r="",onChange:o,placeholder:a="Start writing...",readOnly:s=false,showToolbar:i=true,minHeight:l,maxHeight:c,onEditorReady:d,...u},f)=>{let p=useEditor({extensions:[oN.configure({heading:{levels:[1,2,3]}}),aN.configure({openOnClick:false,HTMLAttributes:{class:"text-primary underline"}}),sN,iN.configure({types:["heading","paragraph"]}),lN.configure({placeholder:a})],content:r,editable:!s,onUpdate:({editor:h})=>{o?.(h.getHTML());},onCreate:({editor:h})=>{d?.(h);}});_.useEffect(()=>{p&&r!==p.getHTML()&&p.commands.setContent(r);},[r,p]),_.useEffect(()=>{p&&p.setEditable(!s);},[s,p]);let g=()=>{if(!p)return;let h=p.getAttributes("link").href,v=window.prompt("URL",h);if(v!==null){if(v===""){p.chain().focus().extendMarkRange("link").unsetLink().run();return}p.chain().focus().extendMarkRange("link").setLink({href:v}).run();}};return p?jsx(jn,{children:jsxs("div",{ref:f,className:m(bv({variant:t,size:n,className:e})),...u,children:[i&&!s&&jsxs("div",{className:m(kN({size:n})),children:[jsx(Xe,{icon:jsx(Undo,{className:"h-4 w-4"}),title:"Undo",onClick:()=>p.chain().focus().undo().run(),disabled:!p.can().undo()}),jsx(Xe,{icon:jsx(Redo,{className:"h-4 w-4"}),title:"Redo",onClick:()=>p.chain().focus().redo().run(),disabled:!p.can().redo()}),jsx(Wn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Xe,{icon:jsx(Heading1,{className:"h-4 w-4"}),title:"Heading 1",isActive:p.isActive("heading",{level:1}),onClick:()=>p.chain().focus().toggleHeading({level:1}).run()}),jsx(Xe,{icon:jsx(Heading2,{className:"h-4 w-4"}),title:"Heading 2",isActive:p.isActive("heading",{level:2}),onClick:()=>p.chain().focus().toggleHeading({level:2}).run()}),jsx(Xe,{icon:jsx(Heading3,{className:"h-4 w-4"}),title:"Heading 3",isActive:p.isActive("heading",{level:3}),onClick:()=>p.chain().focus().toggleHeading({level:3}).run()}),jsx(Wn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Xe,{icon:jsx(Bold,{className:"h-4 w-4"}),title:"Bold (Ctrl+B)",isActive:p.isActive("bold"),onClick:()=>p.chain().focus().toggleBold().run()}),jsx(Xe,{icon:jsx(Italic,{className:"h-4 w-4"}),title:"Italic (Ctrl+I)",isActive:p.isActive("italic"),onClick:()=>p.chain().focus().toggleItalic().run()}),jsx(Xe,{icon:jsx(Underline,{className:"h-4 w-4"}),title:"Underline (Ctrl+U)",isActive:p.isActive("underline"),onClick:()=>p.chain().focus().toggleUnderline().run()}),jsx(Xe,{icon:jsx(Strikethrough,{className:"h-4 w-4"}),title:"Strikethrough",isActive:p.isActive("strike"),onClick:()=>p.chain().focus().toggleStrike().run()}),jsx(Wn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Xe,{icon:jsx(List,{className:"h-4 w-4"}),title:"Bullet List",isActive:p.isActive("bulletList"),onClick:()=>p.chain().focus().toggleBulletList().run()}),jsx(Xe,{icon:jsx(ListOrdered,{className:"h-4 w-4"}),title:"Numbered List",isActive:p.isActive("orderedList"),onClick:()=>p.chain().focus().toggleOrderedList().run()}),jsx(Wn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Xe,{icon:jsx(AlignLeft,{className:"h-4 w-4"}),title:"Align Left",isActive:p.isActive({textAlign:"left"}),onClick:()=>p.chain().focus().setTextAlign("left").run()}),jsx(Xe,{icon:jsx(AlignCenter,{className:"h-4 w-4"}),title:"Align Center",isActive:p.isActive({textAlign:"center"}),onClick:()=>p.chain().focus().setTextAlign("center").run()}),jsx(Xe,{icon:jsx(AlignRight,{className:"h-4 w-4"}),title:"Align Right",isActive:p.isActive({textAlign:"right"}),onClick:()=>p.chain().focus().setTextAlign("right").run()}),jsx(Wn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Xe,{icon:jsx(Quote,{className:"h-4 w-4"}),title:"Blockquote",isActive:p.isActive("blockquote"),onClick:()=>p.chain().focus().toggleBlockquote().run()}),jsx(Xe,{icon:jsx(Code,{className:"h-4 w-4"}),title:"Code Block",isActive:p.isActive("codeBlock"),onClick:()=>p.chain().focus().toggleCodeBlock().run()}),jsx(Wn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Xe,{icon:jsx(Link,{className:"h-4 w-4"}),title:"Insert Link",isActive:p.isActive("link"),onClick:g}),jsx(Xe,{icon:jsx(Unlink,{className:"h-4 w-4"}),title:"Remove Link",onClick:()=>p.chain().focus().unsetLink().run(),disabled:!p.isActive("link")})]}),jsx(EditorContent,{editor:p,className:m(PN({size:n})),style:{minHeight:l,maxHeight:c}})]})}):null});vv.displayName="RichTextEditor";var xv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border-2",ghost:"border-none bg-transparent"}},defaultVariants:{variant:"default"}});function AN(e,t,n){return centerCrop(makeAspectCrop({unit:"%",width:90},n,e,t),e,t)}async function hv(e,t,n=0,r=1){let o=document.createElement("canvas"),a=o.getContext("2d");if(!a)return null;let s=e.naturalWidth/e.width,i=e.naturalHeight/e.height,l=window.devicePixelRatio||1;o.width=Math.floor(t.width*s*l),o.height=Math.floor(t.height*i*l),a.scale(l,l),a.imageSmoothingQuality="high";let c=t.x*s,d=t.y*i,u=n*Math.PI/180,f=e.naturalWidth/2,p=e.naturalHeight/2;return a.save(),a.translate(-c,-d),a.translate(f,p),a.rotate(u),a.scale(r,r),a.translate(-f,-p),a.drawImage(e,0,0,e.naturalWidth,e.naturalHeight,0,0,e.naturalWidth,e.naturalHeight),a.restore(),new Promise(g=>{o.toBlob(h=>{g(h);},"image/png");})}var yv=_.forwardRef(({className:e,variant:t,src:n,aspectRatio:r,onCropChange:o,onCropComplete:a,showZoom:s=true,showRotation:i=true,minZoom:l=1,maxZoom:c=3,circularCrop:d=false,initialCrop:u,...f},p)=>{let g=_.useRef(null),[h,v]=_.useState(),[b,w]=_.useState(),[x,R]=_.useState(1),[C,y]=_.useState(0),N=M=>{let{width:P,height:S}=M.currentTarget;if(r){let H=AN(P,S,r);v(H);}else v(u||{unit:"%",x:10,y:10,width:80,height:80});},T=M=>{v(M),o?.(M);},k=async M=>{if(w(M),a&&g.current&&M.width&&M.height){let P=await hv(g.current,M,C,x);a(P);}},E=()=>{y(M=>(M+90)%360);};return _.useEffect(()=>{b&&g.current&&a&&hv(g.current,b,C,x).then(M=>{a(M);});},[x,C,b,a]),jsxs("div",{ref:p,className:m(xv({variant:t,className:e})),...f,children:[jsx("div",{className:"flex-1 flex items-center justify-center p-4 bg-muted/30 min-h-[300px]",children:jsx(EN,{crop:h,onChange:T,onComplete:k,aspect:r,circularCrop:d,className:"max-h-[400px]",children:jsx("img",{ref:g,src:n,alt:"Crop preview",onLoad:N,style:{transform:`scale(${x}) rotate(${C}deg)`,maxHeight:"400px"}})})}),jsxs("div",{className:"flex items-center gap-4 p-3 border-t",children:[s&&jsxs("div",{className:"flex items-center gap-2 flex-1",children:[jsx(ZoomOut,{className:"h-4 w-4 text-muted-foreground"}),jsx(Ga,{value:[x],onValueChange:([M])=>R(M),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(ae,{variant:"bordered",size:"sm",isIconOnly:true,onClick:E,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});yv.displayName="ImageCropper";var $l=cva("inline-block",{variants:{variant:{default:"",bordered:"border rounded-lg p-2",card:"border rounded-lg p-4 bg-card shadow-sm"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),BN={sm:96,md:128,lg:192},wv=_.forwardRef(({className:e,variant:t,size:n,value:r,qrSize:o,fgColor:a="currentColor",bgColor:s="transparent",level:i="M",includeMargin:l=false,title:c,logo:d,logoSize:u=40,logoPadding:f=4,logoBackgroundColor:p="white",...g},h)=>{let v=o??BN[n??"md"];return r?jsx("div",{ref:h,className:m($l({variant:t,size:n,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(zN,{value:r,size:v,fgColor:a,bgColor:s,level:i,title:c,style:{padding:l?16:0}}),d&&jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded",style:{padding:f,backgroundColor:p},children:jsx("img",{src:d,alt:"Logo",style:{width:u,height:u,objectFit:"contain"}})})]})}):jsx("div",{ref:h,className:m($l({variant:t,size:n,className:e})),...g,children:jsx("div",{className:"flex items-center justify-center bg-muted text-muted-foreground text-xs rounded",style:{width:v,height:v},children:"No data"})})});wv.displayName="QRCode";var Cv=({children:e,defaultTheme:t="system",storageKey:n="reever-ui-theme",enableSystem:r=true,disableTransitionOnChange:o=false,attribute:a="class",forcedTheme:s,themes:i=["light","dark"]})=>jsx(ThemeProvider,{defaultTheme:t,storageKey:n,enableSystem:r,disableTransitionOnChange:o,attribute:a,forcedTheme:s,themes:i,children:e});Cv.displayName="ThemeProvider";var jN=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),Tv=_.forwardRef(({className:e,variant:t="ghost",size:n="md",mode:r="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=_.useState(false);_.useEffect(()=>{c(true);},[]);let d=()=>{let u=["light","dark","system"],p=(u.indexOf(a||"system")+1)%u.length;s(u[p]);};return l?r==="cycle"?jsxs(ae,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,onClick:d,children:[i==="dark"?jsx(Moon,{className:"h-4 w-4"}):jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]}):jsxs(Cn,{children:[jsx(Tn,{children:jsxs(ae,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,children:[jsx(Sun,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),jsx(Moon,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),jsxs(Mn,{align:"end",children:[jsxs($t,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs($t,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs($t,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(ae,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,disabled:true,children:[jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})});Tv.displayName="ThemeToggle";var Mv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Nv=cva("flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2.5 py-1.5 text-xs",md:"h-10 px-3 py-2 text-sm",lg:"h-12 px-4 py-3 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),kv=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Pv=_.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,startContent:u,endContent:f,id:p,...g},h)=>{let v=_.useId(),b=p||v,w=`${b}-description`,x=`${b}-error`,R=a&&r;return jsxs("div",{className:m(Mv({size:s}),e),children:[t&&jsxs("label",{htmlFor:b,className:m(kv({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[u&&jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:u}),jsx("input",{ref:h,id:b,"aria-invalid":a,"aria-describedby":R?x:n?w:void 0,"aria-required":o,className:m(Nv({size:s,isInvalid:a}),u&&"pl-10",f&&"pr-10",l),...g}),f&&jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:f})]}),n&&!R&&jsx("p",{id:w,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),R&&jsx("p",{id:x,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Pv.displayName="TextField";var Sv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),XN=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 text-center [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",{variants:{size:{sm:"h-8 px-8 py-1.5 text-xs",md:"h-10 px-10 py-2 text-sm",lg:"h-12 px-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit min-w-24"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),Ev=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",{variants:{size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),Lv=cva("",{variants:{size:{sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),qN=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Dv=_.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,min:u,max:f,step:p=1,value:g,defaultValue:h,onChange:v,showButtons:b=true,formatOptions:w,fullWidth:x=false,disabled:R,id:C,...y},N)=>{let T=_.useId(),k=C||T,E=`${k}-description`,M=`${k}-error`,[P,S]=_.useState(h),[H,D]=_.useState(false),L=g!==void 0?g:P,V=a&&r,A=_.useCallback(O=>{O!==void 0&&(u!==void 0&&O<u&&(O=u),f!==void 0&&O>f&&(O=f)),g===void 0&&S(O),v?.(O);},[g,u,f,v]),B=()=>{let O=(L??0)+p;A(O);},I=()=>{let O=(L??0)-p;A(O);},F=O=>{let W=O.target.value;if(W==="")A(void 0);else {let z=parseFloat(W);isNaN(z)||A(z);}},K=O=>{O.key==="ArrowUp"?(O.preventDefault(),B()):O.key==="ArrowDown"&&(O.preventDefault(),I());},Y=_.useMemo(()=>L===void 0?"":w?new Intl.NumberFormat(void 0,w).format(L):L.toString(),[L,w]),q=u!==void 0&&L!==void 0&&L<=u,$=f!==void 0&&L!==void 0&&L>=f;return jsxs("div",{className:m(Sv({size:s}),e),children:[t&&jsxs("label",{htmlFor:k,className:m(qN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[b&&jsx("button",{type:"button",onClick:I,disabled:R||q,className:m(Ev({size:s}),"left-1"),tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:m(Lv({size:s}))})}),jsx("input",{ref:N,id:k,type:"text",inputMode:"decimal",value:Y,onChange:F,onKeyDown:K,onFocus:()=>D(true),onBlur:()=>D(false),"aria-invalid":a,"aria-describedby":V?M:n?E:void 0,"aria-required":o,"aria-valuemin":u,"aria-valuemax":f,"aria-valuenow":L,disabled:R,className:m(XN({size:s,isInvalid:a,fullWidth:x}),!b&&"px-3",l),style:{borderColor:H?"var(--color-foreground)":void 0},...y}),b&&jsx("button",{type:"button",onClick:B,disabled:R||$,className:m(Ev({size:s}),"right-1"),tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:m(Lv({size:s}))})})]}),n&&!V&&jsx("p",{id:E,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),V&&jsx("p",{id:M,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Dv.displayName="NumberField";var Iv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),JN=cva("flex w-full rounded-md border border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 pl-8 pr-8 py-1.5 text-xs",md:"h-10 pl-10 pr-10 py-2 text-sm",lg:"h-12 pl-12 pr-12 py-3 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),Hv=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),ek=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),tk=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",{variants:{size:{sm:"h-5 w-5 right-1.5",md:"h-6 w-6 right-2",lg:"h-7 w-7 right-2.5"}},defaultVariants:{size:"md"}}),Vv=_.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f="",onChange:p,onClear:g,onSearch:h,showClearButton:v=true,showSearchIcon:b=true,disabled:w,placeholder:x="Search...",id:R,...C},y)=>{let N=_.useId(),T=R||N,k=`${T}-description`,E=`${T}-error`,[M,P]=_.useState(f),S=u!==void 0?u:M,H=a&&r,D=S.length>0,L=B=>{let I=B.target.value;u===void 0&&P(I),p?.(I);},V=()=>{u===void 0&&P(""),p?.(""),g?.();},A=B=>{B.key==="Enter"?(B.preventDefault(),h?.(S)):B.key==="Escape"&&D&&(B.preventDefault(),V());};return jsxs("div",{className:m(Iv({size:s}),e),children:[t&&jsxs("label",{htmlFor:T,className:m(ek({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[b&&jsx(Search,{className:m(Hv({size:s}),"absolute left-3 top-1/2 -translate-y-1/2")}),jsx("input",{ref:y,id:T,type:"search",value:S,onChange:L,onKeyDown:A,placeholder:x,"aria-invalid":a,"aria-describedby":H?E:n?k:void 0,"aria-required":o,disabled:w,className:m(JN({size:s,isInvalid:a}),!b&&"pl-3",!v&&"pr-3",l),...C}),v&&D&&!w&&jsx("button",{type:"button",onClick:V,className:m(tk({size:s})),tabIndex:-1,"aria-label":"Clear search",children:jsx(X,{className:m(Hv({size:s}))})})]}),n&&!H&&jsx("p",{id:k,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),H&&jsx("p",{id:E,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Vv.displayName="SearchField";var Av=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),rk=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"},showPickerIcon:{true:"",false:""}},compoundVariants:[{size:"sm",showPickerIcon:true,className:"pl-3 pr-8"},{size:"sm",showPickerIcon:false,className:"px-3"},{size:"md",showPickerIcon:true,className:"pl-3 pr-10"},{size:"md",showPickerIcon:false,className:"px-3"},{size:"lg",showPickerIcon:true,className:"pl-4 pr-12"},{size:"lg",showPickerIcon:false,className:"px-4"}],defaultVariants:{size:"md",isInvalid:false,fullWidth:false,showPickerIcon:true}}),ok=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),ak=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),$s={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},ql={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},Yl=(e,t)=>String(e).padStart(t,"0"),ua=(e,t)=>{if(!e)return "";let n=Yl(e.getDate(),2),r=Yl(e.getMonth()+1,2),o=Yl(e.getFullYear(),4),a=$s[t],s=ql[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Xl=(e,t)=>{let n=$s[t],r=e.split(n);if(r.length!==3)return null;let o=ql[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(r[l],10);}),isNaN(a.day)||isNaN(a.month)||isNaN(a.year)||a.month<1||a.month>12||a.day<1||a.day>31||a.year<1e3||a.year>9999)return null;let s=new Date(a.year,a.month-1,a.day);return s.getFullYear()!==a.year||s.getMonth()!==a.month-1||s.getDate()!==a.day?null:s},sk=e=>{let t=$s[e];return ql[e].map(r=>r==="year"?"####":"##").join(t)},Gs=_.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:v="dd.MM.yyyy",showPickerIcon:b=true,mode:w="text",fullWidth:x=false,disabled:R,placeholder:C,id:y,...N},T)=>{let k=_.useId(),E=y||k,M=`${E}-description`,P=`${E}-error`,[S,H]=_.useState(f??null),[D,L]=_.useState(""),[V,A]=_.useState(false),[B,I]=_.useState(false),F=u!==void 0?u:S,K=a&&r,Y=$s[v],q=sk(v);_.useEffect(()=>{B||L(ua(F,v));},[F,v,B]);let $=G=>{u===void 0&&H(G),p?.(G);},O=G=>{let Pe=G??null;$(Pe),L(ua(Pe,v)),A(false);},W=G=>{let Pe=G.target.value;Pe=Pe.replace(new RegExp(`[^0-9\\${Y}]`,"g"),"");let Z=Pe.replace(new RegExp(`\\${Y}`,"g"),""),le="",Be=0;for(let me=0;me<q.length&&Be<Z.length;me++)q[me]==="#"?(le+=Z[Be],Be++):le+=q[me];if(L(le),le.length===q.length){let me=Xl(le,v);if(me){if(g&&me<g||h&&me>h)return;$(me);}}},z=()=>{I(true);},j=()=>{I(false),D.length!==q.length?L(ua(F,v)):Xl(D,v)||L(ua(F,v));},oe=()=>{R||A(true);},ge=()=>{!R&&w==="picker"&&b&&A(true);};return jsxs("div",{className:m(Av({size:s}),e),children:[t&&jsxs("label",{htmlFor:E,className:m(ak({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(ot,{open:b&&V,onOpenChange:A,children:[jsxs(an,{className:m("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:T,id:E,type:"text",inputMode:w==="text"?"numeric":void 0,value:D,onChange:w==="text"?W:void 0,onClick:ge,onFocus:z,onBlur:j,readOnly:w==="picker","aria-invalid":a,"aria-describedby":K?P:n?M:void 0,"aria-required":o,disabled:R,placeholder:C||v.toLowerCase(),className:m(rk({size:s,isInvalid:a,fullWidth:x,showPickerIcon:b}),w==="picker"&&b&&"cursor-pointer",l),style:{borderColor:B||b&&V?"var(--color-foreground)":void 0},...N}),b&&jsx("button",{type:"button",onClick:oe,disabled:R,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:m(ok({size:s}))})})]}),b&&jsx(at,{className:"w-auto p-0",align:"start",children:jsx(no,{mode:"single",selected:F??void 0,onSelect:O,disabled:G=>!!(g&&G<g||h&&G>h),defaultMonth:F??void 0,showMonthAndYearPickers:true})})]}),n&&!K&&jsx("p",{id:M,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),K&&jsx("p",{id:P,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Gs.displayName="DatePicker";var ik=Gs,lk=Gs;var zv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),ck=cva("inline-flex items-center rounded-md border border-input bg-background transition-colors",{variants:{size:{sm:"h-8 px-2 gap-0.5 text-xs",md:"h-10 px-3 gap-1 text-sm",lg:"h-12 px-4 gap-1.5 text-base"},isInvalid:{true:"border-danger",false:""},disabled:{true:"cursor-not-allowed opacity-50",false:""},fullWidth:{true:"w-full justify-center",false:"w-fit"}},defaultVariants:{size:"md",isInvalid:false,disabled:false,fullWidth:false}}),dk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Ov=_.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f,onChange:p,minTime:g,maxTime:h,showSeconds:v=false,hourCycle:b=24,disabled:w,fullWidth:x=false,id:R,...C},y)=>{let N=_.useId(),T=R||N,k=`${T}-description`,E=`${T}-error`,M=_.useRef(null),P=_.useRef(null),S=_.useRef(null),H=_.useRef(null),[D,L]=_.useState(f??null),V=u!==void 0?u:D,A=a&&r,B=U=>b===24?U:U===0?12:U>12?U-12:U,I=U=>U>=12?"PM":"AM",F=(U,re)=>re==="AM"?U===12?0:U:U===12?12:U+12,[K,Y]=_.useState(V?String(B(V.hour)).padStart(2,"0"):""),[q,$]=_.useState(V?String(V.minute).padStart(2,"0"):""),[O,W]=_.useState(V?.second!==void 0?String(V.second).padStart(2,"0"):""),[z,j]=_.useState(V?I(V.hour):"AM"),[oe,ge]=_.useState(false);_.useEffect(()=>{u!==void 0&&(u?(Y(String(B(u.hour)).padStart(2,"0")),$(String(u.minute).padStart(2,"0")),u.second!==void 0&&W(String(u.second).padStart(2,"0")),j(I(u.hour))):(Y(""),$(""),W("")));},[u,b]);let G=(U,re,X,Se)=>{let de=parseInt(U,10),We=parseInt(re,10),je=v?parseInt(X,10):void 0;if(isNaN(de)||isNaN(We)||v&&isNaN(je)){u===void 0&&L(null),p?.(null);return}let ve={hour:b===12?F(de,Se):de,minute:We,...v&&je!==void 0&&{second:je}};u===void 0&&L(ve),p?.(ve);},Pe=U=>{let re=U.target.value.replace(/\D/g,"").slice(0,2);Y(re);let X=b===24?23:12,Se=b===24?0:1;if(re.length===2){let de=parseInt(re,10);de>=Se&&de<=X&&(P.current?.focus(),P.current?.select());}},Z=U=>{let re=U.target.value.replace(/\D/g,"").slice(0,2);if($(re),re.length===2){let X=parseInt(re,10);X>=0&&X<=59&&(v?(S.current?.focus(),S.current?.select()):b===12&&H.current?.focus());}},le=U=>{let re=U.target.value.replace(/\D/g,"").slice(0,2);W(re),re.length===2&&b===12&&H.current?.focus();},Be=()=>{if(K){let U=parseInt(K,10),re=b===24?23:12,Se=Math.min(Math.max(U,b===24?0:1),re),de=String(Se).padStart(2,"0");Y(de),G(de,q,O,z);}},me=()=>{if(q){let U=parseInt(q,10),re=Math.min(Math.max(U,0),59),X=String(re).padStart(2,"0");$(X),G(K,X,O,z);}},wt=()=>{if(O){let U=parseInt(O,10),re=Math.min(Math.max(U,0),59),X=String(re).padStart(2,"0");W(X),G(K,q,X,z);}},gt=()=>{let U=z==="AM"?"PM":"AM";j(U),G(K,q,O,U);},yn=U=>{let re=U.key.toLowerCase();re==="a"?(U.preventDefault(),z!=="AM"&&(j("AM"),G(K,q,O,"AM"))):re==="p"?(U.preventDefault(),z!=="PM"&&(j("PM"),G(K,q,O,"PM"))):re==="arrowup"||re==="arrowdown"?(U.preventDefault(),gt()):re==="arrowleft"&&(U.preventDefault(),v?(S.current?.focus(),S.current?.select()):(P.current?.focus(),P.current?.select()));},Fe=(U,re)=>{if(U.key==="ArrowUp"||U.key==="ArrowDown"){U.preventDefault();let X=U.key==="ArrowUp"?1:-1;if(re==="hour"){let Se=parseInt(K,10)||0,de=b===24?23:12,We=b===24?0:1,je=Se+X;je>de&&(je=We),je<We&&(je=de);let Gn=String(je).padStart(2,"0");Y(Gn),G(Gn,q,O,z);}else if(re==="minute"){let de=(parseInt(q,10)||0)+X;de>59&&(de=0),de<0&&(de=59);let We=String(de).padStart(2,"0");$(We),G(K,We,O,z);}else if(re==="second"){let de=(parseInt(O,10)||0)+X;de>59&&(de=0),de<0&&(de=59);let We=String(de).padStart(2,"0");W(We),G(K,q,We,z);}}U.key==="ArrowRight"&&(U.preventDefault(),re==="hour"?(P.current?.focus(),P.current?.select()):re==="minute"&&v?(S.current?.focus(),S.current?.select()):(re==="minute"&&!v&&b===12||re==="second"&&b===12)&&H.current?.focus()),U.key==="ArrowLeft"&&(U.preventDefault(),re==="minute"?(M.current?.focus(),M.current?.select()):re==="second"&&(P.current?.focus(),P.current?.select())),U.key==="Backspace"&&U.currentTarget.value===""&&(re==="minute"?M.current?.focus():re==="second"&&P.current?.focus());},Ct=m((()=>{switch(s){case "sm":return "w-5";case "lg":return "w-7";default:return "w-6"}})(),"bg-transparent text-center outline-none placeholder:text-muted-foreground tabular-nums",w&&"cursor-not-allowed");return jsxs("div",{ref:y,className:m(zv({size:s}),e),...C,children:[t&&jsxs("label",{htmlFor:T,className:m(dk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:m(ck({size:s,isInvalid:a,disabled:w,fullWidth:x}),l),style:{borderColor:oe?"var(--color-foreground)":void 0},onFocus:()=>ge(true),onBlur:U=>{U.currentTarget.contains(U.relatedTarget)||ge(false);},children:[jsx("input",{ref:M,id:T,type:"text",inputMode:"numeric",placeholder:b===24?"HH":"hh",value:K,onChange:Pe,onBlur:Be,onKeyDown:U=>Fe(U,"hour"),onFocus:U=>U.target.select(),"aria-label":"Hour","aria-invalid":a,"aria-describedby":A?E:n?k:void 0,"aria-required":o,disabled:w,className:Ct}),jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:P,type:"text",inputMode:"numeric",placeholder:"mm",value:q,onChange:Z,onBlur:me,onKeyDown:U=>Fe(U,"minute"),onFocus:U=>U.target.select(),"aria-label":"Minute",disabled:w,className:Ct}),v&&jsxs(Fragment,{children:[jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:S,type:"text",inputMode:"numeric",placeholder:"ss",value:O,onChange:le,onBlur:wt,onKeyDown:U=>Fe(U,"second"),onFocus:U=>U.target.select(),"aria-label":"Second",disabled:w,className:Ct})]}),b===12&&jsx("button",{ref:H,type:"button",onClick:gt,onKeyDown:yn,disabled:w,className:m("ml-0.5 rounded text-muted-foreground hover:text-foreground focus:outline-none focus:text-foreground transition-colors tabular-nums",s==="sm"?"w-6":s==="lg"?"w-8":"w-7",w&&"cursor-not-allowed"),"aria-label":"AM/PM",children:z})]}),n&&!A&&jsx("p",{id:k,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),A&&jsx("p",{id:E,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Ov.displayName="TimeField";var Fv=cva("inline-flex items-center",{variants:{variant:{default:"gap-1",compact:"gap-0.5",attached:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px gap-0"},orientation:{horizontal:"flex-row",vertical:"flex-col [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px [&>*:not(:first-child)]:ml-0"},size:{sm:"",md:"",lg:""},density:{compact:"gap-0.5",regular:"gap-1",spacious:"gap-2"}},defaultVariants:{variant:"default",orientation:"horizontal",size:"md",density:"regular"}}),Kv=_.forwardRef(({className:e,variant:t,orientation:n,size:r,density:o,items:a,maxVisibleItems:s,isDisabled:i,onAction:l,showLabels:c=false,renderItem:d,...u},f)=>{let p=s&&s<a.length?a.slice(0,s):a,g=s&&s<a.length?a.slice(s):[],h={sm:"h-8 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-4 text-base"}[r??"md"],v={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[r??"md"],b={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"}[r??"md"],w=(R,C)=>{C&&C(),l&&l(R);},x=R=>jsxs("button",{type:"button",disabled:i||R.isDisabled,onClick:()=>w(R.key,R.onPress),className:m("inline-flex items-center justify-center gap-2 rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",c?h:v),"aria-label":R.label,children:[R.icon&&jsx("span",{className:b,children:R.icon}),c&&jsx("span",{children:R.label})]},R.key);return jsxs("div",{ref:f,role:"group",className:m(Fv({variant:t,orientation:n,size:r,density:o,className:e})),...u,children:[p.map(R=>d?d(R):x(R)),g.length>0&&jsxs(Cn,{children:[jsx(Tn,{"aria-label":"More actions",className:m("items-center justify-center rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",i&&"pointer-events-none opacity-50",v),children:jsx(MoreHorizontal,{className:b})}),jsx(Mn,{align:"end",children:g.map(R=>jsxs($t,{disabled:R.isDisabled,onClick:()=>w(R.key,R.onPress),children:[R.icon&&jsx("span",{className:m(b,"mr-2"),children:R.icon}),R.label]},R.key))})]})]})});Kv.displayName="ActionGroup";var Wv=cva("inline-flex items-center gap-2",{variants:{variant:{neutral:"[--status-color:theme(colors.muted.foreground)]",info:"[--status-color:theme(colors.blue.500)]",positive:"[--status-color:theme(colors.green.500)]",notice:"[--status-color:theme(colors.yellow.500)]",negative:"[--status-color:theme(colors.red.500)]"},size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{variant:"neutral",size:"md"}}),fk=cva("rounded-full bg-[--status-color] flex-shrink-0",{variants:{size:{sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"},pulse:{true:"animate-pulse",false:""}},defaultVariants:{size:"md",pulse:false}}),jv=_.forwardRef(({className:e,variant:t,size:n,pulse:r=false,hideLabel:o=false,children:a,...s},i)=>jsxs("span",{ref:i,role:"status",className:m(Wv({variant:t,size:n,className:e})),...s,children:[jsx("span",{className:m(fk({size:n,pulse:r})),"aria-hidden":"true"}),!o&&a&&jsx("span",{className:"text-foreground",children:a})]}));jv.displayName="StatusLight";var Yv=cva("flex flex-col items-center justify-center text-center",{variants:{size:{sm:"gap-3 max-w-xs",md:"gap-4 max-w-sm",lg:"gap-5 max-w-md"}},defaultVariants:{size:"md"}}),bk=cva("text-muted-foreground",{variants:{size:{sm:"[&>svg]:h-16 [&>svg]:w-16",md:"[&>svg]:h-24 [&>svg]:w-24",lg:"[&>svg]:h-32 [&>svg]:w-32"}},defaultVariants:{size:"md"}}),vk=cva("font-semibold text-foreground",{variants:{size:{sm:"text-base",md:"text-lg",lg:"text-xl"}},defaultVariants:{size:"md"}}),hk=cva("text-muted-foreground",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Xv=_.forwardRef(({className:e,size:t,illustration:n,heading:r,description:o,children:a,...s},i)=>jsxs("div",{ref:i,className:m(Yv({size:t,className:e})),...s,children:[n&&jsx("div",{className:m(bk({size:t})),"aria-hidden":"true",children:n}),r&&jsx("h3",{className:m(vk({size:t})),children:r}),o&&jsx("p",{className:m(hk({size:t})),children:o}),a&&jsx("div",{className:"mt-2",children:a})]}));Xv.displayName="IllustratedMessage";var Qv=cva("relative flex gap-3 rounded-lg border p-4 text-sm",{variants:{variant:{info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100 [&>svg]:text-green-600 dark:[&>svg]:text-green-400",warning:"border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-400",error:"border-red-200 bg-red-50 text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100 [&>svg]:text-red-600 dark:[&>svg]:text-red-400",neutral:"border-border bg-muted text-foreground [&>svg]:text-muted-foreground"}},defaultVariants:{variant:"info"}}),Mk={info:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle,neutral:Info},Jv=_.forwardRef(({className:e,variant:t,title:n,icon:r,hideIcon:o=false,isDismissible:a=false,onDismiss:s,actions:i,children:l,...c},d)=>{let[u,f]=_.useState(true);if(!u)return null;let p=Mk[t??"info"],g=()=>{f(false),s?.();};return jsxs("div",{ref:d,role:"alert",className:m(Qv({variant:t,className:e})),...c,children:[!o&&jsx("div",{className:"flex-shrink-0",children:r||jsx(p,{className:"h-5 w-5"})}),jsxs("div",{className:"flex-1 space-y-1",children:[n&&jsx("div",{className:"font-medium",children:n}),l&&jsx("div",{className:"opacity-90",children:l}),i&&jsx("div",{className:"mt-3 flex gap-2",children:i})]}),a&&jsx("button",{type:"button",onClick:g,className:"absolute right-2 top-2 rounded-md p-1 opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Dismiss",children:jsx(X,{className:"h-4 w-4"})})]})});Jv.displayName="InlineAlert";var eh=cva("fixed flex items-center gap-2 rounded-lg border bg-background shadow-lg transition-all duration-200",{variants:{position:{bottom:"bottom-4 left-1/2 -translate-x-1/2",top:"top-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4"},size:{sm:"px-3 py-2 gap-1.5",md:"px-4 py-2.5 gap-2",lg:"px-5 py-3 gap-3"}},defaultVariants:{position:"bottom",size:"md"}}),th=_.forwardRef(({className:e,position:t,size:n,selectedCount:r=0,isOpen:o=true,onClose:a,showClose:s=true,selectedText:i,children:l,...c},d)=>{if(!o||r===0)return null;let u=()=>typeof i=="function"?i(r):i||`${r} item${r>1?"s":""} selected`;return jsxs("div",{ref:d,role:"toolbar","aria-label":"Actions for selected items",className:m(eh({position:t,size:n,className:e})),...c,children:[jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:u()}),jsx("div",{className:"h-4 w-px bg-border"}),jsx("div",{className:"flex items-center gap-1",children:l}),s&&jsxs(Fragment,{children:[jsx("div",{className:"h-4 w-px bg-border"}),jsx(Mt,{size:"sm",onClick:a,"aria-label":"Close action bar"})]})]})});th.displayName="ActionBar";var nh=_.forwardRef(({className:e,icon:t,children:n,...r},o)=>jsxs("button",{ref:o,type:"button",className:m("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",e),...r,children:[t&&jsx("span",{className:"h-4 w-4 [&>svg]:h-full [&>svg]:w-full",children:t}),n]}));nh.displayName="ActionBarButton";var ah=cva("flex flex-col",{variants:{variant:{default:"gap-1",bordered:"border rounded-lg divide-y",cards:"gap-2"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),sh=cva("flex items-center gap-3 transition-colors cursor-pointer",{variants:{variant:{default:"rounded-md hover:bg-accent",bordered:"hover:bg-accent",cards:"rounded-lg border hover:border-primary/50 hover:bg-accent/50"},size:{sm:"px-2 py-1.5 text-sm",md:"px-3 py-2",lg:"px-4 py-3 text-lg"},isSelected:{true:"bg-accent",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"cards",isSelected:true,className:"border-primary bg-accent"}],defaultVariants:{variant:"default",size:"md",isSelected:false,isDisabled:false}});function ih({className:e,variant:t,size:n,items:r,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,allowsDragging:i=false,onReorder:l,showCheckbox:c=false,renderItem:d,emptyContent:u,...f}){let[p,g]=_.useState(new Set),[h,v]=_.useState(null),[b,w]=_.useState(null),x=_.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),R=T=>{if(a==="none")return;let k;a==="single"?k=x.has(T)?new Set:new Set([T]):(k=new Set(x),k.has(T)?k.delete(T):k.add(T)),o||g(k),s?.(k);},C=(T,k)=>{v(k),T.dataTransfer.effectAllowed="move";},y=(T,k)=>{T.preventDefault(),h!==k&&w(k);},N=()=>{if(h&&b&&h!==b){let T=r.findIndex(P=>P.key===h),k=r.findIndex(P=>P.key===b),E=[...r],[M]=E.splice(T,1);E.splice(k,0,M),l?.(E);}v(null),w(null);};return r.length===0?jsx("div",{className:m("flex items-center justify-center p-8 text-muted-foreground",e),children:u||"No items"}):jsx("div",{role:"listbox","aria-multiselectable":a==="multiple",className:m(ah({variant:t,size:n,className:e})),...f,children:r.map(T=>{let k=x.has(T.key),E=h===T.key,M=b===T.key;return d?jsx("div",{role:"option","aria-selected":k,onClick:()=>R(T.key),children:d(T,k)},T.key):jsxs("div",{role:"option","aria-selected":k,"aria-disabled":T.isDisabled,draggable:i&&!T.isDisabled,onDragStart:P=>C(P,T.key),onDragOver:P=>y(P,T.key),onDragEnd:N,onClick:()=>!T.isDisabled&&R(T.key),className:m(sh({variant:t,size:n,isSelected:k,isDisabled:T.isDisabled}),E&&"opacity-50",M&&"border-t-2 border-t-primary"),children:[i&&jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground cursor-grab"}),c&&a!=="none"&&jsx("div",{className:m("flex h-4 w-4 items-center justify-center rounded border",k?"bg-primary border-primary text-primary-foreground":"border-input"),children:k&&jsx(Check,{className:"h-3 w-3"})}),T.icon&&jsx("span",{className:"h-5 w-5 text-muted-foreground [&>svg]:h-full [&>svg]:w-full",children:T.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"truncate",children:T.label}),T.description&&jsx("div",{className:"text-sm text-muted-foreground truncate",children:T.description})]})]},T.key)})})}ih.displayName="ListView";var lh=cva("relative flex w-full touch-none select-none",{variants:{orientation:{horizontal:"items-center",vertical:"flex-col justify-center h-full"},size:{sm:"",md:"",lg:""}},defaultVariants:{orientation:"horizontal",size:"md"}}),Lk=cva("relative grow overflow-hidden rounded-full bg-secondary",{variants:{orientation:{horizontal:"w-full",vertical:"w-2 h-full"},size:{sm:"h-1",md:"h-2",lg:"h-3"}},compoundVariants:[{orientation:"vertical",size:"sm",className:"w-1 h-full"},{orientation:"vertical",size:"md",className:"w-2 h-full"},{orientation:"vertical",size:"lg",className:"w-3 h-full"}],defaultVariants:{orientation:"horizontal",size:"md"}}),Sk=cva("block rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-grab",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{size:"md"}}),ch=_.forwardRef(({className:e,orientation:t="horizontal",size:n="md",value:r,defaultValue:o=[25,75],onValueChange:a,onValueCommit:s,min:i=0,max:l=100,step:c=1,disabled:d=false,showLabels:u=false,formatLabel:f=b=>String(b),trackColor:p="primary",name:g,...h},v)=>{let[b,w]=_.useState(o),x=r!==void 0,R=x?r:b,C=_.useRef(null),[y,N]=_.useState(false),[T,k]=_.useState(null),E=(I,F)=>{if(!C.current)return R[0];let K=C.current.getBoundingClientRect(),Y;t==="horizontal"?Y=(I-K.left)/K.width:Y=1-(F-K.top)/K.height,Y=Math.max(0,Math.min(1,Y));let q=i+Y*(l-i),$=Math.round(q/c)*c;return Math.max(i,Math.min(l,$))},M=(I,F)=>{let K=[...R];K[F]=I,F===0&&I>R[1]&&(K[0]=R[1]),F===1&&I<R[0]&&(K[1]=R[0]),x||w(K),a?.(K);},P=(I,F)=>{d||(I.preventDefault(),N(true),k(F),I.target.setPointerCapture(I.pointerId));},S=I=>{if(!y||T===null||d)return;let F=E(I.clientX,I.clientY);M(F,T);},H=()=>{y&&(N(false),k(null),s?.(R));},D=I=>{if(d)return;let F=E(I.clientX,I.clientY),K=Math.abs(R[0]-F),Y=Math.abs(R[1]-F),q=K<=Y?0:1;M(F,q);let $=[...R];$[q]=F,s?.($);},L=(I,F)=>{if(d)return;let K=R[F];switch(I.key){case "ArrowRight":case "ArrowUp":I.preventDefault(),K=Math.min(l,R[F]+c);break;case "ArrowLeft":case "ArrowDown":I.preventDefault(),K=Math.max(i,R[F]-c);break;case "Home":I.preventDefault(),K=i;break;case "End":I.preventDefault(),K=l;break;default:return}M(K,F);let Y=[...R];Y[F]=K,s?.(Y);},V=I=>(I-i)/(l-i)*100,A={primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"}[p],B={sm:14,md:20,lg:24}[n||"md"];return jsxs("div",{className:"relative w-full",children:[u&&jsxs("div",{className:"flex justify-between mb-2 text-sm text-muted-foreground",children:[jsx("span",{children:f(R[0])}),jsx("span",{children:f(R[1])})]}),jsxs("div",{ref:v,className:m(lh({orientation:t,size:n}),d&&"opacity-50 pointer-events-none",e),...h,children:[jsx("div",{ref:C,className:m(Lk({orientation:t,size:n})),onClick:D,children:jsx("div",{className:m("absolute rounded-full",A,{"h-full":t==="horizontal","w-full":t==="vertical"}),style:t==="horizontal"?{left:`${V(R[0])}%`,right:`${100-V(R[1])}%`,top:0,bottom:0}:{bottom:`${V(R[0])}%`,top:`${100-V(R[1])}%`,left:0,right:0}})}),R.map((I,F)=>jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":I,"aria-orientation":t||void 0,"aria-disabled":d,className:m(Sk({size:n}),y&&T===F&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${V(I)}% - ${B/2}px)`,top:"50%",transform:"translateY(-50%)"}:{position:"absolute",bottom:`calc(${V(I)}% - ${B/2}px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:K=>P(K,F),onPointerMove:S,onPointerUp:H,onPointerCancel:H,onKeyDown:K=>L(K,F)},F)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:R[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:R[1]})]})]})]})});ch.displayName="RangeSlider";var nc=cva("inline-flex items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{help:"text-muted-foreground hover:text-foreground",info:"text-blue-500 hover:text-blue-600",warning:"text-yellow-500 hover:text-yellow-600"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"help",size:"md"}}),Ak=cva("z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95",{variants:{size:{sm:"w-56 text-xs",md:"w-72 text-sm",lg:"w-80 text-base"}},defaultVariants:{size:"md"}}),zk={help:HelpCircle,info:Info,warning:AlertCircle},mh=_.forwardRef(({variant:e="help",size:t,title:n,children:r,trigger:o,side:a="top",align:s="center",open:i,onOpenChange:l,learnMoreUrl:c,learnMoreText:d="Learn more",triggerClassName:u,contentClassName:f},p)=>{let[g,h]=_.useState(false),[v,b]=_.useState(false),[w,x]=_.useState({top:0,left:0}),R=_.useRef(null),C=_.useRef(null),y=i!==void 0?i:g,N=_.useCallback(M=>{i===void 0&&h(M),l?.(M);},[i,l]);_.useEffect(()=>{b(true);},[]),_.useEffect(()=>{if(!y||!R.current)return;let M=()=>{let P=R.current.getBoundingClientRect(),S=C.current?.getBoundingClientRect(),H=S?.width||288,D=S?.height||100,L=8,V=0,A=0;switch(a){case "top":V=P.top-D-L,A=P.left+P.width/2-H/2;break;case "bottom":V=P.bottom+L,A=P.left+P.width/2-H/2;break;case "left":V=P.top+P.height/2-D/2,A=P.left-H-L;break;case "right":V=P.top+P.height/2-D/2,A=P.right+L;break}if(a==="top"||a==="bottom")switch(s){case "start":A=P.left;break;case "center":A=P.left+P.width/2-H/2;break;case "end":A=P.right-H;break}if(a==="left"||a==="right")switch(s){case "start":V=P.top;break;case "center":V=P.top+P.height/2-D/2;break;case "end":V=P.bottom-D;break}A=Math.max(8,Math.min(A,window.innerWidth-H-8)),V=Math.max(8,Math.min(V,window.innerHeight-D-8)),x({top:V,left:A});};return M(),requestAnimationFrame(M),window.addEventListener("resize",M),window.addEventListener("scroll",M,true),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,true);}},[y,a,s]),_.useEffect(()=>{if(!y)return;let M=P=>{C.current&&!C.current.contains(P.target)&&R.current&&!R.current.contains(P.target)&&N(false);};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[y,N]),_.useEffect(()=>{if(!y)return;let M=P=>{P.key==="Escape"&&N(false);};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[y,N]);let T=zk[e??"help"],k=()=>{N(!y);},E=()=>{switch(a){case "top":return "bottom center";case "bottom":return "top center";case "left":return "right center";case "right":return "left center";default:return "center center"}};return jsxs(Fragment,{children:[o?_.isValidElement(o)?_.cloneElement(o,{ref:R,onClick:M=>{o.props.onClick?.(M),k();}}):jsx("button",{ref:R,type:"button",onClick:k,className:m(nc({variant:e,size:t}),u),"aria-label":"Help",children:o}):jsx("button",{ref:M=>{R.current=M,typeof p=="function"?p(M):p&&(p.current=M);},type:"button",onClick:k,className:m(nc({variant:e,size:t}),u),"aria-label":"Help",children:jsx(T,{className:"h-full w-full"})}),v&&y&&Oa.createPortal(jsxs("div",{ref:C,className:m(Ak({size:t}),f),style:{position:"fixed",top:w.top,left:w.left,transformOrigin:E()},role:"tooltip",children:[n&&jsx("div",{className:"mb-2 font-semibold text-foreground",children:n}),jsx("div",{className:"text-muted-foreground",children:r}),c&&jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-block text-primary hover:underline",children:[d," \u2192"]}),jsx("div",{className:"absolute h-2 w-2 rotate-45 border bg-popover",style:{...a==="top"&&{bottom:-4,left:"50%",marginLeft:-4,borderTop:"none",borderLeft:"none"},...a==="bottom"&&{top:-4,left:"50%",marginLeft:-4,borderBottom:"none",borderRight:"none"},...a==="left"&&{right:-4,top:"50%",marginTop:-4,borderBottom:"none",borderLeft:"none"},...a==="right"&&{left:-4,top:"50%",marginTop:-4,borderTop:"none",borderRight:"none"}}})]}),document.body)]})});mh.displayName="ContextualHelp";var fh=cva("flex flex-wrap",{variants:{spacing:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{spacing:"md"}}),rc=cva("inline-flex items-center gap-1 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-background hover:bg-accent",soft:"bg-primary/10 text-primary",surface:"bg-muted text-muted-foreground"},size:{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},isSelected:{true:"",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"bordered",isSelected:true,className:"border-primary bg-primary/5"},{variant:"soft",isSelected:true,className:"bg-primary/20"},{variant:"surface",isSelected:true,className:"bg-muted/80 ring-2 ring-primary/20"}],defaultVariants:{variant:"soft",size:"md",isSelected:false,isDisabled:false}});function gh({className:e,spacing:t,variant:n,size:r,items:o,selectedKeys:a,selectionMode:s="none",onSelectionChange:i,allowsRemoving:l=false,onRemove:c,label:d,description:u,errorMessage:f,maxTags:p,...g}){let[h,v]=_.useState(new Set),b=_.useMemo(()=>a?a instanceof Set?a:new Set(a):h,[a,h]),w=y=>{if(s==="none")return;let N;s==="single"?N=b.has(y)?new Set:new Set([y]):(N=new Set(b),N.has(y)?N.delete(y):N.add(y)),a||v(N),i?.(N);},x=(y,N)=>{N.stopPropagation(),c?.(y);},R=p?o.slice(0,p):o,C=p?Math.max(0,o.length-p):0;return jsxs("div",{className:"flex flex-col gap-1.5",children:[d&&jsx("span",{className:"text-sm font-medium text-foreground",children:d}),u&&jsx("span",{className:"text-sm text-muted-foreground",children:u}),jsxs("div",{role:"group","aria-label":d,className:m(fh({spacing:t}),e),...g,children:[R.map(y=>{let N=b.has(y.key),T=s!=="none";return jsxs("span",{role:T?"button":void 0,tabIndex:T&&!y.isDisabled?0:void 0,"aria-pressed":T?N:void 0,onClick:()=>!y.isDisabled&&w(y.key),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&!y.isDisabled&&(k.preventDefault(),w(y.key));},style:y.color?{backgroundColor:y.color}:void 0,className:m(rc({variant:y.color?void 0:n,size:r,isSelected:N,isDisabled:y.isDisabled}),T&&!y.isDisabled&&"cursor-pointer hover:opacity-80",y.color&&"text-white"),children:[y.icon&&jsx("span",{className:"h-3.5 w-3.5 [&>svg]:h-full [&>svg]:w-full",children:y.icon}),y.label,l&&!y.isDisabled&&jsx("button",{type:"button",onClick:k=>x(y.key,k),className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${y.label}`,children:jsx(X,{className:"h-3 w-3"})})]},y.key)}),C>0&&jsxs("span",{className:m(rc({variant:"surface",size:r}),"cursor-default"),children:["+",C," more"]})]}),f&&jsx("span",{className:"text-sm text-danger",children:f})]})}gh.displayName="TagGroup";var hh=cva("grid",{variants:{columns:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",auto:"grid-cols-[repeat(auto-fill,minmax(150px,1fr))]"},gap:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{columns:"auto",gap:"md"}}),xh=cva("relative flex flex-col rounded-lg border transition-all cursor-pointer",{variants:{variant:{default:"hover:border-primary/50 hover:bg-accent/50",card:"bg-card shadow-sm hover:shadow-md hover:border-primary/50"},size:{sm:"p-2",md:"p-3",lg:"p-4"},isSelected:{true:"border-primary bg-accent ring-2 ring-primary/20",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},defaultVariants:{variant:"default",size:"md",isSelected:false,isDisabled:false}});function yh({className:e,columns:t,gap:n,items:r,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,showSelectionIndicator:i=true,itemVariant:l="default",itemSize:c="md",renderItem:d,emptyContent:u,...f}){let[p,g]=_.useState(new Set),h=_.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),v=b=>{if(a==="none")return;let w;a==="single"?w=h.has(b)?new Set:new Set([b]):(w=new Set(h),w.has(b)?w.delete(b):w.add(b)),o||g(w),s?.(w);};return r.length===0?jsx("div",{className:m("flex items-center justify-center p-8 text-muted-foreground",e),children:u||"No items"}):jsx("div",{role:"grid","aria-multiselectable":a==="multiple",className:m(hh({columns:t,gap:n,className:e})),...f,children:r.map(b=>{let w=h.has(b.key);return d?jsx("div",{role:"gridcell","aria-selected":w,onClick:()=>v(b.key),children:d(b,w)},b.key):jsxs("div",{role:"gridcell","aria-selected":w,"aria-disabled":b.isDisabled,onClick:()=>!b.isDisabled&&v(b.key),className:m(xh({variant:l,size:c,isSelected:w,isDisabled:b.isDisabled})),children:[i&&a!=="none"&&w&&jsx("div",{className:"absolute top-2 right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:jsx(Check,{className:"h-3 w-3"})}),b.thumbnail&&jsx("div",{className:"mb-2 aspect-square w-full overflow-hidden rounded-md bg-muted",children:b.thumbnail}),jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate font-medium",children:b.label}),b.description&&jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:b.description})]})]},b.key)})})}yh.displayName="GridList";var wh=cva("relative w-full",{variants:{size:{sm:"h-1.5",md:"h-2",lg:"h-3"}},defaultVariants:{size:"md"}}),Kk=cva("w-full h-full rounded-full overflow-hidden",{variants:{variant:{default:"bg-secondary",subtle:"bg-muted"}},defaultVariants:{variant:"default"}}),$k=cva("h-full transition-all duration-300 ease-out",{variants:{color:{primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500",auto:""},rounded:{true:"rounded-full",false:"rounded-l-full"}},defaultVariants:{color:"primary",rounded:true}}),ei=_.forwardRef(({className:e,size:t,value:n,min:r=0,max:o=100,optimum:a,low:s,high:i,label:l,showValueLabel:c=false,formatValue:d,color:u="primary",trackVariant:f="default",...p},g)=>{let h=Math.min(100,Math.max(0,(n-r)/(o-r)*100)),v=()=>{if(u!=="auto")return "";let w=(n-r)/(o-r),x=s!==void 0?(s-r)/(o-r):.25,R=i!==void 0?(i-r)/(o-r):.75;return (a!==void 0?(a-r)/(o-r):1)>=.5?w<=x?"bg-red-500":w<=R?"bg-yellow-500":"bg-green-500":w>=R?"bg-red-500":w>=x?"bg-yellow-500":"bg-green-500"},b=d?d(n,h):`${Math.round(h)}%`;return jsxs("div",{ref:g,className:m("w-full",e),...p,children:[(l||c)&&jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l&&jsx("span",{className:"text-sm font-medium text-foreground",children:l}),c&&jsx("span",{className:"text-sm text-muted-foreground",children:b})]}),jsx("div",{role:"meter","aria-valuenow":n,"aria-valuemin":r,"aria-valuemax":o,"aria-label":l,className:m(wh({size:t})),children:jsx("div",{className:m(Kk({variant:f})),children:jsx("div",{className:m($k({color:u==="auto"?void 0:u,rounded:h>=100}),u==="auto"&&v()),style:{width:`${h}%`}})})})]})});ei.displayName="Meter";var Ch=_.forwardRef((e,t)=>jsx(ei,{ref:t,color:"auto",low:50,high:80,optimum:0,...e}));Ch.displayName="DiskUsageMeter";var Th=_.forwardRef((e,t)=>jsx(ei,{ref:t,color:"auto",low:20,high:50,optimum:100,...e}));Th.displayName="BatteryMeter";var Mh=cva("relative rounded-lg overflow-hidden cursor-crosshair touch-none select-none",{variants:{size:{sm:"h-32 w-32",md:"h-48 w-48",lg:"h-64 w-64",full:"h-full w-full min-h-48"}},defaultVariants:{size:"md"}}),ni=(e,t,n)=>{let r=o=>{let a=(o+e/60)%6;return n-n*t*Math.max(Math.min(a,4-a,1),0)};return [Math.round(r(5)*255),Math.round(r(3)*255),Math.round(r(1)*255)]},Nh=(e,t,n)=>{e/=255,t/=255,n/=255;let r=Math.max(e,t,n),o=Math.min(e,t,n),a=r-o,s=0,i=r===0?0:a/r,l=r;if(a!==0)switch(r){case e:s=((t-n)/a+(t<n?6:0))*60;break;case t:s=((n-e)/a+2)*60;break;case n:s=((e-t)/a+4)*60;break}return [s,i,l]},kh=e=>{let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null},Ph=(e,t,n)=>"#"+[e,t,n].map(r=>r.toString(16).padStart(2,"0")).join(""),Eh=_.forwardRef(({hue:e,saturation:t,brightness:n,value:r,defaultValue:o="#ff0000",onChange:a,onColorChange:s,size:i,disabled:l,thumbSize:c=18,className:d,...u},f)=>{let p=_.useRef(null),[g,h]=_.useState(false),v=_.useCallback(I=>{let F=kh(I);return F?Nh(...F):[0,1,1]},[]),[b,w]=_.useState(()=>v(r||o)),x=e??b[0],R=t??b[1],C=n??b[2];_.useEffect(()=>{if(r){let I=v(r);w(I);}},[r,v]);let y=_.useCallback((I,F)=>{if(l||!p.current)return;let K=p.current.getBoundingClientRect(),Y=Math.max(0,Math.min(1,(I-K.left)/K.width)),q=Math.max(0,Math.min(1,(F-K.top)/K.height)),$=Y,O=1-q;t===void 0&&n===void 0&&w([x,$,O]),a?.({hue:x,saturation:$,brightness:O});let W=ni(x,$,O);s?.(Ph(...W));},[l,x,t,n,a,s]),N=I=>{l||(I.preventDefault(),h(true),I.target.setPointerCapture(I.pointerId),y(I.clientX,I.clientY));},T=I=>{g&&y(I.clientX,I.clientY);},k=I=>{h(false),I.target.releasePointerCapture(I.pointerId);},[E,M,P]=ni(x,1,1),S=`rgb(${E}, ${M}, ${P})`,H=R*100,D=(1-C)*100,[L,V,A]=ni(x,R,C),B=`rgb(${L}, ${V}, ${A})`;return jsx("div",{ref:f,className:m(Mh({size:i}),l&&"cursor-not-allowed opacity-50",d),...u,children:jsxs("div",{ref:p,className:"absolute inset-0",style:{backgroundColor:S},onPointerDown:N,onPointerMove:T,onPointerUp:k,onPointerLeave:k,children:[jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to right, white, transparent)"}}),jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, transparent, black)"}}),jsx("div",{className:"absolute rounded-full border-2 border-white pointer-events-none",style:{width:c,height:c,left:`calc(${H}% - ${c/2}px)`,top:`calc(${D}% - ${c/2}px)`,backgroundColor:B,boxShadow:"0 0 0 1px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Eh.displayName="ColorArea";var Sh=cva("relative rounded-full cursor-pointer touch-none select-none",{variants:{orientation:{horizontal:"w-full",vertical:"h-full"},size:{sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",size:"sm",className:"h-3"},{orientation:"horizontal",size:"md",className:"h-4"},{orientation:"horizontal",size:"lg",className:"h-5"},{orientation:"vertical",size:"sm",className:"w-3"},{orientation:"vertical",size:"md",className:"w-4"},{orientation:"vertical",size:"lg",className:"w-5"}],defaultVariants:{orientation:"horizontal",size:"md"}}),jk=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cg fill='%23ccc'%3E%3Crect width='4' height='4'/%3E%3Crect x='4' y='4' width='4' height='4'/%3E%3C/g%3E%3C/svg%3E")`,Lh="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",Dh=_.forwardRef(({value:e,defaultValue:t,onChange:n,channel:r="hue",baseColor:o="#ff0000",orientation:a,size:s,disabled:i,thumbSize:l=18,showBorder:c=true,className:d,...u},f)=>{let p=_.useRef(null),[g,h]=_.useState(false),v=()=>{switch(r){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[b,w]=_.useState(t??v()),x=e??b,R=r==="hue"?x/360:x,C=_.useCallback((S,H)=>{if(i||!p.current)return;let D=p.current.getBoundingClientRect(),L=a!=="vertical",V;L?V=Math.max(0,Math.min(1,(S-D.left)/D.width)):V=Math.max(0,Math.min(1,1-(H-D.top)/D.height));let A=r==="hue"?V*360:V;e===void 0&&w(A),n?.(A);},[i,a,r,e,n]),y=S=>{i||(S.preventDefault(),h(true),S.target.setPointerCapture(S.pointerId),C(S.clientX,S.clientY));},N=S=>{g&&C(S.clientX,S.clientY);},T=S=>{h(false),S.target.releasePointerCapture(S.pointerId);},k=()=>{let S=a!=="vertical",H=S?"to right":"to top";switch(r){case "hue":return S?Lh:"linear-gradient(to top, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)";case "alpha":return `linear-gradient(${H}, transparent, ${o})`;case "saturation":return `linear-gradient(${H}, #808080, ${o})`;case "brightness":return `linear-gradient(${H}, #000000, ${o})`;default:return Lh}},E=()=>r==="hue"?`hsl(${x}, 100%, 50%)`:o,M=a!=="vertical",P=R*100;return jsx("div",{ref:f,className:m(Sh({orientation:a,size:s}),i&&"cursor-not-allowed opacity-50",d),...u,children:jsxs("div",{ref:p,className:m("absolute inset-0 rounded-full overflow-hidden",c&&"border border-input"),style:{backgroundImage:r==="alpha"?jk:void 0,backgroundSize:r==="alpha"?"8px 8px":void 0},onPointerDown:y,onPointerMove:N,onPointerUp:T,onPointerLeave:T,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:k()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...M?{left:`calc(${P}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${P}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:E(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Dh.displayName="ColorSlider";var Hh=cva("relative cursor-crosshair touch-none select-none",{variants:{size:{sm:"h-32 w-32",md:"h-48 w-48",lg:"h-64 w-64"}},defaultVariants:{size:"md"}}),Xk=(e,t,n)=>{let r=e-n,o=t-n,a=Math.atan2(o,r)*180/Math.PI+90;return a<0&&(a+=360),a},Ih=_.forwardRef(({value:e,defaultValue:t=0,onChange:n,size:r,disabled:o,innerRadius:a=.6,thumbSize:s=20,showCenter:i=true,className:l,...c},d)=>{let u=_.useRef(null),[f,p]=_.useState(false),[g,h]=_.useState(t),v=e??g,b=_.useCallback((y,N)=>{if(o||!u.current)return;let T=u.current.getBoundingClientRect(),k=T.width/2,E=y-T.left,M=N-T.top,P=Xk(E,M,k);e===void 0&&h(P),n?.(P);},[o,e,n]),w=y=>{o||(y.preventDefault(),p(true),y.target.setPointerCapture(y.pointerId),b(y.clientX,y.clientY));},x=y=>{f&&b(y.clientX,y.clientY);},R=y=>{p(false),y.target.releasePointerCapture(y.pointerId);},C=()=>{let y=[];for(let N=0;N<=360;N+=30)y.push(`hsl(${N}, 100%, 50%) ${N}deg`);return `conic-gradient(from 270deg, ${y.join(", ")})`};return jsx("div",{ref:d,className:m(Hh({size:r}),o&&"cursor-not-allowed opacity-50",l),...c,children:jsxs("div",{ref:u,className:"absolute inset-0 rounded-full",style:{background:C()},onPointerDown:w,onPointerMove:x,onPointerUp:R,onPointerLeave:R,children:[a<1&&jsx("div",{className:"absolute bg-background rounded-full",style:{top:`${(1-a)*50}%`,left:`${(1-a)*50}%`,width:`${a*100}%`,height:`${a*100}%`}}),i&&a<1&&jsx("div",{className:"absolute rounded-full border-2 border-input bg-background",style:{width:8,height:8,top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}),jsx(qk,{hue:v,innerRadius:a,thumbSize:s})]})})});Ih.displayName="ColorWheel";var qk=({hue:e,innerRadius:t,thumbSize:n})=>{let r=(1-(1-t)/2)*50,o=(e-90)*Math.PI/180,a=50+r*Math.cos(o),s=50+r*Math.sin(o);return jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:n,height:n,left:`calc(${a}% - ${n/2}px)`,top:`calc(${s}% - ${n/2}px)`,backgroundColor:`hsl(${e}, 100%, 50%)`,boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})};var Ah=cva("flex",{variants:{orientation:{horizontal:"flex-row items-center gap-2",vertical:"flex-col gap-1"},size:{sm:"",md:"",lg:""},align:{start:"items-start",center:"items-center",end:"items-end"}},compoundVariants:[{orientation:"horizontal",align:"start",className:"items-start"},{orientation:"horizontal",align:"center",className:"items-center"},{orientation:"horizontal",align:"end",className:"items-end"}],defaultVariants:{orientation:"vertical",size:"md",align:"start"}}),Qk=cva("text-muted-foreground font-medium",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Jk=cva("text-foreground",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},mono:{true:"font-mono",false:""}},defaultVariants:{size:"md",weight:"normal",mono:false}}),zh=_.forwardRef(({className:e,orientation:t,size:n,align:r,label:o,value:a,valueWeight:s,mono:i,labelWidth:l,labelClassName:c,valueClassName:d,showColon:u=false,copyable:f=false,onCopy:p,...g},h)=>{let v=async()=>{if(!(!f||a===null||a===void 0))try{let b=typeof a=="string"?a:String(a);await navigator.clipboard.writeText(b),p?.();}catch{}};return jsxs("div",{ref:h,className:m(Ah({orientation:t,size:n,align:r,className:e})),...g,children:[jsxs("span",{className:m(Qk({size:n}),c),style:l?{width:l,flexShrink:0}:void 0,children:[o,u&&":"]}),jsx("span",{className:m(Jk({size:n,weight:s,mono:i}),f&&"cursor-pointer hover:bg-accent/50 rounded px-1 -mx-1 transition-colors",d),onClick:f?v:void 0,role:f?"button":void 0,tabIndex:f?0:void 0,onKeyDown:f?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),v());}:void 0,children:a})]})});zh.displayName="LabeledValue";var Oh=cva("",{variants:{orientation:{horizontal:"flex flex-row flex-wrap",vertical:"flex flex-col"},gap:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{orientation:"vertical",gap:"md"}}),Bh=_.forwardRef(({className:e,orientation:t,gap:n,...r},o)=>jsx("div",{ref:o,className:m(Oh({orientation:t,gap:n,className:e})),...r}));Bh.displayName="LabeledValueGroup";var Gh=cva("flex items-center rounded-md border border-input bg-background ring-offset-background transition-colors focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",{variants:{size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base"},variant:{default:"",filled:"bg-muted border-transparent",ghost:"border-transparent hover:bg-muted"}},defaultVariants:{size:"md",variant:"default"}}),Co=cva("text-muted-foreground shrink-0",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Uh=_.forwardRef(({value:e,defaultValue:t="",onChange:n,onSearch:r,onSelect:o,suggestions:a=[],recentSearches:s=[],onClearRecentSearches:i,trendingSearches:l=[],isLoading:c,showClear:d=true,showIcon:u=true,popoverWidth:f="trigger",emptyMessage:p="No results found",size:g,variant:h,className:v,placeholder:b="Search...",disabled:w,...x},R)=>{let[C,y]=_.useState(false),[N,T]=_.useState(t),k=e!==void 0?e:N,E=_.useRef(null);_.useImperativeHandle(R,()=>E.current);let M=k.length>0,P=C&&(a.length>0||s.length>0||l.length>0||M),S=I=>{e===void 0&&T(I),n?.(I);},H=()=>{S(""),E.current?.focus();},D=I=>{I?.preventDefault(),k.trim()&&(r?.(k.trim()),y(false));},L=I=>{S(I.label),o?.(I),y(false);},V=I=>{S(I),r?.(I),y(false);},A=I=>{S(I),r?.(I),y(false);},B=_.useMemo(()=>{let I={};return a.forEach(F=>{let K=F.category||"Results";I[K]||(I[K]=[]),I[K].push(F);}),I},[a]);return jsxs(ot,{open:P,onOpenChange:y,children:[jsx(an,{children:jsxs("form",{onSubmit:D,className:m(Gh({size:g,variant:h}),v),children:[u&&jsx(Search,{className:m(Co({size:g}),"ml-3")}),jsx("input",{ref:E,type:"text",value:k,onChange:I=>S(I.target.value),onFocus:()=>y(true),placeholder:b,disabled:w,className:m("flex-1 bg-transparent px-3 py-2 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",!u&&"pl-3"),...x}),d&&M&&!w&&jsx("button",{type:"button",onClick:H,className:m("mr-2 rounded-sm p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",Co({size:g})),children:jsx(X,{className:"h-full w-full"})})]})}),jsx(at,{className:"p-0",style:{width:f==="trigger"?"var(--radix-popover-trigger-width)":f},align:"start",onOpenAutoFocus:I=>I.preventDefault(),children:jsxs(Command,{className:"rounded-lg border-0",children:[s.length>0&&!M&&jsxs("div",{className:"p-2",children:[jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recent"}),i&&jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),s.map((I,F)=>jsxs("button",{type:"button",onClick:()=>V(I),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(Clock,{className:m(Co({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:I}),jsx(ArrowRight,{className:m(Co({size:g}),"opacity-0 group-hover:opacity-100")})]},F))]}),l.length>0&&!M&&jsxs("div",{className:"border-t p-2",children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Trending"})}),l.map((I,F)=>jsxs("button",{type:"button",onClick:()=>A(I),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(TrendingUp,{className:m(Co({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:I})]},F))]}),M&&jsx("div",{className:"p-2",children:c?jsx("div",{className:"flex items-center justify-center py-6",children:jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):a.length>0?Object.entries(B).map(([I,F])=>jsxs("div",{children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:I})}),F.map(K=>jsxs("button",{type:"button",onClick:()=>L(K),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[K.icon||jsx(Search,{className:m(Co({size:g}))}),jsxs("div",{className:"flex-1 text-left",children:[jsx("div",{className:"truncate",children:K.label}),K.description&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:K.description})]})]},K.id))]},I)):jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:p})})]})})]})});Uh.displayName="SearchBar";var Wh={Pages:jsx(File,{className:"h-4 w-4"}),Files:jsx(Folder,{className:"h-4 w-4"}),Settings:jsx(Settings,{className:"h-4 w-4"}),Users:jsx(User,{className:"h-4 w-4"}),Tags:jsx(Hash,{className:"h-4 w-4"})},Yh=_.forwardRef(({open:e,onOpenChange:t,items:n=[],recentItems:r=[],placeholder:o="Search...",isLoading:a,emptyMessage:s="No results found.",filter:i,shortcut:l="\u2318K",onSelect:c,footer:d},u)=>{let[f,p]=_.useState(""),g=_.useRef(null),[h,v]=_.useState(false);_.useEffect(()=>{v(true);},[]),_.useEffect(()=>{e||p("");},[e]),_.useEffect(()=>{if(!e)return;let y=N=>{N.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,t]),_.useEffect(()=>{if(e)return Gt(),()=>Ut()},[e]);let b=_.useMemo(()=>{let y={};return n.forEach(N=>{let T=N.category||"Results";y[T]||(y[T]=[]),y[T].push(N);}),y},[n]),w=y=>{y.onSelect?.(),c?.(y),t?.(false);},x=()=>{t?.(false);},R=f.length>0,C=!R&&r.length>0;return !h||!e?null:Oa.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":e?"open":"closed",onClick:x}),jsx("div",{ref:u,className:"fixed left-1/2 top-[20%] z-50 w-full max-w-2xl -translate-x-1/2 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2","data-state":e?"open":"closed",children:jsxs(Command,{className:"overflow-hidden rounded-xl border bg-background shadow-2xl",filter:i,shouldFilter:!i,children:[jsxs("div",{className:"flex items-center border-b px-4",children:[jsx(Search,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),jsx(Command.Input,{ref:g,value:f,onValueChange:p,placeholder:o,className:"flex h-14 w-full bg-transparent px-4 py-4 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"}),f&&jsx("button",{type:"button",onClick:()=>p(""),className:"rounded-sm p-1 text-muted-foreground hover:text-foreground",children:jsx(X,{className:"h-4 w-4"})})]}),jsx(Command.List,{className:"max-h-[400px] overflow-y-auto p-2",children:a?jsx("div",{className:"flex items-center justify-center py-10",children:jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):jsxs(Fragment,{children:[C&&jsxs(Command.Group,{heading:"Recent",children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Recent"}),r.map(y=>jsxs(Command.Item,{value:y.label,onSelect:()=>w(y),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:y.icon||Wh[y.category||""]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:y.label}),y.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:y.description})]}),y.shortcut&&jsx("div",{className:"flex items-center gap-1",children:y.shortcut.map((N,T)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:N},T))})]},y.id))]}),R&&Object.entries(b).map(([y,N])=>jsxs(Command.Group,{heading:y,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:y}),N.map(T=>jsxs(Command.Item,{value:`${T.label} ${T.keywords?.join(" ")||""}`,onSelect:()=>w(T),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:T.icon||Wh[y]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:T.label}),T.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:T.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},T.id))]},y)),jsx(Command.Empty,{className:"py-10 text-center text-sm text-muted-foreground",children:s})]})}),d?jsx("div",{className:"border-t px-4 py-3",children:d}):jsxs("div",{className:"flex items-center justify-between border-t px-4 py-3 text-xs text-muted-foreground",children:[jsxs("div",{className:"flex items-center gap-4",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u2191\u2193"}),"Navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u21B5"}),"Select"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"Esc"}),"Close"]})]}),jsxs("span",{className:"flex items-center gap-1",children:["Press ",jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:l})," to open"]})]})]})})]}),document.body)});Yh.displayName="SpotlightSearch";function mP(e="k"){let[t,n]=_.useState(false);return _.useEffect(()=>{let r=o=>{(o.metaKey||o.ctrlKey)&&o.key===e&&(o.preventDefault(),n(a=>!a));};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e]),{open:t,setOpen:n,toggle:()=>n(r=>!r)}}var Zh=_.createContext(null),oi=()=>{let e=_.useContext(Zh);if(!e)throw new Error("useNotificationCenter must be used within a NotificationCenterProvider");return e},yP=({children:e,notifications:t,onNotificationsChange:n})=>{let[r,o]=_.useState([]),[a,s]=_.useState(false),i=_.useRef(null),l=t!==void 0,c=l?t:r,d=_.useCallback(v=>{l?n?.(v):o(v);},[l,n]),u=c.filter(v=>!v.read).length,f=_.useCallback(v=>{d(c.map(b=>b.id===v?{...b,read:true}:b));},[c,d]),p=_.useCallback(()=>{d(c.map(v=>({...v,read:true})));},[c,d]),g=_.useCallback(v=>{d(c.filter(b=>b.id!==v));},[c,d]),h=_.useCallback(()=>{d([]);},[d]);return jsx(Zh.Provider,{value:{notifications:c,unreadCount:u,markAsRead:f,markAllAsRead:p,removeNotification:g,clearAll:h,open:a,setOpen:s,triggerRef:i},children:e})},Qh=_.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:m("relative inline-block",e),...n,children:t}));Qh.displayName="NotificationCenter";var Jh=_.forwardRef(({className:e,showBadge:t=true,children:n,onClick:r,...o},a)=>{let{unreadCount:s,open:i,setOpen:l,triggerRef:c}=oi(),d=f=>{r?.(f),l(!i);},u=s>99?"99+":String(s);return jsxs("button",{ref:f=>{c.current=f,typeof a=="function"?a(f):a&&(a.current=f);},type:"button",onClick:d,"aria-label":"Notifications"+(s>0?", "+s+" unread":""),className:m("relative inline-flex items-center justify-center rounded-md p-2 text-muted-foreground hover:bg-accent hover:text-accent-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",e),...o,children:[n||jsx(Bell,{className:"h-5 w-5"}),t&&s>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1 text-xs font-medium text-danger-foreground",children:u})]})});Jh.displayName="NotificationCenterTrigger";var ex=_.forwardRef(({className:e,align:t="end",sideOffset:n=8,emptyMessage:r="No notifications",children:o,...a},s)=>{let{open:i,setOpen:l,notifications:c,markAllAsRead:d,clearAll:u,triggerRef:f}=oi(),[p,g]=_.useState(false),h=_.useRef(null),[v,b]=_.useState({top:0,left:0});return _.useEffect(()=>{g(true);},[]),_.useEffect(()=>{if(!i||!f.current||!h.current)return;let w=()=>{if(!f.current||!h.current)return;let x=f.current.getBoundingClientRect(),R=h.current.getBoundingClientRect(),C=x.bottom+n,y=x.left;t==="center"?y=x.left+x.width/2-R.width/2:t==="end"&&(y=x.right-R.width),y+R.width>window.innerWidth-16&&(y=window.innerWidth-R.width-16),y<16&&(y=16),b({top:C,left:y});};return w(),window.addEventListener("resize",w),window.addEventListener("scroll",w,true),()=>{window.removeEventListener("resize",w),window.removeEventListener("scroll",w,true);}},[i,f,t,n]),_.useEffect(()=>{if(!i)return;let w=R=>{h.current&&!h.current.contains(R.target)&&f.current&&!f.current.contains(R.target)&&l(false);},x=R=>{R.key==="Escape"&&l(false);};return document.addEventListener("mousedown",w),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",w),document.removeEventListener("keydown",x);}},[i,l,f]),!p||!i?null:Oa.createPortal(jsxs("div",{ref:w=>{h.current=w,typeof s=="function"?s(w):s&&(s.current=w);},className:m("fixed z-50 w-80 sm:w-96 max-h-[70vh] overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",e),style:{top:v.top,left:v.left},...a,children:[jsxs("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[jsx("h3",{className:"font-semibold",children:"Notifications"}),jsxs("div",{className:"flex items-center gap-2",children:[c.length>0&&jsxs(Fragment,{children:[jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground hover:text-foreground",children:"Mark all read"}),jsx("button",{type:"button",onClick:u,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear all"})]}),jsx("button",{type:"button",onClick:()=>l(false),className:"rounded-md p-1 hover:bg-accent",children:jsx(X,{className:"h-4 w-4"})})]})]}),jsx("div",{className:"max-h-[calc(70vh-60px)] overflow-y-auto",children:o||(c.length===0?jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[jsx(Bell,{className:"h-10 w-10 mb-2 opacity-50"}),jsx("p",{className:"text-sm",children:r})]}):c.map(w=>jsx(lc,{notification:w},w.id)))})]}),document.body)});ex.displayName="NotificationCenterContent";var RP={info:"border-l-blue-500",success:"border-l-green-500",warning:"border-l-yellow-500",error:"border-l-red-500"},wP={info:Info,success:CheckCircle,warning:AlertTriangle,error:AlertCircle},lc=({notification:e,onMarkAsRead:t,onRemove:n})=>{let{markAsRead:r,removeNotification:o}=oi(),{id:a,title:s,description:i,type:l="info",timestamp:c,read:d,avatar:u,action:f}=e,p=wP[l],g=()=>{t?t():r(a);},h=()=>{n?n():o(a);},v=b=>{if(!b)return null;let w=typeof b=="string"?new Date(b):b,R=new Date().getTime()-w.getTime(),C=Math.floor(R/6e4),y=Math.floor(R/36e5),N=Math.floor(R/864e5);return C<1?"Just now":C<60?C+"m ago":y<24?y+"h ago":N<7?N+"d ago":w.toLocaleDateString()};return jsxs("div",{className:m("group relative flex gap-3 border-b border-l-4 px-4 py-3 transition-colors hover:bg-accent/50",RP[l],!d&&"bg-accent/20"),children:[jsx("div",{className:"flex-shrink-0",children:u||jsx("div",{className:m("flex h-8 w-8 items-center justify-center rounded-full",l==="info"&&"bg-blue-100 text-blue-600 dark:bg-blue-900 dark:text-blue-400",l==="success"&&"bg-green-100 text-green-600 dark:bg-green-900 dark:text-green-400",l==="warning"&&"bg-yellow-100 text-yellow-600 dark:bg-yellow-900 dark:text-yellow-400",l==="error"&&"bg-red-100 text-red-600 dark:bg-red-900 dark:text-red-400"),children:jsx(p,{className:"h-4 w-4"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsx("p",{className:m("text-sm font-medium",!d&&"font-semibold"),children:s}),!d&&jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full bg-primary"})]}),i&&jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-2",children:i}),jsxs("div",{className:"mt-2 flex items-center gap-3",children:[c&&jsx("span",{className:"text-xs text-muted-foreground",children:v(c)}),f&&jsx("button",{type:"button",onClick:f.onClick,className:"text-xs font-medium text-primary hover:underline",children:f.label})]})]}),jsx("div",{className:"flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:jsxs("div",{className:"flex gap-1",children:[!d&&jsx("button",{type:"button",onClick:g,className:"rounded-md p-1 hover:bg-accent",title:"Mark as read",children:jsx(Check,{className:"h-4 w-4"})}),jsx("button",{type:"button",onClick:h,className:"rounded-md p-1 hover:bg-accent text-danger",title:"Remove",children:jsx(Trash2,{className:"h-4 w-4"})})]})})]})};lc.displayName="NotificationItem";var tx=_.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:m("divide-y",e),...n,children:t}));tx.displayName="NotificationList";var nx=cva("relative flex items-center justify-center gap-3 px-4 py-2.5 text-sm",{variants:{variant:{solid:"",flat:""},type:{default:"",success:"",warning:"",error:""},position:{top:"fixed top-0 left-0 right-0 z-50",relative:"relative"}},compoundVariants:[{variant:"solid",type:"default",className:"bg-primary text-primary-foreground [&>svg]:text-primary-foreground"},{variant:"flat",type:"default",className:"bg-primary/10 text-primary [&>svg]:text-primary"},{variant:"solid",type:"success",className:"bg-green-600 text-white dark:bg-green-500 [&>svg]:text-white"},{variant:"flat",type:"success",className:"bg-green-600/10 text-green-600 dark:bg-green-500/10 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"solid",type:"warning",className:"bg-amber-600 text-white dark:bg-amber-500 [&>svg]:text-white"},{variant:"flat",type:"warning",className:"bg-amber-600/10 text-amber-600 dark:bg-amber-500/10 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"solid",type:"error",className:"bg-red-600 text-white dark:bg-red-500 [&>svg]:text-white"},{variant:"flat",type:"error",className:"bg-red-600/10 text-red-600 dark:bg-red-500/10 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"}],defaultVariants:{variant:"solid",type:"default",position:"relative"}}),LP={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},rx=_.forwardRef(({message:e,type:t="default",variant:n="solid",showIcon:r=false,icon:o,dismissible:a=true,onDismiss:s,endContent:i,position:l,animate:c,autoDismiss:d,storageKey:u,className:f,...p},g)=>{let[h,v]=_.useState(true),[b,w]=_.useState(false);_.useEffect(()=>{u&&localStorage.getItem(`banner-${u}`)==="true"&&v(false);},[u]),_.useEffect(()=>{if(d&&h){let y=setTimeout(()=>{x();},d);return ()=>clearTimeout(y)}},[d,h]);let x=()=>{w(true),setTimeout(()=>{v(false),u&&localStorage.setItem(`banner-${u}`,"true"),s?.();},200);};if(!h)return null;let R=LP[t],C=r?o!==void 0?o:R?jsx(R,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:m(nx({variant:n,type:t,position:l}),c&&"animate-pulse",b&&"animate-out fade-out slide-out-to-top duration-200",f),role:"banner",...p,children:[C&&jsx("span",{className:"shrink-0",children:C}),jsx("span",{className:"text-center font-medium",children:e}),i&&jsx("div",{className:"shrink-0 ml-2",children:i}),a&&jsx("button",{type:"button",onClick:x,className:m("absolute right-2 top-1/2 -translate-y-1/2 rounded-sm p-1 transition-opacity hover:opacity-70 cursor-pointer",l==="relative"&&"right-4"),"aria-label":"Dismiss banner",children:jsx(X,{className:"h-4 w-4"})})]})});rx.displayName="Banner";var pa=cva("inline-flex items-center justify-center rounded-full shadow-lg transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{solid:"bg-primary text-primary-foreground hover:bg-primary/90",bordered:"border-2 border-current bg-transparent text-primary hover:opacity-70",light:"bg-transparent text-primary hover:bg-primary/10",flat:"bg-primary/20 text-primary hover:opacity-70",ghost:"border-2 border-current bg-transparent text-primary hover:bg-primary hover:text-primary-foreground"},size:{sm:"h-10 w-10",md:"h-14 w-14",lg:"h-16 w-16"},position:{"bottom-right":"fixed bottom-6 right-6","bottom-left":"fixed bottom-6 left-6","bottom-center":"fixed bottom-6 left-1/2 -translate-x-1/2",relative:"relative"}},defaultVariants:{variant:"solid",size:"md",position:"bottom-right"}}),HP=cva("transition-transform duration-200 [&>svg]:h-full [&>svg]:w-full",{variants:{size:{sm:"h-5 w-5",md:"h-6 w-6",lg:"h-8 w-8"}},defaultVariants:{size:"md"}}),dc=_.forwardRef(({icon:e,label:t="Action button",extended:n,extendedLabel:r,actions:o,direction:a="up",showTooltip:s=true,closeIcon:i,animation:l="rotate",variant:c,size:d,position:u,className:f,onClick:p,disabled:g,...h},v)=>{let[b,w]=_.useState(false),x=o&&o.length>0,R=k=>{x&&w(!b),p?.(k);},C=k=>{k.onClick?.(),w(false);},y={up:{container:"flex-col-reverse bottom-full mb-3 gap-3",item:""},down:{container:"flex-col top-full mt-3 gap-3",item:""},left:{container:"flex-row-reverse right-full mr-3 gap-3",item:""},right:{container:"flex-row left-full ml-3 gap-3",item:""}},N=l==="rotate"&&b?"rotate-45":"",T=l==="scale"&&b?"scale-0":"scale-100";return jsxs("div",{className:m("relative z-50",u!=="relative"&&u&&pa({position:u})),children:[x&&b&&jsx("div",{className:m("absolute left-1/2 -translate-x-1/2 flex items-center",y[a].container),children:o.map((k,E)=>jsxs("div",{className:m("flex items-center gap-2 animate-in fade-in zoom-in duration-200",a==="up"||a==="down"?"flex-row":"flex-col"),style:{animationDelay:`${E*50}ms`},children:[s&&(a==="up"||a==="down")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:k.label}),k.href?jsx("a",{href:k.href,className:m(pa({variant:k.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":k.label,children:k.icon}):jsx("button",{type:"button",onClick:()=>C(k),className:m(pa({variant:k.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":k.label,children:k.icon}),s&&(a==="left"||a==="right")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:k.label})]},k.id))}),jsxs("button",{ref:v,type:"button",onClick:R,disabled:g,className:m(pa({variant:c,size:d,position:"relative"}),n&&"w-auto px-6 gap-2",f),"aria-label":t,"aria-expanded":x?b:void 0,...h,children:[b&&i?i:jsx("span",{className:m(HP({size:d}),N,T,"transition-all duration-200"),children:e||jsx(Plus,{})}),n&&r&&jsx("span",{className:"font-medium",children:r})]}),x&&b&&jsx("div",{className:"fixed inset-0 -z-10",onClick:()=>w(false)})]})});dc.displayName="FloatingActionButton";var IP=dc;var lx=cva("fixed bottom-0 left-0 right-0 z-50 flex items-center justify-around border-t bg-background safe-area-pb",{variants:{variant:{default:"border-border",elevated:"border-transparent shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.1)]",filled:"border-transparent bg-primary text-primary-foreground"},size:{sm:"h-14",md:"h-16",lg:"h-20"}},defaultVariants:{variant:"default",size:"md"}}),ax=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),cx=_.forwardRef(({className:e,variant:t,size:n,items:r,value:o,defaultValue:a,onValueChange:s,showLabels:i="all",renderItem:l,...c},d)=>{let[u,f]=_.useState(a||r[0]?.key),p=o!==void 0,g=p?o:u,h=x=>{x.disabled||(p||f(x.key),s?.(x.key));},v=x=>t==="filled"?x?"text-primary-foreground":"text-primary-foreground/60 hover:text-primary-foreground/80":x?"text-primary":"text-muted-foreground hover:text-foreground",b=()=>{switch(n){case "sm":return "h-5 w-5";case "lg":return "h-7 w-7";default:return "h-6 w-6"}},w=()=>{switch(n){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:m(lx({variant:t,size:n}),e),role:"navigation","aria-label":"Bottom navigation",...c,children:r.map(x=>{let R=g===x.key,C=i==="all"||i==="active"&&R,y=R&&x.activeIcon?x.activeIcon:x.icon;if(l)return jsx("div",{onClick:()=>h(x),className:m(ax({variant:t}),x.disabled&&"opacity-50 cursor-not-allowed"),children:l(x,R)},x.key);let N=jsxs("div",{onClick:()=>!x.href&&h(x),className:m(ax({variant:t}),v(R),x.disabled&&"opacity-50 cursor-not-allowed"),role:"button","aria-current":R?"page":void 0,"aria-disabled":x.disabled,tabIndex:x.disabled?-1:0,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),h(x));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:m(b(),"[&>svg]:h-full [&>svg]:w-full"),children:y}),x.badge!==void 0&&x.badge>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:x.badge>99?"99+":x.badge}),x.showDot&&jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-red-500"})]}),C&&x.label&&jsx("span",{className:m(w(),"font-medium truncate max-w-full px-1"),children:x.label})]},x.key);return x.href&&!x.disabled?jsx("a",{href:x.href,onClick:()=>h(x),className:m("flex flex-1 flex-col items-center justify-center gap-1 no-underline",v(R)),children:N},x.key):N})})});cx.displayName="BottomNavigation";var AP="fixed inset-x-0 bottom-0 z-50 mt-24 flex h-fit max-h-[90vh] flex-col rounded-t-[20px] border-t border-border/40 dark:border-border/20 bg-background",ux=cva("flex w-full items-center gap-3 px-4 py-3.5 text-left transition-colors focus-visible:outline-none focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-accent",destructive:"text-danger hover:bg-destructive/10"}},defaultVariants:{variant:"default"}}),mx=_.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r,description:o,items:a,cancelLabel:s="Cancel",onCancel:i,showCancel:l=true,children:c,closeOnSelect:d=true,onAction:u},f)=>{let p=g=>{g.isDisabled||(g.onSelect?.(),u?.(g.key),d&&t?.(false));};return jsxs(Drawer.Root,{open:e,onOpenChange:t,children:[n&&jsx(Drawer.Trigger,{asChild:true,children:n}),jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:"fixed inset-0 z-50 bg-black/40"}),jsxs(Drawer.Content,{ref:f,className:AP,children:[jsx("div",{className:"mx-auto mt-4 h-1.5 w-12 flex-shrink-0 rounded-full bg-muted"}),(r||o)&&jsxs("div",{className:"px-4 py-3 text-center",children:[r&&jsx(Drawer.Title,{className:"text-base font-semibold",children:r}),o&&jsx(Drawer.Description,{className:"mt-1 text-sm text-muted-foreground",children:o})]}),jsx("div",{className:"flex-1 overflow-y-auto",children:c||jsx("div",{className:"divide-y divide-border/40 dark:divide-border/20",children:a?.map(g=>jsxs("button",{type:"button",disabled:g.isDisabled,onClick:()=>p(g),className:m(ux({variant:g.isDestructive?"destructive":"default"})),children:[g.icon&&jsx("span",{className:"h-5 w-5 flex-shrink-0 [&>svg]:h-full [&>svg]:w-full",children:g.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"font-medium",children:g.label}),g.description&&jsx("div",{className:"text-sm text-muted-foreground truncate",children:g.description})]})]},g.key))})}),l&&jsx("div",{className:"border-t border-border/40 dark:border-border/20 p-2 pb-safe",children:jsx(Drawer.Close,{asChild:true,children:jsx("button",{type:"button",onClick:i,className:"w-full rounded-lg bg-muted py-3.5 text-center font-semibold transition-colors hover:bg-muted/80",children:s})})})]})]})]})});mx.displayName="ActionSheet";var fx=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),mc=cva("flex h-full items-center justify-center px-4 text-white font-medium transition-opacity",{variants:{variant:{primary:"bg-primary",secondary:"bg-secondary text-secondary-foreground",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500"},size:{sm:"min-w-16",md:"min-w-20",lg:"min-w-24"}},defaultVariants:{variant:"primary",size:"md"}}),gx=_.forwardRef(({className:e,variant:t,leftActions:n=[],rightActions:r=[],actionSize:o="md",threshold:a=.3,onSwipeEnd:s,disabled:i=false,fullSwipeAction:l,children:c,...d},u)=>{let f=_.useRef(null),[p,g]=_.useState(0),[h,v]=_.useState(false),b=_.useRef(0),w=_.useRef(0),x=n.length*(o==="sm"?64:o==="lg"?96:80),R=r.length*(o==="sm"?64:o==="lg"?96:80),C=E=>{i||(v(true),b.current=E.touches[0].clientX,w.current=p);},y=E=>{if(!h||i)return;let P=E.touches[0].clientX-b.current,S=w.current+P;(S>0&&n.length===0||S<0&&r.length===0)&&(S=0),S>x?S=x+(S-x)*.3:S<-R&&(S=-R+(S+R)*.3),g(S);},N=()=>{if(!h)return;v(false);let E=f.current?.offsetWidth||0,M=Math.abs(p)/E;if(l&&M>.6){l==="right"&&p>0&&n[0]?(n[0].onAction?.(),s?.("right",n[0].key)):l==="left"&&p<0&&r[0]&&(r[0].onAction?.(),s?.("left",r[0].key)),g(0);return}p>x*a&&n.length>0?(g(x),s?.("right")):p<-R*a&&r.length>0?(g(-R),s?.("left")):g(0);},T=(E,M)=>{E.onAction?.(),s?.(M,E.key),g(0);},k=()=>{g(0);};return jsxs("div",{ref:u,className:m(fx({variant:t,className:e})),...d,children:[n.length>0&&p>0&&jsx("div",{className:"absolute left-0 top-0 bottom-0 flex",style:{width:x},children:n.map(E=>jsxs("button",{type:"button",onClick:()=>T(E,"right"),className:m(mc({variant:E.variant,size:o})),style:{opacity:Math.min(1,p/x)},children:[E.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:E.icon}),!E.icon&&E.label]},E.key))}),r.length>0&&p<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:R},children:r.map(E=>jsxs("button",{type:"button",onClick:()=>T(E,"left"),className:m(mc({variant:E.variant,size:o})),style:{opacity:Math.min(1,Math.abs(p)/R)},children:[E.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:E.icon}),!E.icon&&E.label]},E.key))}),jsx("div",{ref:f,className:m("relative bg-background",h?"":"transition-transform duration-200"),style:{transform:`translateX(${p}px)`},onTouchStart:C,onTouchMove:y,onTouchEnd:N,onClick:p!==0?k:void 0,children:c})]})});gx.displayName="SwipeActions";var vx=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),BP=cva("absolute left-1/2 -translate-x-1/2 flex items-center justify-center transition-all duration-200",{variants:{size:{sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"}},defaultVariants:{size:"md"}}),hx=_.forwardRef(({className:e,variant:t,onRefresh:n,pullThreshold:r=80,maxPullDistance:o=120,loadingIndicator:a,pullIndicator:s,indicatorSize:i="md",disabled:l=false,pullText:c="Pull to refresh",releaseText:d="Release to refresh",refreshingText:u="Refreshing...",children:f,...p},g)=>{let h=_.useRef(null),[v,b]=_.useState(0),[w,x]=_.useState("idle"),R=_.useRef(0),C=_.useRef(false),y=()=>l||w==="refreshing"?false:(h.current?.scrollTop??window.scrollY)<=0,N=P=>{y()&&(R.current=P.touches[0].clientY,C.current=true);},T=P=>{if(!C.current||!y())return;let H=P.touches[0].clientY-R.current;if(H<0){b(0),x("idle");return}let L=Math.min(H*.5,o);b(L),x(L>=r?"ready":"pulling");},k=async()=>{if(C.current)if(C.current=false,w==="ready"){x("refreshing"),b(r*.6);try{await n();}finally{x("idle"),b(0);}}else x("idle"),b(0);},E={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],M=()=>{if(w==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:m(E,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:u})]});let P=Math.min(v/r*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:m(E,"text-muted-foreground transition-transform"),style:{transform:`rotate(${P}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:w==="ready"?d:c})]})};return jsxs("div",{ref:g,className:m(vx({variant:t,className:e})),...p,children:[jsx("div",{className:m(BP({size:i}),"z-10",w==="idle"&&v===0&&"opacity-0"),style:{top:Math.max(v-60,-60),opacity:Math.min(v/(r*.5),1)},children:M()}),jsx("div",{ref:h,className:m("transition-transform duration-200",w==="refreshing"&&"ease-out"),style:{transform:`translateY(${v}px)`,transition:C.current?"none":void 0},onTouchStart:N,onTouchMove:T,onTouchEnd:k,children:f})]})});hx.displayName="PullToRefresh";var Gr=(e,t,n)=>({duration:e,delay:t,ease:n||[.4,0,.2,1]}),FP={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},xx=_.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialOpacity:i=0,onAnimationStart:l,onAnimationComplete:c},d)=>{let u=jsx(motion.div,{ref:d,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:FP,custom:i,transition:Gr(n,r,o),className:m(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&u}):u});xx.displayName="Fade";var KP=(e,t)=>{let n=typeof t=="number"?`${t}px`:t,r={up:{y:n},down:{y:`-${n}`},left:{x:n},right:{x:`-${n}`}};return {hidden:{opacity:0,...r[e]},visible:{opacity:1,x:0,y:0},exit:{opacity:0,...r[e]}}},yx=_.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,direction:i="up",offset:l=20,onAnimationStart:c,onAnimationComplete:d},u)=>{let f=_.useMemo(()=>KP(i,l),[i,l]),p=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Gr(n,r,o),className:m(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});yx.displayName="Slide";var $P={center:"center center",top:"center top",bottom:"center bottom",left:"left center",right:"right center","top-left":"left top","top-right":"right top","bottom-left":"left bottom","bottom-right":"right bottom"},GP={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},Rx=_.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialScale:i=.9,origin:l="center",onAnimationStart:c,onAnimationComplete:d},u)=>{let f=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:GP,custom:i,transition:Gr(n,r,o),className:m(a),style:{transformOrigin:$P[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});Rx.displayName="Scale";var wx=_.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,horizontal:s=false,startingSize:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},u)=>{let f=s?"width":"height",p={hidden:{[f]:i,opacity:l?0:1},visible:{[f]:"auto",opacity:1},exit:{[f]:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:u,initial:"hidden",animate:"visible",exit:"exit",variants:p,transition:Gr(n,r,o),className:m("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});wx.displayName="Collapse";var Cx=_.forwardRef(({show:e=true,children:t,duration:n=.4,delay:r=0,ease:o,className:a,initialWidth:s=0,initialHeight:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},u)=>{let f={hidden:{width:s,height:i,opacity:l?0:1},visible:{width:"auto",height:"auto",opacity:1},exit:{width:s,height:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:u,initial:"hidden",animate:"visible",exit:"exit",variants:f,transition:Gr(n,r,o),className:m("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Cx.displayName="Expand";var Tx=_.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialRotation:i=-180,finalRotation:l=0,onAnimationStart:c,onAnimationComplete:d},u)=>{let f={hidden:{opacity:0,rotate:i},visible:{opacity:1,rotate:l},exit:{opacity:0,rotate:i}},p=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Gr(n,r,o),className:m(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Tx.displayName="Rotate";var Mx=_.forwardRef(({front:e,back:t,direction:n="horizontal",flipped:r=false,duration:o=.6,delay:a=0,ease:s,className:i,onAnimationStart:l,onAnimationComplete:c},d)=>{let u=n==="horizontal"?"rotateY":"rotateX";return jsx("div",{ref:d,className:m("relative",i),style:{perspective:1e3},children:jsxs(motion.div,{animate:{[u]:r?180:0},transition:Gr(o,a,s),style:{transformStyle:"preserve-3d"},onAnimationStart:l,onAnimationComplete:c,children:[jsx("div",{className:"absolute inset-0",style:{backfaceVisibility:"hidden"},children:e}),jsx("div",{className:"absolute inset-0",style:{backfaceVisibility:"hidden",transform:`${u}(180deg)`},children:t})]})})});Mx.displayName="Flip";var Nx=_.forwardRef(({color:e="currentColor",duration:t=.6,children:n,className:r,disabled:o=false},a)=>{let[s,i]=_.useState([]),l=_.useRef(null),c=u=>{if(o)return;let f=l.current;if(!f)return;let p=f.getBoundingClientRect(),g=u.clientX-p.left,h=u.clientY-p.top,v=Math.max(p.width,p.height)*2,b={id:Date.now(),x:g,y:h,size:v};i(w=>[...w,b]);},d=u=>{i(f=>f.filter(p=>p.id!==u));};return jsxs("div",{ref:a,className:m("relative overflow-hidden rounded-[inherit]",r),onClick:c,children:[jsx("div",{ref:l,className:"relative z-0",children:n}),jsx(AnimatePresence,{children:s.map(u=>jsx(motion.span,{initial:{scale:0,opacity:.35},animate:{scale:1,opacity:0},exit:{opacity:0},transition:{duration:t,ease:"easeOut"},onAnimationComplete:()=>d(u.id),className:"pointer-events-none absolute rounded-full",style:{left:u.x-u.size/2,top:u.y-u.size/2,width:u.size,height:u.size,backgroundColor:e}},u.id))})]})});Nx.displayName="Ripple";var kx=_.forwardRef(({children:e,animate:t=true,height:n=10,duration:r=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=_.useState(false),d=s?l:t,u={idle:{y:0},bounce:{y:[0,-n,0],transition:{duration:r,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:u,initial:"idle",animate:d?"bounce":"idle",className:m(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});kx.displayName="Bounce";var jP={subtle:[0,-2,2,-2,2,-1,1,0],normal:[0,-5,5,-5,5,-3,3,0],strong:[0,-10,10,-10,10,-5,5,0]},Px=_.forwardRef(({children:e,animate:t=true,intensity:n="normal",duration:r=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=_.useState(false),d=s?l:t,u={idle:{x:0},shake:{x:jP[n],transition:{duration:r,ease:"easeInOut",repeat:o-1}}};return jsx(motion.div,{ref:i,variants:u,initial:"idle",animate:d?"shake":"idle",className:m(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});Px.displayName="Shake";var _P={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},Ex=_.forwardRef(({children:e,animate:t=true,speed:n="normal",className:r},o)=>jsx("div",{ref:o,className:m(t&&_P[n],r),children:e}));Ex.displayName="Pulse";var Lx=_.forwardRef(({children:e,animate:t=true,angle:n=10,duration:r=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=_.useState(false),d=s?l:t,u={idle:{rotate:0},wiggle:{rotate:[0,-n,n,-n,n,0],transition:{duration:r,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:u,initial:"idle",animate:d?"wiggle":"idle",className:m(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});Lx.displayName="Wiggle";var Sx=_.forwardRef(({children:e,animate:t=false,scale:n=1.2,duration:r=.2,className:o,triggerOnHover:a=false,triggerOnClick:s=false},i)=>{let[l,c]=_.useState(false),d=t||l,u={type:"spring",stiffness:400,damping:17,duration:r},f=()=>{s&&(c(true),setTimeout(()=>c(false),r*1e3));};return jsx(motion.div,{ref:i,animate:{scale:d?n:1},transition:u,className:m(o),onMouseEnter:()=>a&&c(true),onMouseLeave:()=>a&&c(false),onClick:f,children:e})});Sx.displayName="Pop";var JP=(e,t,n,r)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,n);return s?`${i}${r}${s}`:i},Dx=_.forwardRef(({value:e,from:t=0,duration:n=2,decimals:r=0,prefix:o="",suffix:a="",separator:s=",",decimalSeparator:i=".",animateOnView:l=true,delay:c=0,className:d,onComplete:u},f)=>{let p=_.useRef(null),g=useInView(p,{once:true}),[h,v]=_.useState(!l);_.useEffect(()=>{if(l&&g){let x=setTimeout(()=>v(true),c*1e3);return ()=>clearTimeout(x)}},[l,g,c]);let b=useMotionValue(t),w=useTransform(b,x=>JP(x,r,s,i));return _.useEffect(()=>{if(h){let x=animate(b,e,{duration:n,ease:"easeOut",onComplete:u});return ()=>x.stop()}},[h,e,n,b,u]),jsx("span",{ref:p,className:m(d),children:jsxs("span",{ref:f,children:[o,jsx(motion.span,{children:w}),a]})})});Dx.displayName="Counter";var Hx=_.forwardRef(({text:e,speed:t=50,delay:n=0,pauseBetween:r=1500,cursor:o=true,cursorChar:a="|",loop:s=false,deleteSpeed:i=30,animateOnView:l=true,className:c,cursorClassName:d,onComplete:u},f)=>{let p=Array.isArray(e)?e:[e],[g,h]=_.useState(""),[v,b]=_.useState(0),[w,x]=_.useState(false),[R,C]=_.useState(false),y=_.useRef(null),N=useInView(y,{once:true}),[T,k]=_.useState(!l);return _.useEffect(()=>{if(l&&N){let E=setTimeout(()=>k(true),n*1e3);return ()=>clearTimeout(E)}},[l,N,n]),_.useEffect(()=>{if(!T||R)return;let E=p[v],M;return w?g.length>0?M=setTimeout(()=>{h(g.slice(0,-1));},i):(x(false),b(P=>(P+1)%p.length)):g.length<E.length?M=setTimeout(()=>{h(E.slice(0,g.length+1));},t):v<p.length-1||s?M=setTimeout(()=>{x(true);},r):(C(true),u?.()),()=>clearTimeout(M)},[T,g,v,w,R,p,t,i,r,s,u]),jsxs("span",{ref:y,className:m(c),children:[jsx("span",{ref:f,children:g}),o&&jsx(motion.span,{animate:{opacity:[1,0]},transition:{duration:.8,repeat:1/0,repeatType:"reverse"},className:m("ml-0.5",d),children:a})]})});Hx.displayName="Typewriter";var Ix=_.forwardRef(({children:e,direction:t="up",stagger:n=.05,duration:r=.5,delay:o=0,splitBy:a="word",animateOnView:s=true,className:i},l)=>{let c=_.useRef(null),d=useInView(c,{once:true,amount:.5}),u=s?d:true,f=typeof e=="string"?e:"",p=a==="word"?f.split(" "):f.split(""),g={up:{y:20},down:{y:-20},left:{x:20},right:{x:-20}},h={hidden:{},visible:{transition:{staggerChildren:n,delayChildren:o}}},v={hidden:{opacity:0,...g[t]},visible:{opacity:1,x:0,y:0,transition:{duration:r,ease:"easeInOut"}}};return jsx(motion.div,{ref:l,className:m("inline-flex flex-wrap",i),variants:h,initial:"hidden",animate:u?"visible":"hidden",children:jsx("span",{ref:c,children:p.map((b,w)=>jsxs(motion.span,{variants:v,className:"inline-block",children:[b,a==="word"&&w<p.length-1&&"\xA0"]},w))})})});Ix.displayName="TextReveal";var Vx=_.forwardRef(({words:e,duration:t=2,animation:n="slide",animationDuration:r=.5,className:o,loop:a=true},s)=>{let[i,l]=_.useState(0);_.useEffect(()=>{if(!a&&i===e.length-1)return;let d=setInterval(()=>{l(u=>(u+1)%e.length);},t*1e3);return ()=>clearInterval(d)},[e.length,t,a,i]);let c=()=>{switch(n){case "fade":return {initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};case "slide":return {initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20}};case "scale":return {initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.2}};case "blur":return {initial:{opacity:0,filter:"blur(10px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(10px)"}}}};return jsx("span",{ref:s,className:m("relative inline-block",o),children:jsx(AnimatePresence,{mode:"wait",children:jsx(motion.span,{variants:c(),initial:"initial",animate:"animate",exit:"exit",transition:{duration:r},className:"inline-block",children:e[i]},e[i])})})});Vx.displayName="WordRotate";var Bx=_.forwardRef(({children:e,direction:t="up",distance:n=50,duration:r=.6,delay:o=0,once:a=true,threshold:s=.1,className:i,scale:l,rotate:c,blur:d,ease:u=[.4,0,.2,1]},f)=>{let p=_.useRef(null),g=useInView(p,{once:a,amount:s}),v={up:{x:0,y:n},down:{x:0,y:-n},left:{x:n,y:0},right:{x:-n,y:0},none:{x:0,y:0}}[t],b={hidden:{opacity:0,x:v.x,y:v.y,scale:l??1,rotate:c??0,filter:d?`blur(${d}px)`:"blur(0px)"},visible:{opacity:1,x:0,y:0,scale:1,rotate:0,filter:"blur(0px)",transition:{duration:r,delay:o,ease:u}}};return jsx("div",{ref:p,children:jsx(motion.div,{ref:f,variants:b,initial:"hidden",animate:g?"visible":"hidden",className:m(i),children:e})})});Bx.displayName="ScrollReveal";var Fx=_.forwardRef(({position:e="top",size:t=4,color:n="hsl(var(--primary))",backgroundColor:r="transparent",zIndex:o=50,className:a,container:s,showPercentage:i=false,useSpring:l=true},c)=>{let{scrollYProgress:d}=useScroll({container:s}),u=useSpring(d,{stiffness:100,damping:30,restDelta:.001}),f=l?u:d,p=e==="top"||e==="bottom",g={top:{top:0,left:0,right:0,height:t},bottom:{bottom:0,left:0,right:0,height:t},left:{top:0,left:0,bottom:0,width:t},right:{top:0,right:0,bottom:0,width:t}},h=p?"scaleX":"scaleY",v=p?"left":"top";return jsxs("div",{ref:c,className:m("fixed",a),style:{...g[e],zIndex:o,backgroundColor:r},children:[jsx(motion.div,{className:"h-full w-full",style:{[h]:f,transformOrigin:v,backgroundColor:n}}),i&&jsx(tE,{progress:f,position:e})]})});Fx.displayName="ScrollProgress";var tE=({progress:e,position:t})=>{let n=useTransform(e,s=>Math.round(s*100)),[r,o]=_.useState(0);return _.useEffect(()=>{let s=n.on("change",o);return ()=>s()},[n]),jsxs("span",{className:m("fixed rounded bg-background/80 px-2 py-1 text-xs font-medium backdrop-blur-sm",{top:"top-2 right-4",bottom:"bottom-2 right-4",left:"top-4 left-2",right:"top-4 right-2"}[t]),children:[r,"%"]})},Kx=_.forwardRef(({children:e,speed:t=.5,direction:n="vertical",className:r,container:o},a)=>{let s=_.useRef(null),{scrollYProgress:i}=useScroll({target:s,container:o,offset:["start end","end start"]}),l=[-100*t,100*t],c=useTransform(i,[0,1],l),d=useSpring(c,{stiffness:100,damping:30}),u=n==="horizontal"?d:0,f=n==="vertical"?d:0;return jsx("div",{ref:s,className:m("overflow-hidden",r),children:jsx(motion.div,{ref:a,style:{x:u,y:f},children:e})})});Kx.displayName="Parallax";var Ux=_.forwardRef(({children:e,width:t,height:n,duration:r=1.5,direction:o="right",baseColor:a="hsl(var(--muted))",highlightColor:s="hsl(var(--muted-foreground) / 0.1)",borderRadius:i,className:l,active:c=true},d)=>{let u={left:"to left",right:"to right",top:"to top",bottom:"to bottom"},f={left:"shimmer-left",right:"shimmer-right",top:"shimmer-top",bottom:"shimmer-bottom"};return jsxs("div",{ref:d,className:m("relative overflow-hidden",l),style:{width:t,height:n,borderRadius:i,backgroundColor:a},children:[e,c&&jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(${u[o]}, transparent, ${s}, transparent)`,animation:`${f[o]} ${r}s infinite`}}),jsx("style",{children:`
55
+ `,document.body.appendChild(de),X.dataTransfer.setDragImage(de,20,15),setTimeout(()=>{document.body.removeChild(de);},0),h(e),C?.({event:X,node:e});},me=X=>{if(X.preventDefault(),X.stopPropagation(),!g||g.key===e.key||oe)return;let Se=X.currentTarget.getBoundingClientRect(),de=X.clientY-Se.top,We=Se.height,je;de<We*.25?je=-1:de>We*.75?je=1:je=0,!(R&&!R({dropNode:e,dropPosition:je,dragNode:g}))&&(w(e.key,je),y?.({event:X,node:e}));},wt=X=>{X.preventDefault(),X.stopPropagation(),!(!g||g.key===e.key)&&N?.({event:X,node:e,expandedKeys:F()});},gt=X=>{X.stopPropagation(),T?.({event:X,node:e});},yn=X=>{X.preventDefault(),X.stopPropagation(),!(!g||g.key===e.key||oe)&&(b!==null&&x(e,b),h(null),w(null,null));},Fe=X=>{h(null),w(null,null),k?.({event:X,node:e});},on=X=>{oe||ge&&i(e.key,e,X);},Ct=X=>{X.stopPropagation(),!oe&&!Y&&a(e.key,e);},U=_.useMemo(()=>{if(!j||b===null)return "";switch(b){case -1:return "before:absolute before:left-0 before:right-0 before:top-0 before:h-0.5 before:bg-foreground";case 1:return "after:absolute after:left-0 after:right-0 after:bottom-0 after:h-0.5 after:bg-foreground";case 0:return "ring-2 ring-foreground ring-inset";default:return ""}},[j,b]),re=[...r,n];return jsxs("div",{className:"relative",children:[E&&t>0&&jsxs(Fragment,{children:[r.map((X,Se)=>!X&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${Se} * var(--tree-indent) + 12px)`,top:0,bottom:0}},Se)),jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:0,height:n?"calc(var(--tree-item-height) / 2)":"100%"}}),jsx("div",{className:"absolute border-t border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:"calc(var(--tree-item-height) / 2)",width:"calc(var(--tree-indent) - 4px)"}})]}),jsxs("div",{role:"treeitem","aria-expanded":Y?void 0:q,"aria-selected":ge?$:void 0,"aria-disabled":oe,draggable:Pe,onDragStart:Be,onDragOver:me,onDragEnter:wt,onDragLeave:gt,onDrop:yn,onDragEnd:Fe,onClick:on,className:m("relative",Vg({size:I,isSelected:$,isDragging:z,isDisabled:oe,isHoverable:ge&&!oe}),U,A&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[Pe&&P&&Z!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:Z}),jsx("button",{type:"button",onClick:Ct,className:m("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",Y&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:m("h-4 w-4 transition-transform duration-200",q&&"rotate-90")})}),G&&jsx(eT,{checked:O,indeterminate:W,disabled:oe,onClick:X=>u(e.key,e,X)}),M&&le&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:le}),jsx("div",{className:m("flex-1 min-w-0 truncate ml-1",A&&"flex-none"),children:e.label})]}),K&&q&&jsx("div",{role:"group",children:e.children.map((X,Se)=>jsx(zg,{node:X,level:t+1,isLast:Se===e.children.length-1,parentIsLastPath:re},X.key))})]})},tT=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return n(e),t},nT=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return e.children&&n(e.children),t},Og=(e,t)=>{if(!e.children)return false;for(let n of e.children)if(n.key===t||Og(n,t))return true;return false},Bg=_.forwardRef(({className:e,variant:t,size:n,data:r,draggable:o=false,allowDrop:a,expandedKeys:s,defaultExpandedKeys:i=[],defaultExpandAll:l=false,onExpand:c,selectable:d=true,multiple:u=false,selectedKeys:f,defaultSelectedKeys:p=[],onSelect:g,checkable:h=false,checkStrictly:v=false,checkedKeys:b,defaultCheckedKeys:w=[],onCheck:x,showLine:R=false,showIcon:C=false,showHandle:y=true,dragIcon:N,icon:T,leafIcon:k=jsx(File,{className:"h-4 w-4"}),folderIcon:E=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:M=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:P,onDragEnter:S,onDragOver:H,onDragLeave:D,onDragEnd:L,onDrop:V,blockNode:A=false,disabled:B=false,...I},F)=>{let K=_.useCallback(()=>l?new Set(tT(r)):new Set(i),[l,i,r]),[Y,q]=_.useState(K),$=s!==void 0,O=$?new Set(s):Y,W=_.useCallback((ve,Ye)=>{let Kt=new Set(O),Ae=!Kt.has(ve);Ae?Kt.add(ve):Kt.delete(ve),$||q(Kt),c?.(Array.from(Kt),{expanded:Ae,node:Ye});},[O,$,c]),[z,j]=_.useState(new Set(p)),oe=f!==void 0,ge=oe?new Set(f):z,G=_.useCallback((ve,Ye,Kt)=>{let Ae=new Set(ge),Rn=!Ae.has(ve);u?Rn?Ae.add(ve):Ae.delete(ve):(Ae.clear(),Rn&&Ae.add(ve)),oe||j(Ae);let jr=[],Vo=wa=>{for(let _r of wa)Ae.has(_r.key)&&jr.push(_r),_r.children&&Vo(_r.children);};Vo(r),g?.(Array.from(Ae),{selected:Rn,selectedNodes:jr,node:Ye,event:Kt});},[ge,u,oe,g,r]),[Pe,Z]=_.useState(new Set(w)),[le,Be]=_.useState(new Set),me=b!==void 0,wt=me?new Set(Array.isArray(b)?b:b.checked):Pe,gt=me&&!Array.isArray(b)?new Set(b.halfChecked):le,yn=_.useCallback((ve,Ye,Kt)=>{let Ae=new Set(wt),Rn=new Set(gt),jr=!Ae.has(ve);if(jr?(Ae.add(ve),Rn.delete(ve)):Ae.delete(ve),!v&&Ye.children){let yi=nT(Ye);for(let Un of yi)jr?(Ae.add(Un),Rn.delete(Un)):Ae.delete(Un);}me||(Z(Ae),Be(Rn));let Vo=[],wa=yi=>{for(let Un of yi)Ae.has(Un.key)&&Vo.push(Un),Un.children&&wa(Un.children);};wa(r);let _r=v?{checked:Array.from(Ae),halfChecked:Array.from(Rn)}:Array.from(Ae);x?.(_r,{checked:jr,checkedNodes:Vo,node:Ye,event:Kt,halfCheckedKeys:Array.from(Rn)});},[wt,gt,v,me,x,r]),[Fe,on]=_.useState(null),[Ct,U]=_.useState(null),[re,X]=_.useState(null),Se=_.useCallback((ve,Ye)=>{U(ve),X(Ye);},[]),de=_.useCallback((ve,Ye)=>{!Fe||!V||Ye===0&&Og(Fe,ve.key)||V({event:{},node:ve,dragNode:Fe,dropPosition:Ye,dropToGap:Ye!==0});},[Fe,V]),We=_.useCallback(()=>Array.from(O),[O]),je={expandedKeys:O,toggleExpand:W,selectedKeys:ge,handleSelect:G,selectable:d,multiple:u,checkedKeys:wt,halfCheckedKeys:gt,handleCheck:yn,checkable:h,checkStrictly:v,draggable:o,draggedNode:Fe,setDraggedNode:on,dragOverKey:Ct,dragOverPosition:re,setDragOver:Se,handleDrop:de,allowDrop:a,onDragStart:P,onDragEnter:S,onDragOver:H,onDragLeave:D,onDragEnd:L,showLine:R,showIcon:C,showHandle:y,dragIcon:N,icon:T,leafIcon:k,folderIcon:E,folderOpenIcon:M,blockNode:A,disabled:B,size:n,data:r,getAllKeys:We},Gn=ve=>{let Ye=ve.relatedTarget,Kt=ve.currentTarget;(!Ye||!Kt.contains(Ye))&&Se(null,null);};return jsx(Ag.Provider,{value:je,children:jsx("div",{ref:F,role:"tree","aria-multiselectable":u||h,className:m(Ig({variant:t,size:n,className:e})),onDragLeave:Gn,...I,children:r.map((ve,Ye)=>jsx(zg,{node:ve,level:0,isLast:Ye===r.length-1},ve.key))})})});Bg.displayName="Tree";var Kg=cva("flex rounded-md border border-input bg-background text-sm placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"},fullWidth:{true:"w-full",false:"w-fit min-w-48"}},defaultVariants:{size:"md",fullWidth:false}}),lT=({text:e,query:t})=>{if(!t)return jsx(Fragment,{children:e});let n=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),r=e.split(n);return jsx(Fragment,{children:r.map((o,a)=>n.test(o)?jsx("mark",{className:"bg-primary/20 text-foreground rounded-sm",children:o},a):jsx("span",{children:o},a))})},cT=(e,t)=>{let[n,r]=_.useState(e);return _.useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n},$g=_.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,onSelect:a,options:s=[],loadOptions:i,debounceMs:l=300,minChars:c=0,placeholder:d="Type to search...",emptyText:u="No results found.",loadingText:f="Loading...",clearable:p=false,allowCustomValue:g=true,maxHeight:h=200,highlightMatch:v=true,fullWidth:b=false,disabled:w,...x},R)=>{let[C,y]=_.useState(false),[N,T]=_.useState(r),[k,E]=_.useState([]),[M,P]=_.useState(false),[S,H]=_.useState(false),[D,L]=_.useState(0),V=_.useRef(null),A=_.useRef(null),B=n!==void 0?n:N,I=cT(B,l);_.useEffect(()=>{let G=A.current;if(!G)return;let Pe=()=>{L(G.offsetWidth);};Pe();let Z=new ResizeObserver(Pe);return Z.observe(G),()=>{Z.disconnect();}},[]),_.useImperativeHandle(R,()=>V.current);let F=i?k:s,K=_.useMemo(()=>i?F:F.filter(G=>G.label.toLowerCase().includes(B.toLowerCase())),[F,B,i]);_.useEffect(()=>{if(!i)return;if(I.length<c){E([]);return}let G=false;return (async()=>{P(true);try{let Z=await i(I);G||E(Z);}catch{G||E([]);}finally{G||P(false);}})(),()=>{G=true;}},[I,i,c]);let Y=G=>{n===void 0&&T(G),o?.(G);},q=G=>{let Pe=G.target.value;Y(Pe),Pe.length>=c&&y(true);},$=G=>{Y(G.label),a?.(G),y(false);},O=()=>{Y(""),V.current?.focus();},W=()=>{H(true),y(true);},z=()=>{H(false);},j=G=>{G.key==="Escape"&&y(false),G.key==="ArrowDown"&&!C&&K.length>0&&y(true);},oe=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",ge=p&&B?"pr-8":"pr-3";return jsxs(ot,{open:C,onOpenChange:y,children:[jsxs(an,{ref:A,className:m("relative",b?"w-full":"w-fit"),children:[jsx("input",{ref:V,type:"text",value:B,onChange:q,onFocus:W,onBlur:z,onKeyDown:j,disabled:w,placeholder:d,className:m(Kg({size:t,fullWidth:b}),ge,e),style:{borderColor:S?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":C,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...x}),p&&B&&!w&&jsx("button",{type:"button",onClick:O,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:oe})})]}),jsx(at,{className:"p-0",align:"start",style:{width:D>0?D:void 0},onOpenAutoFocus:G=>G.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(De,{style:{maxHeight:h},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:M?jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[jsx(Loader2,{className:m(oe,"animate-spin")}),f]}):K.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:u}):K.map(G=>jsxs(Command.Item,{value:G.value,disabled:G.disabled,onSelect:()=>$(G),className:m("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground"),children:[jsx(Check,{className:m("mr-2 h-4 w-4 shrink-0",B===G.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:v?jsx(lT,{text:G.label,query:B}):G.label})]},G.value))})})})})]})});$g.displayName="Autocomplete";var fl=_.createContext(null),gl=_.createContext(null),bl=()=>{let e=_.useContext(fl);if(!e)throw new Error("useFormContext must be used within a Form");return e},gs=()=>{let e=_.useContext(gl);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},dT={required:(e="This field is required")=>({validate:t=>typeof t=="string"?t.trim().length>0:Array.isArray(t)?t.length>0:t!=null,message:e}),minLength:(e,t)=>({validate:n=>typeof n=="string"&&n.length>=e,message:t??`Must be at least ${e} characters`}),maxLength:(e,t)=>({validate:n=>typeof n=="string"&&n.length<=e,message:t??`Must be at most ${e} characters`}),min:(e,t)=>({validate:n=>typeof n=="number"&&n>=e,message:t??`Must be at least ${e}`}),max:(e,t)=>({validate:n=>typeof n=="number"&&n<=e,message:t??`Must be at most ${e}`}),email:(e="Invalid email address")=>({validate:t=>typeof t=="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),message:e}),pattern:(e,t="Invalid format")=>({validate:n=>typeof n=="string"&&e.test(n),message:t}),custom:(e,t)=>({validate:e,message:t})},Gg=_.forwardRef(({defaultValues:e={},onSubmit:t,onError:n,validateOnBlur:r=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=_.useState(e),[u,f]=_.useState({}),[p,g]=_.useState({}),[h,v]=_.useState({}),[b,w]=_.useState(false),x=_.useRef(new Map),R=_.useCallback((D,L)=>{x.current.set(D,L);},[]),C=_.useCallback(D=>{x.current.delete(D);},[]),y=_.useCallback(D=>{let L=x.current.get(D)||[],V=c[D];for(let A of L)if(!A.validate(V))return f(B=>({...B,[D]:A.message})),false;return f(A=>({...A,[D]:null})),true},[c]),N=_.useCallback(()=>{let D=true,L={};return x.current.forEach((V,A)=>{let B=c[A];for(let I of V)if(!I.validate(B)){L[A]=I.message,D=false;break}L[A]||(L[A]=null);}),f(L),D},[c]),T=_.useCallback((D,L)=>{d(V=>({...V,[D]:L})),v(V=>({...V,[D]:true})),o&&setTimeout(()=>{y(D);},0);},[o,y]),k=_.useCallback((D,L)=>{f(V=>({...V,[D]:L}));},[]),E=_.useCallback((D,L)=>{g(V=>({...V,[D]:L})),L&&r&&y(D);},[r,y]),M=_.useCallback(D=>({value:c[D],error:u[D]??null,touched:p[D]??false,dirty:h[D]??false}),[c,u,p,h]),P=_.useCallback(()=>{d(e),f({}),g({}),v({});},[e]),S=async D=>{D.preventDefault();let L={};if(x.current.forEach((A,B)=>{L[B]=true;}),g(L),!N()){n?.(u);return}if(t){w(true);try{await t(c);}finally{w(false);}}},H={values:c,errors:u,touched:p,dirty:h,isSubmitting:b,setValue:T,setError:k,setTouched:E,validateField:y,validateAll:N,registerField:R,unregisterField:C,getFieldState:M,reset:P};return jsx(fl.Provider,{value:H,children:jsx("form",{ref:l,onSubmit:S,className:m("space-y-4",s),...i,children:a})})});Gg.displayName="Form";var Ug=({name:e,rules:t=[],defaultValue:n,children:r})=>{let o=bl(),a=_.useId();_.useEffect(()=>(o.registerField(e,t),n!==void 0&&o.values[e]===void 0&&o.setValue(e,n),()=>{o.unregisterField(e);}),[e,t,n,o]);let s=o.getFieldState(e),i={name:e,id:`${a}-${e}`,value:s.value,error:s.error,touched:s.touched,dirty:s.dirty};return jsx(gl.Provider,{value:i,children:r})};Ug.displayName="FormField";var Wg=_.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("space-y-1.5",e),...t}));Wg.displayName="FormItem";var jg=_.forwardRef(({className:e,required:t,children:n,...r},o)=>{let{id:a,error:s,touched:i}=gs();return jsxs(wr,{ref:o,htmlFor:a,className:m(s&&i&&"text-danger",e),...r,children:[n,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});jg.displayName="FormLabel";var _g=({children:e})=>{let{name:t,id:n,error:r,touched:o}=gs(),a=bl(),s=a.getFieldState(t),i=c=>{let d=c.target,u=d.type==="checkbox"?d.checked:d.value;a.setValue(t,u);},l=()=>{a.setTouched(t,true);};return _.cloneElement(e,{id:n,name:t,value:s.value??"",onChange:i,onBlur:l,"aria-invalid":r&&o?"true":void 0,"aria-describedby":r&&o?`${n}-error`:void 0})};_g.displayName="FormControl";var Yg=_.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:m("text-xs text-muted-foreground",e),...t}));Yg.displayName="FormDescription";var Xg=_.forwardRef(({className:e,message:t,...n},r)=>{let{id:o,error:a,touched:s}=gs(),i=t??(s?a:null);return i?jsx("p",{ref:r,id:`${o}-error`,className:m("text-xs text-danger",e),role:"alert",...n,children:i}):null});Xg.displayName="FormMessage";var Zg=cva("inline-flex items-center gap-3",{variants:{size:{sm:"[&_[data-user-avatar]]:h-8 [&_[data-user-avatar]]:w-8",md:"[&_[data-user-avatar]]:h-10 [&_[data-user-avatar]]:w-10",lg:"[&_[data-user-avatar]]:h-12 [&_[data-user-avatar]]:w-12"}},defaultVariants:{size:"md"}}),Qg=_.forwardRef(({className:e,size:t,name:n,description:r,avatarUrl:o,avatarFallback:a,trailing:s,...i},l)=>{let c=a||n.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return jsxs("div",{ref:l,className:m(Zg({size:t,className:e})),...i,children:[jsxs(Cr,{"data-user-avatar":true,children:[o&&jsx(Jr,{src:o,alt:n}),jsx(Tr,{children:c})]}),jsxs("div",{className:"flex flex-col min-w-0",children:[jsx("span",{className:"text-sm font-medium leading-none truncate",children:n}),r&&jsx("span",{className:"text-sm text-muted-foreground truncate",children:r})]}),s&&jsx("div",{className:"ml-auto flex-shrink-0",children:s})]})});Qg.displayName="User";var eb=cva("font-mono",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-transparent",light:"bg-muted/50 text-foreground",flat:"bg-muted text-foreground",ghost:"bg-transparent text-foreground"},size:{sm:"px-1 py-0.5 text-xs",md:"px-1.5 py-0.5 text-sm",lg:"px-2 py-1 text-base"},radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{variant:"flat",size:"md",radius:"sm"}}),tb=_.forwardRef(({className:e,variant:t,size:n,radius:r,...o},a)=>jsx("code",{ref:a,className:m(eb({variant:t,size:n,radius:r,className:e})),...o}));tb.displayName="Code";function ab(e){let[t,n]=useState(false);return useEffect(()=>{if(e){n(e==="dark");return}let r=()=>{n(document.documentElement.classList.contains("dark"));};r();let o=new MutationObserver(r);return o.observe(document.documentElement,{attributes:true,attributeFilter:["class"]}),()=>o.disconnect()},[e]),t}var sb=_.forwardRef(({code:e,language:t="bash",showLineNumbers:n=false,className:r,noBorder:o=false,filename:a,theme:s,hideCopyButton:i=false},l)=>{let[c,d]=useState(false),f=ab(s)?themes.oneDark:themes.oneLight,p=async()=>{await navigator.clipboard.writeText(e),d(true),setTimeout(()=>d(false),2e3);};return jsxs("div",{ref:l,className:m("overflow-hidden",!o&&"rounded-lg border border-border",r),children:[a&&jsx("div",{className:"flex items-center px-4 py-2 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:jsx("span",{className:"text-sm text-muted-foreground font-mono",children:a})}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:f,code:e.trim(),language:t,children:({tokens:g,getLineProps:h,getTokenProps:v})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:g.map((b,w)=>jsxs("div",{...h({line:b}),children:[n&&jsx("span",{className:"inline-block w-8 text-zinc-400 dark:text-zinc-600 select-none text-right mr-4",children:w+1}),b.map((x,R)=>jsx("span",{...v({token:x})},R))]},w))})}),!i&&jsx("button",{onClick:p,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:c?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});sb.displayName="CodeBlock";var ib=_.forwardRef(({tabs:e,className:t,theme:n},r)=>{let[o,a]=useState(0),[s,i]=useState(false),c=ab(n)?themes.oneDark:themes.oneLight,d=async()=>{await navigator.clipboard.writeText(e[o].code),i(true),setTimeout(()=>i(false),2e3);},u=e[o],f=u.language||"bash";return jsxs("div",{ref:r,className:m("rounded-lg border border-border overflow-hidden",t),children:[jsx("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border bg-zinc-100 dark:bg-zinc-900",children:e.map((p,g)=>jsxs("button",{type:"button",onClick:()=>a(g),className:m("flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-colors cursor-pointer",o===g?"bg-zinc-200 dark:bg-zinc-800 text-zinc-900 dark:text-white":"text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-200 hover:bg-zinc-200/50 dark:hover:bg-zinc-800/50"),children:[p.icon,p.name]},p.name))}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:c,code:u.code.trim(),language:f,children:({tokens:p,getLineProps:g,getTokenProps:h})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:p.map((v,b)=>jsx("div",{...g({line:v}),children:v.map((w,x)=>jsx("span",{...h({token:w})},x))},b))})}),jsx("button",{onClick:d,type:"button",className:"absolute top-3 right-3 p-2 rounded-md transition-colors cursor-pointer bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-600 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200",title:"Copy to clipboard",children:s?jsx(Check,{className:"h-4 w-4 text-zinc-900 dark:text-white"}):jsx(Copy,{className:"h-4 w-4"})})]})]})});ib.displayName="TabbedCodeBlock";var lb=cva("relative flex items-center gap-2 font-mono rounded-lg border",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",bordered:"bg-transparent border-current",ghost:"bg-transparent border-transparent",soft:"bg-muted border-muted",surface:"bg-muted/50 border-border"},size:{sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-base"}},defaultVariants:{variant:"surface",size:"md"}}),cb=_.forwardRef(({className:e,variant:t,size:n,code:r,copyable:o=true,copyLabel:a="Copy",onCopy:s,symbol:i="$",hideSymbol:l=false,...c},d)=>{let[u,f]=_.useState(false),p=async()=>{try{await navigator.clipboard.writeText(r),f(!0),s?.(),setTimeout(()=>f(!1),2e3);}catch(g){console.error("Failed to copy:",g);}};return jsxs("div",{ref:d,className:m(lb({variant:t,size:n,className:e})),...c,children:[!l&&jsx("span",{className:"text-muted-foreground select-none",children:i}),jsx("code",{className:"flex-1 truncate",children:r}),o&&jsx("button",{type:"button",onClick:p,className:m("flex-shrink-0 rounded p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-label":u?"Copied":a,children:u?jsx(Check,{className:"h-4 w-4 text-green-500"}):jsx(Copy,{className:"h-4 w-4 text-muted-foreground"})})]})});cb.displayName="Snippet";var yl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"md"}}),db=_.forwardRef(({className:e,radius:t,src:n,alt:r,fallback:o,showSkeleton:a=true,onLoad:s,onError:i,fit:l="cover",aspectRatio:c,style:d,...u},f)=>{let[p,g]=_.useState("loading");_.useEffect(()=>{n&&g("loading");},[n]);let h=()=>{g("loaded"),s?.();},v=()=>{g("error"),i?.();},b={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"}[l];return p==="error"&&o?jsx("div",{className:m(yl({radius:t}),"flex items-center justify-center bg-muted",e),style:{aspectRatio:c,...d},children:o}):jsxs("div",{className:m(yl({radius:t}),"relative",e),style:{aspectRatio:c,...d},children:[p==="loading"&&a&&jsx(Da,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:f,src:n,alt:r,onLoad:h,onError:v,className:m("h-full w-full transition-opacity duration-300",b,p==="loading"?"opacity-0":"opacity-100"),...u})]})});db.displayName="Image";var pb=cva("flex flex-col rounded-lg border bg-background",{variants:{size:{sm:"p-1 gap-0.5",md:"p-1.5 gap-1",lg:"p-2 gap-1.5"}},defaultVariants:{size:"md"}}),fb=cva("relative flex cursor-pointer select-none items-center rounded-md outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{size:{sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"}},defaultVariants:{size:"md"}}),gb=_.createContext({value:"",onValueChange:()=>{},multiple:false,size:"md"}),bb=_.forwardRef(({className:e,size:t="md",value:n,defaultValue:r="",onValueChange:o,multiple:a=false,children:s,...i},l)=>{let[c,d]=_.useState(r),u=n??c,f=p=>{let g;if(a){let h=Array.isArray(u)?u:[u].filter(Boolean);h.includes(p)?g=h.filter(v=>v!==p):g=[...h,p];}else g=p;o?o(g):d(g);};return jsx(gb.Provider,{value:{value:u,onValueChange:f,multiple:a,size:t??"md"},children:jsx("div",{ref:l,role:"listbox","aria-multiselectable":a,className:m(pb({size:t,className:e})),...i,children:s})})});bb.displayName="Listbox";var vb=_.forwardRef(({className:e,value:t,disabled:n,icon:r,description:o,children:a,...s},i)=>{let{value:l,onValueChange:c,multiple:d,size:u}=_.useContext(gb),f=d?Array.isArray(l)&&l.includes(t):l===t,p=()=>{n||c(t);},g=h=>{(h.key==="Enter"||h.key===" ")&&!n&&(h.preventDefault(),c(t));};return jsxs("div",{ref:i,role:"option","aria-selected":f,"data-disabled":n?"":void 0,tabIndex:n?-1:0,className:m(fb({size:u}),f&&"bg-accent text-accent-foreground",e),onClick:p,onKeyDown:g,...s,children:[r&&jsx("span",{className:"mr-2 flex-shrink-0",children:r}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"truncate",children:a}),o&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:o})]}),f&&jsx(Check,{className:"ml-2 h-4 w-4 flex-shrink-0"})]})});vb.displayName="ListboxItem";var xb=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",cards:"gap-2"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),yb=cva("flex items-center gap-3 bg-background transition-all",{variants:{variant:{default:"rounded-lg border p-3",bordered:"p-3",cards:"rounded-lg border p-3 shadow-sm"},size:{sm:"p-2 text-sm",md:"p-3 text-sm",lg:"p-4 text-base"},isDragging:{true:"opacity-50 scale-[1.02] shadow-lg z-10",false:""},isDragOver:{true:"border-primary border-dashed",false:""}},defaultVariants:{variant:"default",size:"md",isDragging:false,isDragOver:false}});function TT({className:e,variant:t,size:n,items:r,onReorder:o,renderItem:a,showHandle:s=true,disabled:i=false,...l},c){let[d,u]=_.useState(null),[f,p]=_.useState(null),g=(x,R)=>{i||(u(R),x.dataTransfer.effectAllowed="move",x.dataTransfer.setData("text/plain",String(R)));},h=(x,R)=>{x.preventDefault(),!(i||d===null||d===R)&&p(R);},v=()=>{p(null);},b=(x,R)=>{if(x.preventDefault(),i||d===null||d===R){u(null),p(null);return}let C=[...r],[y]=C.splice(d,1);C.splice(R,0,y),o?.(C),u(null),p(null);},w=()=>{u(null),p(null);};return jsx("div",{ref:c,className:m(xb({variant:t,size:n,className:e})),...l,children:r.map((x,R)=>jsxs("div",{draggable:!i,onDragStart:C=>g(C,R),onDragOver:C=>h(C,R),onDragLeave:v,onDrop:C=>b(C,R),onDragEnd:w,className:m(yb({variant:t,size:n,isDragging:d===R,isDragOver:f===R}),!i&&"cursor-move"),children:[s&&jsx("div",{className:m("flex-shrink-0 text-muted-foreground",i?"opacity-30":"cursor-grab active:cursor-grabbing"),children:jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:a(x,R)})]},x.id))})}var MT=_.forwardRef(TT);var Cb=cva("absolute inset-0 z-50 flex items-center justify-center transition-opacity",{variants:{variant:{solid:"bg-background",soft:"bg-background/80 backdrop-blur-sm",ghost:"bg-background/50"},visible:{true:"opacity-100 pointer-events-auto",false:"opacity-0 pointer-events-none"}},defaultVariants:{variant:"soft",visible:true}}),ET={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},Tb=_.forwardRef(({className:e,variant:t,loading:n=true,size:r="md",spinner:o,text:a,children:s,...i},l)=>jsxs("div",{ref:l,className:m("relative",e),...i,children:[s,jsx("div",{className:m(Cb({variant:t,visible:n})),"aria-hidden":!n,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[o||jsx(Loader2,{className:m(ET[r],"animate-spin text-primary")}),a&&jsx("span",{className:"text-sm text-muted-foreground",children:a})]})})]}));Tb.displayName="LoadingOverlay";var Mb=cva("fixed top-0 left-0 z-[9999] h-0.5 transition-all duration-200 ease-out",{variants:{color:{primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"}},defaultVariants:{color:"primary"}}),Nb=_.forwardRef(({className:e,color:t,isLoading:n=false,progress:r,showSpinner:o=false,...a},s)=>{let[i,l]=_.useState(0),[c,d]=_.useState(false),u=_.useRef(null);return _.useEffect(()=>{if(r!==void 0){l(r),d(r>0&&r<100);return}return n?(d(true),l(10),u.current=setInterval(()=>{l(f=>{if(f>=90)return f;let p=Math.random()*10;return Math.min(f+p,90)});},500)):i>0&&(l(100),setTimeout(()=>{d(false),l(0);},200)),()=>{u.current&&clearInterval(u.current);}},[n,r]),!c&&r===void 0||r!==void 0&&(r<=0||r>=100)?null:jsxs(Fragment,{children:[jsx("div",{ref:s,className:m(Mb({color:t,className:e})),style:{width:`${i}%`},role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,...a,children:jsx("div",{className:"absolute right-0 h-full w-24 -translate-y-1 rotate-3 bg-inherit opacity-50 blur-sm"})}),o&&c&&jsx("div",{className:"fixed top-4 right-4 z-[9999]",children:jsx("div",{className:m("h-4 w-4 animate-spin rounded-full border-2 border-transparent",t==="primary"&&"border-t-primary",t==="secondary"&&"border-t-secondary",t==="success"&&"border-t-success",t==="warning"&&"border-t-warning",t==="danger"&&"border-t-danger",t==="info"&&"border-t-info")})})]})});Nb.displayName="NProgress";var Lb=cva("flex items-center justify-center",{variants:{variant:{spinner:"",dots:"",pulse:"",skeleton:""},size:{sm:"gap-1",md:"gap-2",lg:"gap-3"},fullScreen:{true:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",false:""}},defaultVariants:{variant:"spinner",size:"md",fullScreen:false}}),kb={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},VT={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},Sb=_.forwardRef(({className:e,variant:t="spinner",size:n="md",fullScreen:r,text:o,color:a="primary",...s},i)=>{let l={primary:"text-primary",secondary:"text-secondary",muted:"text-muted-foreground"}[a],c=()=>{switch(t){case "dots":return jsx("div",{className:"flex items-center gap-1",children:[0,1,2].map(d=>jsx("div",{className:m(VT[n||"md"],"animate-bounce rounded-full bg-current",l),style:{animationDelay:`${d*.15}s`}},d))});case "pulse":return jsx("div",{className:m(kb[n||"md"],"animate-pulse rounded-full bg-current",l)});case "skeleton":return jsxs("div",{className:"w-full space-y-2",children:[jsx("div",{className:"h-4 w-3/4 animate-pulse rounded bg-muted"}),jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-muted"}),jsx("div",{className:"h-4 w-5/6 animate-pulse rounded bg-muted"})]});default:return jsx(Loader2,{className:m(kb[n||"md"],"animate-spin",l)})}};return jsx("div",{ref:i,className:m(Lb({variant:t,size:n,fullScreen:r,className:e})),role:"status","aria-label":o||"Loading",...s,children:jsxs("div",{className:"flex flex-col items-center gap-2",children:[c(),o&&jsx("span",{className:m("text-sm",l),children:o})]})})});Sb.displayName="Loading";var zT=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),OT=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"},showPickerIcon:{true:"",false:""}},compoundVariants:[{size:"sm",showPickerIcon:true,className:"pl-3 pr-8"},{size:"sm",showPickerIcon:false,className:"px-3"},{size:"md",showPickerIcon:true,className:"pl-3 pr-10"},{size:"md",showPickerIcon:false,className:"px-3"},{size:"lg",showPickerIcon:true,className:"pl-4 pr-12"},{size:"lg",showPickerIcon:false,className:"px-4"}],defaultVariants:{size:"md",isInvalid:false,fullWidth:false,showPickerIcon:true}}),BT=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),FT=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Ts={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},Cl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},wl=(e,t)=>String(e).padStart(t,"0"),Db=(e,t)=>{if(!e)return "";let n=wl(e.getDate(),2),r=wl(e.getMonth()+1,2),o=wl(e.getFullYear(),4),a=Ts[t],s=Cl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Rs=(e,t)=>{let n=Ts[t],r=e.split(n);if(r.length!==3)return null;let o=Cl[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(r[l],10);}),isNaN(a.day)||isNaN(a.month)||isNaN(a.year)||a.month<1||a.month>12||a.day<1||a.day>31||a.year<1e3||a.year>9999)return null;let s=new Date(a.year,a.month-1,a.day);return s.getFullYear()!==a.year||s.getMonth()!==a.month-1||s.getDate()!==a.day?null:s},KT=e=>{let t=Ts[e];return Cl[e].map(r=>r==="year"?"####":"##").join(t)},ea=(e,t)=>{if(!e?.from)return "";let n=Db(e.from,t),r=e.to?Db(e.to,t):"";return n&&r?`${n} - ${r}`:n},Hb=_.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:v="dd.MM.yyyy",showPickerIcon:b=true,mode:w="text",fullWidth:x=false,numberOfMonths:R=2,align:C="start",disabled:y,placeholder:N,id:T,...k},E)=>{let M=_.useId(),P=T||M,S=`${P}-description`,H=`${P}-error`,[D,L]=_.useState(f),[V,A]=_.useState(""),[B,I]=_.useState(false),[F,K]=_.useState(false),Y=u!==void 0?u:D,q=a&&r,$=KT(v),O=Ts[v],W=" - ";_.useEffect(()=>{F||A(ea(Y,v));},[Y,v,F]);let z=le=>{u===void 0&&L(le),p?.(le);},j=le=>{z(le),A(ea(le,v)),le?.from&&le?.to&&I(false);},oe=le=>{let Be=le.target.value;Be=Be.replace(new RegExp(`[^0-9\\${O}\\s-]`,"g"),"");let me=`${$}${W}${$}`,wt=Be.replace(new RegExp(`[\\${O}\\s-]`,"g"),""),gt="",yn=0;for(let Fe=0;Fe<me.length&&yn<wt.length;Fe++)me[Fe]==="#"?(gt+=wt[yn],yn++):gt+=me[Fe];if(A(gt),gt.length===me.length){let Fe=gt.split(W);if(Fe.length===2){let on=Rs(Fe[0].trim(),v),Ct=Rs(Fe[1].trim(),v);if(on&&Ct){if(g&&(on<g||Ct<g)||h&&(on>h||Ct>h))return;on<=Ct&&z({from:on,to:Ct});}}}},ge=()=>{K(true);},G=()=>{K(false);let le=`${$}${W}${$}`;if(V.length!==le.length)A(ea(Y,v));else {let Be=V.split(W);if(Be.length!==2)A(ea(Y,v));else {let me=Rs(Be[0].trim(),v),wt=Rs(Be[1].trim(),v);(!me||!wt||me>wt)&&A(ea(Y,v));}}},Pe=()=>{y||I(true);},Z=()=>{!y&&w==="picker"&&b&&I(true);};return jsxs("div",{className:m(zT({size:s}),e),children:[t&&jsxs("label",{htmlFor:P,className:m(FT({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(ot,{open:b&&B,onOpenChange:I,children:[jsxs(an,{className:m("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:E,id:P,type:"text",inputMode:w==="text"?"numeric":void 0,value:V,onChange:w==="text"?oe:void 0,onClick:Z,onFocus:ge,onBlur:G,readOnly:w==="picker","aria-invalid":a,"aria-describedby":q?H:n?S:void 0,"aria-required":o,disabled:y,placeholder:N||`${v.toLowerCase()} - ${v.toLowerCase()}`,className:m(OT({size:s,isInvalid:a,fullWidth:x,showPickerIcon:b}),w==="picker"&&b&&"cursor-pointer",l),style:{borderColor:F||b&&B?"var(--color-foreground)":void 0},...k}),b&&jsx("button",{type:"button",onClick:Pe,disabled:y,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:m(BT({size:s}))})})]}),b&&jsx(at,{className:"w-auto p-0",align:C,children:jsx(no,{mode:"range",selected:Y,onSelect:j,numberOfMonths:R,disabled:le=>!!(g&&le<g||h&&le>h),defaultMonth:Y?.from,showMonthAndYearPickers:true})})]}),n&&!q&&jsx("p",{id:S,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),q&&jsx("p",{id:H,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Hb.displayName="DateRangePicker";var mo=e=>String(e).padStart(2,"0"),Ib=_.forwardRef(({value:e,onValueChange:t,placeholder:n="Pick a time",use24Hour:r=true,minuteStep:o=1,disabled:a=false,className:s},i)=>{let[l,c]=_.useState(false),d=r?Array.from({length:24},(x,R)=>R):Array.from({length:12},(x,R)=>R+1),u=Array.from({length:Math.floor(60/o)},(x,R)=>R*o),f=x=>{if(!x)return n;if(r)return `${mo(x.hours)}:${mo(x.minutes)}`;let R=x.hours%12||12,C=x.hours>=12?"PM":"AM";return `${mo(R)}:${mo(x.minutes)} ${C}`},p=x=>{let R=e?.minutes??0,C=x;if(!r&&e){let y=e.hours>=12;y&&x!==12?C=x+12:!y&&x===12&&(C=0);}t?.({hours:C,minutes:R});},g=x=>{let R=e?.hours??0;t?.({hours:R,minutes:x});},h=x=>{if(!e)return;let R=e.hours;x==="AM"&&e.hours>=12?R=e.hours-12:x==="PM"&&e.hours<12&&(R=e.hours+12),t?.({hours:R,minutes:e.minutes});},v=()=>{let x=new Date;t?.({hours:x.getHours(),minutes:x.getMinutes()});},b=e?e.hours>=12?"PM":"AM":void 0,w=e?r?e.hours:e.hours%12||12:void 0;return jsxs(ot,{open:l,onOpenChange:c,children:[jsxs(qn,{ref:i,disabled:a,className:m("inline-flex items-center justify-start gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-normal hover:bg-accent hover:text-accent-foreground w-full text-left",!e&&"text-muted-foreground",a&&"cursor-not-allowed opacity-50",s),children:[jsx(Clock,{className:"h-4 w-4"}),f(e)]}),jsxs(at,{className:"w-auto p-0",align:"start",children:[jsxs("div",{className:"flex",children:[jsxs("div",{className:"flex flex-col",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Hour"}),jsx(De,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:d.map(x=>jsx(ae,{variant:w===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>p(x),children:mo(x)},x))})})]}),jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"Min"}),jsx(De,{className:"h-[200px]",children:jsx("div",{className:"flex flex-col p-1",children:u.map(x=>jsx(ae,{variant:e?.minutes===x?"solid":"ghost",size:"sm",className:"h-8 w-12 justify-center",onClick:()=>g(x),children:mo(x)},x))})})]}),!r&&jsxs("div",{className:"flex flex-col border-l",children:[jsx("div",{className:"border-b px-3 py-2 text-center text-xs font-medium text-muted-foreground",children:"\xA0"}),jsxs("div",{className:"flex flex-col gap-1 p-1",children:[jsx(ae,{variant:b==="AM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("AM"),children:"AM"}),jsx(ae,{variant:b==="PM"?"solid":"ghost",size:"sm",className:"h-8 w-12",onClick:()=>h("PM"),children:"PM"})]})]})]}),jsxs("div",{className:"flex justify-between border-t p-2",children:[jsx(ae,{variant:"ghost",size:"sm",onClick:v,children:"Now"}),jsx(ae,{size:"sm",onClick:()=>c(false),children:"Done"})]})]})]})});Ib.displayName="TimePicker";var Vb=cva("overflow-auto",{variants:{variant:{default:"",bordered:"border rounded-lg",cards:""}},defaultVariants:{variant:"default"}});function UT({className:e,variant:t,items:n,itemHeight:r,height:o,overscan:a=3,renderItem:s,getItemKey:i,gap:l=0,onScrollChange:c,...d},u){let f=_.useRef(null),[p,g]=_.useState(0);_.useImperativeHandle(u,()=>f.current);let h=n.length*(r+l)-l,v=r+l,b=Math.max(0,Math.floor(p/v)-a),w=Math.ceil(o/v)+2*a,x=Math.min(n.length-1,b+w),R=y=>{let N=y.currentTarget.scrollTop;g(N),c?.(N);},C=_.useMemo(()=>{let y=[];for(let N=b;N<=x;N++)n[N]!==void 0&&y.push({item:n[N],index:N,style:{position:"absolute",top:N*v,left:0,right:0,height:r}});return y},[n,b,x,v,r]);return jsx("div",{ref:f,className:m(Vb({variant:t,className:e})),style:{height:o,position:"relative"},onScroll:R,...d,children:jsx("div",{style:{height:h,position:"relative"},children:C.map(({item:y,index:N,style:T})=>jsx("div",{style:T,children:s(y,N)},i?i(y,N):N))})})}var WT=_.forwardRef(UT);var zb=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),Ml=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),Ob=_.forwardRef(({className:e,variant:t,size:n,children:r,onLoadMore:o,hasMore:a,isLoading:s=false,loader:i,threshold:l=100,rootMargin:c,useWindow:d=false,endMessage:u,...f},p)=>{let g=_.useRef(null),h=_.useRef(null),v=_.useRef(false);_.useImperativeHandle(p,()=>g.current),_.useEffect(()=>{let w=h.current;if(!w)return;let x=new IntersectionObserver(R=>{let[C]=R;C.isIntersecting&&a&&!s&&!v.current&&(v.current=true,Promise.resolve(o()).finally(()=>{v.current=false;}));},{root:d?null:g.current,rootMargin:c||`${l}px`,threshold:0});return x.observe(w),()=>{x.disconnect();}},[a,s,o,l,c,d]);let b=jsx("div",{className:m(Ml({size:n})),children:jsx(Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})});return jsxs("div",{ref:g,className:m(zb({variant:t,className:e})),...f,children:[r,jsx("div",{ref:h,className:"h-px w-full"}),s&&(i||b),!a&&!s&&u&&jsx("div",{className:m(Ml({size:n}),"text-muted-foreground text-sm"),children:u})]})});Ob.displayName="InfiniteScroll";var rM=e=>e.map(t=>typeof t=="string"?{src:t}:t),Nl=_.forwardRef(({images:e,open:t,onOpenChange:n,initialIndex:r=0,onIndexChange:o,trigger:a,showThumbnails:s=true,showZoom:i=true,showRotate:l=true,showDownload:c=true,showFullscreen:d=true,showNavigation:u=true,showCounter:f=true,closeOnBackdropClick:p=true,className:g},h)=>{let v=_.useMemo(()=>rM(e),[e]),[b,w]=_.useState(r),[x,R]=_.useState(1),[C,y]=_.useState(0),[N,T]=_.useState(false),[k,E]=_.useState(false),[M,P]=_.useState({x:0,y:0}),[S,H]=_.useState({x:0,y:0}),[D,L]=_.useState(false),V=_.useRef(null),A=v[b];_.useEffect(()=>{L(true);},[]),_.useEffect(()=>{w(r);},[r]),_.useEffect(()=>{o?.(b);},[b,o]),_.useEffect(()=>{R(1),y(0),P({x:0,y:0});},[b]),_.useEffect(()=>{if(t)return Gt(),()=>Ut()},[t]);let B=_.useCallback(()=>{w(Z=>Z>0?Z-1:v.length-1);},[v.length]),I=_.useCallback(()=>{w(Z=>Z<v.length-1?Z+1:0);},[v.length]),F=()=>{R(Z=>Math.min(Z+.5,4));},K=()=>{R(Z=>{let le=Math.max(Z-.5,.5);return le===1&&P({x:0,y:0}),le});},Y=()=>{y(Z=>(Z+90)%360);},q=async()=>{if(A)try{let le=await(await fetch(A.src)).blob(),Be=URL.createObjectURL(le),me=document.createElement("a");me.href=Be,me.download=A.alt||`image-${b+1}`,document.body.appendChild(me),me.click(),document.body.removeChild(me),URL.revokeObjectURL(Be);}catch{window.open(A.src,"_blank");}},$=async()=>{if(V.current)if(N)try{await document.exitFullscreen(),T(!1);}catch{}else try{await V.current.requestFullscreen(),T(!0);}catch{}},O=Z=>{x>1&&(E(true),H({x:Z.clientX-M.x,y:Z.clientY-M.y}));},W=Z=>{k&&x>1&&P({x:Z.clientX-S.x,y:Z.clientY-S.y});},z=()=>{E(false);},j=()=>{n?.(false);},oe=Z=>{p&&Z.target===Z.currentTarget&&j();},ge=_.useCallback(Z=>{switch(Z.key){case "ArrowLeft":B();break;case "ArrowRight":I();break;case "Escape":n?.(false);break;case "+":case "=":F();break;case "-":K();break}},[B,I,n]);if(_.useEffect(()=>{if(t)return window.addEventListener("keydown",ge),()=>window.removeEventListener("keydown",ge)},[t,ge]),_.useEffect(()=>{let Z=()=>{T(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",Z),()=>document.removeEventListener("fullscreenchange",Z)},[]),v.length===0)return null;let G=a?_.isValidElement(a)?_.cloneElement(a,{onClick:Z=>{a.props.onClick?.(Z),n?.(true);}}):jsx("button",{type:"button",onClick:()=>n?.(true),children:a}):null;return jsxs(Fragment,{children:[G,!D||!t?null:Oa.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/90 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":t?"open":"closed",onClick:oe}),jsxs("div",{ref:h,className:m("fixed inset-0 z-50 flex flex-col outline-none",g),children:[jsxs("div",{className:"flex items-center justify-between p-4 text-white",children:[jsxs("div",{className:"flex items-center gap-2",children:[f&&v.length>1&&jsxs("span",{className:"text-sm",children:[b+1," / ",v.length]}),A?.title&&jsx("span",{className:"ml-4 text-sm font-medium",children:A.title})]}),jsxs("div",{className:"flex items-center gap-1",children:[i&&jsxs(Fragment,{children:[jsx("button",{onClick:K,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom out",children:jsx(ZoomOut,{className:"h-5 w-5"})}),jsxs("span",{className:"min-w-[3rem] text-center text-sm",children:[Math.round(x*100),"%"]}),jsx("button",{onClick:F,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Zoom in",children:jsx(ZoomIn,{className:"h-5 w-5"})})]}),l&&jsx("button",{onClick:Y,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Rotate",children:jsx(RotateCw,{className:"h-5 w-5"})}),c&&jsx("button",{onClick:q,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:"Download",children:jsx(Download,{className:"h-5 w-5"})}),d&&jsx("button",{onClick:$,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:N?"Exit fullscreen":"Fullscreen",children:N?jsx(Minimize2,{className:"h-5 w-5"}):jsx(Maximize2,{className:"h-5 w-5"})}),jsxs("button",{onClick:j,className:"rounded-full p-2 hover:bg-white/10 transition-colors ml-2",children:[jsx(X,{className:"h-5 w-5"}),jsx("span",{className:"sr-only",children:"Close"})]})]})]}),jsxs("div",{ref:V,className:"relative flex-1 flex items-center justify-center overflow-hidden",onMouseDown:O,onMouseMove:W,onMouseUp:z,onMouseLeave:z,children:[u&&v.length>1&&jsxs(Fragment,{children:[jsx("button",{onClick:B,className:"absolute left-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronLeft,{className:"h-6 w-6"})}),jsx("button",{onClick:I,className:"absolute right-4 z-10 rounded-full bg-black/50 p-3 text-white hover:bg-black/70 transition-colors",children:jsx(ChevronRight,{className:"h-6 w-6"})})]}),jsx("img",{src:A?.src,alt:A?.alt||"",className:m("max-h-full max-w-full object-contain transition-transform duration-200",k?"cursor-grabbing":x>1?"cursor-grab":""),style:{transform:`translate(${M.x}px, ${M.y}px) scale(${x}) rotate(${C}deg)`},draggable:false})]}),A?.description&&jsx("div",{className:"p-4 text-center text-white text-sm",children:A.description}),s&&v.length>1&&jsx("div",{className:"flex justify-center gap-2 p-4 overflow-x-auto",children:v.map((Z,le)=>jsx("button",{onClick:()=>w(le),className:m("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",b===le?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:Z.src,alt:Z.alt||`Thumbnail ${le+1}`,className:"h-full w-full object-cover"})},le))})]})]}),document.body)]})});Nl.displayName="ImageViewer";var Fb=({children:e,images:t,index:n=0,className:r})=>{let[o,a]=_.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:m("cursor-zoom-in",r),children:e}),jsx(Nl,{images:t,open:o,onOpenChange:a,initialIndex:n})]})};Fb.displayName="ImageViewerTrigger";var Kb=cva("absolute rounded-full border-2 border-background",{variants:{color:{default:"bg-muted-foreground",primary:"bg-primary",secondary:"bg-secondary",success:"bg-success",warning:"bg-warning",danger:"bg-danger"},size:{sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3"},position:{"top-right":"top-0 right-0 -translate-y-1/3 translate-x-1/3","top-left":"top-0 left-0 -translate-y-1/3 -translate-x-1/3","bottom-right":"bottom-0 right-0 translate-y-1/3 translate-x-1/3","bottom-left":"bottom-0 left-0 translate-y-1/3 -translate-x-1/3"},ping:{true:"",false:""}},defaultVariants:{color:"primary",size:"md",position:"top-right",ping:false}}),$b=_.forwardRef(({className:e,color:t,size:n,position:r,ping:o,content:a,show:s=true,offset:i,style:l,...c},d)=>{if(!s)return null;let u=a!=null;return jsxs("span",{ref:d,className:m(Kb({color:t,size:u?void 0:n,position:r,ping:o}),u&&"flex h-auto w-auto min-w-[1.25rem] items-center justify-center px-1 py-0.5 text-[10px] font-medium text-white",e),style:{...l,...i!==void 0&&{transform:`translate(${r?.includes("right")?i:-i}px, ${r?.includes("top")?-i:i}px)`}},...c,children:[o&&jsx("span",{className:m("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75",t==="default"&&"bg-muted-foreground",t==="primary"&&"bg-primary",t==="secondary"&&"bg-secondary",t==="success"&&"bg-success",t==="warning"&&"bg-warning",t==="danger"&&"bg-danger")}),a]})});$b.displayName="Indicator";var Gb=_.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:m("relative inline-flex",e),...n,children:t}));Gb.displayName="IndicatorWrapper";var Wb=cva("relative overflow-auto",{variants:{orientation:{vertical:"",horizontal:"",both:""},size:{sm:"",md:"",lg:""}},defaultVariants:{orientation:"vertical",size:"md"}}),jb=_.forwardRef(({className:e,orientation:t,size:n,hideScrollbar:r=false,shadowColor:o="rgba(0, 0, 0, 0.1)",children:a,...s},i)=>{let l=_.useRef(null),[c,d]=_.useState({top:false,bottom:false,left:false,right:false});_.useImperativeHandle(i,()=>l.current);let u=_.useCallback(()=>{let b=l.current;if(!b)return;let{scrollTop:w,scrollLeft:x,scrollHeight:R,scrollWidth:C,clientHeight:y,clientWidth:N}=b;d({top:w>0,bottom:w<R-y-1,left:x>0,right:x<C-N-1});},[]);_.useEffect(()=>{let b=l.current;if(b)return u(),b.addEventListener("scroll",u),window.addEventListener("resize",u),()=>{b.removeEventListener("scroll",u),window.removeEventListener("resize",u);}},[u]);let p={sm:"20px",md:"40px",lg:"60px"}[n??"md"],g=t==="vertical"||t==="both",h=t==="horizontal"||t==="both",v={maskImage:[g&&c.top&&`linear-gradient(to bottom, transparent, black ${p})`,g&&c.bottom&&`linear-gradient(to top, transparent, black ${p})`,h&&c.left&&`linear-gradient(to right, transparent, black ${p})`,h&&c.right&&`linear-gradient(to left, transparent, black ${p})`].filter(Boolean).join(", ")||void 0,maskComposite:"intersect",WebkitMaskComposite:"source-in"};return jsx("div",{ref:l,className:m(Wb({orientation:t,size:n}),r&&"scrollbar-hide [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",e),style:v,...s,children:a})});jb.displayName="ScrollShadow";var _b=cva("inline-flex items-center justify-center font-mono font-medium",{variants:{variant:{default:"rounded border border-border bg-muted text-muted-foreground shadow-sm",bordered:"rounded border border-current text-foreground",ghost:"text-muted-foreground"},size:{sm:"min-w-[1.25rem] px-1 py-0.5 text-[10px]",md:"min-w-[1.5rem] px-1.5 py-0.5 text-xs",lg:"min-w-[2rem] px-2 py-1 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),cM={cmd:"\u2318",command:"\u2318",meta:"\u2318",ctrl:"\u2303",control:"\u2303",alt:"\u2325",option:"\u2325",shift:"\u21E7",enter:"\u21B5",return:"\u21B5",backspace:"\u232B",delete:"\u2326",escape:"\u238B",esc:"\u238B",tab:"\u21E5",space:"\u2423",up:"\u2191",down:"\u2193",left:"\u2190",right:"\u2192",pageup:"\u21DE",pagedown:"\u21DF",home:"\u2912",end:"\u2913",capslock:"\u21EA"},dM={cmd:"meta",command:"meta",ctrl:"control",alt:"alt",option:"alt",shift:"shift",enter:"enter",return:"enter",backspace:"backspace",delete:"delete",escape:"escape",esc:"escape",tab:"tab",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",pageup:"pageup",pagedown:"pagedown",home:"home",end:"end"},uM=e=>{let t=e.toLowerCase();return cM[t]||e.toUpperCase()},na=e=>{let t=e.toLowerCase();return dM[t]||t},ks=e=>{let t=na(e);return ["meta","control","alt","shift"].includes(t)},Yb=_.forwardRef(({className:e,variant:t,size:n,keys:r,children:o,onPress:a,disabled:s,preventDefault:i=true,...l},c)=>{_.useEffect(()=>{if(!a||!r||s)return;let u=Array.isArray(r)?r:[r],f=u.filter(ks).map(na),p=u.filter(h=>!ks(h)).map(na),g=h=>{let v=f.includes("meta")===h.metaKey,b=f.includes("control")===h.ctrlKey,w=f.includes("alt")===h.altKey,x=f.includes("shift")===h.shiftKey,R=p.length===0||p.includes(h.key.toLowerCase());v&&b&&w&&x&&R&&(i&&h.preventDefault(),a(h));};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[r,a,s,i]);let d=()=>r?(Array.isArray(r)?r:[r]).map((f,p)=>jsxs(_.Fragment,{children:[p>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:uM(f)})]},p)):o;return jsx("kbd",{ref:c,className:m(_b({variant:t,size:n}),s&&"opacity-50",e),...l,children:d()})});Yb.displayName="Kbd";function mM(e,t,n={}){let{disabled:r=false,preventDefault:o=true}=n;_.useEffect(()=>{if(r)return;let a=Array.isArray(e)?e:[e],s=a.filter(ks).map(na),i=a.filter(c=>!ks(c)).map(na),l=c=>{let d=s.includes("meta")===c.metaKey,u=s.includes("control")===c.ctrlKey,f=s.includes("alt")===c.altKey,p=s.includes("shift")===c.shiftKey,g=i.length===0||i.includes(c.key.toLowerCase());d&&u&&f&&p&&g&&(o&&c.preventDefault(),t(c));};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t,r,o]);}var Xb=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),qb=_.forwardRef(({className:e,size:t,value:n,successDuration:r=2e3,onCopySuccess:o,onCopyError:a,copyIcon:s,successIcon:i,...l},c)=>{let[d,u]=_.useState(false),p={sm:14,md:16,lg:20}[t??"md"],g=async()=>{try{await navigator.clipboard.writeText(n),u(!0),o?.(),setTimeout(()=>{u(!1);},r);}catch(h){a?.(h);}};return jsx("button",{ref:c,type:"button",className:m(Xb({size:t}),e),onClick:g,"aria-label":d?"Copied":"Copy to clipboard",...l,children:d?i??jsx(Check,{className:"text-success",style:{width:p,height:p}}):s??jsx(Copy,{style:{width:p,height:p}})})});qb.displayName="CopyButton";var Qb=cva("flex flex-col bg-background",{variants:{variant:{default:"border rounded-lg",bordered:"border-2 rounded-lg",ghost:""},size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{variant:"default",size:"md"}}),yM=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"}],RM=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wM=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function CM(e,t,n){let r=new Date(e,t,1),o=new Date(e,t+1,0),a=[],s=r.getDay()-n;s<0&&(s+=7);for(let l=s-1;l>=0;l--)a.push(new Date(e,t,-l));for(let l=1;l<=o.getDate();l++)a.push(new Date(e,t,l));let i=42-a.length;for(let l=1;l<=i;l++)a.push(new Date(e,t+1,l));return a}function TM(e,t){let n=[],o=e.getDay()-t;o<0&&(o+=7);let a=new Date(e);a.setDate(e.getDate()-o);for(let s=0;s<7;s++){let i=new Date(a);i.setDate(a.getDate()+s),n.push(i);}return n}function Ls(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Es(e){return Ls(e,new Date)}function Zb(e,t){return e.filter(n=>{let r=new Date(n.start),o=new Date(n.end);return Ls(r,t)||Ls(o,t)||r<t&&o>t})}var Jb=_.forwardRef(({className:e,variant:t,size:n,events:r=[],view:o="month",onViewChange:a,viewOptions:s=yM,date:i,onDateChange:l,onEventClick:c,onSlotClick:d,weekStartsOn:u=0,locale:f="en-US",...p},g)=>{let[h,v]=_.useState(new Date),b=i??h,w=M=>{l?l(M):v(M);},x=u===1?wM:RM,R=()=>{let M=new Date(b);o==="month"?M.setMonth(M.getMonth()-1):o==="week"?M.setDate(M.getDate()-7):M.setDate(M.getDate()-1),w(M);},C=()=>{let M=new Date(b);o==="month"?M.setMonth(M.getMonth()+1):o==="week"?M.setDate(M.getDate()+7):M.setDate(M.getDate()+1),w(M);},y=()=>{w(new Date);},N=()=>o==="day"?b.toLocaleDateString(f,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):b.toLocaleDateString(f,{year:"numeric",month:"long"}),T=()=>{let M=CM(b.getFullYear(),b.getMonth(),u);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:x.map(P=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:P},P))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:M.map((P,S)=>{let H=Zb(r,P),D=P.getMonth()===b.getMonth();return jsxs("div",{className:m("min-h-[80px] border-b border-r p-1 cursor-pointer hover:bg-accent/50 transition-colors",!D&&"bg-muted/30"),onClick:()=>d?.(P),children:[jsx("div",{className:m("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",Es(P)&&"bg-primary text-primary-foreground",!D&&"text-muted-foreground"),children:P.getDate()}),jsxs("div",{className:"space-y-0.5",children:[H.slice(0,3).map(L=>jsx("div",{className:"text-xs px-1 py-0.5 rounded truncate cursor-pointer hover:opacity-80",style:{backgroundColor:L.color||"hsl(var(--primary))",color:"white"},onClick:V=>{V.stopPropagation(),c?.(L);},children:L.title},L.id)),H.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",H.length-3," more"]})]})]},S)})})]})},k=()=>{let M=TM(b,u),P=Array.from({length:24},(S,H)=>H);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxs("div",{className:"grid grid-cols-[60px_repeat(7,1fr)] border-b",children:[jsx("div",{className:"p-2"}),M.map((S,H)=>jsxs("div",{className:m("p-2 text-center border-l",Es(S)&&"bg-primary/10"),children:[jsx("div",{className:"text-xs text-muted-foreground",children:x[H]}),jsx("div",{className:m("text-lg font-semibold",Es(S)&&"text-primary"),children:S.getDate()})]},H))]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:P.map(S=>jsxs(_.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[S.toString().padStart(2,"0"),":00"]}),M.map((H,D)=>{let L=new Date(H);L.setHours(S,0,0,0);let V=r.filter(A=>{let B=new Date(A.start);return Ls(B,H)&&B.getHours()===S});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>d?.(L),children:V.map(A=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:A.color||"hsl(var(--primary))",color:"white"},onClick:B=>{B.stopPropagation(),c?.(A);},children:A.title},A.id))},D)})]},S))})})]})},E=()=>{let M=Array.from({length:24},(S,H)=>H),P=Zb(r,b);return jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsx("div",{className:"p-4 border-b text-center",children:jsx("div",{className:m("inline-flex items-center justify-center w-12 h-12 rounded-full text-2xl font-semibold",Es(b)&&"bg-primary text-primary-foreground"),children:b.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:M.map(S=>{let H=new Date(b);H.setHours(S,0,0,0);let D=P.filter(L=>new Date(L.start).getHours()===S);return jsxs(_.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[S.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>d?.(H),children:D.map(L=>jsx("div",{className:"absolute inset-x-1 top-0.5 text-xs px-2 py-1 rounded truncate cursor-pointer",style:{backgroundColor:L.color||"hsl(var(--primary))",color:"white"},onClick:V=>{V.stopPropagation(),c?.(L);},children:L.title},L.id))})]},S)})})})]})};return jsxs("div",{ref:g,className:m(Qb({variant:t,size:n,className:e})),...p,children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsx("h2",{className:"text-lg font-semibold",children:N()}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(ae,{variant:"bordered",size:"sm",onClick:y,children:"Today"}),jsx(ae,{variant:"bordered",size:"sm",isIconOnly:true,onClick:R,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(ae,{variant:"bordered",size:"sm",isIconOnly:true,onClick:C,children:jsx(ChevronRight,{className:"h-4 w-4"})}),jsx(Va,{options:s,value:o,onValueChange:M=>a?.(M),className:"w-[120px]"})]})]}),o==="month"&&T(),o==="week"&&k(),o==="day"&&E()]})});Jb.displayName="FullCalendar";var Is=({active:e,payload:t,label:n})=>!e||!t||!t.length?null:jsxs("div",{className:"border bg-card text-card-foreground shadow-sm rounded-lg p-3 min-w-[120px]",children:[n&&jsx("p",{className:"text-sm font-medium mb-2 text-card-foreground",children:n}),jsx("div",{className:"space-y-1",children:t.map((r,o)=>jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsx("span",{className:"text-sm",style:{color:r.color},children:r.name}),jsx("span",{className:"text-sm font-medium text-card-foreground",children:typeof r.value=="number"?r.value.toLocaleString():r.value})]},o))})]}),oa=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),aa=["hsl(var(--primary))","hsl(var(--chart-1, 220 70% 50%))","hsl(var(--chart-2, 160 60% 45%))","hsl(var(--chart-3, 30 80% 55%))","hsl(var(--chart-4, 280 65% 60%))"],ev=_.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=aa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},u)=>jsx("div",{ref:u,className:m(oa({size:t,className:e})),...d,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(LineChart,{data:n,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(Is,{})}),s&&jsx(Legend,{}),r.map((f,p)=>jsx(Line,{type:c,dataKey:f,stroke:o[p%o.length],strokeWidth:2,dot:{fill:o[p%o.length],strokeWidth:0},activeDot:{r:6}},f))]})})}));ev.displayName="LineChart";var tv=_.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=aa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,layout:d="horizontal",...u},f)=>jsx("div",{ref:f,className:m(oa({size:t,className:e})),...u,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(BarChart,{data:n,layout:d,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:d==="horizontal"?l:void 0,type:d==="horizontal"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{dataKey:d==="vertical"?l:void 0,type:d==="vertical"?"category":"number",className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(Is,{})}),s&&jsx(Legend,{}),r.map((p,g)=>jsx(Bar,{dataKey:p,fill:o[g%o.length],stackId:c?"stack":void 0,radius:[4,4,0,0]},p))]})})}));tv.displayName="BarChart";var nv=_.forwardRef(({className:e,size:t,data:n,dataKey:r="value",nameKey:o="name",colors:a=aa,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...u},f)=>jsx("div",{ref:f,className:m(oa({size:t,className:e})),...u,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{content:jsx(Is,{})}),l&&jsx(Legend,{}),jsx(Pie,{data:n,dataKey:r,nameKey:o,cx:"50%",cy:"50%",innerRadius:s,outerRadius:i,label:d,labelLine:d,children:n.map((p,g)=>jsx(Cell,{fill:a[g%a.length]},`cell-${g}`))})]})})}));nv.displayName="PieChart";var rv=_.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=aa,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,curveType:d="monotone",...u},f)=>jsx("div",{ref:f,className:m(oa({size:t,className:e})),...u,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(AreaChart,{data:n,children:[a&&jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-muted"}),jsx(XAxis,{dataKey:l,className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),jsx(YAxis,{className:"text-xs fill-muted-foreground",tickLine:false,axisLine:false}),i&&jsx(Tooltip,{content:jsx(Is,{})}),s&&jsx(Legend,{}),r.map((p,g)=>jsx(Area,{type:d,dataKey:p,stroke:o[g%o.length],fill:o[g%o.length],fillOpacity:.3,stackId:c?"stack":void 0},p))]})})}));rv.displayName="AreaChart";var sv=cva("flex gap-4 overflow-x-auto p-4",{variants:{variant:{default:"bg-muted/30",bordered:"border rounded-lg bg-background",ghost:""}},defaultVariants:{variant:"default"}}),iv=cva("flex flex-col min-w-[280px] w-[280px] rounded-lg",{variants:{variant:{default:"bg-muted/50",bordered:"border bg-background",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),Il=cva("rounded-lg p-3 cursor-grab active:cursor-grabbing transition-all",{variants:{variant:{default:"bg-background border shadow-sm hover:shadow-md",bordered:"border-2 bg-background hover:border-primary/50",ghost:"bg-muted/50 hover:bg-muted"},isDragging:{true:"opacity-50 scale-[1.02] shadow-lg",false:""}},defaultVariants:{variant:"default",isDragging:false}});function _M({card:e,columnId:t,variant:n,renderCard:r,onCardClick:o}){let{attributes:a,listeners:s,setNodeRef:i,transform:l,transition:c,isDragging:d}=useSortable({id:e.id,data:{columnId:t}}),u={transform:CSS.Transform.toString(l),transition:c};return jsx("div",{ref:i,style:u,className:m(Il({variant:n,isDragging:d})),onClick:()=>o?.(e,t),...a,...s,children:r?r(e,t):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:e.title}),e.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:e.description})]})]})})}function YM({column:e,variant:t,renderCard:n,onCardClick:r,onAddCard:o,showAddCard:a,columnHeight:s}){return jsxs("div",{className:m(iv({variant:t})),children:[jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[jsxs("div",{className:"flex items-center gap-2",children:[e.color&&jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),jsx("h3",{className:"font-semibold text-sm",children:e.title}),jsx("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:e.cards.length})]}),a&&jsx(ae,{variant:"ghost",size:"sm",isIconOnly:true,className:"h-7 w-7",onClick:()=>o?.(e.id),children:jsx(Plus,{className:"h-4 w-4"})})]}),jsx(De,{style:{height:s},children:jsxs("div",{className:"p-2 space-y-2",children:[jsx(SortableContext,{items:e.cards.map(i=>i.id),strategy:verticalListSortingStrategy,children:e.cards.map(i=>jsx(_M,{card:i,columnId:e.id,variant:t,renderCard:n,onCardClick:r},i.id))}),e.cards.length===0&&jsx("div",{className:"h-20 border-2 border-dashed rounded-lg flex items-center justify-center text-muted-foreground text-sm",children:"Drop here"})]})})]})}var lv=_.forwardRef(({className:e,variant:t,columns:n,onCardMove:r,onCardClick:o,onAddCard:a,renderCard:s,showAddCard:i=true,columnHeight:l=500,...c},d)=>{let[u,f]=_.useState(null),[p,g]=_.useState(null),h=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),v=R=>n.find(C=>C.cards.some(y=>y.id===R));return jsxs(DndContext,{sensors:h,collisionDetection:closestCorners,onDragStart:R=>{let{active:C}=R,y=v(C.id);if(y){let N=y.cards.find(T=>T.id===C.id);N&&(f(N),g(y.id));}},onDragOver:R=>{let{active:C,over:y}=R;if(!y)return;let N=C.id,T=y.id,k=v(N),E=v(T)||n.find(S=>S.id===T);if(!k||!E||k.id===E.id)return;let M=E.cards.findIndex(S=>S.id===T),P=M===-1?E.cards.length:M;r?.(N,k.id,E.id,P);},onDragEnd:R=>{let{active:C,over:y}=R;if(y&&C.id!==y.id){let N=v(C.id),T=v(y.id)||n.find(k=>k.id===y.id);if(N&&T){let k=T.cards.findIndex(M=>M.id===y.id),E=k===-1?T.cards.length:k;r?.(C.id,N.id,T.id,E);}}f(null),g(null);},children:[jsx("div",{ref:d,className:m(sv({variant:t,className:e})),...c,children:n.map(R=>jsx(YM,{column:R,variant:t,renderCard:s,onCardClick:o,onAddCard:a,showAddCard:i,columnHeight:l},R.id))}),jsx(DragOverlay,{children:u&&p&&jsx("div",{className:m(Il({variant:t,isDragging:true})),children:s?s(u,p):jsxs("div",{className:"flex items-start gap-2",children:[jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 mt-0.5"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"font-medium text-sm truncate",children:u.title}),u.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:u.description})]})]})})})]})});lv.displayName="KanbanBoard";var cv=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),dv=_.createContext(null);function As(){let e=_.useContext(dv);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var uv=_.forwardRef(({className:e,variant:t,children:n,opts:r,plugins:o,orientation:a="horizontal",showArrows:s=true,showDots:i=true,setApi:l,...c},d)=>{let[u,f]=XM({...r,axis:a==="horizontal"?"x":"y"},o),[p,g]=_.useState(false),[h,v]=_.useState(false),[b,w]=_.useState(0),[x,R]=_.useState([]),C=_.useCallback(E=>{E&&(w(E.selectedScrollSnap()),g(E.canScrollPrev()),v(E.canScrollNext()));},[]),y=_.useCallback(()=>{f?.scrollPrev();},[f]),N=_.useCallback(()=>{f?.scrollNext();},[f]),T=_.useCallback(E=>{f?.scrollTo(E);},[f]),k=_.useCallback(E=>{E.key==="ArrowLeft"?(E.preventDefault(),y()):E.key==="ArrowRight"&&(E.preventDefault(),N());},[y,N]);return _.useEffect(()=>{!f||!l||l(f);},[f,l]),_.useEffect(()=>{if(f)return R(f.scrollSnapList()),C(f),f.on("reInit",C),f.on("select",C),()=>{f?.off("select",C);}},[f,C]),jsx(dv.Provider,{value:{carouselRef:u,api:f,scrollPrev:y,scrollNext:N,canScrollPrev:p,canScrollNext:h,selectedIndex:b,scrollSnaps:x,scrollTo:T,orientation:a},children:jsxs("div",{ref:d,className:m(cv({variant:t,className:e})),onKeyDownCapture:k,role:"region","aria-roledescription":"carousel",...c,children:[jsx("div",{ref:u,className:"overflow-hidden",children:jsx("div",{className:m("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col"),children:n})}),s&&jsxs(Fragment,{children:[jsx(Vl,{}),jsx(Al,{})]}),i&&x.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:x.map((E,M)=>jsx("button",{className:m("w-2 h-2 rounded-full transition-all",M===b?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>T(M),"aria-label":`Go to slide ${M+1}`},M))})]})})});uv.displayName="Carousel";var mv=_.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex",e),...t}));mv.displayName="CarouselContent";var pv=_.forwardRef(({className:e,basis:t="basis-full",...n},r)=>{let{orientation:o}=As();return jsx("div",{ref:r,role:"group","aria-roledescription":"slide",className:m("min-w-0 shrink-0 grow-0",o==="horizontal"?"pl-4":"pt-4",t,e),...n})});pv.displayName="CarouselItem";var Vl=_.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollPrev:s,canScrollPrev:i}=As();return jsxs(ae,{ref:a,variant:t,size:n,isIconOnly:r,className:m("absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!i,onClick:s,...o,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Previous slide"})]})});Vl.displayName="CarouselPrevious";var Al=_.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollNext:s,canScrollNext:i}=As();return jsxs(ae,{ref:a,variant:t,size:n,isIconOnly:r,className:m("absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),disabled:!i,onClick:s,...o,children:[jsx(ChevronRight,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Next slide"})]})});Al.displayName="CarouselNext";var fv=cva("flex flex-col bg-popover border rounded-lg shadow-md",{variants:{size:{sm:"w-64 h-72",md:"w-80 h-96",lg:"w-96 h-[480px]"}},defaultVariants:{size:"md"}}),zs={recent:{icon:"\u{1F550}",name:"Recent"},smileys:{icon:"\u{1F600}",name:"Smileys & Emotion"},people:{icon:"\u{1F44B}",name:"People & Body"},animals:{icon:"\u{1F43B}",name:"Animals & Nature"},food:{icon:"\u{1F354}",name:"Food & Drink"},travel:{icon:"\u{1F697}",name:"Travel & Places"},activities:{icon:"\u26BD",name:"Activities"},objects:{icon:"\u{1F4A1}",name:"Objects"},symbols:{icon:"\u2764\uFE0F",name:"Symbols"},flags:{icon:"\u{1F3F3}\uFE0F",name:"Flags"}},Ol={smileys:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F923}","\u{1F602}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60A}","\u{1F607}","\u{1F970}","\u{1F60D}","\u{1F929}","\u{1F618}","\u{1F617}","\u263A\uFE0F","\u{1F61A}","\u{1F60B}","\u{1F61B}","\u{1F61C}","\u{1F92A}","\u{1F61D}","\u{1F911}","\u{1F917}","\u{1F92D}","\u{1F92B}","\u{1F914}","\u{1F910}","\u{1F928}","\u{1F610}","\u{1F611}","\u{1F636}","\u{1F60F}","\u{1F612}","\u{1F644}","\u{1F62C}","\u{1F925}","\u{1F60C}","\u{1F614}","\u{1F62A}","\u{1F924}","\u{1F634}","\u{1F637}","\u{1F912}","\u{1F915}","\u{1F922}","\u{1F92E}","\u{1F927}","\u{1F975}","\u{1F976}","\u{1F974}","\u{1F635}","\u{1F92F}","\u{1F920}","\u{1F973}","\u{1F978}","\u{1F60E}","\u{1F913}","\u{1F9D0}","\u{1F615}","\u{1F61F}","\u{1F641}","\u2639\uFE0F","\u{1F62E}","\u{1F62F}","\u{1F632}","\u{1F633}","\u{1F97A}","\u{1F626}","\u{1F627}","\u{1F628}","\u{1F630}","\u{1F625}","\u{1F622}","\u{1F62D}","\u{1F631}","\u{1F616}","\u{1F623}","\u{1F61E}","\u{1F613}","\u{1F629}","\u{1F62B}","\u{1F971}","\u{1F624}","\u{1F621}","\u{1F620}","\u{1F92C}","\u{1F608}","\u{1F47F}","\u{1F480}","\u2620\uFE0F","\u{1F4A9}","\u{1F921}","\u{1F479}","\u{1F47A}","\u{1F47B}","\u{1F47D}"],people:["\u{1F44B}","\u{1F91A}","\u{1F590}\uFE0F","\u270B","\u{1F596}","\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","\u{1F44D}","\u{1F44E}","\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{1F9BF}","\u{1F9B5}","\u{1F9B6}","\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}","\u{1F476}","\u{1F9D2}","\u{1F466}","\u{1F467}","\u{1F9D1}","\u{1F471}","\u{1F468}","\u{1F9D4}","\u{1F469}","\u{1F9D3}","\u{1F474}","\u{1F475}","\u{1F64D}","\u{1F64E}","\u{1F645}","\u{1F646}","\u{1F481}","\u{1F64B}","\u{1F9CF}","\u{1F647}","\u{1F926}","\u{1F937}","\u{1F46E}","\u{1F575}\uFE0F","\u{1F482}","\u{1F977}","\u{1F477}","\u{1F934}","\u{1F478}"],animals:["\u{1F436}","\u{1F431}","\u{1F42D}","\u{1F439}","\u{1F430}","\u{1F98A}","\u{1F43B}","\u{1F43C}","\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{1FAB0}","\u{1FAB2}","\u{1FAB3}","\u{1F99F}","\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}"],food:["\u{1F347}","\u{1F348}","\u{1F349}","\u{1F34A}","\u{1F34B}","\u{1F34C}","\u{1F34D}","\u{1F96D}","\u{1F34E}","\u{1F34F}","\u{1F350}","\u{1F351}","\u{1F352}","\u{1F353}","\u{1FAD0}","\u{1F95D}","\u{1F345}","\u{1FAD2}","\u{1F965}","\u{1F951}","\u{1F346}","\u{1F954}","\u{1F955}","\u{1F33D}","\u{1F336}\uFE0F","\u{1FAD1}","\u{1F952}","\u{1F96C}","\u{1F966}","\u{1F9C4}","\u{1F9C5}","\u{1F344}","\u{1F95C}","\u{1F330}","\u{1F35E}","\u{1F950}","\u{1F956}","\u{1FAD3}","\u{1F968}","\u{1F96F}","\u{1F95E}","\u{1F9C7}","\u{1F9C0}","\u{1F356}","\u{1F357}","\u{1F969}","\u{1F953}","\u{1F354}","\u{1F35F}","\u{1F355}","\u{1F32D}","\u{1F96A}","\u{1F32E}","\u{1F32F}","\u{1FAD4}","\u{1F959}","\u{1F9C6}","\u{1F95A}","\u{1F373}","\u{1F958}","\u{1F372}","\u{1FAD5}","\u{1F963}","\u{1F957}","\u{1F37F}","\u{1F9C8}","\u{1F9C2}","\u{1F96B}","\u{1F371}","\u{1F358}","\u{1F359}","\u{1F35A}","\u{1F35B}","\u{1F35C}","\u{1F35D}","\u{1F360}","\u{1F362}","\u{1F363}","\u{1F364}","\u{1F365}"],travel:["\u{1F697}","\u{1F695}","\u{1F699}","\u{1F68C}","\u{1F68E}","\u{1F3CE}\uFE0F","\u{1F693}","\u{1F691}","\u{1F692}","\u{1F690}","\u{1F6FB}","\u{1F69A}","\u{1F69B}","\u{1F69C}","\u{1F9AF}","\u{1F9BD}","\u{1F9BC}","\u{1F6F4}","\u{1F6B2}","\u{1F6F5}","\u{1F3CD}\uFE0F","\u{1F6FA}","\u{1F6A8}","\u{1F694}","\u{1F68D}","\u{1F698}","\u{1F696}","\u{1F6A1}","\u{1F6A0}","\u{1F69F}","\u{1F683}","\u{1F68B}","\u{1F69E}","\u{1F69D}","\u{1F684}","\u{1F685}","\u{1F688}","\u{1F682}","\u{1F686}","\u{1F687}","\u{1F68A}","\u{1F689}","\u2708\uFE0F","\u{1F6EB}","\u{1F6EC}","\u{1F6E9}\uFE0F","\u{1F4BA}","\u{1F6F0}\uFE0F","\u{1F680}","\u{1F6F8}","\u{1F681}","\u{1F6F6}","\u26F5","\u{1F6A4}","\u{1F6E5}\uFE0F","\u{1F6F3}\uFE0F","\u26F4\uFE0F","\u{1F6A2}","\u2693","\u{1FA9D}","\u26FD","\u{1F6A7}","\u{1F6A6}","\u{1F6A5}","\u{1F68F}","\u{1F5FA}\uFE0F","\u{1F5FF}","\u{1F5FD}","\u{1F5FC}","\u{1F3F0}","\u{1F3EF}","\u{1F3DF}\uFE0F","\u{1F3A1}","\u{1F3A2}","\u{1F3A0}","\u26F2","\u26F1\uFE0F","\u{1F3D6}\uFE0F","\u{1F3DD}\uFE0F","\u{1F3DC}\uFE0F"],activities:["\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{1F94C}","\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}","\u26D1\uFE0F","\u{1F9D8}","\u{1F3C4}","\u{1F3CA}","\u{1F93D}","\u{1F6A3}","\u{1F9D7}","\u{1F6B5}","\u{1F6B4}","\u{1F3C6}","\u{1F947}","\u{1F948}","\u{1F949}","\u{1F3C5}","\u{1F396}\uFE0F","\u{1F3F5}\uFE0F","\u{1F397}\uFE0F","\u{1F3AB}","\u{1F39F}\uFE0F","\u{1F3AA}","\u{1F939}","\u{1F3AD}","\u{1FA70}","\u{1F3A8}","\u{1F3AC}","\u{1F3A4}","\u{1F3A7}","\u{1F3BC}","\u{1F3B9}","\u{1F941}","\u{1FA98}","\u{1F3B7}","\u{1F3BA}","\u{1FA97}","\u{1F3B8}","\u{1FA95}"],objects:["\u231A","\u{1F4F1}","\u{1F4F2}","\u{1F4BB}","\u2328\uFE0F","\u{1F5A5}\uFE0F","\u{1F5A8}\uFE0F","\u{1F5B1}\uFE0F","\u{1F5B2}\uFE0F","\u{1F579}\uFE0F","\u{1F5DC}\uFE0F","\u{1F4BD}","\u{1F4BE}","\u{1F4BF}","\u{1F4C0}","\u{1F4FC}","\u{1F4F7}","\u{1F4F8}","\u{1F4F9}","\u{1F3A5}","\u{1F4FD}\uFE0F","\u{1F39E}\uFE0F","\u{1F4DE}","\u260E\uFE0F","\u{1F4DF}","\u{1F4E0}","\u{1F4FA}","\u{1F4FB}","\u{1F399}\uFE0F","\u{1F39A}\uFE0F","\u{1F39B}\uFE0F","\u{1F9ED}","\u23F1\uFE0F","\u23F2\uFE0F","\u23F0","\u{1F570}\uFE0F","\u231B","\u23F3","\u{1F4E1}","\u{1F50B}","\u{1F50C}","\u{1F4A1}","\u{1F526}","\u{1F56F}\uFE0F","\u{1FA94}","\u{1F9EF}","\u{1F6E2}\uFE0F","\u{1F4B8}","\u{1F4B5}","\u{1F4B4}","\u{1F4B6}","\u{1F4B7}","\u{1FA99}","\u{1F4B0}","\u{1F4B3}","\u{1F48E}","\u2696\uFE0F","\u{1FA9C}","\u{1F9F0}","\u{1FA9B}","\u{1F527}","\u{1F528}","\u2692\uFE0F","\u{1F6E0}\uFE0F","\u26CF\uFE0F","\u{1FA9A}","\u{1F529}","\u2699\uFE0F","\u{1FAA4}","\u{1F9F1}","\u26D3\uFE0F","\u{1F9F2}","\u{1F52B}","\u{1F4A3}","\u{1F9E8}","\u{1FA93}","\u{1F52A}","\u{1F5E1}\uFE0F","\u2694\uFE0F","\u{1F6E1}\uFE0F"],symbols:["\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}","\u262E\uFE0F","\u271D\uFE0F","\u262A\uFE0F","\u{1F549}\uFE0F","\u2638\uFE0F","\u2721\uFE0F","\u{1F52F}","\u{1F54E}","\u262F\uFE0F","\u2626\uFE0F","\u{1F6D0}","\u26CE","\u2648","\u2649","\u264A","\u264B","\u264C","\u264D","\u264E","\u264F","\u2650","\u2651","\u2652","\u2653","\u{1F194}","\u269B\uFE0F","\u{1F251}","\u2622\uFE0F","\u2623\uFE0F","\u{1F4F4}","\u{1F4F3}","\u{1F236}","\u{1F21A}","\u{1F238}","\u{1F23A}","\u{1F237}\uFE0F","\u2734\uFE0F","\u{1F19A}","\u{1F4AE}","\u{1F250}","\u3299\uFE0F","\u3297\uFE0F","\u{1F234}","\u{1F235}","\u{1F239}","\u{1F232}","\u{1F170}\uFE0F","\u{1F171}\uFE0F","\u{1F18E}","\u{1F191}","\u{1F17E}\uFE0F","\u{1F198}","\u274C","\u2B55","\u{1F6D1}","\u26D4","\u{1F4DB}","\u{1F6AB}","\u{1F4AF}","\u{1F4A2}","\u2668\uFE0F"],flags:["\u{1F3F3}\uFE0F","\u{1F3F4}","\u{1F3C1}","\u{1F6A9}","\u{1F3F3}\uFE0F\u200D\u{1F308}","\u{1F3F3}\uFE0F\u200D\u26A7\uFE0F","\u{1F1FA}\u{1F1F3}","\u{1F1E6}\u{1F1EB}","\u{1F1E6}\u{1F1F1}","\u{1F1E9}\u{1F1FF}","\u{1F1E6}\u{1F1F8}","\u{1F1E6}\u{1F1E9}","\u{1F1E6}\u{1F1F4}","\u{1F1E6}\u{1F1EE}","\u{1F1E6}\u{1F1F6}","\u{1F1E6}\u{1F1EC}","\u{1F1E6}\u{1F1F7}","\u{1F1E6}\u{1F1F2}","\u{1F1E6}\u{1F1FC}","\u{1F1E6}\u{1F1FA}","\u{1F1E6}\u{1F1F9}","\u{1F1E6}\u{1F1FF}","\u{1F1E7}\u{1F1F8}","\u{1F1E7}\u{1F1ED}","\u{1F1E7}\u{1F1E9}","\u{1F1E7}\u{1F1E7}","\u{1F1E7}\u{1F1FE}","\u{1F1E7}\u{1F1EA}","\u{1F1E7}\u{1F1FF}","\u{1F1E7}\u{1F1EF}","\u{1F1E7}\u{1F1F2}","\u{1F1E7}\u{1F1F9}","\u{1F1E7}\u{1F1F4}","\u{1F1E7}\u{1F1E6}","\u{1F1E7}\u{1F1FC}","\u{1F1E7}\u{1F1F7}","\u{1F1E7}\u{1F1F3}","\u{1F1E7}\u{1F1EC}","\u{1F1E7}\u{1F1EB}","\u{1F1E7}\u{1F1EE}","\u{1F1E8}\u{1F1FB}","\u{1F1F0}\u{1F1ED}","\u{1F1E8}\u{1F1F2}","\u{1F1E8}\u{1F1E6}","\u{1F1E8}\u{1F1EB}","\u{1F1F9}\u{1F1E9}","\u{1F1E8}\u{1F1F1}","\u{1F1E8}\u{1F1F3}","\u{1F1E8}\u{1F1F4}","\u{1F1F0}\u{1F1F2}","\u{1F1E8}\u{1F1EC}","\u{1F1E8}\u{1F1E9}","\u{1F1E8}\u{1F1F7}","\u{1F1ED}\u{1F1F7}","\u{1F1E8}\u{1F1FA}","\u{1F1E8}\u{1F1FE}","\u{1F1E8}\u{1F1FF}","\u{1F1E9}\u{1F1F0}","\u{1F1E9}\u{1F1EF}","\u{1F1E9}\u{1F1F2}","\u{1F1E9}\u{1F1F4}","\u{1F1EA}\u{1F1E8}","\u{1F1EA}\u{1F1EC}","\u{1F1F8}\u{1F1FB}","\u{1F1EC}\u{1F1F6}","\u{1F1EA}\u{1F1F7}","\u{1F1EA}\u{1F1EA}","\u{1F1EA}\u{1F1F9}","\u{1F1EA}\u{1F1FA}","\u{1F1EB}\u{1F1EF}","\u{1F1EB}\u{1F1EE}","\u{1F1EB}\u{1F1F7}","\u{1F1EC}\u{1F1E6}","\u{1F1EC}\u{1F1F2}","\u{1F1EC}\u{1F1EA}","\u{1F1E9}\u{1F1EA}","\u{1F1EC}\u{1F1ED}","\u{1F1EC}\u{1F1F7}","\u{1F1EC}\u{1F1F9}","\u{1F1EC}\u{1F1F3}"]},gv=_.forwardRef(({className:e,size:t,onEmojiSelect:n,recentEmojis:r=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=_.useState(r.length>0?"recent":o),[u,f]=_.useState(""),g=u?Object.values(Ol).flat().filter(v=>v.toLowerCase().includes(u.toLowerCase())):c==="recent"?r:Ol[c]||[],h=v=>{n?.(v);};return jsxs("div",{ref:l,className:m(fv({size:t,className:e})),...i,children:[a&&jsx("div",{className:"p-2 border-b",children:jsxs("div",{className:"relative",children:[jsx(Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),jsx(ka,{placeholder:"Search emojis...",value:u,onChange:v=>f(v.target.value),className:"pl-8 h-8"})]})}),s&&!u&&jsx(De,{orientation:"horizontal",className:"border-b",children:jsx("div",{className:"flex px-1",children:Object.entries(zs).map(([v,{icon:b}])=>v==="recent"&&r.length===0?null:jsx("button",{className:m("shrink-0 p-2 text-lg hover:bg-accent rounded transition-colors",c===v&&"bg-accent"),onClick:()=>d(v),title:zs[v].name,children:b},v))})}),!u&&jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-muted-foreground",children:zs[c].name}),jsx(De,{className:"flex-1",children:jsxs("div",{className:"grid grid-cols-8 gap-1 p-2",children:[g.map((v,b)=>jsx("button",{className:"w-8 h-8 flex items-center justify-center text-xl hover:bg-accent rounded transition-colors",onClick:()=>h(v),children:v},`${v}-${b}`)),g.length===0&&jsx("div",{className:"col-span-8 py-8 text-center text-muted-foreground text-sm",children:"No emojis found"})]})})]})});gv.displayName="EmojiPicker";var bv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border-2",ghost:"border-transparent"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),kN=cva("flex flex-wrap items-center gap-0.5 p-1 border-b",{variants:{size:{sm:"p-0.5",md:"p-1",lg:"p-1.5"}},defaultVariants:{size:"md"}}),PN=cva("flex-1 overflow-auto prose prose-sm max-w-none dark:prose-invert [&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[inherit] [&_.ProseMirror.is-editor-empty:first-child::before]:text-muted-foreground [&_.ProseMirror.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.ProseMirror.is-editor-empty:first-child::before]:float-left [&_.ProseMirror.is-editor-empty:first-child::before]:pointer-events-none [&_.ProseMirror.is-editor-empty:first-child::before]:h-0",{variants:{size:{sm:"min-h-[100px] [&_.ProseMirror]:p-2 text-sm",md:"min-h-[150px] [&_.ProseMirror]:p-3 text-sm",lg:"min-h-[200px] [&_.ProseMirror]:p-4 text-base"}},defaultVariants:{size:"md"}}),Xe=({icon:e,title:t,isActive:n,onClick:r,disabled:o})=>jsxs(_n,{children:[jsx(Yn,{children:jsx(ae,{type:"button",variant:n?"solid":"ghost",size:"sm",isIconOnly:true,className:"h-7 w-7",onClick:r,disabled:o,children:e})}),jsx(Xn,{side:"top",className:"text-xs",children:t})]}),vv=_.forwardRef(({className:e,variant:t,size:n,value:r="",onChange:o,placeholder:a="Start writing...",readOnly:s=false,showToolbar:i=true,minHeight:l,maxHeight:c,onEditorReady:d,...u},f)=>{let p=useEditor({extensions:[oN.configure({heading:{levels:[1,2,3]}}),aN.configure({openOnClick:false,HTMLAttributes:{class:"text-primary underline"}}),sN,iN.configure({types:["heading","paragraph"]}),lN.configure({placeholder:a})],content:r,editable:!s,onUpdate:({editor:h})=>{o?.(h.getHTML());},onCreate:({editor:h})=>{d?.(h);}});_.useEffect(()=>{p&&r!==p.getHTML()&&p.commands.setContent(r);},[r,p]),_.useEffect(()=>{p&&p.setEditable(!s);},[s,p]);let g=()=>{if(!p)return;let h=p.getAttributes("link").href,v=window.prompt("URL",h);if(v!==null){if(v===""){p.chain().focus().extendMarkRange("link").unsetLink().run();return}p.chain().focus().extendMarkRange("link").setLink({href:v}).run();}};return p?jsx(jn,{children:jsxs("div",{ref:f,className:m(bv({variant:t,size:n,className:e})),...u,children:[i&&!s&&jsxs("div",{className:m(kN({size:n})),children:[jsx(Xe,{icon:jsx(Undo,{className:"h-4 w-4"}),title:"Undo",onClick:()=>p.chain().focus().undo().run(),disabled:!p.can().undo()}),jsx(Xe,{icon:jsx(Redo,{className:"h-4 w-4"}),title:"Redo",onClick:()=>p.chain().focus().redo().run(),disabled:!p.can().redo()}),jsx(Wn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Xe,{icon:jsx(Heading1,{className:"h-4 w-4"}),title:"Heading 1",isActive:p.isActive("heading",{level:1}),onClick:()=>p.chain().focus().toggleHeading({level:1}).run()}),jsx(Xe,{icon:jsx(Heading2,{className:"h-4 w-4"}),title:"Heading 2",isActive:p.isActive("heading",{level:2}),onClick:()=>p.chain().focus().toggleHeading({level:2}).run()}),jsx(Xe,{icon:jsx(Heading3,{className:"h-4 w-4"}),title:"Heading 3",isActive:p.isActive("heading",{level:3}),onClick:()=>p.chain().focus().toggleHeading({level:3}).run()}),jsx(Wn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Xe,{icon:jsx(Bold,{className:"h-4 w-4"}),title:"Bold (Ctrl+B)",isActive:p.isActive("bold"),onClick:()=>p.chain().focus().toggleBold().run()}),jsx(Xe,{icon:jsx(Italic,{className:"h-4 w-4"}),title:"Italic (Ctrl+I)",isActive:p.isActive("italic"),onClick:()=>p.chain().focus().toggleItalic().run()}),jsx(Xe,{icon:jsx(Underline,{className:"h-4 w-4"}),title:"Underline (Ctrl+U)",isActive:p.isActive("underline"),onClick:()=>p.chain().focus().toggleUnderline().run()}),jsx(Xe,{icon:jsx(Strikethrough,{className:"h-4 w-4"}),title:"Strikethrough",isActive:p.isActive("strike"),onClick:()=>p.chain().focus().toggleStrike().run()}),jsx(Wn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Xe,{icon:jsx(List,{className:"h-4 w-4"}),title:"Bullet List",isActive:p.isActive("bulletList"),onClick:()=>p.chain().focus().toggleBulletList().run()}),jsx(Xe,{icon:jsx(ListOrdered,{className:"h-4 w-4"}),title:"Numbered List",isActive:p.isActive("orderedList"),onClick:()=>p.chain().focus().toggleOrderedList().run()}),jsx(Wn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Xe,{icon:jsx(AlignLeft,{className:"h-4 w-4"}),title:"Align Left",isActive:p.isActive({textAlign:"left"}),onClick:()=>p.chain().focus().setTextAlign("left").run()}),jsx(Xe,{icon:jsx(AlignCenter,{className:"h-4 w-4"}),title:"Align Center",isActive:p.isActive({textAlign:"center"}),onClick:()=>p.chain().focus().setTextAlign("center").run()}),jsx(Xe,{icon:jsx(AlignRight,{className:"h-4 w-4"}),title:"Align Right",isActive:p.isActive({textAlign:"right"}),onClick:()=>p.chain().focus().setTextAlign("right").run()}),jsx(Wn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Xe,{icon:jsx(Quote,{className:"h-4 w-4"}),title:"Blockquote",isActive:p.isActive("blockquote"),onClick:()=>p.chain().focus().toggleBlockquote().run()}),jsx(Xe,{icon:jsx(Code,{className:"h-4 w-4"}),title:"Code Block",isActive:p.isActive("codeBlock"),onClick:()=>p.chain().focus().toggleCodeBlock().run()}),jsx(Wn,{orientation:"vertical",className:"h-6 mx-1"}),jsx(Xe,{icon:jsx(Link,{className:"h-4 w-4"}),title:"Insert Link",isActive:p.isActive("link"),onClick:g}),jsx(Xe,{icon:jsx(Unlink,{className:"h-4 w-4"}),title:"Remove Link",onClick:()=>p.chain().focus().unsetLink().run(),disabled:!p.isActive("link")})]}),jsx(EditorContent,{editor:p,className:m(PN({size:n})),style:{minHeight:l,maxHeight:c}})]})}):null});vv.displayName="RichTextEditor";var xv=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border-2",ghost:"border-none bg-transparent"}},defaultVariants:{variant:"default"}});function AN(e,t,n){return centerCrop(makeAspectCrop({unit:"%",width:90},n,e,t),e,t)}async function hv(e,t,n=0,r=1){let o=document.createElement("canvas"),a=o.getContext("2d");if(!a)return null;let s=e.naturalWidth/e.width,i=e.naturalHeight/e.height,l=window.devicePixelRatio||1;o.width=Math.floor(t.width*s*l),o.height=Math.floor(t.height*i*l),a.scale(l,l),a.imageSmoothingQuality="high";let c=t.x*s,d=t.y*i,u=n*Math.PI/180,f=e.naturalWidth/2,p=e.naturalHeight/2;return a.save(),a.translate(-c,-d),a.translate(f,p),a.rotate(u),a.scale(r,r),a.translate(-f,-p),a.drawImage(e,0,0,e.naturalWidth,e.naturalHeight,0,0,e.naturalWidth,e.naturalHeight),a.restore(),new Promise(g=>{o.toBlob(h=>{g(h);},"image/png");})}var yv=_.forwardRef(({className:e,variant:t,src:n,aspectRatio:r,onCropChange:o,onCropComplete:a,showZoom:s=true,showRotation:i=true,minZoom:l=1,maxZoom:c=3,circularCrop:d=false,initialCrop:u,...f},p)=>{let g=_.useRef(null),[h,v]=_.useState(),[b,w]=_.useState(),[x,R]=_.useState(1),[C,y]=_.useState(0),N=M=>{let{width:P,height:S}=M.currentTarget;if(r){let H=AN(P,S,r);v(H);}else v(u||{unit:"%",x:10,y:10,width:80,height:80});},T=M=>{v(M),o?.(M);},k=async M=>{if(w(M),a&&g.current&&M.width&&M.height){let P=await hv(g.current,M,C,x);a(P);}},E=()=>{y(M=>(M+90)%360);};return _.useEffect(()=>{b&&g.current&&a&&hv(g.current,b,C,x).then(M=>{a(M);});},[x,C,b,a]),jsxs("div",{ref:p,className:m(xv({variant:t,className:e})),...f,children:[jsx("div",{className:"flex-1 flex items-center justify-center p-4 bg-muted/30 min-h-[300px]",children:jsx(EN,{crop:h,onChange:T,onComplete:k,aspect:r,circularCrop:d,className:"max-h-[400px]",children:jsx("img",{ref:g,src:n,alt:"Crop preview",onLoad:N,style:{transform:`scale(${x}) rotate(${C}deg)`,maxHeight:"400px"}})})}),jsxs("div",{className:"flex items-center gap-4 p-3 border-t",children:[s&&jsxs("div",{className:"flex items-center gap-2 flex-1",children:[jsx(ZoomOut,{className:"h-4 w-4 text-muted-foreground"}),jsx(Ga,{value:[x],onValueChange:([M])=>R(M),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(ae,{variant:"bordered",size:"sm",isIconOnly:true,onClick:E,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});yv.displayName="ImageCropper";var $l=cva("inline-block",{variants:{variant:{default:"",bordered:"border rounded-lg p-2",card:"border rounded-lg p-4 bg-card shadow-sm"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),BN={sm:96,md:128,lg:192},wv=_.forwardRef(({className:e,variant:t,size:n,value:r,qrSize:o,fgColor:a="currentColor",bgColor:s="transparent",level:i="M",includeMargin:l=false,title:c,logo:d,logoSize:u=40,logoPadding:f=4,logoBackgroundColor:p="white",...g},h)=>{let v=o??BN[n??"md"];return r?jsx("div",{ref:h,className:m($l({variant:t,size:n,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(zN,{value:r,size:v,fgColor:a,bgColor:s,level:i,title:c,style:{padding:l?16:0}}),d&&jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded",style:{padding:f,backgroundColor:p},children:jsx("img",{src:d,alt:"Logo",style:{width:u,height:u,objectFit:"contain"}})})]})}):jsx("div",{ref:h,className:m($l({variant:t,size:n,className:e})),...g,children:jsx("div",{className:"flex items-center justify-center bg-muted text-muted-foreground text-xs rounded",style:{width:v,height:v},children:"No data"})})});wv.displayName="QRCode";var Cv=({children:e,defaultTheme:t="system",storageKey:n="reever-ui-theme",enableSystem:r=true,disableTransitionOnChange:o=false,attribute:a="class",forcedTheme:s,themes:i=["light","dark"]})=>jsx(ThemeProvider,{defaultTheme:t,storageKey:n,enableSystem:r,disableTransitionOnChange:o,attribute:a,forcedTheme:s,themes:i,children:e});Cv.displayName="ThemeProvider";var jN=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),Tv=_.forwardRef(({className:e,variant:t="ghost",size:n="md",mode:r="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=_.useState(false);_.useEffect(()=>{c(true);},[]);let d=()=>{let u=["light","dark","system"],p=(u.indexOf(a||"system")+1)%u.length;s(u[p]);};return l?r==="cycle"?jsxs(ae,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,onClick:d,children:[i==="dark"?jsx(Moon,{className:"h-4 w-4"}):jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]}):jsxs(Cn,{children:[jsx(Tn,{children:jsxs(ae,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,children:[jsx(Sun,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),jsx(Moon,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),jsxs(Mn,{align:"end",children:[jsxs($t,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs($t,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs($t,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(ae,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,disabled:true,children:[jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})});Tv.displayName="ThemeToggle";var Mv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),Nv=cva("flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 px-2.5 py-1.5 text-xs",md:"h-10 px-3 py-2 text-sm",lg:"h-12 px-4 py-3 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),kv=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Pv=_.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,startContent:u,endContent:f,id:p,...g},h)=>{let v=_.useId(),b=p||v,w=`${b}-description`,x=`${b}-error`,R=a&&r;return jsxs("div",{className:m(Mv({size:s}),e),children:[t&&jsxs("label",{htmlFor:b,className:m(kv({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[u&&jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:u}),jsx("input",{ref:h,id:b,"aria-invalid":a,"aria-describedby":R?x:n?w:void 0,"aria-required":o,className:m(Nv({size:s,isInvalid:a}),u&&"pl-10",f&&"pr-10",l),...g}),f&&jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:f})]}),n&&!R&&jsx("p",{id:w,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),R&&jsx("p",{id:x,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Pv.displayName="TextField";var Sv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),XN=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 text-center [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",{variants:{size:{sm:"h-8 px-8 py-1.5 text-xs",md:"h-10 px-10 py-2 text-sm",lg:"h-12 px-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit min-w-24"}},defaultVariants:{size:"md",isInvalid:false,fullWidth:false}}),Ev=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",{variants:{size:{sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"}},defaultVariants:{size:"md"}}),Lv=cva("",{variants:{size:{sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),qN=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Dv=_.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,min:u,max:f,step:p=1,value:g,defaultValue:h,onChange:v,showButtons:b=true,formatOptions:w,fullWidth:x=false,disabled:R,id:C,...y},N)=>{let T=_.useId(),k=C||T,E=`${k}-description`,M=`${k}-error`,[P,S]=_.useState(h),[H,D]=_.useState(false),L=g!==void 0?g:P,V=a&&r,A=_.useCallback(O=>{O!==void 0&&(u!==void 0&&O<u&&(O=u),f!==void 0&&O>f&&(O=f)),g===void 0&&S(O),v?.(O);},[g,u,f,v]),B=()=>{let O=(L??0)+p;A(O);},I=()=>{let O=(L??0)-p;A(O);},F=O=>{let W=O.target.value;if(W==="")A(void 0);else {let z=parseFloat(W);isNaN(z)||A(z);}},K=O=>{O.key==="ArrowUp"?(O.preventDefault(),B()):O.key==="ArrowDown"&&(O.preventDefault(),I());},Y=_.useMemo(()=>L===void 0?"":w?new Intl.NumberFormat(void 0,w).format(L):L.toString(),[L,w]),q=u!==void 0&&L!==void 0&&L<=u,$=f!==void 0&&L!==void 0&&L>=f;return jsxs("div",{className:m(Sv({size:s}),e),children:[t&&jsxs("label",{htmlFor:k,className:m(qN({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[b&&jsx("button",{type:"button",onClick:I,disabled:R||q,className:m(Ev({size:s}),"left-1"),tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:m(Lv({size:s}))})}),jsx("input",{ref:N,id:k,type:"text",inputMode:"decimal",value:Y,onChange:F,onKeyDown:K,onFocus:()=>D(true),onBlur:()=>D(false),"aria-invalid":a,"aria-describedby":V?M:n?E:void 0,"aria-required":o,"aria-valuemin":u,"aria-valuemax":f,"aria-valuenow":L,disabled:R,className:m(XN({size:s,isInvalid:a,fullWidth:x}),!b&&"px-3",l),style:{borderColor:H?"var(--color-foreground)":void 0},...y}),b&&jsx("button",{type:"button",onClick:B,disabled:R||$,className:m(Ev({size:s}),"right-1"),tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:m(Lv({size:s}))})})]}),n&&!V&&jsx("p",{id:E,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),V&&jsx("p",{id:M,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Dv.displayName="NumberField";var Iv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),JN=cva("flex w-full rounded-md border border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 pl-8 pr-8 py-1.5 text-xs",md:"h-10 pl-10 pr-10 py-2 text-sm",lg:"h-12 pl-12 pr-12 py-3 text-base"},isInvalid:{true:"border-danger focus-visible:ring-danger",false:""}},defaultVariants:{size:"md",isInvalid:false}}),Hv=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),ek=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),tk=cva("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",{variants:{size:{sm:"h-5 w-5 right-1.5",md:"h-6 w-6 right-2",lg:"h-7 w-7 right-2.5"}},defaultVariants:{size:"md"}}),Vv=_.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f="",onChange:p,onClear:g,onSearch:h,showClearButton:v=true,showSearchIcon:b=true,disabled:w,placeholder:x="Search...",id:R,...C},y)=>{let N=_.useId(),T=R||N,k=`${T}-description`,E=`${T}-error`,[M,P]=_.useState(f),S=u!==void 0?u:M,H=a&&r,D=S.length>0,L=B=>{let I=B.target.value;u===void 0&&P(I),p?.(I);},V=()=>{u===void 0&&P(""),p?.(""),g?.();},A=B=>{B.key==="Enter"?(B.preventDefault(),h?.(S)):B.key==="Escape"&&D&&(B.preventDefault(),V());};return jsxs("div",{className:m(Iv({size:s}),e),children:[t&&jsxs("label",{htmlFor:T,className:m(ek({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:"relative",children:[b&&jsx(Search,{className:m(Hv({size:s}),"absolute left-3 top-1/2 -translate-y-1/2")}),jsx("input",{ref:y,id:T,type:"search",value:S,onChange:L,onKeyDown:A,placeholder:x,"aria-invalid":a,"aria-describedby":H?E:n?k:void 0,"aria-required":o,disabled:w,className:m(JN({size:s,isInvalid:a}),!b&&"pl-3",!v&&"pr-3",l),...C}),v&&D&&!w&&jsx("button",{type:"button",onClick:V,className:m(tk({size:s})),tabIndex:-1,"aria-label":"Clear search",children:jsx(X,{className:m(Hv({size:s}))})})]}),n&&!H&&jsx("p",{id:k,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),H&&jsx("p",{id:E,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Vv.displayName="SearchField";var Av=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),rk=cva("flex rounded-md border border-input bg-background placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-8 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-12 py-3 text-base"},isInvalid:{true:"border-danger focus:border-danger",false:""},fullWidth:{true:"w-full",false:"w-fit"},showPickerIcon:{true:"",false:""}},compoundVariants:[{size:"sm",showPickerIcon:true,className:"pl-3 pr-8"},{size:"sm",showPickerIcon:false,className:"px-3"},{size:"md",showPickerIcon:true,className:"pl-3 pr-10"},{size:"md",showPickerIcon:false,className:"px-3"},{size:"lg",showPickerIcon:true,className:"pl-4 pr-12"},{size:"lg",showPickerIcon:false,className:"px-4"}],defaultVariants:{size:"md",isInvalid:false,fullWidth:false,showPickerIcon:true}}),ok=cva("text-muted-foreground",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),ak=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),$s={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},ql={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},Yl=(e,t)=>String(e).padStart(t,"0"),ua=(e,t)=>{if(!e)return "";let n=Yl(e.getDate(),2),r=Yl(e.getMonth()+1,2),o=Yl(e.getFullYear(),4),a=$s[t],s=ql[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Xl=(e,t)=>{let n=$s[t],r=e.split(n);if(r.length!==3)return null;let o=ql[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(r[l],10);}),isNaN(a.day)||isNaN(a.month)||isNaN(a.year)||a.month<1||a.month>12||a.day<1||a.day>31||a.year<1e3||a.year>9999)return null;let s=new Date(a.year,a.month-1,a.day);return s.getFullYear()!==a.year||s.getMonth()!==a.month-1||s.getDate()!==a.day?null:s},sk=e=>{let t=$s[e];return ql[e].map(r=>r==="year"?"####":"##").join(t)},Gs=_.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f,onChange:p,minDate:g,maxDate:h,dateFormat:v="dd.MM.yyyy",showPickerIcon:b=true,mode:w="text",fullWidth:x=false,disabled:R,placeholder:C,id:y,...N},T)=>{let k=_.useId(),E=y||k,M=`${E}-description`,P=`${E}-error`,[S,H]=_.useState(f??null),[D,L]=_.useState(""),[V,A]=_.useState(false),[B,I]=_.useState(false),F=u!==void 0?u:S,K=a&&r,Y=$s[v],q=sk(v);_.useEffect(()=>{B||L(ua(F,v));},[F,v,B]);let $=G=>{u===void 0&&H(G),p?.(G);},O=G=>{let Pe=G??null;$(Pe),L(ua(Pe,v)),A(false);},W=G=>{let Pe=G.target.value;Pe=Pe.replace(new RegExp(`[^0-9\\${Y}]`,"g"),"");let Z=Pe.replace(new RegExp(`\\${Y}`,"g"),""),le="",Be=0;for(let me=0;me<q.length&&Be<Z.length;me++)q[me]==="#"?(le+=Z[Be],Be++):le+=q[me];if(L(le),le.length===q.length){let me=Xl(le,v);if(me){if(g&&me<g||h&&me>h)return;$(me);}}},z=()=>{I(true);},j=()=>{I(false),D.length!==q.length?L(ua(F,v)):Xl(D,v)||L(ua(F,v));},oe=()=>{R||A(true);},ge=()=>{!R&&w==="picker"&&b&&A(true);};return jsxs("div",{className:m(Av({size:s}),e),children:[t&&jsxs("label",{htmlFor:E,className:m(ak({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(ot,{open:b&&V,onOpenChange:A,children:[jsxs(an,{className:m("relative",x?"w-full":"w-fit"),children:[jsx("input",{ref:T,id:E,type:"text",inputMode:w==="text"?"numeric":void 0,value:D,onChange:w==="text"?W:void 0,onClick:ge,onFocus:z,onBlur:j,readOnly:w==="picker","aria-invalid":a,"aria-describedby":K?P:n?M:void 0,"aria-required":o,disabled:R,placeholder:C||v.toLowerCase(),className:m(rk({size:s,isInvalid:a,fullWidth:x,showPickerIcon:b}),w==="picker"&&b&&"cursor-pointer",l),style:{borderColor:B||b&&V?"var(--color-foreground)":void 0},...N}),b&&jsx("button",{type:"button",onClick:oe,disabled:R,className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",tabIndex:-1,"aria-label":"Open calendar",children:jsx(Calendar,{className:m(ok({size:s}))})})]}),b&&jsx(at,{className:"w-auto p-0",align:"start",children:jsx(no,{mode:"single",selected:F??void 0,onSelect:O,disabled:G=>!!(g&&G<g||h&&G>h),defaultMonth:F??void 0,showMonthAndYearPickers:true})})]}),n&&!K&&jsx("p",{id:M,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),K&&jsx("p",{id:P,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Gs.displayName="DatePicker";var ik=Gs,lk=Gs;var zv=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),ck=cva("inline-flex items-center rounded-md border border-input bg-background transition-colors",{variants:{size:{sm:"h-8 px-2 gap-0.5 text-xs",md:"h-10 px-3 gap-1 text-sm",lg:"h-12 px-4 gap-1.5 text-base"},isInvalid:{true:"border-danger",false:""},disabled:{true:"cursor-not-allowed opacity-50",false:""},fullWidth:{true:"w-full justify-center",false:"w-fit"}},defaultVariants:{size:"md",isInvalid:false,disabled:false,fullWidth:false}}),dk=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Ov=_.forwardRef(({className:e,label:t,description:n,errorMessage:r,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:f,onChange:p,minTime:g,maxTime:h,showSeconds:v=false,hourCycle:b=24,disabled:w,fullWidth:x=false,id:R,...C},y)=>{let N=_.useId(),T=R||N,k=`${T}-description`,E=`${T}-error`,M=_.useRef(null),P=_.useRef(null),S=_.useRef(null),H=_.useRef(null),[D,L]=_.useState(f??null),V=u!==void 0?u:D,A=a&&r,B=U=>b===24?U:U===0?12:U>12?U-12:U,I=U=>U>=12?"PM":"AM",F=(U,re)=>re==="AM"?U===12?0:U:U===12?12:U+12,[K,Y]=_.useState(V?String(B(V.hour)).padStart(2,"0"):""),[q,$]=_.useState(V?String(V.minute).padStart(2,"0"):""),[O,W]=_.useState(V?.second!==void 0?String(V.second).padStart(2,"0"):""),[z,j]=_.useState(V?I(V.hour):"AM"),[oe,ge]=_.useState(false);_.useEffect(()=>{u!==void 0&&(u?(Y(String(B(u.hour)).padStart(2,"0")),$(String(u.minute).padStart(2,"0")),u.second!==void 0&&W(String(u.second).padStart(2,"0")),j(I(u.hour))):(Y(""),$(""),W("")));},[u,b]);let G=(U,re,X,Se)=>{let de=parseInt(U,10),We=parseInt(re,10),je=v?parseInt(X,10):void 0;if(isNaN(de)||isNaN(We)||v&&isNaN(je)){u===void 0&&L(null),p?.(null);return}let ve={hour:b===12?F(de,Se):de,minute:We,...v&&je!==void 0&&{second:je}};u===void 0&&L(ve),p?.(ve);},Pe=U=>{let re=U.target.value.replace(/\D/g,"").slice(0,2);Y(re);let X=b===24?23:12,Se=b===24?0:1;if(re.length===2){let de=parseInt(re,10);de>=Se&&de<=X&&(P.current?.focus(),P.current?.select());}},Z=U=>{let re=U.target.value.replace(/\D/g,"").slice(0,2);if($(re),re.length===2){let X=parseInt(re,10);X>=0&&X<=59&&(v?(S.current?.focus(),S.current?.select()):b===12&&H.current?.focus());}},le=U=>{let re=U.target.value.replace(/\D/g,"").slice(0,2);W(re),re.length===2&&b===12&&H.current?.focus();},Be=()=>{if(K){let U=parseInt(K,10),re=b===24?23:12,Se=Math.min(Math.max(U,b===24?0:1),re),de=String(Se).padStart(2,"0");Y(de),G(de,q,O,z);}},me=()=>{if(q){let U=parseInt(q,10),re=Math.min(Math.max(U,0),59),X=String(re).padStart(2,"0");$(X),G(K,X,O,z);}},wt=()=>{if(O){let U=parseInt(O,10),re=Math.min(Math.max(U,0),59),X=String(re).padStart(2,"0");W(X),G(K,q,X,z);}},gt=()=>{let U=z==="AM"?"PM":"AM";j(U),G(K,q,O,U);},yn=U=>{let re=U.key.toLowerCase();re==="a"?(U.preventDefault(),z!=="AM"&&(j("AM"),G(K,q,O,"AM"))):re==="p"?(U.preventDefault(),z!=="PM"&&(j("PM"),G(K,q,O,"PM"))):re==="arrowup"||re==="arrowdown"?(U.preventDefault(),gt()):re==="arrowleft"&&(U.preventDefault(),v?(S.current?.focus(),S.current?.select()):(P.current?.focus(),P.current?.select()));},Fe=(U,re)=>{if(U.key==="ArrowUp"||U.key==="ArrowDown"){U.preventDefault();let X=U.key==="ArrowUp"?1:-1;if(re==="hour"){let Se=parseInt(K,10)||0,de=b===24?23:12,We=b===24?0:1,je=Se+X;je>de&&(je=We),je<We&&(je=de);let Gn=String(je).padStart(2,"0");Y(Gn),G(Gn,q,O,z);}else if(re==="minute"){let de=(parseInt(q,10)||0)+X;de>59&&(de=0),de<0&&(de=59);let We=String(de).padStart(2,"0");$(We),G(K,We,O,z);}else if(re==="second"){let de=(parseInt(O,10)||0)+X;de>59&&(de=0),de<0&&(de=59);let We=String(de).padStart(2,"0");W(We),G(K,q,We,z);}}U.key==="ArrowRight"&&(U.preventDefault(),re==="hour"?(P.current?.focus(),P.current?.select()):re==="minute"&&v?(S.current?.focus(),S.current?.select()):(re==="minute"&&!v&&b===12||re==="second"&&b===12)&&H.current?.focus()),U.key==="ArrowLeft"&&(U.preventDefault(),re==="minute"?(M.current?.focus(),M.current?.select()):re==="second"&&(P.current?.focus(),P.current?.select())),U.key==="Backspace"&&U.currentTarget.value===""&&(re==="minute"?M.current?.focus():re==="second"&&P.current?.focus());},Ct=m((()=>{switch(s){case "sm":return "w-5";case "lg":return "w-7";default:return "w-6"}})(),"bg-transparent text-center outline-none placeholder:text-muted-foreground tabular-nums",w&&"cursor-not-allowed");return jsxs("div",{ref:y,className:m(zv({size:s}),e),...C,children:[t&&jsxs("label",{htmlFor:T,className:m(dk({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs("div",{className:m(ck({size:s,isInvalid:a,disabled:w,fullWidth:x}),l),style:{borderColor:oe?"var(--color-foreground)":void 0},onFocus:()=>ge(true),onBlur:U=>{U.currentTarget.contains(U.relatedTarget)||ge(false);},children:[jsx("input",{ref:M,id:T,type:"text",inputMode:"numeric",placeholder:b===24?"HH":"hh",value:K,onChange:Pe,onBlur:Be,onKeyDown:U=>Fe(U,"hour"),onFocus:U=>U.target.select(),"aria-label":"Hour","aria-invalid":a,"aria-describedby":A?E:n?k:void 0,"aria-required":o,disabled:w,className:Ct}),jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:P,type:"text",inputMode:"numeric",placeholder:"mm",value:q,onChange:Z,onBlur:me,onKeyDown:U=>Fe(U,"minute"),onFocus:U=>U.target.select(),"aria-label":"Minute",disabled:w,className:Ct}),v&&jsxs(Fragment,{children:[jsx("span",{className:"text-muted-foreground",children:":"}),jsx("input",{ref:S,type:"text",inputMode:"numeric",placeholder:"ss",value:O,onChange:le,onBlur:wt,onKeyDown:U=>Fe(U,"second"),onFocus:U=>U.target.select(),"aria-label":"Second",disabled:w,className:Ct})]}),b===12&&jsx("button",{ref:H,type:"button",onClick:gt,onKeyDown:yn,disabled:w,className:m("ml-0.5 rounded text-muted-foreground hover:text-foreground focus:outline-none focus:text-foreground transition-colors tabular-nums",s==="sm"?"w-6":s==="lg"?"w-8":"w-7",w&&"cursor-not-allowed"),"aria-label":"AM/PM",children:z})]}),n&&!A&&jsx("p",{id:k,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),A&&jsx("p",{id:E,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});Ov.displayName="TimeField";var Fv=cva("inline-flex items-center",{variants:{variant:{default:"gap-1",compact:"gap-0.5",attached:"[&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child)]:-ml-px gap-0"},orientation:{horizontal:"flex-row",vertical:"flex-col [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:first-child]:rounded-b-none [&>*:last-child]:rounded-t-none [&>*:not(:first-child)]:-mt-px [&>*:not(:first-child)]:ml-0"},size:{sm:"",md:"",lg:""},density:{compact:"gap-0.5",regular:"gap-1",spacious:"gap-2"}},defaultVariants:{variant:"default",orientation:"horizontal",size:"md",density:"regular"}}),Kv=_.forwardRef(({className:e,variant:t,orientation:n,size:r,density:o,items:a,maxVisibleItems:s,isDisabled:i,onAction:l,showLabels:c=false,renderItem:d,...u},f)=>{let p=s&&s<a.length?a.slice(0,s):a,g=s&&s<a.length?a.slice(s):[],h={sm:"h-8 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-4 text-base"}[r??"md"],v={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[r??"md"],b={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"}[r??"md"],w=(R,C)=>{C&&C(),l&&l(R);},x=R=>jsxs("button",{type:"button",disabled:i||R.isDisabled,onClick:()=>w(R.key,R.onPress),className:m("inline-flex items-center justify-center gap-2 rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",c?h:v),"aria-label":R.label,children:[R.icon&&jsx("span",{className:b,children:R.icon}),c&&jsx("span",{children:R.label})]},R.key);return jsxs("div",{ref:f,role:"group",className:m(Fv({variant:t,orientation:n,size:r,density:o,className:e})),...u,children:[p.map(R=>d?d(R):x(R)),g.length>0&&jsxs(Cn,{children:[jsx(Tn,{"aria-label":"More actions",className:m("items-center justify-center rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",i&&"pointer-events-none opacity-50",v),children:jsx(MoreHorizontal,{className:b})}),jsx(Mn,{align:"end",children:g.map(R=>jsxs($t,{disabled:R.isDisabled,onClick:()=>w(R.key,R.onPress),children:[R.icon&&jsx("span",{className:m(b,"mr-2"),children:R.icon}),R.label]},R.key))})]})]})});Kv.displayName="ActionGroup";var Wv=cva("inline-flex items-center gap-2",{variants:{variant:{neutral:"[--status-color:theme(colors.muted.foreground)]",info:"[--status-color:theme(colors.blue.500)]",positive:"[--status-color:theme(colors.green.500)]",notice:"[--status-color:theme(colors.yellow.500)]",negative:"[--status-color:theme(colors.red.500)]"},size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{variant:"neutral",size:"md"}}),fk=cva("rounded-full bg-[--status-color] flex-shrink-0",{variants:{size:{sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"},pulse:{true:"animate-pulse",false:""}},defaultVariants:{size:"md",pulse:false}}),jv=_.forwardRef(({className:e,variant:t,size:n,pulse:r=false,hideLabel:o=false,children:a,...s},i)=>jsxs("span",{ref:i,role:"status",className:m(Wv({variant:t,size:n,className:e})),...s,children:[jsx("span",{className:m(fk({size:n,pulse:r})),"aria-hidden":"true"}),!o&&a&&jsx("span",{className:"text-foreground",children:a})]}));jv.displayName="StatusLight";var Yv=cva("flex flex-col items-center justify-center text-center",{variants:{size:{sm:"gap-3 max-w-xs",md:"gap-4 max-w-sm",lg:"gap-5 max-w-md"}},defaultVariants:{size:"md"}}),bk=cva("text-muted-foreground",{variants:{size:{sm:"[&>svg]:h-16 [&>svg]:w-16",md:"[&>svg]:h-24 [&>svg]:w-24",lg:"[&>svg]:h-32 [&>svg]:w-32"}},defaultVariants:{size:"md"}}),vk=cva("font-semibold text-foreground",{variants:{size:{sm:"text-base",md:"text-lg",lg:"text-xl"}},defaultVariants:{size:"md"}}),hk=cva("text-muted-foreground",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Xv=_.forwardRef(({className:e,size:t,illustration:n,heading:r,description:o,children:a,...s},i)=>jsxs("div",{ref:i,className:m(Yv({size:t,className:e})),...s,children:[n&&jsx("div",{className:m(bk({size:t})),"aria-hidden":"true",children:n}),r&&jsx("h3",{className:m(vk({size:t})),children:r}),o&&jsx("p",{className:m(hk({size:t})),children:o}),a&&jsx("div",{className:"mt-2",children:a})]}));Xv.displayName="IllustratedMessage";var Qv=cva("relative flex gap-3 rounded-lg border p-4 text-sm",{variants:{variant:{info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-400",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100 [&>svg]:text-green-600 dark:[&>svg]:text-green-400",warning:"border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-400",error:"border-red-200 bg-red-50 text-red-900 dark:border-red-800 dark:bg-red-950 dark:text-red-100 [&>svg]:text-red-600 dark:[&>svg]:text-red-400",neutral:"border-border bg-muted text-foreground [&>svg]:text-muted-foreground"}},defaultVariants:{variant:"info"}}),Mk={info:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle,neutral:Info},Jv=_.forwardRef(({className:e,variant:t,title:n,icon:r,hideIcon:o=false,isDismissible:a=false,onDismiss:s,actions:i,children:l,...c},d)=>{let[u,f]=_.useState(true);if(!u)return null;let p=Mk[t??"info"],g=()=>{f(false),s?.();};return jsxs("div",{ref:d,role:"alert",className:m(Qv({variant:t,className:e})),...c,children:[!o&&jsx("div",{className:"flex-shrink-0",children:r||jsx(p,{className:"h-5 w-5"})}),jsxs("div",{className:"flex-1 space-y-1",children:[n&&jsx("div",{className:"font-medium",children:n}),l&&jsx("div",{className:"opacity-90",children:l}),i&&jsx("div",{className:"mt-3 flex gap-2",children:i})]}),a&&jsx("button",{type:"button",onClick:g,className:"absolute right-2 top-2 rounded-md p-1 opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Dismiss",children:jsx(X,{className:"h-4 w-4"})})]})});Jv.displayName="InlineAlert";var eh=cva("fixed flex items-center gap-2 rounded-lg border bg-background shadow-lg transition-all duration-200",{variants:{position:{bottom:"bottom-4 left-1/2 -translate-x-1/2",top:"top-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4"},size:{sm:"px-3 py-2 gap-1.5",md:"px-4 py-2.5 gap-2",lg:"px-5 py-3 gap-3"}},defaultVariants:{position:"bottom",size:"md"}}),th=_.forwardRef(({className:e,position:t,size:n,selectedCount:r=0,isOpen:o=true,onClose:a,showClose:s=true,selectedText:i,children:l,...c},d)=>{if(!o||r===0)return null;let u=()=>typeof i=="function"?i(r):i||`${r} item${r>1?"s":""} selected`;return jsxs("div",{ref:d,role:"toolbar","aria-label":"Actions for selected items",className:m(eh({position:t,size:n,className:e})),...c,children:[jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:u()}),jsx("div",{className:"h-4 w-px bg-border"}),jsx("div",{className:"flex items-center gap-1",children:l}),s&&jsxs(Fragment,{children:[jsx("div",{className:"h-4 w-px bg-border"}),jsx(Mt,{size:"sm",onClick:a,"aria-label":"Close action bar"})]})]})});th.displayName="ActionBar";var nh=_.forwardRef(({className:e,icon:t,children:n,...r},o)=>jsxs("button",{ref:o,type:"button",className:m("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",e),...r,children:[t&&jsx("span",{className:"h-4 w-4 [&>svg]:h-full [&>svg]:w-full",children:t}),n]}));nh.displayName="ActionBarButton";var ah=cva("flex flex-col",{variants:{variant:{default:"gap-1",bordered:"border rounded-lg divide-y",cards:"gap-2"},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"default",size:"md"}}),sh=cva("flex items-center gap-3 transition-colors cursor-pointer",{variants:{variant:{default:"rounded-md hover:bg-accent",bordered:"hover:bg-accent",cards:"rounded-lg border hover:border-primary/50 hover:bg-accent/50"},size:{sm:"px-2 py-1.5 text-sm",md:"px-3 py-2",lg:"px-4 py-3 text-lg"},isSelected:{true:"bg-accent",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"cards",isSelected:true,className:"border-primary bg-accent"}],defaultVariants:{variant:"default",size:"md",isSelected:false,isDisabled:false}});function ih({className:e,variant:t,size:n,items:r,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,allowsDragging:i=false,onReorder:l,showCheckbox:c=false,renderItem:d,emptyContent:u,...f}){let[p,g]=_.useState(new Set),[h,v]=_.useState(null),[b,w]=_.useState(null),x=_.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),R=T=>{if(a==="none")return;let k;a==="single"?k=x.has(T)?new Set:new Set([T]):(k=new Set(x),k.has(T)?k.delete(T):k.add(T)),o||g(k),s?.(k);},C=(T,k)=>{v(k),T.dataTransfer.effectAllowed="move";},y=(T,k)=>{T.preventDefault(),h!==k&&w(k);},N=()=>{if(h&&b&&h!==b){let T=r.findIndex(P=>P.key===h),k=r.findIndex(P=>P.key===b),E=[...r],[M]=E.splice(T,1);E.splice(k,0,M),l?.(E);}v(null),w(null);};return r.length===0?jsx("div",{className:m("flex items-center justify-center p-8 text-muted-foreground",e),children:u||"No items"}):jsx("div",{role:"listbox","aria-multiselectable":a==="multiple",className:m(ah({variant:t,size:n,className:e})),...f,children:r.map(T=>{let k=x.has(T.key),E=h===T.key,M=b===T.key;return d?jsx("div",{role:"option","aria-selected":k,onClick:()=>R(T.key),children:d(T,k)},T.key):jsxs("div",{role:"option","aria-selected":k,"aria-disabled":T.isDisabled,draggable:i&&!T.isDisabled,onDragStart:P=>C(P,T.key),onDragOver:P=>y(P,T.key),onDragEnd:N,onClick:()=>!T.isDisabled&&R(T.key),className:m(sh({variant:t,size:n,isSelected:k,isDisabled:T.isDisabled}),E&&"opacity-50",M&&"border-t-2 border-t-primary"),children:[i&&jsx(GripVertical,{className:"h-4 w-4 text-muted-foreground cursor-grab"}),c&&a!=="none"&&jsx("div",{className:m("flex h-4 w-4 items-center justify-center rounded border",k?"bg-primary border-primary text-primary-foreground":"border-input"),children:k&&jsx(Check,{className:"h-3 w-3"})}),T.icon&&jsx("span",{className:"h-5 w-5 text-muted-foreground [&>svg]:h-full [&>svg]:w-full",children:T.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"truncate",children:T.label}),T.description&&jsx("div",{className:"text-sm text-muted-foreground truncate",children:T.description})]})]},T.key)})})}ih.displayName="ListView";var lh=cva("relative flex w-full touch-none select-none",{variants:{orientation:{horizontal:"items-center",vertical:"flex-col justify-center h-full"},size:{sm:"",md:"",lg:""}},defaultVariants:{orientation:"horizontal",size:"md"}}),Lk=cva("relative grow overflow-hidden rounded-full bg-secondary",{variants:{orientation:{horizontal:"w-full",vertical:"w-2 h-full"},size:{sm:"h-1",md:"h-2",lg:"h-3"}},compoundVariants:[{orientation:"vertical",size:"sm",className:"w-1 h-full"},{orientation:"vertical",size:"md",className:"w-2 h-full"},{orientation:"vertical",size:"lg",className:"w-3 h-full"}],defaultVariants:{orientation:"horizontal",size:"md"}}),Sk=cva("block rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-grab",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{size:"md"}}),ch=_.forwardRef(({className:e,orientation:t="horizontal",size:n="md",value:r,defaultValue:o=[25,75],onValueChange:a,onValueCommit:s,min:i=0,max:l=100,step:c=1,disabled:d=false,showLabels:u=false,formatLabel:f=b=>String(b),trackColor:p="primary",name:g,...h},v)=>{let[b,w]=_.useState(o),x=r!==void 0,R=x?r:b,C=_.useRef(null),[y,N]=_.useState(false),[T,k]=_.useState(null),E=(I,F)=>{if(!C.current)return R[0];let K=C.current.getBoundingClientRect(),Y;t==="horizontal"?Y=(I-K.left)/K.width:Y=1-(F-K.top)/K.height,Y=Math.max(0,Math.min(1,Y));let q=i+Y*(l-i),$=Math.round(q/c)*c;return Math.max(i,Math.min(l,$))},M=(I,F)=>{let K=[...R];K[F]=I,F===0&&I>R[1]&&(K[0]=R[1]),F===1&&I<R[0]&&(K[1]=R[0]),x||w(K),a?.(K);},P=(I,F)=>{d||(I.preventDefault(),N(true),k(F),I.target.setPointerCapture(I.pointerId));},S=I=>{if(!y||T===null||d)return;let F=E(I.clientX,I.clientY);M(F,T);},H=()=>{y&&(N(false),k(null),s?.(R));},D=I=>{if(d)return;let F=E(I.clientX,I.clientY),K=Math.abs(R[0]-F),Y=Math.abs(R[1]-F),q=K<=Y?0:1;M(F,q);let $=[...R];$[q]=F,s?.($);},L=(I,F)=>{if(d)return;let K=R[F];switch(I.key){case "ArrowRight":case "ArrowUp":I.preventDefault(),K=Math.min(l,R[F]+c);break;case "ArrowLeft":case "ArrowDown":I.preventDefault(),K=Math.max(i,R[F]-c);break;case "Home":I.preventDefault(),K=i;break;case "End":I.preventDefault(),K=l;break;default:return}M(K,F);let Y=[...R];Y[F]=K,s?.(Y);},V=I=>(I-i)/(l-i)*100,A={primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"}[p],B={sm:14,md:20,lg:24}[n||"md"];return jsxs("div",{className:"relative w-full",children:[u&&jsxs("div",{className:"flex justify-between mb-2 text-sm text-muted-foreground",children:[jsx("span",{children:f(R[0])}),jsx("span",{children:f(R[1])})]}),jsxs("div",{ref:v,className:m(lh({orientation:t,size:n}),d&&"opacity-50 pointer-events-none",e),...h,children:[jsx("div",{ref:C,className:m(Lk({orientation:t,size:n})),onClick:D,children:jsx("div",{className:m("absolute rounded-full",A,{"h-full":t==="horizontal","w-full":t==="vertical"}),style:t==="horizontal"?{left:`${V(R[0])}%`,right:`${100-V(R[1])}%`,top:0,bottom:0}:{bottom:`${V(R[0])}%`,top:`${100-V(R[1])}%`,left:0,right:0}})}),R.map((I,F)=>jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":I,"aria-orientation":t||void 0,"aria-disabled":d,className:m(Sk({size:n}),y&&T===F&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${V(I)}% - ${B/2}px)`,top:"50%",transform:"translateY(-50%)"}:{position:"absolute",bottom:`calc(${V(I)}% - ${B/2}px)`,left:"50%",transform:"translateX(-50%)"},onPointerDown:K=>P(K,F),onPointerMove:S,onPointerUp:H,onPointerCancel:H,onKeyDown:K=>L(K,F)},F)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:R[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:R[1]})]})]})]})});ch.displayName="RangeSlider";var nc=cva("inline-flex items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{help:"text-muted-foreground hover:text-foreground",info:"text-blue-500 hover:text-blue-600",warning:"text-yellow-500 hover:text-yellow-600"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"help",size:"md"}}),Ak=cva("z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95",{variants:{size:{sm:"w-56 text-xs",md:"w-72 text-sm",lg:"w-80 text-base"}},defaultVariants:{size:"md"}}),zk={help:HelpCircle,info:Info,warning:AlertCircle},mh=_.forwardRef(({variant:e="help",size:t,title:n,children:r,trigger:o,side:a="top",align:s="center",open:i,onOpenChange:l,learnMoreUrl:c,learnMoreText:d="Learn more",triggerClassName:u,contentClassName:f},p)=>{let[g,h]=_.useState(false),[v,b]=_.useState(false),[w,x]=_.useState({top:0,left:0}),R=_.useRef(null),C=_.useRef(null),y=i!==void 0?i:g,N=_.useCallback(M=>{i===void 0&&h(M),l?.(M);},[i,l]);_.useEffect(()=>{b(true);},[]),_.useEffect(()=>{if(!y||!R.current)return;let M=()=>{let P=R.current.getBoundingClientRect(),S=C.current?.getBoundingClientRect(),H=S?.width||288,D=S?.height||100,L=8,V=0,A=0;switch(a){case "top":V=P.top-D-L,A=P.left+P.width/2-H/2;break;case "bottom":V=P.bottom+L,A=P.left+P.width/2-H/2;break;case "left":V=P.top+P.height/2-D/2,A=P.left-H-L;break;case "right":V=P.top+P.height/2-D/2,A=P.right+L;break}if(a==="top"||a==="bottom")switch(s){case "start":A=P.left;break;case "center":A=P.left+P.width/2-H/2;break;case "end":A=P.right-H;break}if(a==="left"||a==="right")switch(s){case "start":V=P.top;break;case "center":V=P.top+P.height/2-D/2;break;case "end":V=P.bottom-D;break}A=Math.max(8,Math.min(A,window.innerWidth-H-8)),V=Math.max(8,Math.min(V,window.innerHeight-D-8)),x({top:V,left:A});};return M(),requestAnimationFrame(M),window.addEventListener("resize",M),window.addEventListener("scroll",M,true),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,true);}},[y,a,s]),_.useEffect(()=>{if(!y)return;let M=P=>{C.current&&!C.current.contains(P.target)&&R.current&&!R.current.contains(P.target)&&N(false);};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[y,N]),_.useEffect(()=>{if(!y)return;let M=P=>{P.key==="Escape"&&N(false);};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[y,N]);let T=zk[e??"help"],k=()=>{N(!y);},E=()=>{switch(a){case "top":return "bottom center";case "bottom":return "top center";case "left":return "right center";case "right":return "left center";default:return "center center"}};return jsxs(Fragment,{children:[o?_.isValidElement(o)?_.cloneElement(o,{ref:R,onClick:M=>{o.props.onClick?.(M),k();}}):jsx("button",{ref:R,type:"button",onClick:k,className:m(nc({variant:e,size:t}),u),"aria-label":"Help",children:o}):jsx("button",{ref:M=>{R.current=M,typeof p=="function"?p(M):p&&(p.current=M);},type:"button",onClick:k,className:m(nc({variant:e,size:t}),u),"aria-label":"Help",children:jsx(T,{className:"h-full w-full"})}),v&&y&&Oa.createPortal(jsxs("div",{ref:C,className:m(Ak({size:t}),f),style:{position:"fixed",top:w.top,left:w.left,transformOrigin:E()},role:"tooltip",children:[n&&jsx("div",{className:"mb-2 font-semibold text-foreground",children:n}),jsx("div",{className:"text-muted-foreground",children:r}),c&&jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-block text-primary hover:underline",children:[d," \u2192"]}),jsx("div",{className:"absolute h-2 w-2 rotate-45 border bg-popover",style:{...a==="top"&&{bottom:-4,left:"50%",marginLeft:-4,borderTop:"none",borderLeft:"none"},...a==="bottom"&&{top:-4,left:"50%",marginLeft:-4,borderBottom:"none",borderRight:"none"},...a==="left"&&{right:-4,top:"50%",marginTop:-4,borderBottom:"none",borderLeft:"none"},...a==="right"&&{left:-4,top:"50%",marginTop:-4,borderTop:"none",borderRight:"none"}}})]}),document.body)]})});mh.displayName="ContextualHelp";var fh=cva("flex flex-wrap",{variants:{spacing:{sm:"gap-1",md:"gap-2",lg:"gap-3"}},defaultVariants:{spacing:"md"}}),rc=cva("inline-flex items-center gap-1 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-current bg-background hover:bg-accent",soft:"bg-primary/10 text-primary",surface:"bg-muted text-muted-foreground"},size:{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"},isSelected:{true:"",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},compoundVariants:[{variant:"bordered",isSelected:true,className:"border-primary bg-primary/5"},{variant:"soft",isSelected:true,className:"bg-primary/20"},{variant:"surface",isSelected:true,className:"bg-muted/80 ring-2 ring-primary/20"}],defaultVariants:{variant:"soft",size:"md",isSelected:false,isDisabled:false}});function gh({className:e,spacing:t,variant:n,size:r,items:o,selectedKeys:a,selectionMode:s="none",onSelectionChange:i,allowsRemoving:l=false,onRemove:c,label:d,description:u,errorMessage:f,maxTags:p,...g}){let[h,v]=_.useState(new Set),b=_.useMemo(()=>a?a instanceof Set?a:new Set(a):h,[a,h]),w=y=>{if(s==="none")return;let N;s==="single"?N=b.has(y)?new Set:new Set([y]):(N=new Set(b),N.has(y)?N.delete(y):N.add(y)),a||v(N),i?.(N);},x=(y,N)=>{N.stopPropagation(),c?.(y);},R=p?o.slice(0,p):o,C=p?Math.max(0,o.length-p):0;return jsxs("div",{className:"flex flex-col gap-1.5",children:[d&&jsx("span",{className:"text-sm font-medium text-foreground",children:d}),u&&jsx("span",{className:"text-sm text-muted-foreground",children:u}),jsxs("div",{role:"group","aria-label":d,className:m(fh({spacing:t}),e),...g,children:[R.map(y=>{let N=b.has(y.key),T=s!=="none";return jsxs("span",{role:T?"button":void 0,tabIndex:T&&!y.isDisabled?0:void 0,"aria-pressed":T?N:void 0,onClick:()=>!y.isDisabled&&w(y.key),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&!y.isDisabled&&(k.preventDefault(),w(y.key));},style:y.color?{backgroundColor:y.color}:void 0,className:m(rc({variant:y.color?void 0:n,size:r,isSelected:N,isDisabled:y.isDisabled}),T&&!y.isDisabled&&"cursor-pointer hover:opacity-80",y.color&&"text-white"),children:[y.icon&&jsx("span",{className:"h-3.5 w-3.5 [&>svg]:h-full [&>svg]:w-full",children:y.icon}),y.label,l&&!y.isDisabled&&jsx("button",{type:"button",onClick:k=>x(y.key,k),className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${y.label}`,children:jsx(X,{className:"h-3 w-3"})})]},y.key)}),C>0&&jsxs("span",{className:m(rc({variant:"surface",size:r}),"cursor-default"),children:["+",C," more"]})]}),f&&jsx("span",{className:"text-sm text-danger",children:f})]})}gh.displayName="TagGroup";var hh=cva("grid",{variants:{columns:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",auto:"grid-cols-[repeat(auto-fill,minmax(150px,1fr))]"},gap:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{columns:"auto",gap:"md"}}),xh=cva("relative flex flex-col rounded-lg border transition-all cursor-pointer",{variants:{variant:{default:"hover:border-primary/50 hover:bg-accent/50",card:"bg-card shadow-sm hover:shadow-md hover:border-primary/50"},size:{sm:"p-2",md:"p-3",lg:"p-4"},isSelected:{true:"border-primary bg-accent ring-2 ring-primary/20",false:""},isDisabled:{true:"opacity-50 pointer-events-none",false:""}},defaultVariants:{variant:"default",size:"md",isSelected:false,isDisabled:false}});function yh({className:e,columns:t,gap:n,items:r,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,showSelectionIndicator:i=true,itemVariant:l="default",itemSize:c="md",renderItem:d,emptyContent:u,...f}){let[p,g]=_.useState(new Set),h=_.useMemo(()=>o?o instanceof Set?o:new Set(o):p,[o,p]),v=b=>{if(a==="none")return;let w;a==="single"?w=h.has(b)?new Set:new Set([b]):(w=new Set(h),w.has(b)?w.delete(b):w.add(b)),o||g(w),s?.(w);};return r.length===0?jsx("div",{className:m("flex items-center justify-center p-8 text-muted-foreground",e),children:u||"No items"}):jsx("div",{role:"grid","aria-multiselectable":a==="multiple",className:m(hh({columns:t,gap:n,className:e})),...f,children:r.map(b=>{let w=h.has(b.key);return d?jsx("div",{role:"gridcell","aria-selected":w,onClick:()=>v(b.key),children:d(b,w)},b.key):jsxs("div",{role:"gridcell","aria-selected":w,"aria-disabled":b.isDisabled,onClick:()=>!b.isDisabled&&v(b.key),className:m(xh({variant:l,size:c,isSelected:w,isDisabled:b.isDisabled})),children:[i&&a!=="none"&&w&&jsx("div",{className:"absolute top-2 right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:jsx(Check,{className:"h-3 w-3"})}),b.thumbnail&&jsx("div",{className:"mb-2 aspect-square w-full overflow-hidden rounded-md bg-muted",children:b.thumbnail}),jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate font-medium",children:b.label}),b.description&&jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:b.description})]})]},b.key)})})}yh.displayName="GridList";var wh=cva("relative w-full",{variants:{size:{sm:"h-1.5",md:"h-2",lg:"h-3"}},defaultVariants:{size:"md"}}),Kk=cva("w-full h-full rounded-full overflow-hidden",{variants:{variant:{default:"bg-secondary",subtle:"bg-muted"}},defaultVariants:{variant:"default"}}),$k=cva("h-full transition-all duration-300 ease-out",{variants:{color:{primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500",auto:""},rounded:{true:"rounded-full",false:"rounded-l-full"}},defaultVariants:{color:"primary",rounded:true}}),ei=_.forwardRef(({className:e,size:t,value:n,min:r=0,max:o=100,optimum:a,low:s,high:i,label:l,showValueLabel:c=false,formatValue:d,color:u="primary",trackVariant:f="default",...p},g)=>{let h=Math.min(100,Math.max(0,(n-r)/(o-r)*100)),v=()=>{if(u!=="auto")return "";let w=(n-r)/(o-r),x=s!==void 0?(s-r)/(o-r):.25,R=i!==void 0?(i-r)/(o-r):.75;return (a!==void 0?(a-r)/(o-r):1)>=.5?w<=x?"bg-red-500":w<=R?"bg-yellow-500":"bg-green-500":w>=R?"bg-red-500":w>=x?"bg-yellow-500":"bg-green-500"},b=d?d(n,h):`${Math.round(h)}%`;return jsxs("div",{ref:g,className:m("w-full",e),...p,children:[(l||c)&&jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l&&jsx("span",{className:"text-sm font-medium text-foreground",children:l}),c&&jsx("span",{className:"text-sm text-muted-foreground",children:b})]}),jsx("div",{role:"meter","aria-valuenow":n,"aria-valuemin":r,"aria-valuemax":o,"aria-label":l,className:m(wh({size:t})),children:jsx("div",{className:m(Kk({variant:f})),children:jsx("div",{className:m($k({color:u==="auto"?void 0:u,rounded:h>=100}),u==="auto"&&v()),style:{width:`${h}%`}})})})]})});ei.displayName="Meter";var Ch=_.forwardRef((e,t)=>jsx(ei,{ref:t,color:"auto",low:50,high:80,optimum:0,...e}));Ch.displayName="DiskUsageMeter";var Th=_.forwardRef((e,t)=>jsx(ei,{ref:t,color:"auto",low:20,high:50,optimum:100,...e}));Th.displayName="BatteryMeter";var Mh=cva("relative rounded-lg overflow-hidden cursor-crosshair touch-none select-none",{variants:{size:{sm:"h-32 w-32",md:"h-48 w-48",lg:"h-64 w-64",full:"h-full w-full min-h-48"}},defaultVariants:{size:"md"}}),ni=(e,t,n)=>{let r=o=>{let a=(o+e/60)%6;return n-n*t*Math.max(Math.min(a,4-a,1),0)};return [Math.round(r(5)*255),Math.round(r(3)*255),Math.round(r(1)*255)]},Nh=(e,t,n)=>{e/=255,t/=255,n/=255;let r=Math.max(e,t,n),o=Math.min(e,t,n),a=r-o,s=0,i=r===0?0:a/r,l=r;if(a!==0)switch(r){case e:s=((t-n)/a+(t<n?6:0))*60;break;case t:s=((n-e)/a+2)*60;break;case n:s=((e-t)/a+4)*60;break}return [s,i,l]},kh=e=>{let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null},Ph=(e,t,n)=>"#"+[e,t,n].map(r=>r.toString(16).padStart(2,"0")).join(""),Eh=_.forwardRef(({hue:e,saturation:t,brightness:n,value:r,defaultValue:o="#ff0000",onChange:a,onColorChange:s,size:i,disabled:l,thumbSize:c=18,className:d,...u},f)=>{let p=_.useRef(null),[g,h]=_.useState(false),v=_.useCallback(I=>{let F=kh(I);return F?Nh(...F):[0,1,1]},[]),[b,w]=_.useState(()=>v(r||o)),x=e??b[0],R=t??b[1],C=n??b[2];_.useEffect(()=>{if(r){let I=v(r);w(I);}},[r,v]);let y=_.useCallback((I,F)=>{if(l||!p.current)return;let K=p.current.getBoundingClientRect(),Y=Math.max(0,Math.min(1,(I-K.left)/K.width)),q=Math.max(0,Math.min(1,(F-K.top)/K.height)),$=Y,O=1-q;t===void 0&&n===void 0&&w([x,$,O]),a?.({hue:x,saturation:$,brightness:O});let W=ni(x,$,O);s?.(Ph(...W));},[l,x,t,n,a,s]),N=I=>{l||(I.preventDefault(),h(true),I.target.setPointerCapture(I.pointerId),y(I.clientX,I.clientY));},T=I=>{g&&y(I.clientX,I.clientY);},k=I=>{h(false),I.target.releasePointerCapture(I.pointerId);},[E,M,P]=ni(x,1,1),S=`rgb(${E}, ${M}, ${P})`,H=R*100,D=(1-C)*100,[L,V,A]=ni(x,R,C),B=`rgb(${L}, ${V}, ${A})`;return jsx("div",{ref:f,className:m(Mh({size:i}),l&&"cursor-not-allowed opacity-50",d),...u,children:jsxs("div",{ref:p,className:"absolute inset-0",style:{backgroundColor:S},onPointerDown:N,onPointerMove:T,onPointerUp:k,onPointerLeave:k,children:[jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to right, white, transparent)"}}),jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, transparent, black)"}}),jsx("div",{className:"absolute rounded-full border-2 border-white pointer-events-none",style:{width:c,height:c,left:`calc(${H}% - ${c/2}px)`,top:`calc(${D}% - ${c/2}px)`,backgroundColor:B,boxShadow:"0 0 0 1px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Eh.displayName="ColorArea";var Sh=cva("relative rounded-full cursor-pointer touch-none select-none",{variants:{orientation:{horizontal:"w-full",vertical:"h-full"},size:{sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",size:"sm",className:"h-3"},{orientation:"horizontal",size:"md",className:"h-4"},{orientation:"horizontal",size:"lg",className:"h-5"},{orientation:"vertical",size:"sm",className:"w-3"},{orientation:"vertical",size:"md",className:"w-4"},{orientation:"vertical",size:"lg",className:"w-5"}],defaultVariants:{orientation:"horizontal",size:"md"}}),jk=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cg fill='%23ccc'%3E%3Crect width='4' height='4'/%3E%3Crect x='4' y='4' width='4' height='4'/%3E%3C/g%3E%3C/svg%3E")`,Lh="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",Dh=_.forwardRef(({value:e,defaultValue:t,onChange:n,channel:r="hue",baseColor:o="#ff0000",orientation:a,size:s,disabled:i,thumbSize:l=18,showBorder:c=true,className:d,...u},f)=>{let p=_.useRef(null),[g,h]=_.useState(false),v=()=>{switch(r){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[b,w]=_.useState(t??v()),x=e??b,R=r==="hue"?x/360:x,C=_.useCallback((S,H)=>{if(i||!p.current)return;let D=p.current.getBoundingClientRect(),L=a!=="vertical",V;L?V=Math.max(0,Math.min(1,(S-D.left)/D.width)):V=Math.max(0,Math.min(1,1-(H-D.top)/D.height));let A=r==="hue"?V*360:V;e===void 0&&w(A),n?.(A);},[i,a,r,e,n]),y=S=>{i||(S.preventDefault(),h(true),S.target.setPointerCapture(S.pointerId),C(S.clientX,S.clientY));},N=S=>{g&&C(S.clientX,S.clientY);},T=S=>{h(false),S.target.releasePointerCapture(S.pointerId);},k=()=>{let S=a!=="vertical",H=S?"to right":"to top";switch(r){case "hue":return S?Lh:"linear-gradient(to top, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)";case "alpha":return `linear-gradient(${H}, transparent, ${o})`;case "saturation":return `linear-gradient(${H}, #808080, ${o})`;case "brightness":return `linear-gradient(${H}, #000000, ${o})`;default:return Lh}},E=()=>r==="hue"?`hsl(${x}, 100%, 50%)`:o,M=a!=="vertical",P=R*100;return jsx("div",{ref:f,className:m(Sh({orientation:a,size:s}),i&&"cursor-not-allowed opacity-50",d),...u,children:jsxs("div",{ref:p,className:m("absolute inset-0 rounded-full overflow-hidden",c&&"border border-input"),style:{backgroundImage:r==="alpha"?jk:void 0,backgroundSize:r==="alpha"?"8px 8px":void 0},onPointerDown:y,onPointerMove:N,onPointerUp:T,onPointerLeave:T,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:k()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...M?{left:`calc(${P}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${P}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:E(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});Dh.displayName="ColorSlider";var Hh=cva("relative cursor-crosshair touch-none select-none",{variants:{size:{sm:"h-32 w-32",md:"h-48 w-48",lg:"h-64 w-64"}},defaultVariants:{size:"md"}}),Xk=(e,t,n)=>{let r=e-n,o=t-n,a=Math.atan2(o,r)*180/Math.PI+90;return a<0&&(a+=360),a},Ih=_.forwardRef(({value:e,defaultValue:t=0,onChange:n,size:r,disabled:o,innerRadius:a=.6,thumbSize:s=20,showCenter:i=true,className:l,...c},d)=>{let u=_.useRef(null),[f,p]=_.useState(false),[g,h]=_.useState(t),v=e??g,b=_.useCallback((y,N)=>{if(o||!u.current)return;let T=u.current.getBoundingClientRect(),k=T.width/2,E=y-T.left,M=N-T.top,P=Xk(E,M,k);e===void 0&&h(P),n?.(P);},[o,e,n]),w=y=>{o||(y.preventDefault(),p(true),y.target.setPointerCapture(y.pointerId),b(y.clientX,y.clientY));},x=y=>{f&&b(y.clientX,y.clientY);},R=y=>{p(false),y.target.releasePointerCapture(y.pointerId);},C=()=>{let y=[];for(let N=0;N<=360;N+=30)y.push(`hsl(${N}, 100%, 50%) ${N}deg`);return `conic-gradient(from 270deg, ${y.join(", ")})`};return jsx("div",{ref:d,className:m(Hh({size:r}),o&&"cursor-not-allowed opacity-50",l),...c,children:jsxs("div",{ref:u,className:"absolute inset-0 rounded-full",style:{background:C()},onPointerDown:w,onPointerMove:x,onPointerUp:R,onPointerLeave:R,children:[a<1&&jsx("div",{className:"absolute bg-background rounded-full",style:{top:`${(1-a)*50}%`,left:`${(1-a)*50}%`,width:`${a*100}%`,height:`${a*100}%`}}),i&&a<1&&jsx("div",{className:"absolute rounded-full border-2 border-input bg-background",style:{width:8,height:8,top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}),jsx(qk,{hue:v,innerRadius:a,thumbSize:s})]})})});Ih.displayName="ColorWheel";var qk=({hue:e,innerRadius:t,thumbSize:n})=>{let r=(1-(1-t)/2)*50,o=(e-90)*Math.PI/180,a=50+r*Math.cos(o),s=50+r*Math.sin(o);return jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:n,height:n,left:`calc(${a}% - ${n/2}px)`,top:`calc(${s}% - ${n/2}px)`,backgroundColor:`hsl(${e}, 100%, 50%)`,boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})};var Ah=cva("flex",{variants:{orientation:{horizontal:"flex-row items-center gap-2",vertical:"flex-col gap-1"},size:{sm:"",md:"",lg:""},align:{start:"items-start",center:"items-center",end:"items-end"}},compoundVariants:[{orientation:"horizontal",align:"start",className:"items-start"},{orientation:"horizontal",align:"center",className:"items-center"},{orientation:"horizontal",align:"end",className:"items-end"}],defaultVariants:{orientation:"vertical",size:"md",align:"start"}}),Qk=cva("text-muted-foreground font-medium",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),Jk=cva("text-foreground",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},mono:{true:"font-mono",false:""}},defaultVariants:{size:"md",weight:"normal",mono:false}}),zh=_.forwardRef(({className:e,orientation:t,size:n,align:r,label:o,value:a,valueWeight:s,mono:i,labelWidth:l,labelClassName:c,valueClassName:d,showColon:u=false,copyable:f=false,onCopy:p,...g},h)=>{let v=async()=>{if(!(!f||a===null||a===void 0))try{let b=typeof a=="string"?a:String(a);await navigator.clipboard.writeText(b),p?.();}catch{}};return jsxs("div",{ref:h,className:m(Ah({orientation:t,size:n,align:r,className:e})),...g,children:[jsxs("span",{className:m(Qk({size:n}),c),style:l?{width:l,flexShrink:0}:void 0,children:[o,u&&":"]}),jsx("span",{className:m(Jk({size:n,weight:s,mono:i}),f&&"cursor-pointer hover:bg-accent/50 rounded px-1 -mx-1 transition-colors",d),onClick:f?v:void 0,role:f?"button":void 0,tabIndex:f?0:void 0,onKeyDown:f?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),v());}:void 0,children:a})]})});zh.displayName="LabeledValue";var Oh=cva("",{variants:{orientation:{horizontal:"flex flex-row flex-wrap",vertical:"flex flex-col"},gap:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{orientation:"vertical",gap:"md"}}),Bh=_.forwardRef(({className:e,orientation:t,gap:n,...r},o)=>jsx("div",{ref:o,className:m(Oh({orientation:t,gap:n,className:e})),...r}));Bh.displayName="LabeledValueGroup";var Gh=cva("flex items-center rounded-md border border-input bg-background ring-offset-background transition-colors focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",{variants:{size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base"},variant:{default:"",filled:"bg-muted border-transparent",ghost:"border-transparent hover:bg-muted"}},defaultVariants:{size:"md",variant:"default"}}),Co=cva("text-muted-foreground shrink-0",{variants:{size:{sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"md"}}),Uh=_.forwardRef(({value:e,defaultValue:t="",onChange:n,onSearch:r,onSelect:o,suggestions:a=[],recentSearches:s=[],onClearRecentSearches:i,trendingSearches:l=[],isLoading:c,showClear:d=true,showIcon:u=true,popoverWidth:f="trigger",emptyMessage:p="No results found",size:g,variant:h,className:v,placeholder:b="Search...",disabled:w,...x},R)=>{let[C,y]=_.useState(false),[N,T]=_.useState(t),k=e!==void 0?e:N,E=_.useRef(null);_.useImperativeHandle(R,()=>E.current);let M=k.length>0,P=C&&(a.length>0||s.length>0||l.length>0||M),S=I=>{e===void 0&&T(I),n?.(I);},H=()=>{S(""),E.current?.focus();},D=I=>{I?.preventDefault(),k.trim()&&(r?.(k.trim()),y(false));},L=I=>{S(I.label),o?.(I),y(false);},V=I=>{S(I),r?.(I),y(false);},A=I=>{S(I),r?.(I),y(false);},B=_.useMemo(()=>{let I={};return a.forEach(F=>{let K=F.category||"Results";I[K]||(I[K]=[]),I[K].push(F);}),I},[a]);return jsxs(ot,{open:P,onOpenChange:y,children:[jsx(an,{children:jsxs("form",{onSubmit:D,className:m(Gh({size:g,variant:h}),v),children:[u&&jsx(Search,{className:m(Co({size:g}),"ml-3")}),jsx("input",{ref:E,type:"text",value:k,onChange:I=>S(I.target.value),onFocus:()=>y(true),placeholder:b,disabled:w,className:m("flex-1 bg-transparent px-3 py-2 outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",!u&&"pl-3"),...x}),d&&M&&!w&&jsx("button",{type:"button",onClick:H,className:m("mr-2 rounded-sm p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",Co({size:g})),children:jsx(X,{className:"h-full w-full"})})]})}),jsx(at,{className:"p-0",style:{width:f==="trigger"?"var(--radix-popover-trigger-width)":f},align:"start",onOpenAutoFocus:I=>I.preventDefault(),children:jsxs(Command,{className:"rounded-lg border-0",children:[s.length>0&&!M&&jsxs("div",{className:"p-2",children:[jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Recent"}),i&&jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]}),s.map((I,F)=>jsxs("button",{type:"button",onClick:()=>V(I),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(Clock,{className:m(Co({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:I}),jsx(ArrowRight,{className:m(Co({size:g}),"opacity-0 group-hover:opacity-100")})]},F))]}),l.length>0&&!M&&jsxs("div",{className:"border-t p-2",children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Trending"})}),l.map((I,F)=>jsxs("button",{type:"button",onClick:()=>A(I),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[jsx(TrendingUp,{className:m(Co({size:g}))}),jsx("span",{className:"flex-1 text-left truncate",children:I})]},F))]}),M&&jsx("div",{className:"p-2",children:c?jsx("div",{className:"flex items-center justify-center py-6",children:jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):a.length>0?Object.entries(B).map(([I,F])=>jsxs("div",{children:[jsx("div",{className:"px-2 py-1.5",children:jsx("span",{className:"text-xs font-medium text-muted-foreground",children:I})}),F.map(K=>jsxs("button",{type:"button",onClick:()=>L(K),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-muted",children:[K.icon||jsx(Search,{className:m(Co({size:g}))}),jsxs("div",{className:"flex-1 text-left",children:[jsx("div",{className:"truncate",children:K.label}),K.description&&jsx("div",{className:"text-xs text-muted-foreground truncate",children:K.description})]})]},K.id))]},I)):jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:p})})]})})]})});Uh.displayName="SearchBar";var Wh={Pages:jsx(File,{className:"h-4 w-4"}),Files:jsx(Folder,{className:"h-4 w-4"}),Settings:jsx(Settings,{className:"h-4 w-4"}),Users:jsx(User,{className:"h-4 w-4"}),Tags:jsx(Hash,{className:"h-4 w-4"})},Yh=_.forwardRef(({open:e,onOpenChange:t,items:n=[],recentItems:r=[],placeholder:o="Search...",isLoading:a,emptyMessage:s="No results found.",filter:i,shortcut:l="\u2318K",onSelect:c,footer:d},u)=>{let[f,p]=_.useState(""),g=_.useRef(null),[h,v]=_.useState(false);_.useEffect(()=>{v(true);},[]),_.useEffect(()=>{e||p("");},[e]),_.useEffect(()=>{if(!e)return;let y=N=>{N.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,t]),_.useEffect(()=>{if(e)return Gt(),()=>Ut()},[e]);let b=_.useMemo(()=>{let y={};return n.forEach(N=>{let T=N.category||"Results";y[T]||(y[T]=[]),y[T].push(N);}),y},[n]),w=y=>{y.onSelect?.(),c?.(y),t?.(false);},x=()=>{t?.(false);},R=f.length>0,C=!R&&r.length>0;return !h||!e?null:Oa.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-state":e?"open":"closed",onClick:x}),jsx("div",{ref:u,className:"fixed left-1/2 top-[20%] z-50 w-full max-w-2xl -translate-x-1/2 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2","data-state":e?"open":"closed",children:jsxs(Command,{className:"overflow-hidden rounded-xl border bg-background shadow-2xl",filter:i,shouldFilter:!i,children:[jsxs("div",{className:"flex items-center border-b px-4",children:[jsx(Search,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),jsx(Command.Input,{ref:g,value:f,onValueChange:p,placeholder:o,className:"flex h-14 w-full bg-transparent px-4 py-4 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"}),f&&jsx("button",{type:"button",onClick:()=>p(""),className:"rounded-sm p-1 text-muted-foreground hover:text-foreground",children:jsx(X,{className:"h-4 w-4"})})]}),jsx(Command.List,{className:"max-h-[400px] overflow-y-auto p-2",children:a?jsx("div",{className:"flex items-center justify-center py-10",children:jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):jsxs(Fragment,{children:[C&&jsxs(Command.Group,{heading:"Recent",children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Recent"}),r.map(y=>jsxs(Command.Item,{value:y.label,onSelect:()=>w(y),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:y.icon||Wh[y.category||""]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:y.label}),y.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:y.description})]}),y.shortcut&&jsx("div",{className:"flex items-center gap-1",children:y.shortcut.map((N,T)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:N},T))})]},y.id))]}),R&&Object.entries(b).map(([y,N])=>jsxs(Command.Group,{heading:y,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:y}),N.map(T=>jsxs(Command.Item,{value:`${T.label} ${T.keywords?.join(" ")||""}`,onSelect:()=>w(T),className:"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 text-sm aria-selected:bg-muted",children:[jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:T.icon||Wh[y]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:T.label}),T.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:T.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},T.id))]},y)),jsx(Command.Empty,{className:"py-10 text-center text-sm text-muted-foreground",children:s})]})}),d?jsx("div",{className:"border-t px-4 py-3",children:d}):jsxs("div",{className:"flex items-center justify-between border-t px-4 py-3 text-xs text-muted-foreground",children:[jsxs("div",{className:"flex items-center gap-4",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u2191\u2193"}),"Navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"\u21B5"}),"Select"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:"Esc"}),"Close"]})]}),jsxs("span",{className:"flex items-center gap-1",children:["Press ",jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-medium",children:l})," to open"]})]})]})})]}),document.body)});Yh.displayName="SpotlightSearch";function mP(e="k"){let[t,n]=_.useState(false);return _.useEffect(()=>{let r=o=>{(o.metaKey||o.ctrlKey)&&o.key===e&&(o.preventDefault(),n(a=>!a));};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e]),{open:t,setOpen:n,toggle:()=>n(r=>!r)}}var Zh=_.createContext(null),oi=()=>{let e=_.useContext(Zh);if(!e)throw new Error("useNotificationCenter must be used within a NotificationCenterProvider");return e},yP=({children:e,notifications:t,onNotificationsChange:n})=>{let[r,o]=_.useState([]),[a,s]=_.useState(false),i=_.useRef(null),l=t!==void 0,c=l?t:r,d=_.useCallback(v=>{l?n?.(v):o(v);},[l,n]),u=c.filter(v=>!v.read).length,f=_.useCallback(v=>{d(c.map(b=>b.id===v?{...b,read:true}:b));},[c,d]),p=_.useCallback(()=>{d(c.map(v=>({...v,read:true})));},[c,d]),g=_.useCallback(v=>{d(c.filter(b=>b.id!==v));},[c,d]),h=_.useCallback(()=>{d([]);},[d]);return jsx(Zh.Provider,{value:{notifications:c,unreadCount:u,markAsRead:f,markAllAsRead:p,removeNotification:g,clearAll:h,open:a,setOpen:s,triggerRef:i},children:e})},Qh=_.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:m("relative inline-block",e),...n,children:t}));Qh.displayName="NotificationCenter";var Jh=_.forwardRef(({className:e,showBadge:t=true,children:n,onClick:r,...o},a)=>{let{unreadCount:s,open:i,setOpen:l,triggerRef:c}=oi(),d=f=>{r?.(f),l(!i);},u=s>99?"99+":String(s);return jsxs("button",{ref:f=>{c.current=f,typeof a=="function"?a(f):a&&(a.current=f);},type:"button",onClick:d,"aria-label":"Notifications"+(s>0?", "+s+" unread":""),className:m("relative inline-flex items-center justify-center rounded-md p-2 text-muted-foreground hover:bg-accent hover:text-accent-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",e),...o,children:[n||jsx(Bell,{className:"h-5 w-5"}),t&&s>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-destructive px-1 text-xs font-medium text-danger-foreground",children:u})]})});Jh.displayName="NotificationCenterTrigger";var ex=_.forwardRef(({className:e,align:t="end",sideOffset:n=8,emptyMessage:r="No notifications",children:o,...a},s)=>{let{open:i,setOpen:l,notifications:c,markAllAsRead:d,clearAll:u,triggerRef:f}=oi(),[p,g]=_.useState(false),h=_.useRef(null),[v,b]=_.useState({top:0,left:0});return _.useEffect(()=>{g(true);},[]),_.useEffect(()=>{if(!i||!f.current||!h.current)return;let w=()=>{if(!f.current||!h.current)return;let x=f.current.getBoundingClientRect(),R=h.current.getBoundingClientRect(),C=x.bottom+n,y=x.left;t==="center"?y=x.left+x.width/2-R.width/2:t==="end"&&(y=x.right-R.width),y+R.width>window.innerWidth-16&&(y=window.innerWidth-R.width-16),y<16&&(y=16),b({top:C,left:y});};return w(),window.addEventListener("resize",w),window.addEventListener("scroll",w,true),()=>{window.removeEventListener("resize",w),window.removeEventListener("scroll",w,true);}},[i,f,t,n]),_.useEffect(()=>{if(!i)return;let w=R=>{h.current&&!h.current.contains(R.target)&&f.current&&!f.current.contains(R.target)&&l(false);},x=R=>{R.key==="Escape"&&l(false);};return document.addEventListener("mousedown",w),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",w),document.removeEventListener("keydown",x);}},[i,l,f]),!p||!i?null:Oa.createPortal(jsxs("div",{ref:w=>{h.current=w,typeof s=="function"?s(w):s&&(s.current=w);},className:m("fixed z-50 w-80 sm:w-96 max-h-[70vh] overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",e),style:{top:v.top,left:v.left},...a,children:[jsxs("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[jsx("h3",{className:"font-semibold",children:"Notifications"}),jsxs("div",{className:"flex items-center gap-2",children:[c.length>0&&jsxs(Fragment,{children:[jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground hover:text-foreground",children:"Mark all read"}),jsx("button",{type:"button",onClick:u,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear all"})]}),jsx("button",{type:"button",onClick:()=>l(false),className:"rounded-md p-1 hover:bg-accent",children:jsx(X,{className:"h-4 w-4"})})]})]}),jsx("div",{className:"max-h-[calc(70vh-60px)] overflow-y-auto",children:o||(c.length===0?jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[jsx(Bell,{className:"h-10 w-10 mb-2 opacity-50"}),jsx("p",{className:"text-sm",children:r})]}):c.map(w=>jsx(lc,{notification:w},w.id)))})]}),document.body)});ex.displayName="NotificationCenterContent";var RP={info:"border-l-blue-500",success:"border-l-green-500",warning:"border-l-yellow-500",error:"border-l-red-500"},wP={info:Info,success:CheckCircle,warning:AlertTriangle,error:AlertCircle},lc=({notification:e,onMarkAsRead:t,onRemove:n})=>{let{markAsRead:r,removeNotification:o}=oi(),{id:a,title:s,description:i,type:l="info",timestamp:c,read:d,avatar:u,action:f}=e,p=wP[l],g=()=>{t?t():r(a);},h=()=>{n?n():o(a);},v=b=>{if(!b)return null;let w=typeof b=="string"?new Date(b):b,R=new Date().getTime()-w.getTime(),C=Math.floor(R/6e4),y=Math.floor(R/36e5),N=Math.floor(R/864e5);return C<1?"Just now":C<60?C+"m ago":y<24?y+"h ago":N<7?N+"d ago":w.toLocaleDateString()};return jsxs("div",{className:m("group relative flex gap-3 border-b border-l-4 px-4 py-3 transition-colors hover:bg-accent/50",RP[l],!d&&"bg-accent/20"),children:[jsx("div",{className:"flex-shrink-0",children:u||jsx("div",{className:m("flex h-8 w-8 items-center justify-center rounded-full",l==="info"&&"bg-blue-100 text-blue-600 dark:bg-blue-900 dark:text-blue-400",l==="success"&&"bg-green-100 text-green-600 dark:bg-green-900 dark:text-green-400",l==="warning"&&"bg-yellow-100 text-yellow-600 dark:bg-yellow-900 dark:text-yellow-400",l==="error"&&"bg-red-100 text-red-600 dark:bg-red-900 dark:text-red-400"),children:jsx(p,{className:"h-4 w-4"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsx("p",{className:m("text-sm font-medium",!d&&"font-semibold"),children:s}),!d&&jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full bg-primary"})]}),i&&jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-2",children:i}),jsxs("div",{className:"mt-2 flex items-center gap-3",children:[c&&jsx("span",{className:"text-xs text-muted-foreground",children:v(c)}),f&&jsx("button",{type:"button",onClick:f.onClick,className:"text-xs font-medium text-primary hover:underline",children:f.label})]})]}),jsx("div",{className:"flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:jsxs("div",{className:"flex gap-1",children:[!d&&jsx("button",{type:"button",onClick:g,className:"rounded-md p-1 hover:bg-accent",title:"Mark as read",children:jsx(Check,{className:"h-4 w-4"})}),jsx("button",{type:"button",onClick:h,className:"rounded-md p-1 hover:bg-accent text-danger",title:"Remove",children:jsx(Trash2,{className:"h-4 w-4"})})]})})]})};lc.displayName="NotificationItem";var tx=_.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:m("divide-y",e),...n,children:t}));tx.displayName="NotificationList";var nx=cva("relative flex items-center justify-center gap-3 px-4 py-2.5 text-sm",{variants:{variant:{solid:"",flat:""},type:{default:"",success:"",warning:"",error:""},position:{top:"fixed top-0 left-0 right-0 z-50",relative:"relative"}},compoundVariants:[{variant:"solid",type:"default",className:"bg-primary text-primary-foreground [&>svg]:text-primary-foreground"},{variant:"flat",type:"default",className:"bg-primary/10 text-primary [&>svg]:text-primary"},{variant:"solid",type:"success",className:"bg-green-600 text-white dark:bg-green-500 [&>svg]:text-white"},{variant:"flat",type:"success",className:"bg-green-600/10 text-green-600 dark:bg-green-500/10 dark:text-green-500 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"},{variant:"solid",type:"warning",className:"bg-amber-600 text-white dark:bg-amber-500 [&>svg]:text-white"},{variant:"flat",type:"warning",className:"bg-amber-600/10 text-amber-600 dark:bg-amber-500/10 dark:text-amber-500 [&>svg]:text-amber-600 dark:[&>svg]:text-amber-500"},{variant:"solid",type:"error",className:"bg-red-600 text-white dark:bg-red-500 [&>svg]:text-white"},{variant:"flat",type:"error",className:"bg-red-600/10 text-red-600 dark:bg-red-500/10 dark:text-red-500 [&>svg]:text-red-600 dark:[&>svg]:text-red-500"}],defaultVariants:{variant:"solid",type:"default",position:"relative"}}),LP={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},rx=_.forwardRef(({message:e,type:t="default",variant:n="solid",showIcon:r=false,icon:o,dismissible:a=true,onDismiss:s,endContent:i,position:l,animate:c,autoDismiss:d,storageKey:u,className:f,...p},g)=>{let[h,v]=_.useState(true),[b,w]=_.useState(false);_.useEffect(()=>{u&&localStorage.getItem(`banner-${u}`)==="true"&&v(false);},[u]),_.useEffect(()=>{if(d&&h){let y=setTimeout(()=>{x();},d);return ()=>clearTimeout(y)}},[d,h]);let x=()=>{w(true),setTimeout(()=>{v(false),u&&localStorage.setItem(`banner-${u}`,"true"),s?.();},200);};if(!h)return null;let R=LP[t],C=r?o!==void 0?o:R?jsx(R,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:m(nx({variant:n,type:t,position:l}),c&&"animate-pulse",b&&"animate-out fade-out slide-out-to-top duration-200",f),role:"banner",...p,children:[C&&jsx("span",{className:"shrink-0",children:C}),jsx("span",{className:"text-center font-medium",children:e}),i&&jsx("div",{className:"shrink-0 ml-2",children:i}),a&&jsx("button",{type:"button",onClick:x,className:m("absolute right-2 top-1/2 -translate-y-1/2 rounded-sm p-1 transition-opacity hover:opacity-70 cursor-pointer",l==="relative"&&"right-4"),"aria-label":"Dismiss banner",children:jsx(X,{className:"h-4 w-4"})})]})});rx.displayName="Banner";var pa=cva("inline-flex items-center justify-center rounded-full shadow-lg transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{solid:"bg-primary text-primary-foreground hover:bg-primary/90",bordered:"border-2 border-current bg-transparent text-primary hover:opacity-70",light:"bg-transparent text-primary hover:bg-primary/10",flat:"bg-primary/20 text-primary hover:opacity-70",ghost:"border-2 border-current bg-transparent text-primary hover:bg-primary hover:text-primary-foreground"},size:{sm:"h-10 w-10",md:"h-14 w-14",lg:"h-16 w-16"},position:{"bottom-right":"fixed bottom-6 right-6","bottom-left":"fixed bottom-6 left-6","bottom-center":"fixed bottom-6 left-1/2 -translate-x-1/2",relative:"relative"}},defaultVariants:{variant:"solid",size:"md",position:"bottom-right"}}),HP=cva("transition-transform duration-200 [&>svg]:h-full [&>svg]:w-full",{variants:{size:{sm:"h-5 w-5",md:"h-6 w-6",lg:"h-8 w-8"}},defaultVariants:{size:"md"}}),dc=_.forwardRef(({icon:e,label:t="Action button",extended:n,extendedLabel:r,actions:o,direction:a="up",showTooltip:s=true,closeIcon:i,animation:l="rotate",variant:c,size:d,position:u,className:f,onClick:p,disabled:g,...h},v)=>{let[b,w]=_.useState(false),x=o&&o.length>0,R=k=>{x&&w(!b),p?.(k);},C=k=>{k.onClick?.(),w(false);},y={up:{container:"flex-col-reverse bottom-full mb-3 gap-3",item:""},down:{container:"flex-col top-full mt-3 gap-3",item:""},left:{container:"flex-row-reverse right-full mr-3 gap-3",item:""},right:{container:"flex-row left-full ml-3 gap-3",item:""}},N=l==="rotate"&&b?"rotate-45":"",T=l==="scale"&&b?"scale-0":"scale-100";return jsxs("div",{className:m("relative z-50",u!=="relative"&&u&&pa({position:u})),children:[x&&b&&jsx("div",{className:m("absolute left-1/2 -translate-x-1/2 flex items-center",y[a].container),children:o.map((k,E)=>jsxs("div",{className:m("flex items-center gap-2 animate-in fade-in zoom-in duration-200",a==="up"||a==="down"?"flex-row":"flex-col"),style:{animationDelay:`${E*50}ms`},children:[s&&(a==="up"||a==="down")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:k.label}),k.href?jsx("a",{href:k.href,className:m(pa({variant:k.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":k.label,children:k.icon}):jsx("button",{type:"button",onClick:()=>C(k),className:m(pa({variant:k.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":k.label,children:k.icon}),s&&(a==="left"||a==="right")&&jsx("span",{className:"rounded-md bg-popover px-2 py-1 text-xs font-medium text-popover-foreground shadow-md whitespace-nowrap",children:k.label})]},k.id))}),jsxs("button",{ref:v,type:"button",onClick:R,disabled:g,className:m(pa({variant:c,size:d,position:"relative"}),n&&"w-auto px-6 gap-2",f),"aria-label":t,"aria-expanded":x?b:void 0,...h,children:[b&&i?i:jsx("span",{className:m(HP({size:d}),N,T,"transition-all duration-200"),children:e||jsx(Plus,{})}),n&&r&&jsx("span",{className:"font-medium",children:r})]}),x&&b&&jsx("div",{className:"fixed inset-0 -z-10",onClick:()=>w(false)})]})});dc.displayName="FloatingActionButton";var IP=dc;var lx=cva("fixed bottom-0 left-0 right-0 z-50 flex items-center justify-around border-t bg-background safe-area-pb",{variants:{variant:{default:"border-border",elevated:"border-transparent shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.1)]",filled:"border-transparent bg-primary text-primary-foreground"},size:{sm:"h-14",md:"h-16",lg:"h-20"}},defaultVariants:{variant:"default",size:"md"}}),ax=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),cx=_.forwardRef(({className:e,variant:t,size:n,items:r,value:o,defaultValue:a,onValueChange:s,showLabels:i="all",renderItem:l,...c},d)=>{let[u,f]=_.useState(a||r[0]?.key),p=o!==void 0,g=p?o:u,h=x=>{x.disabled||(p||f(x.key),s?.(x.key));},v=x=>t==="filled"?x?"text-primary-foreground":"text-primary-foreground/60 hover:text-primary-foreground/80":x?"text-primary":"text-muted-foreground hover:text-foreground",b=()=>{switch(n){case "sm":return "h-5 w-5";case "lg":return "h-7 w-7";default:return "h-6 w-6"}},w=()=>{switch(n){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:m(lx({variant:t,size:n}),e),role:"navigation","aria-label":"Bottom navigation",...c,children:r.map(x=>{let R=g===x.key,C=i==="all"||i==="active"&&R,y=R&&x.activeIcon?x.activeIcon:x.icon;if(l)return jsx("div",{onClick:()=>h(x),className:m(ax({variant:t}),x.disabled&&"opacity-50 cursor-not-allowed"),children:l(x,R)},x.key);let N=jsxs("div",{onClick:()=>!x.href&&h(x),className:m(ax({variant:t}),v(R),x.disabled&&"opacity-50 cursor-not-allowed"),role:"button","aria-current":R?"page":void 0,"aria-disabled":x.disabled,tabIndex:x.disabled?-1:0,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),h(x));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:m(b(),"[&>svg]:h-full [&>svg]:w-full"),children:y}),x.badge!==void 0&&x.badge>0&&jsx("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-medium text-white",children:x.badge>99?"99+":x.badge}),x.showDot&&jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-red-500"})]}),C&&x.label&&jsx("span",{className:m(w(),"font-medium truncate max-w-full px-1"),children:x.label})]},x.key);return x.href&&!x.disabled?jsx("a",{href:x.href,onClick:()=>h(x),className:m("flex flex-1 flex-col items-center justify-center gap-1 no-underline",v(R)),children:N},x.key):N})})});cx.displayName="BottomNavigation";var AP="fixed inset-x-0 bottom-0 z-50 mt-24 flex h-fit max-h-[90vh] flex-col rounded-t-[20px] border-t border-border/40 dark:border-border/20 bg-background",ux=cva("flex w-full items-center gap-3 px-4 py-3.5 text-left transition-colors focus-visible:outline-none focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"hover:bg-accent",destructive:"text-danger hover:bg-destructive/10"}},defaultVariants:{variant:"default"}}),mx=_.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r,description:o,items:a,cancelLabel:s="Cancel",onCancel:i,showCancel:l=true,children:c,closeOnSelect:d=true,onAction:u},f)=>{let p=g=>{g.isDisabled||(g.onSelect?.(),u?.(g.key),d&&t?.(false));};return jsxs(Drawer.Root,{open:e,onOpenChange:t,children:[n&&jsx(Drawer.Trigger,{asChild:true,children:n}),jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:"fixed inset-0 z-50 bg-black/40"}),jsxs(Drawer.Content,{ref:f,className:AP,children:[jsx("div",{className:"mx-auto mt-4 h-1.5 w-12 flex-shrink-0 rounded-full bg-muted"}),(r||o)&&jsxs("div",{className:"px-4 py-3 text-center",children:[r&&jsx(Drawer.Title,{className:"text-base font-semibold",children:r}),o&&jsx(Drawer.Description,{className:"mt-1 text-sm text-muted-foreground",children:o})]}),jsx("div",{className:"flex-1 overflow-y-auto",children:c||jsx("div",{className:"divide-y divide-border/40 dark:divide-border/20",children:a?.map(g=>jsxs("button",{type:"button",disabled:g.isDisabled,onClick:()=>p(g),className:m(ux({variant:g.isDestructive?"destructive":"default"})),children:[g.icon&&jsx("span",{className:"h-5 w-5 flex-shrink-0 [&>svg]:h-full [&>svg]:w-full",children:g.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"font-medium",children:g.label}),g.description&&jsx("div",{className:"text-sm text-muted-foreground truncate",children:g.description})]})]},g.key))})}),l&&jsx("div",{className:"border-t border-border/40 dark:border-border/20 p-2 pb-safe",children:jsx(Drawer.Close,{asChild:true,children:jsx("button",{type:"button",onClick:i,className:"w-full rounded-lg bg-muted py-3.5 text-center font-semibold transition-colors hover:bg-muted/80",children:s})})})]})]})]})});mx.displayName="ActionSheet";var fx=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),mc=cva("flex h-full items-center justify-center px-4 text-white font-medium transition-opacity",{variants:{variant:{primary:"bg-primary",secondary:"bg-secondary text-secondary-foreground",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500",info:"bg-blue-500"},size:{sm:"min-w-16",md:"min-w-20",lg:"min-w-24"}},defaultVariants:{variant:"primary",size:"md"}}),gx=_.forwardRef(({className:e,variant:t,leftActions:n=[],rightActions:r=[],actionSize:o="md",threshold:a=.3,onSwipeEnd:s,disabled:i=false,fullSwipeAction:l,children:c,...d},u)=>{let f=_.useRef(null),[p,g]=_.useState(0),[h,v]=_.useState(false),b=_.useRef(0),w=_.useRef(0),x=n.length*(o==="sm"?64:o==="lg"?96:80),R=r.length*(o==="sm"?64:o==="lg"?96:80),C=E=>{i||(v(true),b.current=E.touches[0].clientX,w.current=p);},y=E=>{if(!h||i)return;let P=E.touches[0].clientX-b.current,S=w.current+P;(S>0&&n.length===0||S<0&&r.length===0)&&(S=0),S>x?S=x+(S-x)*.3:S<-R&&(S=-R+(S+R)*.3),g(S);},N=()=>{if(!h)return;v(false);let E=f.current?.offsetWidth||0,M=Math.abs(p)/E;if(l&&M>.6){l==="right"&&p>0&&n[0]?(n[0].onAction?.(),s?.("right",n[0].key)):l==="left"&&p<0&&r[0]&&(r[0].onAction?.(),s?.("left",r[0].key)),g(0);return}p>x*a&&n.length>0?(g(x),s?.("right")):p<-R*a&&r.length>0?(g(-R),s?.("left")):g(0);},T=(E,M)=>{E.onAction?.(),s?.(M,E.key),g(0);},k=()=>{g(0);};return jsxs("div",{ref:u,className:m(fx({variant:t,className:e})),...d,children:[n.length>0&&p>0&&jsx("div",{className:"absolute left-0 top-0 bottom-0 flex",style:{width:x},children:n.map(E=>jsxs("button",{type:"button",onClick:()=>T(E,"right"),className:m(mc({variant:E.variant,size:o})),style:{opacity:Math.min(1,p/x)},children:[E.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:E.icon}),!E.icon&&E.label]},E.key))}),r.length>0&&p<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:R},children:r.map(E=>jsxs("button",{type:"button",onClick:()=>T(E,"left"),className:m(mc({variant:E.variant,size:o})),style:{opacity:Math.min(1,Math.abs(p)/R)},children:[E.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:E.icon}),!E.icon&&E.label]},E.key))}),jsx("div",{ref:f,className:m("relative bg-background",h?"":"transition-transform duration-200"),style:{transform:`translateX(${p}px)`},onTouchStart:C,onTouchMove:y,onTouchEnd:N,onClick:p!==0?k:void 0,children:c})]})});gx.displayName="SwipeActions";var vx=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),BP=cva("absolute left-1/2 -translate-x-1/2 flex items-center justify-center transition-all duration-200",{variants:{size:{sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12"}},defaultVariants:{size:"md"}}),hx=_.forwardRef(({className:e,variant:t,onRefresh:n,pullThreshold:r=80,maxPullDistance:o=120,loadingIndicator:a,pullIndicator:s,indicatorSize:i="md",disabled:l=false,pullText:c="Pull to refresh",releaseText:d="Release to refresh",refreshingText:u="Refreshing...",children:f,...p},g)=>{let h=_.useRef(null),[v,b]=_.useState(0),[w,x]=_.useState("idle"),R=_.useRef(0),C=_.useRef(false),y=()=>l||w==="refreshing"?false:(h.current?.scrollTop??window.scrollY)<=0,N=P=>{y()&&(R.current=P.touches[0].clientY,C.current=true);},T=P=>{if(!C.current||!y())return;let H=P.touches[0].clientY-R.current;if(H<0){b(0),x("idle");return}let L=Math.min(H*.5,o);b(L),x(L>=r?"ready":"pulling");},k=async()=>{if(C.current)if(C.current=false,w==="ready"){x("refreshing"),b(r*.6);try{await n();}finally{x("idle"),b(0);}}else x("idle"),b(0);},E={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],M=()=>{if(w==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:m(E,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:u})]});let P=Math.min(v/r*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:m(E,"text-muted-foreground transition-transform"),style:{transform:`rotate(${P}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:w==="ready"?d:c})]})};return jsxs("div",{ref:g,className:m(vx({variant:t,className:e})),...p,children:[jsx("div",{className:m(BP({size:i}),"z-10",w==="idle"&&v===0&&"opacity-0"),style:{top:Math.max(v-60,-60),opacity:Math.min(v/(r*.5),1)},children:M()}),jsx("div",{ref:h,className:m("transition-transform duration-200",w==="refreshing"&&"ease-out"),style:{transform:`translateY(${v}px)`,transition:C.current?"none":void 0},onTouchStart:N,onTouchMove:T,onTouchEnd:k,children:f})]})});hx.displayName="PullToRefresh";var Gr=(e,t,n)=>({duration:e,delay:t,ease:n||[.4,0,.2,1]}),FP={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},xx=_.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialOpacity:i=0,onAnimationStart:l,onAnimationComplete:c},d)=>{let u=jsx(motion.div,{ref:d,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:FP,custom:i,transition:Gr(n,r,o),className:m(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&u}):u});xx.displayName="Fade";var KP=(e,t)=>{let n=typeof t=="number"?`${t}px`:t,r={up:{y:n},down:{y:`-${n}`},left:{x:n},right:{x:`-${n}`}};return {hidden:{opacity:0,...r[e]},visible:{opacity:1,x:0,y:0},exit:{opacity:0,...r[e]}}},yx=_.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,direction:i="up",offset:l=20,onAnimationStart:c,onAnimationComplete:d},u)=>{let f=_.useMemo(()=>KP(i,l),[i,l]),p=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Gr(n,r,o),className:m(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});yx.displayName="Slide";var $P={center:"center center",top:"center top",bottom:"center bottom",left:"left center",right:"right center","top-left":"left top","top-right":"right top","bottom-left":"left bottom","bottom-right":"right bottom"},GP={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},Rx=_.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialScale:i=.9,origin:l="center",onAnimationStart:c,onAnimationComplete:d},u)=>{let f=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:GP,custom:i,transition:Gr(n,r,o),className:m(a),style:{transformOrigin:$P[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});Rx.displayName="Scale";var wx=_.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,horizontal:s=false,startingSize:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},u)=>{let f=s?"width":"height",p={hidden:{[f]:i,opacity:l?0:1},visible:{[f]:"auto",opacity:1},exit:{[f]:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:u,initial:"hidden",animate:"visible",exit:"exit",variants:p,transition:Gr(n,r,o),className:m("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});wx.displayName="Collapse";var Cx=_.forwardRef(({show:e=true,children:t,duration:n=.4,delay:r=0,ease:o,className:a,initialWidth:s=0,initialHeight:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},u)=>{let f={hidden:{width:s,height:i,opacity:l?0:1},visible:{width:"auto",height:"auto",opacity:1},exit:{width:s,height:i,opacity:l?0:1}};return jsx(AnimatePresence,{initial:false,children:e&&jsx(motion.div,{ref:u,initial:"hidden",animate:"visible",exit:"exit",variants:f,transition:Gr(n,r,o),className:m("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Cx.displayName="Expand";var Tx=_.forwardRef(({show:e=true,children:t,duration:n=.3,delay:r=0,ease:o,className:a,unmountOnExit:s=true,initialRotation:i=-180,finalRotation:l=0,onAnimationStart:c,onAnimationComplete:d},u)=>{let f={hidden:{opacity:0,rotate:i},visible:{opacity:1,rotate:l},exit:{opacity:0,rotate:i}},p=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:f,transition:Gr(n,r,o),className:m(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Tx.displayName="Rotate";var Mx=_.forwardRef(({front:e,back:t,direction:n="horizontal",flipped:r=false,duration:o=.6,delay:a=0,ease:s,className:i,onAnimationStart:l,onAnimationComplete:c},d)=>{let u=n==="horizontal"?"rotateY":"rotateX";return jsx("div",{ref:d,className:m("relative",i),style:{perspective:1e3},children:jsxs(motion.div,{animate:{[u]:r?180:0},transition:Gr(o,a,s),style:{transformStyle:"preserve-3d"},onAnimationStart:l,onAnimationComplete:c,children:[jsx("div",{className:"absolute inset-0",style:{backfaceVisibility:"hidden"},children:e}),jsx("div",{className:"absolute inset-0",style:{backfaceVisibility:"hidden",transform:`${u}(180deg)`},children:t})]})})});Mx.displayName="Flip";var Nx=_.forwardRef(({color:e="currentColor",duration:t=.6,children:n,className:r,disabled:o=false},a)=>{let[s,i]=_.useState([]),l=_.useRef(null),c=u=>{if(o)return;let f=l.current;if(!f)return;let p=f.getBoundingClientRect(),g=u.clientX-p.left,h=u.clientY-p.top,v=Math.max(p.width,p.height)*2,b={id:Date.now(),x:g,y:h,size:v};i(w=>[...w,b]);},d=u=>{i(f=>f.filter(p=>p.id!==u));};return jsxs("div",{ref:a,className:m("relative overflow-hidden rounded-[inherit]",r),onClick:c,children:[jsx("div",{ref:l,className:"relative z-0",children:n}),jsx(AnimatePresence,{children:s.map(u=>jsx(motion.span,{initial:{scale:0,opacity:.35},animate:{scale:1,opacity:0},exit:{opacity:0},transition:{duration:t,ease:"easeOut"},onAnimationComplete:()=>d(u.id),className:"pointer-events-none absolute rounded-full",style:{left:u.x-u.size/2,top:u.y-u.size/2,width:u.size,height:u.size,backgroundColor:e}},u.id))})]})});Nx.displayName="Ripple";var kx=_.forwardRef(({children:e,animate:t=true,height:n=10,duration:r=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=_.useState(false),d=s?l:t,u={idle:{y:0},bounce:{y:[0,-n,0],transition:{duration:r,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:u,initial:"idle",animate:d?"bounce":"idle",className:m(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});kx.displayName="Bounce";var jP={subtle:[0,-2,2,-2,2,-1,1,0],normal:[0,-5,5,-5,5,-3,3,0],strong:[0,-10,10,-10,10,-5,5,0]},Px=_.forwardRef(({children:e,animate:t=true,intensity:n="normal",duration:r=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=_.useState(false),d=s?l:t,u={idle:{x:0},shake:{x:jP[n],transition:{duration:r,ease:"easeInOut",repeat:o-1}}};return jsx(motion.div,{ref:i,variants:u,initial:"idle",animate:d?"shake":"idle",className:m(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});Px.displayName="Shake";var _P={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},Ex=_.forwardRef(({children:e,animate:t=true,speed:n="normal",className:r},o)=>jsx("div",{ref:o,className:m(t&&_P[n],r),children:e}));Ex.displayName="Pulse";var Lx=_.forwardRef(({children:e,animate:t=true,angle:n=10,duration:r=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=_.useState(false),d=s?l:t,u={idle:{rotate:0},wiggle:{rotate:[0,-n,n,-n,n,0],transition:{duration:r,ease:"easeInOut",repeat:o===0?1/0:o-1,repeatType:"loop"}}};return jsx(motion.div,{ref:i,variants:u,initial:"idle",animate:d?"wiggle":"idle",className:m(a),onMouseEnter:()=>s&&c(true),onMouseLeave:()=>s&&c(false),children:e})});Lx.displayName="Wiggle";var Sx=_.forwardRef(({children:e,animate:t=false,scale:n=1.2,duration:r=.2,className:o,triggerOnHover:a=false,triggerOnClick:s=false},i)=>{let[l,c]=_.useState(false),d=t||l,u={type:"spring",stiffness:400,damping:17,duration:r},f=()=>{s&&(c(true),setTimeout(()=>c(false),r*1e3));};return jsx(motion.div,{ref:i,animate:{scale:d?n:1},transition:u,className:m(o),onMouseEnter:()=>a&&c(true),onMouseLeave:()=>a&&c(false),onClick:f,children:e})});Sx.displayName="Pop";var JP=(e,t,n,r)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,n);return s?`${i}${r}${s}`:i},Dx=_.forwardRef(({value:e,from:t=0,duration:n=2,decimals:r=0,prefix:o="",suffix:a="",separator:s=",",decimalSeparator:i=".",animateOnView:l=true,delay:c=0,className:d,onComplete:u},f)=>{let p=_.useRef(null),g=useInView(p,{once:true}),[h,v]=_.useState(!l);_.useEffect(()=>{if(l&&g){let x=setTimeout(()=>v(true),c*1e3);return ()=>clearTimeout(x)}},[l,g,c]);let b=useMotionValue(t),w=useTransform(b,x=>JP(x,r,s,i));return _.useEffect(()=>{if(h){let x=animate(b,e,{duration:n,ease:"easeOut",onComplete:u});return ()=>x.stop()}},[h,e,n,b,u]),jsx("span",{ref:p,className:m(d),children:jsxs("span",{ref:f,children:[o,jsx(motion.span,{children:w}),a]})})});Dx.displayName="Counter";var Hx=_.forwardRef(({text:e,speed:t=50,delay:n=0,pauseBetween:r=1500,cursor:o=true,cursorChar:a="|",loop:s=false,deleteSpeed:i=30,animateOnView:l=true,className:c,cursorClassName:d,onComplete:u},f)=>{let p=Array.isArray(e)?e:[e],[g,h]=_.useState(""),[v,b]=_.useState(0),[w,x]=_.useState(false),[R,C]=_.useState(false),y=_.useRef(null),N=useInView(y,{once:true}),[T,k]=_.useState(!l);return _.useEffect(()=>{if(l&&N){let E=setTimeout(()=>k(true),n*1e3);return ()=>clearTimeout(E)}},[l,N,n]),_.useEffect(()=>{if(!T||R)return;let E=p[v],M;return w?g.length>0?M=setTimeout(()=>{h(g.slice(0,-1));},i):(x(false),b(P=>(P+1)%p.length)):g.length<E.length?M=setTimeout(()=>{h(E.slice(0,g.length+1));},t):v<p.length-1||s?M=setTimeout(()=>{x(true);},r):(C(true),u?.()),()=>clearTimeout(M)},[T,g,v,w,R,p,t,i,r,s,u]),jsxs("span",{ref:y,className:m(c),children:[jsx("span",{ref:f,children:g}),o&&jsx(motion.span,{animate:{opacity:[1,0]},transition:{duration:.8,repeat:1/0,repeatType:"reverse"},className:m("ml-0.5",d),children:a})]})});Hx.displayName="Typewriter";var Ix=_.forwardRef(({children:e,direction:t="up",stagger:n=.05,duration:r=.5,delay:o=0,splitBy:a="word",animateOnView:s=true,className:i},l)=>{let c=_.useRef(null),d=useInView(c,{once:true,amount:.5}),u=s?d:true,f=typeof e=="string"?e:"",p=a==="word"?f.split(" "):f.split(""),g={up:{y:20},down:{y:-20},left:{x:20},right:{x:-20}},h={hidden:{},visible:{transition:{staggerChildren:n,delayChildren:o}}},v={hidden:{opacity:0,...g[t]},visible:{opacity:1,x:0,y:0,transition:{duration:r,ease:"easeInOut"}}};return jsx(motion.div,{ref:l,className:m("inline-flex flex-wrap",i),variants:h,initial:"hidden",animate:u?"visible":"hidden",children:jsx("span",{ref:c,children:p.map((b,w)=>jsxs(motion.span,{variants:v,className:"inline-block",children:[b,a==="word"&&w<p.length-1&&"\xA0"]},w))})})});Ix.displayName="TextReveal";var Vx=_.forwardRef(({words:e,duration:t=2,animation:n="slide",animationDuration:r=.5,className:o,loop:a=true},s)=>{let[i,l]=_.useState(0);_.useEffect(()=>{if(!a&&i===e.length-1)return;let d=setInterval(()=>{l(u=>(u+1)%e.length);},t*1e3);return ()=>clearInterval(d)},[e.length,t,a,i]);let c=()=>{switch(n){case "fade":return {initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}};case "slide":return {initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20}};case "scale":return {initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.2}};case "blur":return {initial:{opacity:0,filter:"blur(10px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(10px)"}}}};return jsx("span",{ref:s,className:m("relative inline-block",o),children:jsx(AnimatePresence,{mode:"wait",children:jsx(motion.span,{variants:c(),initial:"initial",animate:"animate",exit:"exit",transition:{duration:r},className:"inline-block",children:e[i]},e[i])})})});Vx.displayName="WordRotate";var Bx=_.forwardRef(({children:e,direction:t="up",distance:n=50,duration:r=.6,delay:o=0,once:a=true,threshold:s=.1,className:i,scale:l,rotate:c,blur:d,ease:u=[.4,0,.2,1]},f)=>{let p=_.useRef(null),g=useInView(p,{once:a,amount:s}),v={up:{x:0,y:n},down:{x:0,y:-n},left:{x:n,y:0},right:{x:-n,y:0},none:{x:0,y:0}}[t],b={hidden:{opacity:0,x:v.x,y:v.y,scale:l??1,rotate:c??0,filter:d?`blur(${d}px)`:"blur(0px)"},visible:{opacity:1,x:0,y:0,scale:1,rotate:0,filter:"blur(0px)",transition:{duration:r,delay:o,ease:u}}};return jsx("div",{ref:p,children:jsx(motion.div,{ref:f,variants:b,initial:"hidden",animate:g?"visible":"hidden",className:m(i),children:e})})});Bx.displayName="ScrollReveal";var Fx=_.forwardRef(({position:e="top",size:t=4,color:n="hsl(var(--primary))",backgroundColor:r="transparent",zIndex:o=50,className:a,container:s,showPercentage:i=false,useSpring:l=true},c)=>{let{scrollYProgress:d}=useScroll({container:s}),u=useSpring(d,{stiffness:100,damping:30,restDelta:.001}),f=l?u:d,p=e==="top"||e==="bottom",g={top:{top:0,left:0,right:0,height:t},bottom:{bottom:0,left:0,right:0,height:t},left:{top:0,left:0,bottom:0,width:t},right:{top:0,right:0,bottom:0,width:t}},h=p?"scaleX":"scaleY",v=p?"left":"top";return jsxs("div",{ref:c,className:m("fixed",a),style:{...g[e],zIndex:o,backgroundColor:r},children:[jsx(motion.div,{className:"h-full w-full",style:{[h]:f,transformOrigin:v,backgroundColor:n}}),i&&jsx(tE,{progress:f,position:e})]})});Fx.displayName="ScrollProgress";var tE=({progress:e,position:t})=>{let n=useTransform(e,s=>Math.round(s*100)),[r,o]=_.useState(0);return _.useEffect(()=>{let s=n.on("change",o);return ()=>s()},[n]),jsxs("span",{className:m("fixed rounded bg-background/80 px-2 py-1 text-xs font-medium backdrop-blur-sm",{top:"top-2 right-4",bottom:"bottom-2 right-4",left:"top-4 left-2",right:"top-4 right-2"}[t]),children:[r,"%"]})},Kx=_.forwardRef(({children:e,speed:t=.5,direction:n="vertical",className:r,container:o},a)=>{let s=_.useRef(null),{scrollYProgress:i}=useScroll({target:s,container:o,offset:["start end","end start"]}),l=[-100*t,100*t],c=useTransform(i,[0,1],l),d=useSpring(c,{stiffness:100,damping:30}),u=n==="horizontal"?d:0,f=n==="vertical"?d:0;return jsx("div",{ref:s,className:m("overflow-hidden",r),children:jsx(motion.div,{ref:a,style:{x:u,y:f},children:e})})});Kx.displayName="Parallax";var Ux=_.forwardRef(({children:e,width:t,height:n,duration:r=1.5,direction:o="right",baseColor:a="hsl(var(--muted))",highlightColor:s="hsl(var(--muted-foreground) / 0.1)",borderRadius:i,className:l,active:c=true},d)=>{let u={left:"to left",right:"to right",top:"to top",bottom:"to bottom"},f={left:"shimmer-left",right:"shimmer-right",top:"shimmer-top",bottom:"shimmer-bottom"};return jsxs("div",{ref:d,className:m("relative overflow-hidden",l),style:{width:t,height:n,borderRadius:i,backgroundColor:a},children:[e,c&&jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(${u[o]}, transparent, ${s}, transparent)`,animation:`${f[o]} ${r}s infinite`}}),jsx("style",{children:`
56
56
  @keyframes shimmer-right {
57
57
  0% { transform: translateX(-100%); }
58
58
  100% { transform: translateX(100%); }