@reeverdev/ui 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as Z from'react';import {createContext,useState,useRef,useCallback,useEffect,useContext,useMemo}from'react';import {cva}from'class-variance-authority';import {AlertCircle,AlertTriangle,CheckCircle2,Info,Minus,Check,X,ChevronDown,Search,ChevronRight,ChevronsUpDown,PanelLeft,PanelLeftOpen,PanelRightOpen,PanelLeftClose,PanelRightClose,EyeOff,Eye,Plus,Heart,Star,TrendingUp,TrendingDown,Upload,Clock,Menu,ExternalLink,ArrowUp,Circle,File,Folder,FolderOpen,Loader2,Copy,Calendar,ZoomOut,ZoomIn,RotateCw,Download,Minimize2,Maximize2,ChevronLeft,GripVertical,Moon,Sun,Monitor,MoreHorizontal,HelpCircle,Hash,User,Settings,ArrowRight,Play,Pause,SkipBack,SkipForward,VolumeX,Volume2,PictureInPicture,Minimize,Maximize,Shuffle,Repeat,Volume1,Printer,FileWarning,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 Ua from'react-dom';import {Toaster}from'sonner';export{toast}from'sonner';import {motion,AnimatePresence,useInView,useMotionValue,useTransform,animate,useScroll,useSpring}from'framer-motion';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 {useSensors,useSensor,PointerSensor,KeyboardSensor,DndContext,closestCorners,DragOverlay,closestCenter}from'@dnd-kit/core';import {sortableKeyboardCoordinates,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import {CSS}from'@dnd-kit/utilities';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 jM from'embla-carousel-react';import QM,{centerCrop,makeAspectCrop}from'react-image-crop';import'react-image-crop/dist/ReactCrop.css';import iT from'react-qr-code';import {useTheme,ThemeProvider}from'next-themes';export{useTheme}from'next-themes';import Vo from'canvas-confetti';function m(...e){return twMerge(clsx(e))}var Ux=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"}}),_x={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},jx=Z.forwardRef(({className:e,variant:t="solid",type:r="default",radius:n="md",icon:o,hideIcon:a=false,endContent:s,children:i,...l},c)=>{let d=_x[r],u=!a,p=o!==void 0?o:d?jsx(d,{className:"h-4 w-4"}):null;return jsxs("div",{ref:c,role:"alert",className:m(Ux({variant:t,type:r,radius:n}),s&&"flex items-center justify-between",e),...l,children:[jsxs("div",{className:"flex items-start gap-3",children:[u&&p&&jsx("span",{className:"mt-0.5 shrink-0",children:p}),jsx("div",{children:i})]}),s&&jsx("div",{className:"shrink-0 ml-4",children:s})]})});jx.displayName="Alert";var Wx=Z.forwardRef(({className:e,...t},r)=>jsx("h5",{ref:r,className:m("mb-1 font-medium leading-none tracking-tight",e),...t}));Wx.displayName="AlertTitle";var Yx=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:m("text-sm [&_p]:leading-relaxed",e),...t}));Yx.displayName="AlertDescription";var qx=cva("absolute rounded-full flex items-center justify-center font-semibold",{variants:{variant:{solid:"",bordered:"border"},color:{default:"",success:"",warning:"",danger:""},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:"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"},{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"}}),Xx={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},Zx={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"},Jx=Z.forwardRef(({className:e,children:t,content:r,variant:n="solid",color:o="default",size:a="md",placement:s="top-right",isDot:i=false,showPing:l=false,...c},d)=>jsxs("div",{ref:d,className:m("relative inline-flex",e),...c,children:[t,jsxs("span",{className:m(qx({variant:n,color:o,size:i?void 0:a,placement:s}),i&&Xx[a||"md"],i&&"min-w-0 p-0"),children:[l&&jsx("span",{className:m("absolute inset-0 rounded-full animate-ping opacity-75",Zx[o||"default"])}),!i&&r]})]}));Jx.displayName="Badge";var Qx=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"},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"}}),ey=Z.forwardRef(({className:e,color:t,size:r,...n},o)=>jsx("span",{ref:o,className:m(Qx({color:t,size:r}),e),...n}));ey.displayName="TextBadge";var Da=cva("",{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-green-600 dark:text-green-500",warning:"text-amber-600 dark:text-amber-500",danger:"text-red-600 dark:text-red-500",white:"text-white",current:""}},defaultVariants:{size:"md",color:"default"}}),ry={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},ny={sm:"text-xs",md:"text-sm",lg:"text-base"},Ha=Z.forwardRef(({className:e,variant:t="spinner",size:r="md",color:n="default",label:o="Loading",text:a,textPosition:s="right",...i},l)=>{let d=(()=>{switch(t){case "dots":return jsx("div",{className:"flex items-center gap-1",children:[0,1,2].map(g=>jsx("div",{className:m(ry[r||"md"],"animate-bounce rounded-full bg-current",Da({color:n})),style:{animationDelay:`${g*.15}s`}},g))});case "pulse":return jsx("div",{className:m(Da({size:r,color:n}),"animate-pulse rounded-full bg-current")});default:return jsxs("svg",{className:m(Da({size:r,color:n}),"animate-spin"),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}})();if(!a)return jsx("div",{ref:l,className:m("inline-flex",e),role:"status","aria-label":o,...i,children:d});let u=jsx("span",{className:m("text-muted-foreground",ny[r]),children:a}),p=s==="top"||s==="bottom";return jsxs("div",{ref:l,role:"status","aria-label":o,className:m("inline-flex items-center",p?"flex-col gap-2":"flex-row gap-3",(s==="left"||s==="top")&&(p?"flex-col-reverse":"flex-row-reverse"),e),...i,children:[d,u]})});Ha.displayName="Spinner";var Jc=Z.createContext({});function vi(){return Z.useContext(Jc)}var Qc=Z.forwardRef(({className:e,orientation:t="horizontal",isDisabled:r,children:n,...o},a)=>{let s=t==="horizontal";return jsx(Jc.Provider,{value:{disabled:r},children:jsx("div",{ref:a,role:"group",className:m("inline-flex",s?"flex-row":"flex-col",s&&["[&>*:not(:first-child):not(:last-child)]:rounded-none","[&>*:first-child]:rounded-r-none","[&>*:last-child]:rounded-l-none",!r&&"[&>*:not(:first-child)]:-ml-px"],!s&&["[&>*:not(:first-child):not(:last-child)]:rounded-none","[&>*:first-child]:rounded-b-none","[&>*:last-child]:rounded-t-none",!r&&"[&>*:not(:first-child)]:-mt-px"],e),...o,children:n})})});Qc.displayName="ButtonGroup";var ed=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:m("w-px self-stretch bg-border",e),...t}));ed.displayName="ButtonGroupSeparator";var no=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-80",light:"bg-transparent hover:bg-accent",flat:"hover:opacity-80",ghost:"border border-border bg-transparent"},color:{default:"",success:"",warning:"",danger:""},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-primary text-primary-foreground hover:bg-primary/90"},{variant:"bordered",color:"default",className:"border-border text-foreground"},{variant:"light",color:"default",className:"text-foreground hover:bg-accent"},{variant:"flat",color:"default",className:"bg-secondary text-secondary-foreground"},{variant:"ghost",color:"default",className:"text-foreground hover:bg-primary hover:text-primary-foreground hover:border-primary"},{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:"border-green-600 text-green-600 hover:bg-green-600 hover:text-white dark:border-green-500 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:"border-amber-600 text-amber-600 hover:bg-amber-600 hover:text-white dark:border-amber-500 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:"border-red-600 text-red-600 hover:bg-red-600 hover:text-white dark:border-red-500 dark:text-red-500 dark:hover:bg-red-500 dark:hover:text-white"}],defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md"}}),me=Z.forwardRef(({className:e,variant:t,color:r,size:n,radius:o,href:a,isLoading:s=false,isDisabled:i,startContent:l,endContent:c,children:d,style:u,isIconOnly:p,...f},g)=>{let v=vi(),b=i||v.disabled||s,h=u,x=p?n==="sm"?"!px-0 !w-9":n==="lg"?"!px-0 !w-11":"!px-0 !w-10":"",N=s?jsxs(Fragment,{children:[jsx(Ha,{size:"sm",color:"current"}),d]}):jsxs(Fragment,{children:[l,d,c]});return a?b?jsx("span",{role:"link","aria-disabled":"true",className:m(no({variant:t,color:r,size:n,radius:o,className:e}),x,"pointer-events-none opacity-50 cursor-not-allowed"),style:h,children:N}):jsx("a",{href:a,className:m(no({variant:t,color:r,size:n,radius:o,className:e}),x),style:h,...f,children:N}):jsx("button",{type:"button",className:m(no({variant:t,color:r,size:n,radius:o,className:e}),x),ref:g,disabled:b,"aria-busy":s,"aria-disabled":b,style:h,...f,children:N})});me.displayName="Button";var od=cva("border bg-card text-card-foreground shadow-sm",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{radius:"lg"}}),ad=Z.forwardRef(({className:e,radius:t,...r},n)=>jsx("div",{ref:n,className:m(od({radius:t,className:e})),...r}));ad.displayName="Card";var sd=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:m("flex flex-col space-y-1.5 p-6",e),...t}));sd.displayName="CardHeader";var id=Z.forwardRef(({className:e,...t},r)=>jsx("h3",{ref:r,className:m("text-2xl font-semibold leading-none tracking-tight",e),...t}));id.displayName="CardTitle";var ld=Z.forwardRef(({className:e,...t},r)=>jsx("p",{ref:r,className:m("text-sm text-muted-foreground",e),...t}));ld.displayName="CardDescription";var cd=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:m("p-6 pt-0",e),...t}));cd.displayName="CardContent";var dd=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:m("flex items-center p-6 pt-0",e),...t}));dd.displayName="CardFooter";var ly={sm:{box:"h-3.5 w-3.5",icon:"h-3 w-3",label:"text-xs",description:"text-[10px]",gap:"gap-1.5"},md:{box:"h-4 w-4",icon:"h-4 w-4",label:"text-sm",description:"text-xs",gap:"gap-2"},lg:{box:"h-5 w-5",icon:"h-5 w-5",label:"text-base",description:"text-sm",gap:"gap-2.5"}},cy={default:{border:"border-primary",bg:"bg-primary",text:"text-primary-foreground"},success:{border:"border-green-500",bg:"bg-green-500",text:"text-white"},warning:{border:"border-yellow-500",bg:"bg-yellow-500",text:"text-white"},danger:{border:"border-red-500",bg:"bg-red-500",text:"text-white"}},Ko=Z.forwardRef(({className:e,checked:t,defaultChecked:r=false,onCheckedChange:n,isDisabled:o,isRequired:a,name:s,value:i="on",text:l,description:c,size:d="md",color:u="default",onKeyDown:p,...f},g)=>{let[v,b]=Z.useState(r),h=t!==void 0,x=h?t:v,[R,N]=Z.useState(false),w=Z.useId(),y=ly[d],C=cy[u],E=()=>{if(o)return;let M=x==="indeterminate"?true:!x;h||b(M),n?.(M);},L=M=>{M.key==="Enter"&&M.preventDefault(),p?.(M);},k=x===true,S=x==="indeterminate",T=jsxs(Fragment,{children:[jsx("button",{type:"button",role:"checkbox",id:l?w:void 0,"aria-checked":S?"mixed":k,"aria-required":a,disabled:o,ref:g,className:m("peer shrink-0 rounded-sm border focus-visible:outline-none cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 transition-colors",y.box,C.border,k&&[C.bg,C.text],S&&"bg-background text-foreground",!l&&e),style:{borderColor:R?"var(--color-foreground)":void 0},onClick:E,onKeyDown:L,onFocus:()=>N(true),onBlur:()=>N(false),...f,children:jsx("span",{className:"flex items-center justify-center text-current",children:S?jsx(Minus,{className:y.icon}):k?jsx(Check,{className:y.icon}):null})}),s&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:s,value:i,checked:k,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-center",y.gap,e),children:[T,jsxs("div",{className:"flex flex-col",children:[jsx("label",{htmlFor:w,className:m("font-medium leading-none cursor-pointer",y.label,o&&"cursor-not-allowed opacity-50"),children:l}),c&&jsx("p",{className:m("text-muted-foreground mt-0.5",y.description),children:c})]})]}):T});Ko.displayName="Checkbox";var my=cva("flex w-full border border-input bg-background px-3 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:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl"}},defaultVariants:{size:"md",radius:"md"}}),Qr=Z.forwardRef(({className:e,type:t,size:r,radius:n,label:o,isRequired:a,isDisabled:s,isReadOnly:i,description:l,errorMessage:c,isInvalid:d,startContent:u,endContent:p,onFocus:f,onBlur:g,style:v,...b},h)=>{let[x,R]=Z.useState(false),N=Z.useId(),w=b.id||N,y=d||!!c,C=u||p,E=jsx("input",{id:w,type:t,className:m(my({size:r,radius:n}),y&&"border-danger focus:border-danger",u&&"pl-10",p&&"pr-10",!o&&!C&&e),ref:h,required:a,disabled:s,readOnly:i,"aria-invalid":y,"aria-describedby":l||c?`${w}-description`:void 0,style:{...v,borderColor:y?void 0:x?"var(--color-foreground)":void 0},onFocus:k=>{R(true),f?.(k);},onBlur:k=>{R(false),g?.(k);},...b}),L=C?jsxs("div",{className:m("relative",!o&&e),children:[u&&jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:u}),E,p&&jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:p})]}):E;return !o&&!l&&!c?L:jsxs("div",{className:m("flex flex-col gap-1.5",e),children:[o&&jsxs("label",{htmlFor:w,className:"text-sm font-medium leading-none",children:[o,a&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),L,(l||c)&&jsx("p",{id:`${w}-description`,className:m("text-xs",y?"text-danger":"text-muted-foreground"),children:c||l})]})});Qr.displayName="Input";var fy=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Pn=Z.forwardRef(({className:e,...t},r)=>jsx("label",{ref:r,className:m(fy(),e),...t}));Pn.displayName="Label";var by=Z.forwardRef(({className:e,orientation:t="horizontal",decorative:r=true,text:n,...o},a)=>{let s=r?{role:"none"}:{role:"separator","aria-orientation":t};return n&&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:n}),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})});by.displayName="Separator";var hy="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",Aa={default:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"},pd={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"}},fd=Z.forwardRef(({className:e,color:t,size:r="md",customColor:n,checked:o,defaultChecked:a=false,onCheckedChange:s,isDisabled:i,isRequired:l,name:c,value:d="on",onKeyDown:u,style:p,...f},g)=>{let[v,b]=Z.useState(a),h=o!==void 0,x=h?o:v,R=()=>{if(i)return;let C=!x;h||b(C),s?.(C);},N=C=>{C.key==="Enter"&&C.preventDefault(),u?.(C);},w=t&&Aa[t]?Aa[t]:Aa.default,y=pd[r]||pd.md;return jsxs(Fragment,{children:[jsx("button",{type:"button",role:"switch","aria-checked":x,"aria-required":l,"data-state":x?"checked":"unchecked",disabled:i,ref:g,className:m(hy,y.track,x?n?"":w:"bg-input",e),style:n&&x?{backgroundColor:n,...p}:p,onClick:R,onKeyDown:N,...f,children:jsx("span",{className:m("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",y.thumb,x?y.translate:"translate-x-0")})}),c&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:c,value:d,checked:x,required:l,disabled:i,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]})});fd.displayName="Switch";var wy=cva("flex w-full border border-input bg-background px-3 placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"min-h-[60px] py-1.5 text-xs",md:"min-h-[80px] py-2 text-sm",lg:"min-h-[100px] py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl"}},defaultVariants:{size:"md",radius:"md"}}),Ba=Z.forwardRef(({className:e,size:t,radius:r,label:n,isRequired:o,isDisabled:a,isReadOnly:s,description:i,errorMessage:l,isInvalid:c,showCount:d,onFocus:u,onBlur:p,onChange:f,value:g,defaultValue:v,maxLength:b,style:h,...x},R)=>{let[N,w]=Z.useState(false),[y,C]=Z.useState(v?.toString()||""),E=Z.useId(),L=x.id||E,k=c||!!l,T=(g!==void 0?String(g):y).length,M=P=>{g===void 0&&C(P.target.value),f?.(P);},D=jsx("textarea",{id:L,className:m(wy({size:t,radius:r}),k&&"border-danger focus:border-danger",!n&&!d&&e),ref:R,required:o,disabled:a,readOnly:s,"aria-invalid":k,"aria-describedby":i||l?`${L}-description`:void 0,value:g,defaultValue:g===void 0?v:void 0,maxLength:b,style:{...h,borderColor:k?void 0:N?"var(--color-foreground)":void 0},onFocus:P=>{w(true),u?.(P);},onBlur:P=>{w(false),p?.(P);},onChange:M,...x});return !n&&!i&&!l&&!d?D:jsxs("div",{className:m("flex flex-col gap-1.5",e),children:[n&&jsxs("label",{htmlFor:L,className:"text-sm font-medium leading-none",children:[n,o&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),D,jsxs("div",{className:"flex justify-between items-center",children:[i||l?jsx("p",{id:`${L}-description`,className:m("text-xs",k?"text-danger":"text-muted-foreground"),children:l||i}):jsx("span",{}),d&&jsxs("span",{className:"text-xs text-muted-foreground",children:[T,b?`/${b}`:""]})]})]})});Ba.displayName="Textarea";var bd=cva("rounded-md bg-muted",{variants:{variant:{pulse:"animate-pulse",shimmer:"skeleton-shimmer",static:""}},defaultVariants:{variant:"pulse"}}),$a=Z.forwardRef(({className:e,variant:t,...r},n)=>jsx("div",{ref:n,className:m(bd({variant:t,className:e})),...r}));$a.displayName="Skeleton";var Ny=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-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",radius:"full"}}),vd=Z.createContext(null),hd=()=>{let e=Z.useContext(vd);if(!e)throw new Error("Avatar components must be used within an Avatar");return e},Dn=Z.forwardRef(({className:e,size:t,radius:r,...n},o)=>{let[a,s]=Z.useState("idle");return jsx(vd.Provider,{value:{imageLoadingStatus:a,onImageLoadingStatusChange:s},children:jsx("span",{ref:o,className:m(Ny({size:t,radius:r,className:e})),...n})})});Dn.displayName="Avatar";var so=Z.forwardRef(({className:e,src:t,alt:r,onLoadingStatusChange:n,...o},a)=>{let{imageLoadingStatus:s,onImageLoadingStatusChange:i}=hd();return Z.useEffect(()=>{if(!t){i("error");return}i("loading"),n?.("loading");let l=new Image;l.src=t,l.onload=()=>{i("loaded"),n?.("loaded");},l.onerror=()=>{i("error"),n?.("error");};},[t,i,n]),s!=="loaded"?null:jsx("img",{ref:a,src:t,alt:r,className:m("aspect-square h-full w-full object-cover",e),...o})});so.displayName="AvatarImage";var Hn=Z.forwardRef(({className:e,delayMs:t=0,children:r,...n},o)=>{let{imageLoadingStatus:a}=hd(),[s,i]=Z.useState(t===0);return Z.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),...n,children:r})});Hn.displayName="AvatarFallback";var yr=({children:e,content:t,position:r="top",offset:n=4,align:o="center",alignOffset:a=0,delayDuration:s=700,showArrow:i=false,open:l,defaultOpen:c=false,onOpenChange:d,className:u})=>{let[p,f]=Z.useState(c),g=l!==void 0,v=g?l:p,b=Z.useRef(null),h=Z.useRef(null),x=Z.useId(),R=Z.useRef(null),[N,w]=Z.useState({top:0,left:0}),[y,C]=Z.useState(false);Z.useEffect(()=>{C(true);},[]);let E=Z.useCallback(M=>{R.current&&clearTimeout(R.current),M?R.current=setTimeout(()=>{g||f(true),d?.(true);},s):(g||f(false),d?.(false));},[g,d,s]);Z.useEffect(()=>()=>{R.current&&clearTimeout(R.current);},[]),Z.useEffect(()=>{if(!v||!b.current||!h.current)return;let M=b.current.getBoundingClientRect(),D=h.current.getBoundingClientRect(),P=0,I=0;switch(r){case "top":P=M.top-D.height-n;break;case "bottom":P=M.bottom+n;break;case "left":I=M.left-D.width-n;break;case "right":I=M.right+n;break}if(r==="top"||r==="bottom")switch(o){case "start":I=M.left+a;break;case "center":I=M.left+M.width/2-D.width/2;break;case "end":I=M.right-D.width-a;break}else switch(o){case "start":P=M.top+a;break;case "center":P=M.top+M.height/2-D.height/2;break;case "end":P=M.bottom-D.height-a;break}w({top:P,left:I});},[v,r,n,o,a]);let L={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"}[r],k={top:"left-1/2 -translate-x-1/2 bottom-0 translate-y-1/2 rotate-45",bottom:"left-1/2 -translate-x-1/2 top-0 -translate-y-1/2 rotate-45",left:"top-1/2 -translate-y-1/2 right-0 translate-x-1/2 rotate-45",right:"top-1/2 -translate-y-1/2 left-0 -translate-x-1/2 rotate-45"}[r],S=e.props,T=Z.cloneElement(e,{ref:M=>{b.current=M;let D=e.ref;typeof D=="function"?D(M):D&&typeof D=="object"&&(D.current=M);},"aria-describedby":v?x:void 0,onMouseEnter:M=>{S.onMouseEnter?.(M),E(true);},onMouseLeave:M=>{S.onMouseLeave?.(M),E(false);},onFocus:M=>{S.onFocus?.(M),E(true);},onBlur:M=>{S.onBlur?.(M),E(false);}});return jsxs(Fragment,{children:[T,y&&v&&Ua.createPortal(jsxs("div",{ref:h,id:x,role:"tooltip","data-position":r,className:m("fixed z-50",L,u),style:{top:N.top,left:N.left},children:[i&&jsx("span",{className:m("absolute z-0 w-2 h-2 bg-zinc-100 dark:bg-zinc-900",k)}),jsx("div",{className:"relative z-10 rounded-md px-3 py-1.5 text-xs bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",children:t})]}),document.body)]})};yr.displayName="Tooltip";var Sy={sm:"20px",md:"40px",lg:"60px"},ze=Z.forwardRef(({className:e,orientation:t="vertical",visibility:r="visible",showShadow:n=false,shadowSize:o="md",children:a,style:s,...i},l)=>{let c=Z.useRef(null),[d,u]=Z.useState(false),[p,f]=Z.useState({top:false,bottom:false,left:false,right:false}),g=Z.useId().replace(/:/g,"");Z.useImperativeHandle(l,()=>c.current);let v=Z.useCallback(()=>{let w=c.current;if(!w||!n)return;let{scrollTop:y,scrollLeft:C,scrollHeight:E,scrollWidth:L,clientHeight:k,clientWidth:S}=w;f({top:y>0,bottom:y<E-k-1,left:C>0,right:C<L-S-1});},[n]);Z.useEffect(()=>{if(!n)return;let w=c.current;if(w)return v(),w.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{w.removeEventListener("scroll",v),window.removeEventListener("resize",v);}},[n,v]);let b=r==="visible"||r==="hover"&&d,h=b?"rgba(0,0,0,0.3)":"transparent",x=b?"rgba(255,255,255,0.3)":"transparent",R=`
|
|
1
|
+
import*as Z from'react';import {createContext,useState,useRef,useCallback,useEffect,useContext,useMemo}from'react';import {cva}from'class-variance-authority';import {AlertCircle,AlertTriangle,CheckCircle2,Info,Minus,Check,X,ChevronDown,Search,ChevronRight,ChevronsUpDown,PanelLeft,PanelLeftOpen,PanelRightOpen,PanelLeftClose,PanelRightClose,EyeOff,Eye,Plus,Heart,Star,TrendingUp,TrendingDown,Upload,Clock,Menu,ExternalLink,ArrowUp,Circle,File,Folder,FolderOpen,Loader2,Copy,Calendar,ZoomOut,ZoomIn,RotateCw,Download,Minimize2,Maximize2,ChevronLeft,GripVertical,Moon,Sun,Monitor,MoreHorizontal,HelpCircle,Hash,User,Settings,ArrowRight,Play,Pause,SkipBack,SkipForward,VolumeX,Volume2,PictureInPicture,Minimize,Maximize,Shuffle,Repeat,Volume1,Printer,FileWarning,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 Ua from'react-dom';import {Toaster}from'sonner';export{toast}from'sonner';import {motion,AnimatePresence,useInView,useMotionValue,useTransform,animate,useScroll,useSpring}from'framer-motion';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 {useSensors,useSensor,PointerSensor,KeyboardSensor,DndContext,closestCorners,DragOverlay,closestCenter}from'@dnd-kit/core';import {sortableKeyboardCoordinates,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import {CSS}from'@dnd-kit/utilities';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 jM from'embla-carousel-react';import QM,{centerCrop,makeAspectCrop}from'react-image-crop';import'react-image-crop/dist/ReactCrop.css';import iT from'react-qr-code';import {useTheme,ThemeProvider}from'next-themes';export{useTheme}from'next-themes';import Vo from'canvas-confetti';function m(...e){return twMerge(clsx(e))}var Ux=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"}}),_x={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},jx=Z.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=_x[n],u=!a,p=o!==void 0?o:d?jsx(d,{className:"h-4 w-4"}):null;return jsxs("div",{ref:c,role:"alert",className:m(Ux({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&&p&&jsx("span",{className:"mt-0.5 shrink-0",children:p}),jsx("div",{children:i})]}),s&&jsx("div",{className:"shrink-0 ml-4",children:s})]})});jx.displayName="Alert";var Wx=Z.forwardRef(({className:e,...t},n)=>jsx("h5",{ref:n,className:m("mb-1 font-medium leading-none tracking-tight",e),...t}));Wx.displayName="AlertTitle";var Yx=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("text-sm [&_p]:leading-relaxed",e),...t}));Yx.displayName="AlertDescription";var qx=cva("absolute rounded-full flex items-center justify-center font-semibold",{variants:{variant:{solid:"",bordered:"border"},color:{default:"",success:"",warning:"",danger:""},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:"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"},{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"}}),Xx={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},Zx={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"},Jx=Z.forwardRef(({className:e,children:t,content:n,variant:r="solid",color:o="default",size:a="md",placement:s="top-right",isDot:i=false,showPing:l=false,...c},d)=>jsxs("div",{ref:d,className:m("relative inline-flex",e),...c,children:[t,jsxs("span",{className:m(qx({variant:r,color:o,size:i?void 0:a,placement:s}),i&&Xx[a||"md"],i&&"min-w-0 p-0"),children:[l&&jsx("span",{className:m("absolute inset-0 rounded-full animate-ping opacity-75",Zx[o||"default"])}),!i&&n]})]}));Jx.displayName="Badge";var Qx=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"},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"}}),ey=Z.forwardRef(({className:e,color:t,size:n,...r},o)=>jsx("span",{ref:o,className:m(Qx({color:t,size:n}),e),...r}));ey.displayName="TextBadge";var Da=cva("",{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-green-600 dark:text-green-500",warning:"text-amber-600 dark:text-amber-500",danger:"text-red-600 dark:text-red-500",white:"text-white",current:""}},defaultVariants:{size:"md",color:"default"}}),ny={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-3 w-3"},ry={sm:"text-xs",md:"text-sm",lg:"text-base"},Ha=Z.forwardRef(({className:e,variant:t="spinner",size:n="md",color:r="default",label:o="Loading",text:a,textPosition:s="right",...i},l)=>{let d=(()=>{switch(t){case "dots":return jsx("div",{className:"flex items-center gap-1",children:[0,1,2].map(g=>jsx("div",{className:m(ny[n||"md"],"animate-bounce rounded-full bg-current",Da({color:r})),style:{animationDelay:`${g*.15}s`}},g))});case "pulse":return jsx("div",{className:m(Da({size:n,color:r}),"animate-pulse rounded-full bg-current")});default:return jsxs("svg",{className:m(Da({size:n,color:r}),"animate-spin"),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}})();if(!a)return jsx("div",{ref:l,className:m("inline-flex",e),role:"status","aria-label":o,...i,children:d});let u=jsx("span",{className:m("text-muted-foreground",ry[n]),children:a}),p=s==="top"||s==="bottom";return jsxs("div",{ref:l,role:"status","aria-label":o,className:m("inline-flex items-center",p?"flex-col gap-2":"flex-row gap-3",(s==="left"||s==="top")&&(p?"flex-col-reverse":"flex-row-reverse"),e),...i,children:[d,u]})});Ha.displayName="Spinner";var Jc=Z.createContext({});function vi(){return Z.useContext(Jc)}var Qc=Z.forwardRef(({className:e,orientation:t="horizontal",isDisabled:n,children:r,...o},a)=>{let s=t==="horizontal";return jsx(Jc.Provider,{value:{disabled:n},children:jsx("div",{ref:a,role:"group",className:m("inline-flex",s?"flex-row":"flex-col",s&&["[&>*:not(:first-child):not(:last-child)]:rounded-none","[&>*:first-child]:rounded-r-none","[&>*:last-child]:rounded-l-none",!n&&"[&>*:not(:first-child)]:-ml-px"],!s&&["[&>*:not(:first-child):not(:last-child)]:rounded-none","[&>*:first-child]:rounded-b-none","[&>*:last-child]:rounded-t-none",!n&&"[&>*:not(:first-child)]:-mt-px"],e),...o,children:r})})});Qc.displayName="ButtonGroup";var ed=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("w-px self-stretch bg-border",e),...t}));ed.displayName="ButtonGroupSeparator";var ro=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-80",light:"bg-transparent hover:bg-accent",flat:"hover:opacity-80",ghost:"border border-border bg-transparent"},color:{default:"",success:"",warning:"",danger:""},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-primary text-primary-foreground hover:bg-primary/90"},{variant:"bordered",color:"default",className:"border-border text-foreground"},{variant:"light",color:"default",className:"text-foreground hover:bg-accent"},{variant:"flat",color:"default",className:"bg-secondary text-secondary-foreground"},{variant:"ghost",color:"default",className:"text-foreground hover:bg-primary hover:text-primary-foreground hover:border-primary"},{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:"border-green-600 text-green-600 hover:bg-green-600 hover:text-white dark:border-green-500 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:"border-amber-600 text-amber-600 hover:bg-amber-600 hover:text-white dark:border-amber-500 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:"border-red-600 text-red-600 hover:bg-red-600 hover:text-white dark:border-red-500 dark:text-red-500 dark:hover:bg-red-500 dark:hover:text-white"}],defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md"}}),me=Z.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,href:a,isLoading:s=false,isDisabled:i,startContent:l,endContent:c,children:d,style:u,isIconOnly:p,...f},g)=>{let v=vi(),b=i||v.disabled||s,h=u,x=p?r==="sm"?"!px-0 !w-9":r==="lg"?"!px-0 !w-11":"!px-0 !w-10":"",N=s?jsxs(Fragment,{children:[jsx(Ha,{size:"sm",color:"current"}),d]}):jsxs(Fragment,{children:[l,d,c]});return a?b?jsx("span",{role:"link","aria-disabled":"true",className:m(ro({variant:t,color:n,size:r,radius:o,className:e}),x,"pointer-events-none opacity-50 cursor-not-allowed"),style:h,children:N}):jsx("a",{href:a,className:m(ro({variant:t,color:n,size:r,radius:o,className:e}),x),style:h,...f,children:N}):jsx("button",{type:"button",className:m(ro({variant:t,color:n,size:r,radius:o,className:e}),x),ref:g,disabled:b,"aria-busy":s,"aria-disabled":b,style:h,...f,children:N})});me.displayName="Button";var od=cva("border bg-card text-card-foreground shadow-sm",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{radius:"lg"}}),ad=Z.forwardRef(({className:e,radius:t,...n},r)=>jsx("div",{ref:r,className:m(od({radius:t,className:e})),...n}));ad.displayName="Card";var sd=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex flex-col space-y-1.5 p-6",e),...t}));sd.displayName="CardHeader";var id=Z.forwardRef(({className:e,...t},n)=>jsx("h3",{ref:n,className:m("text-2xl font-semibold leading-none tracking-tight",e),...t}));id.displayName="CardTitle";var ld=Z.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:m("text-sm text-muted-foreground",e),...t}));ld.displayName="CardDescription";var cd=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("p-6 pt-0",e),...t}));cd.displayName="CardContent";var dd=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center p-6 pt-0",e),...t}));dd.displayName="CardFooter";var ly={sm:{box:"h-3.5 w-3.5",icon:"h-3 w-3",label:"text-xs",description:"text-[10px]",gap:"gap-1.5"},md:{box:"h-4 w-4",icon:"h-4 w-4",label:"text-sm",description:"text-xs",gap:"gap-2"},lg:{box:"h-5 w-5",icon:"h-5 w-5",label:"text-base",description:"text-sm",gap:"gap-2.5"}},cy={default:{border:"border-primary",bg:"bg-primary",text:"text-primary-foreground"},success:{border:"border-green-500",bg:"bg-green-500",text:"text-white"},warning:{border:"border-yellow-500",bg:"bg-yellow-500",text:"text-white"},danger:{border:"border-red-500",bg:"bg-red-500",text:"text-white"}},Ko=Z.forwardRef(({className:e,checked:t,defaultChecked:n=false,onCheckedChange:r,isDisabled:o,isRequired:a,name:s,value:i="on",text:l,description:c,size:d="md",color:u="default",onKeyDown:p,...f},g)=>{let[v,b]=Z.useState(n),h=t!==void 0,x=h?t:v,[R,N]=Z.useState(false),w=Z.useId(),y=ly[d],C=cy[u],E=()=>{if(o)return;let M=x==="indeterminate"?true:!x;h||b(M),r?.(M);},L=M=>{M.key==="Enter"&&M.preventDefault(),p?.(M);},k=x===true,S=x==="indeterminate",T=jsxs(Fragment,{children:[jsx("button",{type:"button",role:"checkbox",id:l?w:void 0,"aria-checked":S?"mixed":k,"aria-required":a,disabled:o,ref:g,className:m("peer shrink-0 rounded-sm border focus-visible:outline-none cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 transition-colors",y.box,C.border,k&&[C.bg,C.text],S&&"bg-background text-foreground",!l&&e),style:{borderColor:R?"var(--color-foreground)":void 0},onClick:E,onKeyDown:L,onFocus:()=>N(true),onBlur:()=>N(false),...f,children:jsx("span",{className:"flex items-center justify-center text-current",children:S?jsx(Minus,{className:y.icon}):k?jsx(Check,{className:y.icon}):null})}),s&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:s,value:i,checked:k,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-center",y.gap,e),children:[T,jsxs("div",{className:"flex flex-col",children:[jsx("label",{htmlFor:w,className:m("font-medium leading-none cursor-pointer",y.label,o&&"cursor-not-allowed opacity-50"),children:l}),c&&jsx("p",{className:m("text-muted-foreground mt-0.5",y.description),children:c})]})]}):T});Ko.displayName="Checkbox";var my=cva("flex w-full border border-input bg-background px-3 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:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl"}},defaultVariants:{size:"md",radius:"md"}}),er=Z.forwardRef(({className:e,type:t,size:n,radius:r,label:o,isRequired:a,isDisabled:s,isReadOnly:i,description:l,errorMessage:c,isInvalid:d,startContent:u,endContent:p,onFocus:f,onBlur:g,style:v,...b},h)=>{let[x,R]=Z.useState(false),N=Z.useId(),w=b.id||N,y=d||!!c,C=u||p,E=jsx("input",{id:w,type:t,className:m(my({size:n,radius:r}),y&&"border-danger focus:border-danger",u&&"pl-10",p&&"pr-10",!o&&!C&&e),ref:h,required:a,disabled:s,readOnly:i,"aria-invalid":y,"aria-describedby":l||c?`${w}-description`:void 0,style:{...v,borderColor:y?void 0:x?"var(--color-foreground)":void 0},onFocus:k=>{R(true),f?.(k);},onBlur:k=>{R(false),g?.(k);},...b}),L=C?jsxs("div",{className:m("relative",!o&&e),children:[u&&jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:u}),E,p&&jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:p})]}):E;return !o&&!l&&!c?L:jsxs("div",{className:m("flex flex-col gap-1.5",e),children:[o&&jsxs("label",{htmlFor:w,className:"text-sm font-medium leading-none",children:[o,a&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),L,(l||c)&&jsx("p",{id:`${w}-description`,className:m("text-xs",y?"text-danger":"text-muted-foreground"),children:c||l})]})});er.displayName="Input";var fy=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Pr=Z.forwardRef(({className:e,...t},n)=>jsx("label",{ref:n,className:m(fy(),e),...t}));Pr.displayName="Label";var by=Z.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})});by.displayName="Separator";var hy="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",Aa={default:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"},pd={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"}},fd=Z.forwardRef(({className:e,color:t,size:n="md",customColor:r,checked:o,defaultChecked:a=false,onCheckedChange:s,isDisabled:i,isRequired:l,name:c,value:d="on",onKeyDown:u,style:p,...f},g)=>{let[v,b]=Z.useState(a),h=o!==void 0,x=h?o:v,R=()=>{if(i)return;let C=!x;h||b(C),s?.(C);},N=C=>{C.key==="Enter"&&C.preventDefault(),u?.(C);},w=t&&Aa[t]?Aa[t]:Aa.default,y=pd[n]||pd.md;return jsxs(Fragment,{children:[jsx("button",{type:"button",role:"switch","aria-checked":x,"aria-required":l,"data-state":x?"checked":"unchecked",disabled:i,ref:g,className:m(hy,y.track,x?r?"":w:"bg-input",e),style:r&&x?{backgroundColor:r,...p}:p,onClick:R,onKeyDown:N,...f,children:jsx("span",{className:m("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",y.thumb,x?y.translate:"translate-x-0")})}),c&&jsx("input",{type:"checkbox","aria-hidden":true,tabIndex:-1,name:c,value:d,checked:x,required:l,disabled:i,onChange:()=>{},style:{position:"absolute",pointerEvents:"none",opacity:0,margin:0,width:0,height:0}})]})});fd.displayName="Switch";var wy=cva("flex w-full border border-input bg-background px-3 placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"min-h-[60px] py-1.5 text-xs",md:"min-h-[80px] py-2 text-sm",lg:"min-h-[100px] py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl"}},defaultVariants:{size:"md",radius:"md"}}),Ba=Z.forwardRef(({className:e,size:t,radius:n,label:r,isRequired:o,isDisabled:a,isReadOnly:s,description:i,errorMessage:l,isInvalid:c,showCount:d,onFocus:u,onBlur:p,onChange:f,value:g,defaultValue:v,maxLength:b,style:h,...x},R)=>{let[N,w]=Z.useState(false),[y,C]=Z.useState(v?.toString()||""),E=Z.useId(),L=x.id||E,k=c||!!l,T=(g!==void 0?String(g):y).length,M=P=>{g===void 0&&C(P.target.value),f?.(P);},D=jsx("textarea",{id:L,className:m(wy({size:t,radius:n}),k&&"border-danger focus:border-danger",!r&&!d&&e),ref:R,required:o,disabled:a,readOnly:s,"aria-invalid":k,"aria-describedby":i||l?`${L}-description`:void 0,value:g,defaultValue:g===void 0?v:void 0,maxLength:b,style:{...h,borderColor:k?void 0:N?"var(--color-foreground)":void 0},onFocus:P=>{w(true),u?.(P);},onBlur:P=>{w(false),p?.(P);},onChange:M,...x});return !r&&!i&&!l&&!d?D:jsxs("div",{className:m("flex flex-col gap-1.5",e),children:[r&&jsxs("label",{htmlFor:L,className:"text-sm font-medium leading-none",children:[r,o&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),D,jsxs("div",{className:"flex justify-between items-center",children:[i||l?jsx("p",{id:`${L}-description`,className:m("text-xs",k?"text-danger":"text-muted-foreground"),children:l||i}):jsx("span",{}),d&&jsxs("span",{className:"text-xs text-muted-foreground",children:[T,b?`/${b}`:""]})]})]})});Ba.displayName="Textarea";var bd=cva("rounded-md bg-muted",{variants:{variant:{pulse:"animate-pulse",shimmer:"skeleton-shimmer",static:""}},defaultVariants:{variant:"pulse"}}),$a=Z.forwardRef(({className:e,variant:t,...n},r)=>jsx("div",{ref:r,className:m(bd({variant:t,className:e})),...n}));$a.displayName="Skeleton";var Ny=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-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",radius:"full"}}),vd=Z.createContext(null),hd=()=>{let e=Z.useContext(vd);if(!e)throw new Error("Avatar components must be used within an Avatar");return e},Dr=Z.forwardRef(({className:e,size:t,radius:n,...r},o)=>{let[a,s]=Z.useState("idle");return jsx(vd.Provider,{value:{imageLoadingStatus:a,onImageLoadingStatusChange:s},children:jsx("span",{ref:o,className:m(Ny({size:t,radius:n,className:e})),...r})})});Dr.displayName="Avatar";var so=Z.forwardRef(({className:e,src:t,alt:n,onLoadingStatusChange:r,...o},a)=>{let{imageLoadingStatus:s,onImageLoadingStatusChange:i}=hd();return Z.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})});so.displayName="AvatarImage";var Hr=Z.forwardRef(({className:e,delayMs:t=0,children:n,...r},o)=>{let{imageLoadingStatus:a}=hd(),[s,i]=Z.useState(t===0);return Z.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})});Hr.displayName="AvatarFallback";var Rn=({children:e,content:t,position:n="top",offset:r=4,align:o="center",alignOffset:a=0,delayDuration:s=700,showArrow:i=false,open:l,defaultOpen:c=false,onOpenChange:d,className:u})=>{let[p,f]=Z.useState(c),g=l!==void 0,v=g?l:p,b=Z.useRef(null),h=Z.useRef(null),x=Z.useId(),R=Z.useRef(null),[N,w]=Z.useState({top:0,left:0}),[y,C]=Z.useState(false);Z.useEffect(()=>{C(true);},[]);let E=Z.useCallback(M=>{R.current&&clearTimeout(R.current),M?R.current=setTimeout(()=>{g||f(true),d?.(true);},s):(g||f(false),d?.(false));},[g,d,s]);Z.useEffect(()=>()=>{R.current&&clearTimeout(R.current);},[]),Z.useEffect(()=>{if(!v||!b.current||!h.current)return;let M=b.current.getBoundingClientRect(),D=h.current.getBoundingClientRect(),P=0,I=0;switch(n){case "top":P=M.top-D.height-r;break;case "bottom":P=M.bottom+r;break;case "left":I=M.left-D.width-r;break;case "right":I=M.right+r;break}if(n==="top"||n==="bottom")switch(o){case "start":I=M.left+a;break;case "center":I=M.left+M.width/2-D.width/2;break;case "end":I=M.right-D.width-a;break}else switch(o){case "start":P=M.top+a;break;case "center":P=M.top+M.height/2-D.height/2;break;case "end":P=M.bottom-D.height-a;break}w({top:P,left:I});},[v,n,r,o,a]);let L={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"}[n],k={top:"left-1/2 -translate-x-1/2 bottom-0 translate-y-1/2 rotate-45",bottom:"left-1/2 -translate-x-1/2 top-0 -translate-y-1/2 rotate-45",left:"top-1/2 -translate-y-1/2 right-0 translate-x-1/2 rotate-45",right:"top-1/2 -translate-y-1/2 left-0 -translate-x-1/2 rotate-45"}[n],S=e.props,T=Z.cloneElement(e,{ref:M=>{b.current=M;let D=e.ref;typeof D=="function"?D(M):D&&typeof D=="object"&&(D.current=M);},"aria-describedby":v?x:void 0,onMouseEnter:M=>{S.onMouseEnter?.(M),E(true);},onMouseLeave:M=>{S.onMouseLeave?.(M),E(false);},onFocus:M=>{S.onFocus?.(M),E(true);},onBlur:M=>{S.onBlur?.(M),E(false);}});return jsxs(Fragment,{children:[T,y&&v&&Ua.createPortal(jsxs("div",{ref:h,id:x,role:"tooltip","data-position":n,className:m("fixed z-50",L,u),style:{top:N.top,left:N.left},children:[i&&jsx("span",{className:m("absolute z-0 w-2 h-2 bg-zinc-100 dark:bg-zinc-900",k)}),jsx("div",{className:"relative z-10 rounded-md px-3 py-1.5 text-xs bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",children:t})]}),document.body)]})};Rn.displayName="Tooltip";var Sy={sm:"20px",md:"40px",lg:"60px"},ze=Z.forwardRef(({className:e,orientation:t="vertical",visibility:n="visible",showShadow:r=false,shadowSize:o="md",children:a,style:s,...i},l)=>{let c=Z.useRef(null),[d,u]=Z.useState(false),[p,f]=Z.useState({top:false,bottom:false,left:false,right:false}),g=Z.useId().replace(/:/g,"");Z.useImperativeHandle(l,()=>c.current);let v=Z.useCallback(()=>{let w=c.current;if(!w||!r)return;let{scrollTop:y,scrollLeft:C,scrollHeight:E,scrollWidth:L,clientHeight:k,clientWidth:S}=w;f({top:y>0,bottom:y<E-k-1,left:C>0,right:C<L-S-1});},[r]);Z.useEffect(()=>{if(!r)return;let w=c.current;if(w)return v(),w.addEventListener("scroll",v),window.addEventListener("resize",v),()=>{w.removeEventListener("scroll",v),window.removeEventListener("resize",v);}},[r,v]);let b=n==="visible"||n==="hover"&&d,h=b?"rgba(0,0,0,0.3)":"transparent",x=b?"rgba(255,255,255,0.3)":"transparent",R=`
|
|
2
2
|
#${g} {
|
|
3
3
|
scrollbar-width: thin;
|
|
4
4
|
scrollbar-color: ${h} transparent;
|
|
@@ -29,7 +29,7 @@ import*as Z from'react';import {createContext,useState,useRef,useCallback,useEff
|
|
|
29
29
|
#${g}::-webkit-scrollbar-corner {
|
|
30
30
|
background: transparent;
|
|
31
31
|
}
|
|
32
|
-
${
|
|
32
|
+
${n==="hidden"?`
|
|
33
33
|
#${g}::-webkit-scrollbar {
|
|
34
34
|
display: none;
|
|
35
35
|
width: 0;
|
|
@@ -40,7 +40,7 @@ import*as Z from'react';import {createContext,useState,useRef,useCallback,useEff
|
|
|
40
40
|
scrollbar-width: none;
|
|
41
41
|
}
|
|
42
42
|
`:""}
|
|
43
|
-
`;return jsxs(Fragment,{children:[jsx("style",{dangerouslySetInnerHTML:{__html:R}}),jsx("div",{ref:c,id:g,onMouseEnter:()=>u(true),onMouseLeave:()=>u(false),style:{...s,...(()=>{if(!n)return {};let w=Sy[o],y=t==="vertical"||t==="both",C=t==="horizontal"||t==="both",E=[y&&p.top&&`linear-gradient(to bottom, transparent, black ${w})`,y&&p.bottom&&`linear-gradient(to top, transparent, black ${w})`,C&&p.left&&`linear-gradient(to right, transparent, black ${w})`,C&&p.right&&`linear-gradient(to left, transparent, black ${w})`].filter(Boolean);return E.length===0?{}:{maskImage:E.join(", "),WebkitMaskImage:E.join(", "),maskComposite:"intersect",WebkitMaskComposite:"source-in"}})()},className:m(t==="vertical"&&"overflow-y-auto overflow-x-hidden",t==="horizontal"&&"overflow-x-auto overflow-y-hidden",t==="both"&&"overflow-auto",e),...i,children:a})]})});ze.displayName="ScrollArea";var Nd=cva("flex w-full cursor-pointer items-center justify-between border border-zinc-300 dark:border-zinc-700 bg-background px-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"min-h-9 py-1.5 text-xs",md:"min-h-10 py-2",lg:"min-h-11 py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",radius:"md"}}),In=Z.forwardRef(({options:e,multiple:t=false,value:r,defaultValue:n,onValueChange:o,placeholder:a="Select...",searchable:s=false,searchPlaceholder:i="Search...",emptyText:l="No results found.",isDisabled:c=false,clearable:d=false,maxDisplayItems:u=3,maxDropdownHeight:p=240,size:f,radius:g,className:v,...b},h)=>{let[x,R]=Z.useState(false),[N,w]=Z.useState(""),[y,C]=Z.useState(n||""),[E,L]=Z.useState(n||[]),[k,S]=Z.useState({top:0,left:0,width:0}),[T,M]=Z.useState(-1),D=Z.useRef(null),P=Z.useRef(null),I=Z.useRef(null),H=Z.useRef(null),A=Z.useId(),B=r!==void 0?r:y,$=r!==void 0?r:E,j=r!==void 0,G=_=>{d&&B===_?(j||C(""),o?.("")):(j||C(_),o?.(_)),R(false),w("");},U=_=>{let O=$.includes(_)?$.filter(F=>F!==_):[...$,_];j||L(O),o?.(O);},W=(_,O)=>{O.stopPropagation();let F=$.filter(q=>q!==_);j||L(F),o?.(F);},V=_=>{_.stopPropagation(),t?(j||L([]),o?.([])):(j||C(""),o?.(""));},z=e.find(_=>_.value===B),K=e.filter(_=>$.includes(_.value)),Y=K.slice(0,u),Q=K.length-u,J=s?e.filter(_=>_.label.toLowerCase().includes(N.toLowerCase())):e;Z.useEffect(()=>{if(x&&P.current){let _=P.current.getBoundingClientRect();S({top:_.bottom+4,left:_.left,width:_.width}),s&&setTimeout(()=>H.current?.focus(),0);}x||w("");},[x,s]),Z.useEffect(()=>{let _=O=>{let F=O.target,q=D.current&&!D.current.contains(F),X=I.current&&!I.current.contains(F);q&&X&&(R(false),w(""));};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]),Z.useEffect(()=>{if(!x)return;let _=O=>{I.current?.contains(O.target)||(R(false),w(""));};return window.addEventListener("scroll",_,true),()=>window.removeEventListener("scroll",_,true)},[x]);let Ne=t?$.length>0:!!B,be=_=>{if(!c)switch(_.key){case "Enter":case " ":if(_.preventDefault(),!x)R(true),M(0);else if(T>=0&&J[T]){let O=J[T];O.disabled||(t?U(O.value):G(O.value));}break;case "Escape":_.preventDefault(),R(false),w(""),M(-1);break;case "ArrowDown":_.preventDefault(),x?M(O=>{let F=O+1;return F>=J.length?0:F}):(R(true),M(0));break;case "ArrowUp":_.preventDefault(),x?M(O=>{let F=O-1;return F<0?J.length-1:F}):(R(true),M(J.length-1));break;case "Home":x&&(_.preventDefault(),M(0));break;case "End":x&&(_.preventDefault(),M(J.length-1));break;case "Tab":x&&(R(false),w(""),M(-1));break}};return Z.useEffect(()=>{x||M(-1);},[x]),jsxs("div",{ref:D,className:m("relative",v),...b,children:[jsxs("div",{ref:_=>{P.current=_,typeof h=="function"?h(_):h&&(h.current=_);},role:"combobox",tabIndex:c?-1:0,"aria-expanded":x,"aria-haspopup":"listbox","aria-controls":x?A:void 0,"aria-disabled":c,onClick:()=>!c&&R(!x),onKeyDown:be,className:m(Nd({size:f,radius:g}),t&&"flex-wrap gap-1",c&&"cursor-not-allowed opacity-50","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[!t&&jsx("span",{className:m(!z&&"text-muted-foreground"),children:z?z.label:a}),t&&jsx(Fragment,{children:K.length===0?jsx("span",{className:"text-muted-foreground",children:a}):jsxs(Fragment,{children:[Y.map(_=>jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs font-medium text-secondary-foreground",children:[_.label,jsx("span",{role:"button",tabIndex:0,onClick:O=>W(_.value,O),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&W(_.value,O);},className:"rounded-full hover:bg-secondary-foreground/20 cursor-pointer",children:jsx(X,{className:"h-3 w-3"})})]},_.value)),Q>0&&jsxs("span",{className:"text-xs text-muted-foreground",children:["+",Q," more"]})]})}),jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d&&Ne&&jsx("span",{role:"button",tabIndex:0,onClick:V,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&V(_);},className:"rounded-full p-0.5 hover:bg-muted cursor-pointer",children:jsx(X,{className:"h-4 w-4 opacity-50"})}),jsx(ChevronDown,{className:m("h-4 w-4 opacity-50 transition-transform",x&&"rotate-180")})]})]}),x&&!c&&typeof document<"u"&&Ua.createPortal(jsxs("div",{ref:I,id:A,role:"listbox","aria-multiselectable":t,className:"fixed z-[9999] overflow-hidden rounded-md border border-zinc-300 dark:border-zinc-700 bg-background shadow-md",style:{top:k.top,left:k.left,minWidth:k.width},children:[s&&jsxs("div",{className:"flex items-center border-b border-zinc-300 dark:border-zinc-700 px-3",children:[jsx(Search,{className:"h-4 w-4 opacity-50 mr-2"}),jsx("input",{ref:H,type:"text",value:N,onChange:_=>w(_.target.value),placeholder:i,className:"flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground"})]}),jsx(ze,{style:{maxHeight:p},onWheel:_=>_.stopPropagation(),children:jsx("div",{className:"p-1",children:J.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l}):J.map((_,O)=>{let F=t?$.includes(_.value):B===_.value,q=T===O;return jsxs("div",{role:"option","aria-selected":F,"aria-disabled":_.disabled,onClick:()=>{_.disabled||(t?U(_.value):G(_.value));},onMouseEnter:()=>M(O),className:m("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",q&&"bg-zinc-100 dark:bg-zinc-800",!q&&"hover:bg-zinc-100 dark:hover:bg-zinc-800",_.disabled&&"pointer-events-none opacity-50"),children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:F&&jsx(Check,{className:"h-4 w-4"})}),_.label]},_.value)})})})]}),document.body)]})});In.displayName="Select";var kd=Z.createContext(null),Uo=()=>{let e=Z.useContext(kd);if(!e)throw new Error("Dropdown components must be used within a Dropdown");return e},wi=Z.createContext({radius:"md"}),Ci=Z.createContext(null),Zt=({children:e,open:t,defaultOpen:r=false,onOpenChange:n})=>{let[o,a]=Z.useState(r),[s,i]=Z.useState(-1),l=t!==void 0,c=l?t:o,d=Z.useRef(null),u=Z.useRef(null),p=Z.useId(),f=Z.useRef(new Map),g=Z.useCallback(h=>{l||a(h),n?.(h),h||i(-1);},[l,n]),v=Z.useCallback((h,x)=>{f.current.set(h,x);},[]),b=Z.useCallback(h=>{f.current.delete(h);},[]);return jsx(kd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentRef:u,contentId:p,activeIndex:s,setActiveIndex:i,items:f,registerItem:v,unregisterItem:b},children:e})};Zt.displayName="Dropdown";var Jt=Z.forwardRef(({children:e,onClick:t,onKeyDown:r,...n},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Uo();return jsx("div",{ref:u=>{i.current=u,typeof o=="function"?o(u):o&&(o.current=u);},role:"button",tabIndex:0,"aria-expanded":a,"aria-haspopup":"menu","aria-controls":a?l:void 0,onClick:u=>{t?.(u),s(!a);},onKeyDown:u=>{r?.(u),(u.key==="ArrowDown"||u.key==="ArrowUp")&&(u.preventDefault(),s(true)),(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),s(!a));},className:"inline-flex",...n,children:e})});Jt.displayName="DropdownTrigger";var Ay={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-2xl"},Qt=Z.forwardRef(({className:e,side:t="bottom",sideOffset:r=4,align:n="start",alignOffset:o=0,collisionPadding:a=8,onInteractOutside:s,onEscapeKeyDown:i,loop:l=true,radius:c="md",children:d,...u},p)=>{let{open:f,onOpenChange:g,triggerRef:v,contentRef:b,contentId:h,activeIndex:x,setActiveIndex:R,items:N}=Uo(),[w,y]=Z.useState({top:0,left:0}),[C,E]=Z.useState(t),[L,k]=Z.useState(false),S=Z.useRef(0);if(Z.useEffect(()=>{k(true);},[]),Z.useEffect(()=>{f&&(S.current=N.current.size);},[f,N]),Z.useEffect(()=>{if(!f||!v.current||!b.current)return;let M=()=>{if(!v.current||!b.current)return;let D=v.current.getBoundingClientRect(),P=b.current.getBoundingClientRect(),I=window.innerWidth,H=window.innerHeight,A=0,B=0,$=t;switch(t){case "top":A=D.top-P.height-r,A<a&&(A=D.bottom+r,$="bottom");break;case "bottom":A=D.bottom+r,A+P.height>H-a&&(A=D.top-P.height-r,$="top");break;case "left":B=D.left-P.width-r,B<a&&(B=D.right+r,$="right");break;case "right":B=D.right+r,B+P.width>I-a&&(B=D.left-P.width-r,$="left");break}if($==="top"||$==="bottom"){switch(n){case "start":B=D.left+o;break;case "center":B=D.left+D.width/2-P.width/2;break;case "end":B=D.right-P.width-o;break}B<a?B=a:B+P.width>I-a&&(B=I-P.width-a);}else {switch(n){case "start":A=D.top+o;break;case "center":A=D.top+D.height/2-P.height/2;break;case "end":A=D.bottom-P.height-o;break}A<a?A=a:A+P.height>H-a&&(A=H-P.height-a);}y({top:A,left:B}),E($);};return M(),window.addEventListener("resize",M),window.addEventListener("scroll",M,true),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,true);}},[f,t,r,n,o,a,v]),Z.useEffect(()=>{if(!f)return;let M=D=>{let P=D.target;b.current&&!b.current.contains(P)&&v.current&&!v.current.contains(P)&&(s?.(),g(false));};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[f,g,s,v,b]),Z.useEffect(()=>{if(!f)return;let M=D=>{let P=Array.from(N.current.entries()).sort(([H],[A])=>H-A).map(([,H])=>H),I=P.length;if(I!==0)switch(D.key){case "Escape":D.preventDefault(),i?.(),g(false),v.current?.focus();break;case "ArrowDown":D.preventDefault(),x===-1||x>=I-1?R(l?0:Math.min(x+1,I-1)):R(x+1);break;case "ArrowUp":D.preventDefault(),x<=0?R(l?I-1:0):R(x-1);break;case "Home":D.preventDefault(),R(0);break;case "End":D.preventDefault(),R(I-1);break;case "Enter":case " ":D.preventDefault(),x>=0&&x<I&&P[x]?.click();break;case "Tab":g(false);break}};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[f,g,i,x,R,N,l,v]),Z.useEffect(()=>{f&&x>=0&&Array.from(N.current.entries()).sort(([D],[P])=>D-P).map(([,D])=>D)[x]?.focus();},[f,x,N]),!L||!f)return null;let T={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"}[C];return Ua.createPortal(jsx("div",{ref:M=>{b.current=M,typeof p=="function"?p(M):p&&(p.current=M);},id:h,role:"menu","aria-orientation":"vertical","data-state":f?"open":"closed","data-side":C,"data-dropdown-content":"",className:m("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md outline-none",Ay[c],T,e),style:{top:w.top,left:w.left},...u,children:jsx(wi.Provider,{value:{radius:c},children:d})}),document.body)});Qt.displayName="DropdownContent";var Sd=0,Ed={none:"rounded-none",sm:"rounded-sm",md:"rounded-sm",lg:"rounded-md",full:"rounded-lg"},Et=Z.forwardRef(({className:e,inset:t,isDisabled:r,onSelect:n,onClick:o,onMouseEnter:a,startContent:s,endContent:i,children:l,...c},d)=>{let{onOpenChange:u,activeIndex:p,setActiveIndex:f,registerItem:g,unregisterItem:v}=Uo(),{radius:b}=Z.useContext(wi),[h]=Z.useState(()=>Sd++),x=Z.useRef(null);Z.useEffect(()=>(!r&&x.current&&g(h,x.current),()=>{v(h);}),[r,h,g,v]);let R=y=>{if(r){y.preventDefault();return}o?.(y),n?.(),u(false);},N=y=>{a?.(y),r||f(h);};return jsxs("div",{ref:y=>{x.current=y,typeof d=="function"?d(y):d&&(d.current=y);},role:"menuitem",tabIndex:r?-1:0,"aria-disabled":r,"data-disabled":r?"":void 0,"data-highlighted":p===h?"":void 0,className:m("relative flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Ed[b],t&&"pl-8",!r&&"cursor-pointer",e),onClick:R,onMouseEnter:N,...c,children:[s,l&&jsx("span",{className:"flex-1",children:l}),i]})});Et.displayName="DropdownItem";var Mi=Z.forwardRef(({className:e,inset:t,...r},n)=>jsx("div",{ref:n,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...r}));Mi.displayName="DropdownSection";var Pd=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,role:"separator",className:m("-mx-1 my-1 h-px bg-muted",e),...t}));Pd.displayName="DropdownSeparator";var Ld=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest opacity-60",e),...t});Ld.displayName="DropdownShortcut";var Dd=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,role:"group",className:e,...t}));Dd.displayName="DropdownGroup";var Hd=({children:e,open:t,defaultOpen:r=false,onOpenChange:n})=>{let[o,a]=Z.useState(r),{contentRef:s}=Uo(),i=t!==void 0,l=i?t:o,c=Z.useRef(null),d=Z.useCallback(u=>{i||a(u),n?.(u);},[i,n]);return jsx(Ci.Provider,{value:{open:l,onOpenChange:d,triggerRef:c,parentMenuRef:s},children:e})};Hd.displayName="DropdownSub";var Id=Z.forwardRef(({className:e,inset:t,isDisabled:r,children:n,onMouseEnter:o,onMouseLeave:a,onKeyDown:s,...i},l)=>{let c=Z.useContext(Ci),{setActiveIndex:d,registerItem:u,unregisterItem:p}=Uo(),{radius:f}=Z.useContext(wi),[g]=Z.useState(()=>Sd++),v=Z.useRef(null);if(!c)throw new Error("DropdownSubTrigger must be used within DropdownSub");let{open:b,onOpenChange:h,triggerRef:x}=c;Z.useEffect(()=>(!r&&v.current&&u(g,v.current),()=>{p(g);}),[r,g,u,p]);let R=y=>{o?.(y),r||(d(g),h(true));},N=y=>{a?.(y);},w=y=>{s?.(y),(y.key==="ArrowRight"||y.key==="Enter"||y.key===" ")&&(y.preventDefault(),h(true));};return jsxs("div",{ref:y=>{v.current=y,x.current=y,typeof l=="function"?l(y):l&&(l.current=y);},role:"menuitem","aria-haspopup":"menu","aria-expanded":b,tabIndex:r?-1:0,"aria-disabled":r,"data-state":b?"open":"closed","data-disabled":r?"":void 0,className:m("flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[state=open]:bg-accent","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Ed[f],t&&"pl-8",!r&&"cursor-pointer",e),onMouseEnter:R,onMouseLeave:N,onKeyDown:w,...i,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Id.displayName="DropdownSubTrigger";var Vd=Z.forwardRef(({className:e,sideOffset:t=2,alignOffset:r=-4,collisionPadding:n=8,onMouseEnter:o,onMouseLeave:a,...s},i)=>{let l=Z.useContext(Ci);if(!l)throw new Error("DropdownSubContent must be used within DropdownSub");let{open:c,onOpenChange:d,triggerRef:u,parentMenuRef:p}=l,[f,g]=Z.useState({top:0,left:0}),[v,b]=Z.useState(false),h=Z.useRef(null),x=Z.useRef(null);Z.useEffect(()=>{b(true);},[]),Z.useEffect(()=>{if(!c||!u.current||!h.current)return;(()=>{if(!u.current||!h.current)return;let y=u.current.getBoundingClientRect(),C=h.current.getBoundingClientRect(),E=window.innerWidth,L=window.innerHeight,k=y.top+r,S=y.right+t;S+C.width>E-n&&(S=y.left-C.width-t),k+C.height>L-n&&(k=L-C.height-n),k<n&&(k=n),g({top:k,left:S});})();},[c,t,r,n,u]);let R=w=>{o?.(w),x.current&&(clearTimeout(x.current),x.current=null),d(true);},N=w=>{a?.(w);let y=w.relatedTarget;u.current?.contains(y)||p?.current?.contains(y)||(x.current=setTimeout(()=>{d(false);},100));};return Z.useEffect(()=>()=>{x.current&&clearTimeout(x.current);},[]),!v||!c?null:Ua.createPortal(jsx("div",{ref:w=>{h.current=w,typeof i=="function"?i(w):i&&(i.current=w);},role:"menu","data-state":c?"open":"closed",className:m("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",e),style:{top:f.top,left:f.left},onMouseEnter:R,onMouseLeave:N,...s}),document.body)});Vd.displayName="DropdownSubContent";var zy=Mi;var Od=Z.createContext(null),Ti=()=>{let e=Z.useContext(Od);if(!e)throw new Error("Popover components must be used within a Popover");return e},Pt=({children:e,open:t,defaultOpen:r=false,onOpenChange:n})=>{let[o,a]=Z.useState(r),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useId(),d=Z.useCallback(u=>{s||a(u),n?.(u);},[s,n]);return jsx(Od.Provider,{value:{open:i,onOpenChange:d,triggerRef:l,contentId:c},children:e})};Pt.displayName="Popover";var en=Z.forwardRef(({children:e,onClick:t,asChild:r,...n},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Ti(),c=p=>{t?.(p),s(!a);},d=p=>{i.current=p,typeof o=="function"?o(p):o&&(o.current=p);},u={"aria-expanded":a,"aria-haspopup":"dialog","aria-controls":a?l:void 0,onClick:c,...n};return r&&Z.isValidElement(e)?Z.cloneElement(e,{...u,ref:d,onClick:p=>{e.props.onClick?.(p),c(p);}}):jsx("button",{ref:d,type:"button",...u,children:e})});en.displayName="PopoverTrigger";var tn=Z.forwardRef(({children:e,...t},r)=>{let{triggerRef:n}=Ti();return jsx("div",{ref:o=>{n.current=o,typeof r=="function"?r(o):r&&(r.current=o);},...t,children:e})});tn.displayName="PopoverAnchor";var Lt=Z.forwardRef(({className:e,style:t,side:r="bottom",sideOffset:n=4,align:o="center",alignOffset:a=0,onInteractOutside:s,onEscapeKeyDown:i,onOpenAutoFocus:l,onCloseAutoFocus:c,children:d,...u},p)=>{let{open:f,onOpenChange:g,triggerRef:v,contentId:b}=Ti(),[h,x]=Z.useState({top:0,left:0}),[R,N]=Z.useState(false),[w,y]=Z.useState(null);if(Z.useEffect(()=>{N(true);},[]),Z.useEffect(()=>{if(!f||!v.current||!w)return;let E=()=>{if(!v.current||!w)return;let L=v.current.getBoundingClientRect(),k=w.getBoundingClientRect(),S=0,T=0;switch(r){case "top":S=L.top-k.height-n;break;case "bottom":S=L.bottom+n;break;case "left":T=L.left-k.width-n;break;case "right":T=L.right+n;break}if(r==="top"||r==="bottom")switch(o){case "start":T=L.left+a;break;case "center":T=L.left+L.width/2-k.width/2;break;case "end":T=L.right-k.width-a;break}else switch(o){case "start":S=L.top+a;break;case "center":S=L.top+L.height/2-k.height/2;break;case "end":S=L.bottom-k.height-a;break}x({top:S,left:T});};return E(),window.addEventListener("resize",E),window.addEventListener("scroll",E,true),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,true);}},[f,r,n,o,a,v,w]),Z.useEffect(()=>{if(!f)return;let E=L=>{let k=L.target;w&&w.contains(k)||v.current&&v.current.contains(k)||k.closest?.("[data-dropdown-content], [data-popover-content]")||(s?.(),g(false));};return document.addEventListener("mouseup",E),()=>document.removeEventListener("mouseup",E)},[f,g,s,v,w]),Z.useEffect(()=>{if(!f)return;let E=L=>{L.key==="Escape"&&(i?.(),g(false));};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[f,g,i]),!R||!f)return null;let C={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"}[r];return Ua.createPortal(jsx("div",{ref:E=>{y(L=>L!==E?E:L),typeof p=="function"?p(E):p&&(p.current=E);},id:b,role:"dialog","data-state":f?"open":"closed","data-side":r,className:m("fixed z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",C,e),style:{...t,top:h.top,left:h.left},...u,children:d}),document.body)});Lt.displayName="PopoverContent";var Fd=Z.createContext(null),ki=()=>{let e=Z.useContext(Fd);if(!e)throw new Error("Tabs components must be used within a Tabs");return e},Bd=Z.forwardRef(({className:e,value:t,defaultValue:r="",onValueChange:n,variant:o="solid",radius:a="md",orientation:s="horizontal",children:i,...l},c)=>{let[d,u]=Z.useState(r),p=t!==void 0,f=p?t:d,g=Z.useId(),v=x=>{p||u(x),n?.(x);},b=Z.useCallback(x=>`${g}-trigger-${x}`,[g]),h=Z.useCallback(x=>`${g}-panel-${x}`,[g]);return jsx(Fd.Provider,{value:{value:f,onValueChange:v,variant:o,radius:a,orientation:s,baseId:g,getTriggerId:b,getPanelId:h},children:jsx("div",{ref:c,"data-orientation":s,className:m(s==="vertical"&&"flex gap-4",e),...l,children:i})})});Bd.displayName="Tabs";var Ni={none:{list:"rounded-none",trigger:"rounded-none",indicator:"rounded-none"},sm:{list:"rounded-md",trigger:"rounded-sm",indicator:"rounded-sm"},md:{list:"rounded-lg",trigger:"rounded-md",indicator:"rounded-md"},lg:{list:"rounded-xl",trigger:"rounded-lg",indicator:"rounded-lg"},full:{list:"rounded-full",trigger:"rounded-full",indicator:"rounded-full"}},$d=Z.forwardRef(({className:e,children:t,...r},n)=>{let{variant:o,radius:a,orientation:s,value:i}=ki(),l=Z.useRef(null),[c,d]=Z.useState({opacity:0});Z.useEffect(()=>{let g=l.current;if(!g)return;let v=()=>{let h=g.querySelector('[data-state="active"]');if(h){let x=g.getBoundingClientRect(),R=h.getBoundingClientRect(),N=s==="vertical";o==="underline"?d(N?{width:2,height:R.height,transform:`translateY(${R.top-x.top}px)`,opacity:1}:{width:R.width,height:2,transform:`translateX(${R.left-x.left}px)`,opacity:1}):o==="solid"&&d(N?{width:R.width,height:R.height,transform:`translateY(${R.top-x.top}px)`,opacity:1}:{width:R.width,height:R.height,transform:`translateX(${R.left-x.left}px)`,opacity:1});}};v();let b=new ResizeObserver(v);return b.observe(g),()=>{b.disconnect();}},[o,s,i]);let u={solid:"bg-muted p-1",underline:"border-b border-border bg-transparent p-0 !rounded-none",bordered:"bg-transparent p-0 gap-1 !rounded-none"},p=s==="vertical",f=()=>o==="solid"?p?"top-0 left-1 bg-background shadow":"top-1 left-1 bg-background shadow":o==="underline"?p?"top-0 left-0 bg-primary !rounded-full":"bottom-0 left-0 bg-primary !rounded-full":"";return jsxs("div",{ref:g=>{l.current=g,typeof n=="function"?n(g):n&&(n.current=g);},role:"tablist","aria-orientation":s,className:m("relative inline-flex h-9 items-center justify-center text-muted-foreground",p&&"flex-col h-auto w-auto",Ni[a].list,u[o],e),...r,children:[(o==="solid"||o==="underline")&&jsx("span",{className:m("absolute transition-all duration-200 ease-out",Ni[a].indicator,f()),style:c,"aria-hidden":"true"}),t]})});$d.displayName="TabsList";var Kd=Z.forwardRef(({className:e,value:t,disabled:r,onClick:n,...o},a)=>{let{value:s,onValueChange:i,variant:l,radius:c,getTriggerId:d,getPanelId:u}=ki(),p=s===t,f={solid:"data-[state=active]:text-foreground",underline:"!rounded-none border-b-2 border-transparent pb-2 data-[state=active]:text-foreground",bordered:"border border-transparent data-[state=active]:border-current data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"};return jsx("button",{type:"button",role:"tab",ref:a,id:d(t),"aria-selected":p,"aria-controls":u(t),tabIndex:p?0:-1,"data-state":p?"active":"inactive",disabled:r,className:m("relative z-10 inline-flex items-center justify-center whitespace-nowrap px-3 py-1 text-sm font-medium ring-offset-background transition-all 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",Ni[c].trigger,f[l],e),onClick:g=>{n?.(g),i(t);},...o})});Kd.displayName="TabsTrigger";var Gd=Z.forwardRef(({className:e,value:t,children:r,...n},o)=>{let{value:a,getTriggerId:s,getPanelId:i}=ki(),l=a===t;return l?jsx("div",{ref:o,role:"tabpanel",id:i(t),"aria-labelledby":s(t),tabIndex:0,"data-state":l?"active":"inactive",className:m("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n,children:r}):null});Gd.displayName="TabsContent";var $y=({theme:e="system",...t})=>jsx(Toaster,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t});var Ud=Z.createContext(null),_a=()=>{let e=Z.useContext(Ud);if(!e)throw new Error("ContextMenu components must be used within a ContextMenu");return e},Si=Z.createContext(null),_d=({children:e,onOpenChange:t})=>{let[r,n]=Z.useState(false),[o,a]=Z.useState({x:0,y:0}),s=Z.useId(),i=Z.useCallback(l=>{n(l),t?.(l);},[t]);return jsx(Ud.Provider,{value:{open:r,onOpenChange:i,position:o,setPosition:a,contentId:s},children:e})};_d.displayName="ContextMenu";var jd=Z.forwardRef(({children:e,onContextMenu:t,...r},n)=>{let{onOpenChange:o,setPosition:a}=_a(),s=i=>{i.preventDefault(),a({x:i.clientX,y:i.clientY}),o(true);};return jsx("div",{ref:n,onContextMenu:i=>{t?.(i),s(i);},...r,children:e})});jd.displayName="ContextMenuTrigger";var Wd=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,role:"group",className:e,...t}));Wd.displayName="ContextMenuGroup";var Yd=({children:e,container:t})=>{let[r,n]=Z.useState(false);return Z.useEffect(()=>{n(true);},[]),r?Ua.createPortal(e,t||document.body):null};Yd.displayName="ContextMenuPortal";var qd=({children:e,open:t,defaultOpen:r=false,onOpenChange:n})=>{let[o,a]=Z.useState(r),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useCallback(d=>{s||a(d),n?.(d);},[s,n]);return jsx(Si.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};qd.displayName="ContextMenuSub";var Xd=Z.forwardRef(({className:e,onInteractOutside:t,onEscapeKeyDown:r,children:n,...o},a)=>{let{open:s,onOpenChange:i,position:l,contentId:c}=_a(),[d,u]=Z.useState(false),[p,f]=Z.useState(l),g=Z.useRef(null);return Z.useEffect(()=>{u(true);},[]),Z.useEffect(()=>{if(!s||!g.current){f(l);return}let b=g.current.getBoundingClientRect(),{x:h,y:x}=l;h+b.width>window.innerWidth&&(h=window.innerWidth-b.width-8),x+b.height>window.innerHeight&&(x=window.innerHeight-b.height-8),f({x:h,y:x});},[s,l]),Z.useEffect(()=>{if(!s)return;let v=b=>{let h=b.target;g.current&&!g.current.contains(h)&&(t?.(),i(false));};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[s,i,t]),Z.useEffect(()=>{if(!s)return;let v=b=>{b.key==="Escape"&&(r?.(),i(false));};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[s,i,r]),!d||!s?null:Ua.createPortal(jsx("div",{ref:v=>{g.current=v,typeof a=="function"?a(v):a&&(a.current=v);},id:c,role:"menu","aria-orientation":"vertical","data-state":s?"open":"closed",className:m("fixed z-50 max-h-[calc(100vh-2rem)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-1 text-zinc-950 dark:text-zinc-50 shadow-md","animate-in fade-in-0 zoom-in-95",e),style:{top:p.y,left:p.x},...o,children:n}),document.body)});Xd.displayName="ContextMenuContent";var Zd=Z.forwardRef(({className:e,inset:t,children:r,onMouseEnter:n,onMouseLeave:o,...a},s)=>{let i=Z.useContext(Si);if(!i)throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");let{open:l,onOpenChange:c,triggerRef:d}=i,u=f=>{n?.(f),c(true);},p=f=>{o?.(f),c(false);};return jsxs("div",{ref:f=>{d.current=f,typeof s=="function"?s(f):s&&(s.current=f);},role:"menuitem","aria-haspopup":"menu","aria-expanded":l,"data-state":l?"open":"closed",className:m("flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[state=open]:bg-zinc-100 dark:data-[state=open]:bg-zinc-800",t&&"pl-8",e),onMouseEnter:u,onMouseLeave:p,...a,children:[r,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Zd.displayName="ContextMenuSubTrigger";var Jd=Z.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:r,onMouseLeave:n,...o},a)=>{let s=Z.useContext(Si);if(!s)throw new Error("ContextMenuSubContent must be used within ContextMenuSub");let{open:i,onOpenChange:l,triggerRef:c}=s,[d,u]=Z.useState({top:0,left:0}),[p,f]=Z.useState(false),g=Z.useRef(null);Z.useEffect(()=>{f(true);},[]),Z.useEffect(()=>{if(!i||!c.current||!g.current)return;(()=>{if(!c.current||!g.current)return;let x=c.current.getBoundingClientRect(),R=g.current.getBoundingClientRect(),N=x.top,w=x.right+t;w+R.width>window.innerWidth&&(w=x.left-R.width-t),u({top:N,left:w});})();},[i,t,c]);let v=h=>{r?.(h),l(true);},b=h=>{n?.(h),l(false);};return !p||!i?null:Ua.createPortal(jsx("div",{ref:h=>{g.current=h,typeof a=="function"?a(h):a&&(a.current=h);},role:"menu","data-state":i?"open":"closed",className:m("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-1 text-zinc-950 dark:text-zinc-50 shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",e),style:{top:d.top,left:d.left},onMouseEnter:v,onMouseLeave:b,...o}),document.body)});Jd.displayName="ContextMenuSubContent";var Qd=Z.forwardRef(({className:e,inset:t,isDisabled:r,onSelect:n,onClick:o,...a},s)=>{let{onOpenChange:i}=_a(),l=c=>{if(r){c.preventDefault();return}o?.(c),n?.(),i(false);};return jsx("div",{ref:s,role:"menuitem",tabIndex:r?-1:0,"aria-disabled":r,"data-disabled":r?"":void 0,className:m("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",t&&"pl-8",e),onClick:l,...a})});Qd.displayName="ContextMenuItem";var eu=Z.forwardRef(({className:e,children:t,checked:r=false,onCheckedChange:n,isDisabled:o,onClick:a,...s},i)=>{let{onOpenChange:l}=_a(),c=d=>{if(o){d.preventDefault();return}a?.(d),n?.(!r),l(false);};return jsxs("div",{ref:i,role:"menuitemcheckbox","aria-checked":r,tabIndex:o?-1:0,"aria-disabled":o,"data-disabled":o?"":void 0,"data-state":r?"checked":"unchecked",className:m("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",e),onClick:c,...s,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r&&jsx(Check,{className:"h-4 w-4"})}),t]})});eu.displayName="ContextMenuCheckboxItem";var tu=Z.forwardRef(({className:e,inset:t,...r},n)=>jsx("div",{ref:n,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...r}));tu.displayName="ContextMenuSection";var ru=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,role:"separator",className:m("-mx-1 my-1 h-px bg-border",e),...t}));ru.displayName="ContextMenuSeparator";var nu=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});nu.displayName="ContextMenuShortcut";var su=Z.createContext(null),jy=()=>{let e=Z.useContext(su);if(!e)throw new Error("Radio components must be used within a RadioGroup");return e},iu=Z.createContext(null),Wa=()=>{let e=Z.useContext(iu);if(!e)throw new Error("Radio.* components must be used within a Radio");return e},jo={sm:{control:"h-3.5 w-3.5",indicator:"h-1.5 w-1.5",label:"text-sm",description:"text-xs",gap:"gap-2"},md:{control:"h-4 w-4",indicator:"h-2 w-2",label:"text-sm",description:"text-xs",gap:"gap-2.5"},lg:{control:"h-5 w-5",indicator:"h-2.5 w-2.5",label:"text-base",description:"text-sm",gap:"gap-3"}},ja={default:{border:"border-input",borderChecked:"border-foreground",indicator:"bg-foreground",ring:"ring-foreground/20"},success:{border:"border-input",borderChecked:"border-green-500",indicator:"bg-green-500",ring:"ring-green-500/20"},warning:{border:"border-input",borderChecked:"border-yellow-500",indicator:"bg-yellow-500",ring:"ring-yellow-500/20"},danger:{border:"border-input",borderChecked:"border-red-500",indicator:"bg-red-500",ring:"ring-red-500/20"}},lu=Z.forwardRef(({className:e,value:t,defaultValue:r="",onValueChange:n,name:o,isDisabled:a,required:s,orientation:i="vertical",size:l="md",color:c="default",children:d,...u},p)=>{let[f,g]=Z.useState(r),v=t!==void 0,b=v?t:f,h=Z.useId(),x=R=>{v||g(R),n?.(R);};return jsx("div",{ref:p,role:"radiogroup","aria-required":s,"aria-orientation":i,className:m(i==="vertical"?"flex flex-col gap-2":"flex flex-row flex-wrap gap-4",e),...u,children:jsx(su.Provider,{value:{name:o||h,value:b,onValueChange:x,isDisabled:a,required:s,size:l,color:c},children:d})})});lu.displayName="RadioGroup";var Pi=Z.forwardRef(({className:e,value:t,isDisabled:r,children:n,...o},a)=>{let s=jy(),[i,l]=Z.useState(false),c=s.value===t,d=r||s.isDisabled,u=()=>{d||s.onValueChange(t);},p=jo[s.size||"md"];return jsx(iu.Provider,{value:{value:t,isChecked:c,isDisabled:d||false,isFocused:i,setIsFocused:l,onSelect:u,size:s.size||"md",color:s.color||"default"},children:jsxs("label",{ref:a,className:m("flex items-center cursor-pointer select-none",p.gap,d&&"cursor-not-allowed opacity-50",e),...o,children:[n,jsx("input",{type:"radio","aria-hidden":true,tabIndex:-1,name:s.name,value:t,checked:c,required:s.required,disabled:d,onChange:()=>{},className:"sr-only"})]})})});Pi.displayName="Radio";var Li=Z.forwardRef(({className:e,children:t},r)=>{let{isChecked:n,isDisabled:o,isFocused:a,setIsFocused:s,onSelect:i,size:l,color:c}=Wa(),d=jo[l],u=!(c in ja),p=u?null:ja[c],f=u?{borderColor:n?c:void 0,boxShadow:a?`0 0 0 2px ${c}33`:void 0}:void 0;return jsx(motion.button,{ref:r,type:"button",role:"radio","aria-checked":n,disabled:o,onClick:i,onFocus:()=>s(true),onBlur:()=>s(false),style:f,className:m("relative flex items-center justify-center rounded-full border-2 transition-colors duration-200","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",d.control,p&&(n?p.borderChecked:p.border),p&&a&&p.ring,!u&&!n&&"border-input",o?"cursor-not-allowed":"cursor-pointer",e),whileTap:o?void 0:{scale:.95},animate:n?{scale:[1,1.1,1]}:void 0,transition:{duration:.2},children:t||jsx(Di,{})})});Li.displayName="RadioControl";var Di=Z.forwardRef(({className:e,forceMount:t},r)=>{let{isChecked:n,size:o,color:a}=Wa(),s=jo[o],i=!(a in ja),l=i?null:ja[a],c=i?{backgroundColor:a}:void 0;return jsx(AnimatePresence,{children:(t||n)&&jsx(motion.span,{ref:r,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:500,damping:30},style:c,className:m("rounded-full",s.indicator,l?.indicator,e)})})});Di.displayName="RadioIndicator";var Hi=Z.forwardRef(({className:e,children:t,...r},n)=>{let{size:o,isDisabled:a}=Wa(),s=jo[o];return jsx("span",{ref:n,className:m("font-medium leading-none",s.label,a&&"text-muted-foreground",e),...r,children:t})});Hi.displayName="RadioLabel";var Ii=Z.forwardRef(({className:e,children:t,...r},n)=>{let{size:o}=Wa(),a=jo[o];return jsx("span",{ref:n,className:m("text-muted-foreground leading-snug",a.description,e),...r,children:t})});Ii.displayName="RadioDescription";var Vi=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("div",{ref:n,className:m("flex flex-col",e),...r,children:t}));Vi.displayName="RadioContent";var cu=Z.forwardRef(({value:e,label:t,description:r,isDisabled:n,className:o,...a},s)=>jsxs(Pi,{ref:s,value:e,isDisabled:n,className:o,...a,children:[jsx(Li,{}),(t||r)&&jsxs(Vi,{children:[t&&jsx(Hi,{children:t}),r&&jsx(Ii,{children:r})]})]}));cu.displayName="RadioGroupItem";var qa=cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",{variants:{variant:{solid:"bg-secondary hover:bg-secondary/80 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",bordered:"border border-input bg-transparent hover:bg-accent data-[state=on]:border-primary data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",flat:"bg-secondary/50 hover:bg-secondary data-[state=on]:bg-primary/15 data-[state=on]:text-primary"},size:{sm:"h-9 px-2.5 min-w-9",md:"h-10 px-3 min-w-10",lg:"h-11 px-5 min-w-11"}},defaultVariants:{variant:"solid",size:"md"}}),du=Z.forwardRef(({className:e,variant:t,size:r,pressed:n,defaultPressed:o=false,onPressedChange:a,isDisabled:s,onKeyDown:i,...l},c)=>{let[d,u]=Z.useState(o),p=n!==void 0,f=p?n:d,g=()=>{if(s)return;let b=!f;p||u(b),a?.(b);},v=b=>{b.key==="Enter"&&b.preventDefault(),i?.(b);};return jsx("button",{type:"button","aria-pressed":f,"data-state":f?"on":"off",disabled:s,ref:c,className:m(qa({variant:t,size:r,className:e})),onClick:g,onKeyDown:v,...l})});du.displayName="Toggle";var uu=Z.createContext(null),qy=()=>{let e=Z.useContext(uu);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e},mu=Z.forwardRef(({className:e,variant:t,size:r,type:n,value:o,defaultValue:a,onValueChange:s,isDisabled:i,children:l,...c},d)=>{let[u,p]=Z.useState(()=>n==="single"?a?[a]:[]:a||[]),f=o!==void 0,g=f?n==="single"?o?[o]:[]:o:u,v=b=>{if(n==="single"){let h=g.includes(b)?[]:[b];f||p(h),s?.(h[0]||"");}else {let h=g.includes(b)?g.filter(x=>x!==b):[...g,b];f||p(h),s?.(h);}};return jsx(uu.Provider,{value:{type:n,variant:t,size:r,value:g,onValueChange:v,isDisabled:i},children:jsx("div",{ref:d,role:"group",className:m("inline-flex","[&>*:not(:first-child):not(:last-child)]:rounded-none","[&>*:first-child]:rounded-r-none","[&>*:last-child]:rounded-l-none","[&>*:not(:first-child)]:-ml-px",e),...c,children:l})})});mu.displayName="ToggleGroup";var pu=Z.forwardRef(({className:e,children:t,variant:r,size:n,value:o,disabled:a,...s},i)=>{let l=qy(),c=l.value.includes(o),d=a||l.isDisabled;return jsx("button",{type:"button",role:"radio","aria-checked":c,"aria-pressed":c,"data-state":c?"on":"off",disabled:d,ref:i,className:m(qa({variant:l.variant||r,size:l.size||n}),e),onClick:()=>l.onValueChange(o),...s,children:t})});pu.displayName="ToggleGroupItem";var Xy={sm:{track:"h-1",thumb:"h-4 w-4",thumbOffset:"8px"},md:{track:"h-2",thumb:"h-5 w-5",thumbOffset:"10px"},lg:{track:"h-3",thumb:"h-6 w-6",thumbOffset:"12px"}},er=Z.forwardRef(({className:e,value:t,defaultValue:r=[0],onValueChange:n,onValueCommit:o,min:a=0,max:s=100,step:i=1,isDisabled:l=false,orientation:c="horizontal",trackColor:d,color:u="default",size:p="md",label:f,name:g,...v},b)=>{let h=d||u,[x,R]=Z.useState(r),N=t!==void 0,w=N?t:x,y=Z.useRef(null),[C,E]=Z.useState(false),[L,k]=Z.useState(null),S=(V,z)=>{if(!y.current)return w[0];let K=y.current.getBoundingClientRect(),Y;c==="horizontal"?Y=(V-K.left)/K.width:Y=1-(z-K.top)/K.height,Y=Math.max(0,Math.min(1,Y));let Q=a+Y*(s-a),J=Math.round(Q/i)*i;return Math.max(a,Math.min(s,J))},T=(V,z)=>{let K=[...w];K[z]=V,z>0&&V<w[z-1]&&(K[z]=w[z-1]),z<w.length-1&&V>w[z+1]&&(K[z]=w[z+1]),N||R(K),n?.(K);},M=(V,z)=>{l||(V.preventDefault(),E(true),k(z),V.target.setPointerCapture(V.pointerId));},D=V=>{if(!C||L===null||l)return;let z=S(V.clientX,V.clientY);T(z,L);},P=()=>{C&&(E(false),k(null),o?.(w));},I=V=>{if(l)return;let z=S(V.clientX,V.clientY),K=0,Y=Math.abs(w[0]-z);for(let Q=1;Q<w.length;Q++){let J=Math.abs(w[Q]-z);J<Y&&(Y=J,K=Q);}T(z,K),o?.([...w.slice(0,K),z,...w.slice(K+1)]);},H=(V,z)=>{if(l)return;let K=w[z];switch(V.key){case "ArrowRight":case "ArrowUp":V.preventDefault(),K=Math.min(s,w[z]+i);break;case "ArrowLeft":case "ArrowDown":V.preventDefault(),K=Math.max(a,w[z]-i);break;case "Home":V.preventDefault(),K=a;break;case "End":V.preventDefault(),K=s;break;default:return}T(K,z),o?.([...w.slice(0,z),K,...w.slice(z+1)]);},A=V=>(V-a)/(s-a)*100,B={default:{track:"bg-primary",thumb:"border-primary"},primary:{track:"bg-primary",thumb:"border-primary"},success:{track:"bg-green-500",thumb:"border-green-500"},warning:{track:"bg-yellow-500",thumb:"border-yellow-500"},danger:{track:"bg-red-500",thumb:"border-red-500"}},$=Xy[p],j=!(h in B),G=j?null:B[h],U=j?{backgroundColor:h}:void 0,W=j?{borderColor:h}:void 0;return jsxs("div",{ref:b,className:m("w-full",e),...v,children:[f&&jsx("div",{className:"mb-2 text-sm font-medium",children:f}),jsxs("div",{className:m("relative flex touch-none select-none items-center",c==="vertical"&&"flex-col h-full w-5",l&&"opacity-50 pointer-events-none"),children:[jsx("div",{ref:y,className:m("relative grow overflow-hidden rounded-full bg-secondary",c==="horizontal"?[$.track,"w-full"]:["h-full","w-2"]),onClick:I,children:jsx("div",{className:m("absolute",G?.track),style:c==="horizontal"?{left:w.length>1?`${A(w[0])}%`:0,right:`${100-A(w[w.length-1])}%`,top:0,bottom:0,...U}:{bottom:w.length>1?`${A(w[0])}%`:0,top:`${100-A(w[w.length-1])}%`,left:0,right:0,...U}})}),w.map((V,z)=>jsx("div",{role:"slider",tabIndex:l?-1:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":V,"aria-orientation":c,"aria-disabled":l,className:m("absolute block rounded-full border-2 bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-grab",$.thumb,G?.thumb,C&&L===z&&"cursor-grabbing"),style:c==="horizontal"?{left:`calc(${A(V)}% - ${$.thumbOffset})`,top:"50%",transform:"translateY(-50%)",...W}:{bottom:`calc(${A(V)}% - ${$.thumbOffset})`,left:"50%",transform:"translateX(-50%)",...W},onPointerDown:K=>M(K,z),onPointerMove:D,onPointerUp:P,onPointerCancel:P,onKeyDown:K=>H(K,z)},z)),g&&w.map((V,z)=>jsx("input",{type:"hidden",name:w.length>1?`${g}[${z}]`:g,value:V},z))]})]})});er.displayName="Slider";var gu=Z.createContext(null),bu=()=>{let e=Z.useContext(gu);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e},zi=Z.createContext(null),vu=()=>{let e=Z.useContext(zi);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return e},hu=Z.forwardRef(({className:e,type:t="multiple",variant:r="default",value:n,defaultValue:o,onValueChange:a,collapsible:s=true,isDisabled:i,children:l,...c},d)=>{let[u,p]=Z.useState(()=>t==="single"?o?[o]:[]:o||[]),f=Z.useRef(new Map),g=Z.useRef([]),v=n!==void 0,b=v?t==="single"?n?[n]:[]:n:u,h=w=>{if(t==="single"){let C=b.includes(w)&&s?[]:[w];v||p(C),a?.(C[0]||"");}else {let y=b.includes(w)?b.filter(C=>C!==w):[...b,w];v||p(y),a?.(y);}},x=Z.useCallback((w,y)=>{f.current.set(w,y),g.current.includes(w)||g.current.push(w);},[]),R=Z.useCallback(w=>{f.current.delete(w),g.current=g.current.filter(y=>y!==w);},[]),N=Z.useCallback(w=>{let y=g.current;if(y.length===0)return;let C=document.activeElement,E;f.current.forEach((M,D)=>{M===C&&(E=D);});let L=E?y.indexOf(E):-1,k;switch(w){case "first":k=0;break;case "last":k=y.length-1;break;case "next":k=L===-1?0:(L+1)%y.length;break;case "prev":k=L===-1?y.length-1:(L-1+y.length)%y.length;break}let S=y[k];f.current.get(S)?.focus();},[]);return jsx(gu.Provider,{value:{type:t,variant:r,value:b,onValueChange:h,collapsible:s,isDisabled:i,registerTrigger:x,unregisterTrigger:R,focusTrigger:N},children:jsx("div",{ref:d,"data-orientation":"vertical",className:m("w-full",r==="bordered"&&"border border-border rounded-lg px-4",r==="splitted"&&"space-y-2",e),...c,children:l})})});hu.displayName="Accordion";var xu=Z.forwardRef(({className:e,value:t,isDisabled:r,title:n,subtitle:o,startContent:a,children:s,...i},l)=>{let c=bu(),d=c.value.includes(t),u=r||c.isDisabled||false,{variant:p}=c,f=Z.useId(),g=Z.useId(),v=m(p==="default"&&"border-b border-border",p==="bordered"&&"border-b border-border last:border-b-0",p==="splitted"&&"border border-border rounded-lg px-4",u&&"opacity-50",e);return n!==void 0?jsx(zi.Provider,{value:{value:t,isOpen:d,isDisabled:u,contentId:f,triggerId:g},children:jsxs("div",{ref:l,"data-state":d?"open":"closed","data-disabled":u?"":void 0,className:v,...i,children:[jsx(yu,{children:jsxs("div",{className:"flex items-center gap-3",children:[a,jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-medium",children:n}),o&&jsx("span",{className:"text-xs text-muted-foreground",children:o})]})]})}),jsx(Ru,{children:s})]})}):jsx(zi.Provider,{value:{value:t,isOpen:d,isDisabled:u,contentId:f,triggerId:g},children:jsx("div",{ref:l,"data-state":d?"open":"closed","data-disabled":u?"":void 0,className:v,...i,children:s})})});xu.displayName="AccordionItem";var yu=Z.forwardRef(({className:e,children:t,onClick:r,onKeyDown:n,...o},a)=>{let s=bu(),{value:i,isOpen:l,isDisabled:c,contentId:d,triggerId:u}=vu(),p=Z.useRef(null);Z.useEffect(()=>{let g=p.current;return g&&!c&&s.registerTrigger(i,g),()=>{s.unregisterTrigger(i);}},[i,c,s]);let f=g=>{switch(n?.(g),g.key){case "ArrowDown":g.preventDefault(),s.focusTrigger("next");break;case "ArrowUp":g.preventDefault(),s.focusTrigger("prev");break;case "Home":g.preventDefault(),s.focusTrigger("first");break;case "End":g.preventDefault(),s.focusTrigger("last");break}};return jsx("h3",{className:"flex",children:jsxs("button",{type:"button",ref:g=>{p.current=g,typeof a=="function"?a(g):a&&(a.current=g);},id:u,"aria-controls":d,"aria-expanded":l,disabled:c,"data-state":l?"open":"closed",className:m("flex flex-1 items-center justify-between py-4 font-medium transition-all text-left cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),onClick:g=>{r?.(g),s.onValueChange(i);},onKeyDown:f,...o,children:[t,jsx(ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})})});yu.displayName="AccordionTrigger";var Ru=Z.forwardRef(({className:e,children:t,style:r,...n},o)=>{let{isOpen:a,contentId:s,triggerId:i,isDisabled:l}=vu();return jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:m("grid transition-[grid-template-rows] duration-200 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]",e),style:r,...n,children:jsx("div",{className:"overflow-hidden",children:jsx("div",{className:"pb-4 pt-0 text-sm",children:t})})})});Ru.displayName="AccordionContent";var Cu=Z.createContext(null),Mu=()=>{let e=Z.useContext(Cu);if(!e)throw new Error("Collapsible components must be used within a Collapsible");return e},Tu=Z.forwardRef(({className:e,open:t,defaultOpen:r=false,onOpenChange:n,isDisabled:o,title:a,children:s,...i},l)=>{let[c,d]=Z.useState(r),u=t!==void 0,p=u?t:c,f=Z.useId(),g=Z.useId(),v=b=>{o||(u||d(b),n?.(b));};return jsx(Cu.Provider,{value:{open:p,onOpenChange:v,isDisabled:o,contentId:f,triggerId:g},children:jsxs("div",{ref:l,"data-state":p?"open":"closed","data-disabled":o?"":void 0,className:m("space-y-2",e),...i,children:[a&&jsxs("div",{className:"flex items-center justify-between space-x-4 px-4",children:[jsx("h4",{className:"text-sm font-semibold",children:a}),jsx(Oi,{})]}),s]})})});Tu.displayName="Collapsible";var Oi=Z.forwardRef(({className:e,children:t,onClick:r,...n},o)=>{let{open:a,onOpenChange:s,isDisabled:i,contentId:l,triggerId:c}=Mu();return jsx(me,{ref:o,id:c,"aria-controls":l,"aria-expanded":a,isDisabled:i,"data-state":a?"open":"closed","data-disabled":i?"":void 0,variant:"light",size:"sm",isIconOnly:true,className:e,onClick:d=>{r?.(d),s(!a);},...n,children:t??jsx(ChevronsUpDown,{className:m("h-4 w-4 transition-transform duration-200",a&&"rotate-180")})})});Oi.displayName="CollapsibleTrigger";var Nu=Z.forwardRef(({className:e,children:t,style:r,...n},o)=>{let{open:a,contentId:s,triggerId:i,isDisabled:l}=Mu(),c=Z.useRef(null),[d,u]=Z.useState(0),[p,f]=Z.useState(false),[g,v]=Z.useState(a);Z.useEffect(()=>{a?(v(true),u(0),f(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c.current&&u(c.current.scrollHeight);});})):(f(true),c.current?(u(c.current.scrollHeight),requestAnimationFrame(()=>{u(0);})):u(0));},[a]);let b=()=>{f(false),a||v(false);};return g?jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:m("overflow-hidden",e),style:{...r,height:p?d:a?"auto":0,transition:p?"height 0.25s ease-out, opacity 0.25s ease-out":void 0,opacity:a?1:0},onTransitionEnd:b,...n,children:jsx("div",{ref:c,className:"space-y-2",children:t})}):null});Nu.displayName="CollapsibleContent";var e0=cva("relative w-full overflow-hidden rounded-full bg-secondary",{variants:{size:{sm:"h-1.5",md:"h-2.5",lg:"h-4"}},defaultVariants:{size:"md"}}),ku={primary:"bg-primary",success:"bg-green-600 dark:bg-green-500",warning:"bg-amber-600 dark:bg-amber-500",danger:"bg-red-600 dark:bg-red-500"},Ja=Z.forwardRef(({className:e,value:t=0,max:r=100,label:n,showPercentage:o=false,formatPercentage:a=u=>`${Math.round(u)}%`,size:s,color:i="primary",isIndeterminate:l=false,...c},d)=>{let u=Math.min(Math.max(t/r*100,0),100),p=n||o&&!l,f=ku[i]||"",g=!ku[i];return jsxs("div",{ref:d,className:"w-full",children:[p&&jsxs("div",{className:"flex justify-between text-sm mb-2",children:[n&&jsx("span",{className:"text-muted-foreground",children:n}),o&&!l&&jsx("span",{className:m("text-muted-foreground",!n&&"ml-auto"),children:a(u)})]}),jsx("div",{role:"progressbar","aria-valuenow":l?void 0:t,"aria-valuemin":0,"aria-valuemax":r,"aria-label":typeof n=="string"?n:void 0,className:m(e0({size:s}),e),...c,children:jsx("div",{className:m("h-full rounded-full",f,l?"w-1/3 animate-[progress-indeterminate_1.5s_ease-in-out_infinite]":"w-full flex-1 transition-all"),style:{...l?{}:{transform:`translateX(-${100-u}%)`},...g?{backgroundColor:i}:{}}})})]})});Ja.displayName="Progress";var Lu=Z.createContext(null),Du=()=>{let e=Z.useContext(Lu);if(!e)throw new Error("HoverCard components must be used within a HoverCard");return e},Hu=({children:e,open:t,defaultOpen:r=false,onOpenChange:n,openDelay:o=700,closeDelay:a=300,closeOnScroll:s=true})=>{let[i,l]=Z.useState(r),c=t!==void 0,d=c?t:i,u=Z.useRef(null),p=Z.useId(),f=Z.useRef(null),g=Z.useRef(null),v=Z.useCallback(b=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current),b?f.current=setTimeout(()=>{c||l(true),n?.(true);},o):g.current=setTimeout(()=>{c||l(false),n?.(false);},a);},[c,n,o,a]);return Z.useEffect(()=>{if(!s||!d)return;let b=()=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current),c||l(false),n?.(false);};return window.addEventListener("scroll",b,true),()=>window.removeEventListener("scroll",b,true)},[s,d,c,n]),Z.useEffect(()=>()=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current);},[]),jsx(Lu.Provider,{value:{open:d,onOpenChange:v,triggerRef:u,contentId:p},children:e})};Hu.displayName="HoverCard";var Iu=Z.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:r,onFocus:n,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l}=Du();return jsx("a",{ref:f=>{l.current=f,typeof s=="function"?s(f):s&&(s.current=f);},onMouseEnter:f=>{t?.(f),i(true);},onMouseLeave:f=>{r?.(f),i(false);},onFocus:f=>{n?.(f),i(true);},onBlur:f=>{o?.(f),i(false);},...a,children:e})});Iu.displayName="HoverCardTrigger";var Vu=Z.forwardRef(({className:e,side:t="bottom",sideOffset:r=4,align:n="center",alignOffset:o=0,onMouseEnter:a,onMouseLeave:s,children:i,...l},c)=>{let{open:d,onOpenChange:u,triggerRef:p,contentId:f}=Du(),[g,v]=Z.useState({top:0,left:0}),[b,h]=Z.useState(false),x=Z.useRef(null);Z.useEffect(()=>{h(true);},[]),Z.useEffect(()=>{if(!d||!p.current||!x.current)return;(()=>{if(!p.current||!x.current)return;let C=p.current.getBoundingClientRect(),E=x.current.getBoundingClientRect(),L=0,k=0;switch(t){case "top":L=C.top-E.height-r;break;case "bottom":L=C.bottom+r;break;case "left":k=C.left-E.width-r;break;case "right":k=C.right+r;break}if(t==="top"||t==="bottom")switch(n){case "start":k=C.left+o;break;case "center":k=C.left+C.width/2-E.width/2;break;case "end":k=C.right-E.width-o;break}else switch(n){case "start":L=C.top+o;break;case "center":L=C.top+C.height/2-E.height/2;break;case "end":L=C.bottom-E.height-o;break}v({top:L,left:k});})();},[d,t,r,n,o,p]);let R=y=>{a?.(y),u(true);},N=y=>{s?.(y),u(false);};if(!b||!d)return null;let w={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 Ua.createPortal(jsx("div",{ref:y=>{x.current=y,typeof c=="function"?c(y):c&&(c.current=y);},id:f,"data-state":d?"open":"closed","data-side":t,className:m("fixed z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",w,e),style:{top:g.top,left:g.left},onMouseEnter:R,onMouseLeave:N,...l,children:i}),document.body)});Vu.displayName="HoverCardContent";var Au=Z.createContext({size:"md",variant:"default",radius:"md"}),es=()=>Z.useContext(Au);cva("",{variants:{size:{sm:"",md:"",lg:""},variant:{default:"",bordered:"",filled:""},radius:{none:"",sm:"",md:"",lg:"",full:""}},defaultVariants:{size:"md",variant:"default",radius:"md"}});var n0=cva("flex flex-wrap items-center break-words",{variants:{size:{sm:"gap-1 text-xs",md:"gap-1.5 text-sm sm:gap-2",lg:"gap-2 text-base sm:gap-3"},variant:{default:"text-muted-foreground",bordered:"text-muted-foreground px-3 py-1.5 border",filled:"text-muted-foreground bg-muted px-3 py-1.5"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",variant:"default",radius:"md"}}),o0=cva("",{variants:{size:{sm:"[&>svg]:h-3 [&>svg]:w-3",md:"[&>svg]:h-3.5 [&>svg]:w-3.5",lg:"[&>svg]:h-4 [&>svg]:w-4"}},defaultVariants:{size:"md"}}),a0=cva("flex items-center justify-center",{variants:{size:{sm:"h-6 w-6 [&>svg]:h-3 [&>svg]:w-3",md:"h-8 w-8 [&>svg]:h-4 [&>svg]:w-4",lg:"h-10 w-10 [&>svg]:h-5 [&>svg]:w-5"}},defaultVariants:{size:"md"}}),zu=Z.forwardRef(({size:e="md",variant:t="default",radius:r="md",children:n,...o},a)=>jsx(Au.Provider,{value:{size:e,variant:t,radius:r},children:jsx("nav",{ref:a,"aria-label":"breadcrumb",...o,children:n})}));zu.displayName="Breadcrumb";var Ou=Z.forwardRef(({className:e,...t},r)=>{let{size:n,variant:o,radius:a}=es();return jsx("ol",{ref:r,className:m(n0({size:n,variant:o,radius:o==="default"?void 0:a}),e),...t})});Ou.displayName="BreadcrumbList";var Fu=Z.forwardRef(({className:e,...t},r)=>{let{size:n}=es();return jsx("li",{ref:r,className:m("inline-flex items-center",n==="sm"&&"gap-1",n==="md"&&"gap-1.5",n==="lg"&&"gap-2",e),...t})});Fu.displayName="BreadcrumbItem";var Bu=Z.forwardRef(({className:e,...t},r)=>jsx("a",{ref:r,className:m("transition-colors hover:text-foreground cursor-pointer",e),...t}));Bu.displayName="BreadcrumbLink";var $u=Z.forwardRef(({className:e,...t},r)=>jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:m("font-medium text-foreground",e),...t}));$u.displayName="BreadcrumbPage";var Ku=({children:e,className:t,...r})=>{let{size:n}=es();return jsx("li",{role:"presentation","aria-hidden":"true",className:m(o0({size:n}),"text-muted-foreground/60",t),...r,children:e??jsx(ChevronRight,{})})};Ku.displayName="BreadcrumbSeparator";var Gu=({className:e,...t})=>{let{size:r}=es();return jsxs("span",{role:"presentation","aria-hidden":"true",className:m(a0({size:r}),e),...t,children:[jsx(MoreHorizontal,{}),jsx("span",{className:"sr-only",children:"More"})]})};Gu.displayName="BreadcrumbEllipsis";var ju=Z.forwardRef(({ratio:e=1,className:t,style:r,children:n,...o},a)=>jsx("div",{ref:a,className:m("relative w-full",t),style:{...r,paddingBottom:`${100/e}%`},...o,children:jsx("div",{className:"absolute inset-0",children:n})}));ju.displayName="AspectRatio";var qu=Z.createContext(null),Bi=()=>{let e=Z.useContext(qu);if(!e)throw new Error("NavigationMenu components must be used within a NavigationMenu");return e},Xu=Z.createContext(null),Zu=()=>{let e=Z.useContext(Xu);if(!e)throw new Error("NavigationMenuItem components must be used within a NavigationMenuItem");return e},Ju=Z.forwardRef(({className:e,orientation:t="horizontal",children:r,...n},o)=>{let[a,s]=Z.useState(null);return jsx(qu.Provider,{value:{activeItem:a,setActiveItem:s,orientation:t},children:jsxs("nav",{ref:o,className:m("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[r,jsx($i,{})]})})});Ju.displayName="NavigationMenu";var Qu=Z.forwardRef(({className:e,...t},r)=>{let{orientation:n}=Bi();return jsx("ul",{ref:r,className:m("group flex flex-1 list-none items-center justify-center gap-1",n==="vertical"&&"flex-col items-start",e),...t})});Qu.displayName="NavigationMenuList";var em=Z.forwardRef(({className:e,children:t,...r},n)=>{let{activeItem:o,setActiveItem:a}=Bi(),s=Z.useId(),i=Z.useRef(null),l=o===s,c=Z.useCallback(d=>{a(d?s:null);},[s,a]);return jsx(Xu.Provider,{value:{itemId:s,triggerRef:i,open:l,onOpenChange:c},children:jsx("li",{ref:n,className:m("relative",e),...r,children:t})})});em.displayName="NavigationMenuItem";var tm=cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50"),rm=Z.forwardRef(({className:e,children:t,onMouseEnter:r,onClick:n,...o},a)=>{let{triggerRef:s,open:i,onOpenChange:l}=Zu(),c=u=>{r?.(u),l(true);},d=u=>{n?.(u),l(!i);};return jsxs("button",{ref:u=>{s.current=u,typeof a=="function"?a(u):a&&(a.current=u);},type:"button","data-state":i?"open":"closed",className:m(tm(),"group",e),onMouseEnter:c,onClick:d,"aria-expanded":i,...o,children:[t,jsx(ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})});rm.displayName="NavigationMenuTrigger";var nm=Z.forwardRef(({className:e,onMouseEnter:t,onMouseLeave:r,...n},o)=>{let{open:a,onOpenChange:s,triggerRef:i}=Zu(),l=Z.useRef(null),[c,d]=Z.useState({top:0,left:0});Z.useEffect(()=>{if(!a||!i.current)return;let f=()=>{if(!i.current)return;let g=i.current.getBoundingClientRect();d({top:g.bottom+4,left:g.left});};return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,true),()=>{window.removeEventListener("resize",f),window.removeEventListener("scroll",f,true);}},[a,i]);let u=f=>{t?.(f),s(true);},p=f=>{r?.(f),s(false);};return a?Ua.createPortal(jsx("div",{ref:f=>{l.current=f,typeof o=="function"?o(f):o&&(o.current=f);},"data-state":a?"open":"closed",className:m("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-4 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",e),style:{top:c.top,left:c.left},onMouseEnter:u,onMouseLeave:p,...n}),document.body):null});nm.displayName="NavigationMenuContent";var om=cva("block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"),am=Z.forwardRef(({className:e,active:t,...r},n)=>jsx("a",{ref:n,className:m(om(),t&&"bg-accent text-accent-foreground",e),...r}));am.displayName="NavigationMenuLink";var $i=Z.forwardRef((e,t)=>null);$i.displayName="NavigationMenuViewport";var sm=Z.forwardRef(({className:e,...t},r)=>{let{activeItem:n}=Bi();return n?jsx("div",{ref:r,className:m("top-full z-[1] flex h-2.5 items-end justify-center overflow-hidden","data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}):null});sm.displayName="NavigationMenuIndicator";var Yo=0,Ki=null;function lr(){Yo===0&&(Ki=document.body.style.overflow,document.body.style.overflow="hidden"),Yo++;}function cr(){Yo--,Yo<=0&&(Yo=0,document.body.style.overflow=Ki??"",Ki=null);}var dm=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 focus-visible:outline-none 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"}}),Ct=Z.forwardRef(({className:e,size:t,...r},n)=>{let a={sm:14,md:16,lg:20}[t??"md"];return jsx("button",{ref:n,type:"button",className:m(dm({size:t}),e),"aria-label":"Close",...r,children:jsx(X,{style:{width:a,height:a}})})});Ct.displayName="CloseButton";var ts=Z.createContext(null);function b0(){let e=Z.useContext(ts);if(!e)throw new Error("useDrawer must be used within a DrawerProvider.");return e}function Fr(){return Z.useContext(ts)}var v0="16rem",h0="18rem",x0="3rem",y0="b",R0={xs:"256px",sm:"320px",md:"384px",lg:"448px",xl:"512px","2xl":"576px","3xl":"672px","4xl":"768px","5xl":"896px",full:"100%"},w0={xs:"20vh",sm:"30vh",md:"40vh",lg:"50vh",xl:"60vh","2xl":"70vh","3xl":"75vh","4xl":"80vh","5xl":"90vh",full:"100vh"},Gi=Z.forwardRef(({defaultOpen:e=false,open:t,onOpenChange:r,placement:n="left",size:o="md",backdrop:a="opaque",isDismissable:s=true,hideCloseButton:i=false,collapsible:l="offcanvas",mode:c,className:d,style:u,children:p,...f},g)=>{let v=c??"overlay",b=v==="overlay",[h,x]=Z.useState(false),[R,N]=Z.useState(false),[w,y]=Z.useState(e),C=t??w,E=Z.useCallback(T=>{let M=typeof T=="function"?T(C):T;r?r(M):y(M);},[r,C]);Z.useEffect(()=>{let T=()=>{x(window.innerWidth<768);};return T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);let L=Z.useCallback(()=>b?E(T=>!T):h?N(T=>!T):E(T=>!T),[h,E,N,b]);Z.useEffect(()=>{if(b)return;let T=M=>{M.key===y0&&(M.metaKey||M.ctrlKey)&&(M.preventDefault(),L());};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[L,b]);let k=C?"expanded":"collapsed",S=Z.useMemo(()=>({placement:n,state:k,open:C,setOpen:E,isMobile:h,openMobile:R,setOpenMobile:N,toggleDrawer:L,collapsible:l,mode:v,size:o,backdrop:a,isDismissable:s,hideCloseButton:i}),[n,k,C,E,h,R,N,L,l,v,o,a,s,i]);return b?jsx(ts.Provider,{value:S,children:jsx(Drawer.Root,{open:C,onOpenChange:E,direction:n,dismissible:s,children:p})}):jsx(ts.Provider,{value:S,children:jsx("div",{ref:g,style:{"--drawer-width":v0,"--drawer-width-icon":x0,...u},className:m("group/drawer-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",d),...f,children:p})})});Gi.displayName="Drawer";var mm=Z.forwardRef(({variant:e="default",embedded:t=false,className:r,children:n,...o},a)=>{let s=Fr();if(!s)return jsx("div",{ref:a,className:m("flex h-full flex-col bg-background text-foreground",r),...o,children:n});let{placement:i,collapsible:l,isMobile:c,state:d,openMobile:u,setOpenMobile:p}=s;if(i==="bottom"||i==="top")return jsx(Fragment,{children:n});if(l==="none")return jsx("div",{ref:a,className:m("flex h-full w-[--drawer-width] flex-col bg-background text-foreground border-r",i==="right"&&"border-l border-r-0",r),...o,children:n});if(c&&!t)return jsx(C0,{open:u,onOpenChange:p,placement:i,children:n});if(t){let g=d==="collapsed",v=l==="offcanvas",b=l==="icon";return jsx("div",{ref:a,className:m("group peer text-foreground relative"),"data-state":d,"data-collapsible":g?l:"","data-variant":e,"data-placement":i,"data-embedded":"true",children:jsx("div",{className:m("flex h-full flex-col overflow-hidden transition-[width,opacity] duration-200 ease-out",v?g?"w-0 opacity-0":"w-[--drawer-width] opacity-100":b&&g?"w-[--drawer-width-icon]":"w-[--drawer-width]",r),...o,children:jsx("div",{"data-drawer":"drawer",className:m("flex h-full w-full flex-col bg-background transition-opacity duration-200",e==="floating"&&"overflow-hidden rounded-lg border shadow-sm",e==="inset"&&"overflow-hidden rounded-lg border",e==="default"&&i==="left"&&"border-r",e==="default"&&i==="right"&&"border-l"),children:n})})})}return jsxs("div",{ref:a,className:"group peer hidden md:block text-foreground","data-state":d,"data-collapsible":d==="collapsed"?l:"","data-variant":e,"data-placement":i,children:[jsx("div",{className:m("duration-200 relative h-svh w-[--drawer-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0",i==="right"&&"group-data-[placement=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--drawer-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--drawer-width-icon]")}),jsx("div",{className:m("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--drawer-width] transition-[left,right,width] ease-linear md:flex",i==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--drawer-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--drawer-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--drawer-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--drawer-width-icon] group-data-[placement=left]:border-r group-data-[placement=right]:border-l",r),...o,children:jsx("div",{"data-drawer":"drawer",className:m("flex h-full w-full flex-col bg-background",e==="floating"&&"overflow-hidden rounded-lg border shadow-sm",e==="inset"&&"overflow-hidden rounded-lg border"),children:n})})]})});mm.displayName="DrawerSidebar";var C0=({children:e,open:t,onOpenChange:r,placement:n})=>{let[o,a]=Z.useState(false);return Z.useEffect(()=>{a(true);},[]),Z.useEffect(()=>{if(t)return lr(),()=>cr()},[t]),!o||!t?null:Ua.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/80 animate-in fade-in-0",onClick:()=>r(false)}),jsx("div",{className:m("fixed z-50 bg-background p-0 text-foreground shadow-lg","animate-in",n==="left"&&"inset-y-0 left-0 h-full w-[--drawer-width] slide-in-from-left",n==="right"&&"inset-y-0 right-0 h-full w-[--drawer-width] slide-in-from-right"),style:{"--drawer-width":h0},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},pm=Z.forwardRef(({className:e,onClick:t,...r},n)=>{let o=Fr();if(o?.mode==="overlay")return jsx(Drawer.Trigger,{ref:n,className:e,onClick:t,...r});let a=o?.toggleDrawer;return jsxs("button",{ref:n,type:"button","data-drawer":"trigger",className:m("flex items-center justify-center h-9 w-9 rounded-lg bg-transparent hover:bg-accent transition-colors cursor-pointer",e),onClick:s=>{t?.(s),a?.();},...r,children:[jsx(PanelLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle Drawer"})]})});pm.displayName="DrawerTrigger";var fm=Z.forwardRef(({className:e,children:t,...r},n)=>{let o=Fr(),a=o?.mode==="overlay",s=o?.placement||"left",i=o?.size||"md",l=o?.backdrop||"opaque";if(a){let c=s==="top"||s==="bottom",d=s==="left"||s==="right",u=d?R0[i]:w0[i],p={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},f={top:"inset-x-0 top-0 rounded-b-[10px]",bottom:"inset-x-0 bottom-0 rounded-t-[10px]",left:"inset-y-0 left-0 rounded-r-[10px]",right:"inset-y-0 right-0 rounded-l-[10px]"};return jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:m("fixed inset-0 z-50",p[l])}),jsxs(Drawer.Content,{ref:n,className:m("fixed z-50 flex flex-col border bg-background",f[s],e),style:{...d?{width:u,height:"100%"}:{},...c?{maxHeight:u}:{},...r.style},...r,children:[c&&jsx("div",{className:m("mx-auto h-2 w-[100px] rounded-full bg-muted",s==="top"?"mb-4 mt-auto":"mt-4")}),t]})]})}return jsx("div",{ref:n,className:m("flex flex-col h-full",e),...r,children:t})});fm.displayName="DrawerContent";var gm=Z.forwardRef(({className:e,hideCloseButton:t,children:r,...n},o)=>{let a=Fr(),s=a?.hideCloseButton??false,i=!t&&!s;return jsxs("div",{ref:o,"data-drawer":"header",className:m("flex flex-col gap-2 p-4 relative",e),...n,children:[r,i&&jsx(Ct,{className:"absolute right-4 top-4",onClick:()=>a?.setOpen(false)})]})});gm.displayName="DrawerHeader";var bm=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-drawer":"body",className:m("flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-4 group-data-[collapsible=icon]:overflow-hidden",e),...t}));bm.displayName="DrawerBody";var vm=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-drawer":"footer",className:m("flex flex-col gap-2 p-4 mt-auto",e),...t}));vm.displayName="DrawerFooter";var hm=Z.forwardRef(({className:e,...t},r)=>Fr()?.mode==="overlay"?jsx(Drawer.Title,{ref:r,className:m("text-lg font-semibold leading-none tracking-tight",e),...t}):jsx("h2",{ref:r,className:m("text-lg font-semibold leading-none tracking-tight",e),...t}));hm.displayName="DrawerTitle";var xm=Z.forwardRef(({className:e,...t},r)=>Fr()?.mode==="overlay"?jsx(Drawer.Description,{ref:r,className:m("text-sm text-muted-foreground",e),...t}):jsx("p",{ref:r,className:m("text-sm text-muted-foreground",e),...t}));xm.displayName="DrawerDescription";var ym=Z.forwardRef(({className:e,onClick:t,...r},n)=>{let o=Fr();return jsx(Ct,{ref:n,className:e,onClick:a=>{t?.(a),o?.setOpen(false);},...r})});ym.displayName="DrawerClose";var Rm=Z.forwardRef(({className:e,onClick:t,showLabel:r=true,...n},o)=>{let a=Fr();if(!a)return null;let{toggleDrawer:s,state:i,placement:l}=a,c=i==="collapsed",d=l==="left",u=d?PanelLeftOpen:PanelRightOpen,p=d?PanelLeftClose:PanelRightClose;return jsxs("button",{ref:o,type:"button","data-drawer":"toggle","data-state":i,className:m("flex items-center gap-2 w-full px-2 py-2 rounded-md text-sm text-muted-foreground","hover:bg-accent hover:text-accent-foreground","transition-colors cursor-pointer","group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0",e),onClick:f=>{t?.(f),s();},...n,children:[c?jsx(u,{className:"h-4 w-4 shrink-0"}):jsx(p,{className:"h-4 w-4 shrink-0"}),r&&jsx("span",{className:"group-data-[collapsible=icon]:hidden truncate",children:c?"Expand":"Collapse"})]})});Rm.displayName="DrawerToggle";var wm=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-drawer":"separator",className:m("mx-4 h-px bg-border",e),...t}));wm.displayName="DrawerSeparator";var Cm=Z.forwardRef(({className:e,...t},r)=>jsx("ul",{ref:r,"data-drawer":"menu",className:m("flex w-full min-w-0 flex-col gap-1",e),...t}));Cm.displayName="DrawerMenu";var Mm=Z.forwardRef(({className:e,...t},r)=>jsx("li",{ref:r,"data-drawer":"menu-item",className:m("group/menu-item relative",e),...t}));Mm.displayName="DrawerMenuItem";var Tm=cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-ring transition-[width,height,padding] hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 active:bg-accent active:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-accent data-[active=true]:font-medium data-[active=true]:text-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground",bordered:"bg-background shadow-[0_0_0_1px_currentColor] hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent/50 hover:text-accent-foreground"},size:{sm:"h-7 text-xs",md:"h-8 text-sm",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"md"}}),Nm=Z.forwardRef(({isActive:e=false,variant:t="default",size:r="md",tooltip:n,className:o,children:a,...s},i)=>{let l=Fr(),c=l?.isMobile??false,d=l?.state??"expanded",u=jsx("button",{ref:i,type:"button","data-drawer":"menu-button","data-size":r,"data-active":e,className:m(Tm({variant:t,size:r}),o),...s,children:a});return !n||d!=="collapsed"||c?u:jsx(yr,{content:n,position:"right",align:"center",delayDuration:0,children:u})});Nm.displayName="DrawerMenuButton";var km=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-drawer":"group",className:m("relative flex w-full min-w-0 flex-col p-2",e),...t}));km.displayName="DrawerGroup";var Sm=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-drawer":"group-label",className:m("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-muted-foreground outline-none transition-[margin,opacity] ease-linear","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...t}));Sm.displayName="DrawerGroupLabel";var Em=Z.forwardRef(({className:e,...t},r)=>jsx("main",{ref:r,className:m("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));Em.displayName="DrawerInset";var M0=Gi;var k0="16rem",S0="18rem",E0="3rem",P0="b",L0="sidebar:state",D0=3600*24*7,io=Z.createContext(null);function H0(){let e=Z.useContext(io);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function qo(){return Z.useContext(io)}var Dm=Z.forwardRef(({defaultOpen:e=true,isOpen:t,onOpenChange:r,className:n,style:o,children:a,...s},i)=>{let[l,c]=Z.useState(false),[d,u]=Z.useState(false),[p,f]=Z.useState(e),g=t??p,v=Z.useCallback(R=>{let N=typeof R=="function"?R(g):R;r?r(N):f(N),document.cookie=`${L0}=${N}; path=/; max-age=${D0}`;},[r,g]);Z.useEffect(()=>{let R=()=>{c(window.innerWidth<768);};return R(),window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);let b=Z.useCallback(()=>l?u(R=>!R):v(R=>!R),[l,v,u]);Z.useEffect(()=>{let R=N=>{N.key===P0&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),b());};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[b]);let h=g?"expanded":"collapsed",x=Z.useMemo(()=>({state:h,isOpen:g,setOpen:v,isMobile:l,isOpenMobile:d,setOpenMobile:u,toggleSidebar:b,side:"left",variant:"sidebar",collapsible:"offcanvas"}),[h,g,v,l,d,u,b]);return jsx(io.Provider,{value:x,children:jsx("div",{ref:i,style:{"--sidebar-width":k0,"--sidebar-width-icon":E0,...o},className:m("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",n),...s,children:a})})});Dm.displayName="SidebarProvider";var Hm=Z.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:o,...a},s)=>{let i=qo();if(!i)return jsx("aside",{ref:s,className:m("flex h-full flex-col bg-sidebar text-sidebar-foreground",n),...a,children:o});let{state:l,isMobile:c,isOpenMobile:d,setOpenMobile:u}=i,p=Z.useMemo(()=>({...i,side:e,variant:t,collapsible:r}),[i,e,t,r]);return r==="none"?jsx(io.Provider,{value:p,children:jsx("aside",{ref:s,className:m("flex h-svh w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",e==="left"&&"border-r",e==="right"&&"border-l",n),...a,children:o})}):c?jsx(io.Provider,{value:p,children:jsx(I0,{open:d,onOpenChange:u,side:e,children:o})}):jsx(io.Provider,{value:p,children:jsxs("div",{ref:s,className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":t,"data-side":e,children:[jsx("div",{className:m("relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0",e==="right"&&"group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),jsx("div",{className:m("fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem+2px)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...a,children:jsx("div",{"data-sidebar":"sidebar",className:"bg-sidebar flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:o})})]})})});Hm.displayName="Sidebar";var I0=({children:e,open:t,onOpenChange:r,side:n})=>{let[o,a]=Z.useState(false);return Z.useEffect(()=>{a(true);},[]),Z.useEffect(()=>{if(t)return lr(),()=>cr()},[t]),!o||!t?null:Ua.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/80 animate-in fade-in-0",onClick:()=>r(false)}),jsx("aside",{"data-sidebar":"sidebar","data-mobile":"true",className:m("fixed z-50 bg-sidebar p-0 text-sidebar-foreground shadow-lg","animate-in",n==="left"&&"inset-y-0 left-0 h-full w-[--sidebar-width] slide-in-from-left border-r",n==="right"&&"inset-y-0 right-0 h-full w-[--sidebar-width] slide-in-from-right border-l"),style:{"--sidebar-width":S0},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},Im=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-sidebar":"header",className:m("flex flex-col gap-2 p-2",e),...t}));Im.displayName="SidebarHeader";var Vm=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-sidebar":"content",className:m("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));Vm.displayName="SidebarContent";var Am=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-sidebar":"footer",className:m("flex flex-col gap-2 p-2",e),...t}));Am.displayName="SidebarFooter";var zm=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-sidebar":"group",className:m("relative flex w-full min-w-0 flex-col p-2",e),...t}));zm.displayName="SidebarGroup";var Om=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-sidebar":"group-label",className:m("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] ease-linear focus-visible:ring-2","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...t}));Om.displayName="SidebarGroupLabel";var Fm=Z.forwardRef(({className:e,...t},r)=>jsx("button",{ref:r,type:"button","data-sidebar":"group-action",className:m("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...t}));Fm.displayName="SidebarGroupAction";var Bm=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-sidebar":"group-content",className:m("w-full text-sm",e),...t}));Bm.displayName="SidebarGroupContent";var $m=Z.forwardRef(({className:e,...t},r)=>jsx("ul",{ref:r,"data-sidebar":"menu",className:m("flex w-full min-w-0 flex-col gap-1",e),...t}));$m.displayName="SidebarMenu";var Km=Z.forwardRef(({className:e,...t},r)=>jsx("li",{ref:r,"data-sidebar":"menu-item",className:m("group/menu-item relative",e),...t}));Km.displayName="SidebarMenuItem";var Gm=cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] cursor-pointer focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",bordered:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",ghost:"hover:bg-transparent hover:text-sidebar-accent-foreground hover:underline"},size:{sm:"h-7 text-xs",md:"h-8 text-sm",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"md"}}),Um=Z.forwardRef(({isActive:e=false,variant:t="default",size:r="md",tooltip:n,asChild:o=false,className:a,children:s,...i},l)=>{let c=qo(),d=c?.isMobile??false,u=c?.state??"expanded",p=c?.side??"left",f=jsx("button",{ref:l,type:"button","data-sidebar":"menu-button","data-size":r,"data-active":e,className:m(Gm({variant:t,size:r}),a),...i,children:s});return !n||u!=="collapsed"||d?f:jsx(yr,{content:typeof n=="string"?n:void 0,position:p==="left"?"right":"left",align:"center",delayDuration:0,children:f})});Um.displayName="SidebarMenuButton";var _m=Z.forwardRef(({className:e,showOnHover:t=false,...r},n)=>jsx("button",{ref:n,type:"button","data-sidebar":"menu-action",className:m("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=md]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r}));_m.displayName="SidebarMenuAction";var jm=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-sidebar":"menu-badge",className:m("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=md]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));jm.displayName="SidebarMenuBadge";var Wm=Z.forwardRef(({className:e,...t},r)=>jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:m("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Wm.displayName="SidebarMenuSub";var Ym=Z.forwardRef(({className:e,...t},r)=>jsx("li",{ref:r,"data-sidebar":"menu-sub-item",className:m("",e),...t}));Ym.displayName="SidebarMenuSubItem";var qm=Z.forwardRef(({isActive:e=false,size:t="md",className:r,...n},o)=>jsx("a",{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":e,className:m("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...n}));qm.displayName="SidebarMenuSubButton";var Xm=Z.forwardRef(({className:e,showIcon:t=false,...r},n)=>{let o=Z.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:m("rounded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&jsx("div",{className:"size-4 rounded-md bg-sidebar-accent-foreground/10 animate-pulse","data-sidebar":"menu-skeleton-icon"}),jsx("div",{className:"h-4 flex-1 max-w-[--skeleton-width] rounded-md bg-sidebar-accent-foreground/10 animate-pulse","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});Xm.displayName="SidebarMenuSkeleton";var Zm=Z.forwardRef(({className:e,onClick:t,...r},n)=>{let a=qo()?.toggleSidebar;return jsxs("button",{ref:n,type:"button","data-sidebar":"trigger",className:m("flex items-center justify-center h-7 w-7 rounded-md hover:bg-accent transition-colors cursor-pointer",e),onClick:s=>{t?.(s),a?.();},...r,children:[jsx(PanelLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});Zm.displayName="SidebarTrigger";var Jm=Z.forwardRef(({className:e,...t},r)=>{let n=qo();if(!n)return null;let{toggleSidebar:o}=n;return jsx("button",{ref:r,type:"button","data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:m("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});Jm.displayName="SidebarRail";var Qm=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,"data-sidebar":"separator",className:m("mx-2 w-auto h-px bg-sidebar-border",e),...t}));Qm.displayName="SidebarSeparator";var ep=Z.forwardRef(({className:e,...t},r)=>jsx("main",{ref:r,"data-sidebar":"inset",className:m("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));ep.displayName="SidebarInset";var tp=Z.forwardRef(({className:e,...t},r)=>jsx("div",{className:"relative w-full overflow-auto",children:jsx("table",{ref:r,className:m("w-full caption-bottom text-sm",e),...t})}));tp.displayName="Table";var rp=Z.forwardRef(({className:e,...t},r)=>jsx("thead",{ref:r,className:m("[&_tr]:border-b",e),...t}));rp.displayName="TableHeader";var np=Z.forwardRef(({className:e,...t},r)=>jsx("tbody",{ref:r,className:m("[&_tr:last-child]:border-0",e),...t}));np.displayName="TableBody";var op=Z.forwardRef(({className:e,...t},r)=>jsx("tfoot",{ref:r,className:m("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));op.displayName="TableFooter";var ap=Z.forwardRef(({className:e,...t},r)=>jsx("tr",{ref:r,className:m("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));ap.displayName="TableRow";var sp=Z.forwardRef(({className:e,...t},r)=>jsx("th",{ref:r,className:m("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));sp.displayName="TableHead";var ip=Z.forwardRef(({className:e,...t},r)=>jsx("td",{ref:r,className:m("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ip.displayName="TableCell";var lp=Z.forwardRef(({className:e,...t},r)=>jsx("caption",{ref:r,className:m("mt-4 text-sm text-muted-foreground",e),...t}));lp.displayName="TableCaption";function $0({className:e,data:t,columns:r,selectable:n=false,selectedKeys:o,onSelectionChange:a,getRowKey:s=(N,w)=>String(w),sortable:i=false,sortState:l,onSortChange:c,paginated:d=false,pageSizeOptions:u=[10,20,50],paginationState:p,onPaginationChange:f,emptyContent:g="No data",loading:v=false,striped:b=false,hoverable:h=true,...x},R){let[N,w]=Z.useState(new Set),[y,C]=Z.useState({columnId:null,direction:null}),[E,L]=Z.useState({pageIndex:0,pageSize:u[0]||10}),k=o??N,S=l??y,T=p??E,M=V=>{a?a(V):w(V);},D=V=>{c?c(V):C(V);},P=V=>{f?f(V):L(V);},I=Z.useMemo(()=>{if(!S.columnId||!S.direction)return t;let V=r.find(z=>z.id===S.columnId);return V?[...t].sort((z,K)=>{let Y=V.accessor(z),Q=V.accessor(K);if(Y===Q)return 0;if(Y==null)return 1;if(Q==null)return -1;let J=String(Y).localeCompare(String(Q),void 0,{numeric:true});return S.direction==="asc"?J:-J}):t},[t,S,r]),H=Z.useMemo(()=>{if(!d)return I;let V=T.pageIndex*T.pageSize;return I.slice(V,V+T.pageSize)},[I,d,T]),A=Math.ceil(I.length/T.pageSize),B=V=>{if(V===true){let z=new Set(H.map((K,Y)=>s(K,Y)));M(z);}else M(new Set);},$=(V,z)=>{let K=new Set(k);z?K.add(V):K.delete(V),M(K);},j=H.length>0&&H.every((V,z)=>k.has(s(V,z))),G=H.some((V,z)=>k.has(s(V,z))),U=V=>{if(!r.find(Y=>Y.id===V)?.sortable&&!i)return;let K="asc";S.columnId===V&&(S.direction==="asc"?K="desc":S.direction==="desc"&&(K=null)),D({columnId:K?V:null,direction:K});},W=V=>S.columnId!==V?jsx(ChevronsUpDown,{className:"h-4 w-4 text-muted-foreground/50"}):S.direction==="asc"?jsx(ChevronUp,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"});return jsxs("div",{ref:R,className:m("w-full",e),...x,children:[jsx("div",{className:"relative w-full overflow-auto rounded-md border",children:jsxs("table",{className:"w-full caption-bottom text-sm",children:[jsx("thead",{className:"[&_tr]:border-b bg-muted/50",children:jsxs("tr",{children:[n&&jsx("th",{className:"h-12 w-12 px-4",children:jsx(Ko,{checked:j?true:G?"indeterminate":false,onCheckedChange:B,"aria-label":"Select all"})}),r.map(V=>{let z=V.sortable??i;return jsx("th",{className:m("h-12 px-4 text-left align-middle font-medium text-muted-foreground",z&&"cursor-pointer select-none hover:text-foreground"),style:{width:V.width},onClick:()=>z&&U(V.id),children:jsxs("div",{className:"flex items-center gap-2",children:[V.header,z&&W(V.id)]})},V.id)})]})}),jsx("tbody",{className:"[&_tr:last-child]:border-0",children:v?jsx("tr",{children:jsx("td",{colSpan:r.length+(n?1:0),className:"h-24 text-center text-muted-foreground",children:"Loading..."})}):H.length===0?jsx("tr",{children:jsx("td",{colSpan:r.length+(n?1:0),className:"h-24 text-center text-muted-foreground",children:g})}):H.map((V,z)=>{let K=s(V,z),Y=k.has(K);return jsxs("tr",{className:m("border-b transition-colors",h&&"hover:bg-muted/50",b&&z%2===1&&"bg-muted/30",Y&&"bg-muted"),"data-state":Y?"selected":void 0,children:[n&&jsx("td",{className:"w-12 px-4",children:jsx(Ko,{checked:Y,onCheckedChange:Q=>$(K,!!Q),"aria-label":`Select row ${z+1}`})}),r.map(Q=>jsx("td",{className:"p-4 align-middle",children:Q.cell?Q.cell(V,z):Q.accessor(V)},Q.id))]},K)})})]})}),d&&jsxs("div",{className:"flex items-center justify-between px-2 py-4",children:[jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsx("span",{children:"Rows per page:"}),jsx("select",{value:T.pageSize,onChange:V=>P({pageIndex:0,pageSize:Number(V.target.value)}),className:"h-8 rounded-md border bg-transparent px-2",children:u.map(V=>jsx("option",{value:V,children:V},V))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",T.pageIndex+1," of ",A||1]}),jsxs("div",{className:"flex gap-1",children:[jsx(me,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>P({...T,pageIndex:T.pageIndex-1}),isDisabled:T.pageIndex===0,"aria-label":"Previous page",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(me,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>P({...T,pageIndex:T.pageIndex+1}),isDisabled:T.pageIndex>=A-1,"aria-label":"Next page",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}var K0=Z.forwardRef($0);var ji={sm:{padding:"p-3",weekday:"w-7 text-[10px]",day:"h-7 w-7 text-xs",dayButton:"size-7 text-xs",navButton:"h-5 w-5",navIcon:"h-3 w-3",monthWidth:"w-[75px]",yearWidth:"w-[50px]",pickerText:"text-[10px]",pickerPadding:"px-1 py-0.5",pickerIcon:"h-2.5 w-2.5"},md:{padding:"p-4",weekday:"w-8 text-xs",day:"h-8 w-8 text-sm",dayButton:"size-8 text-sm",navButton:"h-6 w-6",navIcon:"h-3.5 w-3.5",monthWidth:"w-[85px]",yearWidth:"w-[60px]",pickerText:"text-xs",pickerPadding:"px-1.5 py-1",pickerIcon:"h-3 w-3"},lg:{padding:"p-5",weekday:"w-10 text-sm",day:"h-10 w-10 text-base",dayButton:"size-10 text-base",navButton:"h-8 w-8",navIcon:"h-4 w-4",monthWidth:"w-[100px]",yearWidth:"w-[70px]",pickerText:"text-sm",pickerPadding:"px-2 py-1.5",pickerIcon:"h-3.5 w-3.5"}},Ui=["January","February","March","April","May","June","July","August","September","October","November","December"];function q0({currentMonth:e,onMonthChange:t,startYear:r,endYear:n,size:o}){let a=getMonth(e),s=getYear(e),i=ji[o],l=u=>{let p=setMonth(e,u);t(p);},c=u=>{let p=setYear(e,u);t(p);},d=Z.useMemo(()=>{let u=[];for(let p=n;p>=r;p--)u.push(p);return u},[r,n]);return jsxs("div",{className:"flex items-center gap-1",children:[jsxs(Zt,{children:[jsx(Jt,{children:jsxs("div",{className:m("inline-flex items-center justify-between gap-1 rounded-md",i.pickerPadding,i.pickerText,"font-medium",i.monthWidth,"border border-border bg-background","hover:bg-muted transition-colors cursor-pointer"),children:[jsx("span",{className:"truncate",children:Ui[a]}),jsx(ChevronDown,{className:m(i.pickerIcon,"text-muted-foreground shrink-0")})]})}),jsx(Qt,{className:"min-w-[120px] p-0",children:jsx(ze,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:Ui.map((u,p)=>jsx(Et,{onSelect:()=>l(p),className:m(i.pickerText,a===p&&"bg-primary/10 text-primary font-medium"),children:u},u))})})})]}),jsxs(Zt,{children:[jsx(Jt,{children:jsxs("div",{className:m("inline-flex items-center justify-between gap-1 rounded-md",i.pickerPadding,i.pickerText,"font-medium",i.yearWidth,"border border-border bg-background","hover:bg-muted transition-colors cursor-pointer"),children:[jsx("span",{children:s}),jsx(ChevronDown,{className:m(i.pickerIcon,"text-muted-foreground shrink-0")})]})}),jsx(Qt,{className:"min-w-[80px] p-0",children:jsx(ze,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:d.map(u=>jsx(Et,{onSelect:()=>c(u),className:m(i.pickerText,s===u&&"bg-primary/10 text-primary font-medium"),children:u},u))})})})]})]})}function X0(e,t,r,n){let o=ji[n];return function({calendarMonth:s}){let{goToMonth:i,nextMonth:l,previousMonth:c}=useDayPicker();if(e)return jsxs("div",{className:"flex items-center justify-between gap-1 mb-2",children:[jsx(q0,{currentMonth:s.date,onMonthChange:i,startYear:t,endYear:r,size:n}),jsxs("div",{className:"flex items-center",children:[jsx("button",{type:"button",disabled:!c,onClick:()=>c&&i(c),className:m(o.navButton,"inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Previous month",children:jsx(ChevronLeft,{className:o.navIcon})}),jsx("button",{type:"button",disabled:!l,onClick:()=>l&&i(l),className:m(o.navButton,"inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Next month",children:jsx(ChevronRight,{className:o.navIcon})})]})]});let d=Ui[s.date.getMonth()],u=s.date.getFullYear();return jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:m(o.pickerText,"font-medium",o.monthWidth),children:d}),jsx("span",{className:m(o.pickerText,"font-medium",o.yearWidth),children:u})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{type:"button",disabled:!c,onClick:()=>c&&i(c),className:m(o.navButton,"inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Previous month",children:jsx(ChevronLeft,{className:o.navIcon})}),jsx("button",{type:"button",disabled:!l,onClick:()=>l&&i(l),className:m(o.navButton,"inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Next month",children:jsx(ChevronRight,{className:o.navIcon})})]})]})}}function lo({className:e,classNames:t,showOutsideDays:r=true,showMonthAndYearPickers:n=false,startYear:o=1900,endYear:a=new Date().getFullYear()+50,size:s="md",components:i,...l}){let c=ji[s],d=Z.useMemo(()=>X0(n,o,a,s),[n,o,a,s]);return jsx(DayPicker,{showOutsideDays:r,className:m(c.padding,e),classNames:{months:"flex flex-col sm:flex-row gap-4",month:"flex flex-col gap-2",month_caption:"sr-only",nav:"hidden",month_grid:"w-full border-collapse",weekdays:"flex",weekday:m("text-muted-foreground font-normal text-center",c.weekday),week:"flex w-full mt-0.5",day:m("relative p-0 text-center",c.day,"flex items-center justify-center","focus-within:relative focus-within:z-20","[&:has([aria-selected]:not(.outside-day))]:bg-accent","first:[&:has([aria-selected]:not(.outside-day))]:rounded-l-md","last:[&:has([aria-selected]:not(.outside-day))]:rounded-r-md"),day_button:m(c.dayButton,"p-0 font-normal rounded-md","inline-flex items-center justify-center","hover:bg-primary/10","focus:outline-none","transition-colors cursor-pointer"),range_start:"rounded-l-md",range_end:"rounded-r-md",selected:m("bg-primary text-primary-foreground rounded-md","hover:bg-primary/90 hover:!text-primary-foreground","focus:bg-primary focus:text-primary-foreground","[&.outside-day]:!bg-transparent [&.outside-day]:!text-muted-foreground/50"),today:"bg-accent text-accent-foreground rounded-md",outside:"outside-day text-muted-foreground/50 !bg-transparent",disabled:"text-muted-foreground/30 cursor-not-allowed",range_middle:"rounded-none bg-muted text-foreground",hidden:"invisible",...t},modifiersStyles:{range_middle:{backgroundColor:"var(--color-muted)",color:"var(--color-foreground)",borderRadius:0}},components:{...i,MonthCaption:d},...l})}lo.displayName="Calendar";var mp=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:m("mx-auto flex w-full justify-center",e),...t});mp.displayName="Pagination";var pp=Z.forwardRef(({className:e,...t},r)=>jsx("ul",{ref:r,className:m("flex flex-row items-center gap-1",e),...t}));pp.displayName="PaginationContent";var fp=Z.forwardRef(({className:e,...t},r)=>jsx("li",{ref:r,className:m("",e),...t}));fp.displayName="PaginationItem";var eR={sm:"!px-0 !w-9",md:"!px-0 !w-10",lg:"!px-0 !w-11"},ns=({className:e,isActive:t,size:r="md",radius:n="md",isIconOnly:o=true,...a})=>jsx("a",{"aria-current":t?"page":void 0,className:m(no({variant:t?"solid":"light",size:r,radius:n}),o&&eR[r],e),...a});ns.displayName="PaginationLink";var gp=({className:e,...t})=>jsxs(ns,{"aria-label":"Go to previous page",isIconOnly:false,className:m("gap-1 pl-2.5",e),...t,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});gp.displayName="PaginationPrevious";var bp=({className:e,...t})=>jsxs(ns,{"aria-label":"Go to next page",isIconOnly:false,className:m("gap-1 pr-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});bp.displayName="PaginationNext";var tR={sm:"h-9 w-9",md:"h-10 w-10",lg:"h-11 w-11"},vp=({className:e,size:t="md",...r})=>jsxs("span",{"aria-hidden":true,className:m("flex items-center justify-center",tR[t],e),...r,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});vp.displayName="PaginationEllipsis";var xp=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"].join(",");function rR(e={}){let{enabled:t=true,initialFocus:r,returnFocus:n=true,autoFocus:o=true}=e,a=useRef(null),s=useRef(null),i=useCallback(()=>{let c=a.current;return c?Array.from(c.querySelectorAll(xp)).filter(d=>d.offsetParent!==null&&getComputedStyle(d).visibility!=="hidden"):[]},[]),l=useCallback(c=>{if(c.key!=="Tab")return;let d=i();if(d.length===0)return;let u=d[0],p=d[d.length-1];c.shiftKey?document.activeElement===u&&(c.preventDefault(),p.focus()):document.activeElement===p&&(c.preventDefault(),u.focus());},[i]);return useEffect(()=>{if(!t)return;let c=a.current;if(c){if(s.current=document.activeElement,o)if(r?.current)r.current.focus();else {let d=i();d.length>0&&d[0].focus();}return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l),n&&s.current&&s.current.focus();}}},[t,r,n,o,l,i]),a}function as(e,t={}){let{enabled:r=true,initialFocus:n,returnFocus:o=true,autoFocus:a=true}=t,s=useRef(null),i=useCallback(()=>{let c=e.current;return c?Array.from(c.querySelectorAll(xp)).filter(d=>d.offsetParent!==null&&getComputedStyle(d).visibility!=="hidden"):[]},[e]),l=useCallback(c=>{if(c.key!=="Tab")return;let d=i();if(d.length===0)return;let u=d[0],p=d[d.length-1];c.shiftKey?document.activeElement===u&&(c.preventDefault(),p.focus()):document.activeElement===p&&(c.preventDefault(),u.focus());},[i]);useEffect(()=>{if(!r)return;let c=e.current;if(c){if(s.current=document.activeElement,a)if(n?.current)n.current.focus();else {let d=i();d.length>0&&d[0].focus();}return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l),o&&s.current&&s.current.focus();}}},[e,r,n,o,a,l,i]);}var Xo=Z.forwardRef(({className:e,...t},r)=>jsx("span",{ref:r,className:m("absolute h-px w-px p-0 -m-px overflow-hidden whitespace-nowrap border-0","[clip:rect(0,0,0,0)]",e),...t}));Xo.displayName="VisuallyHidden";var Rp={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},oR={auto:"top-[50%] translate-y-[-50%]",center:"top-[50%] translate-y-[-50%]",top:"top-4 translate-y-0",bottom:"top-auto bottom-4 translate-y-0","top-center":"top-[20%] translate-y-0","bottom-center":"top-auto bottom-[20%] translate-y-0"},wp=cva("fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),Xi=cva("fixed left-[50%] z-50 grid translate-x-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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 sm:rounded-lg",{variants:{size:{xs:"w-full max-w-xs",sm:"w-full max-w-sm",md:"w-full max-w-md",lg:"w-full max-w-lg",xl:"w-full max-w-xl","2xl":"w-full max-w-2xl","3xl":"w-full max-w-3xl","4xl":"w-full max-w-4xl","5xl":"w-full max-w-5xl",full:"w-[calc(100vw-2rem)] h-[calc(100vh-2rem)] max-w-none"}},defaultVariants:{size:"md"}}),is=Z.createContext(null),On=()=>{let e=Z.useContext(is);if(!e)throw new Error("Modal components must be used within a Modal");return e},Mp=Z.forwardRef(({open:e,onOpenChange:t,trigger:r,title:n="Modal",children:o,hideCloseButton:a=false,isDismissable:s=true,isKeyboardDismissDisabled:i=false,backdrop:l="opaque",placement:c="center",scrollBehavior:d="inside",size:u,className:p},f)=>{let[g,v]=Z.useState(false),b=e!==void 0,h=b?e:g,[x,R]=Z.useState(false),N=Z.useRef(null),w=Z.useId(),y=Z.useId();Z.useEffect(()=>{R(true);},[]);let C=Z.useCallback(S=>{b||v(S),t?.(S);},[b,t]);Z.useEffect(()=>{if(h)return lr(),()=>cr()},[h]),Z.useEffect(()=>{if(!h||i)return;let S=T=>{T.key==="Escape"&&C(false);};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[h,i,C]),as(N,{enabled:h,returnFocus:true,autoFocus:true});let E=S=>{s&&S.target===S.currentTarget&&C(false);},L=r?Z.isValidElement(r)?Z.cloneElement(r,{onClick:S=>{r.props.onClick?.(S),C(true);}}):jsx("button",{type:"button",onClick:()=>C(true),children:r}):null,k=()=>!x||!h?null:d==="outside"?Ua.createPortal(jsx("div",{"data-state":h?"open":"closed",className:m(wp(),Rp[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:E,children:jsxs("div",{ref:S=>{N.current=S,typeof f=="function"?f(S):f&&(f.current=S);},role:"dialog","aria-modal":"true","aria-labelledby":w,"aria-describedby":y,"data-state":h?"open":"closed",className:m("relative z-50 grid gap-4 border bg-background p-6 shadow-lg sm:rounded-lg dark:border-0",u==="xs"&&"w-full max-w-xs",u==="sm"&&"w-full max-w-sm",u==="md"&&"w-full max-w-md",u==="lg"&&"w-full max-w-lg",u==="xl"&&"w-full max-w-xl",u==="2xl"&&"w-full max-w-2xl",u==="3xl"&&"w-full max-w-3xl",u==="4xl"&&"w-full max-w-4xl",u==="5xl"&&"w-full max-w-5xl",u==="full"&&"w-[calc(100vw-2rem)] min-h-[calc(100vh-2rem)]",!u&&"w-full max-w-md",p),children:[jsx(Xo,{children:jsx("h2",{id:w,children:n})}),o,!a&&jsx(Ct,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>C(false)})]})}),document.body):Ua.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":h?"open":"closed",className:m(wp(),Rp[l]),onClick:E,"aria-hidden":"true"}),jsxs("div",{ref:S=>{N.current=S,typeof f=="function"?f(S):f&&(f.current=S);},role:"dialog","aria-modal":"true","aria-labelledby":w,"aria-describedby":y,"data-state":h?"open":"closed",className:m(Xi({size:u}),oR[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",p),children:[jsx(Xo,{children:jsx("h2",{id:w,children:n})}),o,!a&&jsx(Ct,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>C(false)})]})]}),document.body);return jsxs(is.Provider,{value:{open:h,onOpenChange:C,scrollBehavior:d,titleId:w,descriptionId:y},children:[L,k()]})});Mp.displayName="Modal";var ls=({children:e,open:t,defaultOpen:r=false,onOpenChange:n,scrollBehavior:o="inside"})=>{let[a,s]=Z.useState(r),i=t!==void 0,l=i?t:a,c=Z.useId(),d=Z.useId(),u=Z.useCallback(p=>{i||s(p),n?.(p);},[i,n]);return jsx(is.Provider,{value:{open:l,onOpenChange:u,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};ls.displayName="ModalRoot";var Tp=Z.forwardRef(({children:e,onClick:t,...r},n)=>{let{onOpenChange:o}=On();return jsx("button",{ref:n,type:"button",onClick:s=>{t?.(s),o(true);},...r,children:e})});Tp.displayName="ModalTrigger";var Zi=({children:e,container:t})=>{let[r,n]=Z.useState(false);return Z.useEffect(()=>{n(true);},[]),r?Ua.createPortal(e,t||document.body):null};Zi.displayName="ModalPortal";var Ji=Z.forwardRef(({className:e,...t},r)=>{let{open:n,onOpenChange:o}=On();return n?jsx("div",{ref:r,"data-state":n?"open":"closed",className:m("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});Ji.displayName="ModalOverlay";var Np=Z.forwardRef(({children:e,onClick:t,...r},n)=>{let{onOpenChange:o}=On();return jsx("button",{ref:n,type:"button",onClick:s=>{t?.(s),o(false);},...r,children:e})});Np.displayName="ModalClose";var cs=Z.forwardRef(({className:e,children:t,size:r,showCloseButton:n=true,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c,titleId:d,descriptionId:u}=On(),[p,f]=Z.useState(false),g=Z.useRef(null);return Z.useEffect(()=>{f(true);},[]),Z.useEffect(()=>{if(l)return lr(),()=>cr()},[l]),Z.useEffect(()=>{if(!l)return;let v=b=>{b.key==="Escape"&&(o?.(),c(false));};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[l,c,o]),as(g,{enabled:l,returnFocus:true,autoFocus:true}),!p||!l?null:jsxs(Zi,{children:[jsx(Ji,{}),jsxs("div",{ref:v=>{g.current=v,typeof i=="function"?i(v):i&&(i.current=v);},role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":u,"data-state":l?"open":"closed",className:m(Xi({size:r}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,n&&jsx(Ct,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>c(false)})]})]})});cs.displayName="ModalContent";var kp=({className:e,...t})=>jsx("div",{className:m("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});kp.displayName="ModalHeader";var Sp=({className:e,children:t})=>(Z.useContext(is)?.scrollBehavior??"inside")==="inside"?jsx(ze,{className:m("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:m(e),children:t});Sp.displayName="ModalBody";var Ep=({className:e,children:t,...r})=>{let{onOpenChange:n}=On();return jsx("div",{className:m("flex-shrink-0 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r,children:Z.Children.map(t,o=>Z.isValidElement(o)?Z.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),n(false);}}):o)})};Ep.displayName="ModalFooter";var Pp=Z.forwardRef(({className:e,...t},r)=>{let{titleId:n}=On();return jsx("h2",{ref:r,id:n,className:m("text-lg font-semibold leading-none tracking-tight",e),...t})});Pp.displayName="ModalTitle";var Lp=Z.forwardRef(({className:e,...t},r)=>{let{descriptionId:n}=On();return jsx("p",{ref:r,id:n,className:m("text-sm text-muted-foreground",e),...t})});Lp.displayName="ModalDescription";var Qi=Z.forwardRef(({className:e,...t},r)=>jsx(Command,{ref:r,className:m("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Qi.displayName=Command.displayName;var iR=({children:e,...t})=>jsx(ls,{...t,children:jsx(cs,{className:"overflow-hidden p-0 shadow-lg",showCloseButton:false,children:jsx(Qi,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Dp=Z.forwardRef(({className:e,...t},r)=>jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[jsx(Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),jsx(Command.Input,{ref:r,className:m("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Dp.displayName=Command.Input.displayName;var Hp=Z.forwardRef(({className:e,children:t,...r},n)=>jsx(ze,{className:"max-h-[300px]",children:jsx(Command.List,{ref:n,className:m("overflow-hidden",e),...r,children:t})}));Hp.displayName=Command.List.displayName;var Ip=Z.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ip.displayName=Command.Empty.displayName;var Vp=Z.forwardRef(({className:e,...t},r)=>jsx(Command.Group,{ref:r,className:m("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Vp.displayName=Command.Group.displayName;var Ap=Z.forwardRef(({className:e,...t},r)=>jsx(Command.Separator,{ref:r,className:m("-mx-1 h-px bg-border",e),...t}));Ap.displayName=Command.Separator.displayName;var zp=Z.forwardRef(({className:e,children:t,startContent:r,endContent:n,...o},a)=>jsxs(Command.Item,{ref:a,className:m("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...o,children:[r,t&&jsx("span",{className:"flex-1",children:t}),n]}));zp.displayName=Command.Item.displayName;var Op=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Op.displayName="CommandShortcut";var dR={sm:{input:"h-9 px-2 text-xs",button:"h-9 w-9",icon:"h-3.5 w-3.5",label:"text-xs",error:"text-xs"},md:{input:"h-10 px-3 text-sm",button:"h-10 w-10",icon:"h-4 w-4",label:"text-sm",error:"text-xs"},lg:{input:"h-11 px-4 text-base",button:"h-11 w-11",icon:"h-5 w-5",label:"text-base",error:"text-sm"}},uR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Bp=Z.forwardRef(({className:e,showToggle:t=true,isDisabled:r,onFocus:n,onBlur:o,style:a,size:s="md",radius:i="md",label:l,isInvalid:c,errorMessage:d,isRequired:u,id:p,...f},g)=>{let[v,b]=Z.useState(false),[h,x]=Z.useState(false),R=dR[s],N=uR[i],w=p||Z.useId();return jsxs("div",{className:"flex flex-col gap-1.5",children:[l&&jsxs("label",{htmlFor:w,className:m("font-medium text-foreground",R.label),children:[l,u&&jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),jsxs("div",{className:"relative",children:[jsx("input",{id:w,type:v?"text":"password",className:m("flex w-full border bg-background py-2 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",c?"border-danger":"border-input",R.input,N,t&&"pr-10",e),ref:g,disabled:r,"aria-invalid":c,"aria-describedby":c&&d?`${w}-error`:void 0,style:{...a,borderColor:c?void 0:h?"var(--color-foreground)":void 0},onFocus:y=>{x(true),n?.(y);},onBlur:y=>{x(false),o?.(y);},...f}),t&&jsx("button",{type:"button",className:m("absolute right-0 top-0 px-3 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",R.button),onClick:()=>b(!v),disabled:r,tabIndex:-1,"aria-label":v?"Hide password":"Show password",children:v?jsx(EyeOff,{className:R.icon}):jsx(Eye,{className:R.icon})})]}),c&&d&&jsx("p",{id:`${w}-error`,className:m("text-danger",R.error),children:d})]})});Bp.displayName="PasswordInput";var fR={sm:{wrapper:"h-9",input:"h-9 text-xs",button:"h-6 w-6",icon:"h-3 w-3"},md:{wrapper:"h-10",input:"h-10 text-sm",button:"h-7 w-7",icon:"h-3.5 w-3.5"},lg:{wrapper:"h-11",input:"h-11 text-base",button:"h-8 w-8",icon:"h-4 w-4"}},gR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Jo=Z.forwardRef(({className:e,showButtons:t=true,step:r=1,min:n,max:o,value:a,defaultValue:s,onChange:i,isDisabled:l,size:c="md",radius:d="md",...u},p)=>{let[f,g]=Z.useState(s),[v,b]=Z.useState(false),h=a!==void 0,x=h?a:f,R=fR[c],N=gR[d],w=T=>{T!==void 0&&(n!==void 0&&T<n&&(T=n),o!==void 0&&T>o&&(T=o)),h||g(T),i?.(T);},y=()=>{w((x??0)+r);},C=()=>{w((x??0)-r);},E=T=>{let M=T.target.value;if(M==="")w(void 0);else {let D=parseFloat(M);isNaN(D)||w(D);}},L=T=>{T.key==="ArrowUp"?(T.preventDefault(),y()):T.key==="ArrowDown"&&(T.preventDefault(),C());},k=n===void 0||(x??0)>n,S=o===void 0||(x??0)<o;return t?jsxs("div",{className:m("relative flex items-center border border-input transition-colors",R.wrapper,N,l&&"opacity-50",e),style:{borderColor:v?"var(--color-foreground)":void 0},children:[jsx("button",{type:"button",className:m("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ml-1.5",R.button),onClick:C,disabled:l||!k,tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:R.icon})}),jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:m("min-w-0 flex-1 bg-transparent text-center focus:outline-none disabled:cursor-not-allowed [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",R.input),ref:p,value:x??"",onChange:E,onKeyDown:L,disabled:l,onFocus:()=>b(true),onBlur:()=>b(false),...u}),jsx("button",{type:"button",className:m("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed mr-1.5",R.button),onClick:y,disabled:l||!S,tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:R.icon})})]}):jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:m("flex w-full bg-background px-3 py-2 text-center border border-input placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",R.input,N,e),style:{borderColor:v?"var(--color-foreground)":void 0},ref:p,value:x??"",onChange:E,onKeyDown:L,disabled:l,onFocus:()=>b(true),onBlur:()=>b(false),...u})});Jo.displayName="NumberInput";var Gp=cva("flex -space-x-2",{variants:{size:{sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3"}},defaultVariants:{size:"md"}}),$p=cva("border-2 border-background ring-0 cursor-pointer transition-transform duration-200 hover:-translate-y-1",{variants:{size:{sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base"}},defaultVariants:{size:"md"}}),Up=Z.forwardRef(({className:e,items:t,max:r=5,size:n,showTooltips:o=false,...a},s)=>{let i=t.slice(0,r),l=t.length-r,c=(u,p)=>{let f=jsxs(Dn,{className:m($p({size:n})),children:[u.src&&jsx(so,{src:u.src,alt:u.alt||""}),jsx(Hn,{className:"text-xs",children:u.fallback||u.alt?.charAt(0)?.toUpperCase()||"?"})]});return o&&u.alt?jsx(yr,{content:u.alt,delayDuration:300,children:f},p):jsx(Z.Fragment,{children:f},p)};return jsxs("div",{ref:s,className:m(Gp({size:n,className:e})),...a,children:[i.map((u,p)=>c(u,p)),l>0&&jsx(Dn,{className:m($p({size:n})),children:jsxs(Hn,{className:"bg-muted text-muted-foreground",children:["+",l]})})]})});Up.displayName="AvatarGroup";var _p=cva("flex gap-0.5",{variants:{size:{sm:"[&_svg]:h-4 [&_svg]:w-4",md:"[&_svg]:h-5 [&_svg]:w-5",lg:"[&_svg]:h-6 [&_svg]:w-6"}},defaultVariants:{size:"md"}}),jp=Z.forwardRef(({className:e,value:t,defaultValue:r=0,onValueChange:n,max:o=5,size:a,icon:s="star",allowHalf:i=false,isReadOnly:l=false,isDisabled:c=false,filledColor:d,emptyColor:u,...p},f)=>{let[g,v]=Z.useState(r),[b,h]=Z.useState(null),x=t!==void 0,R=x?t:g,N=b!==null?b:R,w=M=>{l||c||(x||v(M),n?.(M));},y=(M,D=false)=>{let P=i&&D?M+.5:M+1;w(P);},C=(M,D)=>{if(l||c)return;let P=M.currentTarget.getBoundingClientRect(),I=i&&M.clientX<P.left+P.width/2;h(I?D+.5:D+1);},E=()=>{h(null);},L=s==="heart"?Heart:Star,k=M=>N>=M+1?"full":N>=M+.5?"half":"empty",S=d?{color:d,fill:d}:{},T=u?{color:u}:{};return jsx("div",{ref:f,className:m(_p({size:a,className:e}),c&&"opacity-50 cursor-not-allowed"),onMouseLeave:E,role:"radiogroup","aria-label":"Rating",...p,children:Array.from({length:o},(M,D)=>{let P=k(D);return jsxs("button",{type:"button",className:m("relative focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm",!l&&!c&&"cursor-pointer hover:scale-110 transition-transform"),onClick:I=>{let H=I.currentTarget.getBoundingClientRect(),A=i&&I.clientX<H.left+H.width/2;y(D,A);},onMouseMove:I=>C(I,D),disabled:c||l,"aria-label":`Rate ${D+1} out of ${o}`,role:"radio","aria-checked":R===D+1,children:[jsx(L,{className:m("text-muted-foreground/30",P!=="empty"&&"absolute inset-0"),style:P==="empty"?T:void 0}),P!=="empty"&&jsx(L,{className:m("text-yellow-500 fill-yellow-500",s==="heart"&&"text-red-500 fill-red-500",P==="half"&&"clip-path-half"),style:{...S,clipPath:P==="half"?"inset(0 50% 0 0)":void 0}})]},D)})})});jp.displayName="Rating";var Yp=cva("inline-flex items-center justify-center gap-1.5 text-sm font-medium 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-default",{variants:{variant:{solid:"border-transparent text-primary-foreground",bordered:"border bg-transparent",light:"border-transparent",flat:"border-transparent bg-transparent"},color:{primary:"",success:"",warning:"",danger:""},size:{sm:"h-6 px-2 text-xs",md:"h-7 px-2.5 text-sm",lg:"h-8 px-3 text-sm"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},clickable:{true:"cursor-pointer",false:""}},compoundVariants:[{variant:"solid",color:"primary",className:"bg-primary hover:bg-primary/90"},{variant:"solid",color:"success",className:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-700 dark:hover:bg-green-600"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white hover:bg-amber-700 dark:bg-amber-700 dark:hover:bg-amber-600"},{variant:"solid",color:"danger",className:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:hover:bg-red-600"},{variant:"bordered",color:"primary",className:"text-primary !border-primary hover:bg-primary/10"},{variant:"bordered",color:"success",className:"text-green-600 !border-green-600 hover:bg-green-600/10 dark:text-green-500 dark:!border-green-500"},{variant:"bordered",color:"warning",className:"text-amber-600 !border-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:!border-amber-500"},{variant:"bordered",color:"danger",className:"text-red-600 !border-red-600 hover:bg-red-600/10 dark:text-red-500 dark:!border-red-500"},{variant:"light",color:"primary",className:"bg-primary/15 text-primary hover:bg-primary/20"},{variant:"light",color:"success",className:"bg-green-600/15 text-green-600 hover:bg-green-600/20 dark:bg-green-500/15 dark:text-green-500 dark:hover:bg-green-500/20"},{variant:"light",color:"warning",className:"bg-amber-600/15 text-amber-600 hover:bg-amber-600/20 dark:bg-amber-500/15 dark:text-amber-500 dark:hover:bg-amber-500/20"},{variant:"light",color:"danger",className:"bg-red-600/15 text-red-600 hover:bg-red-600/20 dark:bg-red-500/15 dark:text-red-500 dark:hover:bg-red-500/20"},{variant:"flat",color:"primary",className:"text-primary hover:bg-primary/10"},{variant:"flat",color:"success",className:"text-green-600 hover:bg-green-600/10 dark:text-green-500 dark:hover:bg-green-500/10"},{variant:"flat",color:"warning",className:"text-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:hover:bg-amber-500/10"},{variant:"flat",color:"danger",className:"text-red-600 hover:bg-red-600/10 dark:text-red-500 dark:hover:bg-red-500/10"}],defaultVariants:{variant:"solid",color:"primary",size:"md",radius:"full",clickable:false}}),wR={sm:"sm",md:"sm",lg:"sm"},qp=Z.forwardRef(({className:e,variant:t,color:r,size:n,radius:o,clickable:a,startContent:s,endContent:i,closable:l,onClose:c,isDisabled:d,children:u,onClick:p,...f},g)=>{let v=a||!!p,b=h=>{h.stopPropagation(),c?.();};return jsxs("div",{ref:g,role:v?"button":void 0,tabIndex:v&&!d?0:void 0,"aria-disabled":d,onClick:d?void 0:p,onKeyDown:v&&!d?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),p?.(h));}:void 0,className:m(Yp({variant:t,color:r,size:n,radius:o,clickable:v}),d&&"opacity-50 cursor-not-allowed",e),...f,children:[s&&jsx("span",{className:"shrink-0",children:s}),jsx("span",{className:"truncate",children:u}),i&&jsx("span",{className:"shrink-0",children:i}),l&&jsx(Ct,{size:wR[n??"md"],onClick:b,disabled:d,className:"ml-0.5 h-4 w-4"})]})});qp.displayName="Chip";var Xp=createContext({direction:"horizontal"}),PR=({className:e,direction:t="horizontal",children:r,...n})=>jsx(Xp.Provider,{value:{direction:t},children:jsx(Group,{orientation:t,className:m("flex h-full w-full data-[orientation=vertical]:flex-col",e),...n,children:r})}),LR=Panel,DR=({withHandle:e,className:t,...r})=>{let{direction:n}=useContext(Xp),o=n==="vertical";return jsx(Separator,{className:m("relative flex shrink-0 items-center justify-center bg-border outline-none",o?"h-px w-full after:absolute after:inset-x-0 after:top-1/2 after:h-1 after:-translate-y-1/2":"w-px after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2",t),...r,children:e&&jsx("div",{className:m("z-10 flex items-center justify-center rounded-sm border bg-border",o?"h-3 w-4 rotate-90":"h-4 w-3"),children:jsx(GripVertical,{className:"h-2.5 w-2.5"})})})};var ef=cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-24 w-24"},color:{default:"",primary:"",success:"",warning:"",danger:""}},defaultVariants:{size:"md",color:"default"}}),IR={sm:{size:32,strokeWidth:3,fontSize:"text-[10px]"},md:{size:48,strokeWidth:4,fontSize:"text-xs"},lg:{size:64,strokeWidth:5,fontSize:"text-sm"},xl:{size:96,strokeWidth:6,fontSize:"text-base"}},Zp={default:"var(--color-foreground, #18181b)",primary:"var(--color-primary, #18181b)",success:"var(--color-success, #16a34a)",warning:"var(--color-warning, #d97706)",danger:"var(--color-danger, #dc2626)"},tf=Z.forwardRef(({className:e,size:t="md",color:r="default",value:n=0,max:o=100,showValue:a=false,formatValue:s=u=>`${Math.round(u)}%`,trackClassName:i,isIndeterminate:l=false,...c},d)=>{let u=Math.min(100,Math.max(0,n/o*100)),p=IR[t],f=(p.size-p.strokeWidth)/2,g=2*Math.PI*f,v=l?g*.75:g-u/100*g;return jsxs("div",{ref:d,className:m(ef({size:t,color:r}),e),role:"progressbar","aria-valuenow":l?void 0:n,"aria-valuemin":0,"aria-valuemax":o,...c,children:[jsxs("svg",{width:p.size,height:p.size,viewBox:`0 0 ${p.size} ${p.size}`,fill:"none",className:m(l&&"animate-spin"),children:[jsx("circle",{className:m("stroke-muted",i),cx:p.size/2,cy:p.size/2,r:f,strokeWidth:p.strokeWidth,fill:"none"}),jsx("circle",{cx:p.size/2,cy:p.size/2,r:f,strokeWidth:p.strokeWidth,fill:"none",strokeLinecap:"round",stroke:Zp[r]||Zp.default,strokeDasharray:`${g} ${g}`,strokeDashoffset:v,style:{transformOrigin:"center",transform:"rotate(-90deg)",transition:l?void 0:"stroke-dashoffset 0.3s ease-in-out"}})]}),a&&!l&&jsx("span",{className:m("absolute font-medium text-foreground",p.fontSize),children:s(u)})]})});tf.displayName="CircularProgress";var rf=Z.createContext(null),zR=()=>{let e=Z.useContext(rf);if(!e)throw new Error("OTP components must be used within InputOTP");return e},nf=cva("flex items-center gap-2 has-[:disabled]:opacity-50",{variants:{size:{sm:"[&_[data-otp-slot]]:h-8 [&_[data-otp-slot]]:w-8 [&_[data-otp-slot]]:text-xs",md:"[&_[data-otp-slot]]:h-10 [&_[data-otp-slot]]:w-10 [&_[data-otp-slot]]:text-sm",lg:"[&_[data-otp-slot]]:h-12 [&_[data-otp-slot]]:w-12 [&_[data-otp-slot]]:text-base"}},defaultVariants:{size:"md"}}),of=Z.forwardRef(({className:e,containerClassName:t,maxLength:r,value:n,defaultValue:o="",onChange:a,onComplete:s,pattern:i,isDisabled:l=false,size:c,radius:d="md",children:u,...p},f)=>{let[g,v]=Z.useState(o),[b,h]=Z.useState(0),[x,R]=Z.useState(false),N=Z.useRef(null),w=n!==void 0?n:g;Z.useImperativeHandle(f,()=>N.current),Z.useEffect(()=>{h(Math.min(w.length,r-1));},[w,r]),Z.useEffect(()=>{w.length===r&&s&&s(w);},[w,r,s]);let y=T=>{let M=T.target.value;if(i&&M){let D=new RegExp(i.replace("^","").replace("$","").replace("+",""));M=M.split("").filter(P=>D.test(P)).join("");}M=M.slice(0,r),n===void 0&&v(M),a?.(M);},C=T=>{T.key==="ArrowLeft"?h(M=>Math.max(0,M-1)):T.key==="ArrowRight"&&h(M=>Math.min(w.length,r-1,M+1));},E=()=>{N.current?.focus();},L=()=>{R(true),h(Math.min(w.length,r-1));},k=()=>{R(false);},S={value:w,activeIndex:x?b:-1,maxLength:r,isDisabled:l,radius:d};return jsx(rf.Provider,{value:S,children:jsxs("div",{className:m(nf({size:c}),t),onClick:E,"data-otp-container":true,children:[jsx("input",{ref:N,type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:w,onChange:y,onKeyDown:C,onFocus:L,onBlur:k,disabled:l,maxLength:r,className:m("absolute opacity-0 pointer-events-none w-0 h-0",e),...p}),u]})})});of.displayName="InputOTP";var af=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:m("flex items-center",e),...t}));af.displayName="InputOTPGroup";var OR={none:"first:rounded-l-none",sm:"first:rounded-l-md",md:"first:rounded-l-lg",lg:"first:rounded-l-xl",full:"first:rounded-l-full"},FR={none:"last:rounded-r-none",sm:"last:rounded-r-md",md:"last:rounded-r-lg",lg:"last:rounded-r-xl",full:"last:rounded-r-full"},sf=Z.forwardRef(({index:e,className:t,...r},n)=>{let{value:o,activeIndex:a,isDisabled:s,radius:i}=zR(),l=o[e]||"",c=a===e,d=c&&o.length===e;return jsxs("div",{ref:n,"data-otp-slot":true,"data-active":c,"data-filled":!!l,className:m("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm font-medium transition-all first:border-l",OR[i],FR[i],c&&"z-10 ring-1 ring-foreground",s&&"cursor-not-allowed opacity-50",t),...r,children:[l,d&&jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});sf.displayName="InputOTPSlot";var lf=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,role:"separator",className:m("text-muted-foreground",e),...t,children:jsx(Minus,{className:"h-4 w-4"})}));lf.displayName="InputOTPSeparator";var uf=cva("inline-flex items-center gap-1 rounded-full text-xs font-medium transition-colors",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-border bg-transparent text-foreground",flat:"bg-secondary text-secondary-foreground"},size:{sm:"h-5 px-2 text-xs",md:"h-6 px-2.5 text-xs",lg:"h-7 px-3 text-sm"}},defaultVariants:{variant:"flat",size:"md"}}),mf=Z.forwardRef(({className:e,variant:t,size:r,value:n=[],onChange:o,placeholder:a="Add tag...",maxTags:s,minTagLength:i=1,maxTagLength:l=50,triggerKeys:c=["Enter",",","Tab"],allowDuplicates:d=false,isDisabled:u,readOnly:p,renderTag:f,...g},v)=>{let[b,h]=Z.useState(""),[x,R]=Z.useState(false),N=Z.useRef(null);Z.useImperativeHandle(v,()=>N.current);let w=T=>{let M=T.trim();if(M.length<i||M.length>l||s&&n.length>=s||!d&&n.some(P=>P.text.toLowerCase()===M.toLowerCase()))return;let D={id:crypto.randomUUID(),text:M};o?.([...n,D]),h("");},y=T=>{u||p||o?.(n.filter(M=>M.id!==T));},C=T=>{if(c.includes(T.key)){if(T.key==="Tab"&&!b)return;T.preventDefault(),w(b);}T.key==="Backspace"&&!b&&n.length>0&&y(n[n.length-1].id);},E=T=>{let M=T.target.value;if(M.includes(",")){M.split(",").forEach(P=>{P.trim()&&w(P);});return}h(M);},L=T=>{T.preventDefault(),T.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(P=>{w(P);});},k=()=>{N.current?.focus();},S=s?n.length>=s:false;return jsxs("div",{className:m("flex min-h-10 w-full flex-wrap gap-1.5 rounded-md border border-input bg-background px-3 py-2 text-sm transition-colors",u&&"cursor-not-allowed opacity-50",e),style:{borderColor:x?"var(--color-foreground)":void 0},onClick:k,children:[n.map(T=>f?f(T,()=>y(T.id)):jsxs("span",{className:m(uf({variant:t,size:r})),children:[T.text,!u&&!p&&jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),y(T.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${T.text}`,children:jsx(X,{className:"h-3 w-3"})})]},T.id)),!S&&!p&&jsx("input",{ref:N,type:"text",value:b,onChange:E,onKeyDown:C,onPaste:L,onFocus:()=>R(true),onBlur:()=>R(false),placeholder:n.length===0?a:"",disabled:u,className:m("flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed","min-w-[80px]"),...g})]})});mf.displayName="TagInput";var KR={sm:{container:"gap-2 py-6",icon:"[&>svg]:h-8 [&>svg]:w-8",title:"text-base",description:"text-xs max-w-xs"},md:{container:"gap-3 py-10",icon:"[&>svg]:h-10 [&>svg]:w-10",title:"text-lg",description:"text-sm max-w-sm"},lg:{container:"gap-4 py-14",icon:"[&>svg]:h-12 [&>svg]:w-12",title:"text-xl",description:"text-base max-w-md"}},ff=Z.forwardRef(({className:e,icon:t,title:r,description:n,action:o,size:a="md",children:s,...i},l)=>{let c=KR[a];return jsxs("div",{ref:l,className:m("flex flex-col items-center justify-center text-center",c.container,e),...i,children:[t&&jsx("div",{className:m("text-muted-foreground",c.icon),children:t}),r&&jsx("h3",{className:m("font-semibold text-foreground",c.title),children:r}),n&&jsx("p",{className:m("text-muted-foreground",c.description),children:n}),o&&jsx("div",{className:"mt-2",children:o}),s]})});ff.displayName="EmptyState";var bf=cva("border p-6 text-card-foreground shadow-sm",{variants:{variant:{solid:"bg-zinc-800 text-white border-zinc-800 dark:bg-zinc-200 dark:text-zinc-900 dark:border-zinc-200",bordered:"border border-zinc-300 bg-transparent dark:border-zinc-700",light:"bg-transparent border-transparent shadow-none",flat:"bg-zinc-100 border-transparent dark:bg-zinc-800",ghost:"border border-zinc-300 dark:border-zinc-700 bg-transparent hover:bg-zinc-900 hover:text-white hover:border-zinc-900 dark:hover:bg-white dark:hover:text-zinc-900 dark:hover:border-white"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"bordered",radius:"md"}}),vf=Z.forwardRef(({className:e,variant:t,radius:r,label:n,value:o,icon:a,trend:s,trendValue:i,description:l,...c},d)=>{let u=s==="up"?TrendingUp:s==="down"?TrendingDown:Minus,p=s==="up"?"text-green-500":s==="down"?"text-red-500":"text-muted-foreground";return jsxs("div",{ref:d,className:m(bf({variant:t,radius:r,className:e})),...c,children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("p",{className:m("text-sm font-medium",t==="solid"?"opacity-80":"text-muted-foreground"),children:n}),a&&jsx("div",{className:m("[&>svg]:h-4 [&>svg]:w-4",t==="solid"?"opacity-80":"text-muted-foreground"),children:a})]}),jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[jsx("p",{className:"text-2xl font-bold",children:o}),s&&i&&jsxs("span",{className:m("flex items-center gap-0.5 text-sm",p),children:[jsx(u,{className:"h-3 w-3"}),i]})]}),l&&jsx("p",{className:m("mt-1 text-xs",t==="solid"?"opacity-70":"text-muted-foreground"),children:l})]})});vf.displayName="StatCard";var na=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",striped:"gap-2 [&>*:nth-child(odd)]:bg-muted/50",filled:"gap-2 bg-muted/30 rounded-lg p-2",cards:"gap-2"},size:{sm:"[&>*]:py-2 [&>*]:px-3",md:"[&>*]:py-3 [&>*]:px-4",lg:"[&>*]:py-4 [&>*]:px-5"}},defaultVariants:{variant:"default",size:"md"}}),fs=({checked:e,isDisabled:t,onClick:r})=>jsx("button",{type:"button",role:"checkbox","aria-checked":e,disabled:t,onClick:n=>{n.stopPropagation(),t||r(n);},className:m("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",e&&"bg-primary text-primary-foreground",t&&"cursor-not-allowed opacity-50"),children:e&&jsx("span",{className:"flex items-center justify-center text-current",children:jsx(Check,{className:"h-3 w-3"})})});function sw({item:e,index:t,renderItem:r,showHandle:n,dragIcon:o,selectable:a,checkable:s,isSelected:i,isChecked:l,isCards:c,onSelect:d,onCheck:u}){let{attributes:p,listeners:f,setNodeRef:g,transform:v,transition:b,isDragging:h}=useSortable({id:e.id}),x={transform:CSS.Transform.toString(v),transition:b};return jsxs("div",{ref:g,...p,style:x,role:"listitem","aria-selected":a?i:void 0,onClick:a&&!s?R=>d?.(e,R):void 0,className:m("flex items-center gap-3 transition-all",c&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",c&&i&&"border-primary bg-accent",!c&&a&&!s&&"cursor-pointer hover:bg-muted/50",!c&&s&&"cursor-pointer hover:bg-muted/50",!c&&i&&a&&!s&&"bg-primary/10",h&&"opacity-50 z-10",(a||s)&&"cursor-pointer"),children:[n&&o!==false&&jsx("div",{className:"shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",...f,children:o??jsx(GripVertical,{className:"h-5 w-5"})}),s&&jsx(fs,{checked:l,onClick:R=>u?.(e,R)}),jsx("div",{className:"flex-1 min-w-0",children:r(e,t)})]})}function iw({className:e,variant:t,size:r,items:n,renderItem:o,draggable:a=false,onReorder:s,showHandle:i=true,dragIcon:l,selectable:c=false,multiple:d=false,selectedKeys:u,defaultSelectedKeys:p=[],onSelect:f,checkable:g=false,checkedKeys:v,defaultCheckedKeys:b=[],onCheck:h,emptyContent:x,children:R,virtualized:N=false,height:w,itemHeight:y,overscan:C=3,gap:E=0,...L},k){let[S,T]=Z.useState(false),[M,D]=Z.useState(null),[P,I]=Z.useState(0),H=Z.useRef(null);Z.useEffect(()=>{T(true);},[]),Z.useImperativeHandle(k,()=>H.current);let[A,B]=Z.useState(new Set(p)),$=u!==void 0,j=$?new Set(u):A,[G,U]=Z.useState(new Set(b)),W=v!==void 0,V=W?new Set(v):G,z=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),K=Z.useCallback((O,F)=>{if(!n)return;let q=new Set(j),X=!q.has(O.id);d?X?q.add(O.id):q.delete(O.id):(q.clear(),X&&q.add(O.id)),$||B(q);let Re=n.filter(Te=>q.has(Te.id));f?.(Array.from(q),{selected:X,selectedItems:Re,item:O,event:F});},[n,j,d,$,f]),Y=Z.useCallback((O,F)=>{if(!n)return;let q=new Set(V),X=!q.has(O.id);X?q.add(O.id):q.delete(O.id),W||U(q);let Re=n.filter(Te=>q.has(Te.id));h?.(Array.from(q),{checked:X,checkedItems:Re,item:O,event:F});},[n,V,W,h]),Q=O=>{if(!n)return;let F=n.find(q=>q.id===O.active.id);F&&D(F);},J=O=>{let{active:F,over:q}=O;if(D(null),!n||!q||F.id===q.id)return;let X=n.findIndex(Te=>Te.id===F.id),Re=n.findIndex(Te=>Te.id===q.id);if(X!==-1&&Re!==-1){let Te=[...n],[ot]=Te.splice(X,1);Te.splice(Re,0,ot),s?.(Te);}},be=(a||c||g)&&n&&o,_=t==="cards";if(n&&n.length===0&&x)return jsx("div",{ref:k,className:m("flex items-center justify-center p-8 text-muted-foreground",e),...L,children:x});if(N&&n&&o&&w&&y){let O=y+E,F=n.length*O-E,q=Math.max(0,Math.floor(P/O)-C),X=Math.ceil(w/O)+2*C,Re=Math.min(n.length-1,q+X),Te=ue=>{I(ue.currentTarget.scrollTop);},ot=[];for(let ue=q;ue<=Re;ue++)n[ue]!==void 0&&ot.push({item:n[ue],index:ue,style:{position:"absolute",top:ue*O,left:0,right:0,height:y}});return jsx("div",{ref:H,role:"list",className:m("overflow-auto w-full",t==="bordered"&&"border rounded-lg",e),style:{height:w,position:"relative"},onScroll:Te,...L,children:jsx("div",{style:{height:F,position:"relative",width:"100%"},children:ot.map(({item:ue,index:tt,style:te})=>{let at=j.has(ue.id),qt=V.has(ue.id);return jsxs("div",{role:"listitem","aria-selected":c?at:void 0,onClick:c&&!g?re=>K(ue,re):void 0,style:te,className:m("flex items-center gap-3 transition-all",_&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",_&&at&&"border-primary bg-accent",!_&&c&&!g&&"cursor-pointer hover:bg-muted/50",!_&&g&&"cursor-pointer hover:bg-muted/50",!_&&at&&c&&!g&&"bg-primary/10",(c||g)&&"cursor-pointer"),children:[g&&jsx(fs,{checked:qt,onClick:re=>Y(ue,re)}),jsx("div",{className:"flex-1 min-w-0 px-4",children:o(ue,tt)})]},ue.id)})})})}return be?a?S?jsxs(DndContext,{sensors:z,collisionDetection:closestCenter,onDragStart:Q,onDragEnd:J,children:[jsx("div",{ref:k,role:"list",className:m(na({variant:t,size:r,className:e})),...L,children:jsx(SortableContext,{items:n.map(O=>O.id),strategy:verticalListSortingStrategy,children:n.map((O,F)=>jsx(sw,{item:O,index:F,renderItem:o,showHandle:i,dragIcon:l,selectable:c,checkable:g,isSelected:j.has(O.id),isChecked:V.has(O.id),isCards:_,onSelect:K,onCheck:Y},O.id))})}),jsx(DragOverlay,{children:M&&o&&jsxs("div",{className:"flex items-center gap-3 bg-background border shadow-lg rounded-md p-3 opacity-90",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:o(M,n?.indexOf(M)??0)})]})})]}):jsx("div",{ref:k,role:"list",className:m(na({variant:t,size:r,className:e})),...L,children:n.map((O,F)=>jsxs("div",{role:"listitem",className:"flex items-center gap-3 transition-all",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),g&&jsx(fs,{checked:V.has(O.id),onClick:q=>Y(O,q)}),jsx("div",{className:"flex-1 min-w-0",children:o(O,F)})]},O.id))}):jsx("div",{ref:k,role:"list",className:m(na({variant:t,size:r,className:e})),...L,children:n.map((O,F)=>{let q=j.has(O.id),X=V.has(O.id);return jsxs("div",{role:"listitem","aria-selected":c?q:void 0,onClick:c&&!g?Re=>K(O,Re):void 0,className:m("flex items-center gap-3 transition-all",_&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",_&&q&&"border-primary bg-accent",!_&&c&&!g&&"cursor-pointer hover:bg-muted/50",!_&&g&&"cursor-pointer hover:bg-muted/50",!_&&q&&c&&!g&&"bg-primary/10",(c||g)&&"cursor-pointer"),children:[g&&jsx(fs,{checked:X,onClick:Re=>Y(O,Re)}),jsx("div",{className:"flex-1 min-w-0",children:o(O,F)})]},O.id)})}):jsx("div",{ref:k,role:"list",className:m(na({variant:t,size:r,className:e})),...L,children:R})}var lw=Z.forwardRef(iw),yf=cva("flex items-center gap-3 transition-colors",{variants:{interactive:{true:"cursor-pointer hover:bg-muted/50",false:""}},defaultVariants:{interactive:false}}),Rf=Z.forwardRef(({className:e,interactive:t,leading:r,trailing:n,children:o,...a},s)=>jsxs("div",{ref:s,role:"listitem",className:m(yf({interactive:t,className:e})),...a,children:[r&&jsx("div",{className:"shrink-0 text-muted-foreground",children:r}),jsx("div",{className:"flex-1 min-w-0",children:o}),n&&jsx("div",{className:"shrink-0 whitespace-nowrap",children:n})]}));Rf.displayName="ListItem";var wf=Z.forwardRef(({className:e,primary:t,secondary:r,children:n,...o},a)=>jsxs("div",{ref:a,className:m("min-w-0",e),...o,children:[t&&jsx("p",{className:"text-sm font-medium leading-none truncate",children:t}),r&&jsx("p",{className:"mt-1 text-sm text-muted-foreground truncate",children:r}),n]}));wf.displayName="ListItemText";var Tf=cva("flex flex-col",{variants:{position:{left:"",right:"",alternate:""}},defaultVariants:{position:"left"}}),Nf=Z.forwardRef(({className:e,position:t,...r},n)=>jsx("div",{ref:n,"data-position":t,className:m(Tf({position:t,className:e})),...r}));Nf.displayName="Timeline";var kf=cva("relative flex gap-4 pb-8 last:pb-0",{variants:{variant:{default:"",success:"[&_[data-timeline-dot]]:bg-green-500 [&_[data-timeline-dot]]:border-green-500",warning:"[&_[data-timeline-dot]]:bg-yellow-500 [&_[data-timeline-dot]]:border-yellow-500",error:"[&_[data-timeline-dot]]:bg-red-500 [&_[data-timeline-dot]]:border-red-500",info:"[&_[data-timeline-dot]]:bg-blue-500 [&_[data-timeline-dot]]:border-blue-500"}},defaultVariants:{variant:"default"}}),Sf=Z.forwardRef(({className:e,variant:t,hideSeparator:r=false,hideConnector:n=false,dot:o,children:a,...s},i)=>jsxs("div",{ref:i,className:m(kf({variant:t,className:e})),...s,children:[!r&&jsxs("div",{className:"flex flex-col items-center",children:[jsx("div",{"data-timeline-dot":true,className:"flex h-3 w-3 items-center justify-center rounded-full border-2 border-primary bg-primary",children:o}),!n&&jsx("div",{className:"w-0.5 flex-1 bg-border"})]}),a]}));Sf.displayName="TimelineItem";var Ef=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:m("flex-1 pt-0.5",e),...t}));Ef.displayName="TimelineContent";var Pf=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:m("flex-1 text-sm text-muted-foreground pt-0.5",e),...t}));Pf.displayName="TimelineOpposite";var Lf=cva("relative flex flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",{variants:{variant:{default:"border-input bg-background hover:bg-accent/50",active:"border-primary bg-primary/5",error:"border-danger bg-danger/5"},size:{sm:"p-4 min-h-[120px]",md:"p-6 min-h-[160px]",lg:"p-8 min-h-[200px]"}},defaultVariants:{variant:"default",size:"md"}}),hw={sm:{icon:"h-5 w-5",iconContainer:"p-2",title:"text-xs",subtitle:"text-[10px]"},md:{icon:"h-6 w-6",iconContainer:"p-3",title:"text-sm",subtitle:"text-xs"},lg:{icon:"h-8 w-8",iconContainer:"p-4",title:"text-base",subtitle:"text-sm"}},Df=e=>{let t=e.type;return t.startsWith("image/")?Image$1:t.startsWith("video/")?FileVideo:t.startsWith("audio/")?FileAudio:t.includes("pdf")||t.includes("document")?FileText:t.includes("zip")||t.includes("rar")||t.includes("archive")?FileArchive:File},gs=e=>{if(e===0)return "0 Bytes";let t=1024,r=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(2))+" "+r[n]},Hf=(e,t,r)=>{let n=[];return t&&e.size>t&&n.push({code:"file-too-large",message:`File is larger than ${gs(t)}`}),r&&r.length>0&&(r.some(a=>{if(a.startsWith("."))return e.name.toLowerCase().endsWith(a.toLowerCase());if(a.endsWith("/*")){let s=a.slice(0,-2);return e.type.startsWith(s)}return e.type===a})||n.push({code:"file-invalid-type",message:`File type not accepted. Accepted: ${r.join(", ")}`})),n},If=Z.forwardRef(({className:e,variant:t,size:r="md",onFilesChange:n,onFilesRejected:o,onFileRemove:a,files:s=[],showFileList:i=true,children:l,maxSize:c=10*1024*1024,accept:d,multiple:u=true,isDisabled:p,...f},g)=>{let v=hw[r],[b,h]=Z.useState(false),[x,R]=Z.useState(false),[N,w]=Z.useState([]),y=Z.useRef(null),C=Z.useCallback(H=>{if(!H||H.length===0)return;let A=Array.from(H),B=[],$=[];(u?A:[A[0]]).forEach(G=>{let U=Hf(G,c,d);U.length>0?$.push({file:G,errors:U}):B.push(G);}),w($),B.length>0&&n?.(B),$.length>0&&o?.($);},[c,d,u,n,o]),E=Z.useCallback(H=>{if(H.preventDefault(),H.stopPropagation(),!p&&(h(true),H.dataTransfer.items)){let B=Array.from(H.dataTransfer.items).some($=>{if($.kind!=="file")return true;if(d&&d.length>0){let j=$.type;return !d.some(G=>G.endsWith("/*")?j.startsWith(G.slice(0,-2)):j===G)}return false});R(B);}},[p,d]),L=Z.useCallback(H=>{H.preventDefault(),H.stopPropagation(),!p&&(H.dataTransfer.dropEffect="copy");},[p]),k=Z.useCallback(H=>{H.preventDefault(),H.stopPropagation();let A=H.currentTarget.getBoundingClientRect(),B=H.clientX,$=H.clientY;(B<A.left||B>A.right||$<A.top||$>A.bottom)&&(h(false),R(false));},[]),S=Z.useCallback(H=>{H.preventDefault(),H.stopPropagation(),h(false),R(false),!p&&C(H.dataTransfer.files);},[p,C]),T=Z.useCallback(()=>{p||y.current?.click();},[p]),M=Z.useCallback(H=>{C(H.target.files),H.target.value="";},[C]),D=Z.useCallback(H=>{p||(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),y.current?.click());},[p]),P=x?"error":b?"active":t,I=d?.join(",");return jsxs("div",{ref:g,className:m("space-y-4",e),...f,children:[jsxs("div",{role:"button",tabIndex:p?-1:0,onDragEnter:E,onDragOver:L,onDragLeave:k,onDrop:S,onClick:T,onKeyDown:D,className:m(Lf({variant:P,size:r}),p&&"opacity-50 cursor-not-allowed",!p&&"cursor-pointer focus:outline-none"),"aria-disabled":p,children:[jsx("input",{ref:y,type:"file",accept:I,multiple:u,disabled:p,onChange:M,className:"sr-only",tabIndex:-1}),l||jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[jsx("div",{className:m("rounded-full bg-muted",v.iconContainer),children:jsx(Upload,{className:m(v.icon,"text-muted-foreground")})}),jsxs("div",{className:"space-y-1",children:[jsx("p",{className:m(v.title,"font-medium"),children:b?"Drop files here":"Drop files or click to upload"}),jsxs("p",{className:m(v.subtitle,"text-muted-foreground"),children:[c&&`Max ${gs(c)}`,d&&d.length>0&&` \u2022 ${d.join(", ")}`]})]})]})]}),N.length>0&&jsx("div",{className:"rounded-md bg-danger/10 p-3 text-sm text-danger",children:N.map(({file:H,errors:A})=>jsxs("div",{children:[jsx("span",{className:"font-medium",children:H.name}),":"," ",A.map(B=>B.message).join(", ")]},H.name))}),i&&s.length>0&&jsx("div",{className:"space-y-2",children:s.map(H=>{let A=Df(H.file);return jsxs("div",{className:m("flex items-center gap-3 rounded-lg border p-3",H.error&&"border-danger bg-danger/5"),children:[jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-muted",children:jsx(A,{className:"h-5 w-5 text-muted-foreground"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"truncate text-sm font-medium",children:H.file.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[gs(H.file.size),H.error&&jsx("span",{className:"ml-2 text-danger",children:H.error})]}),H.progress!==void 0&&H.progress<100&&jsx(Ja,{value:H.progress,className:"mt-2 h-1"})]}),jsxs(me,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:B=>{B.stopPropagation(),a?.(H.file);},children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Remove"})]})]},H.id)})})]})});If.displayName="FileUpload";var xw=`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")`,Af=cva("relative rounded-md border border-input shadow-sm transition-all 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:{xs:"h-4 w-4",sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12"},shape:{square:"rounded-md",circle:"rounded-full"},interactive:{true:"cursor-pointer hover:scale-110 active:scale-105",false:"cursor-default"}},defaultVariants:{size:"md",shape:"square",interactive:false}}),sa=Z.forwardRef(({color:e,isSelected:t,showTransparency:r=true,onSelect:n,size:o,shape:a,interactive:s,className:i,onClick:l,disabled:c,selectedRingColor:d,...u},p)=>jsx("button",{ref:p,type:"button",disabled:c,onClick:v=>{l?.(v),n?.(e);},className:m(Af({size:o,shape:a,interactive:s??(!!n||!!l)}),t&&"ring-2 ring-offset-2",i),style:{backgroundImage:r?xw:void 0,backgroundSize:r?"8px 8px":void 0,...t&&{"--tw-ring-color":d||"var(--color-foreground)"}},"aria-label":`Color ${e}`,"aria-pressed":t,...u,children:jsx("span",{className:"absolute inset-0 rounded-[inherit]",style:{backgroundColor:e}})}));sa.displayName="ColorSwatch";var zf=cva("",{variants:{layout:{grid:"grid gap-2",stack:"flex flex-wrap gap-2"}},defaultVariants:{layout:"stack"}}),Of=Z.forwardRef(({value:e,defaultValue:t,onChange:r,layout:n,columns:o=6,colors:a,swatchSize:s="md",swatchShape:i="square",isDisabled:l,selectedRingColor:c,className:d,style:u,...p},f)=>{let[g,v]=Z.useState(t),b=e??g,h=Z.useCallback(R=>{l||(e===void 0&&v(R),r?.(R));},[e,r,l]),x=R=>R.toLowerCase();return jsx("div",{ref:f,role:"listbox","aria-label":"Color options",className:m(zf({layout:n}),d),style:{...n==="grid"?{gridTemplateColumns:`repeat(${o}, 1fr)`}:{},...u},...p,children:a.map(R=>{let N=b?x(b)===x(R):false;return jsx(sa,{role:"option",color:R,size:s,shape:i,isSelected:N,onSelect:h,disabled:l,selectedRingColor:c,"aria-selected":N},R)})})});Of.displayName="ColorSwatchPicker";var ww=["#000000","#ffffff","#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],Ff={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},Bf=Z.forwardRef(({value:e,defaultValue:t="#3b82f6",onChange:r,isDisabled:n,presets:o=ww,showInput:a=true,size:s="md",className:i,variant:l="full"},c)=>{let[d,u]=Z.useState(e??t),p=Z.useId();Z.useEffect(()=>{e!==void 0&&u(e);},[e]);let f=b=>{u(b),r?.(b);},g=b=>{u(b),r?.(b);},v=b=>{let h=b.target.value.toUpperCase();u(h),r?.(h);};return l==="simple"?jsxs("label",{className:m("relative rounded-md border border-input shadow-sm transition-colors cursor-pointer hover:border-foreground focus-within:border-foreground overflow-hidden",n&&"opacity-50 cursor-not-allowed",Ff[s],i),children:[jsx("input",{type:"color",value:d,onChange:v,disabled:n,className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",id:p}),jsx("div",{className:"h-full w-full",style:{backgroundColor:d}})]}):jsxs(Pt,{children:[jsx(en,{ref:c,disabled:n,className:m("rounded-md border border-input shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",Ff[s],i),style:{backgroundColor:d},"aria-label":`Color picker, current color: ${d}`}),jsx(Lt,{className:"w-auto p-3",align:"start",children:jsxs("div",{className:"space-y-3",children:[jsx(HexColorPicker,{color:d,onChange:f,className:"!w-[200px]"}),a&&jsxs("div",{className:"space-y-1.5",children:[jsx(Pn,{htmlFor:"color-input",className:"text-xs",children:"Hex Color"}),jsxs("div",{className:"flex gap-2",children:[jsx("div",{className:"h-9 w-9 shrink-0 rounded-md border",style:{backgroundColor:d}}),jsx(HexColorInput,{id:"color-input",color:d,onChange:f,prefixed:true,className:"flex h-9 w-full rounded-md border border-input bg-background text-foreground px-3 py-2 font-mono text-sm uppercase focus:outline-none focus:border-foreground disabled:cursor-not-allowed disabled:opacity-50"})]})]}),o.length>0&&jsxs("div",{className:"space-y-1.5",children:[jsx(Pn,{className:"text-xs",children:"Presets"}),jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(b=>jsx(sa,{color:b,size:"sm",isSelected:d.toLowerCase()===b.toLowerCase(),onSelect:g},b))})]})]})})]})});Bf.displayName="ColorPicker";var $f=cva("flex w-full border border-input bg-background px-3 file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl"}},defaultVariants:{size:"md",radius:"md"}}),sl=e=>String(e).padStart(2,"0"),kw=e=>{let[t,r]=e.split(":").map(Number);return {hours:t||0,minutes:r||0}},Sw=(e,t)=>`${sl(e)}:${sl(t)}`,Kf=Z.forwardRef(({className:e,size:t,radius:r,value:n,onChange:o,use24Hour:a=true,minuteStep:s=1,showPicker:i=true,minTime:l,maxTime:c,label:d,isRequired:u,isDisabled:p,description:f,errorMessage:g,isInvalid:v,...b},h)=>{let[x,R]=Z.useState(n??""),[N,w]=Z.useState(false),[y,C]=Z.useState(false),E=Z.useId(),L=b.id||E,k=v||!!g;Z.useEffect(()=>{n!==void 0&&R(n);},[n]);let{hours:S,minutes:T}=kw(x||"00:00"),M=j=>{let G=j.target.value;R(G),/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(G)&&o?.(G);},D=(j,G)=>{let U=Math.max(0,Math.min(23,j)),W=Math.max(0,Math.min(59,G)),V=Sw(U,W);R(V),o?.(V);},P=()=>D(S+1,T),I=()=>D(S-1,T),H=()=>D(S,T+s),A=()=>D(S,T-s),B=({value:j,onIncrement:G,onDecrement:U})=>jsxs("div",{className:"flex flex-col items-center",children:[jsx(me,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:G,isDisabled:p,children:jsx(ChevronUp,{className:"h-4 w-4"})}),jsx("div",{className:"flex h-10 w-12 items-center justify-center rounded-md bg-muted text-lg font-semibold",children:sl(j)}),jsx(me,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:U,isDisabled:p,children:jsx(ChevronDown,{className:"h-4 w-4"})})]}),$=jsxs("div",{className:"relative flex items-center",children:[jsx("input",{ref:h,id:L,type:"time",value:x,onChange:M,disabled:p,required:u,"aria-invalid":k,"aria-describedby":f||g?`${L}-description`:void 0,className:m($f({size:t,radius:r}),i&&"pr-10","[&::-webkit-calendar-picker-indicator]:hidden",k&&"border-danger focus:border-danger",!d&&e),style:{borderColor:k?void 0:y?"var(--color-foreground)":void 0},onFocus:()=>C(true),onBlur:()=>C(false),...b}),i&&jsxs(Pt,{open:N,onOpenChange:w,children:[jsxs(en,{type:"button",className:"absolute right-1 h-7 w-7 p-0 inline-flex items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer",disabled:p,children:[jsx(Clock,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Pick time"})]}),jsxs(Lt,{className:"w-auto p-4",align:"end",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(B,{value:S,onIncrement:P,onDecrement:I,max:23}),jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:":"}),jsx(B,{value:T,onIncrement:H,onDecrement:A,max:59})]}),jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[jsx(me,{variant:"bordered",size:"sm",onClick:()=>{let j=new Date;D(j.getHours(),j.getMinutes());},children:"Now"}),jsx(me,{size:"sm",onClick:()=>w(false),children:"Done"})]})]})]})]});return !d&&!f&&!g?$:jsxs("div",{className:m("flex flex-col gap-1.5",e),children:[d&&jsxs("label",{htmlFor:L,className:"text-sm font-medium leading-none",children:[d,u&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),$,(f||g)&&jsx("p",{id:`${L}-description`,className:m("text-xs",k?"text-danger":"text-muted-foreground"),children:g||f})]})});Kf.displayName="TimeInput";var Uf=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 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"}},defaultVariants:{size:"md"}}),Pw={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Lw=(e,t)=>{try{return new Intl.NumberFormat(t,{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).formatToParts(0).find(a=>a.type==="currency")?.value??e}catch{return e}},Gf=(e,t,r,n)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,r);return s?`${i}${n}${s}`:i},Dw=(e,t,r)=>{if(!e)return;let n=e.replace(new RegExp(`\\${t}`,"g"),"");n=n.replace(r,"."),n=n.replace(/[^0-9.-]/g,"");let o=parseFloat(n);return isNaN(o)?void 0:o},_f=Z.forwardRef(({className:e,size:t,value:r,defaultValue:n,onChange:o,currency:a="USD",locale:s="en-US",decimals:i=2,min:l,max:c,showCurrency:d=true,currencyPosition:u="prefix",currencySymbol:p,thousandSeparator:f=",",decimalSeparator:g=".",radius:v="md",isDisabled:b,placeholder:h,...x},R)=>{let[N,w]=Z.useState(n),[y,C]=Z.useState(""),[E,L]=Z.useState(false),k=r!==void 0?r:N,S=p??Lw(a,s);Z.useEffect(()=>{!E&&k!==void 0&&C(Gf(k,i,f,g));},[k,i,f,g,E]);let T=H=>{let A=H.target.value;if(!A){C(""),r===void 0&&w(void 0),o?.(void 0);return}if(!new RegExp(`^[0-9${f}${g}.-]*$`).test(A))return;C(A);let $=Dw(A,f,g);if($!==void 0){let j=$;l!==void 0&&$<l&&(j=l),c!==void 0&&$>c&&(j=c),r===void 0&&w(j),o?.(j);}},M=()=>{L(true),k!==void 0&&C(k.toString().replace(".",g));},D=()=>{L(false),C(k!==void 0?Gf(k,i,f,g):"");},P=d&&u==="prefix"&&jsx("span",{className:"flex items-center text-muted-foreground pr-1",children:S}),I=d&&u==="suffix"&&jsx("span",{className:"flex items-center text-muted-foreground pl-1",children:S});return jsxs("div",{className:"relative flex items-center",children:[P&&jsx("div",{className:"absolute left-3 pointer-events-none",children:P}),jsx("input",{ref:R,type:"text",inputMode:"decimal",value:y,onChange:T,onFocus:M,onBlur:D,disabled:b,placeholder:h??`0${g}${"0".repeat(i)}`,className:m(Uf({size:t}),Pw[v],P&&"pl-8",I&&"pr-8","text-right",e),style:{borderColor:E?"var(--color-foreground)":void 0},...x}),I&&jsx("div",{className:"absolute right-3 pointer-events-none",children:I})]})});_f.displayName="CurrencyInput";var jf=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 font-mono",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),il={creditCard:{mask:"#### #### #### ####"},creditCardAmex:{mask:"#### ###### #####"},cvv:{mask:"###"},expiry:{mask:"##/##"},date:{mask:"##/##/####"},dateISO:{mask:"####-##-##"},time:{mask:"##:##"},ip:{mask:"###.###.###.###"},mac:{mask:"AA:AA:AA:AA:AA:AA"},id11:{mask:"###########"},id9:{mask:"#########"},id10:{mask:"##########"},postal5:{mask:"#####"},postal9:{mask:"#####-####"}},Vw=(e,t)=>{switch(t){case "#":return /\d/.test(e);case "A":return /[a-zA-Z]/.test(e);case "*":return /[a-zA-Z0-9]/.test(e);default:return e===t}},ln=e=>["#","A","*"].includes(e),vs=(e,t,r)=>{let n="",o=0;for(let a=0;a<t.length&&o<=e.length;a++){let s=t[a];if(ln(s)){if(o<e.length){let i=e[o];Vw(i,s)?(n+=i,o++):(o++,a--);}}else (o<e.length||r)&&(n+=s);}return n},ll=(e,t)=>{let r="";for(let n=0;n<e.length&&n<t.length;n++){let o=t[n];ln(o)&&(r+=e[n]);}return r},Wf=(e,t)=>e.split("").map(r=>ln(r)?t:r).join(""),Aw=(e,t,r)=>{let n=0;for(let i=0;i<r&&i<e.length&&i<t.length;i++)ln(t[i])&&n++;let a=0,s=0;for(let i=0;i<t.length&&s<n;i++)a++,ln(t[i])&&s++;for(;a<t.length&&!ln(t[a]);)a++;return Math.min(a,e.length)},Yf=Z.forwardRef(({className:e,size:t,value:r,defaultValue:n="",onChange:o,mask:a,maskPlaceholder:s="_",showMaskPlaceholder:i=false,includeMaskChars:l=false,isDisabled:c,placeholder:d,...u},p)=>{let f=typeof a=="string"&&a in il?il[a].mask:a,[g,v]=Z.useState(n),[b,h]=Z.useState(""),[x,R]=Z.useState(false),N=Z.useRef(null),w=r!==void 0?r:g;Z.useImperativeHandle(p,()=>N.current),Z.useEffect(()=>{let L=vs(w,f,true);h(L);},[w,f]);let y=L=>{let k=L.target.value,S=L.target.selectionStart??0,T=k.replace(/[^\w]/g,""),M=vs(T,f,true),D=ll(M,f);h(M),r===void 0&&v(l?M:D),o?.(D,M),requestAnimationFrame(()=>{if(N.current){let P=Aw(M,f,S);N.current.setSelectionRange(P,P);}});},C=L=>{if(["ArrowLeft","ArrowRight","Home","End","Tab"].includes(L.key)||L.ctrlKey||L.metaKey)return;let k=N.current;if(!k)return;let S=k.selectionStart??0;if(L.key==="Backspace"&&S>0){let T=S-1;for(;T>0&&!ln(f[T]);)T--;let M=ll(b,f),D=0;for(let H=0;H<T&&H<f.length;H++)ln(f[H])&&D++;let P=M.slice(0,Math.max(0,D-1))+M.slice(D),I=vs(P,f,true);h(I),r===void 0&&v(l?I:P),o?.(P,I),L.preventDefault(),requestAnimationFrame(()=>{N.current&&N.current.setSelectionRange(T,T);});}},E=i?Wf(f,s):d;return jsx("input",{ref:N,type:"text",value:b,onChange:y,onKeyDown:C,onFocus:()=>R(true),onBlur:()=>R(false),disabled:c,placeholder:E,className:m(jf({size:t}),e),style:{borderColor:x?"var(--color-foreground)":void 0},...u})});Yf.displayName="MaskedInput";var $w=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium 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"}},defaultVariants:{size:"md"}}),Xf=[{code:"AR",name:"Argentina",dialCode:"+54",flag:"\u{1F1E6}\u{1F1F7}",format:"## ####-####"},{code:"AU",name:"Australia",dialCode:"+61",flag:"\u{1F1E6}\u{1F1FA}",format:"### ### ###"},{code:"AT",name:"Austria",dialCode:"+43",flag:"\u{1F1E6}\u{1F1F9}",format:"### #######"},{code:"BE",name:"Belgium",dialCode:"+32",flag:"\u{1F1E7}\u{1F1EA}",format:"### ## ## ##"},{code:"BR",name:"Brazil",dialCode:"+55",flag:"\u{1F1E7}\u{1F1F7}",format:"(##) #####-####"},{code:"BG",name:"Bulgaria",dialCode:"+359",flag:"\u{1F1E7}\u{1F1EC}",format:"### ### ###"},{code:"CA",name:"Canada",dialCode:"+1",flag:"\u{1F1E8}\u{1F1E6}",format:"(###) ###-####"},{code:"CN",name:"China",dialCode:"+86",flag:"\u{1F1E8}\u{1F1F3}",format:"### #### ####"},{code:"HR",name:"Croatia",dialCode:"+385",flag:"\u{1F1ED}\u{1F1F7}",format:"## ### ####"},{code:"CZ",name:"Czech Republic",dialCode:"+420",flag:"\u{1F1E8}\u{1F1FF}",format:"### ### ###"},{code:"DK",name:"Denmark",dialCode:"+45",flag:"\u{1F1E9}\u{1F1F0}",format:"## ## ## ##"},{code:"EG",name:"Egypt",dialCode:"+20",flag:"\u{1F1EA}\u{1F1EC}",format:"### ### ####"},{code:"FI",name:"Finland",dialCode:"+358",flag:"\u{1F1EB}\u{1F1EE}",format:"## ### ####"},{code:"FR",name:"France",dialCode:"+33",flag:"\u{1F1EB}\u{1F1F7}",format:"# ## ## ## ##"},{code:"DE",name:"Germany",dialCode:"+49",flag:"\u{1F1E9}\u{1F1EA}",format:"#### #######"},{code:"GR",name:"Greece",dialCode:"+30",flag:"\u{1F1EC}\u{1F1F7}",format:"### ### ####"},{code:"HK",name:"Hong Kong",dialCode:"+852",flag:"\u{1F1ED}\u{1F1F0}",format:"#### ####"},{code:"HU",name:"Hungary",dialCode:"+36",flag:"\u{1F1ED}\u{1F1FA}",format:"## ### ####"},{code:"IN",name:"India",dialCode:"+91",flag:"\u{1F1EE}\u{1F1F3}",format:"##### #####"},{code:"IL",name:"Israel",dialCode:"+972",flag:"\u{1F1EE}\u{1F1F1}",format:"##-###-####"},{code:"IT",name:"Italy",dialCode:"+39",flag:"\u{1F1EE}\u{1F1F9}",format:"### ### ####"},{code:"JP",name:"Japan",dialCode:"+81",flag:"\u{1F1EF}\u{1F1F5}",format:"##-####-####"},{code:"MX",name:"Mexico",dialCode:"+52",flag:"\u{1F1F2}\u{1F1FD}",format:"### ### ####"},{code:"NL",name:"Netherlands",dialCode:"+31",flag:"\u{1F1F3}\u{1F1F1}",format:"## ########"},{code:"NZ",name:"New Zealand",dialCode:"+64",flag:"\u{1F1F3}\u{1F1FF}",format:"## ### ####"},{code:"NG",name:"Nigeria",dialCode:"+234",flag:"\u{1F1F3}\u{1F1EC}",format:"### ### ####"},{code:"NO",name:"Norway",dialCode:"+47",flag:"\u{1F1F3}\u{1F1F4}",format:"### ## ###"},{code:"PK",name:"Pakistan",dialCode:"+92",flag:"\u{1F1F5}\u{1F1F0}",format:"### #######"},{code:"PL",name:"Poland",dialCode:"+48",flag:"\u{1F1F5}\u{1F1F1}",format:"### ### ###"},{code:"PT",name:"Portugal",dialCode:"+351",flag:"\u{1F1F5}\u{1F1F9}",format:"### ### ###"},{code:"RO",name:"Romania",dialCode:"+40",flag:"\u{1F1F7}\u{1F1F4}",format:"### ### ###"},{code:"RU",name:"Russia",dialCode:"+7",flag:"\u{1F1F7}\u{1F1FA}",format:"(###) ###-##-##"},{code:"SA",name:"Saudi Arabia",dialCode:"+966",flag:"\u{1F1F8}\u{1F1E6}",format:"## ### ####"},{code:"RS",name:"Serbia",dialCode:"+381",flag:"\u{1F1F7}\u{1F1F8}",format:"## ### ####"},{code:"SG",name:"Singapore",dialCode:"+65",flag:"\u{1F1F8}\u{1F1EC}",format:"#### ####"},{code:"SK",name:"Slovakia",dialCode:"+421",flag:"\u{1F1F8}\u{1F1F0}",format:"### ### ###"},{code:"SI",name:"Slovenia",dialCode:"+386",flag:"\u{1F1F8}\u{1F1EE}",format:"## ### ###"},{code:"ZA",name:"South Africa",dialCode:"+27",flag:"\u{1F1FF}\u{1F1E6}",format:"## ### ####"},{code:"KR",name:"South Korea",dialCode:"+82",flag:"\u{1F1F0}\u{1F1F7}",format:"##-####-####"},{code:"ES",name:"Spain",dialCode:"+34",flag:"\u{1F1EA}\u{1F1F8}",format:"### ### ###"},{code:"SE",name:"Sweden",dialCode:"+46",flag:"\u{1F1F8}\u{1F1EA}",format:"##-### ## ##"},{code:"CH",name:"Switzerland",dialCode:"+41",flag:"\u{1F1E8}\u{1F1ED}",format:"## ### ## ##"},{code:"TW",name:"Taiwan",dialCode:"+886",flag:"\u{1F1F9}\u{1F1FC}",format:"### ### ###"},{code:"TR",name:"Turkey",dialCode:"+90",flag:"\u{1F1F9}\u{1F1F7}",format:"(###) ### ## ##"},{code:"UA",name:"Ukraine",dialCode:"+380",flag:"\u{1F1FA}\u{1F1E6}",format:"## ### ## ##"},{code:"AE",name:"United Arab Emirates",dialCode:"+971",flag:"\u{1F1E6}\u{1F1EA}",format:"## ### ####"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"\u{1F1EC}\u{1F1E7}",format:"#### ### ####"},{code:"US",name:"United States",dialCode:"+1",flag:"\u{1F1FA}\u{1F1F8}",format:"(###) ###-####"}],hs=(e,t)=>{let r=e.replace(/\D/g,""),n="",o=0;for(let a=0;a<t.length&&o<r.length;a++)t[a]==="#"?(n+=r[o],o++):n+=t[a];return n},Kw=e=>e.replace(/#/g,"_"),Zf=Z.forwardRef(({className:e,size:t,value:r,defaultValue:n="",onChange:o,country:a,defaultCountry:s="TR",onCountryChange:i,countries:l=Xf,showCountrySelect:c=true,showDialCode:d=false,isDisabled:u,placeholder:p,radius:f="md",...g},v)=>{let[b,h]=Z.useState(n),[x,R]=Z.useState(a??s),[N,w]=Z.useState(false),[y,C]=Z.useState(false),[E,L]=Z.useState(false),[k,S]=Z.useState({top:0,left:0,width:0}),T=Z.useRef(null),M=Z.useRef(null),D=r!==void 0?r:b,P=a??x,I=l.find(U=>U.code===P)??l[0],H=hs(D,I.format);Z.useEffect(()=>{L(true);},[]),Z.useEffect(()=>{if(y&&T.current){let U=T.current.getBoundingClientRect();S({top:U.bottom+4,left:U.left,width:Math.max(U.width,280)});}},[y]),Z.useEffect(()=>{if(!y)return;let U=W=>{T.current&&!T.current.contains(W.target)&&M.current&&!M.current.contains(W.target)&&C(false);};return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[y]),Z.useEffect(()=>{if(!y)return;let U=W=>{W.key==="Escape"&&C(false);};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[y]),Z.useEffect(()=>{if(!y)return;let U=W=>{M.current?.contains(W.target)||C(false);};return window.addEventListener("scroll",U,true),()=>window.removeEventListener("scroll",U,true)},[y]);let A=U=>{let V=U.target.value.replace(/\D/g,"");r===void 0&&h(V);let z=hs(V,I.format),K=`${I.dialCode} ${z}`;o?.(V,K,I);},B=U=>{let W=l.find(K=>K.code===U);if(!W)return;a===void 0&&R(U),i?.(W);let V=hs(D,W.format),z=`${W.dialCode} ${V}`;o?.(D,z,W),C(false);},$=t==="sm"?"h-9":t==="lg"?"h-11":"h-10",j=N||y;return jsxs("div",{className:m("flex border bg-background transition-colors",{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}[f],u&&"cursor-not-allowed opacity-50"),style:{borderColor:j?"var(--color-foreground)":"var(--color-border)"},children:[c&&jsxs(Fragment,{children:[jsxs("button",{ref:T,type:"button",disabled:u,onClick:()=>C(!y),className:m("flex items-center justify-between bg-transparent px-3 py-2 text-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50","w-[100px] shrink-0 border-r",$),style:{borderColor:j?"var(--color-foreground)":"var(--color-border)"},children:[jsxs("span",{className:"flex items-center gap-1.5",children:[jsx("span",{children:I.flag}),jsx("span",{className:"text-xs text-muted-foreground",children:I.dialCode})]}),jsx(ChevronDown,{className:m("h-4 w-4 opacity-50 transition-transform",y&&"rotate-180")})]}),E&&y&&Ua.createPortal(jsx("div",{ref:M,className:"fixed z-50 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",style:{top:k.top,left:k.left,minWidth:k.width},children:jsx(ze,{style:{maxHeight:300},children:jsx("div",{className:"p-1",children:l.map(U=>jsxs("div",{role:"option","aria-selected":U.code===P,onClick:()=>B(U.code),className:"relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:U.code===P&&jsx(Check,{className:"h-4 w-4"})}),jsxs("span",{className:"flex items-center gap-2",children:[jsx("span",{children:U.flag}),jsx("span",{className:"flex-1",children:U.name}),jsx("span",{className:"text-xs text-muted-foreground",children:U.dialCode})]})]},U.code))})})}),document.body)]}),jsxs("div",{className:"relative flex-1",children:[d&&!c&&jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:I.dialCode}),jsx("input",{ref:v,type:"tel",inputMode:"tel",value:H,onChange:A,onFocus:()=>w(true),onBlur:()=>w(false),disabled:u,placeholder:p??Kw(I.format),className:m("flex h-10 w-full bg-transparent px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",t==="sm"&&"h-8 px-2 text-xs",t==="lg"&&"h-12 px-4 text-base",d&&!c&&"pl-12",e),...g})]})]})});Zf.displayName="PhoneInput";var Qf=cva("flex items-center justify-between w-full px-4 py-3 border-b bg-background",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",bordered:"bg-background border-border",ghost:"bg-transparent border-transparent",soft:"bg-primary/10 border-primary/20",surface:"bg-muted border-border"},size:{sm:"h-12 px-3 py-2",md:"h-14 px-4 py-3",lg:"h-16 px-6 py-4"},sticky:{true:"sticky top-0 z-50",false:""}},defaultVariants:{variant:"bordered",size:"md",sticky:false}}),eg=Z.forwardRef(({className:e,variant:t,size:r,sticky:n,brand:o,children:a,mobileBreakpoint:s="md",...i},l)=>{let[c,d]=Z.useState(false),u={sm:"hidden sm:flex",md:"hidden md:flex",lg:"hidden lg:flex"}[s],p={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden"}[s];return jsxs("nav",{ref:l,className:m(Qf({variant:t,size:r,sticky:n,className:e})),...i,children:[jsxs("div",{className:"flex items-center justify-between w-full",children:[o&&jsx("div",{className:"flex-shrink-0",children:o}),jsx("div",{className:m("items-center gap-4 flex-1 justify-end",u),children:a}),jsx("button",{type:"button",className:m("p-2 rounded-md hover:bg-accent hover:text-accent-foreground transition-colors",p),onClick:()=>d(!c),"aria-label":c?"Close menu":"Open menu","aria-expanded":c,children:c?jsx(X,{className:"h-5 w-5"}):jsx(Menu,{className:"h-5 w-5"})})]}),c&&jsx("div",{className:m("absolute top-full left-0 right-0 flex flex-col gap-2 p-4 bg-background border-b border-border shadow-lg",p),children:a})]})});eg.displayName="Navbar";var tg=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:m("flex items-center gap-2 font-semibold text-lg",e),...t}));tg.displayName="NavbarBrand";var rg=Z.forwardRef(({className:e,justify:t="start",...r},n)=>{let o={start:"justify-start",center:"justify-center",end:"justify-end"}[t];return jsx("div",{ref:n,className:m("flex items-center gap-4",o,e),...r})});rg.displayName="NavbarContent";var ng=Z.forwardRef(({className:e,isActive:t,...r},n)=>jsx("div",{ref:n,className:m("flex items-center",t&&"text-primary font-medium",e),...r}));ng.displayName="NavbarItem";var og=Z.forwardRef(({className:e,isActive:t,...r},n)=>jsx("a",{ref:n,className:m("text-sm font-medium transition-colors hover:text-primary",t?"text-primary":"text-muted-foreground",e),...r}));og.displayName="NavbarLink";var Yw={none:"",hover:"hover:underline",always:"underline"},ag={primary:"text-primary",success:"text-green-600 dark:text-green-500",warning:"text-amber-600 dark:text-amber-500",danger:"text-red-600 dark:text-red-500",muted:"text-muted-foreground"},ig=Z.forwardRef(({className:e,color:t="primary",underline:r="hover",isExternal:n,showExternalIcon:o=true,isDisabled:a,children:s,style:i,...l},c)=>{let d=n?{target:"_blank",rel:"noopener noreferrer"}:{},u=t in ag,p=u?i:{color:t,...i};return jsxs("a",{ref:c,className:m("inline-flex items-center gap-1 underline-offset-4 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",u&&ag[t],Yw[r],a&&"pointer-events-none opacity-50",e),style:p,"aria-disabled":a,...d,...l,children:[s,n&&o&&jsx(ExternalLink,{className:"h-3 w-3","aria-hidden":"true"})]})});ig.displayName="Link";var lg=cva("fixed z-50 transition-all duration-300",{variants:{position:{"bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6","bottom-center":"bottom-6 left-1/2 -translate-x-1/2"}},defaultVariants:{position:"bottom-right"}}),cg=Z.forwardRef(({className:e,position:t,threshold:r=400,icon:n,behavior:o="smooth",variant:a="solid",color:s="default",size:i="md",radius:l="full",target:c,onVisibilityChange:d,onClick:u,...p},f)=>{let[g,v]=Z.useState(false);Z.useEffect(()=>{let x=c?.current||window,R=()=>{let w=(c?.current?c.current.scrollTop:window.scrollY||document.documentElement.scrollTop)>r;w!==g&&(v(w),d?.(w));};return x.addEventListener("scroll",R,{passive:true}),R(),()=>{x.removeEventListener("scroll",R);}},[r,c,g,d]);let b=x=>{c?.current?c.current.scrollTo({top:0,behavior:o}):window.scrollTo({top:0,behavior:o}),u?.(x);},h=i==="sm"?"h-4 w-4":i==="lg"?"h-6 w-6":"h-5 w-5";return jsx("div",{className:m(lg({position:t}),g?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none",e),children:jsx(me,{ref:f,type:"button",variant:a,color:s,size:i,isIconOnly:true,radius:l,onClick:b,"aria-label":"Back to top",className:"shadow-lg",...p,children:n||jsx(ArrowUp,{className:h})})})});cg.displayName="BackTop";var rC=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),nC=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),dg=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"}},defaultVariants:{radius:"sm"}}),Rs=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-xl"}},defaultVariants:{radius:"sm"}}),ug=Z.createContext(null),dn=()=>{let e=Z.useContext(ug);if(!e)throw new Error("Menubar components must be used within a Menubar");return e},mg=Z.createContext(null),la=()=>{let e=Z.useContext(mg);if(!e)throw new Error("Menu components must be used within a MenubarMenu");return e},dl=Z.createContext(null),pg=Z.createContext(null),fg=Z.forwardRef(({className:e,children:t,radius:r="sm",...n},o)=>{let[a,s]=Z.useState(null);return jsx(ug.Provider,{value:{activeMenu:a,setActiveMenu:s,radius:r},children:jsx("div",{ref:o,role:"menubar",className:m("flex h-10 items-center space-x-1 border bg-background p-1",rC({radius:r}),e),...n,children:t})})});fg.displayName="Menubar";var gg=({children:e})=>{let{activeMenu:t,setActiveMenu:r}=dn(),n=Z.useId(),o=Z.useRef(null),a=t===n,s=Z.useCallback(i=>{r(i?n:null);},[n,r]);return jsx(mg.Provider,{value:{menuId:n,triggerRef:o,open:a,onOpenChange:s},children:e})};gg.displayName="MenubarMenu";var bg=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,role:"group",className:e,...t}));bg.displayName="MenubarGroup";var vg=({children:e,container:t})=>{let[r,n]=Z.useState(false);return Z.useEffect(()=>{n(true);},[]),r?Ua.createPortal(e,t||document.body):null};vg.displayName="MenubarPortal";var hg=({children:e,open:t,defaultOpen:r=false,onOpenChange:n})=>{let[o,a]=Z.useState(r),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useCallback(d=>{s||a(d),n?.(d);},[s,n]);return jsx(dl.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};hg.displayName="MenubarSub";var xg=Z.forwardRef(({value:e="",onValueChange:t,className:r,...n},o)=>jsx(pg.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:r,...n})}));xg.displayName="MenubarRadioGroup";var yg=Z.forwardRef(({className:e,onClick:t,onMouseEnter:r,...n},o)=>{let{activeMenu:a,setActiveMenu:s,radius:i}=dn(),{menuId:l,triggerRef:c,open:d,onOpenChange:u}=la(),p=g=>{t?.(g),u(!d);},f=g=>{r?.(g),a&&a!==l&&(s(l),document.activeElement instanceof HTMLElement&&document.activeElement.blur());};return jsx("button",{ref:g=>{c.current=g,typeof o=="function"?o(g):o&&(o.current=g);},type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":d,"data-state":d?"open":"closed",className:m("flex cursor-default select-none items-center px-3 py-1.5 text-sm font-medium outline-none hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",nC({radius:i}),e),onClick:p,onMouseEnter:f,...n})});yg.displayName="MenubarTrigger";var Rg=Z.forwardRef(({className:e,inset:t,children:r,onMouseEnter:n,onMouseLeave:o,...a},s)=>{let{radius:i}=dn(),l=Z.useContext(dl);if(!l)throw new Error("MenubarSubTrigger must be used within MenubarSub");let{open:c,onOpenChange:d,triggerRef:u}=l,p=g=>{n?.(g),d(true);},f=g=>{o?.(g),d(false);};return jsxs("div",{ref:g=>{u.current=g,typeof s=="function"?s(g):s&&(s.current=g);},role:"menuitem","aria-haspopup":"menu","aria-expanded":c,"data-state":c?"open":"closed",className:m("flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",Rs({radius:i}),t&&"pl-8",e),onMouseEnter:p,onMouseLeave:f,...a,children:[r,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Rg.displayName="MenubarSubTrigger";var wg=Z.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:r,onMouseLeave:n,...o},a)=>{let{radius:s}=dn(),i=Z.useContext(dl);if(!i)throw new Error("MenubarSubContent must be used within MenubarSub");let{open:l,onOpenChange:c,triggerRef:d}=i,[u,p]=Z.useState({top:0,left:0}),[f,g]=Z.useState(false),v=Z.useRef(null);Z.useEffect(()=>{g(true);},[]),Z.useEffect(()=>{if(!l||!d.current||!v.current)return;(()=>{if(!d.current||!v.current)return;let R=d.current.getBoundingClientRect(),N=v.current.getBoundingClientRect(),w=R.top,y=R.right+t;y+N.width>window.innerWidth&&(y=R.left-N.width-t),p({top:w,left:y});})();},[l,t,d]);let b=x=>{r?.(x),c(true);},h=x=>{n?.(x),c(false);};return !f||!l?null:Ua.createPortal(jsx("div",{ref:x=>{v.current=x,typeof a=="function"?a(x):a&&(a.current=x);},role:"menu","data-state":l?"open":"closed",className:m("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",dg({radius:s}),e),style:{top:u.top,left:u.left},onMouseEnter:b,onMouseLeave:h,...o}),document.body)});wg.displayName="MenubarSubContent";var Cg=Z.forwardRef(({className:e,align:t="start",alignOffset:r=-4,sideOffset:n=8,children:o,...a},s)=>{let{radius:i}=dn(),{triggerRef:l,open:c,onOpenChange:d}=la(),[u,p]=Z.useState({top:0,left:0}),[f,g]=Z.useState(false),v=Z.useRef(null);return Z.useEffect(()=>{g(true);},[]),Z.useEffect(()=>{if(!c||!l.current||!v.current)return;let b=()=>{if(!l.current||!v.current)return;let h=l.current.getBoundingClientRect(),x=v.current.getBoundingClientRect(),R=h.bottom+n,N=h.left+r;t==="center"?N=h.left+h.width/2-x.width/2:t==="end"&&(N=h.right-x.width-r),p({top:R,left:N});};return b(),window.addEventListener("resize",b),window.addEventListener("scroll",b,true),()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b,true);}},[c,t,r,n,l]),Z.useEffect(()=>{if(!c)return;let b=h=>{let x=h.target;v.current&&!v.current.contains(x)&&l.current&&!l.current.contains(x)&&d(false);};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[c,d,l]),Z.useEffect(()=>{if(!c)return;let b=h=>{h.key==="Escape"&&d(false);};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[c,d]),!f||!c?null:Ua.createPortal(jsx("div",{ref:b=>{v.current=b,typeof s=="function"?s(b):s&&(s.current=b);},role:"menu","data-state":c?"open":"closed",className:m("fixed z-50 min-w-[12rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",dg({radius:i}),e),style:{top:u.top,left:u.left},...a,children:o}),document.body)});Cg.displayName="MenubarContent";var Mg=Z.forwardRef(({className:e,inset:t,isDisabled:r,onSelect:n,onClick:o,...a},s)=>{let{radius:i}=dn(),{onOpenChange:l}=la(),c=d=>{if(r){d.preventDefault();return}o?.(d),n?.(),l(false);};return jsx("div",{ref:s,role:"menuitem",tabIndex:r?-1:0,"aria-disabled":r,"data-disabled":r?"":void 0,className:m("relative flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Rs({radius:i}),t&&"pl-8",!r&&"cursor-pointer",e),onClick:c,...a})});Mg.displayName="MenubarItem";var Tg=Z.forwardRef(({className:e,children:t,checked:r=false,onCheckedChange:n,isDisabled:o,onClick:a,...s},i)=>{let{radius:l}=dn(),{onOpenChange:c}=la(),d=u=>{if(o){u.preventDefault();return}a?.(u),n?.(!r),c(false);};return jsxs("div",{ref:i,role:"menuitemcheckbox","aria-checked":r,tabIndex:o?-1:0,"aria-disabled":o,"data-disabled":o?"":void 0,"data-state":r?"checked":"unchecked",className:m("relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Rs({radius:l}),!o&&"cursor-pointer",e),onClick:d,...s,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r&&jsx(Check,{className:"h-4 w-4"})}),t]})});Tg.displayName="MenubarCheckboxItem";var Ng=Z.forwardRef(({className:e,children:t,value:r,isDisabled:n,onClick:o,...a},s)=>{let{radius:i}=dn(),{onOpenChange:l}=la(),c=Z.useContext(pg),d=c?.value===r,u=p=>{if(n){p.preventDefault();return}o?.(p),c?.onValueChange(r),l(false);};return jsxs("div",{ref:s,role:"menuitemradio","aria-checked":d,tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,"data-state":d?"checked":"unchecked",className:m("relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Rs({radius:i}),!n&&"cursor-pointer",e),onClick:u,...a,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d&&jsx(Circle,{className:"h-2 w-2 fill-current"})}),t]})});Ng.displayName="MenubarRadioItem";var ul=Z.forwardRef(({className:e,inset:t,...r},n)=>jsx("div",{ref:n,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...r}));ul.displayName="MenubarSection";var oC=ul,kg=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,role:"separator",className:m("-mx-1 my-1 h-px bg-muted",e),...t}));kg.displayName="MenubarSeparator";var Sg=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Sg.displayName="MenubarShortcut";var Eg=cva("flex",{variants:{orientation:{horizontal:"flex-row items-center",vertical:"flex-col"},size:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{orientation:"horizontal",size:"md"}}),Pg=Z.forwardRef(({className:e,orientation:t,size:r,currentStep:n=0,children:o,...a},s)=>{let i=Z.Children.toArray(o);return jsx("div",{ref:s,className:m(Eg({orientation:t,size:r,className:e})),...a,children:i.map((l,c)=>Z.isValidElement(l)?Z.cloneElement(l,{...l.props,stepNumber:c+1,status:l.props.status||(c<n?"completed":c===n?"current":"upcoming"),isLast:c===i.length-1,orientation:t,size:r}):l)})});Pg.displayName="Steps";var Lg=cva("flex items-center",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col items-start"},size:{sm:"gap-2",md:"gap-3",lg:"gap-4"}},defaultVariants:{orientation:"horizontal",size:"md"}}),sC=cva("flex items-center justify-center rounded-full font-medium transition-colors",{variants:{status:{completed:"bg-primary text-primary-foreground",current:"bg-primary text-primary-foreground ring-2 ring-primary ring-offset-2 ring-offset-background",upcoming:"bg-muted text-muted-foreground border-2 border-muted-foreground/30"},size:{sm:"h-6 w-6 text-xs",md:"h-8 w-8 text-sm",lg:"h-10 w-10 text-base"}},defaultVariants:{status:"upcoming",size:"md"}}),iC=cva("bg-muted transition-colors",{variants:{orientation:{horizontal:"h-0.5 flex-1 min-w-8",vertical:"w-0.5 min-h-8 ml-4"},status:{completed:"bg-primary",current:"bg-muted",upcoming:"bg-muted"}},defaultVariants:{orientation:"horizontal",status:"upcoming"}}),Dg=Z.forwardRef(({className:e,orientation:t="horizontal",size:r="md",title:n,description:o,icon:a,status:s="upcoming",stepNumber:i,isLast:l,...c},d)=>jsxs("div",{ref:d,className:m(Lg({orientation:t,size:r,className:e}),!l&&t==="horizontal"&&"flex-1"),...c,children:[jsx("div",{className:m("flex items-center",t==="vertical"&&"flex-col items-start"),children:jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:m(sC({status:s,size:r})),children:s==="completed"?jsx(Check,{className:r==="sm"?"h-3 w-3":r==="lg"?"h-5 w-5":"h-4 w-4"}):a||i}),(n||o)&&jsxs("div",{className:"flex flex-col",children:[n&&jsx("span",{className:m("font-medium",r==="sm"&&"text-sm",r==="lg"&&"text-lg",s==="upcoming"&&"text-muted-foreground"),children:n}),o&&jsx("span",{className:m("text-muted-foreground",r==="sm"&&"text-xs",r==="md"&&"text-sm",r==="lg"&&"text-base"),children:o})]})]})}),!l&&jsx("div",{className:m(iC({orientation:t,status:s==="completed"?"completed":"upcoming"}),t==="vertical"&&"my-2")})]}));Dg.displayName="Step";var Ig=cva("flex flex-col select-none",{variants:{variant:{default:"",bordered:"rounded-lg border",filled:"bg-muted/30 rounded-lg p-2"},size:{sm:"[--tree-indent:16px] [--tree-item-height:28px] text-xs",md:"[--tree-indent:20px] [--tree-item-height:32px] text-sm",lg:"[--tree-indent:24px] [--tree-item-height:40px] text-base"}},defaultVariants:{variant:"default",size:"md"}}),Vg=cva("flex items-center py-1.5 px-2 rounded-sm transition-colors",{variants:{size:{sm:"py-1 px-1.5 text-sm min-h-[var(--tree-item-height)]",md:"py-1.5 px-2 text-sm min-h-[var(--tree-item-height)]",lg:"py-2 px-3 text-base min-h-[var(--tree-item-height)]"},isSelected:{true:"bg-primary/10 text-primary",false:""},isDragging:{true:"opacity-50",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed",false:""},isHoverable:{true:"hover:bg-muted/50 cursor-pointer",false:""}},defaultVariants:{size:"md",isSelected:false,isDragging:false,isDisabled:false,isHoverable:true}}),Ag=Z.createContext(null),gC=()=>{let e=Z.useContext(Ag);if(!e)throw new Error("TreeNodeComponent must be used within Tree");return e},bC=({checked:e,indeterminate:t,disabled:r,onClick:n})=>jsx("button",{type:"button",role:"checkbox","aria-checked":t?"mixed":e,disabled:r,onClick:o=>{o.stopPropagation(),r||n(o);},className:m("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",(e||t)&&"bg-primary text-primary-foreground",r&&"cursor-not-allowed opacity-50"),children:(e||t)&&jsx("span",{className:"flex items-center justify-center text-current",children:t?jsx(Minus,{className:"h-3 w-3"}):jsx(Check,{className:"h-3 w-3"})})}),zg=({node:e,level:t,isLast:r=false,parentIsLastPath:n=[]})=>{let{expandedKeys:o,toggleExpand:a,selectedKeys:s,handleSelect:i,selectable:l,checkedKeys:c,halfCheckedKeys:d,handleCheck:u,checkable:p,draggable:f,draggedNode:g,setDraggedNode:v,dragOverKey:b,dragOverPosition:h,setDragOver:x,handleDrop:R,allowDrop:N,onDragStart:w,onDragOver:y,onDragEnter:C,onDragLeave:E,onDragEnd:L,showLine:k,showIcon:S,showHandle:T,dragIcon:M,icon:D,leafIcon:P,folderIcon:I,folderOpenIcon:H,blockNode:A,disabled:B,size:$,getAllKeys:j}=gC(),G=e.children&&e.children.length>0,U=e.isLeaf??!G,W=o.has(e.key),V=s.has(e.key),z=c.has(e.key),K=d.has(e.key),Y=g?.key===e.key,Q=b===e.key,J=!!(B||e.isDisabled),Ne=l&&e.selectable!==false,be=p&&e.checkable!==false,_=Z.useMemo(()=>J?false:typeof f=="boolean"?f:typeof f=="function"?f(e):f&&typeof f=="object"?f.nodeDraggable?f.nodeDraggable(e):true:false,[f,e,J]),O=Z.useMemo(()=>M!==void 0?M:typeof f=="object"&&f.icon!==void 0?f.icon:jsx(GripVertical,{className:"h-4 w-4"}),[M,f]),F=Z.useMemo(()=>e.icon?e.icon:D?typeof D=="function"?D({expanded:W,isLeaf:U}):D:U?P:W?H:I,[e.icon,D,W,U,P,I,H]),q=re=>{if(!_)return;re.stopPropagation(),re.dataTransfer.effectAllowed="move";let oe=re.currentTarget,ke=oe.cloneNode(true),Ft=document.documentElement.classList.contains("dark"),bt=Ft?"#0a0a0a":"#ffffff",eo=Ft?"#27272a":"#e4e4e7";ke.style.cssText=`
|
|
43
|
+
`;return jsxs(Fragment,{children:[jsx("style",{dangerouslySetInnerHTML:{__html:R}}),jsx("div",{ref:c,id:g,onMouseEnter:()=>u(true),onMouseLeave:()=>u(false),style:{...s,...(()=>{if(!r)return {};let w=Sy[o],y=t==="vertical"||t==="both",C=t==="horizontal"||t==="both",E=[y&&p.top&&`linear-gradient(to bottom, transparent, black ${w})`,y&&p.bottom&&`linear-gradient(to top, transparent, black ${w})`,C&&p.left&&`linear-gradient(to right, transparent, black ${w})`,C&&p.right&&`linear-gradient(to left, transparent, black ${w})`].filter(Boolean);return E.length===0?{}:{maskImage:E.join(", "),WebkitMaskImage:E.join(", "),maskComposite:"intersect",WebkitMaskComposite:"source-in"}})()},className:m(t==="vertical"&&"overflow-y-auto overflow-x-hidden",t==="horizontal"&&"overflow-x-auto overflow-y-hidden",t==="both"&&"overflow-auto",e),...i,children:a})]})});ze.displayName="ScrollArea";var Nd=cva("flex w-full cursor-pointer items-center justify-between border border-zinc-300 dark:border-zinc-700 bg-background px-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"min-h-9 py-1.5 text-xs",md:"min-h-10 py-2",lg:"min-h-11 py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",radius:"md"}}),Ir=Z.forwardRef(({options:e,multiple:t=false,value:n,defaultValue:r,onValueChange:o,placeholder:a="Select...",searchable:s=false,searchPlaceholder:i="Search...",emptyText:l="No results found.",isDisabled:c=false,clearable:d=false,maxDisplayItems:u=3,maxDropdownHeight:p=240,size:f,radius:g,className:v,...b},h)=>{let[x,R]=Z.useState(false),[N,w]=Z.useState(""),[y,C]=Z.useState(r||""),[E,L]=Z.useState(r||[]),[k,S]=Z.useState({top:0,left:0,width:0}),[T,M]=Z.useState(-1),D=Z.useRef(null),P=Z.useRef(null),I=Z.useRef(null),H=Z.useRef(null),A=Z.useId(),B=n!==void 0?n:y,$=n!==void 0?n:E,j=n!==void 0,G=_=>{d&&B===_?(j||C(""),o?.("")):(j||C(_),o?.(_)),R(false),w("");},U=_=>{let O=$.includes(_)?$.filter(F=>F!==_):[...$,_];j||L(O),o?.(O);},W=(_,O)=>{O.stopPropagation();let F=$.filter(q=>q!==_);j||L(F),o?.(F);},V=_=>{_.stopPropagation(),t?(j||L([]),o?.([])):(j||C(""),o?.(""));},z=e.find(_=>_.value===B),K=e.filter(_=>$.includes(_.value)),Y=K.slice(0,u),Q=K.length-u,J=s?e.filter(_=>_.label.toLowerCase().includes(N.toLowerCase())):e;Z.useEffect(()=>{if(x&&P.current){let _=P.current.getBoundingClientRect();S({top:_.bottom+4,left:_.left,width:_.width}),s&&setTimeout(()=>H.current?.focus(),0);}x||w("");},[x,s]),Z.useEffect(()=>{let _=O=>{let F=O.target,q=D.current&&!D.current.contains(F),X=I.current&&!I.current.contains(F);q&&X&&(R(false),w(""));};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]),Z.useEffect(()=>{if(!x)return;let _=O=>{I.current?.contains(O.target)||(R(false),w(""));};return window.addEventListener("scroll",_,true),()=>window.removeEventListener("scroll",_,true)},[x]);let Ne=t?$.length>0:!!B,be=_=>{if(!c)switch(_.key){case "Enter":case " ":if(_.preventDefault(),!x)R(true),M(0);else if(T>=0&&J[T]){let O=J[T];O.disabled||(t?U(O.value):G(O.value));}break;case "Escape":_.preventDefault(),R(false),w(""),M(-1);break;case "ArrowDown":_.preventDefault(),x?M(O=>{let F=O+1;return F>=J.length?0:F}):(R(true),M(0));break;case "ArrowUp":_.preventDefault(),x?M(O=>{let F=O-1;return F<0?J.length-1:F}):(R(true),M(J.length-1));break;case "Home":x&&(_.preventDefault(),M(0));break;case "End":x&&(_.preventDefault(),M(J.length-1));break;case "Tab":x&&(R(false),w(""),M(-1));break}};return Z.useEffect(()=>{x||M(-1);},[x]),jsxs("div",{ref:D,className:m("relative",v),...b,children:[jsxs("div",{ref:_=>{P.current=_,typeof h=="function"?h(_):h&&(h.current=_);},role:"combobox",tabIndex:c?-1:0,"aria-expanded":x,"aria-haspopup":"listbox","aria-controls":x?A:void 0,"aria-disabled":c,onClick:()=>!c&&R(!x),onKeyDown:be,className:m(Nd({size:f,radius:g}),t&&"flex-wrap gap-1",c&&"cursor-not-allowed opacity-50","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[!t&&jsx("span",{className:m(!z&&"text-muted-foreground"),children:z?z.label:a}),t&&jsx(Fragment,{children:K.length===0?jsx("span",{className:"text-muted-foreground",children:a}):jsxs(Fragment,{children:[Y.map(_=>jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs font-medium text-secondary-foreground",children:[_.label,jsx("span",{role:"button",tabIndex:0,onClick:O=>W(_.value,O),onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&W(_.value,O);},className:"rounded-full hover:bg-secondary-foreground/20 cursor-pointer",children:jsx(X,{className:"h-3 w-3"})})]},_.value)),Q>0&&jsxs("span",{className:"text-xs text-muted-foreground",children:["+",Q," more"]})]})}),jsxs("div",{className:"ml-auto flex items-center gap-1",children:[d&&Ne&&jsx("span",{role:"button",tabIndex:0,onClick:V,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&V(_);},className:"rounded-full p-0.5 hover:bg-muted cursor-pointer",children:jsx(X,{className:"h-4 w-4 opacity-50"})}),jsx(ChevronDown,{className:m("h-4 w-4 opacity-50 transition-transform",x&&"rotate-180")})]})]}),x&&!c&&typeof document<"u"&&Ua.createPortal(jsxs("div",{ref:I,id:A,role:"listbox","aria-multiselectable":t,className:"fixed z-[9999] overflow-hidden rounded-md border border-zinc-300 dark:border-zinc-700 bg-background shadow-md",style:{top:k.top,left:k.left,minWidth:k.width},children:[s&&jsxs("div",{className:"flex items-center border-b border-zinc-300 dark:border-zinc-700 px-3",children:[jsx(Search,{className:"h-4 w-4 opacity-50 mr-2"}),jsx("input",{ref:H,type:"text",value:N,onChange:_=>w(_.target.value),placeholder:i,className:"flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground"})]}),jsx(ze,{style:{maxHeight:p},onWheel:_=>_.stopPropagation(),children:jsx("div",{className:"p-1",children:J.length===0?jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l}):J.map((_,O)=>{let F=t?$.includes(_.value):B===_.value,q=T===O;return jsxs("div",{role:"option","aria-selected":F,"aria-disabled":_.disabled,onClick:()=>{_.disabled||(t?U(_.value):G(_.value));},onMouseEnter:()=>M(O),className:m("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",q&&"bg-zinc-100 dark:bg-zinc-800",!q&&"hover:bg-zinc-100 dark:hover:bg-zinc-800",_.disabled&&"pointer-events-none opacity-50"),children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:F&&jsx(Check,{className:"h-4 w-4"})}),_.label]},_.value)})})})]}),document.body)]})});Ir.displayName="Select";var kd=Z.createContext(null),Uo=()=>{let e=Z.useContext(kd);if(!e)throw new Error("Dropdown components must be used within a Dropdown");return e},wi=Z.createContext({radius:"md"}),Ci=Z.createContext(null),Zt=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),[s,i]=Z.useState(-1),l=t!==void 0,c=l?t:o,d=Z.useRef(null),u=Z.useRef(null),p=Z.useId(),f=Z.useRef(new Map),g=Z.useCallback(h=>{l||a(h),r?.(h),h||i(-1);},[l,r]),v=Z.useCallback((h,x)=>{f.current.set(h,x);},[]),b=Z.useCallback(h=>{f.current.delete(h);},[]);return jsx(kd.Provider,{value:{open:c,onOpenChange:g,triggerRef:d,contentRef:u,contentId:p,activeIndex:s,setActiveIndex:i,items:f,registerItem:v,unregisterItem:b},children:e})};Zt.displayName="Dropdown";var Jt=Z.forwardRef(({children:e,onClick:t,onKeyDown:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Uo();return jsx("div",{ref:u=>{i.current=u,typeof o=="function"?o(u):o&&(o.current=u);},role:"button",tabIndex:0,"aria-expanded":a,"aria-haspopup":"menu","aria-controls":a?l:void 0,onClick:u=>{t?.(u),s(!a);},onKeyDown:u=>{n?.(u),(u.key==="ArrowDown"||u.key==="ArrowUp")&&(u.preventDefault(),s(true)),(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),s(!a));},className:"inline-flex",...r,children:e})});Jt.displayName="DropdownTrigger";var Ay={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-2xl"},Qt=Z.forwardRef(({className:e,side:t="bottom",sideOffset:n=4,align:r="start",alignOffset:o=0,collisionPadding:a=8,onInteractOutside:s,onEscapeKeyDown:i,loop:l=true,radius:c="md",children:d,...u},p)=>{let{open:f,onOpenChange:g,triggerRef:v,contentRef:b,contentId:h,activeIndex:x,setActiveIndex:R,items:N}=Uo(),[w,y]=Z.useState({top:0,left:0}),[C,E]=Z.useState(t),[L,k]=Z.useState(false),S=Z.useRef(0);if(Z.useEffect(()=>{k(true);},[]),Z.useEffect(()=>{f&&(S.current=N.current.size);},[f,N]),Z.useEffect(()=>{if(!f||!v.current||!b.current)return;let M=()=>{if(!v.current||!b.current)return;let D=v.current.getBoundingClientRect(),P=b.current.getBoundingClientRect(),I=window.innerWidth,H=window.innerHeight,A=0,B=0,$=t;switch(t){case "top":A=D.top-P.height-n,A<a&&(A=D.bottom+n,$="bottom");break;case "bottom":A=D.bottom+n,A+P.height>H-a&&(A=D.top-P.height-n,$="top");break;case "left":B=D.left-P.width-n,B<a&&(B=D.right+n,$="right");break;case "right":B=D.right+n,B+P.width>I-a&&(B=D.left-P.width-n,$="left");break}if($==="top"||$==="bottom"){switch(r){case "start":B=D.left+o;break;case "center":B=D.left+D.width/2-P.width/2;break;case "end":B=D.right-P.width-o;break}B<a?B=a:B+P.width>I-a&&(B=I-P.width-a);}else {switch(r){case "start":A=D.top+o;break;case "center":A=D.top+D.height/2-P.height/2;break;case "end":A=D.bottom-P.height-o;break}A<a?A=a:A+P.height>H-a&&(A=H-P.height-a);}y({top:A,left:B}),E($);};return M(),window.addEventListener("resize",M),window.addEventListener("scroll",M,true),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,true);}},[f,t,n,r,o,a,v]),Z.useEffect(()=>{if(!f)return;let M=D=>{let P=D.target;b.current&&!b.current.contains(P)&&v.current&&!v.current.contains(P)&&(s?.(),g(false));};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[f,g,s,v,b]),Z.useEffect(()=>{if(!f)return;let M=D=>{let P=Array.from(N.current.entries()).sort(([H],[A])=>H-A).map(([,H])=>H),I=P.length;if(I!==0)switch(D.key){case "Escape":D.preventDefault(),i?.(),g(false),v.current?.focus();break;case "ArrowDown":D.preventDefault(),x===-1||x>=I-1?R(l?0:Math.min(x+1,I-1)):R(x+1);break;case "ArrowUp":D.preventDefault(),x<=0?R(l?I-1:0):R(x-1);break;case "Home":D.preventDefault(),R(0);break;case "End":D.preventDefault(),R(I-1);break;case "Enter":case " ":D.preventDefault(),x>=0&&x<I&&P[x]?.click();break;case "Tab":g(false);break}};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[f,g,i,x,R,N,l,v]),Z.useEffect(()=>{f&&x>=0&&Array.from(N.current.entries()).sort(([D],[P])=>D-P).map(([,D])=>D)[x]?.focus();},[f,x,N]),!L||!f)return null;let T={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"}[C];return Ua.createPortal(jsx("div",{ref:M=>{b.current=M,typeof p=="function"?p(M):p&&(p.current=M);},id:h,role:"menu","aria-orientation":"vertical","data-state":f?"open":"closed","data-side":C,"data-dropdown-content":"",className:m("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md outline-none",Ay[c],T,e),style:{top:w.top,left:w.left},...u,children:jsx(wi.Provider,{value:{radius:c},children:d})}),document.body)});Qt.displayName="DropdownContent";var Sd=0,Ed={none:"rounded-none",sm:"rounded-sm",md:"rounded-sm",lg:"rounded-md",full:"rounded-lg"},Et=Z.forwardRef(({className:e,inset:t,isDisabled:n,onSelect:r,onClick:o,onMouseEnter:a,startContent:s,endContent:i,children:l,...c},d)=>{let{onOpenChange:u,activeIndex:p,setActiveIndex:f,registerItem:g,unregisterItem:v}=Uo(),{radius:b}=Z.useContext(wi),[h]=Z.useState(()=>Sd++),x=Z.useRef(null);Z.useEffect(()=>(!n&&x.current&&g(h,x.current),()=>{v(h);}),[n,h,g,v]);let R=y=>{if(n){y.preventDefault();return}o?.(y),r?.(),u(false);},N=y=>{a?.(y),n||f(h);};return jsxs("div",{ref:y=>{x.current=y,typeof d=="function"?d(y):d&&(d.current=y);},role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,"data-highlighted":p===h?"":void 0,className:m("relative flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Ed[b],t&&"pl-8",!n&&"cursor-pointer",e),onClick:R,onMouseEnter:N,...c,children:[s,l&&jsx("span",{className:"flex-1",children:l}),i]})});Et.displayName="DropdownItem";var Mi=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));Mi.displayName="DropdownSection";var Pd=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-muted",e),...t}));Pd.displayName="DropdownSeparator";var Ld=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest opacity-60",e),...t});Ld.displayName="DropdownShortcut";var Dd=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Dd.displayName="DropdownGroup";var Hd=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),{contentRef:s}=Uo(),i=t!==void 0,l=i?t:o,c=Z.useRef(null),d=Z.useCallback(u=>{i||a(u),r?.(u);},[i,r]);return jsx(Ci.Provider,{value:{open:l,onOpenChange:d,triggerRef:c,parentMenuRef:s},children:e})};Hd.displayName="DropdownSub";var Id=Z.forwardRef(({className:e,inset:t,isDisabled:n,children:r,onMouseEnter:o,onMouseLeave:a,onKeyDown:s,...i},l)=>{let c=Z.useContext(Ci),{setActiveIndex:d,registerItem:u,unregisterItem:p}=Uo(),{radius:f}=Z.useContext(wi),[g]=Z.useState(()=>Sd++),v=Z.useRef(null);if(!c)throw new Error("DropdownSubTrigger must be used within DropdownSub");let{open:b,onOpenChange:h,triggerRef:x}=c;Z.useEffect(()=>(!n&&v.current&&u(g,v.current),()=>{p(g);}),[n,g,u,p]);let R=y=>{o?.(y),n||(d(g),h(true));},N=y=>{a?.(y);},w=y=>{s?.(y),(y.key==="ArrowRight"||y.key==="Enter"||y.key===" ")&&(y.preventDefault(),h(true));};return jsxs("div",{ref:y=>{v.current=y,x.current=y,typeof l=="function"?l(y):l&&(l.current=y);},role:"menuitem","aria-haspopup":"menu","aria-expanded":b,tabIndex:n?-1:0,"aria-disabled":n,"data-state":b?"open":"closed","data-disabled":n?"":void 0,className:m("flex cursor-default select-none items-center gap-2 px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-accent focus:text-accent-foreground","data-[state=open]:bg-accent","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Ed[f],t&&"pl-8",!n&&"cursor-pointer",e),onMouseEnter:R,onMouseLeave:N,onKeyDown:w,...i,children:[r,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Id.displayName="DropdownSubTrigger";var Vd=Z.forwardRef(({className:e,sideOffset:t=2,alignOffset:n=-4,collisionPadding:r=8,onMouseEnter:o,onMouseLeave:a,...s},i)=>{let l=Z.useContext(Ci);if(!l)throw new Error("DropdownSubContent must be used within DropdownSub");let{open:c,onOpenChange:d,triggerRef:u,parentMenuRef:p}=l,[f,g]=Z.useState({top:0,left:0}),[v,b]=Z.useState(false),h=Z.useRef(null),x=Z.useRef(null);Z.useEffect(()=>{b(true);},[]),Z.useEffect(()=>{if(!c||!u.current||!h.current)return;(()=>{if(!u.current||!h.current)return;let y=u.current.getBoundingClientRect(),C=h.current.getBoundingClientRect(),E=window.innerWidth,L=window.innerHeight,k=y.top+n,S=y.right+t;S+C.width>E-r&&(S=y.left-C.width-t),k+C.height>L-r&&(k=L-C.height-r),k<r&&(k=r),g({top:k,left:S});})();},[c,t,n,r,u]);let R=w=>{o?.(w),x.current&&(clearTimeout(x.current),x.current=null),d(true);},N=w=>{a?.(w);let y=w.relatedTarget;u.current?.contains(y)||p?.current?.contains(y)||(x.current=setTimeout(()=>{d(false);},100));};return Z.useEffect(()=>()=>{x.current&&clearTimeout(x.current);},[]),!v||!c?null:Ua.createPortal(jsx("div",{ref:w=>{h.current=w,typeof i=="function"?i(w):i&&(i.current=w);},role:"menu","data-state":c?"open":"closed",className:m("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",e),style:{top:f.top,left:f.left},onMouseEnter:R,onMouseLeave:N,...s}),document.body)});Vd.displayName="DropdownSubContent";var zy=Mi;var Od=Z.createContext(null),Ti=()=>{let e=Z.useContext(Od);if(!e)throw new Error("Popover components must be used within a Popover");return e},Pt=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useId(),d=Z.useCallback(u=>{s||a(u),r?.(u);},[s,r]);return jsx(Od.Provider,{value:{open:i,onOpenChange:d,triggerRef:l,contentId:c},children:e})};Pt.displayName="Popover";var tr=Z.forwardRef(({children:e,onClick:t,asChild:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i,contentId:l}=Ti(),c=p=>{t?.(p),s(!a);},d=p=>{i.current=p,typeof o=="function"?o(p):o&&(o.current=p);},u={"aria-expanded":a,"aria-haspopup":"dialog","aria-controls":a?l:void 0,onClick:c,...r};return n&&Z.isValidElement(e)?Z.cloneElement(e,{...u,ref:d,onClick:p=>{e.props.onClick?.(p),c(p);}}):jsx("button",{ref:d,type:"button",...u,children:e})});tr.displayName="PopoverTrigger";var nr=Z.forwardRef(({children:e,...t},n)=>{let{triggerRef:r}=Ti();return jsx("div",{ref:o=>{r.current=o,typeof n=="function"?n(o):n&&(n.current=o);},...t,children:e})});nr.displayName="PopoverAnchor";var Lt=Z.forwardRef(({className:e,style:t,side:n="bottom",sideOffset:r=4,align:o="center",alignOffset:a=0,onInteractOutside:s,onEscapeKeyDown:i,onOpenAutoFocus:l,onCloseAutoFocus:c,children:d,...u},p)=>{let{open:f,onOpenChange:g,triggerRef:v,contentId:b}=Ti(),[h,x]=Z.useState({top:0,left:0}),[R,N]=Z.useState(false),[w,y]=Z.useState(null);if(Z.useEffect(()=>{N(true);},[]),Z.useEffect(()=>{if(!f||!v.current||!w)return;let E=()=>{if(!v.current||!w)return;let L=v.current.getBoundingClientRect(),k=w.getBoundingClientRect(),S=0,T=0;switch(n){case "top":S=L.top-k.height-r;break;case "bottom":S=L.bottom+r;break;case "left":T=L.left-k.width-r;break;case "right":T=L.right+r;break}if(n==="top"||n==="bottom")switch(o){case "start":T=L.left+a;break;case "center":T=L.left+L.width/2-k.width/2;break;case "end":T=L.right-k.width-a;break}else switch(o){case "start":S=L.top+a;break;case "center":S=L.top+L.height/2-k.height/2;break;case "end":S=L.bottom-k.height-a;break}x({top:S,left:T});};return E(),window.addEventListener("resize",E),window.addEventListener("scroll",E,true),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,true);}},[f,n,r,o,a,v,w]),Z.useEffect(()=>{if(!f)return;let E=L=>{let k=L.target;w&&w.contains(k)||v.current&&v.current.contains(k)||k.closest?.("[data-dropdown-content], [data-popover-content]")||(s?.(),g(false));};return document.addEventListener("mouseup",E),()=>document.removeEventListener("mouseup",E)},[f,g,s,v,w]),Z.useEffect(()=>{if(!f)return;let E=L=>{L.key==="Escape"&&(i?.(),g(false));};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[f,g,i]),!R||!f)return null;let C={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"}[n];return Ua.createPortal(jsx("div",{ref:E=>{y(L=>L!==E?E:L),typeof p=="function"?p(E):p&&(p.current=E);},id:b,role:"dialog","data-state":f?"open":"closed","data-side":n,className:m("fixed z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",C,e),style:{...t,top:h.top,left:h.left},...u,children:d}),document.body)});Lt.displayName="PopoverContent";var Fd=Z.createContext(null),ki=()=>{let e=Z.useContext(Fd);if(!e)throw new Error("Tabs components must be used within a Tabs");return e},Bd=Z.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,variant:o="solid",radius:a="md",orientation:s="horizontal",children:i,...l},c)=>{let[d,u]=Z.useState(n),p=t!==void 0,f=p?t:d,g=Z.useId(),v=x=>{p||u(x),r?.(x);},b=Z.useCallback(x=>`${g}-trigger-${x}`,[g]),h=Z.useCallback(x=>`${g}-panel-${x}`,[g]);return jsx(Fd.Provider,{value:{value:f,onValueChange:v,variant:o,radius:a,orientation:s,baseId:g,getTriggerId:b,getPanelId:h},children:jsx("div",{ref:c,"data-orientation":s,className:m(s==="vertical"&&"flex gap-4",e),...l,children:i})})});Bd.displayName="Tabs";var Ni={none:{list:"rounded-none",trigger:"rounded-none",indicator:"rounded-none"},sm:{list:"rounded-md",trigger:"rounded-sm",indicator:"rounded-sm"},md:{list:"rounded-lg",trigger:"rounded-md",indicator:"rounded-md"},lg:{list:"rounded-xl",trigger:"rounded-lg",indicator:"rounded-lg"},full:{list:"rounded-full",trigger:"rounded-full",indicator:"rounded-full"}},$d=Z.forwardRef(({className:e,children:t,...n},r)=>{let{variant:o,radius:a,orientation:s,value:i}=ki(),l=Z.useRef(null),[c,d]=Z.useState({opacity:0});Z.useEffect(()=>{let g=l.current;if(!g)return;let v=()=>{let h=g.querySelector('[data-state="active"]');if(h){let x=g.getBoundingClientRect(),R=h.getBoundingClientRect(),N=s==="vertical";o==="underline"?d(N?{width:2,height:R.height,transform:`translateY(${R.top-x.top}px)`,opacity:1}:{width:R.width,height:2,transform:`translateX(${R.left-x.left}px)`,opacity:1}):o==="solid"&&d(N?{width:R.width,height:R.height,transform:`translateY(${R.top-x.top}px)`,opacity:1}:{width:R.width,height:R.height,transform:`translateX(${R.left-x.left}px)`,opacity:1});}};v();let b=new ResizeObserver(v);return b.observe(g),()=>{b.disconnect();}},[o,s,i]);let u={solid:"bg-muted p-1",underline:"border-b border-border bg-transparent p-0 !rounded-none",bordered:"bg-transparent p-0 gap-1 !rounded-none"},p=s==="vertical",f=()=>o==="solid"?p?"top-0 left-1 bg-background shadow":"top-1 left-1 bg-background shadow":o==="underline"?p?"top-0 left-0 bg-primary !rounded-full":"bottom-0 left-0 bg-primary !rounded-full":"";return jsxs("div",{ref:g=>{l.current=g,typeof r=="function"?r(g):r&&(r.current=g);},role:"tablist","aria-orientation":s,className:m("relative inline-flex h-9 items-center justify-center text-muted-foreground",p&&"flex-col h-auto w-auto",Ni[a].list,u[o],e),...n,children:[(o==="solid"||o==="underline")&&jsx("span",{className:m("absolute transition-all duration-200 ease-out",Ni[a].indicator,f()),style:c,"aria-hidden":"true"}),t]})});$d.displayName="TabsList";var Kd=Z.forwardRef(({className:e,value:t,disabled:n,onClick:r,...o},a)=>{let{value:s,onValueChange:i,variant:l,radius:c,getTriggerId:d,getPanelId:u}=ki(),p=s===t,f={solid:"data-[state=active]:text-foreground",underline:"!rounded-none border-b-2 border-transparent pb-2 data-[state=active]:text-foreground",bordered:"border border-transparent data-[state=active]:border-current data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"};return jsx("button",{type:"button",role:"tab",ref:a,id:d(t),"aria-selected":p,"aria-controls":u(t),tabIndex:p?0:-1,"data-state":p?"active":"inactive",disabled:n,className:m("relative z-10 inline-flex items-center justify-center whitespace-nowrap px-3 py-1 text-sm font-medium ring-offset-background transition-all 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",Ni[c].trigger,f[l],e),onClick:g=>{r?.(g),i(t);},...o})});Kd.displayName="TabsTrigger";var Gd=Z.forwardRef(({className:e,value:t,children:n,...r},o)=>{let{value:a,getTriggerId:s,getPanelId:i}=ki(),l=a===t;return l?jsx("div",{ref:o,role:"tabpanel",id:i(t),"aria-labelledby":s(t),tabIndex:0,"data-state":l?"active":"inactive",className:m("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...r,children:n}):null});Gd.displayName="TabsContent";var $y=({theme:e="system",...t})=>jsx(Toaster,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t});var Ud=Z.createContext(null),_a=()=>{let e=Z.useContext(Ud);if(!e)throw new Error("ContextMenu components must be used within a ContextMenu");return e},Si=Z.createContext(null),_d=({children:e,onOpenChange:t})=>{let[n,r]=Z.useState(false),[o,a]=Z.useState({x:0,y:0}),s=Z.useId(),i=Z.useCallback(l=>{r(l),t?.(l);},[t]);return jsx(Ud.Provider,{value:{open:n,onOpenChange:i,position:o,setPosition:a,contentId:s},children:e})};_d.displayName="ContextMenu";var jd=Z.forwardRef(({children:e,onContextMenu:t,...n},r)=>{let{onOpenChange:o,setPosition:a}=_a(),s=i=>{i.preventDefault(),a({x:i.clientX,y:i.clientY}),o(true);};return jsx("div",{ref:r,onContextMenu:i=>{t?.(i),s(i);},...n,children:e})});jd.displayName="ContextMenuTrigger";var Wd=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));Wd.displayName="ContextMenuGroup";var Yd=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?Ua.createPortal(e,t||document.body):null};Yd.displayName="ContextMenuPortal";var qd=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(Si.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};qd.displayName="ContextMenuSub";var Xd=Z.forwardRef(({className:e,onInteractOutside:t,onEscapeKeyDown:n,children:r,...o},a)=>{let{open:s,onOpenChange:i,position:l,contentId:c}=_a(),[d,u]=Z.useState(false),[p,f]=Z.useState(l),g=Z.useRef(null);return Z.useEffect(()=>{u(true);},[]),Z.useEffect(()=>{if(!s||!g.current){f(l);return}let b=g.current.getBoundingClientRect(),{x:h,y:x}=l;h+b.width>window.innerWidth&&(h=window.innerWidth-b.width-8),x+b.height>window.innerHeight&&(x=window.innerHeight-b.height-8),f({x:h,y:x});},[s,l]),Z.useEffect(()=>{if(!s)return;let v=b=>{let h=b.target;g.current&&!g.current.contains(h)&&(t?.(),i(false));};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[s,i,t]),Z.useEffect(()=>{if(!s)return;let v=b=>{b.key==="Escape"&&(n?.(),i(false));};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[s,i,n]),!d||!s?null:Ua.createPortal(jsx("div",{ref:v=>{g.current=v,typeof a=="function"?a(v):a&&(a.current=v);},id:c,role:"menu","aria-orientation":"vertical","data-state":s?"open":"closed",className:m("fixed z-50 max-h-[calc(100vh-2rem)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-1 text-zinc-950 dark:text-zinc-50 shadow-md","animate-in fade-in-0 zoom-in-95",e),style:{top:p.y,left:p.x},...o,children:r}),document.body)});Xd.displayName="ContextMenuContent";var Zd=Z.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let i=Z.useContext(Si);if(!i)throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");let{open:l,onOpenChange:c,triggerRef:d}=i,u=f=>{r?.(f),c(true);},p=f=>{o?.(f),c(false);};return jsxs("div",{ref:f=>{d.current=f,typeof s=="function"?s(f):s&&(s.current=f);},role:"menuitem","aria-haspopup":"menu","aria-expanded":l,"data-state":l?"open":"closed",className:m("flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[state=open]:bg-zinc-100 dark:data-[state=open]:bg-zinc-800",t&&"pl-8",e),onMouseEnter:u,onMouseLeave:p,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Zd.displayName="ContextMenuSubTrigger";var Jd=Z.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let s=Z.useContext(Si);if(!s)throw new Error("ContextMenuSubContent must be used within ContextMenuSub");let{open:i,onOpenChange:l,triggerRef:c}=s,[d,u]=Z.useState({top:0,left:0}),[p,f]=Z.useState(false),g=Z.useRef(null);Z.useEffect(()=>{f(true);},[]),Z.useEffect(()=>{if(!i||!c.current||!g.current)return;(()=>{if(!c.current||!g.current)return;let x=c.current.getBoundingClientRect(),R=g.current.getBoundingClientRect(),N=x.top,w=x.right+t;w+R.width>window.innerWidth&&(w=x.left-R.width-t),u({top:N,left:w});})();},[i,t,c]);let v=h=>{n?.(h),l(true);},b=h=>{r?.(h),l(false);};return !p||!i?null:Ua.createPortal(jsx("div",{ref:h=>{g.current=h,typeof a=="function"?a(h):a&&(a.current=h);},role:"menu","data-state":i?"open":"closed",className:m("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-1 text-zinc-950 dark:text-zinc-50 shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",e),style:{top:d.top,left:d.left},onMouseEnter:v,onMouseLeave:b,...o}),document.body)});Jd.displayName="ContextMenuSubContent";var Qd=Z.forwardRef(({className:e,inset:t,isDisabled:n,onSelect:r,onClick:o,...a},s)=>{let{onOpenChange:i}=_a(),l=c=>{if(n){c.preventDefault();return}o?.(c),r?.(),i(false);};return jsx("div",{ref:s,role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,className:m("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",t&&"pl-8",e),onClick:l,...a})});Qd.displayName="ContextMenuItem";var eu=Z.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,isDisabled:o,onClick:a,...s},i)=>{let{onOpenChange:l}=_a(),c=d=>{if(o){d.preventDefault();return}a?.(d),r?.(!n),l(false);};return jsxs("div",{ref:i,role:"menuitemcheckbox","aria-checked":n,tabIndex:o?-1:0,"aria-disabled":o,"data-disabled":o?"":void 0,"data-state":n?"checked":"unchecked",className:m("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-zinc-100 dark:hover:bg-zinc-800 focus:bg-zinc-100 dark:focus:bg-zinc-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed",e),onClick:c,...s,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n&&jsx(Check,{className:"h-4 w-4"})}),t]})});eu.displayName="ContextMenuCheckboxItem";var tu=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));tu.displayName="ContextMenuSection";var nu=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-border",e),...t}));nu.displayName="ContextMenuSeparator";var ru=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});ru.displayName="ContextMenuShortcut";var su=Z.createContext(null),jy=()=>{let e=Z.useContext(su);if(!e)throw new Error("Radio components must be used within a RadioGroup");return e},iu=Z.createContext(null),Wa=()=>{let e=Z.useContext(iu);if(!e)throw new Error("Radio.* components must be used within a Radio");return e},jo={sm:{control:"h-3.5 w-3.5",indicator:"h-1.5 w-1.5",label:"text-sm",description:"text-xs",gap:"gap-2"},md:{control:"h-4 w-4",indicator:"h-2 w-2",label:"text-sm",description:"text-xs",gap:"gap-2.5"},lg:{control:"h-5 w-5",indicator:"h-2.5 w-2.5",label:"text-base",description:"text-sm",gap:"gap-3"}},ja={default:{border:"border-input",borderChecked:"border-foreground",indicator:"bg-foreground",ring:"ring-foreground/20"},success:{border:"border-input",borderChecked:"border-green-500",indicator:"bg-green-500",ring:"ring-green-500/20"},warning:{border:"border-input",borderChecked:"border-yellow-500",indicator:"bg-yellow-500",ring:"ring-yellow-500/20"},danger:{border:"border-input",borderChecked:"border-red-500",indicator:"bg-red-500",ring:"ring-red-500/20"}},lu=Z.forwardRef(({className:e,value:t,defaultValue:n="",onValueChange:r,name:o,isDisabled:a,required:s,orientation:i="vertical",size:l="md",color:c="default",children:d,...u},p)=>{let[f,g]=Z.useState(n),v=t!==void 0,b=v?t:f,h=Z.useId(),x=R=>{v||g(R),r?.(R);};return jsx("div",{ref:p,role:"radiogroup","aria-required":s,"aria-orientation":i,className:m(i==="vertical"?"flex flex-col gap-2":"flex flex-row flex-wrap gap-4",e),...u,children:jsx(su.Provider,{value:{name:o||h,value:b,onValueChange:x,isDisabled:a,required:s,size:l,color:c},children:d})})});lu.displayName="RadioGroup";var Pi=Z.forwardRef(({className:e,value:t,isDisabled:n,children:r,...o},a)=>{let s=jy(),[i,l]=Z.useState(false),c=s.value===t,d=n||s.isDisabled,u=()=>{d||s.onValueChange(t);},p=jo[s.size||"md"];return jsx(iu.Provider,{value:{value:t,isChecked:c,isDisabled:d||false,isFocused:i,setIsFocused:l,onSelect:u,size:s.size||"md",color:s.color||"default"},children:jsxs("label",{ref:a,className:m("flex items-center cursor-pointer select-none",p.gap,d&&"cursor-not-allowed opacity-50",e),...o,children:[r,jsx("input",{type:"radio","aria-hidden":true,tabIndex:-1,name:s.name,value:t,checked:c,required:s.required,disabled:d,onChange:()=>{},className:"sr-only"})]})})});Pi.displayName="Radio";var Li=Z.forwardRef(({className:e,children:t},n)=>{let{isChecked:r,isDisabled:o,isFocused:a,setIsFocused:s,onSelect:i,size:l,color:c}=Wa(),d=jo[l],u=!(c in ja),p=u?null:ja[c],f=u?{borderColor:r?c:void 0,boxShadow:a?`0 0 0 2px ${c}33`:void 0}:void 0;return jsx(motion.button,{ref:n,type:"button",role:"radio","aria-checked":r,disabled:o,onClick:i,onFocus:()=>s(true),onBlur:()=>s(false),style:f,className:m("relative flex items-center justify-center rounded-full border-2 transition-colors duration-200","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",d.control,p&&(r?p.borderChecked:p.border),p&&a&&p.ring,!u&&!r&&"border-input",o?"cursor-not-allowed":"cursor-pointer",e),whileTap:o?void 0:{scale:.95},animate:r?{scale:[1,1.1,1]}:void 0,transition:{duration:.2},children:t||jsx(Di,{})})});Li.displayName="RadioControl";var Di=Z.forwardRef(({className:e,forceMount:t},n)=>{let{isChecked:r,size:o,color:a}=Wa(),s=jo[o],i=!(a in ja),l=i?null:ja[a],c=i?{backgroundColor:a}:void 0;return jsx(AnimatePresence,{children:(t||r)&&jsx(motion.span,{ref:n,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:"spring",stiffness:500,damping:30},style:c,className:m("rounded-full",s.indicator,l?.indicator,e)})})});Di.displayName="RadioIndicator";var Hi=Z.forwardRef(({className:e,children:t,...n},r)=>{let{size:o,isDisabled:a}=Wa(),s=jo[o];return jsx("span",{ref:r,className:m("font-medium leading-none",s.label,a&&"text-muted-foreground",e),...n,children:t})});Hi.displayName="RadioLabel";var Ii=Z.forwardRef(({className:e,children:t,...n},r)=>{let{size:o}=Wa(),a=jo[o];return jsx("span",{ref:r,className:m("text-muted-foreground leading-snug",a.description,e),...n,children:t})});Ii.displayName="RadioDescription";var Vi=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:m("flex flex-col",e),...n,children:t}));Vi.displayName="RadioContent";var cu=Z.forwardRef(({value:e,label:t,description:n,isDisabled:r,className:o,...a},s)=>jsxs(Pi,{ref:s,value:e,isDisabled:r,className:o,...a,children:[jsx(Li,{}),(t||n)&&jsxs(Vi,{children:[t&&jsx(Hi,{children:t}),n&&jsx(Ii,{children:n})]})]}));cu.displayName="RadioGroupItem";var qa=cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",{variants:{variant:{solid:"bg-secondary hover:bg-secondary/80 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",bordered:"border border-input bg-transparent hover:bg-accent data-[state=on]:border-primary data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",flat:"bg-secondary/50 hover:bg-secondary data-[state=on]:bg-primary/15 data-[state=on]:text-primary"},size:{sm:"h-9 px-2.5 min-w-9",md:"h-10 px-3 min-w-10",lg:"h-11 px-5 min-w-11"}},defaultVariants:{variant:"solid",size:"md"}}),du=Z.forwardRef(({className:e,variant:t,size:n,pressed:r,defaultPressed:o=false,onPressedChange:a,isDisabled:s,onKeyDown:i,...l},c)=>{let[d,u]=Z.useState(o),p=r!==void 0,f=p?r:d,g=()=>{if(s)return;let b=!f;p||u(b),a?.(b);},v=b=>{b.key==="Enter"&&b.preventDefault(),i?.(b);};return jsx("button",{type:"button","aria-pressed":f,"data-state":f?"on":"off",disabled:s,ref:c,className:m(qa({variant:t,size:n,className:e})),onClick:g,onKeyDown:v,...l})});du.displayName="Toggle";var uu=Z.createContext(null),qy=()=>{let e=Z.useContext(uu);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e},mu=Z.forwardRef(({className:e,variant:t,size:n,type:r,value:o,defaultValue:a,onValueChange:s,isDisabled:i,children:l,...c},d)=>{let[u,p]=Z.useState(()=>r==="single"?a?[a]:[]:a||[]),f=o!==void 0,g=f?r==="single"?o?[o]:[]:o:u,v=b=>{if(r==="single"){let h=g.includes(b)?[]:[b];f||p(h),s?.(h[0]||"");}else {let h=g.includes(b)?g.filter(x=>x!==b):[...g,b];f||p(h),s?.(h);}};return jsx(uu.Provider,{value:{type:r,variant:t,size:n,value:g,onValueChange:v,isDisabled:i},children:jsx("div",{ref:d,role:"group",className:m("inline-flex","[&>*:not(:first-child):not(:last-child)]:rounded-none","[&>*:first-child]:rounded-r-none","[&>*:last-child]:rounded-l-none","[&>*:not(:first-child)]:-ml-px",e),...c,children:l})})});mu.displayName="ToggleGroup";var pu=Z.forwardRef(({className:e,children:t,variant:n,size:r,value:o,disabled:a,...s},i)=>{let l=qy(),c=l.value.includes(o),d=a||l.isDisabled;return jsx("button",{type:"button",role:"radio","aria-checked":c,"aria-pressed":c,"data-state":c?"on":"off",disabled:d,ref:i,className:m(qa({variant:l.variant||n,size:l.size||r}),e),onClick:()=>l.onValueChange(o),...s,children:t})});pu.displayName="ToggleGroupItem";var Xy={sm:{track:"h-1",thumb:"h-4 w-4",thumbOffset:"8px"},md:{track:"h-2",thumb:"h-5 w-5",thumbOffset:"10px"},lg:{track:"h-3",thumb:"h-6 w-6",thumbOffset:"12px"}},en=Z.forwardRef(({className:e,value:t,defaultValue:n=[0],onValueChange:r,onValueCommit:o,min:a=0,max:s=100,step:i=1,isDisabled:l=false,orientation:c="horizontal",trackColor:d,color:u="default",size:p="md",label:f,name:g,...v},b)=>{let h=d||u,[x,R]=Z.useState(n),N=t!==void 0,w=N?t:x,y=Z.useRef(null),[C,E]=Z.useState(false),[L,k]=Z.useState(null),S=(V,z)=>{if(!y.current)return w[0];let K=y.current.getBoundingClientRect(),Y;c==="horizontal"?Y=(V-K.left)/K.width:Y=1-(z-K.top)/K.height,Y=Math.max(0,Math.min(1,Y));let Q=a+Y*(s-a),J=Math.round(Q/i)*i;return Math.max(a,Math.min(s,J))},T=(V,z)=>{let K=[...w];K[z]=V,z>0&&V<w[z-1]&&(K[z]=w[z-1]),z<w.length-1&&V>w[z+1]&&(K[z]=w[z+1]),N||R(K),r?.(K);},M=(V,z)=>{l||(V.preventDefault(),E(true),k(z),V.target.setPointerCapture(V.pointerId));},D=V=>{if(!C||L===null||l)return;let z=S(V.clientX,V.clientY);T(z,L);},P=()=>{C&&(E(false),k(null),o?.(w));},I=V=>{if(l)return;let z=S(V.clientX,V.clientY),K=0,Y=Math.abs(w[0]-z);for(let Q=1;Q<w.length;Q++){let J=Math.abs(w[Q]-z);J<Y&&(Y=J,K=Q);}T(z,K),o?.([...w.slice(0,K),z,...w.slice(K+1)]);},H=(V,z)=>{if(l)return;let K=w[z];switch(V.key){case "ArrowRight":case "ArrowUp":V.preventDefault(),K=Math.min(s,w[z]+i);break;case "ArrowLeft":case "ArrowDown":V.preventDefault(),K=Math.max(a,w[z]-i);break;case "Home":V.preventDefault(),K=a;break;case "End":V.preventDefault(),K=s;break;default:return}T(K,z),o?.([...w.slice(0,z),K,...w.slice(z+1)]);},A=V=>(V-a)/(s-a)*100,B={default:{track:"bg-primary",thumb:"border-primary"},primary:{track:"bg-primary",thumb:"border-primary"},success:{track:"bg-green-500",thumb:"border-green-500"},warning:{track:"bg-yellow-500",thumb:"border-yellow-500"},danger:{track:"bg-red-500",thumb:"border-red-500"}},$=Xy[p],j=!(h in B),G=j?null:B[h],U=j?{backgroundColor:h}:void 0,W=j?{borderColor:h}:void 0;return jsxs("div",{ref:b,className:m("w-full",e),...v,children:[f&&jsx("div",{className:"mb-2 text-sm font-medium",children:f}),jsxs("div",{className:m("relative flex touch-none select-none items-center",c==="vertical"&&"flex-col h-full w-5",l&&"opacity-50 pointer-events-none"),children:[jsx("div",{ref:y,className:m("relative grow overflow-hidden rounded-full bg-secondary",c==="horizontal"?[$.track,"w-full"]:["h-full","w-2"]),onClick:I,children:jsx("div",{className:m("absolute",G?.track),style:c==="horizontal"?{left:w.length>1?`${A(w[0])}%`:0,right:`${100-A(w[w.length-1])}%`,top:0,bottom:0,...U}:{bottom:w.length>1?`${A(w[0])}%`:0,top:`${100-A(w[w.length-1])}%`,left:0,right:0,...U}})}),w.map((V,z)=>jsx("div",{role:"slider",tabIndex:l?-1:0,"aria-valuemin":a,"aria-valuemax":s,"aria-valuenow":V,"aria-orientation":c,"aria-disabled":l,className:m("absolute block rounded-full border-2 bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-grab",$.thumb,G?.thumb,C&&L===z&&"cursor-grabbing"),style:c==="horizontal"?{left:`calc(${A(V)}% - ${$.thumbOffset})`,top:"50%",transform:"translateY(-50%)",...W}:{bottom:`calc(${A(V)}% - ${$.thumbOffset})`,left:"50%",transform:"translateX(-50%)",...W},onPointerDown:K=>M(K,z),onPointerMove:D,onPointerUp:P,onPointerCancel:P,onKeyDown:K=>H(K,z)},z)),g&&w.map((V,z)=>jsx("input",{type:"hidden",name:w.length>1?`${g}[${z}]`:g,value:V},z))]})]})});en.displayName="Slider";var gu=Z.createContext(null),bu=()=>{let e=Z.useContext(gu);if(!e)throw new Error("AccordionItem must be used within an Accordion");return e},zi=Z.createContext(null),vu=()=>{let e=Z.useContext(zi);if(!e)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return e},hu=Z.forwardRef(({className:e,type:t="multiple",variant:n="default",value:r,defaultValue:o,onValueChange:a,collapsible:s=true,isDisabled:i,children:l,...c},d)=>{let[u,p]=Z.useState(()=>t==="single"?o?[o]:[]:o||[]),f=Z.useRef(new Map),g=Z.useRef([]),v=r!==void 0,b=v?t==="single"?r?[r]:[]:r:u,h=w=>{if(t==="single"){let C=b.includes(w)&&s?[]:[w];v||p(C),a?.(C[0]||"");}else {let y=b.includes(w)?b.filter(C=>C!==w):[...b,w];v||p(y),a?.(y);}},x=Z.useCallback((w,y)=>{f.current.set(w,y),g.current.includes(w)||g.current.push(w);},[]),R=Z.useCallback(w=>{f.current.delete(w),g.current=g.current.filter(y=>y!==w);},[]),N=Z.useCallback(w=>{let y=g.current;if(y.length===0)return;let C=document.activeElement,E;f.current.forEach((M,D)=>{M===C&&(E=D);});let L=E?y.indexOf(E):-1,k;switch(w){case "first":k=0;break;case "last":k=y.length-1;break;case "next":k=L===-1?0:(L+1)%y.length;break;case "prev":k=L===-1?y.length-1:(L-1+y.length)%y.length;break}let S=y[k];f.current.get(S)?.focus();},[]);return jsx(gu.Provider,{value:{type:t,variant:n,value:b,onValueChange:h,collapsible:s,isDisabled:i,registerTrigger:x,unregisterTrigger:R,focusTrigger:N},children:jsx("div",{ref:d,"data-orientation":"vertical",className:m("w-full",n==="bordered"&&"border border-border rounded-lg px-4",n==="splitted"&&"space-y-2",e),...c,children:l})})});hu.displayName="Accordion";var xu=Z.forwardRef(({className:e,value:t,isDisabled:n,title:r,subtitle:o,startContent:a,children:s,...i},l)=>{let c=bu(),d=c.value.includes(t),u=n||c.isDisabled||false,{variant:p}=c,f=Z.useId(),g=Z.useId(),v=m(p==="default"&&"border-b border-border",p==="bordered"&&"border-b border-border last:border-b-0",p==="splitted"&&"border border-border rounded-lg px-4",u&&"opacity-50",e);return r!==void 0?jsx(zi.Provider,{value:{value:t,isOpen:d,isDisabled:u,contentId:f,triggerId:g},children:jsxs("div",{ref:l,"data-state":d?"open":"closed","data-disabled":u?"":void 0,className:v,...i,children:[jsx(yu,{children:jsxs("div",{className:"flex items-center gap-3",children:[a,jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-medium",children:r}),o&&jsx("span",{className:"text-xs text-muted-foreground",children:o})]})]})}),jsx(Ru,{children:s})]})}):jsx(zi.Provider,{value:{value:t,isOpen:d,isDisabled:u,contentId:f,triggerId:g},children:jsx("div",{ref:l,"data-state":d?"open":"closed","data-disabled":u?"":void 0,className:v,...i,children:s})})});xu.displayName="AccordionItem";var yu=Z.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,...o},a)=>{let s=bu(),{value:i,isOpen:l,isDisabled:c,contentId:d,triggerId:u}=vu(),p=Z.useRef(null);Z.useEffect(()=>{let g=p.current;return g&&!c&&s.registerTrigger(i,g),()=>{s.unregisterTrigger(i);}},[i,c,s]);let f=g=>{switch(r?.(g),g.key){case "ArrowDown":g.preventDefault(),s.focusTrigger("next");break;case "ArrowUp":g.preventDefault(),s.focusTrigger("prev");break;case "Home":g.preventDefault(),s.focusTrigger("first");break;case "End":g.preventDefault(),s.focusTrigger("last");break}};return jsx("h3",{className:"flex",children:jsxs("button",{type:"button",ref:g=>{p.current=g,typeof a=="function"?a(g):a&&(a.current=g);},id:u,"aria-controls":d,"aria-expanded":l,disabled:c,"data-state":l?"open":"closed",className:m("flex flex-1 items-center justify-between py-4 font-medium transition-all text-left cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),onClick:g=>{n?.(g),s.onValueChange(i);},onKeyDown:f,...o,children:[t,jsx(ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})})});yu.displayName="AccordionTrigger";var Ru=Z.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{isOpen:a,contentId:s,triggerId:i,isDisabled:l}=vu();return jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:m("grid transition-[grid-template-rows] duration-200 ease-out",a?"grid-rows-[1fr]":"grid-rows-[0fr]",e),style:n,...r,children:jsx("div",{className:"overflow-hidden",children:jsx("div",{className:"pb-4 pt-0 text-sm",children:t})})})});Ru.displayName="AccordionContent";var Cu=Z.createContext(null),Mu=()=>{let e=Z.useContext(Cu);if(!e)throw new Error("Collapsible components must be used within a Collapsible");return e},Tu=Z.forwardRef(({className:e,open:t,defaultOpen:n=false,onOpenChange:r,isDisabled:o,title:a,children:s,...i},l)=>{let[c,d]=Z.useState(n),u=t!==void 0,p=u?t:c,f=Z.useId(),g=Z.useId(),v=b=>{o||(u||d(b),r?.(b));};return jsx(Cu.Provider,{value:{open:p,onOpenChange:v,isDisabled:o,contentId:f,triggerId:g},children:jsxs("div",{ref:l,"data-state":p?"open":"closed","data-disabled":o?"":void 0,className:m("space-y-2",e),...i,children:[a&&jsxs("div",{className:"flex items-center justify-between space-x-4 px-4",children:[jsx("h4",{className:"text-sm font-semibold",children:a}),jsx(Oi,{})]}),s]})})});Tu.displayName="Collapsible";var Oi=Z.forwardRef(({className:e,children:t,onClick:n,...r},o)=>{let{open:a,onOpenChange:s,isDisabled:i,contentId:l,triggerId:c}=Mu();return jsx(me,{ref:o,id:c,"aria-controls":l,"aria-expanded":a,isDisabled:i,"data-state":a?"open":"closed","data-disabled":i?"":void 0,variant:"light",size:"sm",isIconOnly:true,className:e,onClick:d=>{n?.(d),s(!a);},...r,children:t??jsx(ChevronsUpDown,{className:m("h-4 w-4 transition-transform duration-200",a&&"rotate-180")})})});Oi.displayName="CollapsibleTrigger";var Nu=Z.forwardRef(({className:e,children:t,style:n,...r},o)=>{let{open:a,contentId:s,triggerId:i,isDisabled:l}=Mu(),c=Z.useRef(null),[d,u]=Z.useState(0),[p,f]=Z.useState(false),[g,v]=Z.useState(a);Z.useEffect(()=>{a?(v(true),u(0),f(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c.current&&u(c.current.scrollHeight);});})):(f(true),c.current?(u(c.current.scrollHeight),requestAnimationFrame(()=>{u(0);})):u(0));},[a]);let b=()=>{f(false),a||v(false);};return g?jsx("div",{ref:o,id:s,role:"region","aria-labelledby":i,"data-state":a?"open":"closed","data-disabled":l?"":void 0,className:m("overflow-hidden",e),style:{...n,height:p?d:a?"auto":0,transition:p?"height 0.25s ease-out, opacity 0.25s ease-out":void 0,opacity:a?1:0},onTransitionEnd:b,...r,children:jsx("div",{ref:c,className:"space-y-2",children:t})}):null});Nu.displayName="CollapsibleContent";var e0=cva("relative w-full overflow-hidden rounded-full bg-secondary",{variants:{size:{sm:"h-1.5",md:"h-2.5",lg:"h-4"}},defaultVariants:{size:"md"}}),ku={primary:"bg-primary",success:"bg-green-600 dark:bg-green-500",warning:"bg-amber-600 dark:bg-amber-500",danger:"bg-red-600 dark:bg-red-500"},Ja=Z.forwardRef(({className:e,value:t=0,max:n=100,label:r,showPercentage:o=false,formatPercentage:a=u=>`${Math.round(u)}%`,size:s,color:i="primary",isIndeterminate:l=false,...c},d)=>{let u=Math.min(Math.max(t/n*100,0),100),p=r||o&&!l,f=ku[i]||"",g=!ku[i];return jsxs("div",{ref:d,className:"w-full",children:[p&&jsxs("div",{className:"flex justify-between text-sm mb-2",children:[r&&jsx("span",{className:"text-muted-foreground",children:r}),o&&!l&&jsx("span",{className:m("text-muted-foreground",!r&&"ml-auto"),children:a(u)})]}),jsx("div",{role:"progressbar","aria-valuenow":l?void 0:t,"aria-valuemin":0,"aria-valuemax":n,"aria-label":typeof r=="string"?r:void 0,className:m(e0({size:s}),e),...c,children:jsx("div",{className:m("h-full rounded-full",f,l?"w-1/3 animate-[progress-indeterminate_1.5s_ease-in-out_infinite]":"w-full flex-1 transition-all"),style:{...l?{}:{transform:`translateX(-${100-u}%)`},...g?{backgroundColor:i}:{}}})})]})});Ja.displayName="Progress";var Lu=Z.createContext(null),Du=()=>{let e=Z.useContext(Lu);if(!e)throw new Error("HoverCard components must be used within a HoverCard");return e},Hu=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,openDelay:o=700,closeDelay:a=300,closeOnScroll:s=true})=>{let[i,l]=Z.useState(n),c=t!==void 0,d=c?t:i,u=Z.useRef(null),p=Z.useId(),f=Z.useRef(null),g=Z.useRef(null),v=Z.useCallback(b=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current),b?f.current=setTimeout(()=>{c||l(true),r?.(true);},o):g.current=setTimeout(()=>{c||l(false),r?.(false);},a);},[c,r,o,a]);return Z.useEffect(()=>{if(!s||!d)return;let b=()=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current),c||l(false),r?.(false);};return window.addEventListener("scroll",b,true),()=>window.removeEventListener("scroll",b,true)},[s,d,c,r]),Z.useEffect(()=>()=>{f.current&&clearTimeout(f.current),g.current&&clearTimeout(g.current);},[]),jsx(Lu.Provider,{value:{open:d,onOpenChange:v,triggerRef:u,contentId:p},children:e})};Hu.displayName="HoverCard";var Iu=Z.forwardRef(({children:e,onMouseEnter:t,onMouseLeave:n,onFocus:r,onBlur:o,...a},s)=>{let{onOpenChange:i,triggerRef:l}=Du();return jsx("a",{ref:f=>{l.current=f,typeof s=="function"?s(f):s&&(s.current=f);},onMouseEnter:f=>{t?.(f),i(true);},onMouseLeave:f=>{n?.(f),i(false);},onFocus:f=>{r?.(f),i(true);},onBlur:f=>{o?.(f),i(false);},...a,children:e})});Iu.displayName="HoverCardTrigger";var Vu=Z.forwardRef(({className:e,side:t="bottom",sideOffset:n=4,align:r="center",alignOffset:o=0,onMouseEnter:a,onMouseLeave:s,children:i,...l},c)=>{let{open:d,onOpenChange:u,triggerRef:p,contentId:f}=Du(),[g,v]=Z.useState({top:0,left:0}),[b,h]=Z.useState(false),x=Z.useRef(null);Z.useEffect(()=>{h(true);},[]),Z.useEffect(()=>{if(!d||!p.current||!x.current)return;(()=>{if(!p.current||!x.current)return;let C=p.current.getBoundingClientRect(),E=x.current.getBoundingClientRect(),L=0,k=0;switch(t){case "top":L=C.top-E.height-n;break;case "bottom":L=C.bottom+n;break;case "left":k=C.left-E.width-n;break;case "right":k=C.right+n;break}if(t==="top"||t==="bottom")switch(r){case "start":k=C.left+o;break;case "center":k=C.left+C.width/2-E.width/2;break;case "end":k=C.right-E.width-o;break}else switch(r){case "start":L=C.top+o;break;case "center":L=C.top+C.height/2-E.height/2;break;case "end":L=C.bottom-E.height-o;break}v({top:L,left:k});})();},[d,t,n,r,o,p]);let R=y=>{a?.(y),u(true);},N=y=>{s?.(y),u(false);};if(!b||!d)return null;let w={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 Ua.createPortal(jsx("div",{ref:y=>{x.current=y,typeof c=="function"?c(y):c&&(c.current=y);},id:f,"data-state":d?"open":"closed","data-side":t,className:m("fixed z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",w,e),style:{top:g.top,left:g.left},onMouseEnter:R,onMouseLeave:N,...l,children:i}),document.body)});Vu.displayName="HoverCardContent";var Au=Z.createContext({size:"md",variant:"default",radius:"md"}),es=()=>Z.useContext(Au);cva("",{variants:{size:{sm:"",md:"",lg:""},variant:{default:"",bordered:"",filled:""},radius:{none:"",sm:"",md:"",lg:"",full:""}},defaultVariants:{size:"md",variant:"default",radius:"md"}});var r0=cva("flex flex-wrap items-center break-words",{variants:{size:{sm:"gap-1 text-xs",md:"gap-1.5 text-sm sm:gap-2",lg:"gap-2 text-base sm:gap-3"},variant:{default:"text-muted-foreground",bordered:"text-muted-foreground px-3 py-1.5 border",filled:"text-muted-foreground bg-muted px-3 py-1.5"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{size:"md",variant:"default",radius:"md"}}),o0=cva("",{variants:{size:{sm:"[&>svg]:h-3 [&>svg]:w-3",md:"[&>svg]:h-3.5 [&>svg]:w-3.5",lg:"[&>svg]:h-4 [&>svg]:w-4"}},defaultVariants:{size:"md"}}),a0=cva("flex items-center justify-center",{variants:{size:{sm:"h-6 w-6 [&>svg]:h-3 [&>svg]:w-3",md:"h-8 w-8 [&>svg]:h-4 [&>svg]:w-4",lg:"h-10 w-10 [&>svg]:h-5 [&>svg]:w-5"}},defaultVariants:{size:"md"}}),zu=Z.forwardRef(({size:e="md",variant:t="default",radius:n="md",children:r,...o},a)=>jsx(Au.Provider,{value:{size:e,variant:t,radius:n},children:jsx("nav",{ref:a,"aria-label":"breadcrumb",...o,children:r})}));zu.displayName="Breadcrumb";var Ou=Z.forwardRef(({className:e,...t},n)=>{let{size:r,variant:o,radius:a}=es();return jsx("ol",{ref:n,className:m(r0({size:r,variant:o,radius:o==="default"?void 0:a}),e),...t})});Ou.displayName="BreadcrumbList";var Fu=Z.forwardRef(({className:e,...t},n)=>{let{size:r}=es();return jsx("li",{ref:n,className:m("inline-flex items-center",r==="sm"&&"gap-1",r==="md"&&"gap-1.5",r==="lg"&&"gap-2",e),...t})});Fu.displayName="BreadcrumbItem";var Bu=Z.forwardRef(({className:e,...t},n)=>jsx("a",{ref:n,className:m("transition-colors hover:text-foreground cursor-pointer",e),...t}));Bu.displayName="BreadcrumbLink";var $u=Z.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:m("font-medium text-foreground",e),...t}));$u.displayName="BreadcrumbPage";var Ku=({children:e,className:t,...n})=>{let{size:r}=es();return jsx("li",{role:"presentation","aria-hidden":"true",className:m(o0({size:r}),"text-muted-foreground/60",t),...n,children:e??jsx(ChevronRight,{})})};Ku.displayName="BreadcrumbSeparator";var Gu=({className:e,...t})=>{let{size:n}=es();return jsxs("span",{role:"presentation","aria-hidden":"true",className:m(a0({size:n}),e),...t,children:[jsx(MoreHorizontal,{}),jsx("span",{className:"sr-only",children:"More"})]})};Gu.displayName="BreadcrumbEllipsis";var ju=Z.forwardRef(({ratio:e=1,className:t,style:n,children:r,...o},a)=>jsx("div",{ref:a,className:m("relative w-full",t),style:{...n,paddingBottom:`${100/e}%`},...o,children:jsx("div",{className:"absolute inset-0",children:r})}));ju.displayName="AspectRatio";var qu=Z.createContext(null),Bi=()=>{let e=Z.useContext(qu);if(!e)throw new Error("NavigationMenu components must be used within a NavigationMenu");return e},Xu=Z.createContext(null),Zu=()=>{let e=Z.useContext(Xu);if(!e)throw new Error("NavigationMenuItem components must be used within a NavigationMenuItem");return e},Ju=Z.forwardRef(({className:e,orientation:t="horizontal",children:n,...r},o)=>{let[a,s]=Z.useState(null);return jsx(qu.Provider,{value:{activeItem:a,setActiveItem:s,orientation:t},children:jsxs("nav",{ref:o,className:m("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...r,children:[n,jsx($i,{})]})})});Ju.displayName="NavigationMenu";var Qu=Z.forwardRef(({className:e,...t},n)=>{let{orientation:r}=Bi();return jsx("ul",{ref:n,className:m("group flex flex-1 list-none items-center justify-center gap-1",r==="vertical"&&"flex-col items-start",e),...t})});Qu.displayName="NavigationMenuList";var em=Z.forwardRef(({className:e,children:t,...n},r)=>{let{activeItem:o,setActiveItem:a}=Bi(),s=Z.useId(),i=Z.useRef(null),l=o===s,c=Z.useCallback(d=>{a(d?s:null);},[s,a]);return jsx(Xu.Provider,{value:{itemId:s,triggerRef:i,open:l,onOpenChange:c},children:jsx("li",{ref:r,className:m("relative",e),...n,children:t})})});em.displayName="NavigationMenuItem";var tm=cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50"),nm=Z.forwardRef(({className:e,children:t,onMouseEnter:n,onClick:r,...o},a)=>{let{triggerRef:s,open:i,onOpenChange:l}=Zu(),c=u=>{n?.(u),l(true);},d=u=>{r?.(u),l(!i);};return jsxs("button",{ref:u=>{s.current=u,typeof a=="function"?a(u):a&&(a.current=u);},type:"button","data-state":i?"open":"closed",className:m(tm(),"group",e),onMouseEnter:c,onClick:d,"aria-expanded":i,...o,children:[t,jsx(ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})});nm.displayName="NavigationMenuTrigger";var rm=Z.forwardRef(({className:e,onMouseEnter:t,onMouseLeave:n,...r},o)=>{let{open:a,onOpenChange:s,triggerRef:i}=Zu(),l=Z.useRef(null),[c,d]=Z.useState({top:0,left:0});Z.useEffect(()=>{if(!a||!i.current)return;let f=()=>{if(!i.current)return;let g=i.current.getBoundingClientRect();d({top:g.bottom+4,left:g.left});};return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,true),()=>{window.removeEventListener("resize",f),window.removeEventListener("scroll",f,true);}},[a,i]);let u=f=>{t?.(f),s(true);},p=f=>{n?.(f),s(false);};return a?Ua.createPortal(jsx("div",{ref:f=>{l.current=f,typeof o=="function"?o(f):o&&(o.current=f);},"data-state":a?"open":"closed",className:m("fixed z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-4 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",e),style:{top:c.top,left:c.left},onMouseEnter:u,onMouseLeave:p,...r}),document.body):null});rm.displayName="NavigationMenuContent";var om=cva("block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"),am=Z.forwardRef(({className:e,active:t,...n},r)=>jsx("a",{ref:r,className:m(om(),t&&"bg-accent text-accent-foreground",e),...n}));am.displayName="NavigationMenuLink";var $i=Z.forwardRef((e,t)=>null);$i.displayName="NavigationMenuViewport";var sm=Z.forwardRef(({className:e,...t},n)=>{let{activeItem:r}=Bi();return r?jsx("div",{ref:n,className:m("top-full z-[1] flex h-2.5 items-end justify-center overflow-hidden","data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}):null});sm.displayName="NavigationMenuIndicator";var Yo=0,Ki=null;function cn(){Yo===0&&(Ki=document.body.style.overflow,document.body.style.overflow="hidden"),Yo++;}function dn(){Yo--,Yo<=0&&(Yo=0,document.body.style.overflow=Ki??"",Ki=null);}var dm=cva("inline-flex items-center justify-center rounded-full cursor-pointer transition-colors hover:bg-muted/50 focus-visible:outline-none 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"}}),Ct=Z.forwardRef(({className:e,size:t,...n},r)=>{let a={sm:14,md:16,lg:20}[t??"md"];return jsx("button",{ref:r,type:"button",className:m(dm({size:t}),e),"aria-label":"Close",...n,children:jsx(X,{style:{width:a,height:a}})})});Ct.displayName="CloseButton";var ts=Z.createContext(null);function b0(){let e=Z.useContext(ts);if(!e)throw new Error("useDrawer must be used within a DrawerProvider.");return e}function Bn(){return Z.useContext(ts)}var v0="16rem",h0="18rem",x0="3rem",y0="b",R0={xs:"256px",sm:"320px",md:"384px",lg:"448px",xl:"512px","2xl":"576px","3xl":"672px","4xl":"768px","5xl":"896px",full:"100%"},w0={xs:"20vh",sm:"30vh",md:"40vh",lg:"50vh",xl:"60vh","2xl":"70vh","3xl":"75vh","4xl":"80vh","5xl":"90vh",full:"100vh"},Gi=Z.forwardRef(({defaultOpen:e=false,open:t,onOpenChange:n,placement:r="left",size:o="md",backdrop:a="opaque",isDismissable:s=true,hideCloseButton:i=false,collapsible:l="offcanvas",mode:c,className:d,style:u,children:p,...f},g)=>{let v=c??"overlay",b=v==="overlay",[h,x]=Z.useState(false),[R,N]=Z.useState(false),[w,y]=Z.useState(e),C=t??w,E=Z.useCallback(T=>{let M=typeof T=="function"?T(C):T;n?n(M):y(M);},[n,C]);Z.useEffect(()=>{let T=()=>{x(window.innerWidth<768);};return T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);let L=Z.useCallback(()=>b?E(T=>!T):h?N(T=>!T):E(T=>!T),[h,E,N,b]);Z.useEffect(()=>{if(b)return;let T=M=>{M.key===y0&&(M.metaKey||M.ctrlKey)&&(M.preventDefault(),L());};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[L,b]);let k=C?"expanded":"collapsed",S=Z.useMemo(()=>({placement:r,state:k,open:C,setOpen:E,isMobile:h,openMobile:R,setOpenMobile:N,toggleDrawer:L,collapsible:l,mode:v,size:o,backdrop:a,isDismissable:s,hideCloseButton:i}),[r,k,C,E,h,R,N,L,l,v,o,a,s,i]);return b?jsx(ts.Provider,{value:S,children:jsx(Drawer.Root,{open:C,onOpenChange:E,direction:r,dismissible:s,children:p})}):jsx(ts.Provider,{value:S,children:jsx("div",{ref:g,style:{"--drawer-width":v0,"--drawer-width-icon":x0,...u},className:m("group/drawer-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",d),...f,children:p})})});Gi.displayName="Drawer";var mm=Z.forwardRef(({variant:e="default",embedded:t=false,className:n,children:r,...o},a)=>{let s=Bn();if(!s)return jsx("div",{ref:a,className:m("flex h-full flex-col bg-background text-foreground",n),...o,children:r});let{placement:i,collapsible:l,isMobile:c,state:d,openMobile:u,setOpenMobile:p}=s;if(i==="bottom"||i==="top")return jsx(Fragment,{children:r});if(l==="none")return jsx("div",{ref:a,className:m("flex h-full w-[--drawer-width] flex-col bg-background text-foreground border-r",i==="right"&&"border-l border-r-0",n),...o,children:r});if(c&&!t)return jsx(C0,{open:u,onOpenChange:p,placement:i,children:r});if(t){let g=d==="collapsed",v=l==="offcanvas",b=l==="icon";return jsx("div",{ref:a,className:m("group peer text-foreground relative"),"data-state":d,"data-collapsible":g?l:"","data-variant":e,"data-placement":i,"data-embedded":"true",children:jsx("div",{className:m("flex h-full flex-col overflow-hidden transition-[width,opacity] duration-200 ease-out",v?g?"w-0 opacity-0":"w-[--drawer-width] opacity-100":b&&g?"w-[--drawer-width-icon]":"w-[--drawer-width]",n),...o,children:jsx("div",{"data-drawer":"drawer",className:m("flex h-full w-full flex-col bg-background transition-opacity duration-200",e==="floating"&&"overflow-hidden rounded-lg border shadow-sm",e==="inset"&&"overflow-hidden rounded-lg border",e==="default"&&i==="left"&&"border-r",e==="default"&&i==="right"&&"border-l"),children:r})})})}return jsxs("div",{ref:a,className:"group peer hidden md:block text-foreground","data-state":d,"data-collapsible":d==="collapsed"?l:"","data-variant":e,"data-placement":i,children:[jsx("div",{className:m("duration-200 relative h-svh w-[--drawer-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0",i==="right"&&"group-data-[placement=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--drawer-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--drawer-width-icon]")}),jsx("div",{className:m("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--drawer-width] transition-[left,right,width] ease-linear md:flex",i==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--drawer-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--drawer-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--drawer-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--drawer-width-icon] group-data-[placement=left]:border-r group-data-[placement=right]:border-l",n),...o,children:jsx("div",{"data-drawer":"drawer",className:m("flex h-full w-full flex-col bg-background",e==="floating"&&"overflow-hidden rounded-lg border shadow-sm",e==="inset"&&"overflow-hidden rounded-lg border"),children:r})})]})});mm.displayName="DrawerSidebar";var C0=({children:e,open:t,onOpenChange:n,placement:r})=>{let[o,a]=Z.useState(false);return Z.useEffect(()=>{a(true);},[]),Z.useEffect(()=>{if(t)return cn(),()=>dn()},[t]),!o||!t?null:Ua.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/80 animate-in fade-in-0",onClick:()=>n(false)}),jsx("div",{className:m("fixed z-50 bg-background p-0 text-foreground shadow-lg","animate-in",r==="left"&&"inset-y-0 left-0 h-full w-[--drawer-width] slide-in-from-left",r==="right"&&"inset-y-0 right-0 h-full w-[--drawer-width] slide-in-from-right"),style:{"--drawer-width":h0},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},pm=Z.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Bn();if(o?.mode==="overlay")return jsx(Drawer.Trigger,{ref:r,className:e,onClick:t,...n});let a=o?.toggleDrawer;return jsxs("button",{ref:r,type:"button","data-drawer":"trigger",className:m("flex items-center justify-center h-9 w-9 rounded-lg bg-transparent hover:bg-accent transition-colors cursor-pointer",e),onClick:s=>{t?.(s),a?.();},...n,children:[jsx(PanelLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle Drawer"})]})});pm.displayName="DrawerTrigger";var fm=Z.forwardRef(({className:e,children:t,...n},r)=>{let o=Bn(),a=o?.mode==="overlay",s=o?.placement||"left",i=o?.size||"md",l=o?.backdrop||"opaque";if(a){let c=s==="top"||s==="bottom",d=s==="left"||s==="right",u=d?R0[i]:w0[i],p={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},f={top:"inset-x-0 top-0 rounded-b-[10px]",bottom:"inset-x-0 bottom-0 rounded-t-[10px]",left:"inset-y-0 left-0 rounded-r-[10px]",right:"inset-y-0 right-0 rounded-l-[10px]"};return jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:m("fixed inset-0 z-50",p[l])}),jsxs(Drawer.Content,{ref:r,className:m("fixed z-50 flex flex-col border bg-background",f[s],e),style:{...d?{width:u,height:"100%"}:{},...c?{maxHeight:u}:{},...n.style},...n,children:[c&&jsx("div",{className:m("mx-auto h-2 w-[100px] rounded-full bg-muted",s==="top"?"mb-4 mt-auto":"mt-4")}),t]})]})}return jsx("div",{ref:r,className:m("flex flex-col h-full",e),...n,children:t})});fm.displayName="DrawerContent";var gm=Z.forwardRef(({className:e,hideCloseButton:t,children:n,...r},o)=>{let a=Bn(),s=a?.hideCloseButton??false,i=!t&&!s;return jsxs("div",{ref:o,"data-drawer":"header",className:m("flex flex-col gap-2 p-4 relative",e),...r,children:[n,i&&jsx(Ct,{className:"absolute right-4 top-4",onClick:()=>a?.setOpen(false)})]})});gm.displayName="DrawerHeader";var bm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"body",className:m("flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-4 group-data-[collapsible=icon]:overflow-hidden",e),...t}));bm.displayName="DrawerBody";var vm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"footer",className:m("flex flex-col gap-2 p-4 mt-auto",e),...t}));vm.displayName="DrawerFooter";var hm=Z.forwardRef(({className:e,...t},n)=>Bn()?.mode==="overlay"?jsx(Drawer.Title,{ref:n,className:m("text-lg font-semibold leading-none tracking-tight",e),...t}):jsx("h2",{ref:n,className:m("text-lg font-semibold leading-none tracking-tight",e),...t}));hm.displayName="DrawerTitle";var xm=Z.forwardRef(({className:e,...t},n)=>Bn()?.mode==="overlay"?jsx(Drawer.Description,{ref:n,className:m("text-sm text-muted-foreground",e),...t}):jsx("p",{ref:n,className:m("text-sm text-muted-foreground",e),...t}));xm.displayName="DrawerDescription";var ym=Z.forwardRef(({className:e,onClick:t,...n},r)=>{let o=Bn();return jsx(Ct,{ref:r,className:e,onClick:a=>{t?.(a),o?.setOpen(false);},...n})});ym.displayName="DrawerClose";var Rm=Z.forwardRef(({className:e,onClick:t,showLabel:n=true,...r},o)=>{let a=Bn();if(!a)return null;let{toggleDrawer:s,state:i,placement:l}=a,c=i==="collapsed",d=l==="left",u=d?PanelLeftOpen:PanelRightOpen,p=d?PanelLeftClose:PanelRightClose;return jsxs("button",{ref:o,type:"button","data-drawer":"toggle","data-state":i,className:m("flex items-center gap-2 w-full px-2 py-2 rounded-md text-sm text-muted-foreground","hover:bg-accent hover:text-accent-foreground","transition-colors cursor-pointer","group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0",e),onClick:f=>{t?.(f),s();},...r,children:[c?jsx(u,{className:"h-4 w-4 shrink-0"}):jsx(p,{className:"h-4 w-4 shrink-0"}),n&&jsx("span",{className:"group-data-[collapsible=icon]:hidden truncate",children:c?"Expand":"Collapse"})]})});Rm.displayName="DrawerToggle";var wm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"separator",className:m("mx-4 h-px bg-border",e),...t}));wm.displayName="DrawerSeparator";var Cm=Z.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,"data-drawer":"menu",className:m("flex w-full min-w-0 flex-col gap-1",e),...t}));Cm.displayName="DrawerMenu";var Mm=Z.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,"data-drawer":"menu-item",className:m("group/menu-item relative",e),...t}));Mm.displayName="DrawerMenuItem";var Tm=cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-ring transition-[width,height,padding] hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 active:bg-accent active:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-accent data-[active=true]:font-medium data-[active=true]:text-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground",bordered:"bg-background shadow-[0_0_0_1px_currentColor] hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent/50 hover:text-accent-foreground"},size:{sm:"h-7 text-xs",md:"h-8 text-sm",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"md"}}),Nm=Z.forwardRef(({isActive:e=false,variant:t="default",size:n="md",tooltip:r,className:o,children:a,...s},i)=>{let l=Bn(),c=l?.isMobile??false,d=l?.state??"expanded",u=jsx("button",{ref:i,type:"button","data-drawer":"menu-button","data-size":n,"data-active":e,className:m(Tm({variant:t,size:n}),o),...s,children:a});return !r||d!=="collapsed"||c?u:jsx(Rn,{content:r,position:"right",align:"center",delayDuration:0,children:u})});Nm.displayName="DrawerMenuButton";var km=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group",className:m("relative flex w-full min-w-0 flex-col p-2",e),...t}));km.displayName="DrawerGroup";var Sm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-drawer":"group-label",className:m("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-muted-foreground outline-none transition-[margin,opacity] ease-linear","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...t}));Sm.displayName="DrawerGroupLabel";var Em=Z.forwardRef(({className:e,...t},n)=>jsx("main",{ref:n,className:m("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));Em.displayName="DrawerInset";var M0=Gi;var k0="16rem",S0="18rem",E0="3rem",P0="b",L0="sidebar:state",D0=3600*24*7,io=Z.createContext(null);function H0(){let e=Z.useContext(io);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function qo(){return Z.useContext(io)}var Dm=Z.forwardRef(({defaultOpen:e=true,isOpen:t,onOpenChange:n,className:r,style:o,children:a,...s},i)=>{let[l,c]=Z.useState(false),[d,u]=Z.useState(false),[p,f]=Z.useState(e),g=t??p,v=Z.useCallback(R=>{let N=typeof R=="function"?R(g):R;n?n(N):f(N),document.cookie=`${L0}=${N}; path=/; max-age=${D0}`;},[n,g]);Z.useEffect(()=>{let R=()=>{c(window.innerWidth<768);};return R(),window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);let b=Z.useCallback(()=>l?u(R=>!R):v(R=>!R),[l,v,u]);Z.useEffect(()=>{let R=N=>{N.key===P0&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),b());};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[b]);let h=g?"expanded":"collapsed",x=Z.useMemo(()=>({state:h,isOpen:g,setOpen:v,isMobile:l,isOpenMobile:d,setOpenMobile:u,toggleSidebar:b,side:"left",variant:"sidebar",collapsible:"offcanvas"}),[h,g,v,l,d,u,b]);return jsx(io.Provider,{value:x,children:jsx("div",{ref:i,style:{"--sidebar-width":k0,"--sidebar-width-icon":E0,...o},className:m("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted/50",r),...s,children:a})})});Dm.displayName="SidebarProvider";var Hm=Z.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,...a},s)=>{let i=qo();if(!i)return jsx("aside",{ref:s,className:m("flex h-full flex-col bg-sidebar text-sidebar-foreground",r),...a,children:o});let{state:l,isMobile:c,isOpenMobile:d,setOpenMobile:u}=i,p=Z.useMemo(()=>({...i,side:e,variant:t,collapsible:n}),[i,e,t,n]);return n==="none"?jsx(io.Provider,{value:p,children:jsx("aside",{ref:s,className:m("flex h-svh w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",e==="left"&&"border-r",e==="right"&&"border-l",r),...a,children:o})}):c?jsx(io.Provider,{value:p,children:jsx(I0,{open:d,onOpenChange:u,side:e,children:o})}):jsx(io.Provider,{value:p,children:jsxs("div",{ref:s,className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,children:[jsx("div",{className:m("relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0",e==="right"&&"group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),jsx("div",{className:m("fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem+2px)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...a,children:jsx("div",{"data-sidebar":"sidebar",className:"bg-sidebar flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:o})})]})})});Hm.displayName="Sidebar";var I0=({children:e,open:t,onOpenChange:n,side:r})=>{let[o,a]=Z.useState(false);return Z.useEffect(()=>{a(true);},[]),Z.useEffect(()=>{if(t)return cn(),()=>dn()},[t]),!o||!t?null:Ua.createPortal(jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-50 bg-black/80 animate-in fade-in-0",onClick:()=>n(false)}),jsx("aside",{"data-sidebar":"sidebar","data-mobile":"true",className:m("fixed z-50 bg-sidebar p-0 text-sidebar-foreground shadow-lg","animate-in",r==="left"&&"inset-y-0 left-0 h-full w-[--sidebar-width] slide-in-from-left border-r",r==="right"&&"inset-y-0 right-0 h-full w-[--sidebar-width] slide-in-from-right border-l"),style:{"--sidebar-width":S0},children:jsx("div",{className:"flex h-full w-full flex-col",children:e})})]}),document.body)},Im=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-sidebar":"header",className:m("flex flex-col gap-2 p-2",e),...t}));Im.displayName="SidebarHeader";var Vm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-sidebar":"content",className:m("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));Vm.displayName="SidebarContent";var Am=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-sidebar":"footer",className:m("flex flex-col gap-2 p-2",e),...t}));Am.displayName="SidebarFooter";var zm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-sidebar":"group",className:m("relative flex w-full min-w-0 flex-col p-2",e),...t}));zm.displayName="SidebarGroup";var Om=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-sidebar":"group-label",className:m("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] ease-linear focus-visible:ring-2","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...t}));Om.displayName="SidebarGroupLabel";var Fm=Z.forwardRef(({className:e,...t},n)=>jsx("button",{ref:n,type:"button","data-sidebar":"group-action",className:m("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...t}));Fm.displayName="SidebarGroupAction";var Bm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-sidebar":"group-content",className:m("w-full text-sm",e),...t}));Bm.displayName="SidebarGroupContent";var $m=Z.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,"data-sidebar":"menu",className:m("flex w-full min-w-0 flex-col gap-1",e),...t}));$m.displayName="SidebarMenu";var Km=Z.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,"data-sidebar":"menu-item",className:m("group/menu-item relative",e),...t}));Km.displayName="SidebarMenuItem";var Gm=cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] cursor-pointer focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",bordered:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",ghost:"hover:bg-transparent hover:text-sidebar-accent-foreground hover:underline"},size:{sm:"h-7 text-xs",md:"h-8 text-sm",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"md"}}),Um=Z.forwardRef(({isActive:e=false,variant:t="default",size:n="md",tooltip:r,asChild:o=false,className:a,children:s,...i},l)=>{let c=qo(),d=c?.isMobile??false,u=c?.state??"expanded",p=c?.side??"left",f=jsx("button",{ref:l,type:"button","data-sidebar":"menu-button","data-size":n,"data-active":e,className:m(Gm({variant:t,size:n}),a),...i,children:s});return !r||u!=="collapsed"||d?f:jsx(Rn,{content:typeof r=="string"?r:void 0,position:p==="left"?"right":"left",align:"center",delayDuration:0,children:f})});Um.displayName="SidebarMenuButton";var _m=Z.forwardRef(({className:e,showOnHover:t=false,...n},r)=>jsx("button",{ref:r,type:"button","data-sidebar":"menu-action",className:m("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=md]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n}));_m.displayName="SidebarMenuAction";var jm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-sidebar":"menu-badge",className:m("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=md]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));jm.displayName="SidebarMenuBadge";var Wm=Z.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:m("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Wm.displayName="SidebarMenuSub";var Ym=Z.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,"data-sidebar":"menu-sub-item",className:m("",e),...t}));Ym.displayName="SidebarMenuSubItem";var qm=Z.forwardRef(({isActive:e=false,size:t="md",className:n,...r},o)=>jsx("a",{ref:o,"data-sidebar":"menu-sub-button","data-size":t,"data-active":e,className:m("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...r}));qm.displayName="SidebarMenuSubButton";var Xm=Z.forwardRef(({className:e,showIcon:t=false,...n},r)=>{let o=Z.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:m("rounded-md h-8 flex gap-2 px-2 items-center",e),...n,children:[t&&jsx("div",{className:"size-4 rounded-md bg-sidebar-accent-foreground/10 animate-pulse","data-sidebar":"menu-skeleton-icon"}),jsx("div",{className:"h-4 flex-1 max-w-[--skeleton-width] rounded-md bg-sidebar-accent-foreground/10 animate-pulse","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});Xm.displayName="SidebarMenuSkeleton";var Zm=Z.forwardRef(({className:e,onClick:t,...n},r)=>{let a=qo()?.toggleSidebar;return jsxs("button",{ref:r,type:"button","data-sidebar":"trigger",className:m("flex items-center justify-center h-7 w-7 rounded-md hover:bg-accent transition-colors cursor-pointer",e),onClick:s=>{t?.(s),a?.();},...n,children:[jsx(PanelLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});Zm.displayName="SidebarTrigger";var Jm=Z.forwardRef(({className:e,...t},n)=>{let r=qo();if(!r)return null;let{toggleSidebar:o}=r;return jsx("button",{ref:n,type:"button","data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:m("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});Jm.displayName="SidebarRail";var Qm=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,"data-sidebar":"separator",className:m("mx-2 w-auto h-px bg-sidebar-border",e),...t}));Qm.displayName="SidebarSeparator";var ep=Z.forwardRef(({className:e,...t},n)=>jsx("main",{ref:n,"data-sidebar":"inset",className:m("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));ep.displayName="SidebarInset";var tp=Z.forwardRef(({className:e,...t},n)=>jsx("div",{className:"relative w-full overflow-auto",children:jsx("table",{ref:n,className:m("w-full caption-bottom text-sm",e),...t})}));tp.displayName="Table";var np=Z.forwardRef(({className:e,...t},n)=>jsx("thead",{ref:n,className:m("[&_tr]:border-b",e),...t}));np.displayName="TableHeader";var rp=Z.forwardRef(({className:e,...t},n)=>jsx("tbody",{ref:n,className:m("[&_tr:last-child]:border-0",e),...t}));rp.displayName="TableBody";var op=Z.forwardRef(({className:e,...t},n)=>jsx("tfoot",{ref:n,className:m("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));op.displayName="TableFooter";var ap=Z.forwardRef(({className:e,...t},n)=>jsx("tr",{ref:n,className:m("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));ap.displayName="TableRow";var sp=Z.forwardRef(({className:e,...t},n)=>jsx("th",{ref:n,className:m("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));sp.displayName="TableHead";var ip=Z.forwardRef(({className:e,...t},n)=>jsx("td",{ref:n,className:m("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ip.displayName="TableCell";var lp=Z.forwardRef(({className:e,...t},n)=>jsx("caption",{ref:n,className:m("mt-4 text-sm text-muted-foreground",e),...t}));lp.displayName="TableCaption";function $0({className:e,data:t,columns:n,selectable:r=false,selectedKeys:o,onSelectionChange:a,getRowKey:s=(N,w)=>String(w),sortable:i=false,sortState:l,onSortChange:c,paginated:d=false,pageSizeOptions:u=[10,20,50],paginationState:p,onPaginationChange:f,emptyContent:g="No data",loading:v=false,striped:b=false,hoverable:h=true,...x},R){let[N,w]=Z.useState(new Set),[y,C]=Z.useState({columnId:null,direction:null}),[E,L]=Z.useState({pageIndex:0,pageSize:u[0]||10}),k=o??N,S=l??y,T=p??E,M=V=>{a?a(V):w(V);},D=V=>{c?c(V):C(V);},P=V=>{f?f(V):L(V);},I=Z.useMemo(()=>{if(!S.columnId||!S.direction)return t;let V=n.find(z=>z.id===S.columnId);return V?[...t].sort((z,K)=>{let Y=V.accessor(z),Q=V.accessor(K);if(Y===Q)return 0;if(Y==null)return 1;if(Q==null)return -1;let J=String(Y).localeCompare(String(Q),void 0,{numeric:true});return S.direction==="asc"?J:-J}):t},[t,S,n]),H=Z.useMemo(()=>{if(!d)return I;let V=T.pageIndex*T.pageSize;return I.slice(V,V+T.pageSize)},[I,d,T]),A=Math.ceil(I.length/T.pageSize),B=V=>{if(V===true){let z=new Set(H.map((K,Y)=>s(K,Y)));M(z);}else M(new Set);},$=(V,z)=>{let K=new Set(k);z?K.add(V):K.delete(V),M(K);},j=H.length>0&&H.every((V,z)=>k.has(s(V,z))),G=H.some((V,z)=>k.has(s(V,z))),U=V=>{if(!n.find(Y=>Y.id===V)?.sortable&&!i)return;let K="asc";S.columnId===V&&(S.direction==="asc"?K="desc":S.direction==="desc"&&(K=null)),D({columnId:K?V:null,direction:K});},W=V=>S.columnId!==V?jsx(ChevronsUpDown,{className:"h-4 w-4 text-muted-foreground/50"}):S.direction==="asc"?jsx(ChevronUp,{className:"h-4 w-4"}):jsx(ChevronDown,{className:"h-4 w-4"});return jsxs("div",{ref:R,className:m("w-full",e),...x,children:[jsx("div",{className:"relative w-full overflow-auto rounded-md border",children:jsxs("table",{className:"w-full caption-bottom text-sm",children:[jsx("thead",{className:"[&_tr]:border-b bg-muted/50",children:jsxs("tr",{children:[r&&jsx("th",{className:"h-12 w-12 px-4",children:jsx(Ko,{checked:j?true:G?"indeterminate":false,onCheckedChange:B,"aria-label":"Select all"})}),n.map(V=>{let z=V.sortable??i;return jsx("th",{className:m("h-12 px-4 text-left align-middle font-medium text-muted-foreground",z&&"cursor-pointer select-none hover:text-foreground"),style:{width:V.width},onClick:()=>z&&U(V.id),children:jsxs("div",{className:"flex items-center gap-2",children:[V.header,z&&W(V.id)]})},V.id)})]})}),jsx("tbody",{className:"[&_tr:last-child]:border-0",children:v?jsx("tr",{children:jsx("td",{colSpan:n.length+(r?1:0),className:"h-24 text-center text-muted-foreground",children:"Loading..."})}):H.length===0?jsx("tr",{children:jsx("td",{colSpan:n.length+(r?1:0),className:"h-24 text-center text-muted-foreground",children:g})}):H.map((V,z)=>{let K=s(V,z),Y=k.has(K);return jsxs("tr",{className:m("border-b transition-colors",h&&"hover:bg-muted/50",b&&z%2===1&&"bg-muted/30",Y&&"bg-muted"),"data-state":Y?"selected":void 0,children:[r&&jsx("td",{className:"w-12 px-4",children:jsx(Ko,{checked:Y,onCheckedChange:Q=>$(K,!!Q),"aria-label":`Select row ${z+1}`})}),n.map(Q=>jsx("td",{className:"p-4 align-middle",children:Q.cell?Q.cell(V,z):Q.accessor(V)},Q.id))]},K)})})]})}),d&&jsxs("div",{className:"flex items-center justify-between px-2 py-4",children:[jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsx("span",{children:"Rows per page:"}),jsx("select",{value:T.pageSize,onChange:V=>P({pageIndex:0,pageSize:Number(V.target.value)}),className:"h-8 rounded-md border bg-transparent px-2",children:u.map(V=>jsx("option",{value:V,children:V},V))})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",T.pageIndex+1," of ",A||1]}),jsxs("div",{className:"flex gap-1",children:[jsx(me,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>P({...T,pageIndex:T.pageIndex-1}),isDisabled:T.pageIndex===0,"aria-label":"Previous page",children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(me,{variant:"light",size:"sm",isIconOnly:true,onClick:()=>P({...T,pageIndex:T.pageIndex+1}),isDisabled:T.pageIndex>=A-1,"aria-label":"Next page",children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]})]})]})}var K0=Z.forwardRef($0);var ji={sm:{padding:"p-3",weekday:"w-7 text-[10px]",day:"h-7 w-7 text-xs",dayButton:"size-7 text-xs",navButton:"h-5 w-5",navIcon:"h-3 w-3",monthWidth:"w-[75px]",yearWidth:"w-[50px]",pickerText:"text-[10px]",pickerPadding:"px-1 py-0.5",pickerIcon:"h-2.5 w-2.5"},md:{padding:"p-4",weekday:"w-8 text-xs",day:"h-8 w-8 text-sm",dayButton:"size-8 text-sm",navButton:"h-6 w-6",navIcon:"h-3.5 w-3.5",monthWidth:"w-[85px]",yearWidth:"w-[60px]",pickerText:"text-xs",pickerPadding:"px-1.5 py-1",pickerIcon:"h-3 w-3"},lg:{padding:"p-5",weekday:"w-10 text-sm",day:"h-10 w-10 text-base",dayButton:"size-10 text-base",navButton:"h-8 w-8",navIcon:"h-4 w-4",monthWidth:"w-[100px]",yearWidth:"w-[70px]",pickerText:"text-sm",pickerPadding:"px-2 py-1.5",pickerIcon:"h-3.5 w-3.5"}},Ui=["January","February","March","April","May","June","July","August","September","October","November","December"];function q0({currentMonth:e,onMonthChange:t,startYear:n,endYear:r,size:o}){let a=getMonth(e),s=getYear(e),i=ji[o],l=u=>{let p=setMonth(e,u);t(p);},c=u=>{let p=setYear(e,u);t(p);},d=Z.useMemo(()=>{let u=[];for(let p=r;p>=n;p--)u.push(p);return u},[n,r]);return jsxs("div",{className:"flex items-center gap-1",children:[jsxs(Zt,{children:[jsx(Jt,{children:jsxs("div",{className:m("inline-flex items-center justify-between gap-1 rounded-md",i.pickerPadding,i.pickerText,"font-medium",i.monthWidth,"border border-border bg-background","hover:bg-muted transition-colors cursor-pointer"),children:[jsx("span",{className:"truncate",children:Ui[a]}),jsx(ChevronDown,{className:m(i.pickerIcon,"text-muted-foreground shrink-0")})]})}),jsx(Qt,{className:"min-w-[120px] p-0",children:jsx(ze,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:Ui.map((u,p)=>jsx(Et,{onSelect:()=>l(p),className:m(i.pickerText,a===p&&"bg-primary/10 text-primary font-medium"),children:u},u))})})})]}),jsxs(Zt,{children:[jsx(Jt,{children:jsxs("div",{className:m("inline-flex items-center justify-between gap-1 rounded-md",i.pickerPadding,i.pickerText,"font-medium",i.yearWidth,"border border-border bg-background","hover:bg-muted transition-colors cursor-pointer"),children:[jsx("span",{children:s}),jsx(ChevronDown,{className:m(i.pickerIcon,"text-muted-foreground shrink-0")})]})}),jsx(Qt,{className:"min-w-[80px] p-0",children:jsx(ze,{className:"h-[200px]",children:jsx("div",{className:"p-1",children:d.map(u=>jsx(Et,{onSelect:()=>c(u),className:m(i.pickerText,s===u&&"bg-primary/10 text-primary font-medium"),children:u},u))})})})]})]})}function X0(e,t,n,r){let o=ji[r];return function({calendarMonth:s}){let{goToMonth:i,nextMonth:l,previousMonth:c}=useDayPicker();if(e)return jsxs("div",{className:"flex items-center justify-between gap-1 mb-2",children:[jsx(q0,{currentMonth:s.date,onMonthChange:i,startYear:t,endYear:n,size:r}),jsxs("div",{className:"flex items-center",children:[jsx("button",{type:"button",disabled:!c,onClick:()=>c&&i(c),className:m(o.navButton,"inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Previous month",children:jsx(ChevronLeft,{className:o.navIcon})}),jsx("button",{type:"button",disabled:!l,onClick:()=>l&&i(l),className:m(o.navButton,"inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Next month",children:jsx(ChevronRight,{className:o.navIcon})})]})]});let d=Ui[s.date.getMonth()],u=s.date.getFullYear();return jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:m(o.pickerText,"font-medium",o.monthWidth),children:d}),jsx("span",{className:m(o.pickerText,"font-medium",o.yearWidth),children:u})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{type:"button",disabled:!c,onClick:()=>c&&i(c),className:m(o.navButton,"inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Previous month",children:jsx(ChevronLeft,{className:o.navIcon})}),jsx("button",{type:"button",disabled:!l,onClick:()=>l&&i(l),className:m(o.navButton,"inline-flex items-center justify-center rounded-md","text-muted-foreground hover:text-foreground hover:bg-muted","transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Next month",children:jsx(ChevronRight,{className:o.navIcon})})]})]})}}function lo({className:e,classNames:t,showOutsideDays:n=true,showMonthAndYearPickers:r=false,startYear:o=1900,endYear:a=new Date().getFullYear()+50,size:s="md",components:i,...l}){let c=ji[s],d=Z.useMemo(()=>X0(r,o,a,s),[r,o,a,s]);return jsx(DayPicker,{showOutsideDays:n,className:m(c.padding,e),classNames:{months:"flex flex-col sm:flex-row gap-4",month:"flex flex-col gap-2",month_caption:"sr-only",nav:"hidden",month_grid:"w-full border-collapse",weekdays:"flex",weekday:m("text-muted-foreground font-normal text-center",c.weekday),week:"flex w-full mt-0.5",day:m("relative p-0 text-center",c.day,"flex items-center justify-center","focus-within:relative focus-within:z-20","[&:has([aria-selected]:not(.outside-day))]:bg-accent","first:[&:has([aria-selected]:not(.outside-day))]:rounded-l-md","last:[&:has([aria-selected]:not(.outside-day))]:rounded-r-md"),day_button:m(c.dayButton,"p-0 font-normal rounded-md","inline-flex items-center justify-center","hover:bg-primary/10","focus:outline-none","transition-colors cursor-pointer"),range_start:"rounded-l-md",range_end:"rounded-r-md",selected:m("bg-primary text-primary-foreground rounded-md","hover:bg-primary/90 hover:!text-primary-foreground","focus:bg-primary focus:text-primary-foreground","[&.outside-day]:!bg-transparent [&.outside-day]:!text-muted-foreground/50"),today:"bg-accent text-accent-foreground rounded-md",outside:"outside-day text-muted-foreground/50 !bg-transparent",disabled:"text-muted-foreground/30 cursor-not-allowed",range_middle:"rounded-none bg-muted text-foreground",hidden:"invisible",...t},modifiersStyles:{range_middle:{backgroundColor:"var(--color-muted)",color:"var(--color-foreground)",borderRadius:0}},components:{...i,MonthCaption:d},...l})}lo.displayName="Calendar";var mp=({className:e,...t})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:m("mx-auto flex w-full justify-center",e),...t});mp.displayName="Pagination";var pp=Z.forwardRef(({className:e,...t},n)=>jsx("ul",{ref:n,className:m("flex flex-row items-center gap-1",e),...t}));pp.displayName="PaginationContent";var fp=Z.forwardRef(({className:e,...t},n)=>jsx("li",{ref:n,className:m("",e),...t}));fp.displayName="PaginationItem";var eR={sm:"!px-0 !w-9",md:"!px-0 !w-10",lg:"!px-0 !w-11"},rs=({className:e,isActive:t,size:n="md",radius:r="md",isIconOnly:o=true,...a})=>jsx("a",{"aria-current":t?"page":void 0,className:m(ro({variant:t?"solid":"light",size:n,radius:r}),o&&eR[n],e),...a});rs.displayName="PaginationLink";var gp=({className:e,...t})=>jsxs(rs,{"aria-label":"Go to previous page",isIconOnly:false,className:m("gap-1 pl-2.5",e),...t,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});gp.displayName="PaginationPrevious";var bp=({className:e,...t})=>jsxs(rs,{"aria-label":"Go to next page",isIconOnly:false,className:m("gap-1 pr-2.5",e),...t,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});bp.displayName="PaginationNext";var tR={sm:"h-9 w-9",md:"h-10 w-10",lg:"h-11 w-11"},vp=({className:e,size:t="md",...n})=>jsxs("span",{"aria-hidden":true,className:m("flex items-center justify-center",tR[t],e),...n,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});vp.displayName="PaginationEllipsis";var xp=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"].join(",");function nR(e={}){let{enabled:t=true,initialFocus:n,returnFocus:r=true,autoFocus:o=true}=e,a=useRef(null),s=useRef(null),i=useCallback(()=>{let c=a.current;return c?Array.from(c.querySelectorAll(xp)).filter(d=>d.offsetParent!==null&&getComputedStyle(d).visibility!=="hidden"):[]},[]),l=useCallback(c=>{if(c.key!=="Tab")return;let d=i();if(d.length===0)return;let u=d[0],p=d[d.length-1];c.shiftKey?document.activeElement===u&&(c.preventDefault(),p.focus()):document.activeElement===p&&(c.preventDefault(),u.focus());},[i]);return useEffect(()=>{if(!t)return;let c=a.current;if(c){if(s.current=document.activeElement,o)if(n?.current)n.current.focus();else {let d=i();d.length>0&&d[0].focus();}return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l),r&&s.current&&s.current.focus();}}},[t,n,r,o,l,i]),a}function as(e,t={}){let{enabled:n=true,initialFocus:r,returnFocus:o=true,autoFocus:a=true}=t,s=useRef(null),i=useCallback(()=>{let c=e.current;return c?Array.from(c.querySelectorAll(xp)).filter(d=>d.offsetParent!==null&&getComputedStyle(d).visibility!=="hidden"):[]},[e]),l=useCallback(c=>{if(c.key!=="Tab")return;let d=i();if(d.length===0)return;let u=d[0],p=d[d.length-1];c.shiftKey?document.activeElement===u&&(c.preventDefault(),p.focus()):document.activeElement===p&&(c.preventDefault(),u.focus());},[i]);useEffect(()=>{if(!n)return;let c=e.current;if(c){if(s.current=document.activeElement,a)if(r?.current)r.current.focus();else {let d=i();d.length>0&&d[0].focus();}return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l),o&&s.current&&s.current.focus();}}},[e,n,r,o,a,l,i]);}var Xo=Z.forwardRef(({className:e,...t},n)=>jsx("span",{ref:n,className:m("absolute h-px w-px p-0 -m-px overflow-hidden whitespace-nowrap border-0","[clip:rect(0,0,0,0)]",e),...t}));Xo.displayName="VisuallyHidden";var Rp={opaque:"bg-black/80",blur:"bg-black/50 backdrop-blur-sm",transparent:"bg-transparent"},oR={auto:"top-[50%] translate-y-[-50%]",center:"top-[50%] translate-y-[-50%]",top:"top-4 translate-y-0",bottom:"top-auto bottom-4 translate-y-0","top-center":"top-[20%] translate-y-0","bottom-center":"top-auto bottom-[20%] translate-y-0"},wp=cva("fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),Xi=cva("fixed left-[50%] z-50 grid translate-x-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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 sm:rounded-lg",{variants:{size:{xs:"w-full max-w-xs",sm:"w-full max-w-sm",md:"w-full max-w-md",lg:"w-full max-w-lg",xl:"w-full max-w-xl","2xl":"w-full max-w-2xl","3xl":"w-full max-w-3xl","4xl":"w-full max-w-4xl","5xl":"w-full max-w-5xl",full:"w-[calc(100vw-2rem)] h-[calc(100vh-2rem)] max-w-none"}},defaultVariants:{size:"md"}}),is=Z.createContext(null),Or=()=>{let e=Z.useContext(is);if(!e)throw new Error("Modal components must be used within a Modal");return e},Mp=Z.forwardRef(({open:e,onOpenChange:t,trigger:n,title:r="Modal",children:o,hideCloseButton:a=false,isDismissable:s=true,isKeyboardDismissDisabled:i=false,backdrop:l="opaque",placement:c="center",scrollBehavior:d="inside",size:u,className:p},f)=>{let[g,v]=Z.useState(false),b=e!==void 0,h=b?e:g,[x,R]=Z.useState(false),N=Z.useRef(null),w=Z.useId(),y=Z.useId();Z.useEffect(()=>{R(true);},[]);let C=Z.useCallback(S=>{b||v(S),t?.(S);},[b,t]);Z.useEffect(()=>{if(h)return cn(),()=>dn()},[h]),Z.useEffect(()=>{if(!h||i)return;let S=T=>{T.key==="Escape"&&C(false);};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[h,i,C]),as(N,{enabled:h,returnFocus:true,autoFocus:true});let E=S=>{s&&S.target===S.currentTarget&&C(false);},L=n?Z.isValidElement(n)?Z.cloneElement(n,{onClick:S=>{n.props.onClick?.(S),C(true);}}):jsx("button",{type:"button",onClick:()=>C(true),children:n}):null,k=()=>!x||!h?null:d==="outside"?Ua.createPortal(jsx("div",{"data-state":h?"open":"closed",className:m(wp(),Rp[l],"overflow-y-auto flex items-start justify-center py-4"),onClick:E,children:jsxs("div",{ref:S=>{N.current=S,typeof f=="function"?f(S):f&&(f.current=S);},role:"dialog","aria-modal":"true","aria-labelledby":w,"aria-describedby":y,"data-state":h?"open":"closed",className:m("relative z-50 grid gap-4 border bg-background p-6 shadow-lg sm:rounded-lg dark:border-0",u==="xs"&&"w-full max-w-xs",u==="sm"&&"w-full max-w-sm",u==="md"&&"w-full max-w-md",u==="lg"&&"w-full max-w-lg",u==="xl"&&"w-full max-w-xl",u==="2xl"&&"w-full max-w-2xl",u==="3xl"&&"w-full max-w-3xl",u==="4xl"&&"w-full max-w-4xl",u==="5xl"&&"w-full max-w-5xl",u==="full"&&"w-[calc(100vw-2rem)] min-h-[calc(100vh-2rem)]",!u&&"w-full max-w-md",p),children:[jsx(Xo,{children:jsx("h2",{id:w,children:r})}),o,!a&&jsx(Ct,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>C(false)})]})}),document.body):Ua.createPortal(jsxs(Fragment,{children:[jsx("div",{"data-state":h?"open":"closed",className:m(wp(),Rp[l]),onClick:E,"aria-hidden":"true"}),jsxs("div",{ref:S=>{N.current=S,typeof f=="function"?f(S):f&&(f.current=S);},role:"dialog","aria-modal":"true","aria-labelledby":w,"aria-describedby":y,"data-state":h?"open":"closed",className:m(Xi({size:u}),oR[c],"dark:border-0 max-h-[calc(100vh-2rem)] !flex !flex-col overflow-hidden gap-4",p),children:[jsx(Xo,{children:jsx("h2",{id:w,children:r})}),o,!a&&jsx(Ct,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>C(false)})]})]}),document.body);return jsxs(is.Provider,{value:{open:h,onOpenChange:C,scrollBehavior:d,titleId:w,descriptionId:y},children:[L,k()]})});Mp.displayName="Modal";var ls=({children:e,open:t,defaultOpen:n=false,onOpenChange:r,scrollBehavior:o="inside"})=>{let[a,s]=Z.useState(n),i=t!==void 0,l=i?t:a,c=Z.useId(),d=Z.useId(),u=Z.useCallback(p=>{i||s(p),r?.(p);},[i,r]);return jsx(is.Provider,{value:{open:l,onOpenChange:u,scrollBehavior:o,titleId:c,descriptionId:d},children:e})};ls.displayName="ModalRoot";var Tp=Z.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Or();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(true);},...n,children:e})});Tp.displayName="ModalTrigger";var Zi=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?Ua.createPortal(e,t||document.body):null};Zi.displayName="ModalPortal";var Ji=Z.forwardRef(({className:e,...t},n)=>{let{open:r,onOpenChange:o}=Or();return r?jsx("div",{ref:n,"data-state":r?"open":"closed",className:m("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),onClick:()=>o(false),"aria-hidden":"true",...t}):null});Ji.displayName="ModalOverlay";var Np=Z.forwardRef(({children:e,onClick:t,...n},r)=>{let{onOpenChange:o}=Or();return jsx("button",{ref:r,type:"button",onClick:s=>{t?.(s),o(false);},...n,children:e})});Np.displayName="ModalClose";var cs=Z.forwardRef(({className:e,children:t,size:n,showCloseButton:r=true,onEscapeKeyDown:o,onInteractOutside:a,...s},i)=>{let{open:l,onOpenChange:c,titleId:d,descriptionId:u}=Or(),[p,f]=Z.useState(false),g=Z.useRef(null);return Z.useEffect(()=>{f(true);},[]),Z.useEffect(()=>{if(l)return cn(),()=>dn()},[l]),Z.useEffect(()=>{if(!l)return;let v=b=>{b.key==="Escape"&&(o?.(),c(false));};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[l,c,o]),as(g,{enabled:l,returnFocus:true,autoFocus:true}),!p||!l?null:jsxs(Zi,{children:[jsx(Ji,{}),jsxs("div",{ref:v=>{g.current=v,typeof i=="function"?i(v):i&&(i.current=v);},role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":u,"data-state":l?"open":"closed",className:m(Xi({size:n}),"top-[50%] translate-y-[-50%]",e),...s,children:[t,r&&jsx(Ct,{size:"sm",className:"absolute right-4 top-4 z-10",onClick:()=>c(false)})]})]})});cs.displayName="ModalContent";var kp=({className:e,...t})=>jsx("div",{className:m("flex-shrink-0 flex flex-col space-y-1.5 text-center sm:text-left",e),...t});kp.displayName="ModalHeader";var Sp=({className:e,children:t})=>(Z.useContext(is)?.scrollBehavior??"inside")==="inside"?jsx(ze,{className:m("flex-1 min-h-0 -mx-6 px-6",e),children:t}):jsx("div",{className:m(e),children:t});Sp.displayName="ModalBody";var Ep=({className:e,children:t,...n})=>{let{onOpenChange:r}=Or();return jsx("div",{className:m("flex-shrink-0 flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n,children:Z.Children.map(t,o=>Z.isValidElement(o)?Z.cloneElement(o,{onClick:a=>{o.props.onClick?.(a),r(false);}}):o)})};Ep.displayName="ModalFooter";var Pp=Z.forwardRef(({className:e,...t},n)=>{let{titleId:r}=Or();return jsx("h2",{ref:n,id:r,className:m("text-lg font-semibold leading-none tracking-tight",e),...t})});Pp.displayName="ModalTitle";var Lp=Z.forwardRef(({className:e,...t},n)=>{let{descriptionId:r}=Or();return jsx("p",{ref:n,id:r,className:m("text-sm text-muted-foreground",e),...t})});Lp.displayName="ModalDescription";var Qi=Z.forwardRef(({className:e,...t},n)=>jsx(Command,{ref:n,className:m("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Qi.displayName=Command.displayName;var iR=({children:e,...t})=>jsx(ls,{...t,children:jsx(cs,{className:"overflow-hidden p-0 shadow-lg",showCloseButton:false,children:jsx(Qi,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Dp=Z.forwardRef(({className:e,...t},n)=>jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[jsx(Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),jsx(Command.Input,{ref:n,className:m("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Dp.displayName=Command.Input.displayName;var Hp=Z.forwardRef(({className:e,children:t,...n},r)=>jsx(ze,{className:"max-h-[300px]",children:jsx(Command.List,{ref:r,className:m("overflow-hidden",e),...n,children:t})}));Hp.displayName=Command.List.displayName;var Ip=Z.forwardRef((e,t)=>jsx(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ip.displayName=Command.Empty.displayName;var Vp=Z.forwardRef(({className:e,...t},n)=>jsx(Command.Group,{ref:n,className:m("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Vp.displayName=Command.Group.displayName;var Ap=Z.forwardRef(({className:e,...t},n)=>jsx(Command.Separator,{ref:n,className:m("-mx-1 h-px bg-border",e),...t}));Ap.displayName=Command.Separator.displayName;var zp=Z.forwardRef(({className:e,children:t,startContent:n,endContent:r,...o},a)=>jsxs(Command.Item,{ref:a,className:m("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...o,children:[n,t&&jsx("span",{className:"flex-1",children:t}),r]}));zp.displayName=Command.Item.displayName;var Op=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Op.displayName="CommandShortcut";var dR={sm:{input:"h-9 px-2 text-xs",button:"h-9 w-9",icon:"h-3.5 w-3.5",label:"text-xs",error:"text-xs"},md:{input:"h-10 px-3 text-sm",button:"h-10 w-10",icon:"h-4 w-4",label:"text-sm",error:"text-xs"},lg:{input:"h-11 px-4 text-base",button:"h-11 w-11",icon:"h-5 w-5",label:"text-base",error:"text-sm"}},uR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Bp=Z.forwardRef(({className:e,showToggle:t=true,isDisabled:n,onFocus:r,onBlur:o,style:a,size:s="md",radius:i="md",label:l,isInvalid:c,errorMessage:d,isRequired:u,id:p,...f},g)=>{let[v,b]=Z.useState(false),[h,x]=Z.useState(false),R=dR[s],N=uR[i],w=p||Z.useId();return jsxs("div",{className:"flex flex-col gap-1.5",children:[l&&jsxs("label",{htmlFor:w,className:m("font-medium text-foreground",R.label),children:[l,u&&jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),jsxs("div",{className:"relative",children:[jsx("input",{id:w,type:v?"text":"password",className:m("flex w-full border bg-background py-2 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",c?"border-danger":"border-input",R.input,N,t&&"pr-10",e),ref:g,disabled:n,"aria-invalid":c,"aria-describedby":c&&d?`${w}-error`:void 0,style:{...a,borderColor:c?void 0:h?"var(--color-foreground)":void 0},onFocus:y=>{x(true),r?.(y);},onBlur:y=>{x(false),o?.(y);},...f}),t&&jsx("button",{type:"button",className:m("absolute right-0 top-0 px-3 flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",R.button),onClick:()=>b(!v),disabled:n,tabIndex:-1,"aria-label":v?"Hide password":"Show password",children:v?jsx(EyeOff,{className:R.icon}):jsx(Eye,{className:R.icon})})]}),c&&d&&jsx("p",{id:`${w}-error`,className:m("text-danger",R.error),children:d})]})});Bp.displayName="PasswordInput";var fR={sm:{wrapper:"h-9",input:"h-9 text-xs",button:"h-6 w-6",icon:"h-3 w-3"},md:{wrapper:"h-10",input:"h-10 text-sm",button:"h-7 w-7",icon:"h-3.5 w-3.5"},lg:{wrapper:"h-11",input:"h-11 text-base",button:"h-8 w-8",icon:"h-4 w-4"}},gR={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Jo=Z.forwardRef(({className:e,showButtons:t=true,step:n=1,min:r,max:o,value:a,defaultValue:s,onChange:i,isDisabled:l,size:c="md",radius:d="md",...u},p)=>{let[f,g]=Z.useState(s),[v,b]=Z.useState(false),h=a!==void 0,x=h?a:f,R=fR[c],N=gR[d],w=T=>{T!==void 0&&(r!==void 0&&T<r&&(T=r),o!==void 0&&T>o&&(T=o)),h||g(T),i?.(T);},y=()=>{w((x??0)+n);},C=()=>{w((x??0)-n);},E=T=>{let M=T.target.value;if(M==="")w(void 0);else {let D=parseFloat(M);isNaN(D)||w(D);}},L=T=>{T.key==="ArrowUp"?(T.preventDefault(),y()):T.key==="ArrowDown"&&(T.preventDefault(),C());},k=r===void 0||(x??0)>r,S=o===void 0||(x??0)<o;return t?jsxs("div",{className:m("relative flex items-center border border-input transition-colors",R.wrapper,N,l&&"opacity-50",e),style:{borderColor:v?"var(--color-foreground)":void 0},children:[jsx("button",{type:"button",className:m("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ml-1.5",R.button),onClick:C,disabled:l||!k,tabIndex:-1,"aria-label":"Decrease value",children:jsx(Minus,{className:R.icon})}),jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:m("min-w-0 flex-1 bg-transparent text-center focus:outline-none disabled:cursor-not-allowed [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",R.input),ref:p,value:x??"",onChange:E,onKeyDown:L,disabled:l,onFocus:()=>b(true),onBlur:()=>b(false),...u}),jsx("button",{type:"button",className:m("shrink-0 flex items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed mr-1.5",R.button),onClick:y,disabled:l||!S,tabIndex:-1,"aria-label":"Increase value",children:jsx(Plus,{className:R.icon})})]}):jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:m("flex w-full bg-background px-3 py-2 text-center border border-input placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",R.input,N,e),style:{borderColor:v?"var(--color-foreground)":void 0},ref:p,value:x??"",onChange:E,onKeyDown:L,disabled:l,onFocus:()=>b(true),onBlur:()=>b(false),...u})});Jo.displayName="NumberInput";var Gp=cva("flex -space-x-2",{variants:{size:{sm:"-space-x-2",md:"-space-x-2.5",lg:"-space-x-3"}},defaultVariants:{size:"md"}}),$p=cva("border-2 border-background ring-0 cursor-pointer transition-transform duration-200 hover:-translate-y-1",{variants:{size:{sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base"}},defaultVariants:{size:"md"}}),Up=Z.forwardRef(({className:e,items:t,max:n=5,size:r,showTooltips:o=false,...a},s)=>{let i=t.slice(0,n),l=t.length-n,c=(u,p)=>{let f=jsxs(Dr,{className:m($p({size:r})),children:[u.src&&jsx(so,{src:u.src,alt:u.alt||""}),jsx(Hr,{className:"text-xs",children:u.fallback||u.alt?.charAt(0)?.toUpperCase()||"?"})]});return o&&u.alt?jsx(Rn,{content:u.alt,delayDuration:300,children:f},p):jsx(Z.Fragment,{children:f},p)};return jsxs("div",{ref:s,className:m(Gp({size:r,className:e})),...a,children:[i.map((u,p)=>c(u,p)),l>0&&jsx(Dr,{className:m($p({size:r})),children:jsxs(Hr,{className:"bg-muted text-muted-foreground",children:["+",l]})})]})});Up.displayName="AvatarGroup";var _p=cva("flex gap-0.5",{variants:{size:{sm:"[&_svg]:h-4 [&_svg]:w-4",md:"[&_svg]:h-5 [&_svg]:w-5",lg:"[&_svg]:h-6 [&_svg]:w-6"}},defaultVariants:{size:"md"}}),jp=Z.forwardRef(({className:e,value:t,defaultValue:n=0,onValueChange:r,max:o=5,size:a,icon:s="star",allowHalf:i=false,isReadOnly:l=false,isDisabled:c=false,filledColor:d,emptyColor:u,...p},f)=>{let[g,v]=Z.useState(n),[b,h]=Z.useState(null),x=t!==void 0,R=x?t:g,N=b!==null?b:R,w=M=>{l||c||(x||v(M),r?.(M));},y=(M,D=false)=>{let P=i&&D?M+.5:M+1;w(P);},C=(M,D)=>{if(l||c)return;let P=M.currentTarget.getBoundingClientRect(),I=i&&M.clientX<P.left+P.width/2;h(I?D+.5:D+1);},E=()=>{h(null);},L=s==="heart"?Heart:Star,k=M=>N>=M+1?"full":N>=M+.5?"half":"empty",S=d?{color:d,fill:d}:{},T=u?{color:u}:{};return jsx("div",{ref:f,className:m(_p({size:a,className:e}),c&&"opacity-50 cursor-not-allowed"),onMouseLeave:E,role:"radiogroup","aria-label":"Rating",...p,children:Array.from({length:o},(M,D)=>{let P=k(D);return jsxs("button",{type:"button",className:m("relative focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-sm",!l&&!c&&"cursor-pointer hover:scale-110 transition-transform"),onClick:I=>{let H=I.currentTarget.getBoundingClientRect(),A=i&&I.clientX<H.left+H.width/2;y(D,A);},onMouseMove:I=>C(I,D),disabled:c||l,"aria-label":`Rate ${D+1} out of ${o}`,role:"radio","aria-checked":R===D+1,children:[jsx(L,{className:m("text-muted-foreground/30",P!=="empty"&&"absolute inset-0"),style:P==="empty"?T:void 0}),P!=="empty"&&jsx(L,{className:m("text-yellow-500 fill-yellow-500",s==="heart"&&"text-red-500 fill-red-500",P==="half"&&"clip-path-half"),style:{...S,clipPath:P==="half"?"inset(0 50% 0 0)":void 0}})]},D)})})});jp.displayName="Rating";var Yp=cva("inline-flex items-center justify-center gap-1.5 text-sm font-medium 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-default",{variants:{variant:{solid:"border-transparent text-primary-foreground",bordered:"border bg-transparent",light:"bg-transparent border-transparent",flat:"border-transparent"},color:{primary:"",success:"",warning:"",danger:""},size:{sm:"h-6 px-2 text-xs",md:"h-7 px-2.5 text-sm",lg:"h-8 px-3 text-sm"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},clickable:{true:"cursor-pointer",false:""}},compoundVariants:[{variant:"solid",color:"primary",className:"bg-primary hover:bg-primary/90"},{variant:"solid",color:"success",className:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-700 dark:hover:bg-green-600"},{variant:"solid",color:"warning",className:"bg-amber-600 text-white hover:bg-amber-700 dark:bg-amber-700 dark:hover:bg-amber-600"},{variant:"solid",color:"danger",className:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:hover:bg-red-600"},{variant:"bordered",color:"primary",className:"text-primary !border-primary hover:bg-primary/10"},{variant:"bordered",color:"success",className:"text-green-600 !border-green-600 hover:bg-green-600/10 dark:text-green-500 dark:!border-green-500"},{variant:"bordered",color:"warning",className:"text-amber-600 !border-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:!border-amber-500"},{variant:"bordered",color:"danger",className:"text-red-600 !border-red-600 hover:bg-red-600/10 dark:text-red-500 dark:!border-red-500"},{variant:"light",color:"primary",className:"text-primary hover:bg-primary/10"},{variant:"light",color:"success",className:"text-green-600 hover:bg-green-600/10 dark:text-green-500 dark:hover:bg-green-500/10"},{variant:"light",color:"warning",className:"text-amber-600 hover:bg-amber-600/10 dark:text-amber-500 dark:hover:bg-amber-500/10"},{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:"primary",className:"bg-primary/20 text-primary"},{variant:"flat",color:"success",className:"bg-green-600/20 text-green-700 dark:bg-green-500/20 dark:text-green-500"},{variant:"flat",color:"warning",className:"bg-amber-600/20 text-amber-700 dark:bg-amber-500/20 dark:text-amber-500"},{variant:"flat",color:"danger",className:"bg-red-600/20 text-red-700 dark:bg-red-500/20 dark:text-red-500"}],defaultVariants:{variant:"solid",color:"primary",size:"md",radius:"full",clickable:false}}),wR={sm:"sm",md:"sm",lg:"sm"},qp=Z.forwardRef(({className:e,variant:t,color:n,size:r,radius:o,clickable:a,startContent:s,endContent:i,closable:l,onClose:c,isDisabled:d,children:u,onClick:p,...f},g)=>{let v=a||!!p,b=h=>{h.stopPropagation(),c?.();};return jsxs("div",{ref:g,role:v?"button":void 0,tabIndex:v&&!d?0:void 0,"aria-disabled":d,onClick:d?void 0:p,onKeyDown:v&&!d?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),p?.(h));}:void 0,className:m(Yp({variant:t,color:n,size:r,radius:o,clickable:v}),d&&"opacity-50 cursor-not-allowed",e),...f,children:[s&&jsx("span",{className:"shrink-0",children:s}),jsx("span",{className:"truncate",children:u}),i&&jsx("span",{className:"shrink-0",children:i}),l&&jsx(Ct,{size:wR[r??"md"],onClick:b,disabled:d,className:"ml-0.5 h-4 w-4"})]})});qp.displayName="Chip";var Xp=createContext({direction:"horizontal"}),PR=({className:e,direction:t="horizontal",children:n,...r})=>jsx(Xp.Provider,{value:{direction:t},children:jsx(Group,{orientation:t,className:m("flex h-full w-full data-[orientation=vertical]:flex-col",e),...r,children:n})}),LR=Panel,DR=({withHandle:e,className:t,...n})=>{let{direction:r}=useContext(Xp),o=r==="vertical";return jsx(Separator,{className:m("relative flex shrink-0 items-center justify-center bg-border outline-none",o?"h-px w-full after:absolute after:inset-x-0 after:top-1/2 after:h-1 after:-translate-y-1/2":"w-px after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2",t),...n,children:e&&jsx("div",{className:m("z-10 flex items-center justify-center rounded-sm border bg-border",o?"h-3 w-4 rotate-90":"h-4 w-3"),children:jsx(GripVertical,{className:"h-2.5 w-2.5"})})})};var ef=cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-24 w-24"},color:{default:"",primary:"",success:"",warning:"",danger:""}},defaultVariants:{size:"md",color:"default"}}),IR={sm:{size:32,strokeWidth:3,fontSize:"text-[10px]"},md:{size:48,strokeWidth:4,fontSize:"text-xs"},lg:{size:64,strokeWidth:5,fontSize:"text-sm"},xl:{size:96,strokeWidth:6,fontSize:"text-base"}},Zp={default:"var(--color-foreground, #18181b)",primary:"var(--color-primary, #18181b)",success:"var(--color-success, #16a34a)",warning:"var(--color-warning, #d97706)",danger:"var(--color-danger, #dc2626)"},tf=Z.forwardRef(({className:e,size:t="md",color:n="default",value:r=0,max:o=100,showValue:a=false,formatValue:s=u=>`${Math.round(u)}%`,trackClassName:i,isIndeterminate:l=false,...c},d)=>{let u=Math.min(100,Math.max(0,r/o*100)),p=IR[t],f=(p.size-p.strokeWidth)/2,g=2*Math.PI*f,v=l?g*.75:g-u/100*g;return jsxs("div",{ref:d,className:m(ef({size:t,color:n}),e),role:"progressbar","aria-valuenow":l?void 0:r,"aria-valuemin":0,"aria-valuemax":o,...c,children:[jsxs("svg",{width:p.size,height:p.size,viewBox:`0 0 ${p.size} ${p.size}`,fill:"none",className:m(l&&"animate-spin"),children:[jsx("circle",{className:m("stroke-muted",i),cx:p.size/2,cy:p.size/2,r:f,strokeWidth:p.strokeWidth,fill:"none"}),jsx("circle",{cx:p.size/2,cy:p.size/2,r:f,strokeWidth:p.strokeWidth,fill:"none",strokeLinecap:"round",stroke:Zp[n]||Zp.default,strokeDasharray:`${g} ${g}`,strokeDashoffset:v,style:{transformOrigin:"center",transform:"rotate(-90deg)",transition:l?void 0:"stroke-dashoffset 0.3s ease-in-out"}})]}),a&&!l&&jsx("span",{className:m("absolute font-medium text-foreground",p.fontSize),children:s(u)})]})});tf.displayName="CircularProgress";var nf=Z.createContext(null),zR=()=>{let e=Z.useContext(nf);if(!e)throw new Error("OTP components must be used within InputOTP");return e},rf=cva("flex items-center gap-2 has-[:disabled]:opacity-50",{variants:{size:{sm:"[&_[data-otp-slot]]:h-8 [&_[data-otp-slot]]:w-8 [&_[data-otp-slot]]:text-xs",md:"[&_[data-otp-slot]]:h-10 [&_[data-otp-slot]]:w-10 [&_[data-otp-slot]]:text-sm",lg:"[&_[data-otp-slot]]:h-12 [&_[data-otp-slot]]:w-12 [&_[data-otp-slot]]:text-base"}},defaultVariants:{size:"md"}}),of=Z.forwardRef(({className:e,containerClassName:t,maxLength:n,value:r,defaultValue:o="",onChange:a,onComplete:s,pattern:i,isDisabled:l=false,size:c,radius:d="md",children:u,...p},f)=>{let[g,v]=Z.useState(o),[b,h]=Z.useState(0),[x,R]=Z.useState(false),N=Z.useRef(null),w=r!==void 0?r:g;Z.useImperativeHandle(f,()=>N.current),Z.useEffect(()=>{h(Math.min(w.length,n-1));},[w,n]),Z.useEffect(()=>{w.length===n&&s&&s(w);},[w,n,s]);let y=T=>{let M=T.target.value;if(i&&M){let D=new RegExp(i.replace("^","").replace("$","").replace("+",""));M=M.split("").filter(P=>D.test(P)).join("");}M=M.slice(0,n),r===void 0&&v(M),a?.(M);},C=T=>{T.key==="ArrowLeft"?h(M=>Math.max(0,M-1)):T.key==="ArrowRight"&&h(M=>Math.min(w.length,n-1,M+1));},E=()=>{N.current?.focus();},L=()=>{R(true),h(Math.min(w.length,n-1));},k=()=>{R(false);},S={value:w,activeIndex:x?b:-1,maxLength:n,isDisabled:l,radius:d};return jsx(nf.Provider,{value:S,children:jsxs("div",{className:m(rf({size:c}),t),onClick:E,"data-otp-container":true,children:[jsx("input",{ref:N,type:"text",inputMode:"numeric",autoComplete:"one-time-code",value:w,onChange:y,onKeyDown:C,onFocus:L,onBlur:k,disabled:l,maxLength:n,className:m("absolute opacity-0 pointer-events-none w-0 h-0",e),...p}),u]})})});of.displayName="InputOTP";var af=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center",e),...t}));af.displayName="InputOTPGroup";var OR={none:"first:rounded-l-none",sm:"first:rounded-l-md",md:"first:rounded-l-lg",lg:"first:rounded-l-xl",full:"first:rounded-l-full"},FR={none:"last:rounded-r-none",sm:"last:rounded-r-md",md:"last:rounded-r-lg",lg:"last:rounded-r-xl",full:"last:rounded-r-full"},sf=Z.forwardRef(({index:e,className:t,...n},r)=>{let{value:o,activeIndex:a,isDisabled:s,radius:i}=zR(),l=o[e]||"",c=a===e,d=c&&o.length===e;return jsxs("div",{ref:r,"data-otp-slot":true,"data-active":c,"data-filled":!!l,className:m("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm font-medium transition-all first:border-l",OR[i],FR[i],c&&"z-10 ring-1 ring-foreground",s&&"cursor-not-allowed opacity-50",t),...n,children:[l,d&&jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});sf.displayName="InputOTPSlot";var lf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("text-muted-foreground",e),...t,children:jsx(Minus,{className:"h-4 w-4"})}));lf.displayName="InputOTPSeparator";var uf=cva("inline-flex items-center gap-1 rounded-full text-xs font-medium transition-colors",{variants:{variant:{solid:"bg-primary text-primary-foreground",bordered:"border border-border bg-transparent text-foreground",flat:"bg-secondary text-secondary-foreground"},size:{sm:"h-5 px-2 text-xs",md:"h-6 px-2.5 text-xs",lg:"h-7 px-3 text-sm"}},defaultVariants:{variant:"flat",size:"md"}}),mf=Z.forwardRef(({className:e,variant:t,size:n,value:r=[],onChange:o,placeholder:a="Add tag...",maxTags:s,minTagLength:i=1,maxTagLength:l=50,triggerKeys:c=["Enter",",","Tab"],allowDuplicates:d=false,isDisabled:u,readOnly:p,renderTag:f,...g},v)=>{let[b,h]=Z.useState(""),[x,R]=Z.useState(false),N=Z.useRef(null);Z.useImperativeHandle(v,()=>N.current);let w=T=>{let M=T.trim();if(M.length<i||M.length>l||s&&r.length>=s||!d&&r.some(P=>P.text.toLowerCase()===M.toLowerCase()))return;let D={id:crypto.randomUUID(),text:M};o?.([...r,D]),h("");},y=T=>{u||p||o?.(r.filter(M=>M.id!==T));},C=T=>{if(c.includes(T.key)){if(T.key==="Tab"&&!b)return;T.preventDefault(),w(b);}T.key==="Backspace"&&!b&&r.length>0&&y(r[r.length-1].id);},E=T=>{let M=T.target.value;if(M.includes(",")){M.split(",").forEach(P=>{P.trim()&&w(P);});return}h(M);},L=T=>{T.preventDefault(),T.clipboardData.getData("text").split(/[,\n\t]/).filter(Boolean).forEach(P=>{w(P);});},k=()=>{N.current?.focus();},S=s?r.length>=s:false;return jsxs("div",{className:m("flex min-h-10 w-full flex-wrap gap-1.5 rounded-md border border-input bg-background px-3 py-2 text-sm transition-colors",u&&"cursor-not-allowed opacity-50",e),style:{borderColor:x?"var(--color-foreground)":void 0},onClick:k,children:[r.map(T=>f?f(T,()=>y(T.id)):jsxs("span",{className:m(uf({variant:t,size:n})),children:[T.text,!u&&!p&&jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),y(T.id);},className:"ml-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10","aria-label":`Remove ${T.text}`,children:jsx(X,{className:"h-3 w-3"})})]},T.id)),!S&&!p&&jsx("input",{ref:N,type:"text",value:b,onChange:E,onKeyDown:C,onPaste:L,onFocus:()=>R(true),onBlur:()=>R(false),placeholder:r.length===0?a:"",disabled:u,className:m("flex-1 bg-transparent outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed","min-w-[80px]"),...g})]})});mf.displayName="TagInput";var KR={sm:{container:"gap-2 py-6",icon:"[&>svg]:h-8 [&>svg]:w-8",title:"text-base",description:"text-xs max-w-xs"},md:{container:"gap-3 py-10",icon:"[&>svg]:h-10 [&>svg]:w-10",title:"text-lg",description:"text-sm max-w-sm"},lg:{container:"gap-4 py-14",icon:"[&>svg]:h-12 [&>svg]:w-12",title:"text-xl",description:"text-base max-w-md"}},ff=Z.forwardRef(({className:e,icon:t,title:n,description:r,action:o,size:a="md",children:s,...i},l)=>{let c=KR[a];return jsxs("div",{ref:l,className:m("flex flex-col items-center justify-center text-center",c.container,e),...i,children:[t&&jsx("div",{className:m("text-muted-foreground",c.icon),children:t}),n&&jsx("h3",{className:m("font-semibold text-foreground",c.title),children:n}),r&&jsx("p",{className:m("text-muted-foreground",c.description),children:r}),o&&jsx("div",{className:"mt-2",children:o}),s]})});ff.displayName="EmptyState";var bf=cva("border p-6 text-card-foreground shadow-sm",{variants:{variant:{solid:"bg-zinc-800 text-white border-zinc-800 dark:bg-zinc-200 dark:text-zinc-900 dark:border-zinc-200",bordered:"border border-zinc-300 bg-transparent dark:border-zinc-700",light:"bg-transparent border-transparent shadow-none",flat:"bg-zinc-100 border-transparent dark:bg-zinc-800",ghost:"border border-zinc-300 dark:border-zinc-700 bg-transparent hover:bg-zinc-900 hover:text-white hover:border-zinc-900 dark:hover:bg-white dark:hover:text-zinc-900 dark:hover:border-white"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"bordered",radius:"md"}}),vf=Z.forwardRef(({className:e,variant:t,radius:n,label:r,value:o,icon:a,trend:s,trendValue:i,description:l,...c},d)=>{let u=s==="up"?TrendingUp:s==="down"?TrendingDown:Minus,p=s==="up"?"text-green-500":s==="down"?"text-red-500":"text-muted-foreground";return jsxs("div",{ref:d,className:m(bf({variant:t,radius:n,className:e})),...c,children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("p",{className:m("text-sm font-medium",t==="solid"?"opacity-80":"text-muted-foreground"),children:r}),a&&jsx("div",{className:m("[&>svg]:h-4 [&>svg]:w-4",t==="solid"?"opacity-80":"text-muted-foreground"),children:a})]}),jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[jsx("p",{className:"text-2xl font-bold",children:o}),s&&i&&jsxs("span",{className:m("flex items-center gap-0.5 text-sm",p),children:[jsx(u,{className:"h-3 w-3"}),i]})]}),l&&jsx("p",{className:m("mt-1 text-xs",t==="solid"?"opacity-70":"text-muted-foreground"),children:l})]})});vf.displayName="StatCard";var ra=cva("flex flex-col",{variants:{variant:{default:"gap-2",bordered:"divide-y divide-border rounded-lg border",striped:"gap-2 [&>*:nth-child(odd)]:bg-muted/50",filled:"gap-2 bg-muted/30 rounded-lg p-2",cards:"gap-2"},size:{sm:"[&>*]:py-2 [&>*]:px-3",md:"[&>*]:py-3 [&>*]:px-4",lg:"[&>*]:py-4 [&>*]:px-5"}},defaultVariants:{variant:"default",size:"md"}}),fs=({checked:e,isDisabled:t,onClick:n})=>jsx("button",{type:"button",role:"checkbox","aria-checked":e,disabled:t,onClick:r=>{r.stopPropagation(),t||n(r);},className:m("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",e&&"bg-primary text-primary-foreground",t&&"cursor-not-allowed opacity-50"),children:e&&jsx("span",{className:"flex items-center justify-center text-current",children:jsx(Check,{className:"h-3 w-3"})})});function sw({item:e,index:t,renderItem:n,showHandle:r,dragIcon:o,selectable:a,checkable:s,isSelected:i,isChecked:l,isCards:c,onSelect:d,onCheck:u}){let{attributes:p,listeners:f,setNodeRef:g,transform:v,transition:b,isDragging:h}=useSortable({id:e.id}),x={transform:CSS.Transform.toString(v),transition:b};return jsxs("div",{ref:g,...p,style:x,role:"listitem","aria-selected":a?i:void 0,onClick:a&&!s?R=>d?.(e,R):void 0,className:m("flex items-center gap-3 transition-all",c&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",c&&i&&"border-primary bg-accent",!c&&a&&!s&&"cursor-pointer hover:bg-muted/50",!c&&s&&"cursor-pointer hover:bg-muted/50",!c&&i&&a&&!s&&"bg-primary/10",h&&"opacity-50 z-10",(a||s)&&"cursor-pointer"),children:[r&&o!==false&&jsx("div",{className:"shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",...f,children:o??jsx(GripVertical,{className:"h-5 w-5"})}),s&&jsx(fs,{checked:l,onClick:R=>u?.(e,R)}),jsx("div",{className:"flex-1 min-w-0",children:n(e,t)})]})}function iw({className:e,variant:t,size:n,items:r,renderItem:o,draggable:a=false,onReorder:s,showHandle:i=true,dragIcon:l,selectable:c=false,multiple:d=false,selectedKeys:u,defaultSelectedKeys:p=[],onSelect:f,checkable:g=false,checkedKeys:v,defaultCheckedKeys:b=[],onCheck:h,emptyContent:x,children:R,virtualized:N=false,height:w,itemHeight:y,overscan:C=3,gap:E=0,...L},k){let[S,T]=Z.useState(false),[M,D]=Z.useState(null),[P,I]=Z.useState(0),H=Z.useRef(null);Z.useEffect(()=>{T(true);},[]),Z.useImperativeHandle(k,()=>H.current);let[A,B]=Z.useState(new Set(p)),$=u!==void 0,j=$?new Set(u):A,[G,U]=Z.useState(new Set(b)),W=v!==void 0,V=W?new Set(v):G,z=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),K=Z.useCallback((O,F)=>{if(!r)return;let q=new Set(j),X=!q.has(O.id);d?X?q.add(O.id):q.delete(O.id):(q.clear(),X&&q.add(O.id)),$||B(q);let Re=r.filter(Te=>q.has(Te.id));f?.(Array.from(q),{selected:X,selectedItems:Re,item:O,event:F});},[r,j,d,$,f]),Y=Z.useCallback((O,F)=>{if(!r)return;let q=new Set(V),X=!q.has(O.id);X?q.add(O.id):q.delete(O.id),W||U(q);let Re=r.filter(Te=>q.has(Te.id));h?.(Array.from(q),{checked:X,checkedItems:Re,item:O,event:F});},[r,V,W,h]),Q=O=>{if(!r)return;let F=r.find(q=>q.id===O.active.id);F&&D(F);},J=O=>{let{active:F,over:q}=O;if(D(null),!r||!q||F.id===q.id)return;let X=r.findIndex(Te=>Te.id===F.id),Re=r.findIndex(Te=>Te.id===q.id);if(X!==-1&&Re!==-1){let Te=[...r],[ot]=Te.splice(X,1);Te.splice(Re,0,ot),s?.(Te);}},be=(a||c||g)&&r&&o,_=t==="cards";if(r&&r.length===0&&x)return jsx("div",{ref:k,className:m("flex items-center justify-center p-8 text-muted-foreground",e),...L,children:x});if(N&&r&&o&&w&&y){let O=y+E,F=r.length*O-E,q=Math.max(0,Math.floor(P/O)-C),X=Math.ceil(w/O)+2*C,Re=Math.min(r.length-1,q+X),Te=ue=>{I(ue.currentTarget.scrollTop);},ot=[];for(let ue=q;ue<=Re;ue++)r[ue]!==void 0&&ot.push({item:r[ue],index:ue,style:{position:"absolute",top:ue*O,left:0,right:0,height:y}});return jsx("div",{ref:H,role:"list",className:m("overflow-auto w-full",t==="bordered"&&"border rounded-lg",e),style:{height:w,position:"relative"},onScroll:Te,...L,children:jsx("div",{style:{height:F,position:"relative",width:"100%"},children:ot.map(({item:ue,index:tt,style:te})=>{let at=j.has(ue.id),qt=V.has(ue.id);return jsxs("div",{role:"listitem","aria-selected":c?at:void 0,onClick:c&&!g?ne=>K(ue,ne):void 0,style:te,className:m("flex items-center gap-3 transition-all",_&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",_&&at&&"border-primary bg-accent",!_&&c&&!g&&"cursor-pointer hover:bg-muted/50",!_&&g&&"cursor-pointer hover:bg-muted/50",!_&&at&&c&&!g&&"bg-primary/10",(c||g)&&"cursor-pointer"),children:[g&&jsx(fs,{checked:qt,onClick:ne=>Y(ue,ne)}),jsx("div",{className:"flex-1 min-w-0 px-4",children:o(ue,tt)})]},ue.id)})})})}return be?a?S?jsxs(DndContext,{sensors:z,collisionDetection:closestCenter,onDragStart:Q,onDragEnd:J,children:[jsx("div",{ref:k,role:"list",className:m(ra({variant:t,size:n,className:e})),...L,children:jsx(SortableContext,{items:r.map(O=>O.id),strategy:verticalListSortingStrategy,children:r.map((O,F)=>jsx(sw,{item:O,index:F,renderItem:o,showHandle:i,dragIcon:l,selectable:c,checkable:g,isSelected:j.has(O.id),isChecked:V.has(O.id),isCards:_,onSelect:K,onCheck:Y},O.id))})}),jsx(DragOverlay,{children:M&&o&&jsxs("div",{className:"flex items-center gap-3 bg-background border shadow-lg rounded-md p-3 opacity-90",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),jsx("div",{className:"flex-1 min-w-0",children:o(M,r?.indexOf(M)??0)})]})})]}):jsx("div",{ref:k,role:"list",className:m(ra({variant:t,size:n,className:e})),...L,children:r.map((O,F)=>jsxs("div",{role:"listitem",className:"flex items-center gap-3 transition-all",children:[i&&l!==false&&jsx("div",{className:"shrink-0 text-muted-foreground",children:l??jsx(GripVertical,{className:"h-5 w-5"})}),g&&jsx(fs,{checked:V.has(O.id),onClick:q=>Y(O,q)}),jsx("div",{className:"flex-1 min-w-0",children:o(O,F)})]},O.id))}):jsx("div",{ref:k,role:"list",className:m(ra({variant:t,size:n,className:e})),...L,children:r.map((O,F)=>{let q=j.has(O.id),X=V.has(O.id);return jsxs("div",{role:"listitem","aria-selected":c?q:void 0,onClick:c&&!g?Re=>K(O,Re):void 0,className:m("flex items-center gap-3 transition-all",_&&"rounded-lg border hover:border-primary/50 hover:bg-accent/50",_&&q&&"border-primary bg-accent",!_&&c&&!g&&"cursor-pointer hover:bg-muted/50",!_&&g&&"cursor-pointer hover:bg-muted/50",!_&&q&&c&&!g&&"bg-primary/10",(c||g)&&"cursor-pointer"),children:[g&&jsx(fs,{checked:X,onClick:Re=>Y(O,Re)}),jsx("div",{className:"flex-1 min-w-0",children:o(O,F)})]},O.id)})}):jsx("div",{ref:k,role:"list",className:m(ra({variant:t,size:n,className:e})),...L,children:R})}var lw=Z.forwardRef(iw),yf=cva("flex items-center gap-3 transition-colors",{variants:{interactive:{true:"cursor-pointer hover:bg-muted/50",false:""}},defaultVariants:{interactive:false}}),Rf=Z.forwardRef(({className:e,interactive:t,leading:n,trailing:r,children:o,...a},s)=>jsxs("div",{ref:s,role:"listitem",className:m(yf({interactive:t,className:e})),...a,children:[n&&jsx("div",{className:"shrink-0 text-muted-foreground",children:n}),jsx("div",{className:"flex-1 min-w-0",children:o}),r&&jsx("div",{className:"shrink-0 whitespace-nowrap",children:r})]}));Rf.displayName="ListItem";var wf=Z.forwardRef(({className:e,primary:t,secondary:n,children:r,...o},a)=>jsxs("div",{ref:a,className:m("min-w-0",e),...o,children:[t&&jsx("p",{className:"text-sm font-medium leading-none truncate",children:t}),n&&jsx("p",{className:"mt-1 text-sm text-muted-foreground truncate",children:n}),r]}));wf.displayName="ListItemText";var Tf=cva("flex flex-col",{variants:{position:{left:"",right:"",alternate:""}},defaultVariants:{position:"left"}}),Nf=Z.forwardRef(({className:e,position:t,...n},r)=>jsx("div",{ref:r,"data-position":t,className:m(Tf({position:t,className:e})),...n}));Nf.displayName="Timeline";var kf=cva("relative flex gap-4 pb-8 last:pb-0",{variants:{variant:{default:"",success:"[&_[data-timeline-dot]]:bg-green-500 [&_[data-timeline-dot]]:border-green-500",warning:"[&_[data-timeline-dot]]:bg-yellow-500 [&_[data-timeline-dot]]:border-yellow-500",error:"[&_[data-timeline-dot]]:bg-red-500 [&_[data-timeline-dot]]:border-red-500",info:"[&_[data-timeline-dot]]:bg-blue-500 [&_[data-timeline-dot]]:border-blue-500"}},defaultVariants:{variant:"default"}}),Sf=Z.forwardRef(({className:e,variant:t,hideSeparator:n=false,hideConnector:r=false,dot:o,children:a,...s},i)=>jsxs("div",{ref:i,className:m(kf({variant:t,className:e})),...s,children:[!n&&jsxs("div",{className:"flex flex-col items-center",children:[jsx("div",{"data-timeline-dot":true,className:"flex h-3 w-3 items-center justify-center rounded-full border-2 border-primary bg-primary",children:o}),!r&&jsx("div",{className:"w-0.5 flex-1 bg-border"})]}),a]}));Sf.displayName="TimelineItem";var Ef=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex-1 pt-0.5",e),...t}));Ef.displayName="TimelineContent";var Pf=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex-1 text-sm text-muted-foreground pt-0.5",e),...t}));Pf.displayName="TimelineOpposite";var Lf=cva("relative flex flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",{variants:{variant:{default:"border-input bg-background hover:bg-accent/50",active:"border-primary bg-primary/5",error:"border-danger bg-danger/5"},size:{sm:"p-4 min-h-[120px]",md:"p-6 min-h-[160px]",lg:"p-8 min-h-[200px]"}},defaultVariants:{variant:"default",size:"md"}}),hw={sm:{icon:"h-5 w-5",iconContainer:"p-2",title:"text-xs",subtitle:"text-[10px]"},md:{icon:"h-6 w-6",iconContainer:"p-3",title:"text-sm",subtitle:"text-xs"},lg:{icon:"h-8 w-8",iconContainer:"p-4",title:"text-base",subtitle:"text-sm"}},Df=e=>{let t=e.type;return t.startsWith("image/")?Image$1:t.startsWith("video/")?FileVideo:t.startsWith("audio/")?FileAudio:t.includes("pdf")||t.includes("document")?FileText:t.includes("zip")||t.includes("rar")||t.includes("archive")?FileArchive:File},gs=e=>{if(e===0)return "0 Bytes";let t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]},Hf=(e,t,n)=>{let r=[];return t&&e.size>t&&r.push({code:"file-too-large",message:`File is larger than ${gs(t)}`}),n&&n.length>0&&(n.some(a=>{if(a.startsWith("."))return e.name.toLowerCase().endsWith(a.toLowerCase());if(a.endsWith("/*")){let s=a.slice(0,-2);return e.type.startsWith(s)}return e.type===a})||r.push({code:"file-invalid-type",message:`File type not accepted. Accepted: ${n.join(", ")}`})),r},If=Z.forwardRef(({className:e,variant:t,size:n="md",onFilesChange:r,onFilesRejected:o,onFileRemove:a,files:s=[],showFileList:i=true,children:l,maxSize:c=10*1024*1024,accept:d,multiple:u=true,isDisabled:p,...f},g)=>{let v=hw[n],[b,h]=Z.useState(false),[x,R]=Z.useState(false),[N,w]=Z.useState([]),y=Z.useRef(null),C=Z.useCallback(H=>{if(!H||H.length===0)return;let A=Array.from(H),B=[],$=[];(u?A:[A[0]]).forEach(G=>{let U=Hf(G,c,d);U.length>0?$.push({file:G,errors:U}):B.push(G);}),w($),B.length>0&&r?.(B),$.length>0&&o?.($);},[c,d,u,r,o]),E=Z.useCallback(H=>{if(H.preventDefault(),H.stopPropagation(),!p&&(h(true),H.dataTransfer.items)){let B=Array.from(H.dataTransfer.items).some($=>{if($.kind!=="file")return true;if(d&&d.length>0){let j=$.type;return !d.some(G=>G.endsWith("/*")?j.startsWith(G.slice(0,-2)):j===G)}return false});R(B);}},[p,d]),L=Z.useCallback(H=>{H.preventDefault(),H.stopPropagation(),!p&&(H.dataTransfer.dropEffect="copy");},[p]),k=Z.useCallback(H=>{H.preventDefault(),H.stopPropagation();let A=H.currentTarget.getBoundingClientRect(),B=H.clientX,$=H.clientY;(B<A.left||B>A.right||$<A.top||$>A.bottom)&&(h(false),R(false));},[]),S=Z.useCallback(H=>{H.preventDefault(),H.stopPropagation(),h(false),R(false),!p&&C(H.dataTransfer.files);},[p,C]),T=Z.useCallback(()=>{p||y.current?.click();},[p]),M=Z.useCallback(H=>{C(H.target.files),H.target.value="";},[C]),D=Z.useCallback(H=>{p||(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),y.current?.click());},[p]),P=x?"error":b?"active":t,I=d?.join(",");return jsxs("div",{ref:g,className:m("space-y-4",e),...f,children:[jsxs("div",{role:"button",tabIndex:p?-1:0,onDragEnter:E,onDragOver:L,onDragLeave:k,onDrop:S,onClick:T,onKeyDown:D,className:m(Lf({variant:P,size:n}),p&&"opacity-50 cursor-not-allowed",!p&&"cursor-pointer focus:outline-none"),"aria-disabled":p,children:[jsx("input",{ref:y,type:"file",accept:I,multiple:u,disabled:p,onChange:M,className:"sr-only",tabIndex:-1}),l||jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[jsx("div",{className:m("rounded-full bg-muted",v.iconContainer),children:jsx(Upload,{className:m(v.icon,"text-muted-foreground")})}),jsxs("div",{className:"space-y-1",children:[jsx("p",{className:m(v.title,"font-medium"),children:b?"Drop files here":"Drop files or click to upload"}),jsxs("p",{className:m(v.subtitle,"text-muted-foreground"),children:[c&&`Max ${gs(c)}`,d&&d.length>0&&` \u2022 ${d.join(", ")}`]})]})]})]}),N.length>0&&jsx("div",{className:"rounded-md bg-danger/10 p-3 text-sm text-danger",children:N.map(({file:H,errors:A})=>jsxs("div",{children:[jsx("span",{className:"font-medium",children:H.name}),":"," ",A.map(B=>B.message).join(", ")]},H.name))}),i&&s.length>0&&jsx("div",{className:"space-y-2",children:s.map(H=>{let A=Df(H.file);return jsxs("div",{className:m("flex items-center gap-3 rounded-lg border p-3",H.error&&"border-danger bg-danger/5"),children:[jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-muted",children:jsx(A,{className:"h-5 w-5 text-muted-foreground"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("p",{className:"truncate text-sm font-medium",children:H.file.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[gs(H.file.size),H.error&&jsx("span",{className:"ml-2 text-danger",children:H.error})]}),H.progress!==void 0&&H.progress<100&&jsx(Ja,{value:H.progress,className:"mt-2 h-1"})]}),jsxs(me,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:B=>{B.stopPropagation(),a?.(H.file);},children:[jsx(X,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Remove"})]})]},H.id)})})]})});If.displayName="FileUpload";var xw=`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")`,Af=cva("relative rounded-md border border-input shadow-sm transition-all 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:{xs:"h-4 w-4",sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10",xl:"h-12 w-12"},shape:{square:"rounded-md",circle:"rounded-full"},interactive:{true:"cursor-pointer hover:scale-110 active:scale-105",false:"cursor-default"}},defaultVariants:{size:"md",shape:"square",interactive:false}}),sa=Z.forwardRef(({color:e,isSelected:t,showTransparency:n=true,onSelect:r,size:o,shape:a,interactive:s,className:i,onClick:l,disabled:c,selectedRingColor:d,...u},p)=>jsx("button",{ref:p,type:"button",disabled:c,onClick:v=>{l?.(v),r?.(e);},className:m(Af({size:o,shape:a,interactive:s??(!!r||!!l)}),t&&"ring-2 ring-offset-2",i),style:{backgroundImage:n?xw:void 0,backgroundSize:n?"8px 8px":void 0,...t&&{"--tw-ring-color":d||"var(--color-foreground)"}},"aria-label":`Color ${e}`,"aria-pressed":t,...u,children:jsx("span",{className:"absolute inset-0 rounded-[inherit]",style:{backgroundColor:e}})}));sa.displayName="ColorSwatch";var zf=cva("",{variants:{layout:{grid:"grid gap-2",stack:"flex flex-wrap gap-2"}},defaultVariants:{layout:"stack"}}),Of=Z.forwardRef(({value:e,defaultValue:t,onChange:n,layout:r,columns:o=6,colors:a,swatchSize:s="md",swatchShape:i="square",isDisabled:l,selectedRingColor:c,className:d,style:u,...p},f)=>{let[g,v]=Z.useState(t),b=e??g,h=Z.useCallback(R=>{l||(e===void 0&&v(R),n?.(R));},[e,n,l]),x=R=>R.toLowerCase();return jsx("div",{ref:f,role:"listbox","aria-label":"Color options",className:m(zf({layout:r}),d),style:{...r==="grid"?{gridTemplateColumns:`repeat(${o}, 1fr)`}:{},...u},...p,children:a.map(R=>{let N=b?x(b)===x(R):false;return jsx(sa,{role:"option",color:R,size:s,shape:i,isSelected:N,onSelect:h,disabled:l,selectedRingColor:c,"aria-selected":N},R)})})});Of.displayName="ColorSwatchPicker";var ww=["#000000","#ffffff","#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"],Ff={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},Bf=Z.forwardRef(({value:e,defaultValue:t="#3b82f6",onChange:n,isDisabled:r,presets:o=ww,showInput:a=true,size:s="md",className:i,variant:l="full"},c)=>{let[d,u]=Z.useState(e??t),p=Z.useId();Z.useEffect(()=>{e!==void 0&&u(e);},[e]);let f=b=>{u(b),n?.(b);},g=b=>{u(b),n?.(b);},v=b=>{let h=b.target.value.toUpperCase();u(h),n?.(h);};return l==="simple"?jsxs("label",{className:m("relative rounded-md border border-input shadow-sm transition-colors cursor-pointer hover:border-foreground focus-within:border-foreground overflow-hidden",r&&"opacity-50 cursor-not-allowed",Ff[s],i),children:[jsx("input",{type:"color",value:d,onChange:v,disabled:r,className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",id:p}),jsx("div",{className:"h-full w-full",style:{backgroundColor:d}})]}):jsxs(Pt,{children:[jsx(tr,{ref:c,disabled:r,className:m("rounded-md border border-input shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",Ff[s],i),style:{backgroundColor:d},"aria-label":`Color picker, current color: ${d}`}),jsx(Lt,{className:"w-auto p-3",align:"start",children:jsxs("div",{className:"space-y-3",children:[jsx(HexColorPicker,{color:d,onChange:f,className:"!w-[200px]"}),a&&jsxs("div",{className:"space-y-1.5",children:[jsx(Pr,{htmlFor:"color-input",className:"text-xs",children:"Hex Color"}),jsxs("div",{className:"flex gap-2",children:[jsx("div",{className:"h-9 w-9 shrink-0 rounded-md border",style:{backgroundColor:d}}),jsx(HexColorInput,{id:"color-input",color:d,onChange:f,prefixed:true,className:"flex h-9 w-full rounded-md border border-input bg-background text-foreground px-3 py-2 font-mono text-sm uppercase focus:outline-none focus:border-foreground disabled:cursor-not-allowed disabled:opacity-50"})]})]}),o.length>0&&jsxs("div",{className:"space-y-1.5",children:[jsx(Pr,{className:"text-xs",children:"Presets"}),jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(b=>jsx(sa,{color:b,size:"sm",isSelected:d.toLowerCase()===b.toLowerCase(),onSelect:g},b))})]})]})})]})});Bf.displayName="ColorPicker";var $f=cva("flex w-full border border-input bg-background px-3 file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{sm:"h-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl"}},defaultVariants:{size:"md",radius:"md"}}),sl=e=>String(e).padStart(2,"0"),kw=e=>{let[t,n]=e.split(":").map(Number);return {hours:t||0,minutes:n||0}},Sw=(e,t)=>`${sl(e)}:${sl(t)}`,Kf=Z.forwardRef(({className:e,size:t,radius:n,value:r,onChange:o,use24Hour:a=true,minuteStep:s=1,showPicker:i=true,minTime:l,maxTime:c,label:d,isRequired:u,isDisabled:p,description:f,errorMessage:g,isInvalid:v,...b},h)=>{let[x,R]=Z.useState(r??""),[N,w]=Z.useState(false),[y,C]=Z.useState(false),E=Z.useId(),L=b.id||E,k=v||!!g;Z.useEffect(()=>{r!==void 0&&R(r);},[r]);let{hours:S,minutes:T}=kw(x||"00:00"),M=j=>{let G=j.target.value;R(G),/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(G)&&o?.(G);},D=(j,G)=>{let U=Math.max(0,Math.min(23,j)),W=Math.max(0,Math.min(59,G)),V=Sw(U,W);R(V),o?.(V);},P=()=>D(S+1,T),I=()=>D(S-1,T),H=()=>D(S,T+s),A=()=>D(S,T-s),B=({value:j,onIncrement:G,onDecrement:U})=>jsxs("div",{className:"flex flex-col items-center",children:[jsx(me,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:G,isDisabled:p,children:jsx(ChevronUp,{className:"h-4 w-4"})}),jsx("div",{className:"flex h-10 w-12 items-center justify-center rounded-md bg-muted text-lg font-semibold",children:sl(j)}),jsx(me,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:U,isDisabled:p,children:jsx(ChevronDown,{className:"h-4 w-4"})})]}),$=jsxs("div",{className:"relative flex items-center",children:[jsx("input",{ref:h,id:L,type:"time",value:x,onChange:M,disabled:p,required:u,"aria-invalid":k,"aria-describedby":f||g?`${L}-description`:void 0,className:m($f({size:t,radius:n}),i&&"pr-10","[&::-webkit-calendar-picker-indicator]:hidden",k&&"border-danger focus:border-danger",!d&&e),style:{borderColor:k?void 0:y?"var(--color-foreground)":void 0},onFocus:()=>C(true),onBlur:()=>C(false),...b}),i&&jsxs(Pt,{open:N,onOpenChange:w,children:[jsxs(tr,{type:"button",className:"absolute right-1 h-7 w-7 p-0 inline-flex items-center justify-center rounded-md hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer",disabled:p,children:[jsx(Clock,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Pick time"})]}),jsxs(Lt,{className:"w-auto p-4",align:"end",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx(B,{value:S,onIncrement:P,onDecrement:I,max:23}),jsx("div",{className:"text-2xl font-bold text-muted-foreground",children:":"}),jsx(B,{value:T,onIncrement:H,onDecrement:A,max:59})]}),jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[jsx(me,{variant:"bordered",size:"sm",onClick:()=>{let j=new Date;D(j.getHours(),j.getMinutes());},children:"Now"}),jsx(me,{size:"sm",onClick:()=>w(false),children:"Done"})]})]})]})]});return !d&&!f&&!g?$:jsxs("div",{className:m("flex flex-col gap-1.5",e),children:[d&&jsxs("label",{htmlFor:L,className:"text-sm font-medium leading-none",children:[d,u&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),$,(f||g)&&jsx("p",{id:`${L}-description`,className:m("text-xs",k?"text-danger":"text-muted-foreground"),children:g||f})]})});Kf.displayName="TimeInput";var Uf=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 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"}},defaultVariants:{size:"md"}}),Pw={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},Lw=(e,t)=>{try{return new Intl.NumberFormat(t,{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).formatToParts(0).find(a=>a.type==="currency")?.value??e}catch{return e}},Gf=(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},Dw=(e,t,n)=>{if(!e)return;let r=e.replace(new RegExp(`\\${t}`,"g"),"");r=r.replace(n,"."),r=r.replace(/[^0-9.-]/g,"");let o=parseFloat(r);return isNaN(o)?void 0:o},_f=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r,onChange:o,currency:a="USD",locale:s="en-US",decimals:i=2,min:l,max:c,showCurrency:d=true,currencyPosition:u="prefix",currencySymbol:p,thousandSeparator:f=",",decimalSeparator:g=".",radius:v="md",isDisabled:b,placeholder:h,...x},R)=>{let[N,w]=Z.useState(r),[y,C]=Z.useState(""),[E,L]=Z.useState(false),k=n!==void 0?n:N,S=p??Lw(a,s);Z.useEffect(()=>{!E&&k!==void 0&&C(Gf(k,i,f,g));},[k,i,f,g,E]);let T=H=>{let A=H.target.value;if(!A){C(""),n===void 0&&w(void 0),o?.(void 0);return}if(!new RegExp(`^[0-9${f}${g}.-]*$`).test(A))return;C(A);let $=Dw(A,f,g);if($!==void 0){let j=$;l!==void 0&&$<l&&(j=l),c!==void 0&&$>c&&(j=c),n===void 0&&w(j),o?.(j);}},M=()=>{L(true),k!==void 0&&C(k.toString().replace(".",g));},D=()=>{L(false),C(k!==void 0?Gf(k,i,f,g):"");},P=d&&u==="prefix"&&jsx("span",{className:"flex items-center text-muted-foreground pr-1",children:S}),I=d&&u==="suffix"&&jsx("span",{className:"flex items-center text-muted-foreground pl-1",children:S});return jsxs("div",{className:"relative flex items-center",children:[P&&jsx("div",{className:"absolute left-3 pointer-events-none",children:P}),jsx("input",{ref:R,type:"text",inputMode:"decimal",value:y,onChange:T,onFocus:M,onBlur:D,disabled:b,placeholder:h??`0${g}${"0".repeat(i)}`,className:m(Uf({size:t}),Pw[v],P&&"pl-8",I&&"pr-8","text-right",e),style:{borderColor:E?"var(--color-foreground)":void 0},...x}),I&&jsx("div",{className:"absolute right-3 pointer-events-none",children:I})]})});_f.displayName="CurrencyInput";var jf=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-50 font-mono",{variants:{size:{sm:"h-8 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-12 px-4 text-base"}},defaultVariants:{size:"md"}}),il={creditCard:{mask:"#### #### #### ####"},creditCardAmex:{mask:"#### ###### #####"},cvv:{mask:"###"},expiry:{mask:"##/##"},date:{mask:"##/##/####"},dateISO:{mask:"####-##-##"},time:{mask:"##:##"},ip:{mask:"###.###.###.###"},mac:{mask:"AA:AA:AA:AA:AA:AA"},id11:{mask:"###########"},id9:{mask:"#########"},id10:{mask:"##########"},postal5:{mask:"#####"},postal9:{mask:"#####-####"}},Vw=(e,t)=>{switch(t){case "#":return /\d/.test(e);case "A":return /[a-zA-Z]/.test(e);case "*":return /[a-zA-Z0-9]/.test(e);default:return e===t}},lr=e=>["#","A","*"].includes(e),vs=(e,t,n)=>{let r="",o=0;for(let a=0;a<t.length&&o<=e.length;a++){let s=t[a];if(lr(s)){if(o<e.length){let i=e[o];Vw(i,s)?(r+=i,o++):(o++,a--);}}else (o<e.length||n)&&(r+=s);}return r},ll=(e,t)=>{let n="";for(let r=0;r<e.length&&r<t.length;r++){let o=t[r];lr(o)&&(n+=e[r]);}return n},Wf=(e,t)=>e.split("").map(n=>lr(n)?t:n).join(""),Aw=(e,t,n)=>{let r=0;for(let i=0;i<n&&i<e.length&&i<t.length;i++)lr(t[i])&&r++;let a=0,s=0;for(let i=0;i<t.length&&s<r;i++)a++,lr(t[i])&&s++;for(;a<t.length&&!lr(t[a]);)a++;return Math.min(a,e.length)},Yf=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,mask:a,maskPlaceholder:s="_",showMaskPlaceholder:i=false,includeMaskChars:l=false,isDisabled:c,placeholder:d,...u},p)=>{let f=typeof a=="string"&&a in il?il[a].mask:a,[g,v]=Z.useState(r),[b,h]=Z.useState(""),[x,R]=Z.useState(false),N=Z.useRef(null),w=n!==void 0?n:g;Z.useImperativeHandle(p,()=>N.current),Z.useEffect(()=>{let L=vs(w,f,true);h(L);},[w,f]);let y=L=>{let k=L.target.value,S=L.target.selectionStart??0,T=k.replace(/[^\w]/g,""),M=vs(T,f,true),D=ll(M,f);h(M),n===void 0&&v(l?M:D),o?.(D,M),requestAnimationFrame(()=>{if(N.current){let P=Aw(M,f,S);N.current.setSelectionRange(P,P);}});},C=L=>{if(["ArrowLeft","ArrowRight","Home","End","Tab"].includes(L.key)||L.ctrlKey||L.metaKey)return;let k=N.current;if(!k)return;let S=k.selectionStart??0;if(L.key==="Backspace"&&S>0){let T=S-1;for(;T>0&&!lr(f[T]);)T--;let M=ll(b,f),D=0;for(let H=0;H<T&&H<f.length;H++)lr(f[H])&&D++;let P=M.slice(0,Math.max(0,D-1))+M.slice(D),I=vs(P,f,true);h(I),n===void 0&&v(l?I:P),o?.(P,I),L.preventDefault(),requestAnimationFrame(()=>{N.current&&N.current.setSelectionRange(T,T);});}},E=i?Wf(f,s):d;return jsx("input",{ref:N,type:"text",value:b,onChange:y,onKeyDown:C,onFocus:()=>R(true),onBlur:()=>R(false),disabled:c,placeholder:E,className:m(jf({size:t}),e),style:{borderColor:x?"var(--color-foreground)":void 0},...u})});Yf.displayName="MaskedInput";var $w=cva("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium 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"}},defaultVariants:{size:"md"}}),Xf=[{code:"AR",name:"Argentina",dialCode:"+54",flag:"\u{1F1E6}\u{1F1F7}",format:"## ####-####"},{code:"AU",name:"Australia",dialCode:"+61",flag:"\u{1F1E6}\u{1F1FA}",format:"### ### ###"},{code:"AT",name:"Austria",dialCode:"+43",flag:"\u{1F1E6}\u{1F1F9}",format:"### #######"},{code:"BE",name:"Belgium",dialCode:"+32",flag:"\u{1F1E7}\u{1F1EA}",format:"### ## ## ##"},{code:"BR",name:"Brazil",dialCode:"+55",flag:"\u{1F1E7}\u{1F1F7}",format:"(##) #####-####"},{code:"BG",name:"Bulgaria",dialCode:"+359",flag:"\u{1F1E7}\u{1F1EC}",format:"### ### ###"},{code:"CA",name:"Canada",dialCode:"+1",flag:"\u{1F1E8}\u{1F1E6}",format:"(###) ###-####"},{code:"CN",name:"China",dialCode:"+86",flag:"\u{1F1E8}\u{1F1F3}",format:"### #### ####"},{code:"HR",name:"Croatia",dialCode:"+385",flag:"\u{1F1ED}\u{1F1F7}",format:"## ### ####"},{code:"CZ",name:"Czech Republic",dialCode:"+420",flag:"\u{1F1E8}\u{1F1FF}",format:"### ### ###"},{code:"DK",name:"Denmark",dialCode:"+45",flag:"\u{1F1E9}\u{1F1F0}",format:"## ## ## ##"},{code:"EG",name:"Egypt",dialCode:"+20",flag:"\u{1F1EA}\u{1F1EC}",format:"### ### ####"},{code:"FI",name:"Finland",dialCode:"+358",flag:"\u{1F1EB}\u{1F1EE}",format:"## ### ####"},{code:"FR",name:"France",dialCode:"+33",flag:"\u{1F1EB}\u{1F1F7}",format:"# ## ## ## ##"},{code:"DE",name:"Germany",dialCode:"+49",flag:"\u{1F1E9}\u{1F1EA}",format:"#### #######"},{code:"GR",name:"Greece",dialCode:"+30",flag:"\u{1F1EC}\u{1F1F7}",format:"### ### ####"},{code:"HK",name:"Hong Kong",dialCode:"+852",flag:"\u{1F1ED}\u{1F1F0}",format:"#### ####"},{code:"HU",name:"Hungary",dialCode:"+36",flag:"\u{1F1ED}\u{1F1FA}",format:"## ### ####"},{code:"IN",name:"India",dialCode:"+91",flag:"\u{1F1EE}\u{1F1F3}",format:"##### #####"},{code:"IL",name:"Israel",dialCode:"+972",flag:"\u{1F1EE}\u{1F1F1}",format:"##-###-####"},{code:"IT",name:"Italy",dialCode:"+39",flag:"\u{1F1EE}\u{1F1F9}",format:"### ### ####"},{code:"JP",name:"Japan",dialCode:"+81",flag:"\u{1F1EF}\u{1F1F5}",format:"##-####-####"},{code:"MX",name:"Mexico",dialCode:"+52",flag:"\u{1F1F2}\u{1F1FD}",format:"### ### ####"},{code:"NL",name:"Netherlands",dialCode:"+31",flag:"\u{1F1F3}\u{1F1F1}",format:"## ########"},{code:"NZ",name:"New Zealand",dialCode:"+64",flag:"\u{1F1F3}\u{1F1FF}",format:"## ### ####"},{code:"NG",name:"Nigeria",dialCode:"+234",flag:"\u{1F1F3}\u{1F1EC}",format:"### ### ####"},{code:"NO",name:"Norway",dialCode:"+47",flag:"\u{1F1F3}\u{1F1F4}",format:"### ## ###"},{code:"PK",name:"Pakistan",dialCode:"+92",flag:"\u{1F1F5}\u{1F1F0}",format:"### #######"},{code:"PL",name:"Poland",dialCode:"+48",flag:"\u{1F1F5}\u{1F1F1}",format:"### ### ###"},{code:"PT",name:"Portugal",dialCode:"+351",flag:"\u{1F1F5}\u{1F1F9}",format:"### ### ###"},{code:"RO",name:"Romania",dialCode:"+40",flag:"\u{1F1F7}\u{1F1F4}",format:"### ### ###"},{code:"RU",name:"Russia",dialCode:"+7",flag:"\u{1F1F7}\u{1F1FA}",format:"(###) ###-##-##"},{code:"SA",name:"Saudi Arabia",dialCode:"+966",flag:"\u{1F1F8}\u{1F1E6}",format:"## ### ####"},{code:"RS",name:"Serbia",dialCode:"+381",flag:"\u{1F1F7}\u{1F1F8}",format:"## ### ####"},{code:"SG",name:"Singapore",dialCode:"+65",flag:"\u{1F1F8}\u{1F1EC}",format:"#### ####"},{code:"SK",name:"Slovakia",dialCode:"+421",flag:"\u{1F1F8}\u{1F1F0}",format:"### ### ###"},{code:"SI",name:"Slovenia",dialCode:"+386",flag:"\u{1F1F8}\u{1F1EE}",format:"## ### ###"},{code:"ZA",name:"South Africa",dialCode:"+27",flag:"\u{1F1FF}\u{1F1E6}",format:"## ### ####"},{code:"KR",name:"South Korea",dialCode:"+82",flag:"\u{1F1F0}\u{1F1F7}",format:"##-####-####"},{code:"ES",name:"Spain",dialCode:"+34",flag:"\u{1F1EA}\u{1F1F8}",format:"### ### ###"},{code:"SE",name:"Sweden",dialCode:"+46",flag:"\u{1F1F8}\u{1F1EA}",format:"##-### ## ##"},{code:"CH",name:"Switzerland",dialCode:"+41",flag:"\u{1F1E8}\u{1F1ED}",format:"## ### ## ##"},{code:"TW",name:"Taiwan",dialCode:"+886",flag:"\u{1F1F9}\u{1F1FC}",format:"### ### ###"},{code:"TR",name:"Turkey",dialCode:"+90",flag:"\u{1F1F9}\u{1F1F7}",format:"(###) ### ## ##"},{code:"UA",name:"Ukraine",dialCode:"+380",flag:"\u{1F1FA}\u{1F1E6}",format:"## ### ## ##"},{code:"AE",name:"United Arab Emirates",dialCode:"+971",flag:"\u{1F1E6}\u{1F1EA}",format:"## ### ####"},{code:"GB",name:"United Kingdom",dialCode:"+44",flag:"\u{1F1EC}\u{1F1E7}",format:"#### ### ####"},{code:"US",name:"United States",dialCode:"+1",flag:"\u{1F1FA}\u{1F1F8}",format:"(###) ###-####"}],hs=(e,t)=>{let n=e.replace(/\D/g,""),r="",o=0;for(let a=0;a<t.length&&o<n.length;a++)t[a]==="#"?(r+=n[o],o++):r+=t[a];return r},Kw=e=>e.replace(/#/g,"_"),Zf=Z.forwardRef(({className:e,size:t,value:n,defaultValue:r="",onChange:o,country:a,defaultCountry:s="TR",onCountryChange:i,countries:l=Xf,showCountrySelect:c=true,showDialCode:d=false,isDisabled:u,placeholder:p,radius:f="md",...g},v)=>{let[b,h]=Z.useState(r),[x,R]=Z.useState(a??s),[N,w]=Z.useState(false),[y,C]=Z.useState(false),[E,L]=Z.useState(false),[k,S]=Z.useState({top:0,left:0,width:0}),T=Z.useRef(null),M=Z.useRef(null),D=n!==void 0?n:b,P=a??x,I=l.find(U=>U.code===P)??l[0],H=hs(D,I.format);Z.useEffect(()=>{L(true);},[]),Z.useEffect(()=>{if(y&&T.current){let U=T.current.getBoundingClientRect();S({top:U.bottom+4,left:U.left,width:Math.max(U.width,280)});}},[y]),Z.useEffect(()=>{if(!y)return;let U=W=>{T.current&&!T.current.contains(W.target)&&M.current&&!M.current.contains(W.target)&&C(false);};return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[y]),Z.useEffect(()=>{if(!y)return;let U=W=>{W.key==="Escape"&&C(false);};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[y]),Z.useEffect(()=>{if(!y)return;let U=W=>{M.current?.contains(W.target)||C(false);};return window.addEventListener("scroll",U,true),()=>window.removeEventListener("scroll",U,true)},[y]);let A=U=>{let V=U.target.value.replace(/\D/g,"");n===void 0&&h(V);let z=hs(V,I.format),K=`${I.dialCode} ${z}`;o?.(V,K,I);},B=U=>{let W=l.find(K=>K.code===U);if(!W)return;a===void 0&&R(U),i?.(W);let V=hs(D,W.format),z=`${W.dialCode} ${V}`;o?.(D,z,W),C(false);},$=t==="sm"?"h-9":t==="lg"?"h-11":"h-10",j=N||y;return jsxs("div",{className:m("flex border bg-background transition-colors",{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}[f],u&&"cursor-not-allowed opacity-50"),style:{borderColor:j?"var(--color-foreground)":"var(--color-border)"},children:[c&&jsxs(Fragment,{children:[jsxs("button",{ref:T,type:"button",disabled:u,onClick:()=>C(!y),className:m("flex items-center justify-between bg-transparent px-3 py-2 text-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50","w-[100px] shrink-0 border-r",$),style:{borderColor:j?"var(--color-foreground)":"var(--color-border)"},children:[jsxs("span",{className:"flex items-center gap-1.5",children:[jsx("span",{children:I.flag}),jsx("span",{className:"text-xs text-muted-foreground",children:I.dialCode})]}),jsx(ChevronDown,{className:m("h-4 w-4 opacity-50 transition-transform",y&&"rotate-180")})]}),E&&y&&Ua.createPortal(jsx("div",{ref:M,className:"fixed z-50 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",style:{top:k.top,left:k.left,minWidth:k.width},children:jsx(ze,{style:{maxHeight:300},children:jsx("div",{className:"p-1",children:l.map(U=>jsxs("div",{role:"option","aria-selected":U.code===P,onClick:()=>B(U.code),className:"relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:U.code===P&&jsx(Check,{className:"h-4 w-4"})}),jsxs("span",{className:"flex items-center gap-2",children:[jsx("span",{children:U.flag}),jsx("span",{className:"flex-1",children:U.name}),jsx("span",{className:"text-xs text-muted-foreground",children:U.dialCode})]})]},U.code))})})}),document.body)]}),jsxs("div",{className:"relative flex-1",children:[d&&!c&&jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:I.dialCode}),jsx("input",{ref:v,type:"tel",inputMode:"tel",value:H,onChange:A,onFocus:()=>w(true),onBlur:()=>w(false),disabled:u,placeholder:p??Kw(I.format),className:m("flex h-10 w-full bg-transparent px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",t==="sm"&&"h-8 px-2 text-xs",t==="lg"&&"h-12 px-4 text-base",d&&!c&&"pl-12",e),...g})]})]})});Zf.displayName="PhoneInput";var Qf=cva("flex items-center justify-between w-full px-4 py-3 border-b bg-background",{variants:{variant:{solid:"bg-primary text-primary-foreground border-primary",bordered:"bg-background border-border",ghost:"bg-transparent border-transparent",soft:"bg-primary/10 border-primary/20",surface:"bg-muted border-border"},size:{sm:"h-12 px-3 py-2",md:"h-14 px-4 py-3",lg:"h-16 px-6 py-4"},sticky:{true:"sticky top-0 z-50",false:""}},defaultVariants:{variant:"bordered",size:"md",sticky:false}}),eg=Z.forwardRef(({className:e,variant:t,size:n,sticky:r,brand:o,children:a,mobileBreakpoint:s="md",...i},l)=>{let[c,d]=Z.useState(false),u={sm:"hidden sm:flex",md:"hidden md:flex",lg:"hidden lg:flex"}[s],p={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden"}[s];return jsxs("nav",{ref:l,className:m(Qf({variant:t,size:n,sticky:r,className:e})),...i,children:[jsxs("div",{className:"flex items-center justify-between w-full",children:[o&&jsx("div",{className:"flex-shrink-0",children:o}),jsx("div",{className:m("items-center gap-4 flex-1 justify-end",u),children:a}),jsx("button",{type:"button",className:m("p-2 rounded-md hover:bg-accent hover:text-accent-foreground transition-colors",p),onClick:()=>d(!c),"aria-label":c?"Close menu":"Open menu","aria-expanded":c,children:c?jsx(X,{className:"h-5 w-5"}):jsx(Menu,{className:"h-5 w-5"})})]}),c&&jsx("div",{className:m("absolute top-full left-0 right-0 flex flex-col gap-2 p-4 bg-background border-b border-border shadow-lg",p),children:a})]})});eg.displayName="Navbar";var tg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex items-center gap-2 font-semibold text-lg",e),...t}));tg.displayName="NavbarBrand";var ng=Z.forwardRef(({className:e,justify:t="start",...n},r)=>{let o={start:"justify-start",center:"justify-center",end:"justify-end"}[t];return jsx("div",{ref:r,className:m("flex items-center gap-4",o,e),...n})});ng.displayName="NavbarContent";var rg=Z.forwardRef(({className:e,isActive:t,...n},r)=>jsx("div",{ref:r,className:m("flex items-center",t&&"text-primary font-medium",e),...n}));rg.displayName="NavbarItem";var og=Z.forwardRef(({className:e,isActive:t,...n},r)=>jsx("a",{ref:r,className:m("text-sm font-medium transition-colors hover:text-primary",t?"text-primary":"text-muted-foreground",e),...n}));og.displayName="NavbarLink";var Yw={none:"",hover:"hover:underline",always:"underline"},ag={primary:"text-primary",success:"text-green-600 dark:text-green-500",warning:"text-amber-600 dark:text-amber-500",danger:"text-red-600 dark:text-red-500",muted:"text-muted-foreground"},ig=Z.forwardRef(({className:e,color:t="primary",underline:n="hover",isExternal:r,showExternalIcon:o=true,isDisabled:a,children:s,style:i,...l},c)=>{let d=r?{target:"_blank",rel:"noopener noreferrer"}:{},u=t in ag,p=u?i:{color:t,...i};return jsxs("a",{ref:c,className:m("inline-flex items-center gap-1 underline-offset-4 transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",u&&ag[t],Yw[n],a&&"pointer-events-none opacity-50",e),style:p,"aria-disabled":a,...d,...l,children:[s,r&&o&&jsx(ExternalLink,{className:"h-3 w-3","aria-hidden":"true"})]})});ig.displayName="Link";var lg=cva("fixed z-50 transition-all duration-300",{variants:{position:{"bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6","bottom-center":"bottom-6 left-1/2 -translate-x-1/2"}},defaultVariants:{position:"bottom-right"}}),cg=Z.forwardRef(({className:e,position:t,threshold:n=400,icon:r,behavior:o="smooth",variant:a="solid",color:s="default",size:i="md",radius:l="full",target:c,onVisibilityChange:d,onClick:u,...p},f)=>{let[g,v]=Z.useState(false);Z.useEffect(()=>{let x=c?.current||window,R=()=>{let w=(c?.current?c.current.scrollTop:window.scrollY||document.documentElement.scrollTop)>n;w!==g&&(v(w),d?.(w));};return x.addEventListener("scroll",R,{passive:true}),R(),()=>{x.removeEventListener("scroll",R);}},[n,c,g,d]);let b=x=>{c?.current?c.current.scrollTo({top:0,behavior:o}):window.scrollTo({top:0,behavior:o}),u?.(x);},h=i==="sm"?"h-4 w-4":i==="lg"?"h-6 w-6":"h-5 w-5";return jsx("div",{className:m(lg({position:t}),g?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 translate-y-4 pointer-events-none",e),children:jsx(me,{ref:f,type:"button",variant:a,color:s,size:i,isIconOnly:true,radius:l,onClick:b,"aria-label":"Back to top",className:"shadow-lg",...p,children:r||jsx(ArrowUp,{className:h})})})});cg.displayName="BackTop";var nC=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),rC=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}},defaultVariants:{radius:"sm"}}),dg=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"}},defaultVariants:{radius:"sm"}}),Rs=cva("",{variants:{radius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-xl"}},defaultVariants:{radius:"sm"}}),ug=Z.createContext(null),dr=()=>{let e=Z.useContext(ug);if(!e)throw new Error("Menubar components must be used within a Menubar");return e},mg=Z.createContext(null),la=()=>{let e=Z.useContext(mg);if(!e)throw new Error("Menu components must be used within a MenubarMenu");return e},dl=Z.createContext(null),pg=Z.createContext(null),fg=Z.forwardRef(({className:e,children:t,radius:n="sm",...r},o)=>{let[a,s]=Z.useState(null);return jsx(ug.Provider,{value:{activeMenu:a,setActiveMenu:s,radius:n},children:jsx("div",{ref:o,role:"menubar",className:m("flex h-10 items-center space-x-1 border bg-background p-1",nC({radius:n}),e),...r,children:t})})});fg.displayName="Menubar";var gg=({children:e})=>{let{activeMenu:t,setActiveMenu:n}=dr(),r=Z.useId(),o=Z.useRef(null),a=t===r,s=Z.useCallback(i=>{n(i?r:null);},[r,n]);return jsx(mg.Provider,{value:{menuId:r,triggerRef:o,open:a,onOpenChange:s},children:e})};gg.displayName="MenubarMenu";var bg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"group",className:e,...t}));bg.displayName="MenubarGroup";var vg=({children:e,container:t})=>{let[n,r]=Z.useState(false);return Z.useEffect(()=>{r(true);},[]),n?Ua.createPortal(e,t||document.body):null};vg.displayName="MenubarPortal";var hg=({children:e,open:t,defaultOpen:n=false,onOpenChange:r})=>{let[o,a]=Z.useState(n),s=t!==void 0,i=s?t:o,l=Z.useRef(null),c=Z.useCallback(d=>{s||a(d),r?.(d);},[s,r]);return jsx(dl.Provider,{value:{open:i,onOpenChange:c,triggerRef:l},children:e})};hg.displayName="MenubarSub";var xg=Z.forwardRef(({value:e="",onValueChange:t,className:n,...r},o)=>jsx(pg.Provider,{value:{value:e,onValueChange:t||(()=>{})},children:jsx("div",{ref:o,role:"group",className:n,...r})}));xg.displayName="MenubarRadioGroup";var yg=Z.forwardRef(({className:e,onClick:t,onMouseEnter:n,...r},o)=>{let{activeMenu:a,setActiveMenu:s,radius:i}=dr(),{menuId:l,triggerRef:c,open:d,onOpenChange:u}=la(),p=g=>{t?.(g),u(!d);},f=g=>{n?.(g),a&&a!==l&&(s(l),document.activeElement instanceof HTMLElement&&document.activeElement.blur());};return jsx("button",{ref:g=>{c.current=g,typeof o=="function"?o(g):o&&(o.current=g);},type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":d,"data-state":d?"open":"closed",className:m("flex cursor-default select-none items-center px-3 py-1.5 text-sm font-medium outline-none hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",rC({radius:i}),e),onClick:p,onMouseEnter:f,...r})});yg.displayName="MenubarTrigger";var Rg=Z.forwardRef(({className:e,inset:t,children:n,onMouseEnter:r,onMouseLeave:o,...a},s)=>{let{radius:i}=dr(),l=Z.useContext(dl);if(!l)throw new Error("MenubarSubTrigger must be used within MenubarSub");let{open:c,onOpenChange:d,triggerRef:u}=l,p=g=>{r?.(g),d(true);},f=g=>{o?.(g),d(false);};return jsxs("div",{ref:g=>{u.current=g,typeof s=="function"?s(g):s&&(s.current=g);},role:"menuitem","aria-haspopup":"menu","aria-expanded":c,"data-state":c?"open":"closed",className:m("flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",Rs({radius:i}),t&&"pl-8",e),onMouseEnter:p,onMouseLeave:f,...a,children:[n,jsx(ChevronRight,{className:"ml-auto h-4 w-4"})]})});Rg.displayName="MenubarSubTrigger";var wg=Z.forwardRef(({className:e,sideOffset:t=2,onMouseEnter:n,onMouseLeave:r,...o},a)=>{let{radius:s}=dr(),i=Z.useContext(dl);if(!i)throw new Error("MenubarSubContent must be used within MenubarSub");let{open:l,onOpenChange:c,triggerRef:d}=i,[u,p]=Z.useState({top:0,left:0}),[f,g]=Z.useState(false),v=Z.useRef(null);Z.useEffect(()=>{g(true);},[]),Z.useEffect(()=>{if(!l||!d.current||!v.current)return;(()=>{if(!d.current||!v.current)return;let R=d.current.getBoundingClientRect(),N=v.current.getBoundingClientRect(),w=R.top,y=R.right+t;y+N.width>window.innerWidth&&(y=R.left-N.width-t),p({top:w,left:y});})();},[l,t,d]);let b=x=>{n?.(x),c(true);},h=x=>{r?.(x),c(false);};return !f||!l?null:Ua.createPortal(jsx("div",{ref:x=>{v.current=x,typeof a=="function"?a(x):a&&(a.current=x);},role:"menu","data-state":l?"open":"closed",className:m("fixed z-50 min-w-[8rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-lg","animate-in fade-in-0 zoom-in-95 slide-in-from-left-2",dg({radius:s}),e),style:{top:u.top,left:u.left},onMouseEnter:b,onMouseLeave:h,...o}),document.body)});wg.displayName="MenubarSubContent";var Cg=Z.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,children:o,...a},s)=>{let{radius:i}=dr(),{triggerRef:l,open:c,onOpenChange:d}=la(),[u,p]=Z.useState({top:0,left:0}),[f,g]=Z.useState(false),v=Z.useRef(null);return Z.useEffect(()=>{g(true);},[]),Z.useEffect(()=>{if(!c||!l.current||!v.current)return;let b=()=>{if(!l.current||!v.current)return;let h=l.current.getBoundingClientRect(),x=v.current.getBoundingClientRect(),R=h.bottom+r,N=h.left+n;t==="center"?N=h.left+h.width/2-x.width/2:t==="end"&&(N=h.right-x.width-n),p({top:R,left:N});};return b(),window.addEventListener("resize",b),window.addEventListener("scroll",b,true),()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b,true);}},[c,t,n,r,l]),Z.useEffect(()=>{if(!c)return;let b=h=>{let x=h.target;v.current&&!v.current.contains(x)&&l.current&&!l.current.contains(x)&&d(false);};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[c,d,l]),Z.useEffect(()=>{if(!c)return;let b=h=>{h.key==="Escape"&&d(false);};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[c,d]),!f||!c?null:Ua.createPortal(jsx("div",{ref:b=>{v.current=b,typeof s=="function"?s(b):s&&(s.current=b);},role:"menu","data-state":c?"open":"closed",className:m("fixed z-50 min-w-[12rem] overflow-hidden border bg-popover p-1 text-popover-foreground shadow-md","animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",dg({radius:i}),e),style:{top:u.top,left:u.left},...a,children:o}),document.body)});Cg.displayName="MenubarContent";var Mg=Z.forwardRef(({className:e,inset:t,isDisabled:n,onSelect:r,onClick:o,...a},s)=>{let{radius:i}=dr(),{onOpenChange:l}=la(),c=d=>{if(n){d.preventDefault();return}o?.(d),r?.(),l(false);};return jsx("div",{ref:s,role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,className:m("relative flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Rs({radius:i}),t&&"pl-8",!n&&"cursor-pointer",e),onClick:c,...a})});Mg.displayName="MenubarItem";var Tg=Z.forwardRef(({className:e,children:t,checked:n=false,onCheckedChange:r,isDisabled:o,onClick:a,...s},i)=>{let{radius:l}=dr(),{onOpenChange:c}=la(),d=u=>{if(o){u.preventDefault();return}a?.(u),r?.(!n),c(false);};return jsxs("div",{ref:i,role:"menuitemcheckbox","aria-checked":n,tabIndex:o?-1:0,"aria-disabled":o,"data-disabled":o?"":void 0,"data-state":n?"checked":"unchecked",className:m("relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Rs({radius:l}),!o&&"cursor-pointer",e),onClick:d,...s,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n&&jsx(Check,{className:"h-4 w-4"})}),t]})});Tg.displayName="MenubarCheckboxItem";var Ng=Z.forwardRef(({className:e,children:t,value:n,isDisabled:r,onClick:o,...a},s)=>{let{radius:i}=dr(),{onOpenChange:l}=la(),c=Z.useContext(pg),d=c?.value===n,u=p=>{if(r){p.preventDefault();return}o?.(p),c?.onValueChange(n),l(false);};return jsxs("div",{ref:s,role:"menuitemradio","aria-checked":d,tabIndex:r?-1:0,"aria-disabled":r,"data-disabled":r?"":void 0,"data-state":d?"checked":"unchecked",className:m("relative flex cursor-default select-none items-center py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Rs({radius:i}),!r&&"cursor-pointer",e),onClick:u,...a,children:[jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d&&jsx(Circle,{className:"h-2 w-2 fill-current"})}),t]})});Ng.displayName="MenubarRadioItem";var ul=Z.forwardRef(({className:e,inset:t,...n},r)=>jsx("div",{ref:r,className:m("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));ul.displayName="MenubarSection";var oC=ul,kg=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,role:"separator",className:m("-mx-1 my-1 h-px bg-muted",e),...t}));kg.displayName="MenubarSeparator";var Sg=({className:e,...t})=>jsx("span",{className:m("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Sg.displayName="MenubarShortcut";var Eg=cva("flex",{variants:{orientation:{horizontal:"flex-row items-center",vertical:"flex-col"},size:{sm:"gap-2",md:"gap-4",lg:"gap-6"}},defaultVariants:{orientation:"horizontal",size:"md"}}),Pg=Z.forwardRef(({className:e,orientation:t,size:n,currentStep:r=0,children:o,...a},s)=>{let i=Z.Children.toArray(o);return jsx("div",{ref:s,className:m(Eg({orientation:t,size:n,className:e})),...a,children:i.map((l,c)=>Z.isValidElement(l)?Z.cloneElement(l,{...l.props,stepNumber:c+1,status:l.props.status||(c<r?"completed":c===r?"current":"upcoming"),isLast:c===i.length-1,orientation:t,size:n}):l)})});Pg.displayName="Steps";var Lg=cva("flex items-center",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col items-start"},size:{sm:"gap-2",md:"gap-3",lg:"gap-4"}},defaultVariants:{orientation:"horizontal",size:"md"}}),sC=cva("flex items-center justify-center rounded-full font-medium transition-colors",{variants:{status:{completed:"bg-primary text-primary-foreground",current:"bg-primary text-primary-foreground ring-2 ring-primary ring-offset-2 ring-offset-background",upcoming:"bg-muted text-muted-foreground border-2 border-muted-foreground/30"},size:{sm:"h-6 w-6 text-xs",md:"h-8 w-8 text-sm",lg:"h-10 w-10 text-base"}},defaultVariants:{status:"upcoming",size:"md"}}),iC=cva("bg-muted transition-colors",{variants:{orientation:{horizontal:"h-0.5 flex-1 min-w-8",vertical:"w-0.5 min-h-8 ml-4"},status:{completed:"bg-primary",current:"bg-muted",upcoming:"bg-muted"}},defaultVariants:{orientation:"horizontal",status:"upcoming"}}),Dg=Z.forwardRef(({className:e,orientation:t="horizontal",size:n="md",title:r,description:o,icon:a,status:s="upcoming",stepNumber:i,isLast:l,...c},d)=>jsxs("div",{ref:d,className:m(Lg({orientation:t,size:n,className:e}),!l&&t==="horizontal"&&"flex-1"),...c,children:[jsx("div",{className:m("flex items-center",t==="vertical"&&"flex-col items-start"),children:jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:m(sC({status:s,size:n})),children:s==="completed"?jsx(Check,{className:n==="sm"?"h-3 w-3":n==="lg"?"h-5 w-5":"h-4 w-4"}):a||i}),(r||o)&&jsxs("div",{className:"flex flex-col",children:[r&&jsx("span",{className:m("font-medium",n==="sm"&&"text-sm",n==="lg"&&"text-lg",s==="upcoming"&&"text-muted-foreground"),children:r}),o&&jsx("span",{className:m("text-muted-foreground",n==="sm"&&"text-xs",n==="md"&&"text-sm",n==="lg"&&"text-base"),children:o})]})]})}),!l&&jsx("div",{className:m(iC({orientation:t,status:s==="completed"?"completed":"upcoming"}),t==="vertical"&&"my-2")})]}));Dg.displayName="Step";var Ig=cva("flex flex-col select-none",{variants:{variant:{default:"",bordered:"rounded-lg border",filled:"bg-muted/30 rounded-lg p-2"},size:{sm:"[--tree-indent:16px] [--tree-item-height:28px] text-xs",md:"[--tree-indent:20px] [--tree-item-height:32px] text-sm",lg:"[--tree-indent:24px] [--tree-item-height:40px] text-base"}},defaultVariants:{variant:"default",size:"md"}}),Vg=cva("flex items-center py-1.5 px-2 rounded-sm transition-colors",{variants:{size:{sm:"py-1 px-1.5 text-sm min-h-[var(--tree-item-height)]",md:"py-1.5 px-2 text-sm min-h-[var(--tree-item-height)]",lg:"py-2 px-3 text-base min-h-[var(--tree-item-height)]"},isSelected:{true:"bg-primary/10 text-primary",false:""},isDragging:{true:"opacity-50",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed",false:""},isHoverable:{true:"hover:bg-muted/50 cursor-pointer",false:""}},defaultVariants:{size:"md",isSelected:false,isDragging:false,isDisabled:false,isHoverable:true}}),Ag=Z.createContext(null),gC=()=>{let e=Z.useContext(Ag);if(!e)throw new Error("TreeNodeComponent must be used within Tree");return e},bC=({checked:e,indeterminate:t,disabled:n,onClick:r})=>jsx("button",{type:"button",role:"checkbox","aria-checked":t?"mixed":e,disabled:n,onClick:o=>{o.stopPropagation(),n||r(o);},className:m("h-4 w-4 shrink-0 rounded-sm border border-primary transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",(e||t)&&"bg-primary text-primary-foreground",n&&"cursor-not-allowed opacity-50"),children:(e||t)&&jsx("span",{className:"flex items-center justify-center text-current",children:t?jsx(Minus,{className:"h-3 w-3"}):jsx(Check,{className:"h-3 w-3"})})}),zg=({node:e,level:t,isLast:n=false,parentIsLastPath:r=[]})=>{let{expandedKeys:o,toggleExpand:a,selectedKeys:s,handleSelect:i,selectable:l,checkedKeys:c,halfCheckedKeys:d,handleCheck:u,checkable:p,draggable:f,draggedNode:g,setDraggedNode:v,dragOverKey:b,dragOverPosition:h,setDragOver:x,handleDrop:R,allowDrop:N,onDragStart:w,onDragOver:y,onDragEnter:C,onDragLeave:E,onDragEnd:L,showLine:k,showIcon:S,showHandle:T,dragIcon:M,icon:D,leafIcon:P,folderIcon:I,folderOpenIcon:H,blockNode:A,disabled:B,size:$,getAllKeys:j}=gC(),G=e.children&&e.children.length>0,U=e.isLeaf??!G,W=o.has(e.key),V=s.has(e.key),z=c.has(e.key),K=d.has(e.key),Y=g?.key===e.key,Q=b===e.key,J=!!(B||e.isDisabled),Ne=l&&e.selectable!==false,be=p&&e.checkable!==false,_=Z.useMemo(()=>J?false:typeof f=="boolean"?f:typeof f=="function"?f(e):f&&typeof f=="object"?f.nodeDraggable?f.nodeDraggable(e):true:false,[f,e,J]),O=Z.useMemo(()=>M!==void 0?M:typeof f=="object"&&f.icon!==void 0?f.icon:jsx(GripVertical,{className:"h-4 w-4"}),[M,f]),F=Z.useMemo(()=>e.icon?e.icon:D?typeof D=="function"?D({expanded:W,isLeaf:U}):D:U?P:W?H:I,[e.icon,D,W,U,P,I,H]),q=ne=>{if(!_)return;ne.stopPropagation(),ne.dataTransfer.effectAllowed="move";let oe=ne.currentTarget,ke=oe.cloneNode(true),Ft=document.documentElement.classList.contains("dark"),bt=Ft?"#0a0a0a":"#ffffff",eo=Ft?"#27272a":"#e4e4e7";ke.style.cssText=`
|
|
44
44
|
position: fixed;
|
|
45
45
|
top: -9999px;
|
|
46
46
|
left: -9999px;
|
|
@@ -52,7 +52,7 @@ import*as Z from'react';import {createContext,useState,useRef,useCallback,useEff
|
|
|
52
52
|
width: ${oe.offsetWidth}px;
|
|
53
53
|
opacity: 1;
|
|
54
54
|
z-index: 9999;
|
|
55
|
-
`,document.body.appendChild(ke),re.dataTransfer.setDragImage(ke,20,15),setTimeout(()=>{document.body.removeChild(ke);},0),v(e),w?.({event:re,node:e});},X=re=>{if(re.preventDefault(),re.stopPropagation(),!g||g.key===e.key||J)return;let oe=re.currentTarget.getBoundingClientRect(),ke=re.clientY-oe.top,Ft=oe.height,bt;ke<Ft*.25?bt=-1:ke>Ft*.75?bt=1:bt=0,!(N&&!N({dropNode:e,dropPosition:bt,dragNode:g}))&&(x(e.key,bt),y?.({event:re,node:e}));},Re=re=>{re.preventDefault(),re.stopPropagation(),!(!g||g.key===e.key)&&C?.({event:re,node:e,expandedKeys:j()});},Te=re=>{re.stopPropagation(),E?.({event:re,node:e});},ot=re=>{re.preventDefault(),re.stopPropagation(),!(!g||g.key===e.key||J)&&(h!==null&&R(e,h),v(null),x(null,null));},ue=re=>{v(null),x(null,null),L?.({event:re,node:e});},tt=re=>{J||Ne&&i(e.key,e,re);},te=re=>{re.stopPropagation(),!J&&!U&&a(e.key,e);},at=Z.useMemo(()=>{if(!Q||h===null)return "";switch(h){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 ""}},[Q,h]),qt=[...n,r];return jsxs("div",{className:"relative",children:[k&&t>0&&jsxs(Fragment,{children:[n.map((re,oe)=>!re&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${oe} * var(--tree-indent) + 12px)`,top:0,bottom:0}},oe)),jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${t-1} * var(--tree-indent) + 12px)`,top:0,height:r?"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":U?void 0:W,"aria-selected":Ne?V:void 0,"aria-disabled":J,draggable:_,onDragStart:q,onDragOver:X,onDragEnter:Re,onDragLeave:Te,onDrop:ot,onDragEnd:ue,onClick:tt,className:m("relative",Vg({size:$,isSelected:V,isDragging:Y,isDisabled:J,isHoverable:Ne&&!J}),at,A&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[_&&T&&O!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:O}),jsx("button",{type:"button",onClick:te,className:m("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",U&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:m("h-4 w-4 transition-transform duration-200",W&&"rotate-90")})}),be&&jsx(bC,{checked:z,indeterminate:K,disabled:J,onClick:re=>u(e.key,e,re)}),S&&F&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:F}),jsx("div",{className:m("flex-1 min-w-0 truncate ml-1",A&&"flex-none"),children:e.label})]}),G&&W&&jsx("div",{role:"group",children:e.children.map((re,oe)=>jsx(zg,{node:re,level:t+1,isLast:oe===e.children.length-1,parentIsLastPath:qt},re.key))})]})},vC=e=>{let t=[],r=n=>{for(let o of n)t.push(o.key),o.children&&r(o.children);};return r(e),t},hC=e=>{let t=[],r=n=>{for(let o of n)t.push(o.key),o.children&&r(o.children);};return e.children&&r(e.children),t},Og=(e,t)=>{if(!e.children)return false;for(let r of e.children)if(r.key===t||Og(r,t))return true;return false},Fg=Z.forwardRef(({className:e,variant:t,size:r,data:n,draggable:o=false,allowDrop:a,expandedKeys:s,defaultExpandedKeys:i=[],defaultExpandAll:l=false,onExpand:c,selectable:d=true,multiple:u=false,selectedKeys:p,defaultSelectedKeys:f=[],onSelect:g,checkable:v=false,checkStrictly:b=false,checkedKeys:h,defaultCheckedKeys:x=[],onCheck:R,showLine:N=false,showIcon:w=false,showHandle:y=true,dragIcon:C,icon:E,leafIcon:L=jsx(File,{className:"h-4 w-4"}),folderIcon:k=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:S=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:T,onDragEnter:M,onDragOver:D,onDragLeave:P,onDragEnd:I,onDrop:H,blockNode:A=false,isDisabled:B=false,...$},j)=>{let G=Z.useCallback(()=>l?new Set(vC(n)):new Set(i),[l,i,n]),[U,W]=Z.useState(G),V=s!==void 0,z=V?new Set(s):U,K=Z.useCallback((Se,qe)=>{let Bt=new Set(z),$e=!Bt.has(Se);$e?Bt.add(Se):Bt.delete(Se),V||W(Bt),c?.(Array.from(Bt),{expanded:$e,node:qe});},[z,V,c]),[Y,Q]=Z.useState(new Set(f)),J=p!==void 0,Ne=J?new Set(p):Y,be=Z.useCallback((Se,qe,Bt)=>{let $e=new Set(Ne),ne=!$e.has(Se);u?ne?$e.add(Se):$e.delete(Se):($e.clear(),ne&&$e.add(Se)),J||Q($e);let we=[],Mn=Pa=>{for(let to of Pa)$e.has(to.key)&&we.push(to),to.children&&Mn(to.children);};Mn(n),g?.(Array.from($e),{selected:ne,selectedNodes:we,node:qe,event:Bt});},[Ne,u,J,g,n]),[_,O]=Z.useState(new Set(x)),[F,q]=Z.useState(new Set),X=h!==void 0,Re=X?new Set(Array.isArray(h)?h:h.checked):_,Te=X&&!Array.isArray(h)?new Set(h.halfChecked):F,ot=Z.useCallback((Se,qe,Bt)=>{let $e=new Set(Re),ne=new Set(Te),we=!$e.has(Se);if(we?($e.add(Se),ne.delete(Se)):$e.delete(Se),!b&&qe.children){let fi=hC(qe);for(let Jr of fi)we?($e.add(Jr),ne.delete(Jr)):$e.delete(Jr);}X||(O($e),q(ne));let Mn=[],Pa=fi=>{for(let Jr of fi)$e.has(Jr.key)&&Mn.push(Jr),Jr.children&&Pa(Jr.children);};Pa(n);let to=b?{checked:Array.from($e),halfChecked:Array.from(ne)}:Array.from($e);R?.(to,{checked:we,checkedNodes:Mn,node:qe,event:Bt,halfCheckedKeys:Array.from(ne)});},[Re,Te,b,X,R,n]),[ue,tt]=Z.useState(null),[te,at]=Z.useState(null),[qt,re]=Z.useState(null),oe=Z.useCallback((Se,qe)=>{at(Se),re(qe);},[]),ke=Z.useCallback((Se,qe)=>{!ue||!H||qe===0&&Og(ue,Se.key)||H({event:{},node:Se,dragNode:ue,dropPosition:qe,dropToGap:qe!==0});},[ue,H]),Ft=Z.useCallback(()=>Array.from(z),[z]),bt={expandedKeys:z,toggleExpand:K,selectedKeys:Ne,handleSelect:be,selectable:d,multiple:u,checkedKeys:Re,halfCheckedKeys:Te,handleCheck:ot,checkable:v,checkStrictly:b,draggable:o,draggedNode:ue,setDraggedNode:tt,dragOverKey:te,dragOverPosition:qt,setDragOver:oe,handleDrop:ke,allowDrop:a,onDragStart:T,onDragEnter:M,onDragOver:D,onDragLeave:P,onDragEnd:I,showLine:N,showIcon:w,showHandle:y,dragIcon:C,icon:E,leafIcon:L,folderIcon:k,folderOpenIcon:S,blockNode:A,disabled:B,size:r,data:n,getAllKeys:Ft},eo=Se=>{let qe=Se.relatedTarget,Bt=Se.currentTarget;(!qe||!Bt.contains(qe))&&oe(null,null);};return jsx(Ag.Provider,{value:bt,children:jsx("div",{ref:j,role:"tree","aria-multiselectable":u||v,className:m(Ig({variant:t,size:r,className:e})),onDragLeave:eo,...$,children:n.map((Se,qe)=>jsx(zg,{node:Se,level:0,isLast:qe===n.length-1},Se.key))})})});Fg.displayName="Tree";var $g=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-9 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base"},fullWidth:{true:"w-full",false:"w-fit min-w-48"}},defaultVariants:{size:"md",fullWidth:false}}),MC=({text:e,query:t})=>{if(!t)return jsx(Fragment,{children:e});let r=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),n=e.split(r);return jsx(Fragment,{children:n.map((o,a)=>r.test(o)?jsx("mark",{className:"bg-primary/20 text-foreground rounded-sm",children:o},a):jsx("span",{children:o},a))})},TC=(e,t)=>{let[r,n]=Z.useState(e);return Z.useEffect(()=>{let o=setTimeout(()=>{n(e);},t);return ()=>{clearTimeout(o);}},[e,t]),r},Kg=Z.forwardRef(({className:e,size:t,value:r,defaultValue:n="",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:p="Loading...",clearable:f=false,allowCustomValue:g=true,maxHeight:v=200,highlightMatch:b=true,fullWidth:h=false,disabled:x,...R},N)=>{let[w,y]=Z.useState(false),[C,E]=Z.useState(n),[L,k]=Z.useState([]),[S,T]=Z.useState(false),[M,D]=Z.useState(false),[P,I]=Z.useState(0),H=Z.useRef(null),A=Z.useRef(null),B=r!==void 0?r:C,$=TC(B,l);Z.useEffect(()=>{let F=A.current;if(!F)return;let q=()=>{I(F.offsetWidth);};q();let X=new ResizeObserver(q);return X.observe(F),()=>{X.disconnect();}},[]),Z.useImperativeHandle(N,()=>H.current);let j=i?L:s,G=Z.useMemo(()=>i?j:j.filter(F=>F.label.toLowerCase().includes(B.toLowerCase())),[j,B,i]);Z.useEffect(()=>{if(!i)return;if($.length<c){k([]);return}let F=false;return (async()=>{T(true);try{let X=await i($);F||k(X);}catch{F||k([]);}finally{F||T(false);}})(),()=>{F=true;}},[$,i,c]);let U=F=>{r===void 0&&E(F),o?.(F);},W=F=>{let q=F.target.value;U(q),q.length>=c&&y(true);},V=F=>{U(F.label),a?.(F),y(false);},z=()=>{U(""),H.current?.focus();},K=()=>{D(true),y(true);},Y=()=>{D(false);},Q=F=>{F.key==="Escape"&&y(false),F.key==="ArrowDown"&&!w&&G.length>0&&y(true);},J=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",Ne=f&&B?"pr-8":"pr-3",be=t==="sm"?"text-xs":t==="lg"?"text-base":"text-sm",_=t==="sm"?"px-1.5 py-1":t==="lg"?"px-3 py-2":"px-2 py-1.5",O=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4";return jsxs(Pt,{open:w,onOpenChange:y,children:[jsxs(tn,{ref:A,className:m("relative",h?"w-full":"w-fit"),children:[jsx("input",{ref:H,type:"text",value:B,onChange:W,onFocus:K,onBlur:Y,onKeyDown:Q,disabled:x,placeholder:d,className:m($g({size:t,fullWidth:h}),Ne,e),style:{borderColor:M?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":w,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...R}),f&&B&&!x&&jsx("button",{type:"button",onClick:z,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:J})})]}),jsx(Lt,{className:"p-0",align:"start",style:{width:P>0?P:void 0},onOpenAutoFocus:F=>F.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(ze,{style:{maxHeight:v},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:S?jsxs("div",{className:m("flex items-center justify-center gap-2 py-6 text-muted-foreground",be),children:[jsx(Loader2,{className:m(J,"animate-spin")}),p]}):G.length===0?jsx("div",{className:m("py-6 text-center text-muted-foreground",be),children:u}):G.map(F=>jsxs(Command.Item,{value:F.value,disabled:F.isDisabled,onSelect:()=>V(F),className:m("relative flex cursor-default select-none items-center rounded-sm outline-none",_,be,"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 shrink-0",O,B===F.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:b?jsx(MC,{text:F.label,query:B}):F.label})]},F.value))})})})})]})});Kg.displayName="Autocomplete";var ur=Z.createContext(null),bl=Z.createContext(null),vl=()=>{let e=Z.useContext(ur);if(!e)throw new Error("useFormContext must be used within a Form");return e},Ms=()=>{let e=Z.useContext(bl);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},NC={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:r=>typeof r=="string"&&r.length>=e,message:t??`Must be at least ${e} characters`}),maxLength:(e,t)=>({validate:r=>typeof r=="string"&&r.length<=e,message:t??`Must be at most ${e} characters`}),min:(e,t)=>({validate:r=>typeof r=="number"&&r>=e,message:t??`Must be at least ${e}`}),max:(e,t)=>({validate:r=>typeof r=="number"&&r<=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:r=>typeof r=="string"&&e.test(r),message:t}),custom:(e,t)=>({validate:e,message:t})},Gg=Z.forwardRef(({defaultValues:e={},onSubmit:t,onError:r,validateOnBlur:n=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=Z.useState(e),[u,p]=Z.useState({}),[f,g]=Z.useState({}),[v,b]=Z.useState({}),[h,x]=Z.useState(false),R=Z.useRef(new Map),N=Z.useCallback((P,I)=>{R.current.set(P,I);},[]),w=Z.useCallback(P=>{R.current.delete(P);},[]),y=Z.useCallback(P=>{let I=R.current.get(P)||[],H=c[P];for(let A of I)if(!A.validate(H))return p(B=>({...B,[P]:A.message})),false;return p(A=>({...A,[P]:null})),true},[c]),C=Z.useCallback(()=>{let P=true,I={};return R.current.forEach((H,A)=>{let B=c[A];for(let $ of H)if(!$.validate(B)){I[A]=$.message,P=false;break}I[A]||(I[A]=null);}),p(I),P},[c]),E=Z.useCallback((P,I)=>{d(H=>({...H,[P]:I})),b(H=>({...H,[P]:true})),o&&setTimeout(()=>{y(P);},0);},[o,y]),L=Z.useCallback((P,I)=>{p(H=>({...H,[P]:I}));},[]),k=Z.useCallback((P,I)=>{g(H=>({...H,[P]:I})),I&&n&&y(P);},[n,y]),S=Z.useCallback(P=>({value:c[P],error:u[P]??null,touched:f[P]??false,dirty:v[P]??false}),[c,u,f,v]),T=Z.useCallback(()=>{d(e),p({}),g({}),b({});},[e]),M=async P=>{P.preventDefault();let I={};if(R.current.forEach((A,B)=>{I[B]=true;}),g(I),!C()){r?.(u);return}if(t){x(true);try{await t(c);}finally{x(false);}}},D={values:c,errors:u,touched:f,dirty:v,isSubmitting:h,setValue:E,setError:L,setTouched:k,validateField:y,validateAll:C,registerField:N,unregisterField:w,getFieldState:S,reset:T};return jsx(ur.Provider,{value:D,children:jsx("form",{ref:l,onSubmit:M,className:m("space-y-4",s),...i,children:a})})});Gg.displayName="Form";var Ug=({name:e,rules:t=[],defaultValue:r,children:n})=>{let o=vl(),a=Z.useId();Z.useEffect(()=>(o.registerField(e,t),r!==void 0&&o.values[e]===void 0&&o.setValue(e,r),()=>{o.unregisterField(e);}),[e,t,r,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(bl.Provider,{value:i,children:n})};Ug.displayName="FormField";var _g=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:m("space-y-1.5",e),...t}));_g.displayName="FormItem";var jg=Z.forwardRef(({className:e,required:t,children:r,...n},o)=>{let{id:a,error:s,touched:i}=Ms();return jsxs(Pn,{ref:o,htmlFor:a,className:m(s&&i&&"text-danger",e),...n,children:[r,t&&jsx("span",{className:"ml-1 text-danger",children:"*"})]})});jg.displayName="FormLabel";var Wg=({children:e})=>{let{name:t,id:r,error:n,touched:o}=Ms(),a=vl(),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 Z.cloneElement(e,{id:r,name:t,value:s.value??"",onChange:i,onBlur:l,"aria-invalid":n&&o?"true":void 0,"aria-describedby":n&&o?`${r}-error`:void 0})};Wg.displayName="FormControl";var Yg=Z.forwardRef(({className:e,...t},r)=>jsx("p",{ref:r,className:m("text-xs text-muted-foreground",e),...t}));Yg.displayName="FormDescription";var qg=Z.forwardRef(({className:e,message:t,...r},n)=>{let{id:o,error:a,touched:s}=Ms(),i=t??(s?a:null);return i?jsx("p",{ref:n,id:`${o}-error`,className:m("text-xs text-danger",e),role:"alert",...r,children:i}):null});qg.displayName="FormMessage";var Xg=Z.forwardRef(({name:e,rules:t=[],validate:r,errorMessage:n,isInvalid:o,isRequired:a,onChange:s,onBlur:i,value:l,defaultValue:c,...d},u)=>{let p=Z.useContext(ur),f=!!p&&!!e,[g,v]=Z.useState(c??""),[b,h]=Z.useState(null),[x,R]=Z.useState(false),N=l!==void 0,w=N?l:f?p.values[e]:g;Z.useEffect(()=>{if(f&&p&&e){let k=[...t];return a&&!k.some(S=>S.message.toLowerCase().includes("required"))&&k.unshift({validate:S=>typeof S=="string"?S.trim().length>0:S!=null,message:"This field is required"}),r&&k.push({validate:S=>!r(String(S??"")),message:"Validation failed"}),p.registerField(e,k),c!==void 0&&p.values[e]===void 0&&p.setValue(e,c),()=>{p.unregisterField(e);}}},[e,f,p,t,a,r,c]);let y=k=>{let S=k.target.value;if(f&&p&&e?p.setValue(e,S):N||v(S),r&&x){let T=r(S);h(T??null);}s?.(k);},C=k=>{if(R(true),f&&p&&e&&p.setTouched(e,true),r){let S=r(String(w??""));h(S??null);}i?.(k);},E=n,L=o;if(f&&p&&e){let k=p.getFieldState(e);k.touched&&k.error&&(E=E??k.error,L=true);}else x&&b&&(E=E??b,L=true);return jsx(Qr,{ref:u,name:e,value:String(w??""),onChange:y,onBlur:C,isRequired:a,isInvalid:L,errorMessage:E,...d})});Xg.displayName="TextField";var Zg=Z.forwardRef(({name:e,rules:t=[],validate:r,errorMessage:n,isInvalid:o,isRequired:a,onChange:s,onBlur:i,value:l,defaultValue:c,...d},u)=>{let p=Z.useContext(ur),f=!!p&&!!e,[g,v]=Z.useState(c??""),[b,h]=Z.useState(null),[x,R]=Z.useState(false),N=l!==void 0,w=N?l:f?p.values[e]:g;Z.useEffect(()=>{if(f&&p&&e){let k=[...t];return a&&!k.some(S=>S.message.toLowerCase().includes("required"))&&k.unshift({validate:S=>typeof S=="string"?S.trim().length>0:S!=null,message:"This field is required"}),r&&k.push({validate:S=>!r(String(S??"")),message:"Validation failed"}),p.registerField(e,k),c!==void 0&&p.values[e]===void 0&&p.setValue(e,c),()=>{p.unregisterField(e);}}},[e,f,p,t,a,r,c]);let y=k=>{let S=k.target.value;if(f&&p&&e?p.setValue(e,S):N||v(S),r&&x){let T=r(S);h(T??null);}s?.(k);},C=k=>{if(R(true),f&&p&&e&&p.setTouched(e,true),r){let S=r(String(w??""));h(S??null);}i?.(k);},E=n,L=o;if(f&&p&&e){let k=p.getFieldState(e);k.touched&&k.error&&(E=E??k.error,L=true);}else x&&b&&(E=E??b,L=true);return jsx(Ba,{ref:u,name:e,value:String(w??""),onChange:y,onBlur:C,isRequired:a,isInvalid:L,errorMessage:E,...d})});Zg.displayName="TextareaField";var Qg=Z.forwardRef(({name:e,rules:t=[],validate:r,errorMessage:n,isInvalid:o,isRequired:a,onChange:s,onBlur:i,value:l,defaultValue:c,label:d,description:u,className:p,...f},g)=>{let v=Z.useContext(ur),b=!!v&&!!e,h=Z.useId(),[x,R]=Z.useState(c),[N,w]=Z.useState(null),[y,C]=Z.useState(false),E=l!==void 0,L=E?l:b?v.values[e]:x;Z.useEffect(()=>{if(b&&v&&e){let P=[...t];return a&&!P.some(I=>I.message.toLowerCase().includes("required"))&&P.unshift({validate:I=>I!=null&&I!=="",message:"This field is required"}),r&&P.push({validate:I=>!r(I),message:"Validation failed"}),v.registerField(e,P),c!==void 0&&v.values[e]===void 0&&v.setValue(e,c),()=>{v.unregisterField(e);}}},[e,b,v,t,a,r,c]);let k=P=>{if(b&&v&&e?v.setValue(e,P):E||R(P),r&&y){let I=r(P);w(I??null);}s?.(P);},S=P=>{if(C(true),b&&v&&e&&v.setTouched(e,true),r){let I=r(L);w(I??null);}i?.(P);},T=n,M=o;if(b&&v&&e){let P=v.getFieldState(e);P.touched&&P.error&&(T=T??P.error,M=true);}else y&&N&&(T=T??N,M=true);let D=M||!!T;return d||u||T?jsxs("div",{className:p,children:[d&&jsxs("label",{htmlFor:h,className:"text-sm font-medium leading-none mb-1.5 block",children:[d,a&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),jsx(Jo,{ref:g,id:h,name:e,value:L,onChange:k,onBlur:S,isDisabled:f.isDisabled,...f}),(u||T)&&jsx("p",{className:`text-xs mt-1.5 ${D?"text-danger":"text-muted-foreground"}`,children:T||u})]}):jsx(Jo,{ref:g,name:e,value:L,onChange:k,onBlur:S,className:p,...f})});Qg.displayName="NumberField";var tb=Z.forwardRef(({name:e,rules:t=[],validate:r,errorMessage:n,isInvalid:o,isRequired:a,multiple:s=false,value:i,defaultValue:l,onValueChange:c,label:d,description:u,className:p,...f},g)=>{let v=Z.useContext(ur),b=!!v&&!!e,h=Z.useId(),[x,R]=Z.useState(l),[N,w]=Z.useState(null),[y,C]=Z.useState(false),E=i!==void 0,L=E?i:b?v.values[e]:x;Z.useEffect(()=>{if(b&&v&&e){let D=[...t];return a&&!D.some(P=>P.message.toLowerCase().includes("required"))&&D.unshift({validate:P=>Array.isArray(P)?P.length>0:P!=null&&P!=="",message:"This field is required"}),r&&D.push({validate:P=>!r(P),message:"Validation failed"}),v.registerField(e,D),l!==void 0&&v.values[e]===void 0&&v.setValue(e,l),()=>{v.unregisterField(e);}}},[e,b,v,t,a,r,l]);let k=D=>{if(C(true),b&&v&&e?(v.setValue(e,D),v.setTouched(e,true)):E||R(D),r){let P=r(D);w(P??null);}c?.(D);},S=n,T=o;if(b&&v&&e){let D=v.getFieldState(e);D.touched&&D.error&&(S=S??D.error,T=true);}else y&&N&&(S=S??N,T=true);let M=T||!!S;return jsxs("div",{className:p,children:[d&&jsxs("label",{htmlFor:h,className:"text-sm font-medium leading-none mb-1.5 block",children:[d,a&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),s?jsx(In,{ref:g,multiple:true,value:L,onValueChange:k,isDisabled:f.isDisabled,...f}):jsx(In,{ref:g,value:L,onValueChange:k,isDisabled:f.isDisabled,...f}),(u||S)&&jsx("p",{className:`text-xs mt-1.5 ${M?"text-danger":"text-muted-foreground"}`,children:S||u})]})});tb.displayName="SelectField";var nb=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"}}),ob=Z.forwardRef(({className:e,size:t,name:r,description:n,avatarUrl:o,avatarFallback:a,trailing:s,...i},l)=>{let c=a||r.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return jsxs("div",{ref:l,className:m(nb({size:t,className:e})),...i,children:[jsxs(Dn,{"data-user-avatar":true,children:[o&&jsx(so,{src:o,alt:r}),jsx(Hn,{children:c})]}),jsxs("div",{className:"flex flex-col min-w-0",children:[jsx("span",{className:"text-sm font-medium leading-none truncate",children:r}),n&&jsx("span",{className:"text-sm text-muted-foreground truncate",children:n})]}),s&&jsx("div",{className:"ml-auto flex-shrink-0",children:s})]})});ob.displayName="User";var sb=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-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"flat",size:"md",radius:"sm"}}),ib=Z.forwardRef(({className:e,variant:t,size:r,radius:n,...o},a)=>jsx("code",{ref:a,className:m(sb({variant:t,size:r,radius:n,className:e})),...o}));ib.displayName="Code";function ub(e){let[t,r]=useState(false);return useEffect(()=>{if(e){r(e==="dark");return}let n=()=>{r(document.documentElement.classList.contains("dark"));};n();let o=new MutationObserver(n);return o.observe(document.documentElement,{attributes:true,attributeFilter:["class"]}),()=>o.disconnect()},[e]),t}var mb=Z.forwardRef(({code:e,language:t="bash",showLineNumbers:r=false,className:n,noBorder:o=false,filename:a,theme:s,hideCopyButton:i=false},l)=>{let[c,d]=useState(false),p=ub(s)?themes.oneDark:themes.oneLight,f=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",n),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:p,code:e.trim(),language:t,children:({tokens:g,getLineProps:v,getTokenProps:b})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:g.map((h,x)=>jsxs("div",{...v({line:h}),children:[r&&jsx("span",{className:"inline-block w-8 text-zinc-400 dark:text-zinc-600 select-none text-right mr-4",children:x+1}),h.map((R,N)=>jsx("span",{...b({token:R})},N))]},x))})}),!i&&jsx("button",{onClick:f,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"})})]})]})});mb.displayName="CodeBlock";var pb=Z.forwardRef(({tabs:e,className:t,theme:r},n)=>{let[o,a]=useState(0),[s,i]=useState(false),c=ub(r)?themes.oneDark:themes.oneLight,d=async()=>{await navigator.clipboard.writeText(e[o].code),i(true),setTimeout(()=>i(false),2e3);},u=e[o],p=u.language||"bash";return jsxs("div",{ref:n,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((f,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:[f.icon,f.name]},f.name))}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:c,code:u.code.trim(),language:p,children:({tokens:f,getLineProps:g,getTokenProps:v})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:f.map((b,h)=>jsx("div",{...g({line:b}),children:b.map((x,R)=>jsx("span",{...v({token:x})},R))},h))})}),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"})})]})]})});pb.displayName="TabbedCodeBlock";var fb=cva("relative flex items-center gap-2 font-mono rounded-lg border",{variants:{variant:{solid:"bg-zinc-800 text-white dark:bg-zinc-200 dark:text-zinc-900 border-transparent",bordered:"bg-transparent border-zinc-300 dark:border-zinc-700 text-zinc-900 dark:text-white",flat:"bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-white border-transparent"},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:"solid",size:"md"}}),gb=Z.forwardRef(({className:e,variant:t,size:r,code:n,copyable:o=true,copyLabel:a="Copy",onCopy:s,symbol:i="$",hideSymbol:l=false,dismissible:c=false,onDismiss:d,...u},p)=>{let[f,g]=Z.useState(false),v=async()=>{try{await navigator.clipboard.writeText(n),g(!0),s?.(),setTimeout(()=>g(!1),2e3);}catch(b){console.error("Failed to copy:",b);}};return jsxs("div",{ref:p,className:m(fb({variant:t,size:r,className:e})),...u,children:[!l&&jsx("span",{className:"text-muted-foreground select-none",children:i}),jsx("code",{className:"flex-1 truncate",children:n}),o&&jsx("button",{type:"button",onClick:v,className:m("flex-shrink-0 rounded p-1 transition-colors cursor-pointer","hover:bg-black/10 dark:hover:bg-white/10","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-label":f?"Copied":a,children:f?jsx(Check,{className:"h-4 w-4 text-green-500"}):jsx(Copy,{className:"h-4 w-4 text-muted-foreground"})}),c&&jsx(Ct,{size:"sm",onClick:d,className:"flex-shrink-0"})]})});gb.displayName="Snippet";var Rl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"md"}}),bb=Z.forwardRef(({className:e,radius:t,src:r,alt:n,fallback:o,showSkeleton:a=true,onLoad:s,onError:i,fit:l="cover",aspectRatio:c,style:d,...u},p)=>{let[f,g]=Z.useState("loading");Z.useEffect(()=>{r&&g("loading");},[r]);let v=()=>{g("loaded"),s?.();},b=()=>{g("error"),i?.();},h={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"}[l];return f==="error"&&o?jsx("div",{className:m(Rl({radius:t}),"flex items-center justify-center bg-muted",e),style:{aspectRatio:c,...d},children:o}):jsxs("div",{className:m(Rl({radius:t}),"relative",e),style:{aspectRatio:c,...d},children:[f==="loading"&&a&&jsx($a,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:p,src:r,alt:n,onLoad:v,onError:b,className:m("h-full w-full transition-opacity duration-300",h,f==="loading"?"opacity-0":"opacity-100"),...u})]})});bb.displayName="Image";var $C=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),KC=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-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 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}}),GC=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"}}),UC=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"}}),Hs={"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"),vb=(e,t)=>{if(!e)return "";let r=wl(e.getDate(),2),n=wl(e.getMonth()+1,2),o=wl(e.getFullYear(),4),a=Hs[t],s=Cl[t],i={day:r,month:n,year:o};return s.map(l=>i[l]).join(a)},Ps=(e,t)=>{let r=Hs[t],n=e.split(r);if(n.length!==3)return null;let o=Cl[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(n[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},_C=e=>{let t=Hs[e];return Cl[e].map(n=>n==="year"?"####":"##").join(t)},da=(e,t)=>{if(!e?.from)return "";let r=vb(e.from,t),n=e.to?vb(e.to,t):"";return r&&n?`${r} - ${n}`:r},hb=Z.forwardRef(({className:e,label:t,description:r,errorMessage:n,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:p,onChange:f,minDate:g,maxDate:v,dateFormat:b="dd.MM.yyyy",showPickerIcon:h=true,mode:x="text",fullWidth:R=false,numberOfMonths:N=2,align:w="start",isDisabled:y,placeholder:C,id:E,...L},k)=>{let S=Z.useId(),T=E||S,M=`${T}-description`,D=`${T}-error`,[P,I]=Z.useState(p),[H,A]=Z.useState(""),[B,$]=Z.useState(false),[j,G]=Z.useState(false),U=u!==void 0?u:P,W=a&&n,V=_C(b),z=Hs[b],K=" - ";Z.useEffect(()=>{j||A(da(U,b));},[U,b,j]);let Y=F=>{u===void 0&&I(F),f?.(F);},Q=F=>{Y(F),A(da(F,b)),F?.from&&F?.to&&$(false);},J=F=>{let q=F.target.value;q=q.replace(new RegExp(`[^0-9\\${z}\\s-]`,"g"),"");let X=`${V}${K}${V}`,Re=q.replace(new RegExp(`[\\${z}\\s-]`,"g"),""),Te="",ot=0;for(let ue=0;ue<X.length&&ot<Re.length;ue++)X[ue]==="#"?(Te+=Re[ot],ot++):Te+=X[ue];if(A(Te),Te.length===X.length){let ue=Te.split(K);if(ue.length===2){let tt=Ps(ue[0].trim(),b),te=Ps(ue[1].trim(),b);if(tt&&te){if(g&&(tt<g||te<g)||v&&(tt>v||te>v))return;tt<=te&&Y({from:tt,to:te});}}}},Ne=()=>{G(true);},be=()=>{G(false);let F=`${V}${K}${V}`;if(H.length!==F.length)A(da(U,b));else {let q=H.split(K);if(q.length!==2)A(da(U,b));else {let X=Ps(q[0].trim(),b),Re=Ps(q[1].trim(),b);(!X||!Re||X>Re)&&A(da(U,b));}}},_=()=>{y||$(true);},O=()=>{!y&&x==="picker"&&h&&$(true);};return jsxs("div",{className:m($C({size:s}),e),children:[t&&jsxs("label",{htmlFor:T,className:m(UC({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(Pt,{open:h&&B,onOpenChange:$,children:[jsxs(tn,{className:m("relative",R?"w-full":"w-fit"),children:[jsx("input",{ref:k,id:T,type:"text",inputMode:x==="text"?"numeric":void 0,value:H,onChange:x==="text"?J:void 0,onClick:O,onFocus:Ne,onBlur:be,readOnly:x==="picker","aria-invalid":a,"aria-describedby":W?D:r?M:void 0,"aria-required":o,disabled:y,placeholder:C||`${b.toLowerCase()} - ${b.toLowerCase()}`,className:m(KC({size:s,isInvalid:a,fullWidth:R,showPickerIcon:h}),x==="picker"&&h&&"cursor-pointer",l),style:{borderColor:j||h&&B?"var(--color-foreground)":void 0},...L}),h&&jsx("button",{type:"button",onClick:_,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(GC({size:s}))})})]}),h&&jsx(Lt,{className:"w-auto p-0",align:w,children:jsx(lo,{mode:"range",selected:U,onSelect:Q,numberOfMonths:N,disabled:F=>!!(g&&F<g||v&&F>v),defaultMonth:U?.from,showMonthAndYearPickers:true,size:s??"md"})})]}),r&&!W&&jsx("p",{id:M,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:r}),W&&jsx("p",{id:D,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:n})]})});hb.displayName="DateRangePicker";var ho=e=>String(e).padStart(2,"0"),xb=Z.forwardRef(({value:e,onValueChange:t,placeholder:r="Pick a time",use24Hour:n=true,minuteStep:o=1,isDisabled:a=false,hideNow:s=false,className:i},l)=>{let[c,d]=Z.useState(false),u=Z.useRef(null),p=Z.useRef(null),f=Z.useCallback((C,E)=>{setTimeout(()=>{if(C!==void 0&&u.current){let L=n?C:C%12||12;u.current.querySelector(`[data-hour="${L}"]`)?.scrollIntoView({behavior:"smooth",block:"center"});}E!==void 0&&p.current&&p.current.querySelector(`[data-minute="${E}"]`)?.scrollIntoView({behavior:"smooth",block:"center"});},50);},[n]);Z.useEffect(()=>{c&&e&&f(e.hours,e.minutes);},[c,e,f]);let g=n?Array.from({length:24},(C,E)=>E):Array.from({length:12},(C,E)=>E+1),v=Array.from({length:Math.floor(60/o)},(C,E)=>E*o),b=C=>{if(!C)return r;if(n)return `${ho(C.hours)}:${ho(C.minutes)}`;let E=C.hours%12||12,L=C.hours>=12?"PM":"AM";return `${ho(E)}:${ho(C.minutes)} ${L}`},h=C=>{let E=e?.minutes??0,L=C;if(!n&&e){let k=e.hours>=12;k&&C!==12?L=C+12:!k&&C===12&&(L=0);}t?.({hours:L,minutes:E});},x=C=>{let E=e?.hours??0;t?.({hours:E,minutes:C});},R=C=>{if(!e)return;let E=e.hours;C==="AM"&&e.hours>=12?E=e.hours-12:C==="PM"&&e.hours<12&&(E=e.hours+12),t?.({hours:E,minutes:e.minutes});},N=()=>{let C=new Date,E={hours:C.getHours(),minutes:C.getMinutes()};t?.(E),f(E.hours,E.minutes);},w=e?e.hours>=12?"PM":"AM":void 0,y=e?n?e.hours:e.hours%12||12:void 0;return jsxs(Pt,{open:c,onOpenChange:d,children:[jsxs(en,{ref:l,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",i),children:[jsx(Clock,{className:"h-4 w-4"}),b(e)]}),jsxs(Lt,{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(ze,{className:"h-[200px]",children:jsx("div",{ref:u,className:"flex flex-col gap-1 p-1",children:g.map(C=>jsx(me,{"data-hour":C,variant:y===C?"solid":"light",size:"sm",radius:"md",className:"h-8 w-12 justify-center",onClick:()=>h(C),children:ho(C)},C))})})]}),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(ze,{className:"h-[200px]",children:jsx("div",{ref:p,className:"flex flex-col gap-1 p-1",children:v.map(C=>jsx(me,{"data-minute":C,variant:e?.minutes===C?"solid":"light",size:"sm",radius:"md",className:"h-8 w-12 justify-center",onClick:()=>x(C),children:ho(C)},C))})})]}),!n&&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(me,{variant:w==="AM"?"solid":"light",size:"sm",radius:"md",className:"h-8 w-12",onClick:()=>R("AM"),children:"AM"}),jsx(me,{variant:w==="PM"?"solid":"light",size:"sm",radius:"md",className:"h-8 w-12",onClick:()=>R("PM"),children:"PM"})]})]})]}),jsxs("div",{className:"flex justify-end gap-2 border-t p-2",children:[!s&&jsx(me,{variant:"light",size:"sm",radius:"md",onClick:N,children:"Now"}),jsx(me,{size:"sm",radius:"md",onClick:()=>d(false),children:"Done"})]})]})]})});xb.displayName="TimePicker";var Ml=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),Tl=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),Rb=Z.forwardRef(({className:e,variant:t,size:r,children:n,onLoadMore:o,hasMore:a,isLoading:s=false,loader:i,threshold:l=100,rootMargin:c,useWindow:d=false,endMessage:u,scrollbarVisibility:p="visible",...f},g)=>{let v=Z.useRef(null),b=Z.useRef(null),h=Z.useRef(false);Z.useImperativeHandle(g,()=>v.current),Z.useEffect(()=>{let N=b.current;if(!N)return;let w=new IntersectionObserver(y=>{let[C]=y;C.isIntersecting&&a&&!s&&!h.current&&(h.current=true,Promise.resolve(o()).finally(()=>{h.current=false;}));},{root:d?null:v.current,rootMargin:c||`${l}px`,threshold:0});return w.observe(N),()=>{w.disconnect();}},[a,s,o,l,c,d]);let x=jsx("div",{className:m(Tl({size:r})),children:jsx(Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),R=jsxs(Fragment,{children:[n,jsx("div",{ref:b,className:"h-px w-full"}),s&&(i||x),!a&&!s&&u&&jsx("div",{className:m(Tl({size:r}),"text-muted-foreground text-sm"),children:u})]});return d?jsx("div",{ref:v,className:m(Ml({variant:t,className:e})),...f,children:R}):jsx(ze,{ref:v,visibility:p,className:m(Ml({variant:t,className:e})),...f,children:R})});Rb.displayName="InfiniteScroll";var aM=e=>e.map(t=>typeof t=="string"?{src:t}:t),Nl=Z.forwardRef(({images:e,open:t,onOpenChange:r,initialIndex:n=0,onIndexChange:o,trigger:a,showThumbnails:s=true,showZoom:i=true,showRotate:l=true,showDownload:c=true,showFullscreen:d=true,showNavigation:u=true,showCounter:p=true,closeOnBackdropClick:f=true,className:g},v)=>{let b=Z.useMemo(()=>aM(e),[e]),[h,x]=Z.useState(n),[R,N]=Z.useState(1),[w,y]=Z.useState(0),[C,E]=Z.useState(false),[L,k]=Z.useState(false),[S,T]=Z.useState({x:0,y:0}),[M,D]=Z.useState({x:0,y:0}),[P,I]=Z.useState(false),H=Z.useRef(null),A=b[h];Z.useEffect(()=>{I(true);},[]),Z.useEffect(()=>{x(n);},[n]),Z.useEffect(()=>{o?.(h);},[h,o]),Z.useEffect(()=>{N(1),y(0),T({x:0,y:0});},[h]),Z.useEffect(()=>{if(t)return lr(),()=>cr()},[t]);let B=Z.useCallback(()=>{x(O=>O>0?O-1:b.length-1);},[b.length]),$=Z.useCallback(()=>{x(O=>O<b.length-1?O+1:0);},[b.length]),j=()=>{N(O=>Math.min(O+.5,4));},G=()=>{N(O=>{let F=Math.max(O-.5,.5);return F===1&&T({x:0,y:0}),F});},U=()=>{y(O=>(O+90)%360);},W=async()=>{if(A)try{let F=await(await fetch(A.src)).blob(),q=URL.createObjectURL(F),X=document.createElement("a");X.href=q,X.download=A.alt||`image-${h+1}`,document.body.appendChild(X),X.click(),document.body.removeChild(X),URL.revokeObjectURL(q);}catch{window.open(A.src,"_blank");}},V=async()=>{if(H.current)if(C)try{await document.exitFullscreen(),E(!1);}catch{}else try{await H.current.requestFullscreen(),E(!0);}catch{}},z=O=>{R>1&&(k(true),D({x:O.clientX-S.x,y:O.clientY-S.y}));},K=O=>{L&&R>1&&T({x:O.clientX-M.x,y:O.clientY-M.y});},Y=()=>{k(false);},Q=()=>{r?.(false);},J=O=>{f&&O.target===O.currentTarget&&Q();},Ne=Z.useCallback(O=>{switch(O.key){case "ArrowLeft":B();break;case "ArrowRight":$();break;case "Escape":r?.(false);break;case "+":case "=":j();break;case "-":G();break}},[B,$,r]);if(Z.useEffect(()=>{if(t)return window.addEventListener("keydown",Ne),()=>window.removeEventListener("keydown",Ne)},[t,Ne]),Z.useEffect(()=>{let O=()=>{E(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",O),()=>document.removeEventListener("fullscreenchange",O)},[]),b.length===0)return null;let be=a?Z.isValidElement(a)?Z.cloneElement(a,{onClick:O=>{a.props.onClick?.(O),r?.(true);}}):jsx("button",{type:"button",onClick:()=>r?.(true),children:a}):null;return jsxs(Fragment,{children:[be,!P||!t?null:Ua.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:J}),jsxs("div",{ref:v,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:[p&&b.length>1&&jsxs("span",{className:"text-sm",children:[h+1," / ",b.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:G,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(R*100),"%"]}),jsx("button",{onClick:j,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:U,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:W,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:V,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:C?"Exit fullscreen":"Fullscreen",children:C?jsx(Minimize2,{className:"h-5 w-5"}):jsx(Maximize2,{className:"h-5 w-5"})}),jsxs("button",{onClick:Q,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:H,className:"relative flex-1 flex items-center justify-center overflow-hidden",onMouseDown:z,onMouseMove:K,onMouseUp:Y,onMouseLeave:Y,children:[u&&b.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:$,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",L?"cursor-grabbing":R>1?"cursor-grab":""),style:{transform:`translate(${S.x}px, ${S.y}px) scale(${R}) rotate(${w}deg)`},draggable:false})]}),A?.description&&jsx("div",{className:"p-4 text-center text-white text-sm",children:A.description}),s&&b.length>1&&jsx("div",{className:"flex justify-center gap-2 p-4 overflow-x-auto",children:b.map((O,F)=>jsx("button",{onClick:()=>x(F),className:m("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",h===F?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:O.src,alt:O.alt||`Thumbnail ${F+1}`,className:"h-full w-full object-cover"})},F))})]})]}),document.body)]})});Nl.displayName="ImageViewer";var Cb=({children:e,images:t,index:r=0,className:n})=>{let[o,a]=Z.useState(false);return jsxs(Fragment,{children:[jsx("button",{onClick:()=>a(true),className:m("cursor-zoom-in",n),children:e}),jsx(Nl,{images:t,open:o,onOpenChange:a,initialIndex:r})]})};Cb.displayName="ImageViewerTrigger";var Mb=cva("inline-flex items-center justify-center font-mono font-medium",{variants:{variant:{default:"rounded border border-border bg-muted text-muted-foreground",light:"text-muted-foreground",bordered:"rounded border border-current text-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"}}),iM={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"},lM={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"},cM=e=>{let t=e.toLowerCase();return iM[t]||e.toUpperCase()},ma=e=>{let t=e.toLowerCase();return lM[t]||t},Is=e=>{let t=ma(e);return ["meta","control","alt","shift"].includes(t)},Tb=Z.forwardRef(({className:e,variant:t,size:r,keys:n,children:o,onPress:a,isDisabled:s,preventDefault:i=true,...l},c)=>{Z.useEffect(()=>{if(!a||!n||s)return;let u=Array.isArray(n)?n:[n],p=u.filter(Is).map(ma),f=u.filter(v=>!Is(v)).map(ma),g=v=>{let b=p.includes("meta")===v.metaKey,h=p.includes("control")===v.ctrlKey,x=p.includes("alt")===v.altKey,R=p.includes("shift")===v.shiftKey,N=f.length===0||f.includes(v.key.toLowerCase());b&&h&&x&&R&&N&&(i&&v.preventDefault(),a(v));};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[n,a,s,i]);let d=()=>n?(Array.isArray(n)?n:[n]).map((p,f)=>jsxs(Z.Fragment,{children:[f>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:cM(p)})]},f)):o;return jsx("kbd",{ref:c,className:m(Mb({variant:t,size:r}),s&&"opacity-50",e),...l,children:d()})});Tb.displayName="Kbd";function dM(e,t,r={}){let{isDisabled:n=false,preventDefault:o=true}=r;Z.useEffect(()=>{if(n)return;let a=Array.isArray(e)?e:[e],s=a.filter(Is).map(ma),i=a.filter(c=>!Is(c)).map(ma),l=c=>{let d=s.includes("meta")===c.metaKey,u=s.includes("control")===c.ctrlKey,p=s.includes("alt")===c.altKey,f=s.includes("shift")===c.shiftKey,g=i.length===0||i.includes(c.key.toLowerCase());d&&u&&p&&f&&g&&(o&&c.preventDefault(),t(c));};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t,n,o]);}var Nb=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"}}),kb=Z.forwardRef(({className:e,size:t,value:r,successDuration:n=2e3,onCopySuccess:o,onCopyError:a,copyIcon:s,successIcon:i,...l},c)=>{let[d,u]=Z.useState(false),f={sm:14,md:16,lg:20}[t??"md"],g=async()=>{try{await navigator.clipboard.writeText(r),u(!0),o?.(),setTimeout(()=>{u(!1);},n);}catch(v){a?.(v);}};return jsx("button",{ref:c,type:"button",className:m(Nb({size:t}),e),onClick:g,"aria-label":d?"Copied":"Copy to clipboard",...l,children:d?i??jsx(Check,{className:"text-success",style:{width:f,height:f}}):s??jsx(Copy,{style:{width:f,height:f}})})});kb.displayName="CopyButton";var Eb=cva("flex flex-col bg-background",{variants:{variant:{default:"border",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:""},size:{sm:"text-xs",md:"text-sm",lg:"text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"default",size:"md",radius:"md"}}),hM=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"}],xM=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],yM=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function RM(e,t,r){let n=new Date(e,t,1),o=new Date(e,t+1,0),a=[],s=n.getDay()-r;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 wM(e,t){let r=[],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),r.push(i);}return r}function Ro(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function yo(e){return Ro(e,new Date)}function Sb(e,t){return e.filter(r=>{let n=new Date(r.start),o=new Date(r.end);return Ro(n,t)||Ro(o,t)||n<t&&o>t})}var Pb=Z.forwardRef(({className:e,variant:t,size:r,radius:n,events:o=[],view:a="month",onViewChange:s,viewOptions:i=hM,date:l,onDateChange:c,onEventClick:d,onSlotClick:u,weekStartsOn:p=0,locale:f="en-US",...g},v)=>{let[b,h]=Z.useState(new Date),x=l??b,R=T=>{c?c(T):h(T);},N=p===1?yM:xM,w=()=>{let T=new Date(x);a==="month"?T.setMonth(T.getMonth()-1):a==="week"?T.setDate(T.getDate()-7):T.setDate(T.getDate()-1),R(T);},y=()=>{let T=new Date(x);a==="month"?T.setMonth(T.getMonth()+1):a==="week"?T.setDate(T.getDate()+7):T.setDate(T.getDate()+1),R(T);},C=()=>{R(new Date);},E=()=>a==="day"?x.toLocaleDateString(f,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):x.toLocaleDateString(f,{year:"numeric",month:"long"}),L=()=>{let T=RM(x.getFullYear(),x.getMonth(),p);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:N.map(M=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:M},M))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:T.map((M,D)=>{let P=Sb(o,M),I=M.getMonth()===x.getMonth(),H=Ro(M,x);return jsxs("div",{className:m("min-h-[80px] border-b border-r p-1 cursor-pointer hover:bg-accent/50 transition-colors",!I&&"bg-muted/30",H&&"bg-accent"),onClick:()=>u?.(M),children:[jsx("div",{className:m("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",yo(M)&&"bg-primary text-primary-foreground",!I&&"text-muted-foreground"),children:M.getDate()}),jsxs("div",{className:"space-y-0.5",children:[P.slice(0,3).map(A=>jsx("div",{className:"text-xs px-1 py-0.5 rounded truncate cursor-pointer hover:opacity-80",style:{backgroundColor:A.color||"hsl(var(--primary))",color:"white"},onClick:B=>{B.stopPropagation(),d?.(A);},children:A.title},A.id)),P.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",P.length-3," more"]})]})]},D)})})]})},k=()=>{let T=wM(x,p),M=Array.from({length:24},(D,P)=>P);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"}),T.map((D,P)=>{let I=Ro(D,x);return jsxs("div",{className:m("p-2 text-center border-l cursor-pointer hover:bg-accent/50",yo(D)&&"bg-primary/10",I&&!yo(D)&&"bg-accent"),onClick:()=>u?.(D),children:[jsx("div",{className:"text-xs text-muted-foreground",children:N[P]}),jsx("div",{className:m("text-lg font-semibold",yo(D)&&"text-primary",I&&!yo(D)&&"text-primary"),children:D.getDate()})]},P)})]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:M.map(D=>jsxs(Z.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[D.toString().padStart(2,"0"),":00"]}),T.map((P,I)=>{let H=new Date(P);H.setHours(D,0,0,0);let A=o.filter(B=>{let $=new Date(B.start);return Ro($,P)&&$.getHours()===D});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>u?.(H),children:A.map(B=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:B.color||"hsl(var(--primary))",color:"white"},onClick:$=>{$.stopPropagation(),d?.(B);},children:B.title},B.id))},I)})]},D))})})]})},S=()=>{let T=Array.from({length:24},(D,P)=>P),M=Sb(o,x);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",yo(x)&&"bg-primary text-primary-foreground"),children:x.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:T.map(D=>{let P=new Date(x);P.setHours(D,0,0,0);let I=M.filter(H=>new Date(H.start).getHours()===D);return jsxs(Z.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[D.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>u?.(P),children:I.map(H=>jsx("div",{className:"absolute inset-x-1 top-0.5 text-xs px-2 py-1 rounded truncate cursor-pointer",style:{backgroundColor:H.color||"hsl(var(--primary))",color:"white"},onClick:A=>{A.stopPropagation(),d?.(H);},children:H.title},H.id))})]},D)})})})]})};return jsxs("div",{ref:v,className:m(Eb({variant:t,size:r,radius:n,className:e})),...g,children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsx("h2",{className:"text-lg font-semibold",children:E()}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(me,{variant:"bordered",size:"sm",radius:"md",onClick:C,children:"Today"}),jsx(In,{options:i,value:a,onValueChange:T=>s?.(T),size:"sm",radius:"md",className:"w-[120px]"}),jsx(me,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:w,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(me,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:y,children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]}),a==="month"&&L(),a==="week"&&k(),a==="day"&&S()]})});Pb.displayName="FullCalendar";var Fs=({active:e,payload:t,label:r})=>!e||!t||!t.length?null:jsxs("div",{className:"border bg-card text-card-foreground shadow-sm rounded-lg p-3 min-w-[120px]",children:[r&&jsx("p",{className:"text-sm font-medium mb-2 text-card-foreground",children:r}),jsx("div",{className:"space-y-1",children:t.map((n,o)=>jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsx("span",{className:"text-sm",style:{color:n.color},children:n.name}),jsx("span",{className:"text-sm font-medium text-card-foreground",children:typeof n.value=="number"?n.value.toLocaleString():n.value})]},o))})]}),fa=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),ga=["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%))"],Lb=Z.forwardRef(({className:e,size:t,data:r,dataKeys:n,colors:o=ga,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},u)=>jsx("div",{ref:u,className:m(fa({size:t,className:e})),...d,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(LineChart,{data:r,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(Fs,{})}),s&&jsx(Legend,{}),n.map((p,f)=>jsx(Line,{type:c,dataKey:p,stroke:o[f%o.length],strokeWidth:2,dot:{fill:o[f%o.length],strokeWidth:0},activeDot:{r:6}},p))]})})}));Lb.displayName="LineChart";var Db=Z.forwardRef(({className:e,size:t,data:r,dataKeys:n,colors:o=ga,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,layout:d="horizontal",...u},p)=>jsx("div",{ref:p,className:m(fa({size:t,className:e})),...u,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(BarChart,{data:r,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(Fs,{})}),s&&jsx(Legend,{}),n.map((f,g)=>jsx(Bar,{dataKey:f,fill:o[g%o.length],stackId:c?"stack":void 0,radius:[4,4,0,0]},f))]})})}));Db.displayName="BarChart";var Hb=Z.forwardRef(({className:e,size:t,data:r,dataKey:n="value",nameKey:o="name",colors:a=ga,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...u},p)=>jsx("div",{ref:p,className:m(fa({size:t,className:e})),...u,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{content:jsx(Fs,{})}),l&&jsx(Legend,{}),jsx(Pie,{data:r,dataKey:n,nameKey:o,cx:"50%",cy:"50%",innerRadius:s,outerRadius:i,label:d,labelLine:d,children:r.map((f,g)=>jsx(Cell,{fill:a[g%a.length]},`cell-${g}`))})]})})}));Hb.displayName="PieChart";var Ib=Z.forwardRef(({className:e,size:t,data:r,dataKeys:n,colors:o=ga,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,curveType:d="monotone",...u},p)=>jsx("div",{ref:p,className:m(fa({size:t,className:e})),...u,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(AreaChart,{data:r,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(Fs,{})}),s&&jsx(Legend,{}),n.map((f,g)=>jsx(Area,{type:d,dataKey:f,stroke:o[g%o.length],fill:o[g%o.length],fillOpacity:.3,stackId:c?"stack":void 0},f))]})})}));Ib.displayName="AreaChart";var Dl={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"};function _M({card:e,columnId:t,radius:r,renderCard:n,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("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-sm hover:shadow-md",d&&"opacity-50 scale-[1.02] shadow-lg",Dl[r]),onClick:()=>o?.(e,t),...a,...s,children:n?n(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 Ab({column:e,radius:t,renderCard:r,onCardClick:n,onAddCard:o,showAddCard:a,addCardLabel:s,columnHeight:i}){return jsxs("div",{className:m("flex flex-col min-w-[280px] w-[280px]",Dl[t]),style:{backgroundColor:e.backgroundColor||"transparent"},children:[jsx("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})]})}),jsx(ze,{style:{height:i},className:"flex-1",children:jsxs("div",{className:"p-2 space-y-2",children:[jsx(SortableContext,{items:e.cards.map(l=>l.id),strategy:verticalListSortingStrategy,children:e.cards.map(l=>jsx(_M,{card:l,columnId:e.id,radius:t,renderCard:r,onCardClick:n},l.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"})]})}),a&&jsx("div",{className:"p-2 border-t",children:jsxs(me,{variant:"light",size:"sm",className:"w-full justify-start",onClick:l=>{l.stopPropagation(),l.preventDefault(),o?.(e.id);},children:[jsx(Plus,{className:"h-4 w-4 mr-2"}),s]})})]})}var Ob=Z.forwardRef(({className:e,columns:t,onCardMove:r,onCardClick:n,onAddCard:o,renderCard:a,showAddCard:s=true,addCardLabel:i="Add card",columnHeight:l=500,radius:c="md",...d},u)=>{let[p,f]=Z.useState(false),[g,v]=Z.useState(null),[b,h]=Z.useState(null);Z.useEffect(()=>{f(true);},[]);let x=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates}));if(!p)return jsx("div",{ref:u,className:m("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(C=>jsx(Ab,{column:C,radius:c,renderCard:a,onCardClick:n,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},C.id))});let R=C=>t.find(E=>E.cards.some(L=>L.id===C));return jsxs(DndContext,{sensors:x,collisionDetection:closestCorners,onDragStart:C=>{let{active:E}=C,L=R(E.id);if(L){let k=L.cards.find(S=>S.id===E.id);k&&(v(k),h(L.id));}},onDragOver:C=>{let{active:E,over:L}=C;if(!L)return;let k=E.id,S=L.id,T=R(k),M=R(S)||t.find(I=>I.id===S);if(!T||!M||T.id===M.id)return;let D=M.cards.findIndex(I=>I.id===S),P=D===-1?M.cards.length:D;r?.(k,T.id,M.id,P);},onDragEnd:C=>{let{active:E,over:L}=C;if(L&&E.id!==L.id){let k=R(E.id),S=R(L.id)||t.find(T=>T.id===L.id);if(k&&S){let T=S.cards.findIndex(D=>D.id===L.id),M=T===-1?S.cards.length:T;r?.(E.id,k.id,S.id,M);}}v(null),h(null);},children:[jsx("div",{ref:u,className:m("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(C=>jsx(Ab,{column:C,radius:c,renderCard:a,onCardClick:n,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},C.id))}),jsx(DragOverlay,{children:g&&b&&jsx("div",{className:m("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-lg opacity-50 scale-[1.02]",Dl[c]),children:a?a(g,b):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:g.title}),g.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:g.description})]})]})})})]})});Ob.displayName="KanbanBoard";var Fb=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),Bb=Z.createContext(null);function $s(){let e=Z.useContext(Bb);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var $b=Z.forwardRef(({className:e,variant:t,children:r,opts:n,plugins:o,orientation:a="horizontal",showArrows:s=true,showDots:i=true,setApi:l,...c},d)=>{let[u,p]=jM({...n,axis:a==="horizontal"?"x":"y"},o),[f,g]=Z.useState(false),[v,b]=Z.useState(false),[h,x]=Z.useState(0),[R,N]=Z.useState([]),w=Z.useCallback(k=>{k&&(x(k.selectedScrollSnap()),g(k.canScrollPrev()),b(k.canScrollNext()));},[]),y=Z.useCallback(()=>{p?.scrollPrev();},[p]),C=Z.useCallback(()=>{p?.scrollNext();},[p]),E=Z.useCallback(k=>{p?.scrollTo(k);},[p]),L=Z.useCallback(k=>{k.key==="ArrowLeft"?(k.preventDefault(),y()):k.key==="ArrowRight"&&(k.preventDefault(),C());},[y,C]);return Z.useEffect(()=>{!p||!l||l(p);},[p,l]),Z.useEffect(()=>{if(p)return N(p.scrollSnapList()),w(p),p.on("reInit",w),p.on("select",w),()=>{p?.off("select",w);}},[p,w]),jsx(Bb.Provider,{value:{carouselRef:u,api:p,scrollPrev:y,scrollNext:C,canScrollPrev:f,canScrollNext:v,selectedIndex:h,scrollSnaps:R,scrollTo:E,orientation:a},children:jsxs("div",{ref:d,className:m(Fb({variant:t,className:e})),onKeyDownCapture:L,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:r})}),s&&jsxs(Fragment,{children:[jsx(Hl,{}),jsx(Il,{})]}),i&&R.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:R.map((k,S)=>jsx("button",{className:m("w-2 h-2 rounded-full transition-all",S===h?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>E(S),"aria-label":`Go to slide ${S+1}`},S))})]})})});$b.displayName="Carousel";var Kb=Z.forwardRef(({className:e,...t},r)=>jsx("div",{ref:r,className:m("flex",e),...t}));Kb.displayName="CarouselContent";var Gb=Z.forwardRef(({className:e,basis:t="basis-full",...r},n)=>{let{orientation:o}=$s();return jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:m("min-w-0 shrink-0 grow-0",o==="horizontal"?"pl-4":"pt-4",t,e),...r})});Gb.displayName="CarouselItem";var Hl=Z.forwardRef(({className:e,variant:t="bordered",size:r="sm",isIconOnly:n=true,...o},a)=>{let{scrollPrev:s,canScrollPrev:i}=$s();return jsxs(me,{ref:a,variant:t,size:r,isIconOnly:n,className:m("absolute left-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),isDisabled:!i,onClick:s,...o,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Previous slide"})]})});Hl.displayName="CarouselPrevious";var Il=Z.forwardRef(({className:e,variant:t="bordered",size:r="sm",isIconOnly:n=true,...o},a)=>{let{scrollNext:s,canScrollNext:i}=$s();return jsxs(me,{ref:a,variant:t,size:r,isIconOnly:n,className:m("absolute right-2 top-1/2 -translate-y-1/2 h-8 w-8 rounded-full",e),isDisabled:!i,onClick:s,...o,children:[jsx(ChevronRight,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Next slide"})]})});Il.displayName="CarouselNext";var Ub=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"}}),Ks={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"}},Al={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}"]},_b=Z.forwardRef(({className:e,size:t,onEmojiSelect:r,recentEmojis:n=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=Z.useState(n.length>0?"recent":o),[u,p]=Z.useState(""),g=u?Object.values(Al).flat().filter(b=>b.toLowerCase().includes(u.toLowerCase())):c==="recent"?n:Al[c]||[],v=b=>{r?.(b);};return jsxs("div",{ref:l,className:m(Ub({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(Qr,{placeholder:"Search emojis...",value:u,onChange:b=>p(b.target.value),className:"pl-8 h-8"})]})}),s&&!u&&jsx(ze,{orientation:"horizontal",className:"border-b",children:jsx("div",{className:"flex px-1",children:Object.entries(Ks).map(([b,{icon:h}])=>b==="recent"&&n.length===0?null:jsx("button",{className:m("shrink-0 p-2 text-lg hover:bg-accent rounded transition-colors",c===b&&"bg-accent"),onClick:()=>d(b),title:Ks[b].name,children:h},b))})}),!u&&jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-muted-foreground",children:Ks[c].name}),jsx(ze,{className:"flex-1",children:jsxs("div",{className:"grid grid-cols-8 gap-1 p-2",children:[g.map((b,h)=>jsx("button",{className:"w-8 h-8 flex items-center justify-center text-xl hover:bg-accent rounded transition-colors",onClick:()=>v(b),children:b},`${b}-${h}`)),g.length===0&&jsx("div",{className:"col-span-8 py-8 text-center text-muted-foreground text-sm",children:"No emojis found"})]})})]})});_b.displayName="EmojiPicker";var Wb=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:"border-none bg-transparent"}},defaultVariants:{variant:"default"}});function sT(e,t,r){return centerCrop(makeAspectCrop({unit:"%",width:90},r,e,t),e,t)}async function jb(e,t,r=0,n=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=r*Math.PI/180,p=e.naturalWidth/2,f=e.naturalHeight/2;return a.save(),a.translate(-c,-d),a.translate(p,f),a.rotate(u),a.scale(n,n),a.translate(-p,-f),a.drawImage(e,0,0,e.naturalWidth,e.naturalHeight,0,0,e.naturalWidth,e.naturalHeight),a.restore(),new Promise(g=>{o.toBlob(v=>{g(v);},"image/png");})}var Yb=Z.forwardRef(({className:e,variant:t,src:r,aspectRatio:n,onCropChange:o,onCropComplete:a,showZoom:s=true,showRotation:i=true,minZoom:l=1,maxZoom:c=3,circularCrop:d=false,initialCrop:u,...p},f)=>{let g=Z.useRef(null),[v,b]=Z.useState(),[h,x]=Z.useState(),[R,N]=Z.useState(1),[w,y]=Z.useState(0),C=S=>{let{width:T,height:M}=S.currentTarget;if(n){let D=sT(T,M,n);b(D);}else b(u||{unit:"%",x:10,y:10,width:80,height:80});},E=S=>{b(S),o?.(S);},L=async S=>{if(x(S),a&&g.current&&S.width&&S.height){let T=await jb(g.current,S,w,R);a(T);}},k=()=>{y(S=>(S+90)%360);};return Z.useEffect(()=>{h&&g.current&&a&&jb(g.current,h,w,R).then(S=>{a(S);});},[R,w,h,a]),jsxs("div",{ref:f,className:m(Wb({variant:t,className:e})),...p,children:[jsx("div",{className:"flex-1 flex items-center justify-center p-4 bg-muted/30 min-h-[300px]",children:jsx(QM,{crop:v,onChange:E,onComplete:L,aspect:n,circularCrop:d,className:"max-h-[400px]",children:jsx("img",{ref:g,src:r,alt:"Crop preview",crossOrigin:"anonymous",onLoad:C,style:{transform:`scale(${R}) rotate(${w}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(er,{value:[R],onValueChange:([S])=>N(S),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(me,{variant:"bordered",size:"sm",isIconOnly:true,onClick:k,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});Yb.displayName="ImageCropper";var Ol=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"}}),cT={sm:96,md:128,lg:192},qb=Z.forwardRef(({className:e,variant:t,size:r,value:n,qrSize:o,fgColor:a="currentColor",bgColor:s="transparent",level:i="M",includeMargin:l=false,title:c,logo:d,logoSize:u=40,logoPadding:p=4,logoBackgroundColor:f="white",...g},v)=>{let b=Z.useRef(null),h=o??cT[r??"md"];return Z.useImperativeHandle(v,()=>({download:(x="qrcode.png")=>{let R=b.current?.querySelector("svg");if(!R)return;let N=new XMLSerializer().serializeToString(R),w=document.createElement("canvas"),y=w.getContext("2d"),C=new Image,E=l?32:0;w.width=h+E,w.height=h+E,C.onload=()=>{if(!y)return;y.fillStyle=s==="transparent"?"#ffffff":s,y.fillRect(0,0,w.width,w.height),y.drawImage(C,0,0);let L=document.createElement("a");L.download=x.endsWith(".png")?x:`${x}.png`,L.href=w.toDataURL("image/png"),L.click();},C.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(N)));}})),n?jsx("div",{ref:b,className:m(Ol({variant:t,size:r,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(iT,{value:n,size:h,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:p,backgroundColor:f},children:jsx("img",{src:d,alt:"Logo",style:{width:u,height:u,objectFit:"contain"}})})]})}):jsx("div",{ref:b,className:m(Ol({variant:t,size:r,className:e})),...g,children:jsx("div",{className:"flex items-center justify-center bg-muted text-muted-foreground text-xs rounded",style:{width:h,height:h},children:"No data"})})});qb.displayName="QRCode";var Gs=({children:e,defaultTheme:t="system",storageKey:r="reever-ui-theme",enableSystem:n=true,disableTransitionOnChange:o=false,attribute:a="class",forcedTheme:s,themes:i=["light","dark"]})=>jsx(ThemeProvider,{defaultTheme:t,storageKey:r,enableSystem:n,disableTransitionOnChange:o,attribute:a,forcedTheme:s,themes:i,children:e});Gs.displayName="ThemeProvider";var bT=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),Xb=Z.forwardRef(({className:e,variant:t="ghost",size:r="md",mode:n="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=Z.useState(false);Z.useEffect(()=>{c(true);},[]);let d=()=>{let u=["light","dark","system"],f=(u.indexOf(a||"system")+1)%u.length;s(u[f]);};return l?n==="cycle"?jsxs(me,{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(Zt,{children:[jsx(Jt,{children:jsxs(me,{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(Qt,{align:"end",children:[jsxs(Et,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs(Et,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs(Et,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(me,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,isDisabled:true,children:[jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})});Xb.displayName="ThemeToggle";var vT={disableAnimation:false,defaultRadius:"md",defaultColor:"default",locale:"en-US",navigate:void 0},Bl=Z.createContext(vT),hT=()=>Z.useContext(Bl),Jb=({children:e,disableAnimation:t=false,defaultRadius:r="md",defaultColor:n="default",locale:o="en-US",navigate:a,defaultTheme:s="system",storageKey:i="reever-ui-theme",enableSystem:l=true,disableTransitionOnChange:c=false,attribute:d="class",forcedTheme:u,themes:p=["light","dark"]})=>{let f=Z.useMemo(()=>({disableAnimation:t,defaultRadius:r,defaultColor:n,locale:o,navigate:a}),[t,r,n,o,a]);return jsx(Bl.Provider,{value:f,children:jsx(Gs,{defaultTheme:s,storageKey:i,enableSystem:l,disableTransitionOnChange:c||t,attribute:d,forcedTheme:u,themes:p,children:e})})};Jb.displayName="ReeverUIProvider";var ev=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),yT=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-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 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}}),RT=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"}}),wT=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"}}),Ys={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},Kl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},$l=(e,t)=>String(e).padStart(t,"0"),_s=(e,t)=>{if(!e)return "";let r=$l(e.getDate(),2),n=$l(e.getMonth()+1,2),o=$l(e.getFullYear(),4),a=Ys[t],s=Kl[t],i={day:r,month:n,year:o};return s.map(l=>i[l]).join(a)},Qb=(e,t)=>{let r=Ys[t],n=e.split(r);if(n.length!==3)return null;let o=Kl[t],a={};if(o.forEach((i,l)=>{a[i]=parseInt(n[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},CT=e=>{let t=Ys[e];return Kl[e].map(n=>n==="year"?"####":"##").join(t)},tv=Z.forwardRef(({className:e,label:t,description:r,errorMessage:n,isRequired:o,isInvalid:a,size:s,labelClassName:i,inputClassName:l,descriptionClassName:c,errorClassName:d,value:u,defaultValue:p,onChange:f,minDate:g,maxDate:v,dateFormat:b="dd.MM.yyyy",showPickerIcon:h=true,mode:x="text",fullWidth:R=false,isDisabled:N,placeholder:w,id:y,...C},E)=>{let L=Z.useId(),k=y||L,S=`${k}-description`,T=`${k}-error`,[M,D]=Z.useState(p??null),[P,I]=Z.useState(""),[H,A]=Z.useState(false),[B,$]=Z.useState(false),j=u!==void 0?u:M,G=a&&n,U=Ys[b],W=CT(b);Z.useEffect(()=>{B||I(_s(j,b));},[j,b,B]);let V=be=>{u===void 0&&D(be),f?.(be);},z=be=>{let _=be??null;V(_),I(_s(_,b)),A(false);},K=be=>{let _=be.target.value;_=_.replace(new RegExp(`[^0-9\\${U}]`,"g"),"");let O=_.replace(new RegExp(`\\${U}`,"g"),""),F="",q=0;for(let X=0;X<W.length&&q<O.length;X++)W[X]==="#"?(F+=O[q],q++):F+=W[X];if(I(F),F.length===W.length){let X=Qb(F,b);if(X){if(g&&X<g||v&&X>v)return;V(X);}}},Y=()=>{$(true);},Q=()=>{$(false),P.length!==W.length?I(_s(j,b)):Qb(P,b)||I(_s(j,b));},J=()=>{N||A(true);},Ne=()=>{!N&&x==="picker"&&h&&A(true);};return jsxs("div",{className:m(ev({size:s}),e),children:[t&&jsxs("label",{htmlFor:k,className:m(wT({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(Pt,{open:h&&H,onOpenChange:A,children:[jsxs(tn,{className:m("relative",R?"w-full":"w-fit"),children:[jsx("input",{ref:E,id:k,type:"text",inputMode:x==="text"?"numeric":void 0,value:P,onChange:x==="text"?K:void 0,onClick:Ne,onFocus:Y,onBlur:Q,readOnly:x==="picker","aria-invalid":a,"aria-describedby":G?T:r?S:void 0,"aria-required":o,disabled:N,placeholder:w||b.toLowerCase(),className:m(yT({size:s,isInvalid:a,fullWidth:R,showPickerIcon:h}),x==="picker"&&h&&"cursor-pointer",l),style:{borderColor:B||h&&H?"var(--color-foreground)":void 0},...C}),h&&jsx("button",{type:"button",onClick:J,disabled:N,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(RT({size:s}))})})]}),h&&jsx(Lt,{className:"w-auto p-0",align:"start",children:jsx(lo,{mode:"single",selected:j??void 0,onSelect:z,disabled:be=>!!(g&&be<g||v&&be>v),defaultMonth:j??void 0,showMonthAndYearPickers:true,size:s??"md"})})]}),r&&!G&&jsx("p",{id:S,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:r}),G&&jsx("p",{id:T,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:n})]})});tv.displayName="DatePicker";var nv=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"}}),ov=Z.forwardRef(({className:e,variant:t,orientation:r,size:n,density:o,items:a,maxVisibleItems:s,isDisabled:i,onAction:l,showLabels:c=false,renderItem:d,...u},p)=>{let f=s&&s<a.length?a.slice(0,s):a,g=s&&s<a.length?a.slice(s):[],v={sm:"h-8 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-4 text-base"}[n??"md"],b={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[n??"md"],h={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"}[n??"md"],x=(N,w)=>{w&&w(),l&&l(N);},R=N=>jsxs("button",{type:"button",disabled:i||N.isDisabled,onClick:()=>x(N.key,N.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?v:b),"aria-label":N.label,children:[N.icon&&jsx("span",{className:h,children:N.icon}),c&&jsx("span",{children:N.label})]},N.key);return jsxs("div",{ref:p,role:"group",className:m(nv({variant:t,orientation:r,size:n,density:o,className:e})),...u,children:[f.map(N=>d?d(N):R(N)),g.length>0&&jsxs(Zt,{children:[jsx(Jt,{"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",b),children:jsx(MoreHorizontal,{className:h})}),jsx(Qt,{align:"end",children:g.map(N=>jsxs(Et,{isDisabled:N.isDisabled,onClick:()=>x(N.key,N.onPress),children:[N.icon&&jsx("span",{className:m(h,"mr-2"),children:N.icon}),N.label]},N.key))})]})]})});ov.displayName="ActionGroup";var av=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"}}),sv=Z.forwardRef(({className:e,position:t,size:r,selectedCount:n=0,isOpen:o=true,onClose:a,showClose:s=true,selectedText:i,children:l,...c},d)=>{if(!o||n===0)return null;let u=()=>typeof i=="function"?i(n):i||`${n} item${n>1?"s":""} selected`;return jsxs("div",{ref:d,role:"toolbar","aria-label":"Actions for selected items",className:m(av({position:t,size:r,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(Ct,{size:"sm",onClick:a,"aria-label":"Close action bar"})]})]})});sv.displayName="ActionBar";var iv=Z.forwardRef(({className:e,icon:t,children:r,...n},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),...n,children:[t&&jsx("span",{className:"h-4 w-4 [&>svg]:h-full [&>svg]:w-full",children:t}),r]}));iv.displayName="ActionBarButton";var lv=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"}}),ST=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"}}),ET=cva("block rounded-full border-2 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"},color:{primary:"border-primary",success:"border-green-500",warning:"border-yellow-500",danger:"border-red-500",custom:""}},defaultVariants:{size:"md",color:"primary"}}),cv=Z.forwardRef(({className:e,orientation:t="horizontal",size:r="md",value:n,defaultValue:o=[25,75],onValueChange:a,onValueCommit:s,min:i=0,max:l=100,step:c=1,isDisabled:d=false,showLabels:u=false,formatLabel:p=h=>String(h),trackColor:f="primary",name:g,...v},b)=>{let[h,x]=Z.useState(o),R=n!==void 0,N=R?n:h,w=Z.useRef(null),[y,C]=Z.useState(false),[E,L]=Z.useState(null),k=(V,z)=>{if(!w.current)return N[0];let K=w.current.getBoundingClientRect(),Y;t==="horizontal"?Y=(V-K.left)/K.width:Y=1-(z-K.top)/K.height,Y=Math.max(0,Math.min(1,Y));let Q=i+Y*(l-i),J=Math.round(Q/c)*c;return Math.max(i,Math.min(l,J))},S=(V,z)=>{let K=[...N];K[z]=V,z===0&&V>N[1]&&(K[0]=N[1]),z===1&&V<N[0]&&(K[1]=N[0]),R||x(K),a?.(K);},T=(V,z)=>{d||(V.preventDefault(),C(true),L(z),V.target.setPointerCapture(V.pointerId));},M=V=>{if(!y||E===null||d)return;let z=k(V.clientX,V.clientY);S(z,E);},D=()=>{y&&(C(false),L(null),s?.(N));},P=V=>{if(d)return;let z=k(V.clientX,V.clientY),K=Math.abs(N[0]-z),Y=Math.abs(N[1]-z),Q=K<=Y?0:1;S(z,Q);let J=[...N];J[Q]=z,s?.(J);},I=(V,z)=>{if(d)return;let K=N[z];switch(V.key){case "ArrowRight":case "ArrowUp":V.preventDefault(),K=Math.min(l,N[z]+c);break;case "ArrowLeft":case "ArrowDown":V.preventDefault(),K=Math.max(i,N[z]-c);break;case "Home":V.preventDefault(),K=i;break;case "End":V.preventDefault(),K=l;break;default:return}S(K,z);let Y=[...N];Y[z]=K,s?.(Y);},H=V=>(V-i)/(l-i)*100,A={primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"},B=!(f in A),$=B?"":A[f],j=B?{backgroundColor:f}:void 0,G=B?{borderColor:f}:void 0,U=B?"custom":f,W={sm:14,md:20,lg:24}[r||"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:p(N[0])}),jsx("span",{children:p(N[1])})]}),jsxs("div",{ref:b,className:m(lv({orientation:t,size:r}),d&&"opacity-50 pointer-events-none",e),...v,children:[jsx("div",{ref:w,className:m(ST({orientation:t,size:r})),onClick:P,children:jsx("div",{className:m("absolute rounded-full",$,{"h-full":t==="horizontal","w-full":t==="vertical"}),style:t==="horizontal"?{left:`${H(N[0])}%`,right:`${100-H(N[1])}%`,top:0,bottom:0,...j}:{bottom:`${H(N[0])}%`,top:`${100-H(N[1])}%`,left:0,right:0,...j}})}),N.map((V,z)=>jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":V,"aria-orientation":t||void 0,"aria-disabled":d,className:m(ET({size:r,color:U}),y&&E===z&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${H(V)}% - ${W/2}px)`,top:"50%",transform:"translateY(-50%)",...G}:{position:"absolute",bottom:`calc(${H(V)}% - ${W/2}px)`,left:"50%",transform:"translateX(-50%)",...G},onPointerDown:K=>T(K,z),onPointerMove:M,onPointerUp:D,onPointerCancel:D,onKeyDown:K=>I(K,z)},z)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:N[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:N[1]})]})]})]})});cv.displayName="RangeSlider";var Wl=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"}}),IT=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"}}),VT={help:HelpCircle,info:Info,warning:AlertCircle},mv=Z.forwardRef(({variant:e="help",size:t,title:r,children:n,trigger:o,side:a="top",align:s="center",open:i,onOpenChange:l,learnMoreUrl:c,learnMoreText:d="Learn more",triggerClassName:u,contentClassName:p},f)=>{let[g,v]=Z.useState(false),[b,h]=Z.useState(false),[x,R]=Z.useState({top:0,left:0}),N=Z.useRef(null),w=Z.useRef(null),y=i!==void 0?i:g,C=Z.useCallback(S=>{i===void 0&&v(S),l?.(S);},[i,l]);Z.useEffect(()=>{h(true);},[]),Z.useEffect(()=>{if(!y||!N.current)return;let S=()=>{let T=N.current.getBoundingClientRect(),M=w.current?.getBoundingClientRect(),D=M?.width||288,P=M?.height||100,I=8,H=0,A=0;switch(a){case "top":H=T.top-P-I,A=T.left+T.width/2-D/2;break;case "bottom":H=T.bottom+I,A=T.left+T.width/2-D/2;break;case "left":H=T.top+T.height/2-P/2,A=T.left-D-I;break;case "right":H=T.top+T.height/2-P/2,A=T.right+I;break}if(a==="top"||a==="bottom")switch(s){case "start":A=T.left;break;case "center":A=T.left+T.width/2-D/2;break;case "end":A=T.right-D;break}if(a==="left"||a==="right")switch(s){case "start":H=T.top;break;case "center":H=T.top+T.height/2-P/2;break;case "end":H=T.bottom-P;break}A=Math.max(8,Math.min(A,window.innerWidth-D-8)),H=Math.max(8,Math.min(H,window.innerHeight-P-8)),R({top:H,left:A});};return S(),requestAnimationFrame(S),window.addEventListener("resize",S),window.addEventListener("scroll",S,true),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",S,true);}},[y,a,s]),Z.useEffect(()=>{if(!y)return;let S=T=>{w.current&&!w.current.contains(T.target)&&N.current&&!N.current.contains(T.target)&&C(false);};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[y,C]),Z.useEffect(()=>{if(!y)return;let S=T=>{T.key==="Escape"&&C(false);};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[y,C]);let E=VT[e??"help"],L=()=>{C(!y);},k=()=>{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?Z.isValidElement(o)?Z.cloneElement(o,{ref:N,onClick:S=>{o.props.onClick?.(S),L();}}):jsx("button",{ref:N,type:"button",onClick:L,className:m(Wl({variant:e,size:t}),u),"aria-label":"Help",children:o}):jsx("button",{ref:S=>{N.current=S,typeof f=="function"?f(S):f&&(f.current=S);},type:"button",onClick:L,className:m(Wl({variant:e,size:t}),u),"aria-label":"Help",children:jsx(E,{className:"h-full w-full"})}),b&&y&&Ua.createPortal(jsxs("div",{ref:w,className:m(IT({size:t}),p),style:{position:"fixed",top:x.top,left:x.left,transformOrigin:k()},role:"tooltip",children:[r&&jsx("div",{className:"mb-2 font-semibold text-foreground",children:r}),jsx("div",{className:"text-muted-foreground",children:n}),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)]})});mv.displayName="ContextualHelp";var gv=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"}}),bv=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 vv({className:e,columns:t,gap:r,items:n,selectedKeys:o,selectionMode:a="none",onSelectionChange:s,showSelectionIndicator:i=true,itemVariant:l="default",itemSize:c="md",renderItem:d,emptyContent:u,...p}){let[f,g]=Z.useState(new Set),v=Z.useMemo(()=>o?o instanceof Set?o:new Set(o):f,[o,f]),b=h=>{if(a==="none")return;let x;a==="single"?x=v.has(h)?new Set:new Set([h]):(x=new Set(v),x.has(h)?x.delete(h):x.add(h)),o||g(x),s?.(x);};return n.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(gv({columns:t,gap:r,className:e})),...p,children:n.map(h=>{let x=v.has(h.key);return d?jsx("div",{role:"gridcell","aria-selected":x,onClick:()=>b(h.key),children:d(h,x)},h.key):jsxs("div",{role:"gridcell","aria-selected":x,"aria-disabled":h.isDisabled,onClick:()=>!h.isDisabled&&b(h.key),className:m(bv({variant:l,size:c,isSelected:x,isDisabled:h.isDisabled})),children:[i&&a!=="none"&&x&&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"})}),h.thumbnail&&jsx("div",{className:"mb-2 aspect-square w-full overflow-hidden rounded-md bg-muted",children:h.thumbnail}),jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate font-medium",children:h.label}),h.description&&jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:h.description})]})]},h.key)})})}vv.displayName="GridList";var hv=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"}}),Yl=(e,t,r)=>{let n=o=>{let a=(o+e/60)%6;return r-r*t*Math.max(Math.min(a,4-a,1),0)};return [Math.round(n(5)*255),Math.round(n(3)*255),Math.round(n(1)*255)]},FT=(e,t,r)=>{e/=255,t/=255,r/=255;let n=Math.max(e,t,r),o=Math.min(e,t,r),a=n-o,s=0,i=n===0?0:a/n,l=n;if(a!==0)switch(n){case e:s=((t-r)/a+(t<r?6:0))*60;break;case t:s=((r-e)/a+2)*60;break;case r:s=((e-t)/a+4)*60;break}return [s,i,l]},BT=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},$T=(e,t,r)=>"#"+[e,t,r].map(n=>n.toString(16).padStart(2,"0")).join(""),xv=Z.forwardRef(({hue:e,saturation:t,brightness:r,value:n,defaultValue:o="#ff0000",onChange:a,onColorChange:s,size:i,disabled:l,thumbSize:c=18,className:d,...u},p)=>{let f=Z.useRef(null),[g,v]=Z.useState(false),b=Z.useCallback($=>{let j=BT($);return j?FT(...j):[0,1,1]},[]),[h,x]=Z.useState(()=>b(n||o)),R=e??h[0],N=t??h[1],w=r??h[2];Z.useEffect(()=>{if(n){let $=b(n);x($);}},[n,b]);let y=Z.useCallback(($,j)=>{if(l||!f.current)return;let G=f.current.getBoundingClientRect(),U=Math.max(0,Math.min(1,($-G.left)/G.width)),W=Math.max(0,Math.min(1,(j-G.top)/G.height)),V=U,z=1-W;t===void 0&&r===void 0&&x([R,V,z]),a?.({hue:R,saturation:V,brightness:z});let K=Yl(R,V,z);s?.($T(...K));},[l,R,t,r,a,s]),C=$=>{l||($.preventDefault(),v(true),$.target.setPointerCapture($.pointerId),y($.clientX,$.clientY));},E=$=>{g&&y($.clientX,$.clientY);},L=$=>{v(false),$.target.releasePointerCapture($.pointerId);},[k,S,T]=Yl(R,1,1),M=`rgb(${k}, ${S}, ${T})`,D=N*100,P=(1-w)*100,[I,H,A]=Yl(R,N,w),B=`rgb(${I}, ${H}, ${A})`;return jsx("div",{ref:p,className:m(hv({size:i}),l&&"cursor-not-allowed opacity-50",d),...u,children:jsxs("div",{ref:f,className:"absolute inset-0",style:{backgroundColor:M},onPointerDown:C,onPointerMove:E,onPointerUp:L,onPointerLeave:L,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(${D}% - ${c/2}px)`,top:`calc(${P}% - ${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)"}})]})})});xv.displayName="ColorArea";var Rv=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"}}),UT=`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")`,yv="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",wv=Z.forwardRef(({value:e,defaultValue:t,onChange:r,channel:n="hue",baseColor:o="#ff0000",orientation:a,size:s,disabled:i,thumbSize:l=18,showBorder:c=true,className:d,...u},p)=>{let f=Z.useRef(null),[g,v]=Z.useState(false),b=()=>{switch(n){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[h,x]=Z.useState(t??b()),R=e??h,N=n==="hue"?R/360:R,w=Z.useCallback((M,D)=>{if(i||!f.current)return;let P=f.current.getBoundingClientRect(),I=a!=="vertical",H;I?H=Math.max(0,Math.min(1,(M-P.left)/P.width)):H=Math.max(0,Math.min(1,1-(D-P.top)/P.height));let A=n==="hue"?H*360:H;e===void 0&&x(A),r?.(A);},[i,a,n,e,r]),y=M=>{i||(M.preventDefault(),v(true),M.target.setPointerCapture(M.pointerId),w(M.clientX,M.clientY));},C=M=>{g&&w(M.clientX,M.clientY);},E=M=>{v(false),M.target.releasePointerCapture(M.pointerId);},L=()=>{let M=a!=="vertical",D=M?"to right":"to top";switch(n){case "hue":return M?yv:"linear-gradient(to top, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)";case "alpha":return `linear-gradient(${D}, transparent, ${o})`;case "saturation":return `linear-gradient(${D}, #808080, ${o})`;case "brightness":return `linear-gradient(${D}, #000000, ${o})`;default:return yv}},k=()=>n==="hue"?`hsl(${R}, 100%, 50%)`:o,S=a!=="vertical",T=N*100;return jsx("div",{ref:p,className:m(Rv({orientation:a,size:s}),i&&"cursor-not-allowed opacity-50",d),...u,children:jsxs("div",{ref:f,className:m("absolute inset-0 rounded-full overflow-hidden",c&&"border border-input"),style:{backgroundImage:n==="alpha"?UT:void 0,backgroundSize:n==="alpha"?"8px 8px":void 0},onPointerDown:y,onPointerMove:C,onPointerUp:E,onPointerLeave:E,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:L()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...S?{left:`calc(${T}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${T}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:k(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});wv.displayName="ColorSlider";var Cv=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"}}),WT=(e,t,r)=>{let n=e-r,o=t-r,a=Math.atan2(o,n)*180/Math.PI+90;return a<0&&(a+=360),a},Mv=Z.forwardRef(({value:e,defaultValue:t=0,onChange:r,size:n,disabled:o,innerRadius:a=.6,thumbSize:s=20,showCenter:i=true,className:l,...c},d)=>{let u=Z.useRef(null),[p,f]=Z.useState(false),[g,v]=Z.useState(t),b=e??g,h=Z.useCallback((y,C)=>{if(o||!u.current)return;let E=u.current.getBoundingClientRect(),L=E.width/2,k=y-E.left,S=C-E.top,T=WT(k,S,L);e===void 0&&v(T),r?.(T);},[o,e,r]),x=y=>{o||(y.preventDefault(),f(true),y.target.setPointerCapture(y.pointerId),h(y.clientX,y.clientY));},R=y=>{p&&h(y.clientX,y.clientY);},N=y=>{f(false),y.target.releasePointerCapture(y.pointerId);},w=()=>{let y=[];for(let C=0;C<=360;C+=30)y.push(`hsl(${C}, 100%, 50%) ${C}deg`);return `conic-gradient(from 270deg, ${y.join(", ")})`};return jsx("div",{ref:d,className:m(Cv({size:n}),o&&"cursor-not-allowed opacity-50",l),...c,children:jsxs("div",{ref:u,className:"absolute inset-0 rounded-full",style:{background:w()},onPointerDown:x,onPointerMove:R,onPointerUp:N,onPointerLeave:N,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(YT,{hue:b,innerRadius:a,thumbSize:s})]})})});Mv.displayName="ColorWheel";var YT=({hue:e,innerRadius:t,thumbSize:r})=>{let n=(1-(1-t)/2)*50,o=(e-90)*Math.PI/180,a=50+n*Math.cos(o),s=50+n*Math.sin(o);return jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:r,height:r,left:`calc(${a}% - ${r/2}px)`,top:`calc(${s}% - ${r/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 Tv={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"})},Sv=Z.forwardRef(({open:e,onOpenChange:t,items:r=[],recentItems:n=[],placeholder:o="Search...",isLoading:a,emptyMessage:s="No results found.",filter:i,shortcut:l="\u2318K",onSelect:c,footer:d},u)=>{let[p,f]=Z.useState(""),g=Z.useRef(null),[v,b]=Z.useState(false);Z.useEffect(()=>{b(true);},[]),Z.useEffect(()=>{e||f("");},[e]),Z.useEffect(()=>{if(!e)return;let y=C=>{C.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,t]),Z.useEffect(()=>{if(e)return lr(),()=>cr()},[e]);let h=Z.useMemo(()=>{let y={};return r.forEach(C=>{let E=C.category||"Results";y[E]||(y[E]=[]),y[E].push(C);}),y},[r]),x=y=>{y.onSelect?.(),c?.(y),t?.(false);},R=()=>{t?.(false);},N=p.length>0,w=!N&&n.length>0;return !v||!e?null:Ua.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:R}),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:p,onValueChange:f,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"}),p&&jsx("button",{type:"button",onClick:()=>f(""),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:[w&&jsxs(Command.Group,{heading:"Recent",children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Recent"}),n.map(y=>jsxs(Command.Item,{value:y.label,onSelect:()=>x(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||Tv[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((C,E)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:C},E))})]},y.id))]}),N&&Object.entries(h).map(([y,C])=>jsxs(Command.Group,{heading:y,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:y}),C.map(E=>jsxs(Command.Item,{value:`${E.label} ${E.keywords?.join(" ")||""}`,onSelect:()=>x(E),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:E.icon||Tv[y]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:E.label}),E.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:E.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},E.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)});Sv.displayName="SpotlightSearch";function nN(e="k"){let[t,r]=Z.useState(false);return Z.useEffect(()=>{let n=o=>{(o.metaKey||o.ctrlKey)&&o.key===e&&(o.preventDefault(),r(a=>!a));};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]),{open:t,setOpen:r,toggle:()=>r(n=>!n)}}var Ev=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"}}),dN={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},Pv=Z.forwardRef(({message:e,type:t="default",variant:r="solid",showIcon:n=false,icon:o,dismissible:a=true,onDismiss:s,endContent:i,position:l,animate:c,autoDismiss:d,storageKey:u,className:p,...f},g)=>{let[v,b]=Z.useState(true),[h,x]=Z.useState(false);Z.useEffect(()=>{u&&localStorage.getItem(`banner-${u}`)==="true"&&b(false);},[u]),Z.useEffect(()=>{if(d&&v){let y=setTimeout(()=>{R();},d);return ()=>clearTimeout(y)}},[d,v]);let R=()=>{x(true),setTimeout(()=>{b(false),u&&localStorage.setItem(`banner-${u}`,"true"),s?.();},200);};if(!v)return null;let N=dN[t],w=n?o!==void 0?o:N?jsx(N,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:m(Ev({variant:r,type:t,position:l}),c&&"animate-pulse",h&&"animate-out fade-out slide-out-to-top duration-200",p),role:"banner",...f,children:[w&&jsx("span",{className:"shrink-0",children:w}),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:R,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"})})]})});Pv.displayName="Banner";var ha=cva("inline-flex items-center justify-center rounded-full shadow-lg transition-all 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",{variants:{variant:{solid:"bg-primary text-primary-foreground hover:bg-primary/90",bordered:"border border-zinc-300 dark:border-zinc-700 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 border-zinc-300 dark:border-zinc-700 bg-transparent text-primary hover:bg-primary hover:text-primary-foreground hover:border-primary"},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"}}),pN=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"}}),Jl=Z.forwardRef(({icon:e,label:t="Action button",extended:r,extendedLabel:n,actions:o,direction:a="up",showTooltip:s=true,closeIcon:i,animation:l="rotate",variant:c,size:d,position:u,className:p,onClick:f,disabled:g,...v},b)=>{let[h,x]=Z.useState(false),R=o&&o.length>0,N=L=>{R&&x(!h),f?.(L);},w=L=>{L.onClick?.(),x(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:""}},C=l==="rotate"&&h?"rotate-45":"",E=l==="scale"&&h?"scale-0":"scale-100";return jsxs("div",{className:m("relative z-50",u!=="relative"&&u&&ha({position:u})),children:[R&&h&&jsx("div",{className:m("absolute left-1/2 -translate-x-1/2 flex items-center",y[a].container),children:o.map((L,k)=>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:`${k*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:L.label}),L.href?jsx("a",{href:L.href,className:m(ha({variant:L.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":L.label,children:L.icon}):jsx("button",{type:"button",onClick:()=>w(L),className:m(ha({variant:L.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":L.label,children:L.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:L.label})]},L.id))}),jsxs("button",{ref:b,type:"button",onClick:N,disabled:g,className:m(ha({variant:c,size:d,position:"relative"}),r&&"w-auto px-6 gap-2",p),"aria-label":t,"aria-expanded":R?h:void 0,...v,children:[h&&i?i:jsx("span",{className:m(pN({size:d}),C,E,"transition-all duration-200"),children:e||jsx(Plus,{})}),r&&n&&jsx("span",{className:"font-medium",children:n})]}),R&&h&&jsx("div",{className:"fixed inset-0 -z-10",onClick:()=>x(false)})]})});Jl.displayName="FloatingActionButton";var fN=Jl;var Vv=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"}}),Dv=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),Av=Z.forwardRef(({className:e,variant:t,size:r,items:n,value:o,defaultValue:a,onValueChange:s,showLabels:i="all",renderItem:l,...c},d)=>{let[u,p]=Z.useState(a||n[0]?.key),f=o!==void 0,g=f?o:u,v=R=>{R.isDisabled||(f||p(R.key),s?.(R.key));},b=R=>t==="filled"?R?"text-primary-foreground":"text-primary-foreground/60 hover:text-primary-foreground/80":R?"text-primary":"text-muted-foreground hover:text-foreground",h=()=>{switch(r){case "sm":return "h-5 w-5";case "lg":return "h-7 w-7";default:return "h-6 w-6"}},x=()=>{switch(r){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:m(Vv({variant:t,size:r}),e),role:"navigation","aria-label":"Bottom navigation",...c,children:n.map(R=>{let N=g===R.key,w=i==="all"||i==="active"&&N,y=N&&R.activeIcon?R.activeIcon:R.icon;if(l)return jsx("div",{onClick:()=>v(R),className:m(Dv({variant:t}),R.isDisabled&&"opacity-50 cursor-not-allowed"),children:l(R,N)},R.key);let C=jsxs("div",{onClick:()=>!R.href&&v(R),className:m(Dv({variant:t}),b(N),R.isDisabled&&"opacity-50 cursor-not-allowed"),role:"button","aria-current":N?"page":void 0,"aria-disabled":R.isDisabled,tabIndex:R.isDisabled?-1:0,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),v(R));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:m(h(),"[&>svg]:h-full [&>svg]:w-full"),children:y}),R.badge!==void 0&&R.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:R.badge>99?"99+":R.badge}),R.showDot&&jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-red-500"})]}),w&&R.label&&jsx("span",{className:m(x(),"font-medium truncate max-w-full px-1"),children:R.label})]},R.key);return R.href&&!R.isDisabled?jsx("a",{href:R.href,onClick:()=>v(R),className:m("flex flex-1 flex-col items-center justify-center gap-1 no-underline",b(N)),children:C},R.key):C})})});Av.displayName="BottomNavigation";var bN="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",Ov=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",danger:"text-danger hover:bg-danger/10"}},defaultVariants:{variant:"default"}}),Fv=Z.forwardRef(({open:e,onOpenChange:t,trigger:r,title:n,description:o,items:a,cancelLabel:s="Cancel",onCancel:i,showCancel:l=true,children:c,closeOnSelect:d=true,onAction:u},p)=>{let f=g=>{g.isDisabled||(g.onSelect?.(),u?.(g.key),d&&t?.(false));};return jsxs(Drawer.Root,{open:e,onOpenChange:t,children:[r&&jsx(Drawer.Trigger,{asChild:true,children:r}),jsxs(Drawer.Portal,{children:[jsx(Drawer.Overlay,{className:"fixed inset-0 z-50 bg-black/40"}),jsxs(Drawer.Content,{ref:p,className:bN,children:[jsx("div",{className:"mx-auto mt-4 h-1.5 w-12 flex-shrink-0 rounded-full bg-muted"}),(n||o)&&jsxs("div",{className:"px-4 py-3 text-center",children:[n&&jsx(Drawer.Title,{className:"text-base font-semibold",children:n}),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:()=>f(g),className:m(Ov({variant:g.isDestructive?"danger":"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})})})]})]})]})});Fv.displayName="ActionSheet";var $v=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),ec=cva("flex h-full items-center justify-center px-4 text-white font-medium transition-opacity",{variants:{variant:{primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"},size:{sm:"min-w-16",md:"min-w-20",lg:"min-w-24"}},defaultVariants:{variant:"primary",size:"md"}}),Kv=Z.forwardRef(({className:e,variant:t,leftActions:r=[],rightActions:n=[],actionSize:o="md",threshold:a=.3,onSwipeEnd:s,disabled:i=false,fullSwipeAction:l,children:c,...d},u)=>{let p=Z.useRef(null),[f,g]=Z.useState(0),[v,b]=Z.useState(false),h=Z.useRef(0),x=Z.useRef(0),R=r.length*(o==="sm"?64:o==="lg"?96:80),N=n.length*(o==="sm"?64:o==="lg"?96:80),w=k=>{i||(b(true),h.current=k.touches[0].clientX,x.current=f);},y=k=>{if(!v||i)return;let T=k.touches[0].clientX-h.current,M=x.current+T;(M>0&&r.length===0||M<0&&n.length===0)&&(M=0),M>R?M=R+(M-R)*.3:M<-N&&(M=-N+(M+N)*.3),g(M);},C=()=>{if(!v)return;b(false);let k=p.current?.offsetWidth||0,S=Math.abs(f)/k;if(l&&S>.6){l==="right"&&f>0&&r[0]?(r[0].onAction?.(),s?.("right",r[0].key)):l==="left"&&f<0&&n[0]&&(n[0].onAction?.(),s?.("left",n[0].key)),g(0);return}f>R*a&&r.length>0?(g(R),s?.("right")):f<-N*a&&n.length>0?(g(-N),s?.("left")):g(0);},E=(k,S)=>{k.onAction?.(),s?.(S,k.key),g(0);},L=()=>{g(0);};return jsxs("div",{ref:u,className:m($v({variant:t,className:e})),...d,children:[r.length>0&&f>0&&jsx("div",{className:"absolute left-0 top-0 bottom-0 flex",style:{width:R},children:r.map(k=>jsxs("button",{type:"button",onClick:()=>E(k,"right"),className:m(ec({variant:k.variant,size:o})),style:{opacity:Math.min(1,f/R)},children:[k.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:k.icon}),!k.icon&&k.label]},k.key))}),n.length>0&&f<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:N},children:n.map(k=>jsxs("button",{type:"button",onClick:()=>E(k,"left"),className:m(ec({variant:k.variant,size:o})),style:{opacity:Math.min(1,Math.abs(f)/N)},children:[k.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:k.icon}),!k.icon&&k.label]},k.key))}),jsx("div",{ref:p,className:m("relative bg-background",v?"":"transition-transform duration-200"),style:{transform:`translateX(${f}px)`},onTouchStart:w,onTouchMove:y,onTouchEnd:C,onClick:f!==0?L:void 0,children:c})]})});Kv.displayName="SwipeActions";var Uv=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),xN=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"}}),_v=Z.forwardRef(({className:e,variant:t,onRefresh:r,pullThreshold:n=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:p,...f},g)=>{let v=Z.useRef(null),[b,h]=Z.useState(0),[x,R]=Z.useState("idle"),N=Z.useRef(0),w=Z.useRef(false),y=()=>l||x==="refreshing"?false:(v.current?.scrollTop??window.scrollY)<=0,C=T=>{y()&&(N.current=T.touches[0].clientY,w.current=true);},E=T=>{if(!w.current||!y())return;let D=T.touches[0].clientY-N.current;if(D<0){h(0),R("idle");return}let I=Math.min(D*.5,o);h(I),R(I>=n?"ready":"pulling");},L=async()=>{if(w.current)if(w.current=false,x==="ready"){R("refreshing"),h(n*.6);try{await r();}finally{R("idle"),h(0);}}else R("idle"),h(0);},k={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],S=()=>{if(x==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:m(k,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:u})]});let T=Math.min(b/n*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:m(k,"text-muted-foreground transition-transform"),style:{transform:`rotate(${T}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:x==="ready"?d:c})]})};return jsxs("div",{ref:g,className:m(Uv({variant:t,className:e})),...f,children:[jsx("div",{className:m(xN({size:i}),"z-10",x==="idle"&&b===0&&"opacity-0"),style:{top:Math.max(b-60,-60),opacity:Math.min(b/(n*.5),1)},children:S()}),jsx("div",{ref:v,className:m("transition-transform duration-200",x==="refreshing"&&"ease-out"),style:{transform:`translateY(${b}px)`,transition:w.current?"none":void 0},onTouchStart:C,onTouchMove:E,onTouchEnd:L,children:p})]})});_v.displayName="PullToRefresh";var Xn=(e,t,r)=>({duration:e,delay:t,ease:r||[.4,0,.2,1]}),yN={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},jv=Z.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=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:yN,custom:i,transition:Xn(r,n,o),className:m(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&u}):u});jv.displayName="Fade";var RN=(e,t)=>{let r=typeof t=="number"?`${t}px`:t,n={up:{y:r},down:{y:`-${r}`},left:{x:r},right:{x:`-${r}`}};return {hidden:{opacity:0,...n[e]},visible:{opacity:1,x:0,y:0},exit:{opacity:0,...n[e]}}},Wv=Z.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,unmountOnExit:s=true,direction:i="up",offset:l=20,onAnimationStart:c,onAnimationComplete:d},u)=>{let p=Z.useMemo(()=>RN(i,l),[i,l]),f=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:p,transition:Xn(r,n,o),className:m(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});Wv.displayName="Slide";var wN={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"},CN={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},Yv=Z.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,unmountOnExit:s=true,initialScale:i=.9,origin:l="center",onAnimationStart:c,onAnimationComplete:d},u)=>{let p=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:CN,custom:i,transition:Xn(r,n,o),className:m(a),style:{transformOrigin:wN[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Yv.displayName="Scale";var qv=Z.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,horizontal:s=false,startingSize:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},u)=>{let p=s?"width":"height",f={hidden:{[p]:i,opacity:l?0:1},visible:{[p]:"auto",opacity:1},exit:{[p]: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:Xn(r,n,o),className:m("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});qv.displayName="Collapse";var Xv=Z.forwardRef(({show:e=true,children:t,duration:r=.4,delay:n=0,ease:o,className:a,initialWidth:s=0,initialHeight:i=0,animateOpacity:l=true,onAnimationStart:c,onAnimationComplete:d},u)=>{let p={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:p,transition:Xn(r,n,o),className:m("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Xv.displayName="Expand";var Zv=Z.forwardRef(({show:e=true,children:t,duration:r=.3,delay:n=0,ease:o,className:a,unmountOnExit:s=true,initialRotation:i=-180,finalRotation:l=0,onAnimationStart:c,onAnimationComplete:d},u)=>{let p={hidden:{opacity:0,rotate:i},visible:{opacity:1,rotate:l},exit:{opacity:0,rotate:i}},f=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:p,transition:Xn(r,n,o),className:m(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});Zv.displayName="Rotate";var Jv=Z.forwardRef(({front:e,back:t,direction:r="horizontal",flipped:n=false,duration:o=.6,delay:a=0,ease:s,className:i,onAnimationStart:l,onAnimationComplete:c},d)=>{let u=r==="horizontal"?"rotateY":"rotateX";return jsx("div",{ref:d,className:m("relative",i),style:{perspective:1e3},children:jsxs(motion.div,{animate:{[u]:n?180:0},transition:Xn(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})]})})});Jv.displayName="Flip";var Qv=Z.forwardRef(({color:e="currentColor",duration:t=.6,children:r,className:n,disabled:o=false},a)=>{let[s,i]=Z.useState([]),l=Z.useRef(null),c=u=>{if(o)return;let p=l.current;if(!p)return;let f=p.getBoundingClientRect(),g=u.clientX-f.left,v=u.clientY-f.top,b=Math.max(f.width,f.height)*2,h={id:Date.now(),x:g,y:v,size:b};i(x=>[...x,h]);},d=u=>{i(p=>p.filter(f=>f.id!==u));};return jsxs("div",{ref:a,className:m("relative overflow-hidden rounded-[inherit]",n),onClick:c,children:[jsx("div",{ref:l,className:"relative z-0",children:r}),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))})]})});Qv.displayName="Ripple";var eh=Z.forwardRef(({children:e,animate:t=true,height:r=10,duration:n=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.useState(false),d=s?l:t,u={idle:{y:0},bounce:{y:[0,-r,0],transition:{duration:n,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})});eh.displayName="Bounce";var NN={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]},th=Z.forwardRef(({children:e,animate:t=true,intensity:r="normal",duration:n=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.useState(false),d=s?l:t,u={idle:{x:0},shake:{x:NN[r],transition:{duration:n,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})});th.displayName="Shake";var kN={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},rh=Z.forwardRef(({children:e,animate:t=true,speed:r="normal",className:n},o)=>jsx("div",{ref:o,className:m(t&&kN[r],n),children:e}));rh.displayName="Pulse";var nh=Z.forwardRef(({children:e,animate:t=true,angle:r=10,duration:n=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.useState(false),d=s?l:t,u={idle:{rotate:0},wiggle:{rotate:[0,-r,r,-r,r,0],transition:{duration:n,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})});nh.displayName="Wiggle";var oh=Z.forwardRef(({children:e,animate:t=false,scale:r=1.2,duration:n=.2,className:o,triggerOnHover:a=false,triggerOnClick:s=false},i)=>{let[l,c]=Z.useState(false),d=t||l,u={type:"spring",stiffness:400,damping:17,duration:n},p=()=>{s&&(c(true),setTimeout(()=>c(false),n*1e3));};return jsx(motion.div,{ref:i,animate:{scale:d?r:1},transition:u,className:m(o),onMouseEnter:()=>a&&c(true),onMouseLeave:()=>a&&c(false),onClick:p,children:e})});oh.displayName="Pop";var HN=(e,t,r,n)=>{let o=e.toFixed(t),[a,s]=o.split("."),i=a.replace(/\B(?=(\d{3})+(?!\d))/g,r);return s?`${i}${n}${s}`:i},ah=Z.forwardRef(({value:e,from:t=0,duration:r=2,decimals:n=0,prefix:o="",suffix:a="",separator:s=",",decimalSeparator:i=".",animateOnView:l=true,delay:c=0,className:d,onComplete:u},p)=>{let f=Z.useRef(null),g=useInView(f,{once:true}),[v,b]=Z.useState(!l);Z.useEffect(()=>{if(l&&g){let R=setTimeout(()=>b(true),c*1e3);return ()=>clearTimeout(R)}},[l,g,c]);let h=useMotionValue(t),x=useTransform(h,R=>HN(R,n,s,i));return Z.useEffect(()=>{if(v){let R=animate(h,e,{duration:r,ease:"easeOut",onComplete:u});return ()=>R.stop()}},[v,e,r,h,u]),jsx("span",{ref:f,className:m(d),children:jsxs("span",{ref:p,children:[o,jsx(motion.span,{children:x}),a]})})});ah.displayName="Counter";var sh=Z.forwardRef(({text:e,speed:t=50,delay:r=0,pauseBetween:n=1500,cursor:o=true,cursorChar:a="|",loop:s=false,deleteSpeed:i=30,animateOnView:l=true,className:c,cursorClassName:d,onComplete:u},p)=>{let f=Array.isArray(e)?e:[e],[g,v]=Z.useState(""),[b,h]=Z.useState(0),[x,R]=Z.useState(false),[N,w]=Z.useState(false),y=Z.useRef(null),C=useInView(y,{once:true}),[E,L]=Z.useState(!l);return Z.useEffect(()=>{if(l&&C){let k=setTimeout(()=>L(true),r*1e3);return ()=>clearTimeout(k)}},[l,C,r]),Z.useEffect(()=>{if(!E||N)return;let k=f[b],S;return x?g.length>0?S=setTimeout(()=>{v(g.slice(0,-1));},i):(R(false),h(T=>(T+1)%f.length)):g.length<k.length?S=setTimeout(()=>{v(k.slice(0,g.length+1));},t):b<f.length-1||s?S=setTimeout(()=>{R(true);},n):(w(true),u?.()),()=>clearTimeout(S)},[E,g,b,x,N,f,t,i,n,s,u]),jsxs("span",{ref:y,className:m(c),children:[jsx("span",{ref:p,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})]})});sh.displayName="Typewriter";var ih=Z.forwardRef(({children:e,direction:t="up",stagger:r=.05,duration:n=.5,delay:o=0,splitBy:a="word",animateOnView:s=true,className:i},l)=>{let c=Z.useRef(null),d=useInView(c,{once:true,amount:.5}),u=s?d:true,p=typeof e=="string"?e:"",f=a==="word"?p.split(" "):p.split(""),g={up:{y:20},down:{y:-20},left:{x:20},right:{x:-20}},v={hidden:{},visible:{transition:{staggerChildren:r,delayChildren:o}}},b={hidden:{opacity:0,...g[t]},visible:{opacity:1,x:0,y:0,transition:{duration:n,ease:"easeInOut"}}};return jsx(motion.div,{ref:l,className:m("inline-flex flex-wrap",i),variants:v,initial:"hidden",animate:u?"visible":"hidden",children:jsx("span",{ref:c,children:f.map((h,x)=>jsxs(motion.span,{variants:b,className:"inline-block",children:[h,a==="word"&&x<f.length-1&&"\xA0"]},x))})})});ih.displayName="TextReveal";var lh=Z.forwardRef(({words:e,duration:t=2,animation:r="slide",animationDuration:n=.5,className:o,loop:a=true},s)=>{let[i,l]=Z.useState(0);Z.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(r){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:n},className:"inline-block",children:e[i]},e[i])})})});lh.displayName="WordRotate";var mh=Z.forwardRef(({children:e,direction:t="up",distance:r=50,duration:n=.6,delay:o=0,once:a=true,threshold:s=.1,className:i,scale:l,rotate:c,blur:d,ease:u=[.4,0,.2,1]},p)=>{let f=Z.useRef(null),g=useInView(f,{once:a,amount:s}),b={up:{x:0,y:r},down:{x:0,y:-r},left:{x:r,y:0},right:{x:-r,y:0},none:{x:0,y:0}}[t],h={hidden:{opacity:0,x:b.x,y:b.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:n,delay:o,ease:u}}};return jsx("div",{ref:f,children:jsx(motion.div,{ref:p,variants:h,initial:"hidden",animate:g?"visible":"hidden",className:m(i),children:e})})});mh.displayName="ScrollReveal";var ph=Z.forwardRef(({position:e="top",size:t=4,color:r="hsl(var(--primary))",backgroundColor:n="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}),p=l?u:d,f=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}},v=f?"scaleX":"scaleY",b=f?"left":"top";return jsxs("div",{ref:c,className:m("fixed",a),style:{...g[e],zIndex:o,backgroundColor:n},children:[jsx(motion.div,{className:"h-full w-full",style:{[v]:p,transformOrigin:b,backgroundColor:r}}),i&&jsx(VN,{progress:p,position:e})]})});ph.displayName="ScrollProgress";var VN=({progress:e,position:t})=>{let r=useTransform(e,s=>Math.round(s*100)),[n,o]=Z.useState(0);return Z.useEffect(()=>{let s=r.on("change",o);return ()=>s()},[r]),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:[n,"%"]})},fh=Z.forwardRef(({children:e,speed:t=.5,direction:r="vertical",className:n,container:o},a)=>{let s=Z.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=r==="horizontal"?d:0,p=r==="vertical"?d:0;return jsx("div",{ref:s,className:m("overflow-hidden",n),children:jsx(motion.div,{ref:a,style:{x:u,y:p},children:e})})});fh.displayName="Parallax";var vh=Z.forwardRef(({children:e,width:t,height:r,duration:n=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"},p={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:r,borderRadius:i,backgroundColor:a},children:[e,c&&jsx("div",{className:"absolute inset-0",style:{background:`linear-gradient(${u[o]}, transparent, ${s}, transparent)`,animation:`${p[o]} ${n}s infinite`}}),jsx("style",{children:`
|
|
55
|
+
`,document.body.appendChild(ke),ne.dataTransfer.setDragImage(ke,20,15),setTimeout(()=>{document.body.removeChild(ke);},0),v(e),w?.({event:ne,node:e});},X=ne=>{if(ne.preventDefault(),ne.stopPropagation(),!g||g.key===e.key||J)return;let oe=ne.currentTarget.getBoundingClientRect(),ke=ne.clientY-oe.top,Ft=oe.height,bt;ke<Ft*.25?bt=-1:ke>Ft*.75?bt=1:bt=0,!(N&&!N({dropNode:e,dropPosition:bt,dragNode:g}))&&(x(e.key,bt),y?.({event:ne,node:e}));},Re=ne=>{ne.preventDefault(),ne.stopPropagation(),!(!g||g.key===e.key)&&C?.({event:ne,node:e,expandedKeys:j()});},Te=ne=>{ne.stopPropagation(),E?.({event:ne,node:e});},ot=ne=>{ne.preventDefault(),ne.stopPropagation(),!(!g||g.key===e.key||J)&&(h!==null&&R(e,h),v(null),x(null,null));},ue=ne=>{v(null),x(null,null),L?.({event:ne,node:e});},tt=ne=>{J||Ne&&i(e.key,e,ne);},te=ne=>{ne.stopPropagation(),!J&&!U&&a(e.key,e);},at=Z.useMemo(()=>{if(!Q||h===null)return "";switch(h){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 ""}},[Q,h]),qt=[...r,n];return jsxs("div",{className:"relative",children:[k&&t>0&&jsxs(Fragment,{children:[r.map((ne,oe)=>!ne&&jsx("div",{className:"absolute border-l border-border",style:{left:`calc(${oe} * var(--tree-indent) + 12px)`,top:0,bottom:0}},oe)),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":U?void 0:W,"aria-selected":Ne?V:void 0,"aria-disabled":J,draggable:_,onDragStart:q,onDragOver:X,onDragEnter:Re,onDragLeave:Te,onDrop:ot,onDragEnd:ue,onClick:tt,className:m("relative",Vg({size:$,isSelected:V,isDragging:Y,isDisabled:J,isHoverable:Ne&&!J}),at,A&&"flex-1"),style:{paddingLeft:`calc(${t} * var(--tree-indent) + 8px)`},children:[_&&T&&O!==false&&jsx("div",{className:"flex-shrink-0 text-muted-foreground cursor-grab active:cursor-grabbing",children:O}),jsx("button",{type:"button",onClick:te,className:m("flex-shrink-0 p-0.5 rounded hover:bg-muted/80 transition-transform",U&&"invisible"),tabIndex:-1,children:jsx(ChevronRight,{className:m("h-4 w-4 transition-transform duration-200",W&&"rotate-90")})}),be&&jsx(bC,{checked:z,indeterminate:K,disabled:J,onClick:ne=>u(e.key,e,ne)}),S&&F&&jsx("div",{className:"flex-shrink-0 text-muted-foreground ml-1",children:F}),jsx("div",{className:m("flex-1 min-w-0 truncate ml-1",A&&"flex-none"),children:e.label})]}),G&&W&&jsx("div",{role:"group",children:e.children.map((ne,oe)=>jsx(zg,{node:ne,level:t+1,isLast:oe===e.children.length-1,parentIsLastPath:qt},ne.key))})]})},vC=e=>{let t=[],n=r=>{for(let o of r)t.push(o.key),o.children&&n(o.children);};return n(e),t},hC=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},Fg=Z.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:p,defaultSelectedKeys:f=[],onSelect:g,checkable:v=false,checkStrictly:b=false,checkedKeys:h,defaultCheckedKeys:x=[],onCheck:R,showLine:N=false,showIcon:w=false,showHandle:y=true,dragIcon:C,icon:E,leafIcon:L=jsx(File,{className:"h-4 w-4"}),folderIcon:k=jsx(Folder,{className:"h-4 w-4"}),folderOpenIcon:S=jsx(FolderOpen,{className:"h-4 w-4"}),onDragStart:T,onDragEnter:M,onDragOver:D,onDragLeave:P,onDragEnd:I,onDrop:H,blockNode:A=false,isDisabled:B=false,...$},j)=>{let G=Z.useCallback(()=>l?new Set(vC(r)):new Set(i),[l,i,r]),[U,W]=Z.useState(G),V=s!==void 0,z=V?new Set(s):U,K=Z.useCallback((Se,qe)=>{let Bt=new Set(z),$e=!Bt.has(Se);$e?Bt.add(Se):Bt.delete(Se),V||W(Bt),c?.(Array.from(Bt),{expanded:$e,node:qe});},[z,V,c]),[Y,Q]=Z.useState(new Set(f)),J=p!==void 0,Ne=J?new Set(p):Y,be=Z.useCallback((Se,qe,Bt)=>{let $e=new Set(Ne),re=!$e.has(Se);u?re?$e.add(Se):$e.delete(Se):($e.clear(),re&&$e.add(Se)),J||Q($e);let we=[],Mr=Pa=>{for(let to of Pa)$e.has(to.key)&&we.push(to),to.children&&Mr(to.children);};Mr(r),g?.(Array.from($e),{selected:re,selectedNodes:we,node:qe,event:Bt});},[Ne,u,J,g,r]),[_,O]=Z.useState(new Set(x)),[F,q]=Z.useState(new Set),X=h!==void 0,Re=X?new Set(Array.isArray(h)?h:h.checked):_,Te=X&&!Array.isArray(h)?new Set(h.halfChecked):F,ot=Z.useCallback((Se,qe,Bt)=>{let $e=new Set(Re),re=new Set(Te),we=!$e.has(Se);if(we?($e.add(Se),re.delete(Se)):$e.delete(Se),!b&&qe.children){let fi=hC(qe);for(let Qn of fi)we?($e.add(Qn),re.delete(Qn)):$e.delete(Qn);}X||(O($e),q(re));let Mr=[],Pa=fi=>{for(let Qn of fi)$e.has(Qn.key)&&Mr.push(Qn),Qn.children&&Pa(Qn.children);};Pa(r);let to=b?{checked:Array.from($e),halfChecked:Array.from(re)}:Array.from($e);R?.(to,{checked:we,checkedNodes:Mr,node:qe,event:Bt,halfCheckedKeys:Array.from(re)});},[Re,Te,b,X,R,r]),[ue,tt]=Z.useState(null),[te,at]=Z.useState(null),[qt,ne]=Z.useState(null),oe=Z.useCallback((Se,qe)=>{at(Se),ne(qe);},[]),ke=Z.useCallback((Se,qe)=>{!ue||!H||qe===0&&Og(ue,Se.key)||H({event:{},node:Se,dragNode:ue,dropPosition:qe,dropToGap:qe!==0});},[ue,H]),Ft=Z.useCallback(()=>Array.from(z),[z]),bt={expandedKeys:z,toggleExpand:K,selectedKeys:Ne,handleSelect:be,selectable:d,multiple:u,checkedKeys:Re,halfCheckedKeys:Te,handleCheck:ot,checkable:v,checkStrictly:b,draggable:o,draggedNode:ue,setDraggedNode:tt,dragOverKey:te,dragOverPosition:qt,setDragOver:oe,handleDrop:ke,allowDrop:a,onDragStart:T,onDragEnter:M,onDragOver:D,onDragLeave:P,onDragEnd:I,showLine:N,showIcon:w,showHandle:y,dragIcon:C,icon:E,leafIcon:L,folderIcon:k,folderOpenIcon:S,blockNode:A,disabled:B,size:n,data:r,getAllKeys:Ft},eo=Se=>{let qe=Se.relatedTarget,Bt=Se.currentTarget;(!qe||!Bt.contains(qe))&&oe(null,null);};return jsx(Ag.Provider,{value:bt,children:jsx("div",{ref:j,role:"tree","aria-multiselectable":u||v,className:m(Ig({variant:t,size:n,className:e})),onDragLeave:eo,...$,children:r.map((Se,qe)=>jsx(zg,{node:Se,level:0,isLast:qe===r.length-1},Se.key))})})});Fg.displayName="Tree";var $g=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-9 px-2 text-xs",md:"h-10 px-3 text-sm",lg:"h-11 px-4 text-base"},fullWidth:{true:"w-full",false:"w-fit min-w-48"}},defaultVariants:{size:"md",fullWidth:false}}),MC=({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))})},TC=(e,t)=>{let[n,r]=Z.useState(e);return Z.useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n},Kg=Z.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:p="Loading...",clearable:f=false,allowCustomValue:g=true,maxHeight:v=200,highlightMatch:b=true,fullWidth:h=false,disabled:x,...R},N)=>{let[w,y]=Z.useState(false),[C,E]=Z.useState(r),[L,k]=Z.useState([]),[S,T]=Z.useState(false),[M,D]=Z.useState(false),[P,I]=Z.useState(0),H=Z.useRef(null),A=Z.useRef(null),B=n!==void 0?n:C,$=TC(B,l);Z.useEffect(()=>{let F=A.current;if(!F)return;let q=()=>{I(F.offsetWidth);};q();let X=new ResizeObserver(q);return X.observe(F),()=>{X.disconnect();}},[]),Z.useImperativeHandle(N,()=>H.current);let j=i?L:s,G=Z.useMemo(()=>i?j:j.filter(F=>F.label.toLowerCase().includes(B.toLowerCase())),[j,B,i]);Z.useEffect(()=>{if(!i)return;if($.length<c){k([]);return}let F=false;return (async()=>{T(true);try{let X=await i($);F||k(X);}catch{F||k([]);}finally{F||T(false);}})(),()=>{F=true;}},[$,i,c]);let U=F=>{n===void 0&&E(F),o?.(F);},W=F=>{let q=F.target.value;U(q),q.length>=c&&y(true);},V=F=>{U(F.label),a?.(F),y(false);},z=()=>{U(""),H.current?.focus();},K=()=>{D(true),y(true);},Y=()=>{D(false);},Q=F=>{F.key==="Escape"&&y(false),F.key==="ArrowDown"&&!w&&G.length>0&&y(true);},J=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4",Ne=f&&B?"pr-8":"pr-3",be=t==="sm"?"text-xs":t==="lg"?"text-base":"text-sm",_=t==="sm"?"px-1.5 py-1":t==="lg"?"px-3 py-2":"px-2 py-1.5",O=t==="sm"?"h-3 w-3":t==="lg"?"h-5 w-5":"h-4 w-4";return jsxs(Pt,{open:w,onOpenChange:y,children:[jsxs(nr,{ref:A,className:m("relative",h?"w-full":"w-fit"),children:[jsx("input",{ref:H,type:"text",value:B,onChange:W,onFocus:K,onBlur:Y,onKeyDown:Q,disabled:x,placeholder:d,className:m($g({size:t,fullWidth:h}),Ne,e),style:{borderColor:M?"var(--color-foreground)":void 0},role:"combobox","aria-expanded":w,"aria-autocomplete":"list","aria-controls":"autocomplete-list",...R}),f&&B&&!x&&jsx("button",{type:"button",onClick:z,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:jsx(X,{className:J})})]}),jsx(Lt,{className:"p-0",align:"start",style:{width:P>0?P:void 0},onOpenAutoFocus:F=>F.preventDefault(),children:jsx(Command,{className:"overflow-hidden rounded-md",shouldFilter:false,children:jsx(ze,{style:{maxHeight:v},children:jsx(Command.List,{id:"autocomplete-list",className:"p-1",children:S?jsxs("div",{className:m("flex items-center justify-center gap-2 py-6 text-muted-foreground",be),children:[jsx(Loader2,{className:m(J,"animate-spin")}),p]}):G.length===0?jsx("div",{className:m("py-6 text-center text-muted-foreground",be),children:u}):G.map(F=>jsxs(Command.Item,{value:F.value,disabled:F.isDisabled,onSelect:()=>V(F),className:m("relative flex cursor-default select-none items-center rounded-sm outline-none",_,be,"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 shrink-0",O,B===F.label?"opacity-100":"opacity-0")}),jsx("span",{className:"flex-1",children:b?jsx(MC,{text:F.label,query:B}):F.label})]},F.value))})})})})]})});Kg.displayName="Autocomplete";var mn=Z.createContext(null),bl=Z.createContext(null),vl=()=>{let e=Z.useContext(mn);if(!e)throw new Error("useFormContext must be used within a Form");return e},Ms=()=>{let e=Z.useContext(bl);if(!e)throw new Error("useFieldContext must be used within a FormField");return e},NC={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=Z.forwardRef(({defaultValues:e={},onSubmit:t,onError:n,validateOnBlur:r=true,validateOnChange:o=false,children:a,className:s,...i},l)=>{let[c,d]=Z.useState(e),[u,p]=Z.useState({}),[f,g]=Z.useState({}),[v,b]=Z.useState({}),[h,x]=Z.useState(false),R=Z.useRef(new Map),N=Z.useCallback((P,I)=>{R.current.set(P,I);},[]),w=Z.useCallback(P=>{R.current.delete(P);},[]),y=Z.useCallback(P=>{let I=R.current.get(P)||[],H=c[P];for(let A of I)if(!A.validate(H))return p(B=>({...B,[P]:A.message})),false;return p(A=>({...A,[P]:null})),true},[c]),C=Z.useCallback(()=>{let P=true,I={};return R.current.forEach((H,A)=>{let B=c[A];for(let $ of H)if(!$.validate(B)){I[A]=$.message,P=false;break}I[A]||(I[A]=null);}),p(I),P},[c]),E=Z.useCallback((P,I)=>{d(H=>({...H,[P]:I})),b(H=>({...H,[P]:true})),o&&setTimeout(()=>{y(P);},0);},[o,y]),L=Z.useCallback((P,I)=>{p(H=>({...H,[P]:I}));},[]),k=Z.useCallback((P,I)=>{g(H=>({...H,[P]:I})),I&&r&&y(P);},[r,y]),S=Z.useCallback(P=>({value:c[P],error:u[P]??null,touched:f[P]??false,dirty:v[P]??false}),[c,u,f,v]),T=Z.useCallback(()=>{d(e),p({}),g({}),b({});},[e]),M=async P=>{P.preventDefault();let I={};if(R.current.forEach((A,B)=>{I[B]=true;}),g(I),!C()){n?.(u);return}if(t){x(true);try{await t(c);}finally{x(false);}}},D={values:c,errors:u,touched:f,dirty:v,isSubmitting:h,setValue:E,setError:L,setTouched:k,validateField:y,validateAll:C,registerField:N,unregisterField:w,getFieldState:S,reset:T};return jsx(mn.Provider,{value:D,children:jsx("form",{ref:l,onSubmit:M,className:m("space-y-4",s),...i,children:a})})});Gg.displayName="Form";var Ug=({name:e,rules:t=[],defaultValue:n,children:r})=>{let o=vl(),a=Z.useId();Z.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(bl.Provider,{value:i,children:r})};Ug.displayName="FormField";var _g=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("space-y-1.5",e),...t}));_g.displayName="FormItem";var jg=Z.forwardRef(({className:e,required:t,children:n,...r},o)=>{let{id:a,error:s,touched:i}=Ms();return jsxs(Pr,{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 Wg=({children:e})=>{let{name:t,id:n,error:r,touched:o}=Ms(),a=vl(),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 Z.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})};Wg.displayName="FormControl";var Yg=Z.forwardRef(({className:e,...t},n)=>jsx("p",{ref:n,className:m("text-xs text-muted-foreground",e),...t}));Yg.displayName="FormDescription";var qg=Z.forwardRef(({className:e,message:t,...n},r)=>{let{id:o,error:a,touched:s}=Ms(),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});qg.displayName="FormMessage";var Xg=Z.forwardRef(({name:e,rules:t=[],validate:n,errorMessage:r,isInvalid:o,isRequired:a,onChange:s,onBlur:i,value:l,defaultValue:c,...d},u)=>{let p=Z.useContext(mn),f=!!p&&!!e,[g,v]=Z.useState(c??""),[b,h]=Z.useState(null),[x,R]=Z.useState(false),N=l!==void 0,w=N?l:f?p.values[e]:g;Z.useEffect(()=>{if(f&&p&&e){let k=[...t];return a&&!k.some(S=>S.message.toLowerCase().includes("required"))&&k.unshift({validate:S=>typeof S=="string"?S.trim().length>0:S!=null,message:"This field is required"}),n&&k.push({validate:S=>!n(String(S??"")),message:"Validation failed"}),p.registerField(e,k),c!==void 0&&p.values[e]===void 0&&p.setValue(e,c),()=>{p.unregisterField(e);}}},[e,f,p,t,a,n,c]);let y=k=>{let S=k.target.value;if(f&&p&&e?p.setValue(e,S):N||v(S),n&&x){let T=n(S);h(T??null);}s?.(k);},C=k=>{if(R(true),f&&p&&e&&p.setTouched(e,true),n){let S=n(String(w??""));h(S??null);}i?.(k);},E=r,L=o;if(f&&p&&e){let k=p.getFieldState(e);k.touched&&k.error&&(E=E??k.error,L=true);}else x&&b&&(E=E??b,L=true);return jsx(er,{ref:u,name:e,value:String(w??""),onChange:y,onBlur:C,isRequired:a,isInvalid:L,errorMessage:E,...d})});Xg.displayName="TextField";var Zg=Z.forwardRef(({name:e,rules:t=[],validate:n,errorMessage:r,isInvalid:o,isRequired:a,onChange:s,onBlur:i,value:l,defaultValue:c,...d},u)=>{let p=Z.useContext(mn),f=!!p&&!!e,[g,v]=Z.useState(c??""),[b,h]=Z.useState(null),[x,R]=Z.useState(false),N=l!==void 0,w=N?l:f?p.values[e]:g;Z.useEffect(()=>{if(f&&p&&e){let k=[...t];return a&&!k.some(S=>S.message.toLowerCase().includes("required"))&&k.unshift({validate:S=>typeof S=="string"?S.trim().length>0:S!=null,message:"This field is required"}),n&&k.push({validate:S=>!n(String(S??"")),message:"Validation failed"}),p.registerField(e,k),c!==void 0&&p.values[e]===void 0&&p.setValue(e,c),()=>{p.unregisterField(e);}}},[e,f,p,t,a,n,c]);let y=k=>{let S=k.target.value;if(f&&p&&e?p.setValue(e,S):N||v(S),n&&x){let T=n(S);h(T??null);}s?.(k);},C=k=>{if(R(true),f&&p&&e&&p.setTouched(e,true),n){let S=n(String(w??""));h(S??null);}i?.(k);},E=r,L=o;if(f&&p&&e){let k=p.getFieldState(e);k.touched&&k.error&&(E=E??k.error,L=true);}else x&&b&&(E=E??b,L=true);return jsx(Ba,{ref:u,name:e,value:String(w??""),onChange:y,onBlur:C,isRequired:a,isInvalid:L,errorMessage:E,...d})});Zg.displayName="TextareaField";var Qg=Z.forwardRef(({name:e,rules:t=[],validate:n,errorMessage:r,isInvalid:o,isRequired:a,onChange:s,onBlur:i,value:l,defaultValue:c,label:d,description:u,className:p,...f},g)=>{let v=Z.useContext(mn),b=!!v&&!!e,h=Z.useId(),[x,R]=Z.useState(c),[N,w]=Z.useState(null),[y,C]=Z.useState(false),E=l!==void 0,L=E?l:b?v.values[e]:x;Z.useEffect(()=>{if(b&&v&&e){let P=[...t];return a&&!P.some(I=>I.message.toLowerCase().includes("required"))&&P.unshift({validate:I=>I!=null&&I!=="",message:"This field is required"}),n&&P.push({validate:I=>!n(I),message:"Validation failed"}),v.registerField(e,P),c!==void 0&&v.values[e]===void 0&&v.setValue(e,c),()=>{v.unregisterField(e);}}},[e,b,v,t,a,n,c]);let k=P=>{if(b&&v&&e?v.setValue(e,P):E||R(P),n&&y){let I=n(P);w(I??null);}s?.(P);},S=P=>{if(C(true),b&&v&&e&&v.setTouched(e,true),n){let I=n(L);w(I??null);}i?.(P);},T=r,M=o;if(b&&v&&e){let P=v.getFieldState(e);P.touched&&P.error&&(T=T??P.error,M=true);}else y&&N&&(T=T??N,M=true);let D=M||!!T;return d||u||T?jsxs("div",{className:p,children:[d&&jsxs("label",{htmlFor:h,className:"text-sm font-medium leading-none mb-1.5 block",children:[d,a&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),jsx(Jo,{ref:g,id:h,name:e,value:L,onChange:k,onBlur:S,isDisabled:f.isDisabled,...f}),(u||T)&&jsx("p",{className:`text-xs mt-1.5 ${D?"text-danger":"text-muted-foreground"}`,children:T||u})]}):jsx(Jo,{ref:g,name:e,value:L,onChange:k,onBlur:S,className:p,...f})});Qg.displayName="NumberField";var tb=Z.forwardRef(({name:e,rules:t=[],validate:n,errorMessage:r,isInvalid:o,isRequired:a,multiple:s=false,value:i,defaultValue:l,onValueChange:c,label:d,description:u,className:p,...f},g)=>{let v=Z.useContext(mn),b=!!v&&!!e,h=Z.useId(),[x,R]=Z.useState(l),[N,w]=Z.useState(null),[y,C]=Z.useState(false),E=i!==void 0,L=E?i:b?v.values[e]:x;Z.useEffect(()=>{if(b&&v&&e){let D=[...t];return a&&!D.some(P=>P.message.toLowerCase().includes("required"))&&D.unshift({validate:P=>Array.isArray(P)?P.length>0:P!=null&&P!=="",message:"This field is required"}),n&&D.push({validate:P=>!n(P),message:"Validation failed"}),v.registerField(e,D),l!==void 0&&v.values[e]===void 0&&v.setValue(e,l),()=>{v.unregisterField(e);}}},[e,b,v,t,a,n,l]);let k=D=>{if(C(true),b&&v&&e?(v.setValue(e,D),v.setTouched(e,true)):E||R(D),n){let P=n(D);w(P??null);}c?.(D);},S=r,T=o;if(b&&v&&e){let D=v.getFieldState(e);D.touched&&D.error&&(S=S??D.error,T=true);}else y&&N&&(S=S??N,T=true);let M=T||!!S;return jsxs("div",{className:p,children:[d&&jsxs("label",{htmlFor:h,className:"text-sm font-medium leading-none mb-1.5 block",children:[d,a&&jsx("span",{className:"text-danger ml-1",children:"*"})]}),s?jsx(Ir,{ref:g,multiple:true,value:L,onValueChange:k,isDisabled:f.isDisabled,...f}):jsx(Ir,{ref:g,value:L,onValueChange:k,isDisabled:f.isDisabled,...f}),(u||S)&&jsx("p",{className:`text-xs mt-1.5 ${M?"text-danger":"text-muted-foreground"}`,children:S||u})]})});tb.displayName="SelectField";var rb=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"}}),ob=Z.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(rb({size:t,className:e})),...i,children:[jsxs(Dr,{"data-user-avatar":true,children:[o&&jsx(so,{src:o,alt:n}),jsx(Hr,{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})]})});ob.displayName="User";var sb=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-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"flat",size:"md",radius:"sm"}}),ib=Z.forwardRef(({className:e,variant:t,size:n,radius:r,...o},a)=>jsx("code",{ref:a,className:m(sb({variant:t,size:n,radius:r,className:e})),...o}));ib.displayName="Code";function ub(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 mb=Z.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),p=ub(s)?themes.oneDark:themes.oneLight,f=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:p,code:e.trim(),language:t,children:({tokens:g,getLineProps:v,getTokenProps:b})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:g.map((h,x)=>jsxs("div",{...v({line:h}),children:[n&&jsx("span",{className:"inline-block w-8 text-zinc-400 dark:text-zinc-600 select-none text-right mr-4",children:x+1}),h.map((R,N)=>jsx("span",{...b({token:R})},N))]},x))})}),!i&&jsx("button",{onClick:f,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"})})]})]})});mb.displayName="CodeBlock";var pb=Z.forwardRef(({tabs:e,className:t,theme:n},r)=>{let[o,a]=useState(0),[s,i]=useState(false),c=ub(n)?themes.oneDark:themes.oneLight,d=async()=>{await navigator.clipboard.writeText(e[o].code),i(true),setTimeout(()=>i(false),2e3);},u=e[o],p=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((f,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:[f.icon,f.name]},f.name))}),jsxs("div",{className:"relative",children:[jsx(Highlight,{theme:c,code:u.code.trim(),language:p,children:({tokens:f,getLineProps:g,getTokenProps:v})=>jsx("pre",{className:"p-4 overflow-x-auto text-sm bg-zinc-100 dark:bg-zinc-900 m-0",children:f.map((b,h)=>jsx("div",{...g({line:b}),children:b.map((x,R)=>jsx("span",{...v({token:x})},R))},h))})}),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"})})]})]})});pb.displayName="TabbedCodeBlock";var fb=cva("relative flex items-center gap-2 font-mono rounded-lg border",{variants:{variant:{solid:"bg-zinc-800 text-white dark:bg-zinc-200 dark:text-zinc-900 border-transparent",bordered:"bg-transparent border-zinc-300 dark:border-zinc-700 text-zinc-900 dark:text-white",flat:"bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-white border-transparent"},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:"solid",size:"md"}}),gb=Z.forwardRef(({className:e,variant:t,size:n,code:r,copyable:o=true,copyLabel:a="Copy",onCopy:s,symbol:i="$",hideSymbol:l=false,dismissible:c=false,onDismiss:d,...u},p)=>{let[f,g]=Z.useState(false),v=async()=>{try{await navigator.clipboard.writeText(r),g(!0),s?.(),setTimeout(()=>g(!1),2e3);}catch(b){console.error("Failed to copy:",b);}};return jsxs("div",{ref:p,className:m(fb({variant:t,size:n,className:e})),...u,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:v,className:m("flex-shrink-0 rounded p-1 transition-colors cursor-pointer","hover:bg-black/10 dark:hover:bg-white/10","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),"aria-label":f?"Copied":a,children:f?jsx(Check,{className:"h-4 w-4 text-green-500"}):jsx(Copy,{className:"h-4 w-4 text-muted-foreground"})}),c&&jsx(Ct,{size:"sm",onClick:d,className:"flex-shrink-0"})]})});gb.displayName="Snippet";var Rl=cva("overflow-hidden",{variants:{radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"}},defaultVariants:{radius:"md"}}),bb=Z.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},p)=>{let[f,g]=Z.useState("loading");Z.useEffect(()=>{n&&g("loading");},[n]);let v=()=>{g("loaded"),s?.();},b=()=>{g("error"),i?.();},h={contain:"object-contain",cover:"object-cover",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"}[l];return f==="error"&&o?jsx("div",{className:m(Rl({radius:t}),"flex items-center justify-center bg-muted",e),style:{aspectRatio:c,...d},children:o}):jsxs("div",{className:m(Rl({radius:t}),"relative",e),style:{aspectRatio:c,...d},children:[f==="loading"&&a&&jsx($a,{className:"absolute inset-0 h-full w-full"}),jsx("img",{ref:p,src:n,alt:r,onLoad:v,onError:b,className:m("h-full w-full transition-opacity duration-300",h,f==="loading"?"opacity-0":"opacity-100"),...u})]})});bb.displayName="Image";var $C=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),KC=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-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 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}}),GC=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"}}),UC=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"}}),Hs={"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"),vb=(e,t)=>{if(!e)return "";let n=wl(e.getDate(),2),r=wl(e.getMonth()+1,2),o=wl(e.getFullYear(),4),a=Hs[t],s=Cl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Ps=(e,t)=>{let n=Hs[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},_C=e=>{let t=Hs[e];return Cl[e].map(r=>r==="year"?"####":"##").join(t)},da=(e,t)=>{if(!e?.from)return "";let n=vb(e.from,t),r=e.to?vb(e.to,t):"";return n&&r?`${n} - ${r}`:n},hb=Z.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:p,onChange:f,minDate:g,maxDate:v,dateFormat:b="dd.MM.yyyy",showPickerIcon:h=true,mode:x="text",fullWidth:R=false,numberOfMonths:N=2,align:w="start",isDisabled:y,placeholder:C,id:E,...L},k)=>{let S=Z.useId(),T=E||S,M=`${T}-description`,D=`${T}-error`,[P,I]=Z.useState(p),[H,A]=Z.useState(""),[B,$]=Z.useState(false),[j,G]=Z.useState(false),U=u!==void 0?u:P,W=a&&r,V=_C(b),z=Hs[b],K=" - ";Z.useEffect(()=>{j||A(da(U,b));},[U,b,j]);let Y=F=>{u===void 0&&I(F),f?.(F);},Q=F=>{Y(F),A(da(F,b)),F?.from&&F?.to&&$(false);},J=F=>{let q=F.target.value;q=q.replace(new RegExp(`[^0-9\\${z}\\s-]`,"g"),"");let X=`${V}${K}${V}`,Re=q.replace(new RegExp(`[\\${z}\\s-]`,"g"),""),Te="",ot=0;for(let ue=0;ue<X.length&&ot<Re.length;ue++)X[ue]==="#"?(Te+=Re[ot],ot++):Te+=X[ue];if(A(Te),Te.length===X.length){let ue=Te.split(K);if(ue.length===2){let tt=Ps(ue[0].trim(),b),te=Ps(ue[1].trim(),b);if(tt&&te){if(g&&(tt<g||te<g)||v&&(tt>v||te>v))return;tt<=te&&Y({from:tt,to:te});}}}},Ne=()=>{G(true);},be=()=>{G(false);let F=`${V}${K}${V}`;if(H.length!==F.length)A(da(U,b));else {let q=H.split(K);if(q.length!==2)A(da(U,b));else {let X=Ps(q[0].trim(),b),Re=Ps(q[1].trim(),b);(!X||!Re||X>Re)&&A(da(U,b));}}},_=()=>{y||$(true);},O=()=>{!y&&x==="picker"&&h&&$(true);};return jsxs("div",{className:m($C({size:s}),e),children:[t&&jsxs("label",{htmlFor:T,className:m(UC({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(Pt,{open:h&&B,onOpenChange:$,children:[jsxs(nr,{className:m("relative",R?"w-full":"w-fit"),children:[jsx("input",{ref:k,id:T,type:"text",inputMode:x==="text"?"numeric":void 0,value:H,onChange:x==="text"?J:void 0,onClick:O,onFocus:Ne,onBlur:be,readOnly:x==="picker","aria-invalid":a,"aria-describedby":W?D:n?M:void 0,"aria-required":o,disabled:y,placeholder:C||`${b.toLowerCase()} - ${b.toLowerCase()}`,className:m(KC({size:s,isInvalid:a,fullWidth:R,showPickerIcon:h}),x==="picker"&&h&&"cursor-pointer",l),style:{borderColor:j||h&&B?"var(--color-foreground)":void 0},...L}),h&&jsx("button",{type:"button",onClick:_,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(GC({size:s}))})})]}),h&&jsx(Lt,{className:"w-auto p-0",align:w,children:jsx(lo,{mode:"range",selected:U,onSelect:Q,numberOfMonths:N,disabled:F=>!!(g&&F<g||v&&F>v),defaultMonth:U?.from,showMonthAndYearPickers:true,size:s??"md"})})]}),n&&!W&&jsx("p",{id:M,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),W&&jsx("p",{id:D,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});hb.displayName="DateRangePicker";var ho=e=>String(e).padStart(2,"0"),xb=Z.forwardRef(({value:e,onValueChange:t,placeholder:n="Pick a time",use24Hour:r=true,minuteStep:o=1,isDisabled:a=false,hideNow:s=false,className:i},l)=>{let[c,d]=Z.useState(false),u=Z.useRef(null),p=Z.useRef(null),f=Z.useCallback((C,E)=>{setTimeout(()=>{if(C!==void 0&&u.current){let L=r?C:C%12||12;u.current.querySelector(`[data-hour="${L}"]`)?.scrollIntoView({behavior:"smooth",block:"center"});}E!==void 0&&p.current&&p.current.querySelector(`[data-minute="${E}"]`)?.scrollIntoView({behavior:"smooth",block:"center"});},50);},[r]);Z.useEffect(()=>{c&&e&&f(e.hours,e.minutes);},[c,e,f]);let g=r?Array.from({length:24},(C,E)=>E):Array.from({length:12},(C,E)=>E+1),v=Array.from({length:Math.floor(60/o)},(C,E)=>E*o),b=C=>{if(!C)return n;if(r)return `${ho(C.hours)}:${ho(C.minutes)}`;let E=C.hours%12||12,L=C.hours>=12?"PM":"AM";return `${ho(E)}:${ho(C.minutes)} ${L}`},h=C=>{let E=e?.minutes??0,L=C;if(!r&&e){let k=e.hours>=12;k&&C!==12?L=C+12:!k&&C===12&&(L=0);}t?.({hours:L,minutes:E});},x=C=>{let E=e?.hours??0;t?.({hours:E,minutes:C});},R=C=>{if(!e)return;let E=e.hours;C==="AM"&&e.hours>=12?E=e.hours-12:C==="PM"&&e.hours<12&&(E=e.hours+12),t?.({hours:E,minutes:e.minutes});},N=()=>{let C=new Date,E={hours:C.getHours(),minutes:C.getMinutes()};t?.(E),f(E.hours,E.minutes);},w=e?e.hours>=12?"PM":"AM":void 0,y=e?r?e.hours:e.hours%12||12:void 0;return jsxs(Pt,{open:c,onOpenChange:d,children:[jsxs(tr,{ref:l,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",i),children:[jsx(Clock,{className:"h-4 w-4"}),b(e)]}),jsxs(Lt,{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(ze,{className:"h-[200px]",children:jsx("div",{ref:u,className:"flex flex-col gap-1 p-1",children:g.map(C=>jsx(me,{"data-hour":C,variant:y===C?"solid":"light",size:"sm",radius:"md",className:"h-8 w-12 justify-center",onClick:()=>h(C),children:ho(C)},C))})})]}),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(ze,{className:"h-[200px]",children:jsx("div",{ref:p,className:"flex flex-col gap-1 p-1",children:v.map(C=>jsx(me,{"data-minute":C,variant:e?.minutes===C?"solid":"light",size:"sm",radius:"md",className:"h-8 w-12 justify-center",onClick:()=>x(C),children:ho(C)},C))})})]}),!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(me,{variant:w==="AM"?"solid":"light",size:"sm",radius:"md",className:"h-8 w-12",onClick:()=>R("AM"),children:"AM"}),jsx(me,{variant:w==="PM"?"solid":"light",size:"sm",radius:"md",className:"h-8 w-12",onClick:()=>R("PM"),children:"PM"})]})]})]}),jsxs("div",{className:"flex justify-end gap-2 border-t p-2",children:[!s&&jsx(me,{variant:"light",size:"sm",radius:"md",onClick:N,children:"Now"}),jsx(me,{size:"sm",radius:"md",onClick:()=>d(false),children:"Done"})]})]})]})});xb.displayName="TimePicker";var Ml=cva("",{variants:{variant:{default:"",bordered:"border rounded-lg overflow-hidden"}},defaultVariants:{variant:"default"}}),Tl=cva("flex items-center justify-center py-4",{variants:{size:{sm:"py-2",md:"py-4",lg:"py-6"}},defaultVariants:{size:"md"}}),Rb=Z.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,scrollbarVisibility:p="visible",...f},g)=>{let v=Z.useRef(null),b=Z.useRef(null),h=Z.useRef(false);Z.useImperativeHandle(g,()=>v.current),Z.useEffect(()=>{let N=b.current;if(!N)return;let w=new IntersectionObserver(y=>{let[C]=y;C.isIntersecting&&a&&!s&&!h.current&&(h.current=true,Promise.resolve(o()).finally(()=>{h.current=false;}));},{root:d?null:v.current,rootMargin:c||`${l}px`,threshold:0});return w.observe(N),()=>{w.disconnect();}},[a,s,o,l,c,d]);let x=jsx("div",{className:m(Tl({size:n})),children:jsx(Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),R=jsxs(Fragment,{children:[r,jsx("div",{ref:b,className:"h-px w-full"}),s&&(i||x),!a&&!s&&u&&jsx("div",{className:m(Tl({size:n}),"text-muted-foreground text-sm"),children:u})]});return d?jsx("div",{ref:v,className:m(Ml({variant:t,className:e})),...f,children:R}):jsx(ze,{ref:v,visibility:p,className:m(Ml({variant:t,className:e})),...f,children:R})});Rb.displayName="InfiniteScroll";var aM=e=>e.map(t=>typeof t=="string"?{src:t}:t),Nl=Z.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:p=true,closeOnBackdropClick:f=true,className:g},v)=>{let b=Z.useMemo(()=>aM(e),[e]),[h,x]=Z.useState(r),[R,N]=Z.useState(1),[w,y]=Z.useState(0),[C,E]=Z.useState(false),[L,k]=Z.useState(false),[S,T]=Z.useState({x:0,y:0}),[M,D]=Z.useState({x:0,y:0}),[P,I]=Z.useState(false),H=Z.useRef(null),A=b[h];Z.useEffect(()=>{I(true);},[]),Z.useEffect(()=>{x(r);},[r]),Z.useEffect(()=>{o?.(h);},[h,o]),Z.useEffect(()=>{N(1),y(0),T({x:0,y:0});},[h]),Z.useEffect(()=>{if(t)return cn(),()=>dn()},[t]);let B=Z.useCallback(()=>{x(O=>O>0?O-1:b.length-1);},[b.length]),$=Z.useCallback(()=>{x(O=>O<b.length-1?O+1:0);},[b.length]),j=()=>{N(O=>Math.min(O+.5,4));},G=()=>{N(O=>{let F=Math.max(O-.5,.5);return F===1&&T({x:0,y:0}),F});},U=()=>{y(O=>(O+90)%360);},W=async()=>{if(A)try{let F=await(await fetch(A.src)).blob(),q=URL.createObjectURL(F),X=document.createElement("a");X.href=q,X.download=A.alt||`image-${h+1}`,document.body.appendChild(X),X.click(),document.body.removeChild(X),URL.revokeObjectURL(q);}catch{window.open(A.src,"_blank");}},V=async()=>{if(H.current)if(C)try{await document.exitFullscreen(),E(!1);}catch{}else try{await H.current.requestFullscreen(),E(!0);}catch{}},z=O=>{R>1&&(k(true),D({x:O.clientX-S.x,y:O.clientY-S.y}));},K=O=>{L&&R>1&&T({x:O.clientX-M.x,y:O.clientY-M.y});},Y=()=>{k(false);},Q=()=>{n?.(false);},J=O=>{f&&O.target===O.currentTarget&&Q();},Ne=Z.useCallback(O=>{switch(O.key){case "ArrowLeft":B();break;case "ArrowRight":$();break;case "Escape":n?.(false);break;case "+":case "=":j();break;case "-":G();break}},[B,$,n]);if(Z.useEffect(()=>{if(t)return window.addEventListener("keydown",Ne),()=>window.removeEventListener("keydown",Ne)},[t,Ne]),Z.useEffect(()=>{let O=()=>{E(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",O),()=>document.removeEventListener("fullscreenchange",O)},[]),b.length===0)return null;let be=a?Z.isValidElement(a)?Z.cloneElement(a,{onClick:O=>{a.props.onClick?.(O),n?.(true);}}):jsx("button",{type:"button",onClick:()=>n?.(true),children:a}):null;return jsxs(Fragment,{children:[be,!P||!t?null:Ua.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:J}),jsxs("div",{ref:v,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:[p&&b.length>1&&jsxs("span",{className:"text-sm",children:[h+1," / ",b.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:G,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(R*100),"%"]}),jsx("button",{onClick:j,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:U,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:W,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:V,className:"rounded-full p-2 hover:bg-white/10 transition-colors",title:C?"Exit fullscreen":"Fullscreen",children:C?jsx(Minimize2,{className:"h-5 w-5"}):jsx(Maximize2,{className:"h-5 w-5"})}),jsxs("button",{onClick:Q,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:H,className:"relative flex-1 flex items-center justify-center overflow-hidden",onMouseDown:z,onMouseMove:K,onMouseUp:Y,onMouseLeave:Y,children:[u&&b.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:$,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",L?"cursor-grabbing":R>1?"cursor-grab":""),style:{transform:`translate(${S.x}px, ${S.y}px) scale(${R}) rotate(${w}deg)`},draggable:false})]}),A?.description&&jsx("div",{className:"p-4 text-center text-white text-sm",children:A.description}),s&&b.length>1&&jsx("div",{className:"flex justify-center gap-2 p-4 overflow-x-auto",children:b.map((O,F)=>jsx("button",{onClick:()=>x(F),className:m("h-16 w-16 flex-shrink-0 overflow-hidden rounded border-2 transition-all",h===F?"border-white opacity-100":"border-transparent opacity-50 hover:opacity-75"),children:jsx("img",{src:O.src,alt:O.alt||`Thumbnail ${F+1}`,className:"h-full w-full object-cover"})},F))})]})]}),document.body)]})});Nl.displayName="ImageViewer";var Cb=({children:e,images:t,index:n=0,className:r})=>{let[o,a]=Z.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})]})};Cb.displayName="ImageViewerTrigger";var Mb=cva("inline-flex items-center justify-center font-mono font-medium",{variants:{variant:{default:"rounded border border-border bg-muted text-muted-foreground",light:"text-muted-foreground",bordered:"rounded border border-current text-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"}}),iM={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"},lM={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"},cM=e=>{let t=e.toLowerCase();return iM[t]||e.toUpperCase()},ma=e=>{let t=e.toLowerCase();return lM[t]||t},Is=e=>{let t=ma(e);return ["meta","control","alt","shift"].includes(t)},Tb=Z.forwardRef(({className:e,variant:t,size:n,keys:r,children:o,onPress:a,isDisabled:s,preventDefault:i=true,...l},c)=>{Z.useEffect(()=>{if(!a||!r||s)return;let u=Array.isArray(r)?r:[r],p=u.filter(Is).map(ma),f=u.filter(v=>!Is(v)).map(ma),g=v=>{let b=p.includes("meta")===v.metaKey,h=p.includes("control")===v.ctrlKey,x=p.includes("alt")===v.altKey,R=p.includes("shift")===v.shiftKey,N=f.length===0||f.includes(v.key.toLowerCase());b&&h&&x&&R&&N&&(i&&v.preventDefault(),a(v));};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[r,a,s,i]);let d=()=>r?(Array.isArray(r)?r:[r]).map((p,f)=>jsxs(Z.Fragment,{children:[f>0&&jsx("span",{className:"mx-0.5 text-muted-foreground",children:"+"}),jsx("span",{children:cM(p)})]},f)):o;return jsx("kbd",{ref:c,className:m(Mb({variant:t,size:n}),s&&"opacity-50",e),...l,children:d()})});Tb.displayName="Kbd";function dM(e,t,n={}){let{isDisabled:r=false,preventDefault:o=true}=n;Z.useEffect(()=>{if(r)return;let a=Array.isArray(e)?e:[e],s=a.filter(Is).map(ma),i=a.filter(c=>!Is(c)).map(ma),l=c=>{let d=s.includes("meta")===c.metaKey,u=s.includes("control")===c.ctrlKey,p=s.includes("alt")===c.altKey,f=s.includes("shift")===c.shiftKey,g=i.length===0||i.includes(c.key.toLowerCase());d&&u&&p&&f&&g&&(o&&c.preventDefault(),t(c));};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,t,r,o]);}var Nb=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"}}),kb=Z.forwardRef(({className:e,size:t,value:n,successDuration:r=2e3,onCopySuccess:o,onCopyError:a,copyIcon:s,successIcon:i,...l},c)=>{let[d,u]=Z.useState(false),f={sm:14,md:16,lg:20}[t??"md"],g=async()=>{try{await navigator.clipboard.writeText(n),u(!0),o?.(),setTimeout(()=>{u(!1);},r);}catch(v){a?.(v);}};return jsx("button",{ref:c,type:"button",className:m(Nb({size:t}),e),onClick:g,"aria-label":d?"Copied":"Copy to clipboard",...l,children:d?i??jsx(Check,{className:"text-success",style:{width:f,height:f}}):s??jsx(Copy,{style:{width:f,height:f}})})});kb.displayName="CopyButton";var Eb=cva("flex flex-col bg-background",{variants:{variant:{default:"border",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:""},size:{sm:"text-xs",md:"text-sm",lg:"text-base"},radius:{none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-3xl"}},defaultVariants:{variant:"default",size:"md",radius:"md"}}),hM=[{value:"month",label:"Month"},{value:"week",label:"Week"},{value:"day",label:"Day"}],xM=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],yM=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function RM(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 wM(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 Ro(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function yo(e){return Ro(e,new Date)}function Sb(e,t){return e.filter(n=>{let r=new Date(n.start),o=new Date(n.end);return Ro(r,t)||Ro(o,t)||r<t&&o>t})}var Pb=Z.forwardRef(({className:e,variant:t,size:n,radius:r,events:o=[],view:a="month",onViewChange:s,viewOptions:i=hM,date:l,onDateChange:c,onEventClick:d,onSlotClick:u,weekStartsOn:p=0,locale:f="en-US",...g},v)=>{let[b,h]=Z.useState(new Date),x=l??b,R=T=>{c?c(T):h(T);},N=p===1?yM:xM,w=()=>{let T=new Date(x);a==="month"?T.setMonth(T.getMonth()-1):a==="week"?T.setDate(T.getDate()-7):T.setDate(T.getDate()-1),R(T);},y=()=>{let T=new Date(x);a==="month"?T.setMonth(T.getMonth()+1):a==="week"?T.setDate(T.getDate()+7):T.setDate(T.getDate()+1),R(T);},C=()=>{R(new Date);},E=()=>a==="day"?x.toLocaleDateString(f,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):x.toLocaleDateString(f,{year:"numeric",month:"long"}),L=()=>{let T=RM(x.getFullYear(),x.getMonth(),p);return jsxs("div",{className:"flex-1 flex flex-col",children:[jsx("div",{className:"grid grid-cols-7 border-b",children:N.map(M=>jsx("div",{className:"p-2 text-center font-medium text-muted-foreground",children:M},M))}),jsx("div",{className:"flex-1 grid grid-cols-7 grid-rows-6",children:T.map((M,D)=>{let P=Sb(o,M),I=M.getMonth()===x.getMonth(),H=Ro(M,x);return jsxs("div",{className:m("min-h-[80px] border-b border-r p-1 cursor-pointer hover:bg-accent/50 transition-colors",!I&&"bg-muted/30",H&&"bg-accent"),onClick:()=>u?.(M),children:[jsx("div",{className:m("flex items-center justify-center w-7 h-7 rounded-full text-sm mb-1",yo(M)&&"bg-primary text-primary-foreground",!I&&"text-muted-foreground"),children:M.getDate()}),jsxs("div",{className:"space-y-0.5",children:[P.slice(0,3).map(A=>jsx("div",{className:"text-xs px-1 py-0.5 rounded truncate cursor-pointer hover:opacity-80",style:{backgroundColor:A.color||"hsl(var(--primary))",color:"white"},onClick:B=>{B.stopPropagation(),d?.(A);},children:A.title},A.id)),P.length>3&&jsxs("div",{className:"text-xs text-muted-foreground px-1",children:["+",P.length-3," more"]})]})]},D)})})]})},k=()=>{let T=wM(x,p),M=Array.from({length:24},(D,P)=>P);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"}),T.map((D,P)=>{let I=Ro(D,x);return jsxs("div",{className:m("p-2 text-center border-l cursor-pointer hover:bg-accent/50",yo(D)&&"bg-primary/10",I&&!yo(D)&&"bg-accent"),onClick:()=>u?.(D),children:[jsx("div",{className:"text-xs text-muted-foreground",children:N[P]}),jsx("div",{className:m("text-lg font-semibold",yo(D)&&"text-primary",I&&!yo(D)&&"text-primary"),children:D.getDate()})]},P)})]}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_repeat(7,1fr)]",children:M.map(D=>jsxs(Z.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[D.toString().padStart(2,"0"),":00"]}),T.map((P,I)=>{let H=new Date(P);H.setHours(D,0,0,0);let A=o.filter(B=>{let $=new Date(B.start);return Ro($,P)&&$.getHours()===D});return jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>u?.(H),children:A.map(B=>jsx("div",{className:"absolute inset-x-0.5 top-0.5 text-xs px-1 py-0.5 rounded truncate cursor-pointer",style:{backgroundColor:B.color||"hsl(var(--primary))",color:"white"},onClick:$=>{$.stopPropagation(),d?.(B);},children:B.title},B.id))},I)})]},D))})})]})},S=()=>{let T=Array.from({length:24},(D,P)=>P),M=Sb(o,x);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",yo(x)&&"bg-primary text-primary-foreground"),children:x.getDate()})}),jsx("div",{className:"flex-1 overflow-auto",children:jsx("div",{className:"grid grid-cols-[60px_1fr]",children:T.map(D=>{let P=new Date(x);P.setHours(D,0,0,0);let I=M.filter(H=>new Date(H.start).getHours()===D);return jsxs(Z.Fragment,{children:[jsxs("div",{className:"h-12 text-xs text-muted-foreground text-right pr-2 pt-0 border-b",children:[D.toString().padStart(2,"0"),":00"]}),jsx("div",{className:"h-12 border-b border-l cursor-pointer hover:bg-accent/50 relative",onClick:()=>u?.(P),children:I.map(H=>jsx("div",{className:"absolute inset-x-1 top-0.5 text-xs px-2 py-1 rounded truncate cursor-pointer",style:{backgroundColor:H.color||"hsl(var(--primary))",color:"white"},onClick:A=>{A.stopPropagation(),d?.(H);},children:H.title},H.id))})]},D)})})})]})};return jsxs("div",{ref:v,className:m(Eb({variant:t,size:n,radius:r,className:e})),...g,children:[jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[jsx("h2",{className:"text-lg font-semibold",children:E()}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(me,{variant:"bordered",size:"sm",radius:"md",onClick:C,children:"Today"}),jsx(Ir,{options:i,value:a,onValueChange:T=>s?.(T),size:"sm",radius:"md",className:"w-[120px]"}),jsx(me,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:w,children:jsx(ChevronLeft,{className:"h-4 w-4"})}),jsx(me,{variant:"light",size:"sm",radius:"md",isIconOnly:true,onClick:y,children:jsx(ChevronRight,{className:"h-4 w-4"})})]})]}),a==="month"&&L(),a==="week"&&k(),a==="day"&&S()]})});Pb.displayName="FullCalendar";var Fs=({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))})]}),fa=cva("w-full",{variants:{size:{sm:"h-48",md:"h-64",lg:"h-96"}},defaultVariants:{size:"md"}}),ga=["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%))"],Lb=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=ga,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",curveType:c="monotone",...d},u)=>jsx("div",{ref:u,className:m(fa({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(Fs,{})}),s&&jsx(Legend,{}),r.map((p,f)=>jsx(Line,{type:c,dataKey:p,stroke:o[f%o.length],strokeWidth:2,dot:{fill:o[f%o.length],strokeWidth:0},activeDot:{r:6}},p))]})})}));Lb.displayName="LineChart";var Db=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=ga,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,layout:d="horizontal",...u},p)=>jsx("div",{ref:p,className:m(fa({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(Fs,{})}),s&&jsx(Legend,{}),r.map((f,g)=>jsx(Bar,{dataKey:f,fill:o[g%o.length],stackId:c?"stack":void 0,radius:[4,4,0,0]},f))]})})}));Db.displayName="BarChart";var Hb=Z.forwardRef(({className:e,size:t,data:n,dataKey:r="value",nameKey:o="name",colors:a=ga,innerRadius:s=0,outerRadius:i=80,showLegend:l=true,showTooltip:c=true,showLabels:d=false,...u},p)=>jsx("div",{ref:p,className:m(fa({size:t,className:e})),...u,children:jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxs(PieChart,{children:[c&&jsx(Tooltip,{content:jsx(Fs,{})}),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((f,g)=>jsx(Cell,{fill:a[g%a.length]},`cell-${g}`))})]})})}));Hb.displayName="PieChart";var Ib=Z.forwardRef(({className:e,size:t,data:n,dataKeys:r,colors:o=ga,showGrid:a=true,showLegend:s=true,showTooltip:i=true,xAxisKey:l="name",stacked:c=false,curveType:d="monotone",...u},p)=>jsx("div",{ref:p,className:m(fa({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(Fs,{})}),s&&jsx(Legend,{}),r.map((f,g)=>jsx(Area,{type:d,dataKey:f,stroke:o[g%o.length],fill:o[g%o.length],fillOpacity:.3,stackId:c?"stack":void 0},f))]})})}));Ib.displayName="AreaChart";var Dl={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",full:"rounded-2xl"};function _M({card:e,columnId:t,radius: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("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-sm hover:shadow-md",d&&"opacity-50 scale-[1.02] shadow-lg",Dl[n]),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 Ab({column:e,radius:t,renderCard:n,onCardClick:r,onAddCard:o,showAddCard:a,addCardLabel:s,columnHeight:i}){return jsxs("div",{className:m("flex flex-col min-w-[280px] w-[280px]",Dl[t]),style:{backgroundColor:e.backgroundColor||"transparent"},children:[jsx("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})]})}),jsx(ze,{style:{height:i},className:"flex-1",children:jsxs("div",{className:"p-2 space-y-2",children:[jsx(SortableContext,{items:e.cards.map(l=>l.id),strategy:verticalListSortingStrategy,children:e.cards.map(l=>jsx(_M,{card:l,columnId:e.id,radius:t,renderCard:n,onCardClick:r},l.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"})]})}),a&&jsx("div",{className:"p-2 border-t",children:jsxs(me,{variant:"light",size:"sm",className:"w-full justify-start",onClick:l=>{l.stopPropagation(),l.preventDefault(),o?.(e.id);},children:[jsx(Plus,{className:"h-4 w-4 mr-2"}),s]})})]})}var Ob=Z.forwardRef(({className:e,columns:t,onCardMove:n,onCardClick:r,onAddCard:o,renderCard:a,showAddCard:s=true,addCardLabel:i="Add card",columnHeight:l=500,radius:c="md",...d},u)=>{let[p,f]=Z.useState(false),[g,v]=Z.useState(null),[b,h]=Z.useState(null);Z.useEffect(()=>{f(true);},[]);let x=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates}));if(!p)return jsx("div",{ref:u,className:m("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(C=>jsx(Ab,{column:C,radius:c,renderCard:a,onCardClick:r,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},C.id))});let R=C=>t.find(E=>E.cards.some(L=>L.id===C));return jsxs(DndContext,{sensors:x,collisionDetection:closestCorners,onDragStart:C=>{let{active:E}=C,L=R(E.id);if(L){let k=L.cards.find(S=>S.id===E.id);k&&(v(k),h(L.id));}},onDragOver:C=>{let{active:E,over:L}=C;if(!L)return;let k=E.id,S=L.id,T=R(k),M=R(S)||t.find(I=>I.id===S);if(!T||!M||T.id===M.id)return;let D=M.cards.findIndex(I=>I.id===S),P=D===-1?M.cards.length:D;n?.(k,T.id,M.id,P);},onDragEnd:C=>{let{active:E,over:L}=C;if(L&&E.id!==L.id){let k=R(E.id),S=R(L.id)||t.find(T=>T.id===L.id);if(k&&S){let T=S.cards.findIndex(D=>D.id===L.id),M=T===-1?S.cards.length:T;n?.(E.id,k.id,S.id,M);}}v(null),h(null);},children:[jsx("div",{ref:u,className:m("flex gap-4 overflow-x-auto p-4 bg-muted/30",e),...d,children:t.map(C=>jsx(Ab,{column:C,radius:c,renderCard:a,onCardClick:r,onAddCard:o,showAddCard:s,addCardLabel:i,columnHeight:l},C.id))}),jsx(DragOverlay,{children:g&&b&&jsx("div",{className:m("p-3 cursor-grab active:cursor-grabbing transition-all bg-background border shadow-lg opacity-50 scale-[1.02]",Dl[c]),children:a?a(g,b):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:g.title}),g.description&&jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:g.description})]})]})})})]})});Ob.displayName="KanbanBoard";var Fb=cva("relative",{variants:{variant:{default:"",bordered:"border rounded-lg p-4",cards:"rounded-lg"}},defaultVariants:{variant:"default"}}),Bb=Z.createContext(null);function $s(){let e=Z.useContext(Bb);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}var $b=Z.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,p]=jM({...r,axis:a==="horizontal"?"x":"y"},o),[f,g]=Z.useState(false),[v,b]=Z.useState(false),[h,x]=Z.useState(0),[R,N]=Z.useState([]),w=Z.useCallback(k=>{k&&(x(k.selectedScrollSnap()),g(k.canScrollPrev()),b(k.canScrollNext()));},[]),y=Z.useCallback(()=>{p?.scrollPrev();},[p]),C=Z.useCallback(()=>{p?.scrollNext();},[p]),E=Z.useCallback(k=>{p?.scrollTo(k);},[p]),L=Z.useCallback(k=>{k.key==="ArrowLeft"?(k.preventDefault(),y()):k.key==="ArrowRight"&&(k.preventDefault(),C());},[y,C]);return Z.useEffect(()=>{!p||!l||l(p);},[p,l]),Z.useEffect(()=>{if(p)return N(p.scrollSnapList()),w(p),p.on("reInit",w),p.on("select",w),()=>{p?.off("select",w);}},[p,w]),jsx(Bb.Provider,{value:{carouselRef:u,api:p,scrollPrev:y,scrollNext:C,canScrollPrev:f,canScrollNext:v,selectedIndex:h,scrollSnaps:R,scrollTo:E,orientation:a},children:jsxs("div",{ref:d,className:m(Fb({variant:t,className:e})),onKeyDownCapture:L,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(Hl,{}),jsx(Il,{})]}),i&&R.length>1&&jsx("div",{className:"flex justify-center gap-1.5 mt-4",children:R.map((k,S)=>jsx("button",{className:m("w-2 h-2 rounded-full transition-all",S===h?"bg-primary w-4":"bg-muted-foreground/30 hover:bg-muted-foreground/50"),onClick:()=>E(S),"aria-label":`Go to slide ${S+1}`},S))})]})})});$b.displayName="Carousel";var Kb=Z.forwardRef(({className:e,...t},n)=>jsx("div",{ref:n,className:m("flex",e),...t}));Kb.displayName="CarouselContent";var Gb=Z.forwardRef(({className:e,basis:t="basis-full",...n},r)=>{let{orientation:o}=$s();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})});Gb.displayName="CarouselItem";var Hl=Z.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollPrev:s,canScrollPrev:i}=$s();return jsxs(me,{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),isDisabled:!i,onClick:s,...o,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Previous slide"})]})});Hl.displayName="CarouselPrevious";var Il=Z.forwardRef(({className:e,variant:t="bordered",size:n="sm",isIconOnly:r=true,...o},a)=>{let{scrollNext:s,canScrollNext:i}=$s();return jsxs(me,{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),isDisabled:!i,onClick:s,...o,children:[jsx(ChevronRight,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Next slide"})]})});Il.displayName="CarouselNext";var Ub=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"}}),Ks={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"}},Al={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}"]},_b=Z.forwardRef(({className:e,size:t,onEmojiSelect:n,recentEmojis:r=[],defaultCategory:o="smileys",showSearch:a=true,showCategories:s=true,...i},l)=>{let[c,d]=Z.useState(r.length>0?"recent":o),[u,p]=Z.useState(""),g=u?Object.values(Al).flat().filter(b=>b.toLowerCase().includes(u.toLowerCase())):c==="recent"?r:Al[c]||[],v=b=>{n?.(b);};return jsxs("div",{ref:l,className:m(Ub({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(er,{placeholder:"Search emojis...",value:u,onChange:b=>p(b.target.value),className:"pl-8 h-8"})]})}),s&&!u&&jsx(ze,{orientation:"horizontal",className:"border-b",children:jsx("div",{className:"flex px-1",children:Object.entries(Ks).map(([b,{icon:h}])=>b==="recent"&&r.length===0?null:jsx("button",{className:m("shrink-0 p-2 text-lg hover:bg-accent rounded transition-colors",c===b&&"bg-accent"),onClick:()=>d(b),title:Ks[b].name,children:h},b))})}),!u&&jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-muted-foreground",children:Ks[c].name}),jsx(ze,{className:"flex-1",children:jsxs("div",{className:"grid grid-cols-8 gap-1 p-2",children:[g.map((b,h)=>jsx("button",{className:"w-8 h-8 flex items-center justify-center text-xl hover:bg-accent rounded transition-colors",onClick:()=>v(b),children:b},`${b}-${h}`)),g.length===0&&jsx("div",{className:"col-span-8 py-8 text-center text-muted-foreground text-sm",children:"No emojis found"})]})})]})});_b.displayName="EmojiPicker";var Wb=cva("flex flex-col border rounded-lg bg-background overflow-hidden",{variants:{variant:{default:"",bordered:"border border-zinc-300 dark:border-zinc-700",ghost:"border-none bg-transparent"}},defaultVariants:{variant:"default"}});function sT(e,t,n){return centerCrop(makeAspectCrop({unit:"%",width:90},n,e,t),e,t)}async function jb(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,p=e.naturalWidth/2,f=e.naturalHeight/2;return a.save(),a.translate(-c,-d),a.translate(p,f),a.rotate(u),a.scale(r,r),a.translate(-p,-f),a.drawImage(e,0,0,e.naturalWidth,e.naturalHeight,0,0,e.naturalWidth,e.naturalHeight),a.restore(),new Promise(g=>{o.toBlob(v=>{g(v);},"image/png");})}var Yb=Z.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,...p},f)=>{let g=Z.useRef(null),[v,b]=Z.useState(),[h,x]=Z.useState(),[R,N]=Z.useState(1),[w,y]=Z.useState(0),C=S=>{let{width:T,height:M}=S.currentTarget;if(r){let D=sT(T,M,r);b(D);}else b(u||{unit:"%",x:10,y:10,width:80,height:80});},E=S=>{b(S),o?.(S);},L=async S=>{if(x(S),a&&g.current&&S.width&&S.height){let T=await jb(g.current,S,w,R);a(T);}},k=()=>{y(S=>(S+90)%360);};return Z.useEffect(()=>{h&&g.current&&a&&jb(g.current,h,w,R).then(S=>{a(S);});},[R,w,h,a]),jsxs("div",{ref:f,className:m(Wb({variant:t,className:e})),...p,children:[jsx("div",{className:"flex-1 flex items-center justify-center p-4 bg-muted/30 min-h-[300px]",children:jsx(QM,{crop:v,onChange:E,onComplete:L,aspect:r,circularCrop:d,className:"max-h-[400px]",children:jsx("img",{ref:g,src:n,alt:"Crop preview",crossOrigin:"anonymous",onLoad:C,style:{transform:`scale(${R}) rotate(${w}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(en,{value:[R],onValueChange:([S])=>N(S),min:l,max:c,step:.1,className:"flex-1"}),jsx(ZoomIn,{className:"h-4 w-4 text-muted-foreground"})]}),i&&jsx(me,{variant:"bordered",size:"sm",isIconOnly:true,onClick:k,children:jsx(RotateCw,{className:"h-4 w-4"})})]})]})});Yb.displayName="ImageCropper";var Ol=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"}}),cT={sm:96,md:128,lg:192},qb=Z.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:p=4,logoBackgroundColor:f="white",...g},v)=>{let b=Z.useRef(null),h=o??cT[n??"md"];return Z.useImperativeHandle(v,()=>({download:(x="qrcode.png")=>{let R=b.current?.querySelector("svg");if(!R)return;let N=new XMLSerializer().serializeToString(R),w=document.createElement("canvas"),y=w.getContext("2d"),C=new Image,E=l?32:0;w.width=h+E,w.height=h+E,C.onload=()=>{if(!y)return;y.fillStyle=s==="transparent"?"#ffffff":s,y.fillRect(0,0,w.width,w.height),y.drawImage(C,0,0);let L=document.createElement("a");L.download=x.endsWith(".png")?x:`${x}.png`,L.href=w.toDataURL("image/png"),L.click();},C.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(N)));}})),r?jsx("div",{ref:b,className:m(Ol({variant:t,size:n,className:e})),...g,children:jsxs("div",{className:"relative inline-block",children:[jsx(iT,{value:r,size:h,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:p,backgroundColor:f},children:jsx("img",{src:d,alt:"Logo",style:{width:u,height:u,objectFit:"contain"}})})]})}):jsx("div",{ref:b,className:m(Ol({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:h,height:h},children:"No data"})})});qb.displayName="QRCode";var Gs=({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});Gs.displayName="ThemeProvider";var bT=cva("",{variants:{variant:{default:"",bordered:"",ghost:""},size:{sm:"",md:"",lg:""}},defaultVariants:{variant:"ghost",size:"md"}}),Xb=Z.forwardRef(({className:e,variant:t="ghost",size:n="md",mode:r="dropdown"},o)=>{let{theme:a,setTheme:s,resolvedTheme:i}=useTheme(),[l,c]=Z.useState(false);Z.useEffect(()=>{c(true);},[]);let d=()=>{let u=["light","dark","system"],f=(u.indexOf(a||"system")+1)%u.length;s(u[f]);};return l?r==="cycle"?jsxs(me,{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(Zt,{children:[jsx(Jt,{children:jsxs(me,{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(Qt,{align:"end",children:[jsxs(Et,{onClick:()=>s("light"),children:[jsx(Sun,{className:"mr-2 h-4 w-4"}),"Light"]}),jsxs(Et,{onClick:()=>s("dark"),children:[jsx(Moon,{className:"mr-2 h-4 w-4"}),"Dark"]}),jsxs(Et,{onClick:()=>s("system"),children:[jsx(Monitor,{className:"mr-2 h-4 w-4"}),"System"]})]})]}):jsxs(me,{ref:o,variant:t==="default"?"bordered":t,size:"sm",isIconOnly:true,className:e,isDisabled:true,children:[jsx(Sun,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"Toggle theme"})]})});Xb.displayName="ThemeToggle";var vT={disableAnimation:false,defaultRadius:"md",defaultColor:"default",locale:"en-US",navigate:void 0},Bl=Z.createContext(vT),hT=()=>Z.useContext(Bl),Jb=({children:e,disableAnimation:t=false,defaultRadius:n="md",defaultColor:r="default",locale:o="en-US",navigate:a,defaultTheme:s="system",storageKey:i="reever-ui-theme",enableSystem:l=true,disableTransitionOnChange:c=false,attribute:d="class",forcedTheme:u,themes:p=["light","dark"]})=>{let f=Z.useMemo(()=>({disableAnimation:t,defaultRadius:n,defaultColor:r,locale:o,navigate:a}),[t,n,r,o,a]);return jsx(Bl.Provider,{value:f,children:jsx(Gs,{defaultTheme:s,storageKey:i,enableSystem:l,disableTransitionOnChange:c||t,attribute:d,forcedTheme:u,themes:p,children:e})})};Jb.displayName="ReeverUIProvider";var ev=cva("flex flex-col gap-1.5",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),yT=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-9 py-1.5 text-xs",md:"h-10 py-2 text-sm",lg:"h-11 py-2.5 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}}),RT=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"}}),wT=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"}}),Ys={"dd/MM/yyyy":"/","MM/dd/yyyy":"/","yyyy-MM-dd":"-","dd.MM.yyyy":"."},Kl={"dd/MM/yyyy":["day","month","year"],"MM/dd/yyyy":["month","day","year"],"yyyy-MM-dd":["year","month","day"],"dd.MM.yyyy":["day","month","year"]},$l=(e,t)=>String(e).padStart(t,"0"),_s=(e,t)=>{if(!e)return "";let n=$l(e.getDate(),2),r=$l(e.getMonth()+1,2),o=$l(e.getFullYear(),4),a=Ys[t],s=Kl[t],i={day:n,month:r,year:o};return s.map(l=>i[l]).join(a)},Qb=(e,t)=>{let n=Ys[t],r=e.split(n);if(r.length!==3)return null;let o=Kl[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},CT=e=>{let t=Ys[e];return Kl[e].map(r=>r==="year"?"####":"##").join(t)},tv=Z.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:p,onChange:f,minDate:g,maxDate:v,dateFormat:b="dd.MM.yyyy",showPickerIcon:h=true,mode:x="text",fullWidth:R=false,isDisabled:N,placeholder:w,id:y,...C},E)=>{let L=Z.useId(),k=y||L,S=`${k}-description`,T=`${k}-error`,[M,D]=Z.useState(p??null),[P,I]=Z.useState(""),[H,A]=Z.useState(false),[B,$]=Z.useState(false),j=u!==void 0?u:M,G=a&&r,U=Ys[b],W=CT(b);Z.useEffect(()=>{B||I(_s(j,b));},[j,b,B]);let V=be=>{u===void 0&&D(be),f?.(be);},z=be=>{let _=be??null;V(_),I(_s(_,b)),A(false);},K=be=>{let _=be.target.value;_=_.replace(new RegExp(`[^0-9\\${U}]`,"g"),"");let O=_.replace(new RegExp(`\\${U}`,"g"),""),F="",q=0;for(let X=0;X<W.length&&q<O.length;X++)W[X]==="#"?(F+=O[q],q++):F+=W[X];if(I(F),F.length===W.length){let X=Qb(F,b);if(X){if(g&&X<g||v&&X>v)return;V(X);}}},Y=()=>{$(true);},Q=()=>{$(false),P.length!==W.length?I(_s(j,b)):Qb(P,b)||I(_s(j,b));},J=()=>{N||A(true);},Ne=()=>{!N&&x==="picker"&&h&&A(true);};return jsxs("div",{className:m(ev({size:s}),e),children:[t&&jsxs("label",{htmlFor:k,className:m(wT({size:s}),i),children:[t,o&&jsx("span",{className:"text-danger ml-0.5","aria-hidden":"true",children:"*"})]}),jsxs(Pt,{open:h&&H,onOpenChange:A,children:[jsxs(nr,{className:m("relative",R?"w-full":"w-fit"),children:[jsx("input",{ref:E,id:k,type:"text",inputMode:x==="text"?"numeric":void 0,value:P,onChange:x==="text"?K:void 0,onClick:Ne,onFocus:Y,onBlur:Q,readOnly:x==="picker","aria-invalid":a,"aria-describedby":G?T:n?S:void 0,"aria-required":o,disabled:N,placeholder:w||b.toLowerCase(),className:m(yT({size:s,isInvalid:a,fullWidth:R,showPickerIcon:h}),x==="picker"&&h&&"cursor-pointer",l),style:{borderColor:B||h&&H?"var(--color-foreground)":void 0},...C}),h&&jsx("button",{type:"button",onClick:J,disabled:N,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(RT({size:s}))})})]}),h&&jsx(Lt,{className:"w-auto p-0",align:"start",children:jsx(lo,{mode:"single",selected:j??void 0,onSelect:z,disabled:be=>!!(g&&be<g||v&&be>v),defaultMonth:j??void 0,showMonthAndYearPickers:true,size:s??"md"})})]}),n&&!G&&jsx("p",{id:S,className:m("text-muted-foreground",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",c),children:n}),G&&jsx("p",{id:T,role:"alert",className:m("text-danger",s==="sm"?"text-xs":s==="lg"?"text-sm":"text-xs",d),children:r})]})});tv.displayName="DatePicker";var rv=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"}}),ov=Z.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},p)=>{let f=s&&s<a.length?a.slice(0,s):a,g=s&&s<a.length?a.slice(s):[],v={sm:"h-8 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-4 text-base"}[r??"md"],b={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"}[r??"md"],h={sm:"h-4 w-4",md:"h-4 w-4",lg:"h-5 w-5"}[r??"md"],x=(N,w)=>{w&&w(),l&&l(N);},R=N=>jsxs("button",{type:"button",disabled:i||N.isDisabled,onClick:()=>x(N.key,N.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?v:b),"aria-label":N.label,children:[N.icon&&jsx("span",{className:h,children:N.icon}),c&&jsx("span",{children:N.label})]},N.key);return jsxs("div",{ref:p,role:"group",className:m(rv({variant:t,orientation:n,size:r,density:o,className:e})),...u,children:[f.map(N=>d?d(N):R(N)),g.length>0&&jsxs(Zt,{children:[jsx(Jt,{"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",b),children:jsx(MoreHorizontal,{className:h})}),jsx(Qt,{align:"end",children:g.map(N=>jsxs(Et,{isDisabled:N.isDisabled,onClick:()=>x(N.key,N.onPress),children:[N.icon&&jsx("span",{className:m(h,"mr-2"),children:N.icon}),N.label]},N.key))})]})]})});ov.displayName="ActionGroup";var av=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"}}),sv=Z.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(av({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(Ct,{size:"sm",onClick:a,"aria-label":"Close action bar"})]})]})});sv.displayName="ActionBar";var iv=Z.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]}));iv.displayName="ActionBarButton";var lv=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"}}),ST=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"}}),ET=cva("block rounded-full border-2 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"},color:{primary:"border-primary",success:"border-green-500",warning:"border-yellow-500",danger:"border-red-500",custom:""}},defaultVariants:{size:"md",color:"primary"}}),cv=Z.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,isDisabled:d=false,showLabels:u=false,formatLabel:p=h=>String(h),trackColor:f="primary",name:g,...v},b)=>{let[h,x]=Z.useState(o),R=r!==void 0,N=R?r:h,w=Z.useRef(null),[y,C]=Z.useState(false),[E,L]=Z.useState(null),k=(V,z)=>{if(!w.current)return N[0];let K=w.current.getBoundingClientRect(),Y;t==="horizontal"?Y=(V-K.left)/K.width:Y=1-(z-K.top)/K.height,Y=Math.max(0,Math.min(1,Y));let Q=i+Y*(l-i),J=Math.round(Q/c)*c;return Math.max(i,Math.min(l,J))},S=(V,z)=>{let K=[...N];K[z]=V,z===0&&V>N[1]&&(K[0]=N[1]),z===1&&V<N[0]&&(K[1]=N[0]),R||x(K),a?.(K);},T=(V,z)=>{d||(V.preventDefault(),C(true),L(z),V.target.setPointerCapture(V.pointerId));},M=V=>{if(!y||E===null||d)return;let z=k(V.clientX,V.clientY);S(z,E);},D=()=>{y&&(C(false),L(null),s?.(N));},P=V=>{if(d)return;let z=k(V.clientX,V.clientY),K=Math.abs(N[0]-z),Y=Math.abs(N[1]-z),Q=K<=Y?0:1;S(z,Q);let J=[...N];J[Q]=z,s?.(J);},I=(V,z)=>{if(d)return;let K=N[z];switch(V.key){case "ArrowRight":case "ArrowUp":V.preventDefault(),K=Math.min(l,N[z]+c);break;case "ArrowLeft":case "ArrowDown":V.preventDefault(),K=Math.max(i,N[z]-c);break;case "Home":V.preventDefault(),K=i;break;case "End":V.preventDefault(),K=l;break;default:return}S(K,z);let Y=[...N];Y[z]=K,s?.(Y);},H=V=>(V-i)/(l-i)*100,A={primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"},B=!(f in A),$=B?"":A[f],j=B?{backgroundColor:f}:void 0,G=B?{borderColor:f}:void 0,U=B?"custom":f,W={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:p(N[0])}),jsx("span",{children:p(N[1])})]}),jsxs("div",{ref:b,className:m(lv({orientation:t,size:n}),d&&"opacity-50 pointer-events-none",e),...v,children:[jsx("div",{ref:w,className:m(ST({orientation:t,size:n})),onClick:P,children:jsx("div",{className:m("absolute rounded-full",$,{"h-full":t==="horizontal","w-full":t==="vertical"}),style:t==="horizontal"?{left:`${H(N[0])}%`,right:`${100-H(N[1])}%`,top:0,bottom:0,...j}:{bottom:`${H(N[0])}%`,top:`${100-H(N[1])}%`,left:0,right:0,...j}})}),N.map((V,z)=>jsx("div",{role:"slider",tabIndex:d?-1:0,"aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":V,"aria-orientation":t||void 0,"aria-disabled":d,className:m(ET({size:n,color:U}),y&&E===z&&"cursor-grabbing"),style:t==="horizontal"?{position:"absolute",left:`calc(${H(V)}% - ${W/2}px)`,top:"50%",transform:"translateY(-50%)",...G}:{position:"absolute",bottom:`calc(${H(V)}% - ${W/2}px)`,left:"50%",transform:"translateX(-50%)",...G},onPointerDown:K=>T(K,z),onPointerMove:M,onPointerUp:D,onPointerCancel:D,onKeyDown:K=>I(K,z)},z)),g&&jsxs(Fragment,{children:[jsx("input",{type:"hidden",name:`${g}[0]`,value:N[0]}),jsx("input",{type:"hidden",name:`${g}[1]`,value:N[1]})]})]})]})});cv.displayName="RangeSlider";var Wl=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"}}),IT=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"}}),VT={help:HelpCircle,info:Info,warning:AlertCircle},mv=Z.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:p},f)=>{let[g,v]=Z.useState(false),[b,h]=Z.useState(false),[x,R]=Z.useState({top:0,left:0}),N=Z.useRef(null),w=Z.useRef(null),y=i!==void 0?i:g,C=Z.useCallback(S=>{i===void 0&&v(S),l?.(S);},[i,l]);Z.useEffect(()=>{h(true);},[]),Z.useEffect(()=>{if(!y||!N.current)return;let S=()=>{let T=N.current.getBoundingClientRect(),M=w.current?.getBoundingClientRect(),D=M?.width||288,P=M?.height||100,I=8,H=0,A=0;switch(a){case "top":H=T.top-P-I,A=T.left+T.width/2-D/2;break;case "bottom":H=T.bottom+I,A=T.left+T.width/2-D/2;break;case "left":H=T.top+T.height/2-P/2,A=T.left-D-I;break;case "right":H=T.top+T.height/2-P/2,A=T.right+I;break}if(a==="top"||a==="bottom")switch(s){case "start":A=T.left;break;case "center":A=T.left+T.width/2-D/2;break;case "end":A=T.right-D;break}if(a==="left"||a==="right")switch(s){case "start":H=T.top;break;case "center":H=T.top+T.height/2-P/2;break;case "end":H=T.bottom-P;break}A=Math.max(8,Math.min(A,window.innerWidth-D-8)),H=Math.max(8,Math.min(H,window.innerHeight-P-8)),R({top:H,left:A});};return S(),requestAnimationFrame(S),window.addEventListener("resize",S),window.addEventListener("scroll",S,true),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",S,true);}},[y,a,s]),Z.useEffect(()=>{if(!y)return;let S=T=>{w.current&&!w.current.contains(T.target)&&N.current&&!N.current.contains(T.target)&&C(false);};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[y,C]),Z.useEffect(()=>{if(!y)return;let S=T=>{T.key==="Escape"&&C(false);};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[y,C]);let E=VT[e??"help"],L=()=>{C(!y);},k=()=>{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?Z.isValidElement(o)?Z.cloneElement(o,{ref:N,onClick:S=>{o.props.onClick?.(S),L();}}):jsx("button",{ref:N,type:"button",onClick:L,className:m(Wl({variant:e,size:t}),u),"aria-label":"Help",children:o}):jsx("button",{ref:S=>{N.current=S,typeof f=="function"?f(S):f&&(f.current=S);},type:"button",onClick:L,className:m(Wl({variant:e,size:t}),u),"aria-label":"Help",children:jsx(E,{className:"h-full w-full"})}),b&&y&&Ua.createPortal(jsxs("div",{ref:w,className:m(IT({size:t}),p),style:{position:"fixed",top:x.top,left:x.left,transformOrigin:k()},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)]})});mv.displayName="ContextualHelp";var gv=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"}}),bv=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 vv({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,...p}){let[f,g]=Z.useState(new Set),v=Z.useMemo(()=>o?o instanceof Set?o:new Set(o):f,[o,f]),b=h=>{if(a==="none")return;let x;a==="single"?x=v.has(h)?new Set:new Set([h]):(x=new Set(v),x.has(h)?x.delete(h):x.add(h)),o||g(x),s?.(x);};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(gv({columns:t,gap:n,className:e})),...p,children:r.map(h=>{let x=v.has(h.key);return d?jsx("div",{role:"gridcell","aria-selected":x,onClick:()=>b(h.key),children:d(h,x)},h.key):jsxs("div",{role:"gridcell","aria-selected":x,"aria-disabled":h.isDisabled,onClick:()=>!h.isDisabled&&b(h.key),className:m(bv({variant:l,size:c,isSelected:x,isDisabled:h.isDisabled})),children:[i&&a!=="none"&&x&&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"})}),h.thumbnail&&jsx("div",{className:"mb-2 aspect-square w-full overflow-hidden rounded-md bg-muted",children:h.thumbnail}),jsxs("div",{className:"min-w-0",children:[jsx("div",{className:"truncate font-medium",children:h.label}),h.description&&jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:h.description})]})]},h.key)})})}vv.displayName="GridList";var hv=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"}}),Yl=(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)]},FT=(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]},BT=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},$T=(e,t,n)=>"#"+[e,t,n].map(r=>r.toString(16).padStart(2,"0")).join(""),xv=Z.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},p)=>{let f=Z.useRef(null),[g,v]=Z.useState(false),b=Z.useCallback($=>{let j=BT($);return j?FT(...j):[0,1,1]},[]),[h,x]=Z.useState(()=>b(r||o)),R=e??h[0],N=t??h[1],w=n??h[2];Z.useEffect(()=>{if(r){let $=b(r);x($);}},[r,b]);let y=Z.useCallback(($,j)=>{if(l||!f.current)return;let G=f.current.getBoundingClientRect(),U=Math.max(0,Math.min(1,($-G.left)/G.width)),W=Math.max(0,Math.min(1,(j-G.top)/G.height)),V=U,z=1-W;t===void 0&&n===void 0&&x([R,V,z]),a?.({hue:R,saturation:V,brightness:z});let K=Yl(R,V,z);s?.($T(...K));},[l,R,t,n,a,s]),C=$=>{l||($.preventDefault(),v(true),$.target.setPointerCapture($.pointerId),y($.clientX,$.clientY));},E=$=>{g&&y($.clientX,$.clientY);},L=$=>{v(false),$.target.releasePointerCapture($.pointerId);},[k,S,T]=Yl(R,1,1),M=`rgb(${k}, ${S}, ${T})`,D=N*100,P=(1-w)*100,[I,H,A]=Yl(R,N,w),B=`rgb(${I}, ${H}, ${A})`;return jsx("div",{ref:p,className:m(hv({size:i}),l&&"cursor-not-allowed opacity-50",d),...u,children:jsxs("div",{ref:f,className:"absolute inset-0",style:{backgroundColor:M},onPointerDown:C,onPointerMove:E,onPointerUp:L,onPointerLeave:L,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(${D}% - ${c/2}px)`,top:`calc(${P}% - ${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)"}})]})})});xv.displayName="ColorArea";var Rv=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"}}),UT=`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")`,yv="linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)",wv=Z.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},p)=>{let f=Z.useRef(null),[g,v]=Z.useState(false),b=()=>{switch(r){case "hue":return 0;case "alpha":case "saturation":case "brightness":return 1;default:return 0}},[h,x]=Z.useState(t??b()),R=e??h,N=r==="hue"?R/360:R,w=Z.useCallback((M,D)=>{if(i||!f.current)return;let P=f.current.getBoundingClientRect(),I=a!=="vertical",H;I?H=Math.max(0,Math.min(1,(M-P.left)/P.width)):H=Math.max(0,Math.min(1,1-(D-P.top)/P.height));let A=r==="hue"?H*360:H;e===void 0&&x(A),n?.(A);},[i,a,r,e,n]),y=M=>{i||(M.preventDefault(),v(true),M.target.setPointerCapture(M.pointerId),w(M.clientX,M.clientY));},C=M=>{g&&w(M.clientX,M.clientY);},E=M=>{v(false),M.target.releasePointerCapture(M.pointerId);},L=()=>{let M=a!=="vertical",D=M?"to right":"to top";switch(r){case "hue":return M?yv:"linear-gradient(to top, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)";case "alpha":return `linear-gradient(${D}, transparent, ${o})`;case "saturation":return `linear-gradient(${D}, #808080, ${o})`;case "brightness":return `linear-gradient(${D}, #000000, ${o})`;default:return yv}},k=()=>r==="hue"?`hsl(${R}, 100%, 50%)`:o,S=a!=="vertical",T=N*100;return jsx("div",{ref:p,className:m(Rv({orientation:a,size:s}),i&&"cursor-not-allowed opacity-50",d),...u,children:jsxs("div",{ref:f,className:m("absolute inset-0 rounded-full overflow-hidden",c&&"border border-input"),style:{backgroundImage:r==="alpha"?UT:void 0,backgroundSize:r==="alpha"?"8px 8px":void 0},onPointerDown:y,onPointerMove:C,onPointerUp:E,onPointerLeave:E,children:[jsx("div",{className:"absolute inset-0 rounded-full",style:{background:L()}}),jsx("div",{className:"absolute rounded-full border-2 border-white shadow-md pointer-events-none",style:{width:l,height:l,...S?{left:`calc(${T}% - ${l/2}px)`,top:"50%",transform:"translateY(-50%)"}:{bottom:`calc(${T}% - ${l/2}px)`,left:"50%",transform:"translateX(-50%)"},backgroundColor:k(),boxShadow:"0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2)"}})]})})});wv.displayName="ColorSlider";var Cv=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"}}),WT=(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},Mv=Z.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=Z.useRef(null),[p,f]=Z.useState(false),[g,v]=Z.useState(t),b=e??g,h=Z.useCallback((y,C)=>{if(o||!u.current)return;let E=u.current.getBoundingClientRect(),L=E.width/2,k=y-E.left,S=C-E.top,T=WT(k,S,L);e===void 0&&v(T),n?.(T);},[o,e,n]),x=y=>{o||(y.preventDefault(),f(true),y.target.setPointerCapture(y.pointerId),h(y.clientX,y.clientY));},R=y=>{p&&h(y.clientX,y.clientY);},N=y=>{f(false),y.target.releasePointerCapture(y.pointerId);},w=()=>{let y=[];for(let C=0;C<=360;C+=30)y.push(`hsl(${C}, 100%, 50%) ${C}deg`);return `conic-gradient(from 270deg, ${y.join(", ")})`};return jsx("div",{ref:d,className:m(Cv({size:r}),o&&"cursor-not-allowed opacity-50",l),...c,children:jsxs("div",{ref:u,className:"absolute inset-0 rounded-full",style:{background:w()},onPointerDown:x,onPointerMove:R,onPointerUp:N,onPointerLeave:N,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(YT,{hue:b,innerRadius:a,thumbSize:s})]})})});Mv.displayName="ColorWheel";var YT=({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 Tv={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"})},Sv=Z.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[p,f]=Z.useState(""),g=Z.useRef(null),[v,b]=Z.useState(false);Z.useEffect(()=>{b(true);},[]),Z.useEffect(()=>{e||f("");},[e]),Z.useEffect(()=>{if(!e)return;let y=C=>{C.key==="Escape"&&t?.(false);};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,t]),Z.useEffect(()=>{if(e)return cn(),()=>dn()},[e]);let h=Z.useMemo(()=>{let y={};return n.forEach(C=>{let E=C.category||"Results";y[E]||(y[E]=[]),y[E].push(C);}),y},[n]),x=y=>{y.onSelect?.(),c?.(y),t?.(false);},R=()=>{t?.(false);},N=p.length>0,w=!N&&r.length>0;return !v||!e?null:Ua.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:R}),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:p,onValueChange:f,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"}),p&&jsx("button",{type:"button",onClick:()=>f(""),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:[w&&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:()=>x(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||Tv[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((C,E)=>jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 text-xs font-medium",children:C},E))})]},y.id))]}),N&&Object.entries(h).map(([y,C])=>jsxs(Command.Group,{heading:y,children:[jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:y}),C.map(E=>jsxs(Command.Item,{value:`${E.label} ${E.keywords?.join(" ")||""}`,onSelect:()=>x(E),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:E.icon||Tv[y]||jsx(File,{className:"h-4 w-4"})}),jsxs("div",{className:"flex-1 overflow-hidden",children:[jsx("div",{className:"truncate font-medium",children:E.label}),E.description&&jsx("div",{className:"truncate text-xs text-muted-foreground",children:E.description})]}),jsx(ArrowRight,{className:"h-4 w-4 text-muted-foreground opacity-0 group-aria-selected:opacity-100"})]},E.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)});Sv.displayName="SpotlightSearch";function rN(e="k"){let[t,n]=Z.useState(false);return Z.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 Ev=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"}}),dN={default:Info,success:CheckCircle2,warning:AlertTriangle,error:AlertCircle},Pv=Z.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:p,...f},g)=>{let[v,b]=Z.useState(true),[h,x]=Z.useState(false);Z.useEffect(()=>{u&&localStorage.getItem(`banner-${u}`)==="true"&&b(false);},[u]),Z.useEffect(()=>{if(d&&v){let y=setTimeout(()=>{R();},d);return ()=>clearTimeout(y)}},[d,v]);let R=()=>{x(true),setTimeout(()=>{b(false),u&&localStorage.setItem(`banner-${u}`,"true"),s?.();},200);};if(!v)return null;let N=dN[t],w=r?o!==void 0?o:N?jsx(N,{className:"h-4 w-4"}):null:null;return jsxs("div",{ref:g,className:m(Ev({variant:n,type:t,position:l}),c&&"animate-pulse",h&&"animate-out fade-out slide-out-to-top duration-200",p),role:"banner",...f,children:[w&&jsx("span",{className:"shrink-0",children:w}),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:R,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"})})]})});Pv.displayName="Banner";var ha=cva("inline-flex items-center justify-center rounded-full shadow-lg transition-all 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",{variants:{variant:{solid:"bg-primary text-primary-foreground hover:bg-primary/90",bordered:"border border-zinc-300 dark:border-zinc-700 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 border-zinc-300 dark:border-zinc-700 bg-transparent text-primary hover:bg-primary hover:text-primary-foreground hover:border-primary"},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"}}),pN=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"}}),Jl=Z.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:p,onClick:f,disabled:g,...v},b)=>{let[h,x]=Z.useState(false),R=o&&o.length>0,N=L=>{R&&x(!h),f?.(L);},w=L=>{L.onClick?.(),x(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:""}},C=l==="rotate"&&h?"rotate-45":"",E=l==="scale"&&h?"scale-0":"scale-100";return jsxs("div",{className:m("relative z-50",u!=="relative"&&u&&ha({position:u})),children:[R&&h&&jsx("div",{className:m("absolute left-1/2 -translate-x-1/2 flex items-center",y[a].container),children:o.map((L,k)=>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:`${k*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:L.label}),L.href?jsx("a",{href:L.href,className:m(ha({variant:L.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":L.label,children:L.icon}):jsx("button",{type:"button",onClick:()=>w(L),className:m(ha({variant:L.variant||"flat",size:d==="lg"?"md":"sm",position:"relative"}),"[&>svg]:h-5 [&>svg]:w-5"),"aria-label":L.label,children:L.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:L.label})]},L.id))}),jsxs("button",{ref:b,type:"button",onClick:N,disabled:g,className:m(ha({variant:c,size:d,position:"relative"}),n&&"w-auto px-6 gap-2",p),"aria-label":t,"aria-expanded":R?h:void 0,...v,children:[h&&i?i:jsx("span",{className:m(pN({size:d}),C,E,"transition-all duration-200"),children:e||jsx(Plus,{})}),n&&r&&jsx("span",{className:"font-medium",children:r})]}),R&&h&&jsx("div",{className:"fixed inset-0 -z-10",onClick:()=>x(false)})]})});Jl.displayName="FloatingActionButton";var fN=Jl;var Vv=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"}}),Dv=cva("flex flex-1 flex-col items-center justify-center gap-1 transition-colors cursor-pointer",{variants:{variant:{default:"",elevated:"",filled:""}},defaultVariants:{variant:"default"}}),Av=Z.forwardRef(({className:e,variant:t,size:n,items:r,value:o,defaultValue:a,onValueChange:s,showLabels:i="all",renderItem:l,...c},d)=>{let[u,p]=Z.useState(a||r[0]?.key),f=o!==void 0,g=f?o:u,v=R=>{R.isDisabled||(f||p(R.key),s?.(R.key));},b=R=>t==="filled"?R?"text-primary-foreground":"text-primary-foreground/60 hover:text-primary-foreground/80":R?"text-primary":"text-muted-foreground hover:text-foreground",h=()=>{switch(n){case "sm":return "h-5 w-5";case "lg":return "h-7 w-7";default:return "h-6 w-6"}},x=()=>{switch(n){case "sm":return "text-[10px]";case "lg":return "text-sm";default:return "text-xs"}};return jsx("nav",{ref:d,className:m(Vv({variant:t,size:n}),e),role:"navigation","aria-label":"Bottom navigation",...c,children:r.map(R=>{let N=g===R.key,w=i==="all"||i==="active"&&N,y=N&&R.activeIcon?R.activeIcon:R.icon;if(l)return jsx("div",{onClick:()=>v(R),className:m(Dv({variant:t}),R.isDisabled&&"opacity-50 cursor-not-allowed"),children:l(R,N)},R.key);let C=jsxs("div",{onClick:()=>!R.href&&v(R),className:m(Dv({variant:t}),b(N),R.isDisabled&&"opacity-50 cursor-not-allowed"),role:"button","aria-current":N?"page":void 0,"aria-disabled":R.isDisabled,tabIndex:R.isDisabled?-1:0,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),v(R));},children:[jsxs("div",{className:"relative",children:[jsx("span",{className:m(h(),"[&>svg]:h-full [&>svg]:w-full"),children:y}),R.badge!==void 0&&R.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:R.badge>99?"99+":R.badge}),R.showDot&&jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-red-500"})]}),w&&R.label&&jsx("span",{className:m(x(),"font-medium truncate max-w-full px-1"),children:R.label})]},R.key);return R.href&&!R.isDisabled?jsx("a",{href:R.href,onClick:()=>v(R),className:m("flex flex-1 flex-col items-center justify-center gap-1 no-underline",b(N)),children:C},R.key):C})})});Av.displayName="BottomNavigation";var bN="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",Ov=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",danger:"text-danger hover:bg-danger/10"}},defaultVariants:{variant:"default"}}),Fv=Z.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},p)=>{let f=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:p,className:bN,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:()=>f(g),className:m(Ov({variant:g.isDestructive?"danger":"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})})})]})]})]})});Fv.displayName="ActionSheet";var $v=cva("relative overflow-hidden touch-pan-y",{variants:{variant:{default:"",card:"rounded-lg border bg-card"}},defaultVariants:{variant:"default"}}),ec=cva("flex h-full items-center justify-center px-4 text-white font-medium transition-opacity",{variants:{variant:{primary:"bg-primary",success:"bg-green-500",warning:"bg-yellow-500",danger:"bg-red-500"},size:{sm:"min-w-16",md:"min-w-20",lg:"min-w-24"}},defaultVariants:{variant:"primary",size:"md"}}),Kv=Z.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 p=Z.useRef(null),[f,g]=Z.useState(0),[v,b]=Z.useState(false),h=Z.useRef(0),x=Z.useRef(0),R=n.length*(o==="sm"?64:o==="lg"?96:80),N=r.length*(o==="sm"?64:o==="lg"?96:80),w=k=>{i||(b(true),h.current=k.touches[0].clientX,x.current=f);},y=k=>{if(!v||i)return;let T=k.touches[0].clientX-h.current,M=x.current+T;(M>0&&n.length===0||M<0&&r.length===0)&&(M=0),M>R?M=R+(M-R)*.3:M<-N&&(M=-N+(M+N)*.3),g(M);},C=()=>{if(!v)return;b(false);let k=p.current?.offsetWidth||0,S=Math.abs(f)/k;if(l&&S>.6){l==="right"&&f>0&&n[0]?(n[0].onAction?.(),s?.("right",n[0].key)):l==="left"&&f<0&&r[0]&&(r[0].onAction?.(),s?.("left",r[0].key)),g(0);return}f>R*a&&n.length>0?(g(R),s?.("right")):f<-N*a&&r.length>0?(g(-N),s?.("left")):g(0);},E=(k,S)=>{k.onAction?.(),s?.(S,k.key),g(0);},L=()=>{g(0);};return jsxs("div",{ref:u,className:m($v({variant:t,className:e})),...d,children:[n.length>0&&f>0&&jsx("div",{className:"absolute left-0 top-0 bottom-0 flex",style:{width:R},children:n.map(k=>jsxs("button",{type:"button",onClick:()=>E(k,"right"),className:m(ec({variant:k.variant,size:o})),style:{opacity:Math.min(1,f/R)},children:[k.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:k.icon}),!k.icon&&k.label]},k.key))}),r.length>0&&f<0&&jsx("div",{className:"absolute right-0 top-0 bottom-0 flex",style:{width:N},children:r.map(k=>jsxs("button",{type:"button",onClick:()=>E(k,"left"),className:m(ec({variant:k.variant,size:o})),style:{opacity:Math.min(1,Math.abs(f)/N)},children:[k.icon&&jsx("span",{className:"h-5 w-5 [&>svg]:h-full [&>svg]:w-full",children:k.icon}),!k.icon&&k.label]},k.key))}),jsx("div",{ref:p,className:m("relative bg-background",v?"":"transition-transform duration-200"),style:{transform:`translateX(${f}px)`},onTouchStart:w,onTouchMove:y,onTouchEnd:C,onClick:f!==0?L:void 0,children:c})]})});Kv.displayName="SwipeActions";var Uv=cva("relative overflow-hidden",{variants:{variant:{default:"",contained:"h-full"}},defaultVariants:{variant:"default"}}),xN=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"}}),_v=Z.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:p,...f},g)=>{let v=Z.useRef(null),[b,h]=Z.useState(0),[x,R]=Z.useState("idle"),N=Z.useRef(0),w=Z.useRef(false),y=()=>l||x==="refreshing"?false:(v.current?.scrollTop??window.scrollY)<=0,C=T=>{y()&&(N.current=T.touches[0].clientY,w.current=true);},E=T=>{if(!w.current||!y())return;let D=T.touches[0].clientY-N.current;if(D<0){h(0),R("idle");return}let I=Math.min(D*.5,o);h(I),R(I>=r?"ready":"pulling");},L=async()=>{if(w.current)if(w.current=false,x==="ready"){R("refreshing"),h(r*.6);try{await n();}finally{R("idle"),h(0);}}else R("idle"),h(0);},k={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[i],S=()=>{if(x==="refreshing")return a||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(Loader2,{className:m(k,"animate-spin text-primary")}),jsx("span",{className:"text-xs text-muted-foreground",children:u})]});let T=Math.min(b/r*180,180);return s||jsxs("div",{className:"flex flex-col items-center gap-1",children:[jsx(ArrowDown,{className:m(k,"text-muted-foreground transition-transform"),style:{transform:`rotate(${T}deg)`}}),jsx("span",{className:"text-xs text-muted-foreground",children:x==="ready"?d:c})]})};return jsxs("div",{ref:g,className:m(Uv({variant:t,className:e})),...f,children:[jsx("div",{className:m(xN({size:i}),"z-10",x==="idle"&&b===0&&"opacity-0"),style:{top:Math.max(b-60,-60),opacity:Math.min(b/(r*.5),1)},children:S()}),jsx("div",{ref:v,className:m("transition-transform duration-200",x==="refreshing"&&"ease-out"),style:{transform:`translateY(${b}px)`,transition:w.current?"none":void 0},onTouchStart:C,onTouchMove:E,onTouchEnd:L,children:p})]})});_v.displayName="PullToRefresh";var Xr=(e,t,n)=>({duration:e,delay:t,ease:n||[.4,0,.2,1]}),yN={hidden:e=>({opacity:e}),visible:{opacity:1},exit:e=>({opacity:e})},jv=Z.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:yN,custom:i,transition:Xr(n,r,o),className:m(a),onAnimationStart:l,onAnimationComplete:c,children:t});return s?jsx(AnimatePresence,{children:e&&u}):u});jv.displayName="Fade";var RN=(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]}}},Wv=Z.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 p=Z.useMemo(()=>RN(i,l),[i,l]),f=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:p,transition:Xr(n,r,o),className:m(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});Wv.displayName="Slide";var wN={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"},CN={hidden:e=>({opacity:0,scale:e}),visible:{opacity:1,scale:1},exit:e=>({opacity:0,scale:e})},Yv=Z.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 p=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:CN,custom:i,transition:Xr(n,r,o),className:m(a),style:{transformOrigin:wN[l]},onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&p}):p});Yv.displayName="Scale";var qv=Z.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 p=s?"width":"height",f={hidden:{[p]:i,opacity:l?0:1},visible:{[p]:"auto",opacity:1},exit:{[p]: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:Xr(n,r,o),className:m("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});qv.displayName="Collapse";var Xv=Z.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 p={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:p,transition:Xr(n,r,o),className:m("overflow-hidden",a),onAnimationStart:c,onAnimationComplete:d,children:t})})});Xv.displayName="Expand";var Zv=Z.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 p={hidden:{opacity:0,rotate:i},visible:{opacity:1,rotate:l},exit:{opacity:0,rotate:i}},f=jsx(motion.div,{ref:u,initial:"hidden",animate:e?"visible":"hidden",exit:s?"exit":void 0,variants:p,transition:Xr(n,r,o),className:m(a),onAnimationStart:c,onAnimationComplete:d,children:t});return s?jsx(AnimatePresence,{children:e&&f}):f});Zv.displayName="Rotate";var Jv=Z.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:Xr(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})]})})});Jv.displayName="Flip";var Qv=Z.forwardRef(({color:e="currentColor",duration:t=.6,children:n,className:r,disabled:o=false},a)=>{let[s,i]=Z.useState([]),l=Z.useRef(null),c=u=>{if(o)return;let p=l.current;if(!p)return;let f=p.getBoundingClientRect(),g=u.clientX-f.left,v=u.clientY-f.top,b=Math.max(f.width,f.height)*2,h={id:Date.now(),x:g,y:v,size:b};i(x=>[...x,h]);},d=u=>{i(p=>p.filter(f=>f.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))})]})});Qv.displayName="Ripple";var eh=Z.forwardRef(({children:e,animate:t=true,height:n=10,duration:r=.5,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.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})});eh.displayName="Bounce";var NN={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]},th=Z.forwardRef(({children:e,animate:t=true,intensity:n="normal",duration:r=.5,count:o=1,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.useState(false),d=s?l:t,u={idle:{x:0},shake:{x:NN[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})});th.displayName="Shake";var kN={slow:"animate-[pulse_3s_ease-in-out_infinite]",normal:"animate-[pulse_2s_ease-in-out_infinite]",fast:"animate-[pulse_1s_ease-in-out_infinite]"},nh=Z.forwardRef(({children:e,animate:t=true,speed:n="normal",className:r},o)=>jsx("div",{ref:o,className:m(t&&kN[n],r),children:e}));nh.displayName="Pulse";var rh=Z.forwardRef(({children:e,animate:t=true,angle:n=10,duration:r=.3,count:o=0,className:a,triggerOnHover:s=false},i)=>{let[l,c]=Z.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})});rh.displayName="Wiggle";var oh=Z.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]=Z.useState(false),d=t||l,u={type:"spring",stiffness:400,damping:17,duration:r},p=()=>{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:p,children:e})});oh.displayName="Pop";var HN=(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},ah=Z.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},p)=>{let f=Z.useRef(null),g=useInView(f,{once:true}),[v,b]=Z.useState(!l);Z.useEffect(()=>{if(l&&g){let R=setTimeout(()=>b(true),c*1e3);return ()=>clearTimeout(R)}},[l,g,c]);let h=useMotionValue(t),x=useTransform(h,R=>HN(R,r,s,i));return Z.useEffect(()=>{if(v){let R=animate(h,e,{duration:n,ease:"easeOut",onComplete:u});return ()=>R.stop()}},[v,e,n,h,u]),jsx("span",{ref:f,className:m(d),children:jsxs("span",{ref:p,children:[o,jsx(motion.span,{children:x}),a]})})});ah.displayName="Counter";var sh=Z.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},p)=>{let f=Array.isArray(e)?e:[e],[g,v]=Z.useState(""),[b,h]=Z.useState(0),[x,R]=Z.useState(false),[N,w]=Z.useState(false),y=Z.useRef(null),C=useInView(y,{once:true}),[E,L]=Z.useState(!l);return Z.useEffect(()=>{if(l&&C){let k=setTimeout(()=>L(true),n*1e3);return ()=>clearTimeout(k)}},[l,C,n]),Z.useEffect(()=>{if(!E||N)return;let k=f[b],S;return x?g.length>0?S=setTimeout(()=>{v(g.slice(0,-1));},i):(R(false),h(T=>(T+1)%f.length)):g.length<k.length?S=setTimeout(()=>{v(k.slice(0,g.length+1));},t):b<f.length-1||s?S=setTimeout(()=>{R(true);},r):(w(true),u?.()),()=>clearTimeout(S)},[E,g,b,x,N,f,t,i,r,s,u]),jsxs("span",{ref:y,className:m(c),children:[jsx("span",{ref:p,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})]})});sh.displayName="Typewriter";var ih=Z.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=Z.useRef(null),d=useInView(c,{once:true,amount:.5}),u=s?d:true,p=typeof e=="string"?e:"",f=a==="word"?p.split(" "):p.split(""),g={up:{y:20},down:{y:-20},left:{x:20},right:{x:-20}},v={hidden:{},visible:{transition:{staggerChildren:n,delayChildren:o}}},b={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:v,initial:"hidden",animate:u?"visible":"hidden",children:jsx("span",{ref:c,children:f.map((h,x)=>jsxs(motion.span,{variants:b,className:"inline-block",children:[h,a==="word"&&x<f.length-1&&"\xA0"]},x))})})});ih.displayName="TextReveal";var lh=Z.forwardRef(({words:e,duration:t=2,animation:n="slide",animationDuration:r=.5,className:o,loop:a=true},s)=>{let[i,l]=Z.useState(0);Z.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])})})});lh.displayName="WordRotate";var mh=Z.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]},p)=>{let f=Z.useRef(null),g=useInView(f,{once:a,amount:s}),b={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],h={hidden:{opacity:0,x:b.x,y:b.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:f,children:jsx(motion.div,{ref:p,variants:h,initial:"hidden",animate:g?"visible":"hidden",className:m(i),children:e})})});mh.displayName="ScrollReveal";var ph=Z.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}),p=l?u:d,f=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}},v=f?"scaleX":"scaleY",b=f?"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:{[v]:p,transformOrigin:b,backgroundColor:n}}),i&&jsx(VN,{progress:p,position:e})]})});ph.displayName="ScrollProgress";var VN=({progress:e,position:t})=>{let n=useTransform(e,s=>Math.round(s*100)),[r,o]=Z.useState(0);return Z.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,"%"]})},fh=Z.forwardRef(({children:e,speed:t=.5,direction:n="vertical",className:r,container:o},a)=>{let s=Z.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,p=n==="vertical"?d:0;return jsx("div",{ref:s,className:m("overflow-hidden",r),children:jsx(motion.div,{ref:a,style:{x:u,y:p},children:e})})});fh.displayName="Parallax";var vh=Z.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"},p={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:`${p[o]} ${r}s infinite`}}),jsx("style",{children:`
|
|
56
56
|
@keyframes shimmer-right {
|
|
57
57
|
0% { transform: translateX(-100%); }
|
|
58
58
|
100% { transform: translateX(100%); }
|
|
@@ -69,5 +69,5 @@ import*as Z from'react';import {createContext,useState,useRef,useCallback,useEff
|
|
|
69
69
|
0% { transform: translateY(-100%); }
|
|
70
70
|
100% { transform: translateY(100%); }
|
|
71
71
|
}
|
|
72
|
-
`})]})});vh.displayName="Shimmer";var AN={sm:24,md:40,lg:56,xl:80},zN={default:{circle:"stroke-muted-foreground",check:"stroke-foreground"},success:{circle:"stroke-green-500",check:"stroke-green-500"},primary:{circle:"stroke-primary",check:"stroke-primary"},outline:{circle:"stroke-border",check:"stroke-foreground"}},hh=Z.forwardRef(({show:e=true,size:t="md",variant:r="success",strokeWidth:n=2,duration:o=.6,delay:a=0,className:s,onComplete:i},l)=>{let c=AN[t],d=zN[r],u={hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:o*.5,delay:a,ease:"easeOut"}}},p={hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:o*.5,delay:a+o*.4,ease:"easeOut"}}};return jsxs("svg",{ref:l,width:c,height:c,viewBox:"0 0 50 50",className:m(s),children:[jsx(motion.circle,{cx:"25",cy:"25",r:"22",fill:"none",strokeWidth:n,className:d.circle,variants:u,initial:"hidden",animate:e?"visible":"hidden"}),jsx(motion.path,{d:"M14 27 L22 35 L36 18",fill:"none",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:d.check,variants:p,initial:"hidden",animate:e?"visible":"hidden",onAnimationComplete:()=>e&&i?.()})]})});hh.displayName="Checkmark";var Ao={particleCount:100,spread:70,startVelocity:30,decay:.95,gravity:1,colors:["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff"],origin:{x:.5,y:.5},shapes:["square","circle"],scalar:1,drift:0,ticks:200},xh=Z.forwardRef(({autoTrigger:e=false,delay:t=0,options:r={},children:n,onTrigger:o},a)=>{let s=Z.useCallback(()=>{let i={...Ao,...r};Vo(i),o?.();},[r,o]);return Z.useEffect(()=>{if(e){let i=setTimeout(s,t);return ()=>clearTimeout(i)}},[e,t,s]),n?jsx("div",{ref:a,onClick:s,className:"inline-block cursor-pointer",children:n}):null});xh.displayName="Confetti";var ON=()=>{let e=Z.useCallback(n=>{let o={...Ao,...n};Vo(o);},[]),t=Z.useCallback(()=>{let o=Date.now()+3e3,a=setInterval(()=>{let s=o-Date.now();if(s<=0){clearInterval(a);return}let i=50*(s/3e3);Vo({...Ao,particleCount:i,origin:{x:Math.random()*.4+.1,y:Math.random()-.2}}),Vo({...Ao,particleCount:i,origin:{x:Math.random()*.4+.5,y:Math.random()-.2}});},250);},[]),r=Z.useCallback((n="both")=>{let o={x:0,y:1},a={x:1,y:1};(n==="left"||n==="both")&&Vo({...Ao,particleCount:50,angle:60,spread:55,origin:o}),(n==="right"||n==="both")&&Vo({...Ao,particleCount:50,angle:120,spread:55,origin:a});},[]);return {fire:e,fireworks:t,cannon:r}},yh=Z.forwardRef(({children:e,color:t="hsl(var(--primary))",intensity:r=20,spread:n=0,animate:o=false,duration:a=2,className:s},i)=>{let l={boxShadow:`0 0 ${r}px ${n}px ${t}`};return o?jsx(motion.div,{ref:i,className:m("rounded-[inherit]",s),animate:{boxShadow:[`0 0 ${r}px ${n}px ${t}`,`0 0 ${r*1.5}px ${n+5}px ${t}`,`0 0 ${r}px ${n}px ${t}`]},transition:{duration:a,repeat:1/0,ease:"easeInOut"},children:e}):jsx("div",{ref:i,className:m("rounded-[inherit]",s),style:l,children:e})});yh.displayName="Glow";var bh=(e,t)=>({id:Math.random().toString(36).substr(2,9),x:`${Math.random()*100}%`,y:`${Math.random()*100}%`,size:Math.random()*(t-e)+e,delay:Math.random()*2}),Rh=Z.forwardRef(({children:e,count:t=10,color:r="hsl(var(--primary))",minSize:n=4,maxSize:o=8,duration:a=1.5,className:s},i)=>{let[l,c]=Z.useState([]);return Z.useEffect(()=>{let d=Array.from({length:t},()=>bh(n,o));c(d);let u=setInterval(()=>{c(p=>{let f=[...p],g=Math.floor(Math.random()*t);return f[g]=bh(n,o),f});},a*500);return ()=>clearInterval(u)},[t,n,o,a]),jsxs("div",{ref:i,className:m("relative inline-block",s),children:[e,l.map(d=>jsx(motion.svg,{className:"pointer-events-none absolute",style:{left:d.x,top:d.y,width:d.size,height:d.size},viewBox:"0 0 24 24",initial:{scale:0,opacity:0,rotate:0},animate:{scale:[0,1,0],opacity:[0,1,0],rotate:[0,180]},transition:{duration:a,delay:d.delay,repeat:1/0,ease:"easeInOut"},children:jsx("path",{d:"M12 0L14.59 9.41L24 12L14.59 14.59L12 24L9.41 14.59L0 12L9.41 9.41L12 0Z",fill:r})},d.id))]})});Rh.displayName="Sparkles";var wh=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("h1",{ref:n,className:m("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",e),...r,children:t}));wh.displayName="H1";var Ch=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("h2",{ref:n,className:m("scroll-m-20 text-3xl font-semibold tracking-tight",e),...r,children:t}));Ch.displayName="H2";var Mh=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("h3",{ref:n,className:m("scroll-m-20 text-2xl font-semibold tracking-tight",e),...r,children:t}));Mh.displayName="H3";var Th=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("h4",{ref:n,className:m("scroll-m-20 text-xl font-semibold tracking-tight",e),...r,children:t}));Th.displayName="H4";var Nh=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("p",{ref:n,className:m("leading-7 [&:not(:first-child)]:mt-6",e),...r,children:t}));Nh.displayName="Paragraph";var kh=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("blockquote",{ref:n,className:m("mt-6 border-l-2 pl-6 italic",e),...r,children:t}));kh.displayName="Blockquote";var Sh=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("code",{ref:n,className:m("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",e),...r,children:t}));Sh.displayName="InlineCode";var Eh=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("p",{ref:n,className:m("text-xl text-muted-foreground",e),...r,children:t}));Eh.displayName="Lead";var Ph=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("div",{ref:n,className:m("text-lg font-semibold",e),...r,children:t}));Ph.displayName="Large";var Lh=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("small",{ref:n,className:m("text-sm font-medium leading-none",e),...r,children:t}));Lh.displayName="Small";var Dh=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("p",{ref:n,className:m("text-sm text-muted-foreground",e),...r,children:t}));Dh.displayName="Muted";var Hh=Z.forwardRef(({className:e,children:t,...r},n)=>jsx("ul",{ref:n,className:m("my-6 ml-6 list-disc [&>li]:mt-2",e),...r,children:t}));Hh.displayName="UL";function FN(){let[e,t]=Z.useState(false);return Z.useEffect(()=>{t(true);},[]),e}var BN=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],$N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],sc={default:["bg-muted","bg-emerald-200 dark:bg-emerald-900","bg-emerald-300 dark:bg-emerald-700","bg-emerald-500 dark:bg-emerald-500","bg-emerald-700 dark:bg-emerald-300"],success:["bg-muted","bg-green-200 dark:bg-green-900","bg-green-300 dark:bg-green-700","bg-green-500 dark:bg-green-500","bg-green-700 dark:bg-green-300"],warning:["bg-muted","bg-amber-200 dark:bg-amber-900","bg-amber-300 dark:bg-amber-700","bg-amber-500 dark:bg-amber-500","bg-amber-700 dark:bg-amber-300"],danger:["bg-muted","bg-red-200 dark:bg-red-900","bg-red-300 dark:bg-red-700","bg-red-500 dark:bg-red-500","bg-red-700 dark:bg-red-300"],primary:["bg-muted","bg-primary/20","bg-primary/40","bg-primary/60","bg-primary/80"],secondary:["bg-muted","bg-secondary/40","bg-secondary/60","bg-secondary/80","bg-secondary"]},ic={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function Ih(e){return e.toISOString().split("T")[0]}function KN(e){return e instanceof Date?e:new Date(e)}function GN(e,t){let r=[],n=new Date(e);for(n.setDate(n.getDate()-n.getDay());n<=t;){let o=[];for(let a=0;a<7;a++)o.push(new Date(n)),n.setDate(n.getDate()+1);r.push(o);}return r}function UN(e){let t=[],r=-1;return e.forEach((n,o)=>{let a=n.find(s=>s.getDate()<=7);a&&a.getMonth()!==r&&(r=a.getMonth(),t.push({month:$N[r],position:o}));}),t}var Vh=Z.forwardRef(({className:e,values:t,startDate:r,endDate:n,color:o="default",levels:a=5,showMonthLabels:s=true,showWeekdayLabels:i=true,showTooltip:l=true,tooltipFormatter:c,colorScale:d,gap:u=3,cellSize:p=12,radius:f="sm",onCellClick:g,emptyColor:v,showLegend:b=true,legendLabels:h={less:"Less",more:"More"},...x},R)=>{let N=FN(),{startDate:w,endDate:y}=Z.useMemo(()=>{let P=n?new Date(n):new Date;return {startDate:r?new Date(r):new Date(P.getFullYear()-1,P.getMonth(),P.getDate()),endDate:P}},[r,n]),C=Z.useMemo(()=>{let P=new Map;return t.forEach(I=>{let H=KN(I.date),A=Ih(H);P.set(A,(P.get(A)||0)+I.count);}),P},[t]),E=Z.useMemo(()=>C.size===0?0:Math.max(...Array.from(C.values())),[C]),L=Z.useMemo(()=>GN(w,y),[w,y]),k=Z.useMemo(()=>UN(L),[L]),S=P=>{if(P===0)return v||d?.[0]||sc[o][0];let I=d||sc[o],H=Math.min(Math.ceil(P/E*(a-1)),a-1);return I[H]||I[I.length-1]},T=(P,I)=>{if(c)return c(P,I);let H=P.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"});return jsxs("span",{children:[jsx("span",{className:"font-medium",children:I})," contributions on ",H]})},M=(P,I,H)=>{let A=Ih(P),B=C.get(A)||0;if(!(P>=w&&P<=y))return jsx("div",{style:{width:p,height:p}},`${I}-${H}`);let j=jsx("div",{className:m("transition-all duration-200",ic[f],S(B),g&&"cursor-pointer hover:ring-2 hover:ring-foreground/50 hover:ring-offset-1"),style:{width:p,height:p},onClick:()=>g?.(P,B),role:g?"button":void 0,tabIndex:g?0:void 0,onKeyDown:G=>{g&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),g(P,B));}});return l?jsx(yr,{content:T(P,B),delayDuration:0,children:jsx("button",{type:"button",className:m("transition-all duration-200 border-0 bg-transparent p-0",ic[f],S(B),g&&"cursor-pointer hover:ring-2 hover:ring-foreground/50 hover:ring-offset-1"),style:{width:p,height:p},onClick:()=>g?.(P,B),onKeyDown:G=>{g&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),g(P,B));}})},`${I}-${H}`):jsx(Z.Fragment,{children:j},`${I}-${H}`)},D=d||sc[o];return N?jsxs("div",{ref:R,className:m("inline-flex flex-col",e),...x,children:[jsxs("div",{className:"flex",children:[i&&jsx("div",{className:"flex flex-col justify-between pr-2",style:{gap:u,marginTop:s?20:0},children:BN.map((P,I)=>jsx("div",{className:m("text-xs text-muted-foreground",I%2===1&&"invisible"),style:{height:p,lineHeight:`${p}px`},children:P},P))}),jsxs("div",{className:"flex flex-col",children:[s&&jsx("div",{className:"relative mb-1",style:{height:16,width:L.length*(p+u)-u},children:k.map(({month:P,position:I},H)=>jsx("div",{className:"absolute text-xs text-muted-foreground whitespace-nowrap",style:{left:I*(p+u)},children:P},`${P}-${H}`))}),jsx("div",{className:"flex",style:{gap:u},children:L.map((P,I)=>jsx("div",{className:"flex flex-col",style:{gap:u},children:P.map((H,A)=>M(H,I,A))},I))})]})]}),b&&jsxs("div",{className:"flex items-center justify-end mt-4 gap-2",children:[jsx("span",{className:"text-xs text-muted-foreground",children:h.less}),jsx("div",{className:"flex",style:{gap:u/2},children:D.slice(0,a).map((P,I)=>jsx("div",{className:m(ic[f],P),style:{width:p,height:p}},I))}),jsx("span",{className:"text-xs text-muted-foreground",children:h.more})]})]}):jsx("div",{ref:R,className:m("inline-flex flex-col",e),...x})});Vh.displayName="HeatmapCalendar";var _N=Z.forwardRef(({className:e,beforeImage:t,afterImage:r,beforeAlt:n="Before",afterAlt:o="After",defaultPosition:a=50,position:s,onPositionChange:i,orientation:l="horizontal",showLabels:c=true,beforeLabel:d="Before",afterLabel:u="After",handleVariant:p="default",handleColor:f="default",aspectRatio:g,disableKeyboard:v=false,handleWidth:b=4,...h},x)=>{let[R,N]=Z.useState(a),w=s!==void 0,y=w?s:R,C=Z.useRef(null),[E,L]=Z.useState(false),[k,S]=Z.useState({width:0,height:0});Z.useEffect(()=>{let G=()=>{C.current&&S({width:C.current.offsetWidth,height:C.current.offsetHeight});};G();let U=new ResizeObserver(G);return C.current&&U.observe(C.current),()=>U.disconnect()},[]);let T=G=>{let U=Math.max(0,Math.min(100,G));w||N(U),i?.(U);},M=(G,U)=>{if(!C.current)return y;let W=C.current.getBoundingClientRect();return l==="horizontal"?(G-W.left)/W.width*100:(U-W.top)/W.height*100},D=G=>{G.preventDefault(),L(true),G.target.setPointerCapture(G.pointerId);let U=M(G.clientX,G.clientY);T(U);},P=G=>{if(!E)return;let U=M(G.clientX,G.clientY);T(U);},I=()=>{L(false);},H=G=>{if(v)return;let U=G.shiftKey?10:1,W=y;switch(G.key){case "ArrowLeft":case "ArrowUp":G.preventDefault(),W=y-U;break;case "ArrowRight":case "ArrowDown":G.preventDefault(),W=y+U;break;case "Home":G.preventDefault(),W=0;break;case "End":G.preventDefault(),W=100;break;default:return}T(W);},A={default:"bg-border",primary:"bg-primary",white:"bg-white",black:"bg-black"},B={default:"bg-background border-border text-foreground",primary:"bg-primary border-primary text-primary-foreground",white:"bg-white border-white text-black",black:"bg-black border-black text-white"},$=()=>{let G=l==="horizontal",U=m("absolute z-10 flex items-center justify-center",G?"top-0 bottom-0 cursor-ew-resize":"left-0 right-0 cursor-ns-resize",A[f]),W=G?{left:`${y}%`,width:b,transform:"translateX(-50%)"}:{top:`${y}%`,height:b,transform:"translateY(-50%)"};return p==="minimal"?jsx("div",{className:U,style:W}):p==="arrows"?jsx("div",{className:U,style:W,children:jsxs("div",{className:m("absolute flex items-center justify-center gap-0.5 rounded-full p-1.5 shadow-md border-2",B[f],G?"flex-row":"flex-col"),children:[jsx("svg",{className:m("w-3 h-3",G?"-rotate-0":"rotate-90"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M15 18l-6-6 6-6"})}),jsx("svg",{className:m("w-3 h-3",G?"-rotate-0":"rotate-90"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M9 18l6-6-6-6"})})]})}):jsx("div",{className:U,style:W,children:jsx("div",{className:m("absolute rounded-full p-2 shadow-md border-2",B[f]),children:jsxs("svg",{className:m("w-4 h-4",G?"":"rotate-90"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M8 3L4 7l4 4"}),jsx("path",{d:"M16 3l4 4-4 4"}),jsx("path",{d:"M4 7h16"}),jsx("path",{d:"M8 17l-4 4 4 4"}),jsx("path",{d:"M16 17l4 4-4 4"}),jsx("path",{d:"M4 21h16"})]})})})},j=l==="horizontal";return jsx("div",{ref:x,className:m("relative select-none overflow-hidden rounded-lg",E&&"cursor-grabbing",e),style:g?{aspectRatio:g}:void 0,...h,children:jsxs("div",{ref:C,className:"relative w-full h-full",role:"slider",tabIndex:0,"aria-valuenow":y,"aria-valuemin":0,"aria-valuemax":100,"aria-orientation":l,"aria-label":"Image comparison slider",onPointerDown:D,onPointerMove:P,onPointerUp:I,onPointerCancel:I,onKeyDown:H,children:[jsx("img",{src:r,alt:o,className:"absolute inset-0 w-full h-full object-cover",draggable:false}),jsx("div",{className:"absolute inset-0 overflow-hidden",style:j?{width:`${y}%`}:{height:`${y}%`},children:jsx("img",{src:t,alt:n,className:"absolute object-cover",style:{top:0,left:0,width:k.width>0?`${k.width}px`:"100%",height:k.height>0?`${k.height}px`:"100%"},draggable:false})}),$(),c&&jsxs(Fragment,{children:[jsx("div",{className:m("absolute px-2 py-1 text-xs font-medium rounded bg-black/70 text-white pointer-events-none","top-3 left-3"),children:d}),jsx("div",{className:m("absolute px-2 py-1 text-xs font-medium rounded bg-black/70 text-white pointer-events-none",j?"top-3 right-3":"bottom-3 left-3"),children:u})]})]})})});_N.displayName="ImageComparison";function zh(e){let t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60);return t>0?`${t}:${r.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${r}:${n.toString().padStart(2,"0")}`}var nk={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},Oh=Z.forwardRef(({className:e,src:t,poster:r,autoPlay:n=false,muted:o=false,loop:a=false,controls:s=true,preload:i="metadata",aspectRatio:l="16/9",defaultVolume:c=1,playbackSpeeds:d=[.5,.75,1,1.25,1.5,2],showPiP:u=true,showFullscreen:p=true,showVolume:f=true,showPlaybackSpeed:g=true,showSkipButtons:v=false,skipInterval:b=10,onPlay:h,onPause:x,onEnded:R,onVideoTimeUpdate:N,onVideoVolumeChange:w,controlsHideTimeout:y=3e3,keyboardShortcuts:C=true,doubleClickFullscreen:E=true,radius:L="lg",...k},S)=>{let T=Z.useRef(null),M=Z.useRef(null),D=Z.useRef(null),[P,I]=Z.useState(false),[H,A]=Z.useState(0),[B,$]=Z.useState(0),[j,G]=Z.useState(c),[U,W]=Z.useState(o),[V,z]=Z.useState(false),[K,Y]=Z.useState(true),[Q,J]=Z.useState(true),[Ne,be]=Z.useState(1),[_,O]=Z.useState(0),F=Z.useMemo(()=>typeof t=="string"?[{src:t,type:void 0,label:void 0}]:t,[t]),[q,X]=Z.useState(0),Re=Z.useCallback(()=>{D.current&&clearTimeout(D.current),J(true),P&&y>0&&(D.current=setTimeout(()=>{J(false);},y));},[P,y]);Z.useEffect(()=>(Re(),()=>{D.current&&clearTimeout(D.current);}),[P,Re]);let Te=()=>{M.current&&($(M.current.duration),Y(false));},ot=()=>{if(M.current){A(M.current.currentTime),N?.(M.current.currentTime,M.current.duration);let ne=M.current.buffered.length>0?M.current.buffered.end(M.current.buffered.length-1):0;O(ne/M.current.duration*100);}},ue=()=>{I(true),h?.();},tt=()=>{I(false),x?.();},te=()=>{I(false),R?.();},at=()=>{Y(true);},qt=()=>{Y(false);},re=()=>{M.current&&(P?M.current.pause():M.current.play());},oe=ne=>{if(M.current){let we=ne[0]/100*B;M.current.currentTime=we,A(we);}},ke=ne=>{let we=ne[0]/100;G(we),W(we===0),M.current&&(M.current.volume=we,M.current.muted=we===0),w?.(we,we===0);},Ft=()=>{if(M.current){let ne=!U;M.current.muted=ne,W(ne),ne?M.current.volume=0:M.current.volume=j||1,w?.(ne?0:j,ne);}},bt=async()=>{if(T.current)try{V?await document.exitFullscreen():await T.current.requestFullscreen();}catch{}},eo=async()=>{if(M.current)try{document.pictureInPictureElement?await document.exitPictureInPicture():await M.current.requestPictureInPicture();}catch{}},Se=ne=>{M.current&&(M.current.currentTime=Math.max(0,Math.min(B,M.current.currentTime+ne)));},qe=ne=>{M.current&&(M.current.playbackRate=ne,be(ne));};Z.useEffect(()=>{let ne=()=>{z(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",ne),()=>{document.removeEventListener("fullscreenchange",ne);}},[]),Z.useEffect(()=>{if(!C)return;let ne=we=>{if(!(!T.current?.contains(document.activeElement)&&document.activeElement!==T.current))switch(we.key.toLowerCase()){case " ":case "k":we.preventDefault(),re();break;case "f":we.preventDefault(),bt();break;case "m":we.preventDefault(),Ft();break;case "arrowleft":we.preventDefault(),Se(-b);break;case "arrowright":we.preventDefault(),Se(b);break;case "arrowup":we.preventDefault(),ke([Math.min(100,j*100+10)]);break;case "arrowdown":we.preventDefault(),ke([Math.max(0,j*100-10)]);break}};return window.addEventListener("keydown",ne),()=>{window.removeEventListener("keydown",ne);}},[C,P,j,b]);let Bt=()=>{E&&bt();},$e=B>0?H/B*100:0;return jsxs("div",{ref:ne=>{T.current=ne,typeof S=="function"?S(ne):S&&(S.current=ne);},className:m("relative bg-black overflow-hidden group",nk[L],e),style:{aspectRatio:l},onMouseMove:Re,onMouseLeave:()=>P&&J(false),tabIndex:0,...k,children:[jsx("video",{ref:M,className:"w-full h-full object-contain",poster:r,autoPlay:n,muted:o,loop:a,preload:i,playsInline:true,onClick:re,onDoubleClick:Bt,onLoadedMetadata:Te,onTimeUpdate:ot,onPlay:ue,onPause:tt,onEnded:te,onWaiting:at,onCanPlay:qt,children:F.map((ne,we)=>jsx("source",{src:ne.src,type:ne.type},we))}),K&&jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/20",children:jsx(Loader2,{className:"w-12 h-12 text-white animate-spin"})}),!P&&!K&&jsx("button",{type:"button",className:"absolute inset-0 flex items-center justify-center bg-black/30 transition-opacity cursor-pointer",onClick:re,children:jsx("div",{className:"w-16 h-16 rounded-full bg-white/90 flex items-center justify-center",children:jsx(Play,{className:"w-8 h-8 text-black ml-1",fill:"currentColor"})})}),s&&jsxs("div",{className:m("absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-4 pt-16 transition-opacity duration-300",Q?"opacity-100":"opacity-0 pointer-events-none"),children:[jsxs("div",{className:"relative mb-3 group/progress",children:[jsx("div",{className:"absolute top-1/2 left-0 h-1 bg-white/30 rounded-full -translate-y-1/2",style:{width:`${_}%`}}),jsx(er,{value:[$e],onValueChange:oe,min:0,max:100,step:.1,className:"h-1 group-hover/progress:h-2 transition-all cursor-pointer [&_[role=slider]]:w-3 [&_[role=slider]]:h-3 [&_[role=slider]]:opacity-0 group-hover/progress:[&_[role=slider]]:opacity-100 [&_[role=slider]]:transition-opacity"})]}),jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:re,children:P?jsx(Pause,{className:"w-5 h-5",fill:"currentColor"}):jsx(Play,{className:"w-5 h-5",fill:"currentColor"})}),v&&jsxs(Fragment,{children:[jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:()=>Se(-b),children:jsx(SkipBack,{className:"w-5 h-5"})}),jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:()=>Se(b),children:jsx(SkipForward,{className:"w-5 h-5"})})]}),f&&jsxs("div",{className:"flex items-center gap-1 group/volume",children:[jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:Ft,children:U||j===0?jsx(VolumeX,{className:"w-5 h-5"}):jsx(Volume2,{className:"w-5 h-5"})}),jsx("div",{className:"w-0 overflow-hidden group-hover/volume:w-20 transition-all",children:jsx(er,{value:[U?0:j*100],onValueChange:ke,min:0,max:100,step:1,className:"w-20"})})]}),jsxs("div",{className:"text-white text-sm ml-2",children:[zh(H)," / ",zh(B)]})]}),jsxs("div",{className:"flex items-center gap-1",children:[g&&jsxs(Zt,{children:[jsx(Jt,{children:jsxs("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer flex items-center gap-1",children:[jsx(Settings,{className:"w-5 h-5"}),jsxs("span",{className:"text-xs",children:[Ne,"x"]})]})}),jsx(Qt,{align:"end",className:"min-w-[100px]",children:d.map(ne=>jsxs(Et,{onSelect:()=>qe(ne),className:m(Ne===ne&&"bg-primary/10 text-primary"),children:[ne,"x"]},ne))})]}),F.length>1&&jsxs(Zt,{children:[jsx(Jt,{children:jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer text-xs",children:F[q]?.quality||F[q]?.label||"Quality"})}),jsx(Qt,{align:"end",className:"min-w-[100px]",children:F.map((ne,we)=>jsx(Et,{onSelect:()=>{let Mn=M.current?.currentTime||0;X(we),setTimeout(()=>{M.current&&(M.current.currentTime=Mn,P&&M.current.play());},100);},className:m(q===we&&"bg-primary/10 text-primary"),children:ne.quality||ne.label||`Source ${we+1}`},we))})]}),u&&typeof document<"u"&&document.pictureInPictureEnabled&&jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:eo,children:jsx(PictureInPicture,{className:"w-5 h-5"})}),p&&jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:bt,children:V?jsx(Minimize,{className:"w-5 h-5"}):jsx(Maximize,{className:"w-5 h-5"})})]})]})]})]})});Oh.displayName="VideoPlayer";function Ca(e){if(!e||!isFinite(e))return "0:00";let t=Math.floor(e/60),r=Math.floor(e%60);return `${t}:${r.toString().padStart(2,"0")}`}var Fh={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},pk={default:{progress:"bg-foreground",waveformActive:"bg-foreground",waveformInactive:"bg-muted-foreground/30"},primary:{progress:"bg-primary",waveformActive:"bg-primary",waveformInactive:"bg-primary/20"},success:{progress:"bg-green-500",waveformActive:"bg-green-500",waveformInactive:"bg-green-500/20"},warning:{progress:"bg-amber-500",waveformActive:"bg-amber-500",waveformInactive:"bg-amber-500/20"},danger:{progress:"bg-red-500",waveformActive:"bg-red-500",waveformInactive:"bg-red-500/20"}},Bh=Z.forwardRef(({className:e,src:t,autoPlay:r=false,defaultVolume:n=1,loop:o=false,muted:a=false,showWaveform:s=true,waveformData:i,waveformBars:l=50,showTrackInfo:c=true,showVolume:d=true,showSkipButtons:u=false,skipInterval:p=10,showLoop:f=true,showShuffle:g=false,showDownload:v=false,variant:b="default",color:h="default",customColor:x,onPlay:R,onPause:N,onEnded:w,onAudioTimeUpdate:y,radius:C="lg",...E},L)=>{let k=Z.useRef(null),S=Z.useRef(null),[T,M]=Z.useState(false),[D,P]=Z.useState(0),[I,H]=Z.useState(0),[A,B]=Z.useState(n),[$,j]=Z.useState(a),[G,U]=Z.useState(true),[W,V]=Z.useState(o),[z,K]=Z.useState(false),Y=Z.useMemo(()=>typeof t=="string"?{src:t}:t,[t]),Q=Z.useMemo(()=>{if(i)return i;let oe=[];for(let ke=0;ke<l;ke++)oe.push(.2+Math.random()*.8);return oe},[i,l]),J=()=>{k.current&&(H(k.current.duration),U(false));},Ne=()=>{k.current&&(P(k.current.currentTime),y?.(k.current.currentTime,k.current.duration));},be=()=>{M(true),R?.();},_=()=>{M(false),N?.();},O=()=>{M(false),w?.();},F=()=>{U(false);},q=()=>{k.current&&(T?k.current.pause():k.current.play());},X=oe=>{if(k.current&&I){let ke=oe/100*I;k.current.currentTime=ke,P(ke);}},Re=oe=>{if(!S.current||!I)return;let ke=S.current.getBoundingClientRect(),Ft=(oe.clientX-ke.left)/ke.width*100;X(Ft);},Te=oe=>{let ke=oe[0]/100;B(ke),j(ke===0),k.current&&(k.current.volume=ke,k.current.muted=ke===0);},ot=()=>{if(k.current){let oe=!$;k.current.muted=oe,j(oe);}},ue=()=>{if(k.current){let oe=!W;k.current.loop=oe,V(oe);}},tt=oe=>{k.current&&(k.current.currentTime=Math.max(0,Math.min(I,k.current.currentTime+oe)));},te=()=>{let oe=document.createElement("a");oe.href=Y.src,oe.download=Y.title||"audio",document.body.appendChild(oe),oe.click(),document.body.removeChild(oe);},at=I>0?D/I*100:0,qt=pk[h],re=$||A===0?VolumeX:A<.5?Volume1:Volume2;return b==="compact"?jsxs("div",{ref:L,className:m("flex items-center gap-3 p-2 bg-muted/50",Fh[C],e),...E,children:[jsx("audio",{ref:k,src:Y.src,autoPlay:r,loop:W,muted:a,onLoadedMetadata:J,onTimeUpdate:Ne,onPlay:be,onPause:_,onEnded:O,onCanPlay:F}),jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded-full transition-colors cursor-pointer",onClick:q,disabled:G,children:G?jsx(Loader2,{className:"w-4 h-4 animate-spin"}):T?jsx(Pause,{className:"w-4 h-4",fill:"currentColor"}):jsx(Play,{className:"w-4 h-4",fill:"currentColor"})}),jsx("div",{className:"flex-1",children:jsx(er,{value:[at],onValueChange:oe=>X(oe[0]),min:0,max:100,step:.1,className:"h-1"})}),jsx("span",{className:"text-xs text-muted-foreground min-w-[35px]",children:Ca(D)})]}):b==="minimal"?jsxs("div",{ref:L,className:m("flex items-center gap-4",e),...E,children:[jsx("audio",{ref:k,src:Y.src,autoPlay:r,loop:W,muted:a,onLoadedMetadata:J,onTimeUpdate:Ne,onPlay:be,onPause:_,onEnded:O,onCanPlay:F}),jsx("button",{type:"button",className:m("p-3 rounded-full transition-colors cursor-pointer",!x&&qt.progress,"text-white hover:opacity-90"),style:x?{backgroundColor:x}:void 0,onClick:q,disabled:G,children:G?jsx(Loader2,{className:"w-5 h-5 animate-spin"}):T?jsx(Pause,{className:"w-5 h-5",fill:"currentColor"}):jsx(Play,{className:"w-5 h-5 ml-0.5",fill:"currentColor"})}),jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[c&&Y.title&&jsx("span",{className:"text-sm font-medium truncate",children:Y.title}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-xs text-muted-foreground min-w-[35px]",children:Ca(D)}),jsx(er,{value:[at],onValueChange:oe=>X(oe[0]),min:0,max:100,step:.1,className:"flex-1"}),jsx("span",{className:"text-xs text-muted-foreground min-w-[35px]",children:Ca(I)})]})]})]}):jsxs("div",{ref:L,className:m("p-4 bg-card border border-border",Fh[C],e),...E,children:[jsx("audio",{ref:k,src:Y.src,autoPlay:r,loop:W,muted:a,onLoadedMetadata:J,onTimeUpdate:Ne,onPlay:be,onPause:_,onEnded:O,onCanPlay:F}),c&&(Y.title||Y.artist||Y.artwork)&&jsxs("div",{className:"flex items-center gap-4 mb-4",children:[Y.artwork&&jsx("img",{src:Y.artwork,alt:Y.title||"Album artwork",className:"w-16 h-16 rounded-md object-cover"}),jsxs("div",{className:"flex-1 min-w-0",children:[Y.title&&jsx("h3",{className:"font-medium truncate",children:Y.title}),Y.artist&&jsx("p",{className:"text-sm text-muted-foreground truncate",children:Y.artist}),Y.album&&jsx("p",{className:"text-xs text-muted-foreground truncate",children:Y.album})]})]}),s?jsx("div",{ref:S,className:"relative h-16 mb-4 flex items-end gap-[2px] cursor-pointer",onClick:Re,children:Q.map((oe,ke)=>{let bt=(ke+1)/Q.length*100<=at;return jsx("div",{className:m("flex-1 rounded-sm transition-colors",!x&&(bt?qt.waveformActive:qt.waveformInactive)),style:{height:`${oe*100}%`,minHeight:4,...x&&{backgroundColor:bt?x:`${x}33`}}},ke)})}):jsx("div",{className:"mb-4",children:jsx(er,{value:[at],onValueChange:oe=>X(oe[0]),min:0,max:100,step:.1})}),jsxs("div",{className:"flex justify-between text-xs text-muted-foreground mb-4",children:[jsx("span",{children:Ca(D)}),jsx("span",{children:Ca(I)})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsxs("div",{className:"flex items-center gap-1",children:[g&&jsx("button",{type:"button",className:m("p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",z&&"text-primary"),onClick:()=>K(!z),children:jsx(Shuffle,{className:"w-4 h-4"})}),u&&jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",onClick:()=>tt(-p),children:jsx(SkipBack,{className:"w-5 h-5"})})]}),jsx("button",{type:"button",className:m("p-4 rounded-full transition-colors cursor-pointer",!x&&qt.progress,"text-white hover:opacity-90"),style:x?{backgroundColor:x}:void 0,onClick:q,disabled:G,children:G?jsx(Loader2,{className:"w-6 h-6 animate-spin"}):T?jsx(Pause,{className:"w-6 h-6",fill:"currentColor"}):jsx(Play,{className:"w-6 h-6 ml-0.5",fill:"currentColor"})}),jsxs("div",{className:"flex items-center gap-1",children:[u&&jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",onClick:()=>tt(p),children:jsx(SkipForward,{className:"w-5 h-5"})}),f&&jsx("button",{type:"button",className:m("p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",W&&"text-primary"),onClick:ue,children:jsx(Repeat,{className:"w-4 h-4"})})]})]}),jsxs("div",{className:"flex items-center justify-between mt-4",children:[d?jsxs("div",{className:"flex items-center gap-2 flex-1",children:[jsx("button",{type:"button",className:"p-1 hover:bg-muted rounded transition-colors cursor-pointer",onClick:ot,children:jsx(re,{className:"w-4 h-4"})}),jsx(er,{value:[$?0:A*100],onValueChange:Te,min:0,max:100,step:1,className:"w-24"})]}):jsx("div",{}),v&&jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",onClick:te,children:jsx(Download,{className:"w-4 h-4"})})]})]})});Bh.displayName="AudioPlayer";var Nk={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},$h=Z.forwardRef(({className:e,src:t,defaultPage:r=1,defaultZoom:n=100,showToolbar:o=true,showNavigation:a=true,showZoomControls:s=true,showDownload:i=true,showPrint:l=true,showFullscreen:c=true,showRotate:d=true,showSearch:u=false,zoomStep:p=25,minZoom:f=25,maxZoom:g=400,toolbarPosition:v="top",height:b="600px",onPageChange:h,onZoomChange:x,onPDFLoad:R,onPDFError:N,errorMessage:w="Failed to load PDF. Please try again.",loadingMessage:y="Loading PDF...",fileName:C="document.pdf",totalPages:E=1,radius:L="lg",...k},S)=>{let T=Z.useRef(null),M=Z.useRef(null),[D,P]=Z.useState(r),[I]=Z.useState(E),[H,A]=Z.useState(n),[B,$]=Z.useState(0),[j,G]=Z.useState(false),[U,W]=Z.useState(true),[V,z]=Z.useState(false),[K,Y]=Z.useState(String(r)),Q=te=>{let at=Math.max(1,Math.min(I,te));P(at),Y(String(at)),h?.(at);},J=te=>{Y(te.target.value);},Ne=()=>{let te=parseInt(K,10);isNaN(te)?Y(String(D)):Q(te);},be=te=>{te.key==="Enter"&&Ne();},_=()=>{let te=Math.min(g,H+p);A(te),x?.(te);},O=()=>{let te=Math.max(f,H-p);A(te),x?.(te);},F=()=>{$(te=>(te+90)%360);},q=async()=>{if(T.current)try{j?await document.exitFullscreen():await T.current.requestFullscreen();}catch{}};Z.useEffect(()=>{let te=()=>{G(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",te),()=>{document.removeEventListener("fullscreenchange",te);}},[]);let X=()=>{let te=document.createElement("a");te.href=t,te.download=C,document.body.appendChild(te),te.click(),document.body.removeChild(te);},Re=()=>{M.current?.contentWindow&&M.current.contentWindow.print();},Te=()=>{W(false),z(false),R?.();},ot=()=>{W(false),z(true),N?.(new Error("Failed to load PDF"));},ue=Z.useMemo(()=>{if(typeof window>"u")return t;try{let te=new URL(t,window.location.href);return te.hash=`page=${D}&zoom=${H}`,te.toString()}catch{return t}},[t,D,H]),tt=jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 bg-muted/50 border-b border-border",children:[a&&jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>Q(D-1),disabled:D<=1,title:"Previous page",children:jsx(ChevronLeft,{className:"w-4 h-4"})}),jsxs("div",{className:"flex items-center gap-1.5",children:[jsx(Qr,{value:K,onChange:J,onBlur:Ne,onKeyDown:be,className:"w-12 h-7 text-center text-sm px-1"}),jsxs("span",{className:"text-sm text-muted-foreground",children:["/ ",I]})]}),jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>Q(D+1),disabled:D>=I,title:"Next page",children:jsx(ChevronRight,{className:"w-4 h-4"})})]}),s&&jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:O,disabled:H<=f,title:"Zoom out",children:jsx(ZoomOut,{className:"w-4 h-4"})}),jsxs("span",{className:"text-sm text-muted-foreground min-w-[50px] text-center",children:[H,"%"]}),jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:_,disabled:H>=g,title:"Zoom in",children:jsx(ZoomIn,{className:"w-4 h-4"})})]}),jsxs("div",{className:"flex items-center gap-1",children:[u&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",title:"Search",children:jsx(Search,{className:"w-4 h-4"})}),d&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:F,title:"Rotate",children:jsx(RotateCw,{className:"w-4 h-4"})}),l&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:Re,title:"Print",children:jsx(Printer,{className:"w-4 h-4"})}),i&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:X,title:"Download",children:jsx(Download,{className:"w-4 h-4"})}),c&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:q,title:j?"Exit fullscreen":"Fullscreen",children:j?jsx(Minimize,{className:"w-4 h-4"}):jsx(Maximize,{className:"w-4 h-4"})})]})]});return jsxs("div",{ref:te=>{T.current=te,typeof S=="function"?S(te):S&&(S.current=te);},className:m("flex flex-col bg-card border border-border overflow-hidden",Nk[L],e),style:{height:j?"100vh":b},...k,children:[o&&v==="top"&&tt,jsxs("div",{className:"flex-1 relative overflow-hidden bg-muted/30",children:[U&&jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-background/80 z-10",children:[jsx(Loader2,{className:"w-8 h-8 animate-spin text-muted-foreground mb-2"}),jsx("span",{className:"text-sm text-muted-foreground",children:y})]}),V&&jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-background z-10",children:[jsx(FileWarning,{className:"w-12 h-12 text-muted-foreground mb-3"}),jsx("span",{className:"text-sm text-muted-foreground",children:w}),jsx("button",{type:"button",className:"mt-3 px-4 py-2 text-sm bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors cursor-pointer",onClick:()=>{W(true),z(false);},children:"Try again"})]}),jsx("iframe",{ref:M,src:ue,className:"w-full h-full border-0",style:{transform:`rotate(${B}deg) scale(${H/100})`,transformOrigin:"center center"},onLoad:Te,onError:ot,title:"PDF Viewer"})]}),o&&v==="bottom"&&tt]})});$h.displayName="PDFViewer";function zo(e){let t=useCallback(o=>typeof window<"u"?window.matchMedia(o).matches:false,[]),[r,n]=useState(()=>t(e));return useEffect(()=>{let o=window.matchMedia(e),a=()=>{n(o.matches);};return n(o.matches),o.addEventListener("change",a),()=>{o.removeEventListener("change",a);}},[e]),r}function Pk(){return zo("(max-width: 767px)")}function Lk(){return zo("(min-width: 768px) and (max-width: 1023px)")}function Dk(){return zo("(min-width: 1024px)")}function Hk(){return zo("(prefers-color-scheme: dark)")?"dark":"light"}function Ik(){return zo("(prefers-reduced-motion: reduce)")}function Ma(e={}){let{initialWidth:t=0,initialHeight:r=0,debounce:n=0,includeScrollbar:o=true}=e,[a,s]=useState(()=>typeof window>"u"?{width:t,height:r}:{width:o?window.innerWidth:document.documentElement.clientWidth,height:o?window.innerHeight:document.documentElement.clientHeight}),i=useRef(null),l=useCallback(()=>{let c=()=>{s({width:o?window.innerWidth:document.documentElement.clientWidth,height:o?window.innerHeight:document.documentElement.clientHeight});};n>0?(i.current&&clearTimeout(i.current),i.current=setTimeout(c,n)):c();},[n,o]);return useEffect(()=>(l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l),i.current&&clearTimeout(i.current);}),[l]),a}function Fk(){let{width:e}=Ma();return e}function Bk(){let{height:e}=Ma();return e}function $k(e){let{width:t}=Ma();return t>=e}function Kk(){let{width:e}=Ma();return {isSm:e>=640,isMd:e>=768,isLg:e>=1024,isXl:e>=1280,is2xl:e>=1536}}function _k(e,t){let r=useCallback(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.warn(`Error reading localStorage key "${e}":`,i),t}},[t,e]),[n,o]=useState(r),a=useCallback(i=>{if(typeof window>"u"){console.warn(`Tried setting localStorage key "${e}" even though environment is not a browser`);return}try{let l=i instanceof Function?i(n):i;o(l),window.localStorage.setItem(e,JSON.stringify(l)),window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:JSON.stringify(l)}));}catch(l){console.warn(`Error setting localStorage key "${e}":`,l);}},[e,n]),s=useCallback(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(e),o(t),window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:null}));}catch(i){console.warn(`Error removing localStorage key "${e}":`,i);}},[e,t]);return useEffect(()=>{let i=l=>{if(l.key===e&&l.newValue!==null)try{o(JSON.parse(l.newValue));}catch{o(l.newValue);}else l.key===e&&l.newValue===null&&o(t);};return window.addEventListener("storage",i),()=>{window.removeEventListener("storage",i);}},[e,t]),[n,a,s]}function Wk(e,t){let r=useCallback(()=>{if(typeof window>"u")return t;try{let i=window.sessionStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.warn(`Error reading sessionStorage key "${e}":`,i),t}},[t,e]),[n,o]=useState(r),a=useCallback(i=>{if(typeof window>"u"){console.warn(`Tried setting sessionStorage key "${e}" even though environment is not a browser`);return}try{let l=i instanceof Function?i(n):i;o(l),window.sessionStorage.setItem(e,JSON.stringify(l));}catch(l){console.warn(`Error setting sessionStorage key "${e}":`,l);}},[e,n]),s=useCallback(()=>{if(!(typeof window>"u"))try{window.sessionStorage.removeItem(e),o(t);}catch(i){console.warn(`Error removing sessionStorage key "${e}":`,i);}},[e,t]);return [n,a,s]}function Xk(e,t=500){let[r,n]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{n(e);},t);return ()=>{clearTimeout(o);}},[e,t]),r}function Zk(e,t=500){let r=useRef(null),n=useRef(e);return useEffect(()=>{n.current=e;},[e]),useEffect(()=>()=>{r.current&&clearTimeout(r.current);},[]),useCallback((...a)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{n.current(...a);},t);},[t])}function Jk(e,t=500){let r=useRef(null),n=useRef(e),o=useRef(null);useEffect(()=>{n.current=e;},[e]),useEffect(()=>()=>{r.current&&clearTimeout(r.current);},[]);let a=useCallback((...c)=>{o.current=c,r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{n.current(...c),r.current=null,o.current=null;},t);},[t]),s=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null,o.current=null);},[]),i=useCallback(()=>{r.current&&o.current&&(clearTimeout(r.current),n.current(...o.current),r.current=null,o.current=null);},[]),l=useCallback(()=>r.current!==null,[]);return {debouncedCallback:a,cancel:s,flush:i,isPending:l}}function tS(e,t=500){let[r,n]=useState(e),o=useRef(Date.now());return useEffect(()=>{let a=Date.now();if(a>=o.current+t)o.current=a,n(e);else {let s=setTimeout(()=>{o.current=Date.now(),n(e);},t-(a-o.current));return ()=>clearTimeout(s)}},[e,t]),r}function rS(e,t=500){let r=useRef(0),n=useRef(null),o=useRef(e);return useEffect(()=>{o.current=e;},[e]),useEffect(()=>()=>{n.current&&clearTimeout(n.current);},[]),useCallback((...s)=>{let i=Date.now();i-r.current>=t?(o.current(...s),r.current=i):(n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{o.current(...s),r.current=Date.now();},t-(i-r.current)));},[t])}function oS(e,t=true){let r=useRef(null);return useEffect(()=>{if(!t)return;let n=o=>{let a=r.current;!a||a.contains(o.target)||e(o);};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n);}},[e,t]),r}function aS(e,t,r=true){useEffect(()=>{if(!r)return;let n=o=>{e.some(s=>{let i=s.current;return i&&i.contains(o.target)})||t(o);};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n);}},[e,t,r]);}function sS(e=2e3){let[t,r]=useState(null),[n,o]=useState(false),[a,s]=useState(false),i=useCallback(()=>{r(null),o(false);},[]),l=useCallback(async c=>{if(!navigator?.clipboard)return console.warn("Clipboard API not available"),false;s(true);try{return await navigator.clipboard.writeText(c),r(c),o(!0),e>0&&setTimeout(()=>{o(!1);},e),!0}catch(d){return console.warn("Copy to clipboard failed:",d),r(null),o(false),false}finally{s(false);}},[e]);return {copiedValue:t,success:n,isLoading:a,copy:l,reset:i}}function iS(){return useCallback(async e=>{if(!navigator?.clipboard)return console.warn("Clipboard API not available"),false;try{return await navigator.clipboard.writeText(e),!0}catch(t){return console.warn("Copy to clipboard failed:",t),false}},[])}function Gh(e){let t=e.toLowerCase().split("+");return {key:t[t.length-1],ctrl:t.includes("ctrl")||t.includes("control"),alt:t.includes("alt")||t.includes("option"),shift:t.includes("shift"),meta:t.includes("meta")||t.includes("cmd")||t.includes("command")}}function Uh(e,t){let r=e.key.toLowerCase(),n=r===" "?"space":r==="escape"?"esc":r,o=t.key==="space"?" ":t.key;return (n===o||e.code.toLowerCase()===`key${o}`)&&e.ctrlKey===t.ctrl&&e.altKey===t.alt&&e.shiftKey===t.shift&&e.metaKey===t.meta}function lS(e,t,r={}){let{enabled:n=true,preventDefault:o=true,stopPropagation:a=false,target:s=null}=r,i=useRef(t);i.current=t;let l=Gh(e);useEffect(()=>{if(!n)return;let c=u=>{Uh(u,l)&&(o&&u.preventDefault(),a&&u.stopPropagation(),i.current(u));},d=s||document;return d.addEventListener("keydown",c),()=>{d.removeEventListener("keydown",c);}},[n,o,a,s,l]);}function cS(e,t={}){let{enabled:r=true,preventDefault:n=true,stopPropagation:o=false,target:a=null}=t,s=useRef(e);s.current=e;let i=Object.entries(e).map(([l,c])=>({parsed:Gh(l),handler:c}));useEffect(()=>{if(!r)return;let l=d=>{for(let{parsed:u,handler:p}of i)if(Uh(d,u)){n&&d.preventDefault(),o&&d.stopPropagation(),p(d);break}},c=a||document;return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l);}},[r,n,o,a,i]);}function dS(e){let t=useRef(false);return useEffect(()=>{let r=o=>{o.key===e&&(t.current=true);},n=o=>{o.key===e&&(t.current=false);};return document.addEventListener("keydown",r),document.addEventListener("keyup",n),()=>{document.removeEventListener("keydown",r),document.removeEventListener("keyup",n);}},[e]),t.current}function uS(e,t,r,n){let o=useRef(t);o.current=t,useEffect(()=>{let a;if(r==null?a=window:"current"in r?a=r.current:a=r,!a)return;let s=i=>{o.current(i);};return a.addEventListener(e,s,n),()=>{a?.removeEventListener(e,s,n);}},[e,r,n]);}function mS(e,t,r){let n=useRef(null),o=useRef(t);return o.current=t,useEffect(()=>{let a=n.current;if(!a)return;let s=i=>{o.current(i);};return a.addEventListener(e,s,r),()=>{a.removeEventListener(e,s,r);}},[e,r]),n}function pS(e,t,r={}){let{target:n,event:o="keydown",enabled:a=true}=r,s=useRef(t);s.current=t,useEffect(()=>{if(!a)return;let i=n?.current||window,l=c=>{c.key===e&&s.current(c);};return i.addEventListener(o,l),()=>{i.removeEventListener(o,l);}},[e,n,o,a]);}function fS(e,t={}){let{threshold:r=500,onStart:n,onCancel:o,enabled:a=true}=t,s=useRef(null),i=useRef(false),l=useRef(null),c=useCallback(u=>{a&&(l.current=u,i.current=false,n?.(u),s.current=setTimeout(()=>{i.current=true,l.current&&e(l.current);},r));},[e,r,n,a]),d=useCallback(u=>{a&&(s.current&&(clearTimeout(s.current),s.current=null),i.current||o?.(u),i.current=false,l.current=null);},[o,a]);return {onMouseDown:c,onMouseUp:d,onMouseLeave:d,onTouchStart:c,onTouchEnd:d}}function gS(e){let t=useRef(null),[r,n]=useState(false),o=useCallback(()=>{n(true),e?.onHoverStart?.();},[e]),a=useCallback(()=>{n(false),e?.onHoverEnd?.();},[e]);return useEffect(()=>{let s=t.current;if(s)return s.addEventListener("mouseenter",o),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mouseenter",o),s.removeEventListener("mouseleave",a);}},[o,a]),{ref:t,isHovered:r}}function bS(e,t){let[r,n]=useState(false),o=useCallback(()=>{n(true),t?.onHoverStart?.();},[t]),a=useCallback(()=>{n(false),t?.onHoverEnd?.();},[t]);return useEffect(()=>{let s=e.current;if(s)return s.addEventListener("mouseenter",o),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mouseenter",o),s.removeEventListener("mouseleave",a);}},[e,o,a]),r}function vS(){let[e,t]=useState(false);return {isHovered:e,hoverProps:{onMouseEnter:()=>t(true),onMouseLeave:()=>t(false)}}}function hS(e=0){let t=useRef(null),[r,n]=useState(false),o=useRef(null);return useEffect(()=>{let a=t.current;if(!a)return;let s=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{n(true);},e);},i=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{n(false);},e);};return a.addEventListener("mouseenter",s),a.addEventListener("mouseleave",i),()=>{a.removeEventListener("mouseenter",s),a.removeEventListener("mouseleave",i),o.current&&clearTimeout(o.current);}},[e]),{ref:t,isHovered:r}}function yS(){let[e,t]=useState({x:0,y:0});return useEffect(()=>{let r=n=>{t({x:n.clientX,y:n.clientY});};return window.addEventListener("mousemove",r),()=>{window.removeEventListener("mousemove",r);}},[]),e}function RS(e={}){let{enabled:t=true,resetOnLeave:r=false}=e,n=useRef(null),[o,a]=useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});return useEffect(()=>{let s=n.current;if(!s||!t)return;let i=c=>{let d=s.getBoundingClientRect();a({x:c.clientX,y:c.clientY,elementX:c.clientX-d.left,elementY:c.clientY-d.top,elementPositionX:d.left,elementPositionY:d.top,pageX:c.pageX,pageY:c.pageY});},l=()=>{r&&a({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});};return s.addEventListener("mousemove",i),r&&s.addEventListener("mouseleave",l),()=>{s.removeEventListener("mousemove",i),r&&s.removeEventListener("mouseleave",l);}},[t,r]),{ref:n,...o}}function wS(e,t={}){let{enabled:r=true,resetOnLeave:n=false}=t,[o,a]=useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});return useEffect(()=>{let s=e.current;if(!s||!r)return;let i=c=>{let d=s.getBoundingClientRect();a({x:c.clientX,y:c.clientY,elementX:c.clientX-d.left,elementY:c.clientY-d.top,elementPositionX:d.left,elementPositionY:d.top,pageX:c.pageX,pageY:c.pageY});},l=()=>{n&&a({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});};return s.addEventListener("mousemove",i),n&&s.addEventListener("mouseleave",l),()=>{s.removeEventListener("mousemove",i),n&&s.removeEventListener("mouseleave",l);}},[e,r,n]),o}function CS(e={}){let{threshold:t=0,throttle:r=0,element:n}=e,[o,a]=useState({x:0,y:0,isScrolled:false,directionY:0,directionX:0,isAtBottom:false,isAtTop:true,progress:0}),s=useRef(0),i=useRef(0),l=useRef(false),c=useRef(0),d=useCallback(()=>{let p=n?.current,f=p?p.scrollTop:window.scrollY,g=p?p.scrollLeft:window.scrollX,v=p?p.scrollHeight-p.clientHeight:document.documentElement.scrollHeight-window.innerHeight,b=f>s.current?1:f<s.current?-1:0,h=g>i.current?1:g<i.current?-1:0;s.current=f,i.current=g,a({x:g,y:f,isScrolled:f>t,directionY:b,directionX:h,isAtBottom:f>=v-1,isAtTop:f<=0,progress:v>0?f/v:0}),l.current=false;},[n,t]),u=useCallback(()=>{let p=Date.now();if(r>0&&p-c.current<r){l.current||(l.current=true,requestAnimationFrame(d));return}c.current=p,l.current||(l.current=true,requestAnimationFrame(d));},[r,d]);return useEffect(()=>{let p=n?.current||window;return p.addEventListener("scroll",u,{passive:true}),d(),()=>{p.removeEventListener("scroll",u);}},[n,u,d]),o}function MS(){let[e,t]=useState({x:0,y:0});return useEffect(()=>{let r=()=>{t({x:window.scrollX,y:window.scrollY});};return window.addEventListener("scroll",r,{passive:true}),r(),()=>{window.removeEventListener("scroll",r);}},[]),e}function Zh(e={}){let{autoLock:t=false,lockX:r=true}=e,n=useRef(false),o=useRef({x:0,y:0}),a=useRef(null),s=useCallback(()=>{if(typeof document>"u"||n.current)return;let{body:l}=document,c=window.scrollY,d=window.scrollX;o.current={x:d,y:c},a.current={overflow:l.style.overflow,overflowX:l.style.overflowX,overflowY:l.style.overflowY,position:l.style.position,top:l.style.top,left:l.style.left,width:l.style.width},l.style.overflow="hidden",r&&(l.style.overflowX="hidden"),l.style.overflowY="hidden",l.style.position="fixed",l.style.top=`-${c}px`,l.style.left=r?`-${d}px`:"0",l.style.width="100%",n.current=true;},[r]),i=useCallback(()=>{if(typeof document>"u"||!n.current)return;let{body:l}=document,c=a.current;c&&(l.style.overflow=c.overflow,l.style.overflowX=c.overflowX,l.style.overflowY=c.overflowY,l.style.position=c.position,l.style.top=c.top,l.style.left=c.left,l.style.width=c.width),window.scrollTo(o.current.x,o.current.y),n.current=false;},[]);return useEffect(()=>(t&&s(),()=>{i();}),[t,s,i]),{lock:s,unlock:i,isLocked:n.current}}function TS(e=true){let{lock:t,unlock:r}=Zh();useEffect(()=>{e?t():r();},[e,t,r]);}function ex(e={}){let{root:t=null,rootMargin:r="0px",threshold:n=0,once:o=false,enabled:a=true}=e,s=useRef(null),[i,l]=useState({isIntersecting:false,entry:null});return useEffect(()=>{let c=s.current;if(!c||!a)return;let d=new IntersectionObserver(([u])=>{l({isIntersecting:u.isIntersecting,entry:u}),o&&u.isIntersecting&&d.disconnect();},{root:t,rootMargin:r,threshold:n});return d.observe(c),()=>{d.disconnect();}},[t,r,n,o,a]),{ref:s,...i}}function kS(e,t={}){let{root:r=null,rootMargin:n="0px",threshold:o=0,once:a=false,enabled:s=true}=t,[i,l]=useState({isIntersecting:false,entry:null});return useEffect(()=>{let c=e.current;if(!c||!s)return;let d=new IntersectionObserver(([u])=>{l({isIntersecting:u.isIntersecting,entry:u}),a&&u.isIntersecting&&d.disconnect();},{root:r,rootMargin:n,threshold:o});return d.observe(c),()=>{d.disconnect();}},[e,r,n,o,a,s]),i}function SS(e="200px"){let{ref:t,isIntersecting:r}=ex({rootMargin:e,once:true});return {ref:t,isVisible:r}}function ES(e,t={}){let{enabled:r=true,childList:n=true,attributes:o=true,characterData:a=false,subtree:s=false,attributeOldValue:i=false,characterDataOldValue:l=false,attributeFilter:c}=t,d=useRef(null),u=useRef(e);return u.current=e,useEffect(()=>{let p=d.current;if(!p||!r)return;let f=new MutationObserver((g,v)=>{u.current(g,v);});return f.observe(p,{childList:n,attributes:o,characterData:a,subtree:s,attributeOldValue:i,characterDataOldValue:l,attributeFilter:c}),()=>{f.disconnect();}},[r,n,o,a,s,i,l,c]),d}function PS(e,t,r={}){let{enabled:n=true,childList:o=true,attributes:a=true,characterData:s=false,subtree:i=false,attributeOldValue:l=false,characterDataOldValue:c=false,attributeFilter:d}=r,u=useRef(t);u.current=t,useEffect(()=>{let p=e.current;if(!p||!n)return;let f=new MutationObserver((g,v)=>{u.current(g,v);});return f.observe(p,{childList:o,attributes:a,characterData:s,subtree:i,attributeOldValue:l,characterDataOldValue:c,attributeFilter:d}),()=>{f.disconnect();}},[e,n,o,a,s,i,l,c,d]);}function LS(e={}){let{enabled:t=true,box:r="content-box",debounce:n=0}=e,o=useRef(null),[a,s]=useState({width:0,height:0}),i=useRef(null),l=useCallback(c=>{let d=c[0];if(!d)return;let u,p;r==="border-box"&&d.borderBoxSize?.[0]?(u=d.borderBoxSize[0].inlineSize,p=d.borderBoxSize[0].blockSize):d.contentBoxSize?.[0]?(u=d.contentBoxSize[0].inlineSize,p=d.contentBoxSize[0].blockSize):(u=d.contentRect.width,p=d.contentRect.height);let f=()=>s({width:u,height:p});n>0?(i.current&&clearTimeout(i.current),i.current=setTimeout(f,n)):f();},[r,n]);return useEffect(()=>{let c=o.current;if(!c||!t)return;let d=new ResizeObserver(l);d.observe(c,{box:r});let u=c.getBoundingClientRect();return s({width:u.width,height:u.height}),()=>{d.disconnect(),i.current&&clearTimeout(i.current);}},[t,r,l]),{ref:o,...a}}function DS(e,t={}){let{enabled:r=true,box:n="content-box",debounce:o=0}=t,[a,s]=useState({width:0,height:0}),i=useRef(null),l=useCallback(c=>{let d=c[0];if(!d)return;let u,p;n==="border-box"&&d.borderBoxSize?.[0]?(u=d.borderBoxSize[0].inlineSize,p=d.borderBoxSize[0].blockSize):d.contentBoxSize?.[0]?(u=d.contentBoxSize[0].inlineSize,p=d.contentBoxSize[0].blockSize):(u=d.contentRect.width,p=d.contentRect.height);let f=()=>s({width:u,height:p});o>0?(i.current&&clearTimeout(i.current),i.current=setTimeout(f,o)):f();},[n,o]);return useEffect(()=>{let c=e.current;if(!c||!r)return;let d=new ResizeObserver(l);d.observe(c,{box:n});let u=c.getBoundingClientRect();return s({width:u.width,height:u.height}),()=>{d.disconnect(),i.current&&clearTimeout(i.current);}},[e,r,n,l]),a}function HS(){let e=useRef(null),t=useCallback(()=>{let r=e.current;if(!r)return {width:0,height:0};let n=r.getBoundingClientRect();return {width:n.width,height:n.height}},[]);return {ref:e,measure:t}}function ox(e={}){let{defaultOpen:t=false,isOpen:r,onOpen:n,onClose:o,onChange:a,id:s}=e,[i,l]=useState(t),c=r!==void 0,d=c?r:i,u=useCallback(()=>{c||l(true),n?.(),a?.(true);},[c,n,a]),p=useCallback(()=>{c||l(false),o?.(),a?.(false);},[c,o,a]),f=useCallback(()=>{d?p():u();},[d,u,p]),g=useCallback(h=>{h?u():p();},[u,p]),v=useCallback(()=>({onClick:f,"aria-expanded":d,...s&&{"aria-controls":s}}),[f,d,s]),b=useCallback(()=>({hidden:!d,...s&&{id:s}}),[d,s]);return useMemo(()=>({isOpen:d,open:u,close:p,toggle:f,setIsOpen:g,getButtonProps:v,getDisclosureProps:b}),[d,u,p,f,g,v,b])}function AS(e){return ox({...e,defaultOpen:true})}function zS(e=false){let[t,r]=useState(e),n=useCallback(()=>{r(o=>!o);},[]);return [t,n,r]}function OS(e,t=0){let[r,n]=useState(t),o=useCallback(()=>{n(i=>(i+1)%e.length);},[e.length]),a=useCallback(()=>{n(i=>(i-1+e.length)%e.length);},[e.length]),s=useCallback(i=>{let l=e.indexOf(i);l!==-1&&n(l);},[e]);return useMemo(()=>({value:e[r],index:r,next:o,prev:a,setIndex:n,setValue:s}),[e,r,o,a,s])}function FS(e=false){let[t,r]=useState(e),n=useCallback(()=>r(s=>!s),[]),o=useCallback(()=>r(true),[]),a=useCallback(()=>r(false),[]);return useMemo(()=>({value:t,toggle:n,on:o,off:a,set:r}),[t,n,o,a])}function $S(e=0,t={}){let{min:r=-1/0,max:n=1/0,step:o=1}=t,a=useCallback(g=>Math.min(Math.max(g,r),n),[r,n]),[s,i]=useState(()=>a(e)),l=useCallback(()=>{i(g=>a(g+o));},[a,o]),c=useCallback(()=>{i(g=>a(g-o));},[a,o]),d=useCallback(g=>{i(a(g));},[a]),u=useCallback(()=>{i(a(e));},[a,e]),p=s<=r,f=s>=n;return useMemo(()=>({count:s,increment:l,decrement:c,set:d,reset:u,isMin:p,isMax:f}),[s,l,c,d,u,p,f])}function KS(e=0){let[t,r]=useState(e),n=useCallback(()=>r(o=>o+1),[]);return [t,n]}function GS(e){let t=useRef(void 0);return useEffect(()=>{t.current=e;},[e]),t.current}function US(e,t){let r=useRef(t);return useEffect(()=>{r.current=e;},[e]),r.current}function _S(e){let t=useRef(void 0),r=useRef(e),n=r.current!==e;return useEffect(()=>{t.current=r.current,r.current=e;},[e]),{current:e,previous:t.current,hasChanged:n}}function YS(e=[]){let[t,r]=useState(e),n=useCallback(w=>{r(w);},[]),o=useCallback(w=>{r(y=>[...y,w]);},[]),a=useCallback(w=>{r(y=>[...y,...w]);},[]),s=useCallback((w,y)=>{r(C=>{let E=[...C];return E.splice(w,0,y),E});},[]),i=useCallback((w,y)=>{r(C=>{let E=[...C];return E[w]=y,E});},[]),l=useCallback(w=>{r(y=>y.filter((C,E)=>E!==w));},[]),c=useCallback(w=>{r(y=>{let C=y.indexOf(w);return C===-1?y:y.filter((E,L)=>L!==C)});},[]),d=useCallback(w=>{r(y=>y.filter(C=>!w(C)));},[]),u=useCallback(()=>{let w;return r(y=>y.length===0?y:(w=y[0],y.slice(1))),w},[]),p=useCallback(w=>{r(y=>[w,...y]);},[]),f=useCallback(()=>{let w;return r(y=>y.length===0?y:(w=y[y.length-1],y.slice(0,-1))),w},[]),g=useCallback(()=>{r([]);},[]),v=useCallback(()=>{r(e);},[e]),b=useCallback((w,y)=>{r(C=>{let E=[...C],[L]=E.splice(w,1);return E.splice(y,0,L),E});},[]),h=useCallback((w,y)=>{r(C=>{let E=[...C];return [E[w],E[y]]=[E[y],E[w]],E});},[]),x=useCallback(w=>t.filter(w),[t]),R=useCallback(w=>t.find(w),[t]),N=useCallback(w=>t.includes(w),[t]);return useMemo(()=>({list:t,set:n,push:o,pushMany:a,insertAt:s,updateAt:i,removeAt:l,remove:c,removeWhere:d,shift:u,unshift:p,pop:f,clear:g,reset:v,move:b,swap:h,filter:x,find:R,includes:N,length:t.length,isEmpty:t.length===0}),[t,n,o,a,s,i,l,c,d,u,p,f,g,v,b,h,x,R,N])}function qS(e=[]){let[t,r]=useState(()=>new Map(e)),n=useCallback(f=>t.get(f),[t]),o=useCallback((f,g)=>{r(v=>{let b=new Map(v);return b.set(f,g),b});},[]),a=useCallback(f=>{r(g=>{let v=new Map(g);return f.forEach(([b,h])=>v.set(b,h)),v});},[]),s=useCallback(f=>t.has(f),[t]),i=useCallback(f=>{r(g=>{let v=new Map(g);return v.delete(f),v});},[]),l=useCallback(()=>{r(new Map);},[]),c=useCallback(()=>{r(new Map(e));},[e]),d=useCallback(()=>Array.from(t.keys()),[t]),u=useCallback(()=>Array.from(t.values()),[t]),p=useCallback(()=>Array.from(t.entries()),[t]);return useMemo(()=>({map:t,get:n,set:o,setMany:a,has:s,delete:i,clear:l,reset:c,keys:d,values:u,entries:p,size:t.size,isEmpty:t.size===0}),[t,n,o,a,s,i,l,c,d,u,p])}function XS(e={}){let[t,r]=useState(e),n=useCallback(d=>t[d],[t]),o=useCallback((d,u)=>{r(p=>({...p,[d]:u}));},[]),a=useCallback(d=>{r(u=>({...u,...d}));},[]),s=useCallback(d=>{r(u=>{let{[d]:p,...f}=u;return f});},[]),i=useCallback(()=>{r({});},[]),l=useCallback(()=>{r(e);},[e]),c=useCallback(d=>d in t,[t]);return useMemo(()=>({value:t,get:n,set:o,setAll:a,remove:s,clear:i,reset:l,has:c,keys:Object.keys(t),values:Object.values(t)}),[t,n,o,a,s,i,l,c])}function dx(e=[]){let[t,r]=useState(()=>new Set(e)),n=useCallback(u=>{r(p=>{let f=new Set(p);return f.add(u),f});},[]),o=useCallback(u=>{r(p=>{let f=new Set(p);return u.forEach(g=>f.add(g)),f});},[]),a=useCallback(u=>{r(p=>{let f=new Set(p);return f.delete(u),f});},[]),s=useCallback(u=>t.has(u),[t]),i=useCallback(u=>{r(p=>{let f=new Set(p);return f.has(u)?f.delete(u):f.add(u),f});},[]),l=useCallback(()=>{r(new Set);},[]),c=useCallback(()=>{r(new Set(e));},[e]),d=useCallback(()=>Array.from(t),[t]);return useMemo(()=>({set:t,add:n,addMany:o,remove:a,has:s,toggle:i,clear:l,reset:c,values:d,size:t.size,isEmpty:t.size===0}),[t,n,o,a,s,i,l,c,d])}function JS(e=[]){let{add:t,remove:r,has:n,toggle:o,clear:a,addMany:s,values:i,size:l}=dx(e);return useMemo(()=>({selected:i(),isSelected:n,select:t,deselect:r,toggle:o,selectAll:s,deselectAll:a,count:l,isEmpty:l===0}),[i,n,t,r,o,s,a,l])}function QS(e=[]){let[t,r]=useState(e),n=useCallback(c=>{r(d=>[...d,c]);},[]),o=useCallback(c=>{r(d=>[...d,...c]);},[]),a=useCallback(()=>{let c;return r(d=>d.length===0?d:(c=d[0],d.slice(1))),c},[]),s=useCallback(()=>t[0],[t]),i=useCallback(()=>t[t.length-1],[t]),l=useCallback(()=>{r([]);},[]);return useMemo(()=>({queue:t,enqueue:n,enqueueMany:o,dequeue:a,peek:s,peekLast:i,clear:l,size:t.length,isEmpty:t.length===0,hasItems:t.length>0}),[t,n,o,a,s,i,l])}function eE(e=[]){let[t,r]=useState(e),n=useCallback(l=>{r(c=>[...c,l]);},[]),o=useCallback(l=>{r(c=>[...c,...l]);},[]),a=useCallback(()=>{let l;return r(c=>c.length===0?c:(l=c[c.length-1],c.slice(0,-1))),l},[]),s=useCallback(()=>t[t.length-1],[t]),i=useCallback(()=>{r([]);},[]);return useMemo(()=>({stack:t,push:n,pushMany:o,pop:a,peek:s,clear:i,size:t.length,isEmpty:t.length===0}),[t,n,o,a,s,i])}function fx(e,t=false){let[r,n]=useState({data:null,error:null,isLoading:false,isSuccess:false,isError:false,isIdle:true}),o=useRef(true),a=useRef(e);a.current=e;let s=useCallback(async(...l)=>{n(c=>({...c,isLoading:true,isIdle:false,isError:false,error:null}));try{let c=await a.current(...l);return o.current&&n({data:c,error:null,isLoading:!1,isSuccess:!0,isError:!1,isIdle:!1}),c}catch(c){let d=c instanceof Error?c:new Error(String(c));return o.current&&n({data:null,error:d,isLoading:false,isSuccess:false,isError:true,isIdle:false}),null}},[]),i=useCallback(()=>{n({data:null,error:null,isLoading:false,isSuccess:false,isError:false,isIdle:true});},[]);return useEffect(()=>(o.current=true,t&&s(),()=>{o.current=false;}),[t,s]),{...r,execute:s,reset:i}}function rE(e,t=3,r=1e3){let[n,o]=useState(0),a=useRef(e);a.current=e;let s=useCallback(async(...l)=>{let c=null;for(let d=0;d<=t;d++)try{return o(d),await a.current(...l)}catch(u){c=u instanceof Error?u:new Error(String(u)),d<t&&await new Promise(p=>setTimeout(p,r));}throw c},[t,r]);return {...fx(s,false),retryCount:n}}var vx=new Map,nE=300*1e3;function oE(e,t={}){let{immediate:r=true,init:n,transform:o,deps:a=[],enabled:s=true,refetchInterval:i,cacheKey:l}=t,[c,d]=useState({data:null,error:null,isLoading:false,isSuccess:false,isError:false}),u=useRef(null),p=useRef(true),f=useCallback(async()=>{if(!e||!s)return;let v=l||e,b=vx.get(v);if(b&&Date.now()-b.timestamp<nE){d({data:b.data,error:null,isLoading:false,isSuccess:true,isError:false});return}u.current&&u.current.abort(),u.current=new AbortController,d(h=>({...h,isLoading:true,error:null}));try{let h=await fetch(e,{...n,signal:u.current.signal});if(!h.ok)throw new Error(`HTTP error! status: ${h.status}`);let x=await h.json(),R=o?o(x):x;vx.set(v,{data:R,timestamp:Date.now()}),p.current&&d({data:R,error:null,isLoading:!1,isSuccess:!0,isError:!1});}catch(h){if(h instanceof Error&&h.name==="AbortError")return;let x=h instanceof Error?h:new Error(String(h));p.current&&d({data:null,error:x,isLoading:false,isSuccess:false,isError:true});}},[e,s,n,o,l]),g=useCallback(()=>{u.current&&u.current.abort();},[]);return useEffect(()=>(p.current=true,r&&s&&f(),()=>{p.current=false,g();}),[e,r,s,...a]),useEffect(()=>{if(!i||!s)return;let v=setInterval(f,i);return ()=>{clearInterval(v);}},[i,s,f]),{...c,refetch:f,abort:g}}function aE(e,t={}){let{transform:r,...n}=t,[o,a]=useState({data:null,error:null,isLoading:false,isSuccess:false,isError:false}),s=useCallback(async l=>{a(c=>({...c,isLoading:true,error:null}));try{let c=await fetch(e,{...n,method:n.method||"POST",headers:{"Content-Type":"application/json",...n.headers},body:l?JSON.stringify(l):void 0});if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);let d=await c.json(),u=r?r(d):d;return a({data:u,error:null,isLoading:!1,isSuccess:!0,isError:!1}),u}catch(c){let d=c instanceof Error?c:new Error(String(c));return a({data:null,error:d,isLoading:false,isSuccess:false,isError:true}),null}},[e,n,r]),i=useCallback(()=>{a({data:null,error:null,isLoading:false,isSuccess:false,isError:false});},[]);return {...o,mutate:s,reset:i}}function mi(e,t){let r=useRef(e);r.current=e,useEffect(()=>{if(t===null)return;let n=setInterval(()=>{r.current();},t);return ()=>{clearInterval(n);}},[t]);}function iE(e,t){let[r,n]=useState(false);mi(e,r?t:null);let o=useCallback(()=>n(true),[]),a=useCallback(()=>n(false),[]),s=useCallback(()=>n(i=>!i),[]);return {start:o,stop:a,toggle:s,isRunning:r}}function lE(e,t={}){let{interval:r=1e3,onComplete:n,autoStart:o=false}=t,[a,s]=useState(e),[i,l]=useState(o),c=useRef(n);c.current=n;let d=a<=0;mi(()=>{s(g=>{let v=g-1;return v<=0?(l(false),c.current?.(),0):v});},i&&!d?r:null);let u=useCallback(()=>{d||l(true);},[d]),p=useCallback(()=>{l(false);},[]),f=useCallback(g=>{s(g??e),l(false);},[e]);return {seconds:a,isRunning:i,isComplete:d,start:u,pause:p,reset:f}}function cE(e={}){let{interval:t=1e3,maxSeconds:r,autoStart:n=false}=e,[o,a]=useState(0),[s,i]=useState(n),l=s&&(r===void 0||o<r);mi(()=>{a(f=>f+1);},l?t:null);let c=useCallback(()=>i(true),[]),d=useCallback(()=>i(false),[]),u=useCallback(()=>i(f=>!f),[]),p=useCallback(()=>{a(0),i(false);},[]);return {seconds:o,isRunning:s,start:c,stop:d,reset:p,toggle:u}}function yx(e,t){let r=useRef(e);r.current=e,useEffect(()=>{if(t===null)return;let n=setTimeout(()=>{r.current();},t);return ()=>{clearTimeout(n);}},[t]);}function dE(e,t){let[r,n]=useState(false),o=useRef(null),a=useRef(e);a.current=e;let s=useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null),n(false);},[]),i=useCallback(()=>{s(),n(true),o.current=setTimeout(()=>{a.current(),n(false);},t);},[t,s]),l=useCallback(()=>{i();},[i]);return useEffect(()=>()=>{o.current&&clearTimeout(o.current);},[]),{start:i,cancel:s,reset:l,isScheduled:r}}function uE(e,t){let[r,n]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{n(e);},t);return ()=>{clearTimeout(o);}},[e,t]),r}function mE(e,t=true){let[r,n]=useState(false);return yx(()=>{n(true);},t?e:null),r}function pE(e,t=true){let[r,n]=useState(t),[o,a]=useState(0),[s,i]=useState(0),l=useRef(e);l.current=e;let c=useRef(null),d=useRef(0),u=useRef(0),p=useRef(0),f=useRef(0),g=useCallback(h=>{let x=d.current?h-d.current:0;d.current=h,f.current++,h-p.current>=1e3&&(a(f.current),f.current=0,p.current=h),u.current++,i(u.current),l.current(x,h),c.current=requestAnimationFrame(g);},[]),v=useCallback(()=>{c.current===null&&(d.current=0,p.current=performance.now(),f.current=0,c.current=requestAnimationFrame(g),n(true));},[g]),b=useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null,n(false));},[]);return useEffect(()=>(t&&v(),()=>{c.current!==null&&cancelAnimationFrame(c.current);}),[t,v]),{start:v,stop:b,isRunning:r,frameCount:s,fps:o}}function fE(e,t={}){let{duration:r=300,easing:n="easeOutCubic"}=t,[o,a]=useState(e),s=useRef(e),i=useRef(null),l=useRef(null),c={linear:d=>d,easeInCubic:d=>d*d*d,easeOutCubic:d=>1-Math.pow(1-d,3),easeInOutCubic:d=>d<.5?4*d*d*d:1-Math.pow(-2*d+2,3)/2};return useEffect(()=>{if(o===e)return;s.current=o,i.current=null;let d=u=>{i.current===null&&(i.current=u);let p=u-i.current,f=Math.min(p/r,1),g=c[n](f),v=s.current+(e-s.current)*g;a(v),f<1&&(l.current=requestAnimationFrame(d));};return l.current=requestAnimationFrame(d),()=>{l.current!==null&&cancelAnimationFrame(l.current);}},[e,r,n]),o}function gE(e,t={}){let{stiffness:r=100,damping:n=10,mass:o=1}=t,[a,s]=useState(e),i=useRef(0),l=useRef(null),c=useRef(null);return useEffect(()=>{if(Math.abs(a-e)<.01&&Math.abs(i.current)<.01){s(e);return}let d=u=>{c.current===null&&(c.current=u);let p=Math.min((u-c.current)/1e3,.064);c.current=u;let f=(e-a)*r,g=i.current*n,v=(f-g)/o;i.current+=v*p;let b=a+i.current*p;s(b),Math.abs(b-e)>.01||Math.abs(i.current)>.01?l.current=requestAnimationFrame(d):(s(e),i.current=0);};return c.current=null,l.current=requestAnimationFrame(d),()=>{l.current!==null&&cancelAnimationFrame(l.current);}},[e,r,n,o,a]),a}var Mx=["mousemove","mousedown","resize","keydown","touchstart","wheel","scroll"];function bE(e,t={}){let{events:r=Mx,initialState:n=false,enabled:o=true}=t,[a,s]=useState(n),i=useRef(null),l=useCallback(()=>{s(false),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{s(true);},e);},[e]);return useEffect(()=>{if(o)return l(),r.forEach(c=>{window.addEventListener(c,l);}),()=>{i.current&&clearTimeout(i.current),r.forEach(c=>{window.removeEventListener(c,l);});}},[o,r,l]),a}function vE(e,t,r,n={}){let{events:o=Mx,initialState:a=false,enabled:s=true}=n,[i,l]=useState(a),c=useRef(null),d=useRef(a),u=useCallback(()=>{d.current&&(d.current=false,r?.()),l(false),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{d.current=true,l(true),t?.();},e);},[e,t,r]);return useEffect(()=>{if(s)return u(),o.forEach(p=>{window.addEventListener(p,u);}),()=>{c.current&&clearTimeout(c.current),o.forEach(p=>{window.removeEventListener(p,u);});}},[s,o,u]),i}function Nx(){let[e,t]=useState(()=>typeof document>"u"?"visible":document.visibilityState);return useEffect(()=>{let r=()=>{t(document.visibilityState);};return document.addEventListener("visibilitychange",r),()=>{document.removeEventListener("visibilitychange",r);}},[]),e}function yE(){return Nx()==="visible"}function RE(e,t){let r=useCallback(()=>{document.visibilityState==="visible"?e?.():t?.();},[e,t]);useEffect(()=>(document.addEventListener("visibilitychange",r),()=>{document.removeEventListener("visibilitychange",r);}),[r]);}function wE(){let[e,t]=useState(()=>typeof navigator>"u"?true:navigator.onLine);return useEffect(()=>{let r=()=>t(true),n=()=>t(false);return window.addEventListener("online",r),window.addEventListener("offline",n),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n);}},[]),e}function CE(e,t){let[r,n]=useState(()=>typeof navigator>"u"?true:navigator.onLine),o=useCallback(()=>{n(true),e?.();},[e]),a=useCallback(()=>{n(false),t?.();},[t]);return useEffect(()=>(window.addEventListener("online",o),window.addEventListener("offline",a),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",a);}),[o,a]),r}function Px(e){let[t,r]=useState(false),n=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),o=useCallback(async()=>{let i=e?.current||document.documentElement;try{i.requestFullscreen?await i.requestFullscreen():i.webkitRequestFullscreen?await i.webkitRequestFullscreen():i.mozRequestFullScreen?await i.mozRequestFullScreen():i.msRequestFullscreen&&await i.msRequestFullscreen();}catch(l){console.error("Failed to enter fullscreen:",l);}},[e]),a=useCallback(async()=>{try{document.exitFullscreen?await document.exitFullscreen():document.webkitExitFullscreen?await document.webkitExitFullscreen():document.mozCancelFullScreen?await document.mozCancelFullScreen():document.msExitFullscreen&&await document.msExitFullscreen();}catch(i){console.error("Failed to exit fullscreen:",i);}},[]),s=useCallback(async()=>{t?await a():await o();},[t,o,a]);return useEffect(()=>{let i=()=>{r(!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement));};return document.addEventListener("fullscreenchange",i),document.addEventListener("webkitfullscreenchange",i),document.addEventListener("mozfullscreenchange",i),document.addEventListener("MSFullscreenChange",i),()=>{document.removeEventListener("fullscreenchange",i),document.removeEventListener("webkitfullscreenchange",i),document.removeEventListener("mozfullscreenchange",i),document.removeEventListener("MSFullscreenChange",i);}},[]),{isFullscreen:t,enter:o,exit:a,toggle:s,isSupported:n}}function kE(){let e=useRef(null),t=Px(e);return {ref:e,...t}}function PE(e={}){let{watch:t=false,immediate:r=true,enableHighAccuracy:n=true,maximumAge:o=0,timeout:a=1e4}=e,[s,i]=useState({isLoading:false,position:null,error:null,latitude:null,longitude:null,accuracy:null,altitude:null,altitudeAccuracy:null,heading:null,speed:null,timestamp:null}),l=typeof navigator<"u"&&"geolocation"in navigator,c=useCallback(p=>{i({isLoading:false,position:p,error:null,latitude:p.coords.latitude,longitude:p.coords.longitude,accuracy:p.coords.accuracy,altitude:p.coords.altitude,altitudeAccuracy:p.coords.altitudeAccuracy,heading:p.coords.heading,speed:p.coords.speed,timestamp:p.timestamp});},[]),d=useCallback(p=>{i(f=>({...f,isLoading:false,error:p}));},[]),u=useCallback(()=>{l&&(i(p=>({...p,isLoading:true,error:null})),navigator.geolocation.getCurrentPosition(c,d,{enableHighAccuracy:n,maximumAge:o,timeout:a}));},[l,c,d,n,o,a]);return useEffect(()=>{if(l&&(r&&u(),t)){let p=navigator.geolocation.watchPosition(c,d,{enableHighAccuracy:n,maximumAge:o,timeout:a});return ()=>{navigator.geolocation.clearWatch(p);}}},[t,r,l,u,c,d,n,o,a]),{...s,getCurrentPosition:u,isSupported:l}}function LE(e,t,r,n){if(e===null||t===null||r===null||n===null)return null;let o=6371e3,a=e*Math.PI/180,s=r*Math.PI/180,i=(r-e)*Math.PI/180,l=(n-t)*Math.PI/180,c=Math.sin(i/2)*Math.sin(i/2)+Math.cos(a)*Math.cos(s)*Math.sin(l/2)*Math.sin(l/2),d=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return o*d}function DE(e){let[t,r]=useState(null),[n,o]=useState(true),a=typeof navigator<"u"&&"permissions"in navigator,s=useCallback(async()=>{if(!a)return o(false),null;try{o(!0);let i=await navigator.permissions.query({name:e});return r(i.state),o(!1),i.state}catch(i){return console.error(`Permission query failed for ${e}:`,i),o(false),null}},[e,a]);return useEffect(()=>{if(!a){o(false);return}let i=null,l=()=>{i&&r(i.state);};return navigator.permissions.query({name:e}).then(c=>{i=c,r(c.state),o(false),c.addEventListener("change",l);}).catch(()=>{o(false);}),()=>{i&&i.removeEventListener("change",l);}},[e,a]),{state:t,isGranted:t==="granted",isDenied:t==="denied",isPrompt:t==="prompt",isLoading:n,isSupported:a,query:s}}function HE(){let[e,t]=useState(typeof Notification<"u"?Notification.permission:"default"),r=typeof Notification<"u",n=useCallback(async()=>{if(!r)return "default";let o=await Notification.requestPermission();return t(o),o},[r]);return useEffect(()=>{r&&t(Notification.permission);},[r]),{permission:e,request:n,isSupported:r}}function IE(e){let[t,r]=useState(null),[n,o]=useState(null),[a,s]=useState(false),i=typeof navigator<"u"&&"mediaDevices"in navigator,l=useCallback(async()=>{if(!i)return null;s(true),o(null);try{let d=await navigator.mediaDevices.getUserMedia(e);return r(d),s(!1),d}catch(d){let u=d instanceof Error?d:new Error(String(d));return o(u),s(false),null}},[e,i]),c=useCallback(()=>{t&&(t.getTracks().forEach(d=>d.stop()),r(null));},[t]);return useEffect(()=>()=>{t&&t.getTracks().forEach(d=>d.stop());},[t]),{stream:t,error:n,isLoading:a,request:l,stop:c,isSupported:i}}function AE(e={}){let{voice:t=null,rate:r=1,pitch:n=1,volume:o=1,lang:a="en-US"}=e,[s,i]=useState(false),[l,c]=useState(false),[d,u]=useState([]),p=typeof window<"u"&&"speechSynthesis"in window;useEffect(()=>{if(!p)return;let h=()=>{u(window.speechSynthesis.getVoices());};return h(),window.speechSynthesis.addEventListener("voiceschanged",h),()=>{window.speechSynthesis.removeEventListener("voiceschanged",h);}},[p]);let f=useCallback(h=>{if(!p)return;window.speechSynthesis.cancel();let x=new SpeechSynthesisUtterance(h);x.voice=t,x.rate=r,x.pitch=n,x.volume=o,x.lang=a,x.onstart=()=>i(true),x.onend=()=>{i(false),c(false);},x.onerror=()=>{i(false),c(false);},window.speechSynthesis.speak(x);},[p,t,r,n,o,a]),g=useCallback(()=>{p&&(window.speechSynthesis.cancel(),i(false),c(false));},[p]),v=useCallback(()=>{p&&(window.speechSynthesis.pause(),c(true));},[p]),b=useCallback(()=>{p&&(window.speechSynthesis.resume(),c(false));},[p]);return {speak:f,stop:g,pause:v,resume:b,isSpeaking:s,isPaused:l,isSupported:p,voices:d}}function zE(e={}){let{lang:t="en-US",continuous:r=false,interimResults:n=true}=e,[o,a]=useState(false),[s,i]=useState(""),[l,c]=useState(""),[d,u]=useState(null),p=useRef(null),f=typeof window<"u"?window.SpeechRecognition||window.webkitSpeechRecognition:null,g=f!==null;useEffect(()=>{if(!g||!f)return;let R=new f;return R.lang=t,R.continuous=r,R.interimResults=n,R.onstart=()=>{a(true),u(null);},R.onend=()=>{a(false);},R.onerror=N=>{u(new Error(N.error)),a(false);},R.onresult=N=>{let w="",y="";for(let C=N.resultIndex;C<N.results.length;C++){let E=N.results[C];E.isFinal?y+=E[0].transcript:w+=E[0].transcript;}y&&i(C=>C+y),c(w);},p.current=R,()=>{R.abort();}},[g,f,t,r,n]);let v=useCallback(()=>{if(p.current&&!o)try{p.current.start();}catch{}},[o]),b=useCallback(()=>{p.current&&p.current.stop();},[]),h=useCallback(()=>{p.current&&p.current.abort();},[]),x=useCallback(()=>{i(""),c(""),u(null);},[]);return {start:v,stop:b,abort:h,isListening:o,transcript:s,interimTranscript:l,isSupported:g,error:d,reset:x}}var Dx=[{label:"At least 8 characters",test:e=>e.length>=8},{label:"Contains uppercase",test:e=>/[A-Z]/.test(e)},{label:"Contains lowercase",test:e=>/[a-z]/.test(e)},{label:"Contains number",test:e=>/[0-9]/.test(e)},{label:"Contains special character",test:e=>/[!@#$%^&*(),.?":{}|<>]/.test(e)}];function OE(e,t=Dx){return e?t.filter(n=>n.test(e)).length/t.length:0}function FE(e){return e<.4?"bg-red-500":e<.7?"bg-yellow-500":"bg-green-500"}function BE(e){return e<.4?"Weak":e<.7?"Medium":"Strong"}function xr(e){let t=e.replace(/^#/,""),r=t.length===3?t.split("").map(o=>o+o).join(""):t;if(r.length!==6)return null;let n=parseInt(r,16);return isNaN(n)?null:{r:n>>16&255,g:n>>8&255,b:n&255}}function $E(e){let t=e.replace(/^#/,"");if(t.length===8){let n=xr(t.slice(0,6));if(!n)return null;let o=parseInt(t.slice(6,8),16)/255;return {...n,a:Math.round(o*100)/100}}let r=xr(e);return r?{...r,a:1}:null}function Ea(e,t,r){let n=o=>{let a=Math.max(0,Math.min(255,Math.round(o))).toString(16);return a.length===1?"0"+a:a};return `#${n(e)}${n(t)}${n(r)}`}function KE(e,t,r,n){let o=Ea(e,t,r),a=Math.round(n*255).toString(16).padStart(2,"0");return `${o}${a}`}function Hx(e,t,r){e/=255,t/=255,r/=255;let n=Math.max(e,t,r),o=Math.min(e,t,r),a=0,s=0,i=(n+o)/2;if(n!==o){let l=n-o;switch(s=i>.5?l/(2-n-o):l/(n+o),n){case e:a=((t-r)/l+(t<r?6:0))/6;break;case t:a=((r-e)/l+2)/6;break;case r:a=((e-t)/l+4)/6;break}}return {h:Math.round(a*360),s:Math.round(s*100),l:Math.round(i*100)}}function Kc(e,t,r){e/=360,t/=100,r/=100;let n,o,a;if(t===0)n=o=a=r;else {let s=(c,d,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?c+(d-c)*6*u:u<.5?d:u<.6666666666666666?c+(d-c)*(.6666666666666666-u)*6:c),i=r<.5?r*(1+t):r+t-r*t,l=2*r-i;n=s(l,i,e+1/3),o=s(l,i,e),a=s(l,i,e-1/3);}return {r:Math.round(n*255),g:Math.round(o*255),b:Math.round(a*255)}}function Qn(e){let t=xr(e);return t?Hx(t.r,t.g,t.b):null}function $o(e,t,r){let n=Kc(e,t,r);return Ea(n.r,n.g,n.b)}function $c(e,t,r){let[n,o,a]=[e,t,r].map(s=>(s/=255,s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4)));return .2126*n+.7152*o+.0722*a}function Gc(e,t){let r=xr(e),n=xr(t);if(!r||!n)return 1;let o=$c(r.r,r.g,r.b),a=$c(n.r,n.g,n.b),s=Math.max(o,a),i=Math.min(o,a);return Math.round((s+.05)/(i+.05)*100)/100}function GE(e,t,r=false){let n=Gc(e,t);return r?n>=3:n>=4.5}function UE(e,t,r=false){let n=Gc(e,t);return r?n>=4.5:n>=7}function Uc(e){let t=Qn(e);return t?t.l>50:false}function _E(e){return !Uc(e)}function jE(e){return Uc(e)?"#000000":"#ffffff"}function WE(e,t){let r=Qn(e);if(!r)return e;let n=Math.min(100,r.l+t);return $o(r.h,r.s,n)}function YE(e,t){let r=Qn(e);if(!r)return e;let n=Math.max(0,r.l-t);return $o(r.h,r.s,n)}function qE(e,t){let r=Qn(e);if(!r)return e;let n=Math.min(100,r.s+t);return $o(r.h,n,r.l)}function XE(e,t){let r=Qn(e);if(!r)return e;let n=Math.max(0,r.s-t);return $o(r.h,n,r.l)}function ZE(e,t){let r=xr(e);return r?`rgba(${r.r}, ${r.g}, ${r.b}, ${t})`:e}function JE(e,t,r=.5){let n=xr(e),o=xr(t);if(!n||!o)return e;let a=Math.round(n.r*r+o.r*(1-r)),s=Math.round(n.g*r+o.g*(1-r)),i=Math.round(n.b*r+o.b*(1-r));return Ea(a,s,i)}function QE(e){let t=Qn(e);if(!t)return e;let r=(t.h+180)%360;return $o(r,t.s,t.l)}function eP(e){let t=xr(e);return t?Ea(255-t.r,255-t.g,255-t.b):e}function tP(e){if(e.startsWith("#"))return xr(e);let t=e.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*[\d.]+)?\s*\)/i);if(t)return {r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)};let r=e.match(/hsla?\s*\(\s*(\d+)\s*,\s*(\d+)%?\s*,\s*(\d+)%?\s*(?:,\s*[\d.]+)?\s*\)/i);return r?Kc(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10)):null}function ye(e){return e instanceof Date?e:typeof e=="number"?new Date(e):new Date(e)}function Ix(e){let t=ye(e);return !isNaN(t.getTime())}var rP=["January","February","March","April","May","June","July","August","September","October","November","December"],nP=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],oP=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],aP=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function _c(e,t="yyyy-MM-dd"){let r=ye(e);if(!Ix(r))return "Invalid Date";let n=r.getFullYear(),o=r.getMonth(),a=r.getDate(),s=r.getDay(),i=r.getHours(),l=r.getMinutes(),c=r.getSeconds(),d=v=>v.toString().padStart(2,"0"),u=i%12||12,p={yyyy:n.toString(),yy:n.toString().slice(-2),MMMM:rP[o],MMM:nP[o],MM:d(o+1),M:(o+1).toString(),dd:d(a),d:a.toString(),EEEE:oP[s],EEE:aP[s],HH:d(i),H:i.toString(),hh:d(u),h:u.toString(),mm:d(l),m:l.toString(),ss:d(c),s:c.toString(),a:i<12?"AM":"PM"},f=Object.keys(p).sort((v,b)=>b.length-v.length),g=t;for(let v of f)g=g.replace(new RegExp(v,"g"),p[v]);return g}function sP(e){return _c(e,"yyyy-MM-dd")}function iP(e){return ye(e).toISOString()}function lP(e,t=false){return _c(e,t?"HH:mm":"h:mm a")}var cP=[["year",31536e6],["month",2592e6],["week",6048e5],["day",864e5],["hour",36e5],["minute",6e4],["second",1e3]];function Vx(e,t={}){let{locale:r="en",addSuffix:n=true,style:o="long"}=t,a=ye(e),s=new Date,i=a.getTime()-s.getTime(),l=Math.abs(i);for(let[c,d]of cP)if(l>=d||c==="second"){let u=Math.round(i/d);try{return new Intl.RelativeTimeFormat(r,{style:o}).format(u,c)}catch{let p=Math.abs(u),f=p===1?c:`${c}s`;return n?u<0?`${p} ${f} ago`:`in ${p} ${f}`:`${p} ${f}`}}return "just now"}function dP(e,t=new Date){let r=ye(e),o=ye(t).getTime()-r.getTime();if(o<0)return Vx(e);let a=Math.floor(o/1e3),s=Math.floor(a/60),i=Math.floor(s/60),l=Math.floor(i/24),c=Math.floor(l/7),d=Math.floor(l/30),u=Math.floor(l/365);return a<60?"just now":s<60?`${s}m ago`:i<24?`${i}h ago`:l<7?`${l}d ago`:c<4?`${c}w ago`:d<12?`${d}mo ago`:`${u}y ago`}function uP(e){let t=ye(e),r=new Date;return t.getDate()===r.getDate()&&t.getMonth()===r.getMonth()&&t.getFullYear()===r.getFullYear()}function mP(e){let t=ye(e),r=new Date;return r.setDate(r.getDate()-1),t.getDate()===r.getDate()&&t.getMonth()===r.getMonth()&&t.getFullYear()===r.getFullYear()}function pP(e){let t=ye(e),r=new Date;return r.setDate(r.getDate()+1),t.getDate()===r.getDate()&&t.getMonth()===r.getMonth()&&t.getFullYear()===r.getFullYear()}function fP(e){return ye(e).getTime()<Date.now()}function gP(e){return ye(e).getTime()>Date.now()}function bP(e,t){let r=ye(e),n=ye(t);return r.getDate()===n.getDate()&&r.getMonth()===n.getMonth()&&r.getFullYear()===n.getFullYear()}function vP(e,t){let r=ye(e),n=ye(t);return r.getMonth()===n.getMonth()&&r.getFullYear()===n.getFullYear()}function hP(e,t){return ye(e).getFullYear()===ye(t).getFullYear()}function xP(e,t){let r=new Date(ye(e));return r.setDate(r.getDate()+t),r}function yP(e,t){let r=new Date(ye(e));return r.setMonth(r.getMonth()+t),r}function RP(e,t){let r=new Date(ye(e));return r.setFullYear(r.getFullYear()+t),r}function wP(e,t){let r=new Date(ye(e));return r.setTime(r.getTime()+t*36e5),r}function CP(e,t){let r=new Date(ye(e));return r.setTime(r.getTime()+t*6e4),r}function MP(e){let t=new Date(ye(e));return t.setHours(0,0,0,0),t}function TP(e){let t=new Date(ye(e));return t.setHours(23,59,59,999),t}function NP(e){let t=new Date(ye(e));return t.setDate(1),t.setHours(0,0,0,0),t}function kP(e){let t=new Date(ye(e));return t.setMonth(t.getMonth()+1,0),t.setHours(23,59,59,999),t}function SP(e,t){let r=ye(e),n=ye(t),o=r.getTime()-n.getTime();return Math.floor(o/864e5)}function EP(e,t){let r=ye(e),n=ye(t),o=r.getTime()-n.getTime();return Math.floor(o/36e5)}function PP(e,t){let r=ye(e),n=ye(t),o=r.getTime()-n.getTime();return Math.floor(o/6e4)}function LP(e,t={}){let{locale:r="en-US",minimumFractionDigits:n,maximumFractionDigits:o,useGrouping:a=true}=t;try{return new Intl.NumberFormat(r,{minimumFractionDigits:n,maximumFractionDigits:o,useGrouping:a}).format(e)}catch{return e.toString()}}function DP(e,t="USD",r={}){let{locale:n="en-US",display:o="symbol",minimumFractionDigits:a=2,maximumFractionDigits:s=2}=r;try{return new Intl.NumberFormat(n,{style:"currency",currency:t,currencyDisplay:o,minimumFractionDigits:a,maximumFractionDigits:s}).format(e)}catch{return `${t} ${e.toFixed(2)}`}}function HP(e,t={}){let{locale:r="en-US",minimumFractionDigits:n=0,maximumFractionDigits:o=1,signDisplay:a="auto"}=t,s=Math.abs(e)>1?e/100:e;try{return new Intl.NumberFormat(r,{style:"percent",minimumFractionDigits:n,maximumFractionDigits:o,signDisplay:a}).format(s)}catch{return `${(s*100).toFixed(o)}%`}}function IP(e,t={}){let{decimals:r=2,binary:n=true}=t;if(e===0)return "0 Bytes";let o=n?1024:1e3,a=n?["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]:["Bytes","kB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.floor(Math.log(e)/Math.log(o));return `${(e/Math.pow(o,s)).toFixed(r)} ${a[s]}`}function VP(e,t={}){let{locale:r="en-US",maximumFractionDigits:n=1}=t;try{return new Intl.NumberFormat(r,{notation:"compact",maximumFractionDigits:n}).format(e)}catch{let o=["","K","M","B","T"],a=Math.floor(Math.log10(Math.abs(e))/3);if(a===0)return e.toString();let s=o[a]||"",i=Math.pow(10,a*3);return (e/i).toFixed(n).replace(/\.0$/,"")+s}}function AP(e){let t=["th","st","nd","rd"],r=e%100;return r>=11&&r<=13?`${e}th`:`${e}${t[r%10]||"th"}`}function zP(e,t="(###) ###-####"){let r=e.replace(/\D/g,""),n=t,o=0;for(let a=0;a<n.length&&o<r.length;a++)n[a]==="#"&&(n=n.substring(0,a)+r[o]+n.substring(a+1),o++);return n.replace(/#/g,"").trim()}function OP(e){return e.replace(/\D/g,"").slice(0,16).replace(/(.{4})/g,"$1 ").trim()}function FP(e,t,r="..."){return e.length<=t?e:e.slice(0,t-r.length)+r}function BP(e,t,r="..."){if(e.length<=t)return e;let n=t-r.length,o=Math.ceil(n/2),a=Math.floor(n/2);return e.slice(0,o)+r+e.slice(-a)}function $P(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Ax(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,r)=>r.toUpperCase())}function KP(e){let t=Ax(e);return t.charAt(0).toUpperCase()+t.slice(1)}function GP(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function UP(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase()}function _P(e){return e.toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function jP(e){let t=e.toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function WP(e){return e.charAt(0).toUpperCase()+e.slice(1)}function YP(e,t=2){return e.split(" ").filter(Boolean).map(r=>r[0]).slice(0,t).join("").toUpperCase()}function qP(e,t,r){return e===1?t:r||`${t}s`}function XP(e,t="and"){if(e.length===0)return "";if(e.length===1)return e[0];if(e.length===2)return `${e[0]} ${t} ${e[1]}`;let r=e[e.length-1];return `${e.slice(0,-1).join(", ")}, ${t} ${r}`}function ZP(e,t=0,r=0,n="*"){if(e.length<=t+r)return e;let o=e.slice(0,t),a=e.slice(-r||void 0),s=e.length-t-r;return `${o}${n.repeat(s)}${r>0?a:""}`}function JP(e){let[t,r]=e.split("@");return !t||!r?e:`${t.length<=2?t:t[0]+"*".repeat(t.length-2)+t[t.length-1]}@${r}`}function QP(e,t=4){let r=e.replace(/\D/g,"");return r.length<=t?e:"*".repeat(r.length-t)+r.slice(-t)}function eL(e){return `**** **** **** ${e.replace(/\D/g,"").slice(-4)}`}export{hu as Accordion,xu as AccordionItem,sv as ActionBar,iv as ActionBarButton,ov as ActionGroup,Fv as ActionSheet,jx as Alert,Yx as AlertDescription,Wx as AlertTitle,Ib as AreaChart,ju as AspectRatio,Bh as AudioPlayer,Kg as Autocomplete,Dn as Avatar,Hn as AvatarFallback,Up as AvatarGroup,so as AvatarImage,cg as BackTop,Jx as Badge,Pv as Banner,Db as BarChart,kh as Blockquote,Av as BottomNavigation,eh as Bounce,zu as Breadcrumb,Gu as BreadcrumbEllipsis,Fu as BreadcrumbItem,Bu as BreadcrumbLink,Ou as BreadcrumbList,$u as BreadcrumbPage,Ku as BreadcrumbSeparator,me as Button,Qc as ButtonGroup,ed as ButtonGroupSeparator,Xf as COUNTRIES,lo as Calendar,ad as Card,cd as CardContent,ld as CardDescription,dd as CardFooter,sd as CardHeader,id as CardTitle,$b as Carousel,Kb as CarouselContent,Gb as CarouselItem,Il as CarouselNext,Hl as CarouselPrevious,Ko as Checkbox,hh as Checkmark,qp as Chip,tf as CircularProgress,Ct as CloseButton,ib as Code,mb as CodeBlock,qv as Collapse,Tu as Collapsible,Nu as CollapsibleContent,Oi as CollapsibleTrigger,xv as ColorArea,Bf as ColorPicker,wv as ColorSlider,sa as ColorSwatch,Of as ColorSwatchPicker,Mv as ColorWheel,Qi as Command,iR as CommandDialog,Ip as CommandEmpty,Vp as CommandGroup,Dp as CommandInput,zp as CommandItem,Hp as CommandList,Ap as CommandSeparator,Op as CommandShortcut,xh as Confetti,_d as ContextMenu,eu as ContextMenuCheckboxItem,Xd as ContextMenuContent,Wd as ContextMenuGroup,Qd as ContextMenuItem,Yd as ContextMenuPortal,tu as ContextMenuSection,ru as ContextMenuSeparator,nu as ContextMenuShortcut,qd as ContextMenuSub,Jd as ContextMenuSubContent,Zd as ContextMenuSubTrigger,jd as ContextMenuTrigger,mv as ContextualHelp,kb as CopyButton,ah as Counter,_f as CurrencyInput,ga as DEFAULT_COLORS,K0 as DataTable,tv as DatePicker,hb as DateRangePicker,Gi as Drawer,bm as DrawerBody,ym as DrawerClose,fm as DrawerContent,xm as DrawerDescription,vm as DrawerFooter,km as DrawerGroup,Sm as DrawerGroupLabel,gm as DrawerHeader,Em as DrawerInset,Cm as DrawerMenu,Nm as DrawerMenuButton,Mm as DrawerMenuItem,M0 as DrawerProvider,wm as DrawerSeparator,mm as DrawerSidebar,hm as DrawerTitle,Rm as DrawerToggle,pm as DrawerTrigger,Zt as Dropdown,Qt as DropdownContent,Dd as DropdownGroup,Et as DropdownItem,zy as DropdownLabel,Mi as DropdownSection,Pd as DropdownSeparator,Ld as DropdownShortcut,Hd as DropdownSub,Vd as DropdownSubContent,Id as DropdownSubTrigger,Jt as DropdownTrigger,Al as EMOJIS,Ks as EMOJI_CATEGORIES,_b as EmojiPicker,ff as EmptyState,Xv as Expand,fN as FAB,jv as Fade,bl as FieldContext,If as FileUpload,Jv as Flip,Jl as FloatingActionButton,Gg as Form,ur as FormContext,Wg as FormControl,Yg as FormDescription,Ug as FormField,_g as FormItem,jg as FormLabel,qg as FormMessage,Pb as FullCalendar,yh as Glow,vv as GridList,wh as H1,Ch as H2,Mh as H3,Th as H4,Vh as HeatmapCalendar,Hu as HoverCard,Vu as HoverCardContent,Iu as HoverCardTrigger,bb as Image,_N as ImageComparison,Yb as ImageCropper,Nl as ImageViewer,Cb as ImageViewerTrigger,Rb as InfiniteScroll,Sh as InlineCode,Qr as Input,of as InputOTP,af as InputOTPGroup,lf as InputOTPSeparator,sf as InputOTPSlot,Ob as KanbanBoard,Tb as Kbd,Pn as Label,Ph as Large,Eh as Lead,Lb as LineChart,ig as Link,lw as List,Rf as ListItem,wf as ListItemText,il as MASK_PRESETS,Yf as MaskedInput,fg as Menubar,Tg as MenubarCheckboxItem,Cg as MenubarContent,bg as MenubarGroup,Mg as MenubarItem,oC as MenubarLabel,gg as MenubarMenu,vg as MenubarPortal,xg as MenubarRadioGroup,Ng as MenubarRadioItem,ul as MenubarSection,kg as MenubarSeparator,Sg as MenubarShortcut,hg as MenubarSub,wg as MenubarSubContent,Rg as MenubarSubTrigger,yg as MenubarTrigger,Mp as Modal,Sp as ModalBody,Np as ModalClose,cs as ModalContent,Lp as ModalDescription,Ep as ModalFooter,kp as ModalHeader,Ji as ModalOverlay,Zi as ModalPortal,ls as ModalRoot,Pp as ModalTitle,Tp as ModalTrigger,Dh as Muted,eg as Navbar,tg as NavbarBrand,rg as NavbarContent,ng as NavbarItem,og as NavbarLink,Ju as NavigationMenu,nm as NavigationMenuContent,sm as NavigationMenuIndicator,em as NavigationMenuItem,am as NavigationMenuLink,Qu as NavigationMenuList,rm as NavigationMenuTrigger,$i as NavigationMenuViewport,Qg as NumberField,Jo as NumberInput,$h as PDFViewer,mp as Pagination,pp as PaginationContent,vp as PaginationEllipsis,fp as PaginationItem,ns as PaginationLink,bp as PaginationNext,gp as PaginationPrevious,Nh as Paragraph,fh as Parallax,Bp as PasswordInput,Zf as PhoneInput,Hb as PieChart,oh as Pop,Pt as Popover,tn as PopoverAnchor,Lt as PopoverContent,en as PopoverTrigger,Ja as Progress,_v as PullToRefresh,rh as Pulse,qb as QRCode,Pi as Radio,Vi as RadioContent,Li as RadioControl,Ii as RadioDescription,lu as RadioGroup,cu as RadioGroupItem,Di as RadioIndicator,Hi as RadioLabel,cv as RangeSlider,jp as Rating,Bl as ReeverUIContext,Jb as ReeverUIProvider,DR as ResizableHandle,LR as ResizablePanel,PR as ResizablePanelGroup,Qv as Ripple,Zv as Rotate,Yv as Scale,ze as ScrollArea,ph as ScrollProgress,mh as ScrollReveal,In as Select,tb as SelectField,by as Separator,th as Shake,vh as Shimmer,Hm as Sidebar,Vm as SidebarContent,Am as SidebarFooter,zm as SidebarGroup,Fm as SidebarGroupAction,Bm as SidebarGroupContent,Om as SidebarGroupLabel,Im as SidebarHeader,ep as SidebarInset,$m as SidebarMenu,_m as SidebarMenuAction,jm as SidebarMenuBadge,Um as SidebarMenuButton,Km as SidebarMenuItem,Xm as SidebarMenuSkeleton,Wm as SidebarMenuSub,qm as SidebarMenuSubButton,Ym as SidebarMenuSubItem,Dm as SidebarProvider,Jm as SidebarRail,Qm as SidebarSeparator,Zm as SidebarTrigger,$a as Skeleton,Wv as Slide,er as Slider,Lh as Small,gb as Snippet,Rh as Sparkles,Ha as Spinner,Sv as SpotlightSearch,vf as StatCard,Dg as Step,Pg as Steps,Kv as SwipeActions,fd as Switch,pb as TabbedCodeBlock,tp as Table,np as TableBody,lp as TableCaption,ip as TableCell,op as TableFooter,sp as TableHead,rp as TableHeader,ap as TableRow,Bd as Tabs,Gd as TabsContent,$d as TabsList,Kd as TabsTrigger,mf as TagInput,ey as TextBadge,Xg as TextField,ih as TextReveal,Ba as Textarea,Zg as TextareaField,Gs as ThemeProvider,Xb as ThemeToggle,Kf as TimeInput,xb as TimePicker,Nf as Timeline,Ef as TimelineContent,Sf as TimelineItem,Pf as TimelineOpposite,$y as Toaster,du as Toggle,mu as ToggleGroup,pu as ToggleGroupItem,yr as Tooltip,Fg as Tree,sh as Typewriter,Hh as UL,ob as User,Oh as VideoPlayer,nh as Wiggle,lh as WordRotate,av as actionBarVariants,nv as actionGroupVariants,Ov as actionSheetItemVariants,xP as addDays,wP as addHours,CP as addMinutes,yP as addMonths,RP as addYears,Ux as alertVariants,ZE as alpha,vs as applyMask,$g as autocompleteInputVariants,Gp as avatarGroupVariants,lg as backTopVariants,qx as badgeIndicatorVariants,Ev as bannerVariants,Vv as bottomNavigationVariants,no as buttonVariants,OE as calculatePasswordStrength,Ax as camelCase,WP as capitalize,od as cardVariants,Fb as carouselVariants,fa as chartContainerVariants,Yp as chipVariants,ef as circularProgressVariants,dm as closeButtonVariants,m as cn,sb as codeVariants,hv as colorAreaVariants,Rv as colorSliderVariants,zf as colorSwatchPickerVariants,Af as colorSwatchVariants,Cv as colorWheelVariants,QE as complement,Wl as contextualHelpTriggerVariants,Nb as copyButtonVariants,Uf as currencyInputVariants,YE as darken,ev as datePickerVariants,Dx as defaultPasswordRequirements,XE as desaturate,SP as differenceInDays,EP as differenceInHours,PP as differenceInMinutes,Tm as drawerMenuButtonVariants,Ub as emojiPickerVariants,TP as endOfDay,kP as endOfMonth,ha as fabVariants,Lf as fileUploadVariants,IP as formatBytes,VP as formatCompact,OP as formatCreditCard,DP as formatCurrency,_c as formatDate,gs as formatFileSize,sP as formatISO,iP as formatISODateTime,XP as formatList,LP as formatNumber,AP as formatOrdinal,HP as formatPercent,zP as formatPhone,hs as formatPhoneNumber,Vx as formatRelative,lP as formatTime,Eb as fullCalendarVariants,Gc as getContrastRatio,Df as getFileIcon,YP as getInitials,$c as getLuminance,Wf as getMaskPlaceholder,FE as getPasswordStrengthColor,BE as getPasswordStrengthLabel,jE as getTextColor,bv as gridListItemVariants,gv as gridListVariants,Qn as hexToHsl,xr as hexToRgb,$E as hexToRgba,$o as hslToHex,Kc as hslToRgb,Wb as imageCropperVariants,Rl as imageVariants,Tl as infiniteScrollLoaderVariants,Ml as infiniteScrollVariants,nf as inputOTPVariants,eP as invert,_E as isDarkColor,gP as isFuture,Uc as isLightColor,fP as isPast,bP as isSameDay,vP as isSameMonth,hP as isSameYear,uP as isToday,pP as isTomorrow,Ix as isValidDate,mP as isYesterday,Mb as kbdVariants,GP as kebabCase,WE as lighten,yf as listItemVariants,na as listVariants,ZP as mask,eL as maskCreditCard,JP as maskEmail,QP as maskPhone,jf as maskedInputVariants,GE as meetsContrastAA,UE as meetsContrastAAA,JE as mix,Xi as modalContentVariants,Qf as navbarVariants,om as navigationMenuLinkStyle,tm as navigationMenuTriggerStyle,tP as parseColor,ye as parseDate,KP as pascalCase,$w as phoneInputVariants,qP as pluralize,Uv as pullToRefreshVariants,Ol as qrCodeVariants,lv as rangeSliderVariants,_p as ratingVariants,Ea as rgbToHex,Hx as rgbToHsl,KE as rgbaToHex,qE as saturate,Nd as selectVariants,jP as sentenceCase,Gm as sidebarMenuButtonVariants,bd as skeletonVariants,$P as slugify,UP as snakeCase,fb as snippetVariants,Da as spinnerVariants,MP as startOfDay,NP as startOfMonth,bf as statCardVariants,Lg as stepVariants,Eg as stepsVariants,ec as swipeActionVariants,$v as swipeActionsVariants,Aa as switchColors,uf as tagVariants,Qx as textBadgeVariants,bT as themeToggleVariants,dP as timeAgo,$f as timeInputVariants,kf as timelineItemVariants,Tf as timelineVariants,_P as titleCase,qa as toggleVariants,Vg as treeItemVariants,Ig as treeVariants,FP as truncate,BP as truncateMiddle,ll as unmask,fE as useAnimatedValue,fx as useAsync,rE as useAsyncRetry,TS as useBodyScrollLock,FS as useBooleanToggle,$k as useBreakpoint,Kk as useBreakpoints,vi as useButtonGroup,$s as useCarousel,oS as useClickOutside,aS as useClickOutsideMultiple,ON as useConfetti,iS as useCopy,sS as useCopyToClipboard,lE as useCountdown,$S as useCounter,OS as useCycle,Xk as useDebounce,Zk as useDebouncedCallback,Jk as useDebouncedCallbackWithControls,uE as useDelayedValue,ox as useDisclosure,AS as useDisclosureOpen,LE as useDistance,yE as useDocumentIsVisible,Nx as useDocumentVisibility,RE as useDocumentVisibilityCallback,b0 as useDrawer,HS as useElementSize,uS as useEventListener,mS as useEventListenerRef,oE as useFetch,Ms as useFieldContext,rR as useFocusTrap,as as useFocusTrapRef,vl as useFormContext,Px as useFullscreen,kE as useFullscreenRef,PE as useGeolocation,lS as useHotkeys,cS as useHotkeysMap,gS as useHover,hS as useHoverDelay,vS as useHoverProps,bS as useHoverRef,bE as useIdle,vE as useIdleCallback,KS as useIncrementCounter,ex as useIntersectionObserver,kS as useIntersectionObserverRef,mi as useInterval,iE as useIntervalControls,Dk as useIsDesktop,Pk as useIsMobile,Lk as useIsTablet,pS as useKeyPress,dS as useKeyPressed,dM as useKeyboardShortcut,SS as useLazyLoad,YS as useList,_k as useLocalStorage,fS as useLongPress,qS as useMap,IE as useMediaPermission,zo as useMediaQuery,yS as useMouse,RS as useMouseElement,wS as useMouseElementRef,aE as useMutation,ES as useMutationObserver,PS as useMutationObserverRef,HE as useNotificationPermission,wE as useOnlineStatus,CE as useOnlineStatusCallback,DE as usePermission,Hk as usePrefersColorScheme,Ik as usePrefersReducedMotion,GS as usePrevious,_S as usePreviousDistinct,US as usePreviousWithInitial,QS as useQueue,pE as useRafLoop,XS as useRecord,hT as useReeverUI,LS as useResizeObserver,DS as useResizeObserverRef,Zh as useScrollLock,CS as useScrollPosition,JS as useSelection,Wk as useSessionStorage,dx as useSet,H0 as useSidebar,qo as useSidebarSafe,zE as useSpeechRecognition,AE as useSpeechSynthesis,nN as useSpotlight,gE as useSpringValue,eE as useStack,tS as useThrottle,rS as useThrottledCallback,yx as useTimeout,dE as useTimeoutControls,mE as useTimeoutFlag,cE as useTimer,zS as useToggle,Bk as useWindowHeight,MS as useWindowScroll,Ma as useWindowSize,Fk as useWindowWidth,nb as userVariants,Hf as validateFile,NC as validators};//# sourceMappingURL=index.js.map
|
|
72
|
+
`})]})});vh.displayName="Shimmer";var AN={sm:24,md:40,lg:56,xl:80},zN={default:{circle:"stroke-muted-foreground",check:"stroke-foreground"},success:{circle:"stroke-green-500",check:"stroke-green-500"},primary:{circle:"stroke-primary",check:"stroke-primary"},outline:{circle:"stroke-border",check:"stroke-foreground"}},hh=Z.forwardRef(({show:e=true,size:t="md",variant:n="success",strokeWidth:r=2,duration:o=.6,delay:a=0,className:s,onComplete:i},l)=>{let c=AN[t],d=zN[n],u={hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:o*.5,delay:a,ease:"easeOut"}}},p={hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{duration:o*.5,delay:a+o*.4,ease:"easeOut"}}};return jsxs("svg",{ref:l,width:c,height:c,viewBox:"0 0 50 50",className:m(s),children:[jsx(motion.circle,{cx:"25",cy:"25",r:"22",fill:"none",strokeWidth:r,className:d.circle,variants:u,initial:"hidden",animate:e?"visible":"hidden"}),jsx(motion.path,{d:"M14 27 L22 35 L36 18",fill:"none",strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round",className:d.check,variants:p,initial:"hidden",animate:e?"visible":"hidden",onAnimationComplete:()=>e&&i?.()})]})});hh.displayName="Checkmark";var Ao={particleCount:100,spread:70,startVelocity:30,decay:.95,gravity:1,colors:["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff"],origin:{x:.5,y:.5},shapes:["square","circle"],scalar:1,drift:0,ticks:200},xh=Z.forwardRef(({autoTrigger:e=false,delay:t=0,options:n={},children:r,onTrigger:o},a)=>{let s=Z.useCallback(()=>{let i={...Ao,...n};Vo(i),o?.();},[n,o]);return Z.useEffect(()=>{if(e){let i=setTimeout(s,t);return ()=>clearTimeout(i)}},[e,t,s]),r?jsx("div",{ref:a,onClick:s,className:"inline-block cursor-pointer",children:r}):null});xh.displayName="Confetti";var ON=()=>{let e=Z.useCallback(r=>{let o={...Ao,...r};Vo(o);},[]),t=Z.useCallback(()=>{let o=Date.now()+3e3,a=setInterval(()=>{let s=o-Date.now();if(s<=0){clearInterval(a);return}let i=50*(s/3e3);Vo({...Ao,particleCount:i,origin:{x:Math.random()*.4+.1,y:Math.random()-.2}}),Vo({...Ao,particleCount:i,origin:{x:Math.random()*.4+.5,y:Math.random()-.2}});},250);},[]),n=Z.useCallback((r="both")=>{let o={x:0,y:1},a={x:1,y:1};(r==="left"||r==="both")&&Vo({...Ao,particleCount:50,angle:60,spread:55,origin:o}),(r==="right"||r==="both")&&Vo({...Ao,particleCount:50,angle:120,spread:55,origin:a});},[]);return {fire:e,fireworks:t,cannon:n}},yh=Z.forwardRef(({children:e,color:t="hsl(var(--primary))",intensity:n=20,spread:r=0,animate:o=false,duration:a=2,className:s},i)=>{let l={boxShadow:`0 0 ${n}px ${r}px ${t}`};return o?jsx(motion.div,{ref:i,className:m("rounded-[inherit]",s),animate:{boxShadow:[`0 0 ${n}px ${r}px ${t}`,`0 0 ${n*1.5}px ${r+5}px ${t}`,`0 0 ${n}px ${r}px ${t}`]},transition:{duration:a,repeat:1/0,ease:"easeInOut"},children:e}):jsx("div",{ref:i,className:m("rounded-[inherit]",s),style:l,children:e})});yh.displayName="Glow";var bh=(e,t)=>({id:Math.random().toString(36).substr(2,9),x:`${Math.random()*100}%`,y:`${Math.random()*100}%`,size:Math.random()*(t-e)+e,delay:Math.random()*2}),Rh=Z.forwardRef(({children:e,count:t=10,color:n="hsl(var(--primary))",minSize:r=4,maxSize:o=8,duration:a=1.5,className:s},i)=>{let[l,c]=Z.useState([]);return Z.useEffect(()=>{let d=Array.from({length:t},()=>bh(r,o));c(d);let u=setInterval(()=>{c(p=>{let f=[...p],g=Math.floor(Math.random()*t);return f[g]=bh(r,o),f});},a*500);return ()=>clearInterval(u)},[t,r,o,a]),jsxs("div",{ref:i,className:m("relative inline-block",s),children:[e,l.map(d=>jsx(motion.svg,{className:"pointer-events-none absolute",style:{left:d.x,top:d.y,width:d.size,height:d.size},viewBox:"0 0 24 24",initial:{scale:0,opacity:0,rotate:0},animate:{scale:[0,1,0],opacity:[0,1,0],rotate:[0,180]},transition:{duration:a,delay:d.delay,repeat:1/0,ease:"easeInOut"},children:jsx("path",{d:"M12 0L14.59 9.41L24 12L14.59 14.59L12 24L9.41 14.59L0 12L9.41 9.41L12 0Z",fill:n})},d.id))]})});Rh.displayName="Sparkles";var wh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("h1",{ref:r,className:m("scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",e),...n,children:t}));wh.displayName="H1";var Ch=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("h2",{ref:r,className:m("scroll-m-20 text-3xl font-semibold tracking-tight",e),...n,children:t}));Ch.displayName="H2";var Mh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("h3",{ref:r,className:m("scroll-m-20 text-2xl font-semibold tracking-tight",e),...n,children:t}));Mh.displayName="H3";var Th=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("h4",{ref:r,className:m("scroll-m-20 text-xl font-semibold tracking-tight",e),...n,children:t}));Th.displayName="H4";var Nh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:m("leading-7 [&:not(:first-child)]:mt-6",e),...n,children:t}));Nh.displayName="Paragraph";var kh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("blockquote",{ref:r,className:m("mt-6 border-l-2 pl-6 italic",e),...n,children:t}));kh.displayName="Blockquote";var Sh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("code",{ref:r,className:m("relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",e),...n,children:t}));Sh.displayName="InlineCode";var Eh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:m("text-xl text-muted-foreground",e),...n,children:t}));Eh.displayName="Lead";var Ph=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("div",{ref:r,className:m("text-lg font-semibold",e),...n,children:t}));Ph.displayName="Large";var Lh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("small",{ref:r,className:m("text-sm font-medium leading-none",e),...n,children:t}));Lh.displayName="Small";var Dh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("p",{ref:r,className:m("text-sm text-muted-foreground",e),...n,children:t}));Dh.displayName="Muted";var Hh=Z.forwardRef(({className:e,children:t,...n},r)=>jsx("ul",{ref:r,className:m("my-6 ml-6 list-disc [&>li]:mt-2",e),...n,children:t}));Hh.displayName="UL";function FN(){let[e,t]=Z.useState(false);return Z.useEffect(()=>{t(true);},[]),e}var BN=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],$N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],sc={default:["bg-muted","bg-emerald-200 dark:bg-emerald-900","bg-emerald-300 dark:bg-emerald-700","bg-emerald-500 dark:bg-emerald-500","bg-emerald-700 dark:bg-emerald-300"],success:["bg-muted","bg-green-200 dark:bg-green-900","bg-green-300 dark:bg-green-700","bg-green-500 dark:bg-green-500","bg-green-700 dark:bg-green-300"],warning:["bg-muted","bg-amber-200 dark:bg-amber-900","bg-amber-300 dark:bg-amber-700","bg-amber-500 dark:bg-amber-500","bg-amber-700 dark:bg-amber-300"],danger:["bg-muted","bg-red-200 dark:bg-red-900","bg-red-300 dark:bg-red-700","bg-red-500 dark:bg-red-500","bg-red-700 dark:bg-red-300"],primary:["bg-muted","bg-primary/20","bg-primary/40","bg-primary/60","bg-primary/80"],secondary:["bg-muted","bg-secondary/40","bg-secondary/60","bg-secondary/80","bg-secondary"]},ic={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function Ih(e){return e.toISOString().split("T")[0]}function KN(e){return e instanceof Date?e:new Date(e)}function GN(e,t){let n=[],r=new Date(e);for(r.setDate(r.getDate()-r.getDay());r<=t;){let o=[];for(let a=0;a<7;a++)o.push(new Date(r)),r.setDate(r.getDate()+1);n.push(o);}return n}function UN(e){let t=[],n=-1;return e.forEach((r,o)=>{let a=r.find(s=>s.getDate()<=7);a&&a.getMonth()!==n&&(n=a.getMonth(),t.push({month:$N[n],position:o}));}),t}var Vh=Z.forwardRef(({className:e,values:t,startDate:n,endDate:r,color:o="default",levels:a=5,showMonthLabels:s=true,showWeekdayLabels:i=true,showTooltip:l=true,tooltipFormatter:c,colorScale:d,gap:u=3,cellSize:p=12,radius:f="sm",onCellClick:g,emptyColor:v,showLegend:b=true,legendLabels:h={less:"Less",more:"More"},...x},R)=>{let N=FN(),{startDate:w,endDate:y}=Z.useMemo(()=>{let P=r?new Date(r):new Date;return {startDate:n?new Date(n):new Date(P.getFullYear()-1,P.getMonth(),P.getDate()),endDate:P}},[n,r]),C=Z.useMemo(()=>{let P=new Map;return t.forEach(I=>{let H=KN(I.date),A=Ih(H);P.set(A,(P.get(A)||0)+I.count);}),P},[t]),E=Z.useMemo(()=>C.size===0?0:Math.max(...Array.from(C.values())),[C]),L=Z.useMemo(()=>GN(w,y),[w,y]),k=Z.useMemo(()=>UN(L),[L]),S=P=>{if(P===0)return v||d?.[0]||sc[o][0];let I=d||sc[o],H=Math.min(Math.ceil(P/E*(a-1)),a-1);return I[H]||I[I.length-1]},T=(P,I)=>{if(c)return c(P,I);let H=P.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"});return jsxs("span",{children:[jsx("span",{className:"font-medium",children:I})," contributions on ",H]})},M=(P,I,H)=>{let A=Ih(P),B=C.get(A)||0;if(!(P>=w&&P<=y))return jsx("div",{style:{width:p,height:p}},`${I}-${H}`);let j=jsx("div",{className:m("transition-all duration-200",ic[f],S(B),g&&"cursor-pointer hover:ring-2 hover:ring-foreground/50 hover:ring-offset-1"),style:{width:p,height:p},onClick:()=>g?.(P,B),role:g?"button":void 0,tabIndex:g?0:void 0,onKeyDown:G=>{g&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),g(P,B));}});return l?jsx(Rn,{content:T(P,B),delayDuration:0,children:jsx("button",{type:"button",className:m("transition-all duration-200 border-0 bg-transparent p-0",ic[f],S(B),g&&"cursor-pointer hover:ring-2 hover:ring-foreground/50 hover:ring-offset-1"),style:{width:p,height:p},onClick:()=>g?.(P,B),onKeyDown:G=>{g&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),g(P,B));}})},`${I}-${H}`):jsx(Z.Fragment,{children:j},`${I}-${H}`)},D=d||sc[o];return N?jsxs("div",{ref:R,className:m("inline-flex flex-col",e),...x,children:[jsxs("div",{className:"flex",children:[i&&jsx("div",{className:"flex flex-col justify-between pr-2",style:{gap:u,marginTop:s?20:0},children:BN.map((P,I)=>jsx("div",{className:m("text-xs text-muted-foreground",I%2===1&&"invisible"),style:{height:p,lineHeight:`${p}px`},children:P},P))}),jsxs("div",{className:"flex flex-col",children:[s&&jsx("div",{className:"relative mb-1",style:{height:16,width:L.length*(p+u)-u},children:k.map(({month:P,position:I},H)=>jsx("div",{className:"absolute text-xs text-muted-foreground whitespace-nowrap",style:{left:I*(p+u)},children:P},`${P}-${H}`))}),jsx("div",{className:"flex",style:{gap:u},children:L.map((P,I)=>jsx("div",{className:"flex flex-col",style:{gap:u},children:P.map((H,A)=>M(H,I,A))},I))})]})]}),b&&jsxs("div",{className:"flex items-center justify-end mt-4 gap-2",children:[jsx("span",{className:"text-xs text-muted-foreground",children:h.less}),jsx("div",{className:"flex",style:{gap:u/2},children:D.slice(0,a).map((P,I)=>jsx("div",{className:m(ic[f],P),style:{width:p,height:p}},I))}),jsx("span",{className:"text-xs text-muted-foreground",children:h.more})]})]}):jsx("div",{ref:R,className:m("inline-flex flex-col",e),...x})});Vh.displayName="HeatmapCalendar";var _N=Z.forwardRef(({className:e,beforeImage:t,afterImage:n,beforeAlt:r="Before",afterAlt:o="After",defaultPosition:a=50,position:s,onPositionChange:i,orientation:l="horizontal",showLabels:c=true,beforeLabel:d="Before",afterLabel:u="After",handleVariant:p="default",handleColor:f="default",aspectRatio:g,disableKeyboard:v=false,handleWidth:b=4,...h},x)=>{let[R,N]=Z.useState(a),w=s!==void 0,y=w?s:R,C=Z.useRef(null),[E,L]=Z.useState(false),[k,S]=Z.useState({width:0,height:0});Z.useEffect(()=>{let G=()=>{C.current&&S({width:C.current.offsetWidth,height:C.current.offsetHeight});};G();let U=new ResizeObserver(G);return C.current&&U.observe(C.current),()=>U.disconnect()},[]);let T=G=>{let U=Math.max(0,Math.min(100,G));w||N(U),i?.(U);},M=(G,U)=>{if(!C.current)return y;let W=C.current.getBoundingClientRect();return l==="horizontal"?(G-W.left)/W.width*100:(U-W.top)/W.height*100},D=G=>{G.preventDefault(),L(true),G.target.setPointerCapture(G.pointerId);let U=M(G.clientX,G.clientY);T(U);},P=G=>{if(!E)return;let U=M(G.clientX,G.clientY);T(U);},I=()=>{L(false);},H=G=>{if(v)return;let U=G.shiftKey?10:1,W=y;switch(G.key){case "ArrowLeft":case "ArrowUp":G.preventDefault(),W=y-U;break;case "ArrowRight":case "ArrowDown":G.preventDefault(),W=y+U;break;case "Home":G.preventDefault(),W=0;break;case "End":G.preventDefault(),W=100;break;default:return}T(W);},A={default:"bg-border",primary:"bg-primary",white:"bg-white",black:"bg-black"},B={default:"bg-background border-border text-foreground",primary:"bg-primary border-primary text-primary-foreground",white:"bg-white border-white text-black",black:"bg-black border-black text-white"},$=()=>{let G=l==="horizontal",U=m("absolute z-10 flex items-center justify-center",G?"top-0 bottom-0 cursor-ew-resize":"left-0 right-0 cursor-ns-resize",A[f]),W=G?{left:`${y}%`,width:b,transform:"translateX(-50%)"}:{top:`${y}%`,height:b,transform:"translateY(-50%)"};return p==="minimal"?jsx("div",{className:U,style:W}):p==="arrows"?jsx("div",{className:U,style:W,children:jsxs("div",{className:m("absolute flex items-center justify-center gap-0.5 rounded-full p-1.5 shadow-md border-2",B[f],G?"flex-row":"flex-col"),children:[jsx("svg",{className:m("w-3 h-3",G?"-rotate-0":"rotate-90"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M15 18l-6-6 6-6"})}),jsx("svg",{className:m("w-3 h-3",G?"-rotate-0":"rotate-90"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M9 18l6-6-6-6"})})]})}):jsx("div",{className:U,style:W,children:jsx("div",{className:m("absolute rounded-full p-2 shadow-md border-2",B[f]),children:jsxs("svg",{className:m("w-4 h-4",G?"":"rotate-90"),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M8 3L4 7l4 4"}),jsx("path",{d:"M16 3l4 4-4 4"}),jsx("path",{d:"M4 7h16"}),jsx("path",{d:"M8 17l-4 4 4 4"}),jsx("path",{d:"M16 17l4 4-4 4"}),jsx("path",{d:"M4 21h16"})]})})})},j=l==="horizontal";return jsx("div",{ref:x,className:m("relative select-none overflow-hidden rounded-lg",E&&"cursor-grabbing",e),style:g?{aspectRatio:g}:void 0,...h,children:jsxs("div",{ref:C,className:"relative w-full h-full",role:"slider",tabIndex:0,"aria-valuenow":y,"aria-valuemin":0,"aria-valuemax":100,"aria-orientation":l,"aria-label":"Image comparison slider",onPointerDown:D,onPointerMove:P,onPointerUp:I,onPointerCancel:I,onKeyDown:H,children:[jsx("img",{src:n,alt:o,className:"absolute inset-0 w-full h-full object-cover",draggable:false}),jsx("div",{className:"absolute inset-0 overflow-hidden",style:j?{width:`${y}%`}:{height:`${y}%`},children:jsx("img",{src:t,alt:r,className:"absolute object-cover",style:{top:0,left:0,width:k.width>0?`${k.width}px`:"100%",height:k.height>0?`${k.height}px`:"100%"},draggable:false})}),$(),c&&jsxs(Fragment,{children:[jsx("div",{className:m("absolute px-2 py-1 text-xs font-medium rounded bg-black/70 text-white pointer-events-none","top-3 left-3"),children:d}),jsx("div",{className:m("absolute px-2 py-1 text-xs font-medium rounded bg-black/70 text-white pointer-events-none",j?"top-3 right-3":"bottom-3 left-3"),children:u})]})]})})});_N.displayName="ImageComparison";function zh(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60);return t>0?`${t}:${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${n}:${r.toString().padStart(2,"0")}`}var rk={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},Oh=Z.forwardRef(({className:e,src:t,poster:n,autoPlay:r=false,muted:o=false,loop:a=false,controls:s=true,preload:i="metadata",aspectRatio:l="16/9",defaultVolume:c=1,playbackSpeeds:d=[.5,.75,1,1.25,1.5,2],showPiP:u=true,showFullscreen:p=true,showVolume:f=true,showPlaybackSpeed:g=true,showSkipButtons:v=false,skipInterval:b=10,onPlay:h,onPause:x,onEnded:R,onVideoTimeUpdate:N,onVideoVolumeChange:w,controlsHideTimeout:y=3e3,keyboardShortcuts:C=true,doubleClickFullscreen:E=true,radius:L="lg",...k},S)=>{let T=Z.useRef(null),M=Z.useRef(null),D=Z.useRef(null),[P,I]=Z.useState(false),[H,A]=Z.useState(0),[B,$]=Z.useState(0),[j,G]=Z.useState(c),[U,W]=Z.useState(o),[V,z]=Z.useState(false),[K,Y]=Z.useState(true),[Q,J]=Z.useState(true),[Ne,be]=Z.useState(1),[_,O]=Z.useState(0),F=Z.useMemo(()=>typeof t=="string"?[{src:t,type:void 0,label:void 0}]:t,[t]),[q,X]=Z.useState(0),Re=Z.useCallback(()=>{D.current&&clearTimeout(D.current),J(true),P&&y>0&&(D.current=setTimeout(()=>{J(false);},y));},[P,y]);Z.useEffect(()=>(Re(),()=>{D.current&&clearTimeout(D.current);}),[P,Re]);let Te=()=>{M.current&&($(M.current.duration),Y(false));},ot=()=>{if(M.current){A(M.current.currentTime),N?.(M.current.currentTime,M.current.duration);let re=M.current.buffered.length>0?M.current.buffered.end(M.current.buffered.length-1):0;O(re/M.current.duration*100);}},ue=()=>{I(true),h?.();},tt=()=>{I(false),x?.();},te=()=>{I(false),R?.();},at=()=>{Y(true);},qt=()=>{Y(false);},ne=()=>{M.current&&(P?M.current.pause():M.current.play());},oe=re=>{if(M.current){let we=re[0]/100*B;M.current.currentTime=we,A(we);}},ke=re=>{let we=re[0]/100;G(we),W(we===0),M.current&&(M.current.volume=we,M.current.muted=we===0),w?.(we,we===0);},Ft=()=>{if(M.current){let re=!U;M.current.muted=re,W(re),re?M.current.volume=0:M.current.volume=j||1,w?.(re?0:j,re);}},bt=async()=>{if(T.current)try{V?await document.exitFullscreen():await T.current.requestFullscreen();}catch{}},eo=async()=>{if(M.current)try{document.pictureInPictureElement?await document.exitPictureInPicture():await M.current.requestPictureInPicture();}catch{}},Se=re=>{M.current&&(M.current.currentTime=Math.max(0,Math.min(B,M.current.currentTime+re)));},qe=re=>{M.current&&(M.current.playbackRate=re,be(re));};Z.useEffect(()=>{let re=()=>{z(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",re),()=>{document.removeEventListener("fullscreenchange",re);}},[]),Z.useEffect(()=>{if(!C)return;let re=we=>{if(!(!T.current?.contains(document.activeElement)&&document.activeElement!==T.current))switch(we.key.toLowerCase()){case " ":case "k":we.preventDefault(),ne();break;case "f":we.preventDefault(),bt();break;case "m":we.preventDefault(),Ft();break;case "arrowleft":we.preventDefault(),Se(-b);break;case "arrowright":we.preventDefault(),Se(b);break;case "arrowup":we.preventDefault(),ke([Math.min(100,j*100+10)]);break;case "arrowdown":we.preventDefault(),ke([Math.max(0,j*100-10)]);break}};return window.addEventListener("keydown",re),()=>{window.removeEventListener("keydown",re);}},[C,P,j,b]);let Bt=()=>{E&&bt();},$e=B>0?H/B*100:0;return jsxs("div",{ref:re=>{T.current=re,typeof S=="function"?S(re):S&&(S.current=re);},className:m("relative bg-black overflow-hidden group",rk[L],e),style:{aspectRatio:l},onMouseMove:Re,onMouseLeave:()=>P&&J(false),tabIndex:0,...k,children:[jsx("video",{ref:M,className:"w-full h-full object-contain",poster:n,autoPlay:r,muted:o,loop:a,preload:i,playsInline:true,onClick:ne,onDoubleClick:Bt,onLoadedMetadata:Te,onTimeUpdate:ot,onPlay:ue,onPause:tt,onEnded:te,onWaiting:at,onCanPlay:qt,children:F.map((re,we)=>jsx("source",{src:re.src,type:re.type},we))}),K&&jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/20",children:jsx(Loader2,{className:"w-12 h-12 text-white animate-spin"})}),!P&&!K&&jsx("button",{type:"button",className:"absolute inset-0 flex items-center justify-center bg-black/30 transition-opacity cursor-pointer",onClick:ne,children:jsx("div",{className:"w-16 h-16 rounded-full bg-white/90 flex items-center justify-center",children:jsx(Play,{className:"w-8 h-8 text-black ml-1",fill:"currentColor"})})}),s&&jsxs("div",{className:m("absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-4 pt-16 transition-opacity duration-300",Q?"opacity-100":"opacity-0 pointer-events-none"),children:[jsxs("div",{className:"relative mb-3 group/progress",children:[jsx("div",{className:"absolute top-1/2 left-0 h-1 bg-white/30 rounded-full -translate-y-1/2",style:{width:`${_}%`}}),jsx(en,{value:[$e],onValueChange:oe,min:0,max:100,step:.1,className:"h-1 group-hover/progress:h-2 transition-all cursor-pointer [&_[role=slider]]:w-3 [&_[role=slider]]:h-3 [&_[role=slider]]:opacity-0 group-hover/progress:[&_[role=slider]]:opacity-100 [&_[role=slider]]:transition-opacity"})]}),jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:ne,children:P?jsx(Pause,{className:"w-5 h-5",fill:"currentColor"}):jsx(Play,{className:"w-5 h-5",fill:"currentColor"})}),v&&jsxs(Fragment,{children:[jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:()=>Se(-b),children:jsx(SkipBack,{className:"w-5 h-5"})}),jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:()=>Se(b),children:jsx(SkipForward,{className:"w-5 h-5"})})]}),f&&jsxs("div",{className:"flex items-center gap-1 group/volume",children:[jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:Ft,children:U||j===0?jsx(VolumeX,{className:"w-5 h-5"}):jsx(Volume2,{className:"w-5 h-5"})}),jsx("div",{className:"w-0 overflow-hidden group-hover/volume:w-20 transition-all",children:jsx(en,{value:[U?0:j*100],onValueChange:ke,min:0,max:100,step:1,className:"w-20"})})]}),jsxs("div",{className:"text-white text-sm ml-2",children:[zh(H)," / ",zh(B)]})]}),jsxs("div",{className:"flex items-center gap-1",children:[g&&jsxs(Zt,{children:[jsx(Jt,{children:jsxs("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer flex items-center gap-1",children:[jsx(Settings,{className:"w-5 h-5"}),jsxs("span",{className:"text-xs",children:[Ne,"x"]})]})}),jsx(Qt,{align:"end",className:"min-w-[100px]",children:d.map(re=>jsxs(Et,{onSelect:()=>qe(re),className:m(Ne===re&&"bg-primary/10 text-primary"),children:[re,"x"]},re))})]}),F.length>1&&jsxs(Zt,{children:[jsx(Jt,{children:jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer text-xs",children:F[q]?.quality||F[q]?.label||"Quality"})}),jsx(Qt,{align:"end",className:"min-w-[100px]",children:F.map((re,we)=>jsx(Et,{onSelect:()=>{let Mr=M.current?.currentTime||0;X(we),setTimeout(()=>{M.current&&(M.current.currentTime=Mr,P&&M.current.play());},100);},className:m(q===we&&"bg-primary/10 text-primary"),children:re.quality||re.label||`Source ${we+1}`},we))})]}),u&&typeof document<"u"&&document.pictureInPictureEnabled&&jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:eo,children:jsx(PictureInPicture,{className:"w-5 h-5"})}),p&&jsx("button",{type:"button",className:"p-2 text-white hover:bg-white/20 rounded-md transition-colors cursor-pointer",onClick:bt,children:V?jsx(Minimize,{className:"w-5 h-5"}):jsx(Maximize,{className:"w-5 h-5"})})]})]})]})]})});Oh.displayName="VideoPlayer";function Ca(e){if(!e||!isFinite(e))return "0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return `${t}:${n.toString().padStart(2,"0")}`}var Fh={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},pk={default:{progress:"bg-foreground",waveformActive:"bg-foreground",waveformInactive:"bg-muted-foreground/30"},primary:{progress:"bg-primary",waveformActive:"bg-primary",waveformInactive:"bg-primary/20"},success:{progress:"bg-green-500",waveformActive:"bg-green-500",waveformInactive:"bg-green-500/20"},warning:{progress:"bg-amber-500",waveformActive:"bg-amber-500",waveformInactive:"bg-amber-500/20"},danger:{progress:"bg-red-500",waveformActive:"bg-red-500",waveformInactive:"bg-red-500/20"}},Bh=Z.forwardRef(({className:e,src:t,autoPlay:n=false,defaultVolume:r=1,loop:o=false,muted:a=false,showWaveform:s=true,waveformData:i,waveformBars:l=50,showTrackInfo:c=true,showVolume:d=true,showSkipButtons:u=false,skipInterval:p=10,showLoop:f=true,showShuffle:g=false,showDownload:v=false,variant:b="default",color:h="default",customColor:x,onPlay:R,onPause:N,onEnded:w,onAudioTimeUpdate:y,radius:C="lg",...E},L)=>{let k=Z.useRef(null),S=Z.useRef(null),[T,M]=Z.useState(false),[D,P]=Z.useState(0),[I,H]=Z.useState(0),[A,B]=Z.useState(r),[$,j]=Z.useState(a),[G,U]=Z.useState(true),[W,V]=Z.useState(o),[z,K]=Z.useState(false),Y=Z.useMemo(()=>typeof t=="string"?{src:t}:t,[t]),Q=Z.useMemo(()=>{if(i)return i;let oe=[];for(let ke=0;ke<l;ke++)oe.push(.2+Math.random()*.8);return oe},[i,l]),J=()=>{k.current&&(H(k.current.duration),U(false));},Ne=()=>{k.current&&(P(k.current.currentTime),y?.(k.current.currentTime,k.current.duration));},be=()=>{M(true),R?.();},_=()=>{M(false),N?.();},O=()=>{M(false),w?.();},F=()=>{U(false);},q=()=>{k.current&&(T?k.current.pause():k.current.play());},X=oe=>{if(k.current&&I){let ke=oe/100*I;k.current.currentTime=ke,P(ke);}},Re=oe=>{if(!S.current||!I)return;let ke=S.current.getBoundingClientRect(),Ft=(oe.clientX-ke.left)/ke.width*100;X(Ft);},Te=oe=>{let ke=oe[0]/100;B(ke),j(ke===0),k.current&&(k.current.volume=ke,k.current.muted=ke===0);},ot=()=>{if(k.current){let oe=!$;k.current.muted=oe,j(oe);}},ue=()=>{if(k.current){let oe=!W;k.current.loop=oe,V(oe);}},tt=oe=>{k.current&&(k.current.currentTime=Math.max(0,Math.min(I,k.current.currentTime+oe)));},te=()=>{let oe=document.createElement("a");oe.href=Y.src,oe.download=Y.title||"audio",document.body.appendChild(oe),oe.click(),document.body.removeChild(oe);},at=I>0?D/I*100:0,qt=pk[h],ne=$||A===0?VolumeX:A<.5?Volume1:Volume2;return b==="compact"?jsxs("div",{ref:L,className:m("flex items-center gap-3 p-2 bg-muted/50",Fh[C],e),...E,children:[jsx("audio",{ref:k,src:Y.src,autoPlay:n,loop:W,muted:a,onLoadedMetadata:J,onTimeUpdate:Ne,onPlay:be,onPause:_,onEnded:O,onCanPlay:F}),jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded-full transition-colors cursor-pointer",onClick:q,disabled:G,children:G?jsx(Loader2,{className:"w-4 h-4 animate-spin"}):T?jsx(Pause,{className:"w-4 h-4",fill:"currentColor"}):jsx(Play,{className:"w-4 h-4",fill:"currentColor"})}),jsx("div",{className:"flex-1",children:jsx(en,{value:[at],onValueChange:oe=>X(oe[0]),min:0,max:100,step:.1,className:"h-1"})}),jsx("span",{className:"text-xs text-muted-foreground min-w-[35px]",children:Ca(D)})]}):b==="minimal"?jsxs("div",{ref:L,className:m("flex items-center gap-4",e),...E,children:[jsx("audio",{ref:k,src:Y.src,autoPlay:n,loop:W,muted:a,onLoadedMetadata:J,onTimeUpdate:Ne,onPlay:be,onPause:_,onEnded:O,onCanPlay:F}),jsx("button",{type:"button",className:m("p-3 rounded-full transition-colors cursor-pointer",!x&&qt.progress,"text-white hover:opacity-90"),style:x?{backgroundColor:x}:void 0,onClick:q,disabled:G,children:G?jsx(Loader2,{className:"w-5 h-5 animate-spin"}):T?jsx(Pause,{className:"w-5 h-5",fill:"currentColor"}):jsx(Play,{className:"w-5 h-5 ml-0.5",fill:"currentColor"})}),jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[c&&Y.title&&jsx("span",{className:"text-sm font-medium truncate",children:Y.title}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-xs text-muted-foreground min-w-[35px]",children:Ca(D)}),jsx(en,{value:[at],onValueChange:oe=>X(oe[0]),min:0,max:100,step:.1,className:"flex-1"}),jsx("span",{className:"text-xs text-muted-foreground min-w-[35px]",children:Ca(I)})]})]})]}):jsxs("div",{ref:L,className:m("p-4 bg-card border border-border",Fh[C],e),...E,children:[jsx("audio",{ref:k,src:Y.src,autoPlay:n,loop:W,muted:a,onLoadedMetadata:J,onTimeUpdate:Ne,onPlay:be,onPause:_,onEnded:O,onCanPlay:F}),c&&(Y.title||Y.artist||Y.artwork)&&jsxs("div",{className:"flex items-center gap-4 mb-4",children:[Y.artwork&&jsx("img",{src:Y.artwork,alt:Y.title||"Album artwork",className:"w-16 h-16 rounded-md object-cover"}),jsxs("div",{className:"flex-1 min-w-0",children:[Y.title&&jsx("h3",{className:"font-medium truncate",children:Y.title}),Y.artist&&jsx("p",{className:"text-sm text-muted-foreground truncate",children:Y.artist}),Y.album&&jsx("p",{className:"text-xs text-muted-foreground truncate",children:Y.album})]})]}),s?jsx("div",{ref:S,className:"relative h-16 mb-4 flex items-end gap-[2px] cursor-pointer",onClick:Re,children:Q.map((oe,ke)=>{let bt=(ke+1)/Q.length*100<=at;return jsx("div",{className:m("flex-1 rounded-sm transition-colors",!x&&(bt?qt.waveformActive:qt.waveformInactive)),style:{height:`${oe*100}%`,minHeight:4,...x&&{backgroundColor:bt?x:`${x}33`}}},ke)})}):jsx("div",{className:"mb-4",children:jsx(en,{value:[at],onValueChange:oe=>X(oe[0]),min:0,max:100,step:.1})}),jsxs("div",{className:"flex justify-between text-xs text-muted-foreground mb-4",children:[jsx("span",{children:Ca(D)}),jsx("span",{children:Ca(I)})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsxs("div",{className:"flex items-center gap-1",children:[g&&jsx("button",{type:"button",className:m("p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",z&&"text-primary"),onClick:()=>K(!z),children:jsx(Shuffle,{className:"w-4 h-4"})}),u&&jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",onClick:()=>tt(-p),children:jsx(SkipBack,{className:"w-5 h-5"})})]}),jsx("button",{type:"button",className:m("p-4 rounded-full transition-colors cursor-pointer",!x&&qt.progress,"text-white hover:opacity-90"),style:x?{backgroundColor:x}:void 0,onClick:q,disabled:G,children:G?jsx(Loader2,{className:"w-6 h-6 animate-spin"}):T?jsx(Pause,{className:"w-6 h-6",fill:"currentColor"}):jsx(Play,{className:"w-6 h-6 ml-0.5",fill:"currentColor"})}),jsxs("div",{className:"flex items-center gap-1",children:[u&&jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",onClick:()=>tt(p),children:jsx(SkipForward,{className:"w-5 h-5"})}),f&&jsx("button",{type:"button",className:m("p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",W&&"text-primary"),onClick:ue,children:jsx(Repeat,{className:"w-4 h-4"})})]})]}),jsxs("div",{className:"flex items-center justify-between mt-4",children:[d?jsxs("div",{className:"flex items-center gap-2 flex-1",children:[jsx("button",{type:"button",className:"p-1 hover:bg-muted rounded transition-colors cursor-pointer",onClick:ot,children:jsx(ne,{className:"w-4 h-4"})}),jsx(en,{value:[$?0:A*100],onValueChange:Te,min:0,max:100,step:1,className:"w-24"})]}):jsx("div",{}),v&&jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors cursor-pointer",onClick:te,children:jsx(Download,{className:"w-4 h-4"})})]})]})});Bh.displayName="AudioPlayer";var Nk={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},$h=Z.forwardRef(({className:e,src:t,defaultPage:n=1,defaultZoom:r=100,showToolbar:o=true,showNavigation:a=true,showZoomControls:s=true,showDownload:i=true,showPrint:l=true,showFullscreen:c=true,showRotate:d=true,showSearch:u=false,zoomStep:p=25,minZoom:f=25,maxZoom:g=400,toolbarPosition:v="top",height:b="600px",onPageChange:h,onZoomChange:x,onPDFLoad:R,onPDFError:N,errorMessage:w="Failed to load PDF. Please try again.",loadingMessage:y="Loading PDF...",fileName:C="document.pdf",totalPages:E=1,radius:L="lg",...k},S)=>{let T=Z.useRef(null),M=Z.useRef(null),[D,P]=Z.useState(n),[I]=Z.useState(E),[H,A]=Z.useState(r),[B,$]=Z.useState(0),[j,G]=Z.useState(false),[U,W]=Z.useState(true),[V,z]=Z.useState(false),[K,Y]=Z.useState(String(n)),Q=te=>{let at=Math.max(1,Math.min(I,te));P(at),Y(String(at)),h?.(at);},J=te=>{Y(te.target.value);},Ne=()=>{let te=parseInt(K,10);isNaN(te)?Y(String(D)):Q(te);},be=te=>{te.key==="Enter"&&Ne();},_=()=>{let te=Math.min(g,H+p);A(te),x?.(te);},O=()=>{let te=Math.max(f,H-p);A(te),x?.(te);},F=()=>{$(te=>(te+90)%360);},q=async()=>{if(T.current)try{j?await document.exitFullscreen():await T.current.requestFullscreen();}catch{}};Z.useEffect(()=>{let te=()=>{G(!!document.fullscreenElement);};return document.addEventListener("fullscreenchange",te),()=>{document.removeEventListener("fullscreenchange",te);}},[]);let X=()=>{let te=document.createElement("a");te.href=t,te.download=C,document.body.appendChild(te),te.click(),document.body.removeChild(te);},Re=()=>{M.current?.contentWindow&&M.current.contentWindow.print();},Te=()=>{W(false),z(false),R?.();},ot=()=>{W(false),z(true),N?.(new Error("Failed to load PDF"));},ue=Z.useMemo(()=>{if(typeof window>"u")return t;try{let te=new URL(t,window.location.href);return te.hash=`page=${D}&zoom=${H}`,te.toString()}catch{return t}},[t,D,H]),tt=jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 bg-muted/50 border-b border-border",children:[a&&jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>Q(D-1),disabled:D<=1,title:"Previous page",children:jsx(ChevronLeft,{className:"w-4 h-4"})}),jsxs("div",{className:"flex items-center gap-1.5",children:[jsx(er,{value:K,onChange:J,onBlur:Ne,onKeyDown:be,className:"w-12 h-7 text-center text-sm px-1"}),jsxs("span",{className:"text-sm text-muted-foreground",children:["/ ",I]})]}),jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>Q(D+1),disabled:D>=I,title:"Next page",children:jsx(ChevronRight,{className:"w-4 h-4"})})]}),s&&jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:O,disabled:H<=f,title:"Zoom out",children:jsx(ZoomOut,{className:"w-4 h-4"})}),jsxs("span",{className:"text-sm text-muted-foreground min-w-[50px] text-center",children:[H,"%"]}),jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",onClick:_,disabled:H>=g,title:"Zoom in",children:jsx(ZoomIn,{className:"w-4 h-4"})})]}),jsxs("div",{className:"flex items-center gap-1",children:[u&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",title:"Search",children:jsx(Search,{className:"w-4 h-4"})}),d&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:F,title:"Rotate",children:jsx(RotateCw,{className:"w-4 h-4"})}),l&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:Re,title:"Print",children:jsx(Printer,{className:"w-4 h-4"})}),i&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:X,title:"Download",children:jsx(Download,{className:"w-4 h-4"})}),c&&jsx("button",{type:"button",className:"p-1.5 hover:bg-muted rounded transition-colors cursor-pointer",onClick:q,title:j?"Exit fullscreen":"Fullscreen",children:j?jsx(Minimize,{className:"w-4 h-4"}):jsx(Maximize,{className:"w-4 h-4"})})]})]});return jsxs("div",{ref:te=>{T.current=te,typeof S=="function"?S(te):S&&(S.current=te);},className:m("flex flex-col bg-card border border-border overflow-hidden",Nk[L],e),style:{height:j?"100vh":b},...k,children:[o&&v==="top"&&tt,jsxs("div",{className:"flex-1 relative overflow-hidden bg-muted/30",children:[U&&jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-background/80 z-10",children:[jsx(Loader2,{className:"w-8 h-8 animate-spin text-muted-foreground mb-2"}),jsx("span",{className:"text-sm text-muted-foreground",children:y})]}),V&&jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-background z-10",children:[jsx(FileWarning,{className:"w-12 h-12 text-muted-foreground mb-3"}),jsx("span",{className:"text-sm text-muted-foreground",children:w}),jsx("button",{type:"button",className:"mt-3 px-4 py-2 text-sm bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors cursor-pointer",onClick:()=>{W(true),z(false);},children:"Try again"})]}),jsx("iframe",{ref:M,src:ue,className:"w-full h-full border-0",style:{transform:`rotate(${B}deg) scale(${H/100})`,transformOrigin:"center center"},onLoad:Te,onError:ot,title:"PDF Viewer"})]}),o&&v==="bottom"&&tt]})});$h.displayName="PDFViewer";function zo(e){let t=useCallback(o=>typeof window<"u"?window.matchMedia(o).matches:false,[]),[n,r]=useState(()=>t(e));return useEffect(()=>{let o=window.matchMedia(e),a=()=>{r(o.matches);};return r(o.matches),o.addEventListener("change",a),()=>{o.removeEventListener("change",a);}},[e]),n}function Pk(){return zo("(max-width: 767px)")}function Lk(){return zo("(min-width: 768px) and (max-width: 1023px)")}function Dk(){return zo("(min-width: 1024px)")}function Hk(){return zo("(prefers-color-scheme: dark)")?"dark":"light"}function Ik(){return zo("(prefers-reduced-motion: reduce)")}function Ma(e={}){let{initialWidth:t=0,initialHeight:n=0,debounce:r=0,includeScrollbar:o=true}=e,[a,s]=useState(()=>typeof window>"u"?{width:t,height:n}:{width:o?window.innerWidth:document.documentElement.clientWidth,height:o?window.innerHeight:document.documentElement.clientHeight}),i=useRef(null),l=useCallback(()=>{let c=()=>{s({width:o?window.innerWidth:document.documentElement.clientWidth,height:o?window.innerHeight:document.documentElement.clientHeight});};r>0?(i.current&&clearTimeout(i.current),i.current=setTimeout(c,r)):c();},[r,o]);return useEffect(()=>(l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l),i.current&&clearTimeout(i.current);}),[l]),a}function Fk(){let{width:e}=Ma();return e}function Bk(){let{height:e}=Ma();return e}function $k(e){let{width:t}=Ma();return t>=e}function Kk(){let{width:e}=Ma();return {isSm:e>=640,isMd:e>=768,isLg:e>=1024,isXl:e>=1280,is2xl:e>=1536}}function _k(e,t){let n=useCallback(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.warn(`Error reading localStorage key "${e}":`,i),t}},[t,e]),[r,o]=useState(n),a=useCallback(i=>{if(typeof window>"u"){console.warn(`Tried setting localStorage key "${e}" even though environment is not a browser`);return}try{let l=i instanceof Function?i(r):i;o(l),window.localStorage.setItem(e,JSON.stringify(l)),window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:JSON.stringify(l)}));}catch(l){console.warn(`Error setting localStorage key "${e}":`,l);}},[e,r]),s=useCallback(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(e),o(t),window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:null}));}catch(i){console.warn(`Error removing localStorage key "${e}":`,i);}},[e,t]);return useEffect(()=>{let i=l=>{if(l.key===e&&l.newValue!==null)try{o(JSON.parse(l.newValue));}catch{o(l.newValue);}else l.key===e&&l.newValue===null&&o(t);};return window.addEventListener("storage",i),()=>{window.removeEventListener("storage",i);}},[e,t]),[r,a,s]}function Wk(e,t){let n=useCallback(()=>{if(typeof window>"u")return t;try{let i=window.sessionStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.warn(`Error reading sessionStorage key "${e}":`,i),t}},[t,e]),[r,o]=useState(n),a=useCallback(i=>{if(typeof window>"u"){console.warn(`Tried setting sessionStorage key "${e}" even though environment is not a browser`);return}try{let l=i instanceof Function?i(r):i;o(l),window.sessionStorage.setItem(e,JSON.stringify(l));}catch(l){console.warn(`Error setting sessionStorage key "${e}":`,l);}},[e,r]),s=useCallback(()=>{if(!(typeof window>"u"))try{window.sessionStorage.removeItem(e),o(t);}catch(i){console.warn(`Error removing sessionStorage key "${e}":`,i);}},[e,t]);return [r,a,s]}function Xk(e,t=500){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function Zk(e,t=500){let n=useRef(null),r=useRef(e);return useEffect(()=>{r.current=e;},[e]),useEffect(()=>()=>{n.current&&clearTimeout(n.current);},[]),useCallback((...a)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current(...a);},t);},[t])}function Jk(e,t=500){let n=useRef(null),r=useRef(e),o=useRef(null);useEffect(()=>{r.current=e;},[e]),useEffect(()=>()=>{n.current&&clearTimeout(n.current);},[]);let a=useCallback((...c)=>{o.current=c,n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current(...c),n.current=null,o.current=null;},t);},[t]),s=useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null,o.current=null);},[]),i=useCallback(()=>{n.current&&o.current&&(clearTimeout(n.current),r.current(...o.current),n.current=null,o.current=null);},[]),l=useCallback(()=>n.current!==null,[]);return {debouncedCallback:a,cancel:s,flush:i,isPending:l}}function tS(e,t=500){let[n,r]=useState(e),o=useRef(Date.now());return useEffect(()=>{let a=Date.now();if(a>=o.current+t)o.current=a,r(e);else {let s=setTimeout(()=>{o.current=Date.now(),r(e);},t-(a-o.current));return ()=>clearTimeout(s)}},[e,t]),n}function nS(e,t=500){let n=useRef(0),r=useRef(null),o=useRef(e);return useEffect(()=>{o.current=e;},[e]),useEffect(()=>()=>{r.current&&clearTimeout(r.current);},[]),useCallback((...s)=>{let i=Date.now();i-n.current>=t?(o.current(...s),n.current=i):(r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{o.current(...s),n.current=Date.now();},t-(i-n.current)));},[t])}function oS(e,t=true){let n=useRef(null);return useEffect(()=>{if(!t)return;let r=o=>{let a=n.current;!a||a.contains(o.target)||e(o);};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r);}},[e,t]),n}function aS(e,t,n=true){useEffect(()=>{if(!n)return;let r=o=>{e.some(s=>{let i=s.current;return i&&i.contains(o.target)})||t(o);};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r);}},[e,t,n]);}function sS(e=2e3){let[t,n]=useState(null),[r,o]=useState(false),[a,s]=useState(false),i=useCallback(()=>{n(null),o(false);},[]),l=useCallback(async c=>{if(!navigator?.clipboard)return console.warn("Clipboard API not available"),false;s(true);try{return await navigator.clipboard.writeText(c),n(c),o(!0),e>0&&setTimeout(()=>{o(!1);},e),!0}catch(d){return console.warn("Copy to clipboard failed:",d),n(null),o(false),false}finally{s(false);}},[e]);return {copiedValue:t,success:r,isLoading:a,copy:l,reset:i}}function iS(){return useCallback(async e=>{if(!navigator?.clipboard)return console.warn("Clipboard API not available"),false;try{return await navigator.clipboard.writeText(e),!0}catch(t){return console.warn("Copy to clipboard failed:",t),false}},[])}function Gh(e){let t=e.toLowerCase().split("+");return {key:t[t.length-1],ctrl:t.includes("ctrl")||t.includes("control"),alt:t.includes("alt")||t.includes("option"),shift:t.includes("shift"),meta:t.includes("meta")||t.includes("cmd")||t.includes("command")}}function Uh(e,t){let n=e.key.toLowerCase(),r=n===" "?"space":n==="escape"?"esc":n,o=t.key==="space"?" ":t.key;return (r===o||e.code.toLowerCase()===`key${o}`)&&e.ctrlKey===t.ctrl&&e.altKey===t.alt&&e.shiftKey===t.shift&&e.metaKey===t.meta}function lS(e,t,n={}){let{enabled:r=true,preventDefault:o=true,stopPropagation:a=false,target:s=null}=n,i=useRef(t);i.current=t;let l=Gh(e);useEffect(()=>{if(!r)return;let c=u=>{Uh(u,l)&&(o&&u.preventDefault(),a&&u.stopPropagation(),i.current(u));},d=s||document;return d.addEventListener("keydown",c),()=>{d.removeEventListener("keydown",c);}},[r,o,a,s,l]);}function cS(e,t={}){let{enabled:n=true,preventDefault:r=true,stopPropagation:o=false,target:a=null}=t,s=useRef(e);s.current=e;let i=Object.entries(e).map(([l,c])=>({parsed:Gh(l),handler:c}));useEffect(()=>{if(!n)return;let l=d=>{for(let{parsed:u,handler:p}of i)if(Uh(d,u)){r&&d.preventDefault(),o&&d.stopPropagation(),p(d);break}},c=a||document;return c.addEventListener("keydown",l),()=>{c.removeEventListener("keydown",l);}},[n,r,o,a,i]);}function dS(e){let t=useRef(false);return useEffect(()=>{let n=o=>{o.key===e&&(t.current=true);},r=o=>{o.key===e&&(t.current=false);};return document.addEventListener("keydown",n),document.addEventListener("keyup",r),()=>{document.removeEventListener("keydown",n),document.removeEventListener("keyup",r);}},[e]),t.current}function uS(e,t,n,r){let o=useRef(t);o.current=t,useEffect(()=>{let a;if(n==null?a=window:"current"in n?a=n.current:a=n,!a)return;let s=i=>{o.current(i);};return a.addEventListener(e,s,r),()=>{a?.removeEventListener(e,s,r);}},[e,n,r]);}function mS(e,t,n){let r=useRef(null),o=useRef(t);return o.current=t,useEffect(()=>{let a=r.current;if(!a)return;let s=i=>{o.current(i);};return a.addEventListener(e,s,n),()=>{a.removeEventListener(e,s,n);}},[e,n]),r}function pS(e,t,n={}){let{target:r,event:o="keydown",enabled:a=true}=n,s=useRef(t);s.current=t,useEffect(()=>{if(!a)return;let i=r?.current||window,l=c=>{c.key===e&&s.current(c);};return i.addEventListener(o,l),()=>{i.removeEventListener(o,l);}},[e,r,o,a]);}function fS(e,t={}){let{threshold:n=500,onStart:r,onCancel:o,enabled:a=true}=t,s=useRef(null),i=useRef(false),l=useRef(null),c=useCallback(u=>{a&&(l.current=u,i.current=false,r?.(u),s.current=setTimeout(()=>{i.current=true,l.current&&e(l.current);},n));},[e,n,r,a]),d=useCallback(u=>{a&&(s.current&&(clearTimeout(s.current),s.current=null),i.current||o?.(u),i.current=false,l.current=null);},[o,a]);return {onMouseDown:c,onMouseUp:d,onMouseLeave:d,onTouchStart:c,onTouchEnd:d}}function gS(e){let t=useRef(null),[n,r]=useState(false),o=useCallback(()=>{r(true),e?.onHoverStart?.();},[e]),a=useCallback(()=>{r(false),e?.onHoverEnd?.();},[e]);return useEffect(()=>{let s=t.current;if(s)return s.addEventListener("mouseenter",o),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mouseenter",o),s.removeEventListener("mouseleave",a);}},[o,a]),{ref:t,isHovered:n}}function bS(e,t){let[n,r]=useState(false),o=useCallback(()=>{r(true),t?.onHoverStart?.();},[t]),a=useCallback(()=>{r(false),t?.onHoverEnd?.();},[t]);return useEffect(()=>{let s=e.current;if(s)return s.addEventListener("mouseenter",o),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mouseenter",o),s.removeEventListener("mouseleave",a);}},[e,o,a]),n}function vS(){let[e,t]=useState(false);return {isHovered:e,hoverProps:{onMouseEnter:()=>t(true),onMouseLeave:()=>t(false)}}}function hS(e=0){let t=useRef(null),[n,r]=useState(false),o=useRef(null);return useEffect(()=>{let a=t.current;if(!a)return;let s=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(true);},e);},i=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(false);},e);};return a.addEventListener("mouseenter",s),a.addEventListener("mouseleave",i),()=>{a.removeEventListener("mouseenter",s),a.removeEventListener("mouseleave",i),o.current&&clearTimeout(o.current);}},[e]),{ref:t,isHovered:n}}function yS(){let[e,t]=useState({x:0,y:0});return useEffect(()=>{let n=r=>{t({x:r.clientX,y:r.clientY});};return window.addEventListener("mousemove",n),()=>{window.removeEventListener("mousemove",n);}},[]),e}function RS(e={}){let{enabled:t=true,resetOnLeave:n=false}=e,r=useRef(null),[o,a]=useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});return useEffect(()=>{let s=r.current;if(!s||!t)return;let i=c=>{let d=s.getBoundingClientRect();a({x:c.clientX,y:c.clientY,elementX:c.clientX-d.left,elementY:c.clientY-d.top,elementPositionX:d.left,elementPositionY:d.top,pageX:c.pageX,pageY:c.pageY});},l=()=>{n&&a({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});};return s.addEventListener("mousemove",i),n&&s.addEventListener("mouseleave",l),()=>{s.removeEventListener("mousemove",i),n&&s.removeEventListener("mouseleave",l);}},[t,n]),{ref:r,...o}}function wS(e,t={}){let{enabled:n=true,resetOnLeave:r=false}=t,[o,a]=useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});return useEffect(()=>{let s=e.current;if(!s||!n)return;let i=c=>{let d=s.getBoundingClientRect();a({x:c.clientX,y:c.clientY,elementX:c.clientX-d.left,elementY:c.clientY-d.top,elementPositionX:d.left,elementPositionY:d.top,pageX:c.pageX,pageY:c.pageY});},l=()=>{r&&a({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0,pageX:0,pageY:0});};return s.addEventListener("mousemove",i),r&&s.addEventListener("mouseleave",l),()=>{s.removeEventListener("mousemove",i),r&&s.removeEventListener("mouseleave",l);}},[e,n,r]),o}function CS(e={}){let{threshold:t=0,throttle:n=0,element:r}=e,[o,a]=useState({x:0,y:0,isScrolled:false,directionY:0,directionX:0,isAtBottom:false,isAtTop:true,progress:0}),s=useRef(0),i=useRef(0),l=useRef(false),c=useRef(0),d=useCallback(()=>{let p=r?.current,f=p?p.scrollTop:window.scrollY,g=p?p.scrollLeft:window.scrollX,v=p?p.scrollHeight-p.clientHeight:document.documentElement.scrollHeight-window.innerHeight,b=f>s.current?1:f<s.current?-1:0,h=g>i.current?1:g<i.current?-1:0;s.current=f,i.current=g,a({x:g,y:f,isScrolled:f>t,directionY:b,directionX:h,isAtBottom:f>=v-1,isAtTop:f<=0,progress:v>0?f/v:0}),l.current=false;},[r,t]),u=useCallback(()=>{let p=Date.now();if(n>0&&p-c.current<n){l.current||(l.current=true,requestAnimationFrame(d));return}c.current=p,l.current||(l.current=true,requestAnimationFrame(d));},[n,d]);return useEffect(()=>{let p=r?.current||window;return p.addEventListener("scroll",u,{passive:true}),d(),()=>{p.removeEventListener("scroll",u);}},[r,u,d]),o}function MS(){let[e,t]=useState({x:0,y:0});return useEffect(()=>{let n=()=>{t({x:window.scrollX,y:window.scrollY});};return window.addEventListener("scroll",n,{passive:true}),n(),()=>{window.removeEventListener("scroll",n);}},[]),e}function Zh(e={}){let{autoLock:t=false,lockX:n=true}=e,r=useRef(false),o=useRef({x:0,y:0}),a=useRef(null),s=useCallback(()=>{if(typeof document>"u"||r.current)return;let{body:l}=document,c=window.scrollY,d=window.scrollX;o.current={x:d,y:c},a.current={overflow:l.style.overflow,overflowX:l.style.overflowX,overflowY:l.style.overflowY,position:l.style.position,top:l.style.top,left:l.style.left,width:l.style.width},l.style.overflow="hidden",n&&(l.style.overflowX="hidden"),l.style.overflowY="hidden",l.style.position="fixed",l.style.top=`-${c}px`,l.style.left=n?`-${d}px`:"0",l.style.width="100%",r.current=true;},[n]),i=useCallback(()=>{if(typeof document>"u"||!r.current)return;let{body:l}=document,c=a.current;c&&(l.style.overflow=c.overflow,l.style.overflowX=c.overflowX,l.style.overflowY=c.overflowY,l.style.position=c.position,l.style.top=c.top,l.style.left=c.left,l.style.width=c.width),window.scrollTo(o.current.x,o.current.y),r.current=false;},[]);return useEffect(()=>(t&&s(),()=>{i();}),[t,s,i]),{lock:s,unlock:i,isLocked:r.current}}function TS(e=true){let{lock:t,unlock:n}=Zh();useEffect(()=>{e?t():n();},[e,t,n]);}function ex(e={}){let{root:t=null,rootMargin:n="0px",threshold:r=0,once:o=false,enabled:a=true}=e,s=useRef(null),[i,l]=useState({isIntersecting:false,entry:null});return useEffect(()=>{let c=s.current;if(!c||!a)return;let d=new IntersectionObserver(([u])=>{l({isIntersecting:u.isIntersecting,entry:u}),o&&u.isIntersecting&&d.disconnect();},{root:t,rootMargin:n,threshold:r});return d.observe(c),()=>{d.disconnect();}},[t,n,r,o,a]),{ref:s,...i}}function kS(e,t={}){let{root:n=null,rootMargin:r="0px",threshold:o=0,once:a=false,enabled:s=true}=t,[i,l]=useState({isIntersecting:false,entry:null});return useEffect(()=>{let c=e.current;if(!c||!s)return;let d=new IntersectionObserver(([u])=>{l({isIntersecting:u.isIntersecting,entry:u}),a&&u.isIntersecting&&d.disconnect();},{root:n,rootMargin:r,threshold:o});return d.observe(c),()=>{d.disconnect();}},[e,n,r,o,a,s]),i}function SS(e="200px"){let{ref:t,isIntersecting:n}=ex({rootMargin:e,once:true});return {ref:t,isVisible:n}}function ES(e,t={}){let{enabled:n=true,childList:r=true,attributes:o=true,characterData:a=false,subtree:s=false,attributeOldValue:i=false,characterDataOldValue:l=false,attributeFilter:c}=t,d=useRef(null),u=useRef(e);return u.current=e,useEffect(()=>{let p=d.current;if(!p||!n)return;let f=new MutationObserver((g,v)=>{u.current(g,v);});return f.observe(p,{childList:r,attributes:o,characterData:a,subtree:s,attributeOldValue:i,characterDataOldValue:l,attributeFilter:c}),()=>{f.disconnect();}},[n,r,o,a,s,i,l,c]),d}function PS(e,t,n={}){let{enabled:r=true,childList:o=true,attributes:a=true,characterData:s=false,subtree:i=false,attributeOldValue:l=false,characterDataOldValue:c=false,attributeFilter:d}=n,u=useRef(t);u.current=t,useEffect(()=>{let p=e.current;if(!p||!r)return;let f=new MutationObserver((g,v)=>{u.current(g,v);});return f.observe(p,{childList:o,attributes:a,characterData:s,subtree:i,attributeOldValue:l,characterDataOldValue:c,attributeFilter:d}),()=>{f.disconnect();}},[e,r,o,a,s,i,l,c,d]);}function LS(e={}){let{enabled:t=true,box:n="content-box",debounce:r=0}=e,o=useRef(null),[a,s]=useState({width:0,height:0}),i=useRef(null),l=useCallback(c=>{let d=c[0];if(!d)return;let u,p;n==="border-box"&&d.borderBoxSize?.[0]?(u=d.borderBoxSize[0].inlineSize,p=d.borderBoxSize[0].blockSize):d.contentBoxSize?.[0]?(u=d.contentBoxSize[0].inlineSize,p=d.contentBoxSize[0].blockSize):(u=d.contentRect.width,p=d.contentRect.height);let f=()=>s({width:u,height:p});r>0?(i.current&&clearTimeout(i.current),i.current=setTimeout(f,r)):f();},[n,r]);return useEffect(()=>{let c=o.current;if(!c||!t)return;let d=new ResizeObserver(l);d.observe(c,{box:n});let u=c.getBoundingClientRect();return s({width:u.width,height:u.height}),()=>{d.disconnect(),i.current&&clearTimeout(i.current);}},[t,n,l]),{ref:o,...a}}function DS(e,t={}){let{enabled:n=true,box:r="content-box",debounce:o=0}=t,[a,s]=useState({width:0,height:0}),i=useRef(null),l=useCallback(c=>{let d=c[0];if(!d)return;let u,p;r==="border-box"&&d.borderBoxSize?.[0]?(u=d.borderBoxSize[0].inlineSize,p=d.borderBoxSize[0].blockSize):d.contentBoxSize?.[0]?(u=d.contentBoxSize[0].inlineSize,p=d.contentBoxSize[0].blockSize):(u=d.contentRect.width,p=d.contentRect.height);let f=()=>s({width:u,height:p});o>0?(i.current&&clearTimeout(i.current),i.current=setTimeout(f,o)):f();},[r,o]);return useEffect(()=>{let c=e.current;if(!c||!n)return;let d=new ResizeObserver(l);d.observe(c,{box:r});let u=c.getBoundingClientRect();return s({width:u.width,height:u.height}),()=>{d.disconnect(),i.current&&clearTimeout(i.current);}},[e,n,r,l]),a}function HS(){let e=useRef(null),t=useCallback(()=>{let n=e.current;if(!n)return {width:0,height:0};let r=n.getBoundingClientRect();return {width:r.width,height:r.height}},[]);return {ref:e,measure:t}}function ox(e={}){let{defaultOpen:t=false,isOpen:n,onOpen:r,onClose:o,onChange:a,id:s}=e,[i,l]=useState(t),c=n!==void 0,d=c?n:i,u=useCallback(()=>{c||l(true),r?.(),a?.(true);},[c,r,a]),p=useCallback(()=>{c||l(false),o?.(),a?.(false);},[c,o,a]),f=useCallback(()=>{d?p():u();},[d,u,p]),g=useCallback(h=>{h?u():p();},[u,p]),v=useCallback(()=>({onClick:f,"aria-expanded":d,...s&&{"aria-controls":s}}),[f,d,s]),b=useCallback(()=>({hidden:!d,...s&&{id:s}}),[d,s]);return useMemo(()=>({isOpen:d,open:u,close:p,toggle:f,setIsOpen:g,getButtonProps:v,getDisclosureProps:b}),[d,u,p,f,g,v,b])}function AS(e){return ox({...e,defaultOpen:true})}function zS(e=false){let[t,n]=useState(e),r=useCallback(()=>{n(o=>!o);},[]);return [t,r,n]}function OS(e,t=0){let[n,r]=useState(t),o=useCallback(()=>{r(i=>(i+1)%e.length);},[e.length]),a=useCallback(()=>{r(i=>(i-1+e.length)%e.length);},[e.length]),s=useCallback(i=>{let l=e.indexOf(i);l!==-1&&r(l);},[e]);return useMemo(()=>({value:e[n],index:n,next:o,prev:a,setIndex:r,setValue:s}),[e,n,o,a,s])}function FS(e=false){let[t,n]=useState(e),r=useCallback(()=>n(s=>!s),[]),o=useCallback(()=>n(true),[]),a=useCallback(()=>n(false),[]);return useMemo(()=>({value:t,toggle:r,on:o,off:a,set:n}),[t,r,o,a])}function $S(e=0,t={}){let{min:n=-1/0,max:r=1/0,step:o=1}=t,a=useCallback(g=>Math.min(Math.max(g,n),r),[n,r]),[s,i]=useState(()=>a(e)),l=useCallback(()=>{i(g=>a(g+o));},[a,o]),c=useCallback(()=>{i(g=>a(g-o));},[a,o]),d=useCallback(g=>{i(a(g));},[a]),u=useCallback(()=>{i(a(e));},[a,e]),p=s<=n,f=s>=r;return useMemo(()=>({count:s,increment:l,decrement:c,set:d,reset:u,isMin:p,isMax:f}),[s,l,c,d,u,p,f])}function KS(e=0){let[t,n]=useState(e),r=useCallback(()=>n(o=>o+1),[]);return [t,r]}function GS(e){let t=useRef(void 0);return useEffect(()=>{t.current=e;},[e]),t.current}function US(e,t){let n=useRef(t);return useEffect(()=>{n.current=e;},[e]),n.current}function _S(e){let t=useRef(void 0),n=useRef(e),r=n.current!==e;return useEffect(()=>{t.current=n.current,n.current=e;},[e]),{current:e,previous:t.current,hasChanged:r}}function YS(e=[]){let[t,n]=useState(e),r=useCallback(w=>{n(w);},[]),o=useCallback(w=>{n(y=>[...y,w]);},[]),a=useCallback(w=>{n(y=>[...y,...w]);},[]),s=useCallback((w,y)=>{n(C=>{let E=[...C];return E.splice(w,0,y),E});},[]),i=useCallback((w,y)=>{n(C=>{let E=[...C];return E[w]=y,E});},[]),l=useCallback(w=>{n(y=>y.filter((C,E)=>E!==w));},[]),c=useCallback(w=>{n(y=>{let C=y.indexOf(w);return C===-1?y:y.filter((E,L)=>L!==C)});},[]),d=useCallback(w=>{n(y=>y.filter(C=>!w(C)));},[]),u=useCallback(()=>{let w;return n(y=>y.length===0?y:(w=y[0],y.slice(1))),w},[]),p=useCallback(w=>{n(y=>[w,...y]);},[]),f=useCallback(()=>{let w;return n(y=>y.length===0?y:(w=y[y.length-1],y.slice(0,-1))),w},[]),g=useCallback(()=>{n([]);},[]),v=useCallback(()=>{n(e);},[e]),b=useCallback((w,y)=>{n(C=>{let E=[...C],[L]=E.splice(w,1);return E.splice(y,0,L),E});},[]),h=useCallback((w,y)=>{n(C=>{let E=[...C];return [E[w],E[y]]=[E[y],E[w]],E});},[]),x=useCallback(w=>t.filter(w),[t]),R=useCallback(w=>t.find(w),[t]),N=useCallback(w=>t.includes(w),[t]);return useMemo(()=>({list:t,set:r,push:o,pushMany:a,insertAt:s,updateAt:i,removeAt:l,remove:c,removeWhere:d,shift:u,unshift:p,pop:f,clear:g,reset:v,move:b,swap:h,filter:x,find:R,includes:N,length:t.length,isEmpty:t.length===0}),[t,r,o,a,s,i,l,c,d,u,p,f,g,v,b,h,x,R,N])}function qS(e=[]){let[t,n]=useState(()=>new Map(e)),r=useCallback(f=>t.get(f),[t]),o=useCallback((f,g)=>{n(v=>{let b=new Map(v);return b.set(f,g),b});},[]),a=useCallback(f=>{n(g=>{let v=new Map(g);return f.forEach(([b,h])=>v.set(b,h)),v});},[]),s=useCallback(f=>t.has(f),[t]),i=useCallback(f=>{n(g=>{let v=new Map(g);return v.delete(f),v});},[]),l=useCallback(()=>{n(new Map);},[]),c=useCallback(()=>{n(new Map(e));},[e]),d=useCallback(()=>Array.from(t.keys()),[t]),u=useCallback(()=>Array.from(t.values()),[t]),p=useCallback(()=>Array.from(t.entries()),[t]);return useMemo(()=>({map:t,get:r,set:o,setMany:a,has:s,delete:i,clear:l,reset:c,keys:d,values:u,entries:p,size:t.size,isEmpty:t.size===0}),[t,r,o,a,s,i,l,c,d,u,p])}function XS(e={}){let[t,n]=useState(e),r=useCallback(d=>t[d],[t]),o=useCallback((d,u)=>{n(p=>({...p,[d]:u}));},[]),a=useCallback(d=>{n(u=>({...u,...d}));},[]),s=useCallback(d=>{n(u=>{let{[d]:p,...f}=u;return f});},[]),i=useCallback(()=>{n({});},[]),l=useCallback(()=>{n(e);},[e]),c=useCallback(d=>d in t,[t]);return useMemo(()=>({value:t,get:r,set:o,setAll:a,remove:s,clear:i,reset:l,has:c,keys:Object.keys(t),values:Object.values(t)}),[t,r,o,a,s,i,l,c])}function dx(e=[]){let[t,n]=useState(()=>new Set(e)),r=useCallback(u=>{n(p=>{let f=new Set(p);return f.add(u),f});},[]),o=useCallback(u=>{n(p=>{let f=new Set(p);return u.forEach(g=>f.add(g)),f});},[]),a=useCallback(u=>{n(p=>{let f=new Set(p);return f.delete(u),f});},[]),s=useCallback(u=>t.has(u),[t]),i=useCallback(u=>{n(p=>{let f=new Set(p);return f.has(u)?f.delete(u):f.add(u),f});},[]),l=useCallback(()=>{n(new Set);},[]),c=useCallback(()=>{n(new Set(e));},[e]),d=useCallback(()=>Array.from(t),[t]);return useMemo(()=>({set:t,add:r,addMany:o,remove:a,has:s,toggle:i,clear:l,reset:c,values:d,size:t.size,isEmpty:t.size===0}),[t,r,o,a,s,i,l,c,d])}function JS(e=[]){let{add:t,remove:n,has:r,toggle:o,clear:a,addMany:s,values:i,size:l}=dx(e);return useMemo(()=>({selected:i(),isSelected:r,select:t,deselect:n,toggle:o,selectAll:s,deselectAll:a,count:l,isEmpty:l===0}),[i,r,t,n,o,s,a,l])}function QS(e=[]){let[t,n]=useState(e),r=useCallback(c=>{n(d=>[...d,c]);},[]),o=useCallback(c=>{n(d=>[...d,...c]);},[]),a=useCallback(()=>{let c;return n(d=>d.length===0?d:(c=d[0],d.slice(1))),c},[]),s=useCallback(()=>t[0],[t]),i=useCallback(()=>t[t.length-1],[t]),l=useCallback(()=>{n([]);},[]);return useMemo(()=>({queue:t,enqueue:r,enqueueMany:o,dequeue:a,peek:s,peekLast:i,clear:l,size:t.length,isEmpty:t.length===0,hasItems:t.length>0}),[t,r,o,a,s,i,l])}function eE(e=[]){let[t,n]=useState(e),r=useCallback(l=>{n(c=>[...c,l]);},[]),o=useCallback(l=>{n(c=>[...c,...l]);},[]),a=useCallback(()=>{let l;return n(c=>c.length===0?c:(l=c[c.length-1],c.slice(0,-1))),l},[]),s=useCallback(()=>t[t.length-1],[t]),i=useCallback(()=>{n([]);},[]);return useMemo(()=>({stack:t,push:r,pushMany:o,pop:a,peek:s,clear:i,size:t.length,isEmpty:t.length===0}),[t,r,o,a,s,i])}function fx(e,t=false){let[n,r]=useState({data:null,error:null,isLoading:false,isSuccess:false,isError:false,isIdle:true}),o=useRef(true),a=useRef(e);a.current=e;let s=useCallback(async(...l)=>{r(c=>({...c,isLoading:true,isIdle:false,isError:false,error:null}));try{let c=await a.current(...l);return o.current&&r({data:c,error:null,isLoading:!1,isSuccess:!0,isError:!1,isIdle:!1}),c}catch(c){let d=c instanceof Error?c:new Error(String(c));return o.current&&r({data:null,error:d,isLoading:false,isSuccess:false,isError:true,isIdle:false}),null}},[]),i=useCallback(()=>{r({data:null,error:null,isLoading:false,isSuccess:false,isError:false,isIdle:true});},[]);return useEffect(()=>(o.current=true,t&&s(),()=>{o.current=false;}),[t,s]),{...n,execute:s,reset:i}}function nE(e,t=3,n=1e3){let[r,o]=useState(0),a=useRef(e);a.current=e;let s=useCallback(async(...l)=>{let c=null;for(let d=0;d<=t;d++)try{return o(d),await a.current(...l)}catch(u){c=u instanceof Error?u:new Error(String(u)),d<t&&await new Promise(p=>setTimeout(p,n));}throw c},[t,n]);return {...fx(s,false),retryCount:r}}var vx=new Map,rE=300*1e3;function oE(e,t={}){let{immediate:n=true,init:r,transform:o,deps:a=[],enabled:s=true,refetchInterval:i,cacheKey:l}=t,[c,d]=useState({data:null,error:null,isLoading:false,isSuccess:false,isError:false}),u=useRef(null),p=useRef(true),f=useCallback(async()=>{if(!e||!s)return;let v=l||e,b=vx.get(v);if(b&&Date.now()-b.timestamp<rE){d({data:b.data,error:null,isLoading:false,isSuccess:true,isError:false});return}u.current&&u.current.abort(),u.current=new AbortController,d(h=>({...h,isLoading:true,error:null}));try{let h=await fetch(e,{...r,signal:u.current.signal});if(!h.ok)throw new Error(`HTTP error! status: ${h.status}`);let x=await h.json(),R=o?o(x):x;vx.set(v,{data:R,timestamp:Date.now()}),p.current&&d({data:R,error:null,isLoading:!1,isSuccess:!0,isError:!1});}catch(h){if(h instanceof Error&&h.name==="AbortError")return;let x=h instanceof Error?h:new Error(String(h));p.current&&d({data:null,error:x,isLoading:false,isSuccess:false,isError:true});}},[e,s,r,o,l]),g=useCallback(()=>{u.current&&u.current.abort();},[]);return useEffect(()=>(p.current=true,n&&s&&f(),()=>{p.current=false,g();}),[e,n,s,...a]),useEffect(()=>{if(!i||!s)return;let v=setInterval(f,i);return ()=>{clearInterval(v);}},[i,s,f]),{...c,refetch:f,abort:g}}function aE(e,t={}){let{transform:n,...r}=t,[o,a]=useState({data:null,error:null,isLoading:false,isSuccess:false,isError:false}),s=useCallback(async l=>{a(c=>({...c,isLoading:true,error:null}));try{let c=await fetch(e,{...r,method:r.method||"POST",headers:{"Content-Type":"application/json",...r.headers},body:l?JSON.stringify(l):void 0});if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);let d=await c.json(),u=n?n(d):d;return a({data:u,error:null,isLoading:!1,isSuccess:!0,isError:!1}),u}catch(c){let d=c instanceof Error?c:new Error(String(c));return a({data:null,error:d,isLoading:false,isSuccess:false,isError:true}),null}},[e,r,n]),i=useCallback(()=>{a({data:null,error:null,isLoading:false,isSuccess:false,isError:false});},[]);return {...o,mutate:s,reset:i}}function mi(e,t){let n=useRef(e);n.current=e,useEffect(()=>{if(t===null)return;let r=setInterval(()=>{n.current();},t);return ()=>{clearInterval(r);}},[t]);}function iE(e,t){let[n,r]=useState(false);mi(e,n?t:null);let o=useCallback(()=>r(true),[]),a=useCallback(()=>r(false),[]),s=useCallback(()=>r(i=>!i),[]);return {start:o,stop:a,toggle:s,isRunning:n}}function lE(e,t={}){let{interval:n=1e3,onComplete:r,autoStart:o=false}=t,[a,s]=useState(e),[i,l]=useState(o),c=useRef(r);c.current=r;let d=a<=0;mi(()=>{s(g=>{let v=g-1;return v<=0?(l(false),c.current?.(),0):v});},i&&!d?n:null);let u=useCallback(()=>{d||l(true);},[d]),p=useCallback(()=>{l(false);},[]),f=useCallback(g=>{s(g??e),l(false);},[e]);return {seconds:a,isRunning:i,isComplete:d,start:u,pause:p,reset:f}}function cE(e={}){let{interval:t=1e3,maxSeconds:n,autoStart:r=false}=e,[o,a]=useState(0),[s,i]=useState(r),l=s&&(n===void 0||o<n);mi(()=>{a(f=>f+1);},l?t:null);let c=useCallback(()=>i(true),[]),d=useCallback(()=>i(false),[]),u=useCallback(()=>i(f=>!f),[]),p=useCallback(()=>{a(0),i(false);},[]);return {seconds:o,isRunning:s,start:c,stop:d,reset:p,toggle:u}}function yx(e,t){let n=useRef(e);n.current=e,useEffect(()=>{if(t===null)return;let r=setTimeout(()=>{n.current();},t);return ()=>{clearTimeout(r);}},[t]);}function dE(e,t){let[n,r]=useState(false),o=useRef(null),a=useRef(e);a.current=e;let s=useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null),r(false);},[]),i=useCallback(()=>{s(),r(true),o.current=setTimeout(()=>{a.current(),r(false);},t);},[t,s]),l=useCallback(()=>{i();},[i]);return useEffect(()=>()=>{o.current&&clearTimeout(o.current);},[]),{start:i,cancel:s,reset:l,isScheduled:n}}function uE(e,t){let[n,r]=useState(e);return useEffect(()=>{let o=setTimeout(()=>{r(e);},t);return ()=>{clearTimeout(o);}},[e,t]),n}function mE(e,t=true){let[n,r]=useState(false);return yx(()=>{r(true);},t?e:null),n}function pE(e,t=true){let[n,r]=useState(t),[o,a]=useState(0),[s,i]=useState(0),l=useRef(e);l.current=e;let c=useRef(null),d=useRef(0),u=useRef(0),p=useRef(0),f=useRef(0),g=useCallback(h=>{let x=d.current?h-d.current:0;d.current=h,f.current++,h-p.current>=1e3&&(a(f.current),f.current=0,p.current=h),u.current++,i(u.current),l.current(x,h),c.current=requestAnimationFrame(g);},[]),v=useCallback(()=>{c.current===null&&(d.current=0,p.current=performance.now(),f.current=0,c.current=requestAnimationFrame(g),r(true));},[g]),b=useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null,r(false));},[]);return useEffect(()=>(t&&v(),()=>{c.current!==null&&cancelAnimationFrame(c.current);}),[t,v]),{start:v,stop:b,isRunning:n,frameCount:s,fps:o}}function fE(e,t={}){let{duration:n=300,easing:r="easeOutCubic"}=t,[o,a]=useState(e),s=useRef(e),i=useRef(null),l=useRef(null),c={linear:d=>d,easeInCubic:d=>d*d*d,easeOutCubic:d=>1-Math.pow(1-d,3),easeInOutCubic:d=>d<.5?4*d*d*d:1-Math.pow(-2*d+2,3)/2};return useEffect(()=>{if(o===e)return;s.current=o,i.current=null;let d=u=>{i.current===null&&(i.current=u);let p=u-i.current,f=Math.min(p/n,1),g=c[r](f),v=s.current+(e-s.current)*g;a(v),f<1&&(l.current=requestAnimationFrame(d));};return l.current=requestAnimationFrame(d),()=>{l.current!==null&&cancelAnimationFrame(l.current);}},[e,n,r]),o}function gE(e,t={}){let{stiffness:n=100,damping:r=10,mass:o=1}=t,[a,s]=useState(e),i=useRef(0),l=useRef(null),c=useRef(null);return useEffect(()=>{if(Math.abs(a-e)<.01&&Math.abs(i.current)<.01){s(e);return}let d=u=>{c.current===null&&(c.current=u);let p=Math.min((u-c.current)/1e3,.064);c.current=u;let f=(e-a)*n,g=i.current*r,v=(f-g)/o;i.current+=v*p;let b=a+i.current*p;s(b),Math.abs(b-e)>.01||Math.abs(i.current)>.01?l.current=requestAnimationFrame(d):(s(e),i.current=0);};return c.current=null,l.current=requestAnimationFrame(d),()=>{l.current!==null&&cancelAnimationFrame(l.current);}},[e,n,r,o,a]),a}var Mx=["mousemove","mousedown","resize","keydown","touchstart","wheel","scroll"];function bE(e,t={}){let{events:n=Mx,initialState:r=false,enabled:o=true}=t,[a,s]=useState(r),i=useRef(null),l=useCallback(()=>{s(false),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{s(true);},e);},[e]);return useEffect(()=>{if(o)return l(),n.forEach(c=>{window.addEventListener(c,l);}),()=>{i.current&&clearTimeout(i.current),n.forEach(c=>{window.removeEventListener(c,l);});}},[o,n,l]),a}function vE(e,t,n,r={}){let{events:o=Mx,initialState:a=false,enabled:s=true}=r,[i,l]=useState(a),c=useRef(null),d=useRef(a),u=useCallback(()=>{d.current&&(d.current=false,n?.()),l(false),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{d.current=true,l(true),t?.();},e);},[e,t,n]);return useEffect(()=>{if(s)return u(),o.forEach(p=>{window.addEventListener(p,u);}),()=>{c.current&&clearTimeout(c.current),o.forEach(p=>{window.removeEventListener(p,u);});}},[s,o,u]),i}function Nx(){let[e,t]=useState(()=>typeof document>"u"?"visible":document.visibilityState);return useEffect(()=>{let n=()=>{t(document.visibilityState);};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n);}},[]),e}function yE(){return Nx()==="visible"}function RE(e,t){let n=useCallback(()=>{document.visibilityState==="visible"?e?.():t?.();},[e,t]);useEffect(()=>(document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n);}),[n]);}function wE(){let[e,t]=useState(()=>typeof navigator>"u"?true:navigator.onLine);return useEffect(()=>{let n=()=>t(true),r=()=>t(false);return window.addEventListener("online",n),window.addEventListener("offline",r),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r);}},[]),e}function CE(e,t){let[n,r]=useState(()=>typeof navigator>"u"?true:navigator.onLine),o=useCallback(()=>{r(true),e?.();},[e]),a=useCallback(()=>{r(false),t?.();},[t]);return useEffect(()=>(window.addEventListener("online",o),window.addEventListener("offline",a),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",a);}),[o,a]),n}function Px(e){let[t,n]=useState(false),r=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),o=useCallback(async()=>{let i=e?.current||document.documentElement;try{i.requestFullscreen?await i.requestFullscreen():i.webkitRequestFullscreen?await i.webkitRequestFullscreen():i.mozRequestFullScreen?await i.mozRequestFullScreen():i.msRequestFullscreen&&await i.msRequestFullscreen();}catch(l){console.error("Failed to enter fullscreen:",l);}},[e]),a=useCallback(async()=>{try{document.exitFullscreen?await document.exitFullscreen():document.webkitExitFullscreen?await document.webkitExitFullscreen():document.mozCancelFullScreen?await document.mozCancelFullScreen():document.msExitFullscreen&&await document.msExitFullscreen();}catch(i){console.error("Failed to exit fullscreen:",i);}},[]),s=useCallback(async()=>{t?await a():await o();},[t,o,a]);return useEffect(()=>{let i=()=>{n(!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement));};return document.addEventListener("fullscreenchange",i),document.addEventListener("webkitfullscreenchange",i),document.addEventListener("mozfullscreenchange",i),document.addEventListener("MSFullscreenChange",i),()=>{document.removeEventListener("fullscreenchange",i),document.removeEventListener("webkitfullscreenchange",i),document.removeEventListener("mozfullscreenchange",i),document.removeEventListener("MSFullscreenChange",i);}},[]),{isFullscreen:t,enter:o,exit:a,toggle:s,isSupported:r}}function kE(){let e=useRef(null),t=Px(e);return {ref:e,...t}}function PE(e={}){let{watch:t=false,immediate:n=true,enableHighAccuracy:r=true,maximumAge:o=0,timeout:a=1e4}=e,[s,i]=useState({isLoading:false,position:null,error:null,latitude:null,longitude:null,accuracy:null,altitude:null,altitudeAccuracy:null,heading:null,speed:null,timestamp:null}),l=typeof navigator<"u"&&"geolocation"in navigator,c=useCallback(p=>{i({isLoading:false,position:p,error:null,latitude:p.coords.latitude,longitude:p.coords.longitude,accuracy:p.coords.accuracy,altitude:p.coords.altitude,altitudeAccuracy:p.coords.altitudeAccuracy,heading:p.coords.heading,speed:p.coords.speed,timestamp:p.timestamp});},[]),d=useCallback(p=>{i(f=>({...f,isLoading:false,error:p}));},[]),u=useCallback(()=>{l&&(i(p=>({...p,isLoading:true,error:null})),navigator.geolocation.getCurrentPosition(c,d,{enableHighAccuracy:r,maximumAge:o,timeout:a}));},[l,c,d,r,o,a]);return useEffect(()=>{if(l&&(n&&u(),t)){let p=navigator.geolocation.watchPosition(c,d,{enableHighAccuracy:r,maximumAge:o,timeout:a});return ()=>{navigator.geolocation.clearWatch(p);}}},[t,n,l,u,c,d,r,o,a]),{...s,getCurrentPosition:u,isSupported:l}}function LE(e,t,n,r){if(e===null||t===null||n===null||r===null)return null;let o=6371e3,a=e*Math.PI/180,s=n*Math.PI/180,i=(n-e)*Math.PI/180,l=(r-t)*Math.PI/180,c=Math.sin(i/2)*Math.sin(i/2)+Math.cos(a)*Math.cos(s)*Math.sin(l/2)*Math.sin(l/2),d=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return o*d}function DE(e){let[t,n]=useState(null),[r,o]=useState(true),a=typeof navigator<"u"&&"permissions"in navigator,s=useCallback(async()=>{if(!a)return o(false),null;try{o(!0);let i=await navigator.permissions.query({name:e});return n(i.state),o(!1),i.state}catch(i){return console.error(`Permission query failed for ${e}:`,i),o(false),null}},[e,a]);return useEffect(()=>{if(!a){o(false);return}let i=null,l=()=>{i&&n(i.state);};return navigator.permissions.query({name:e}).then(c=>{i=c,n(c.state),o(false),c.addEventListener("change",l);}).catch(()=>{o(false);}),()=>{i&&i.removeEventListener("change",l);}},[e,a]),{state:t,isGranted:t==="granted",isDenied:t==="denied",isPrompt:t==="prompt",isLoading:r,isSupported:a,query:s}}function HE(){let[e,t]=useState(typeof Notification<"u"?Notification.permission:"default"),n=typeof Notification<"u",r=useCallback(async()=>{if(!n)return "default";let o=await Notification.requestPermission();return t(o),o},[n]);return useEffect(()=>{n&&t(Notification.permission);},[n]),{permission:e,request:r,isSupported:n}}function IE(e){let[t,n]=useState(null),[r,o]=useState(null),[a,s]=useState(false),i=typeof navigator<"u"&&"mediaDevices"in navigator,l=useCallback(async()=>{if(!i)return null;s(true),o(null);try{let d=await navigator.mediaDevices.getUserMedia(e);return n(d),s(!1),d}catch(d){let u=d instanceof Error?d:new Error(String(d));return o(u),s(false),null}},[e,i]),c=useCallback(()=>{t&&(t.getTracks().forEach(d=>d.stop()),n(null));},[t]);return useEffect(()=>()=>{t&&t.getTracks().forEach(d=>d.stop());},[t]),{stream:t,error:r,isLoading:a,request:l,stop:c,isSupported:i}}function AE(e={}){let{voice:t=null,rate:n=1,pitch:r=1,volume:o=1,lang:a="en-US"}=e,[s,i]=useState(false),[l,c]=useState(false),[d,u]=useState([]),p=typeof window<"u"&&"speechSynthesis"in window;useEffect(()=>{if(!p)return;let h=()=>{u(window.speechSynthesis.getVoices());};return h(),window.speechSynthesis.addEventListener("voiceschanged",h),()=>{window.speechSynthesis.removeEventListener("voiceschanged",h);}},[p]);let f=useCallback(h=>{if(!p)return;window.speechSynthesis.cancel();let x=new SpeechSynthesisUtterance(h);x.voice=t,x.rate=n,x.pitch=r,x.volume=o,x.lang=a,x.onstart=()=>i(true),x.onend=()=>{i(false),c(false);},x.onerror=()=>{i(false),c(false);},window.speechSynthesis.speak(x);},[p,t,n,r,o,a]),g=useCallback(()=>{p&&(window.speechSynthesis.cancel(),i(false),c(false));},[p]),v=useCallback(()=>{p&&(window.speechSynthesis.pause(),c(true));},[p]),b=useCallback(()=>{p&&(window.speechSynthesis.resume(),c(false));},[p]);return {speak:f,stop:g,pause:v,resume:b,isSpeaking:s,isPaused:l,isSupported:p,voices:d}}function zE(e={}){let{lang:t="en-US",continuous:n=false,interimResults:r=true}=e,[o,a]=useState(false),[s,i]=useState(""),[l,c]=useState(""),[d,u]=useState(null),p=useRef(null),f=typeof window<"u"?window.SpeechRecognition||window.webkitSpeechRecognition:null,g=f!==null;useEffect(()=>{if(!g||!f)return;let R=new f;return R.lang=t,R.continuous=n,R.interimResults=r,R.onstart=()=>{a(true),u(null);},R.onend=()=>{a(false);},R.onerror=N=>{u(new Error(N.error)),a(false);},R.onresult=N=>{let w="",y="";for(let C=N.resultIndex;C<N.results.length;C++){let E=N.results[C];E.isFinal?y+=E[0].transcript:w+=E[0].transcript;}y&&i(C=>C+y),c(w);},p.current=R,()=>{R.abort();}},[g,f,t,n,r]);let v=useCallback(()=>{if(p.current&&!o)try{p.current.start();}catch{}},[o]),b=useCallback(()=>{p.current&&p.current.stop();},[]),h=useCallback(()=>{p.current&&p.current.abort();},[]),x=useCallback(()=>{i(""),c(""),u(null);},[]);return {start:v,stop:b,abort:h,isListening:o,transcript:s,interimTranscript:l,isSupported:g,error:d,reset:x}}var Dx=[{label:"At least 8 characters",test:e=>e.length>=8},{label:"Contains uppercase",test:e=>/[A-Z]/.test(e)},{label:"Contains lowercase",test:e=>/[a-z]/.test(e)},{label:"Contains number",test:e=>/[0-9]/.test(e)},{label:"Contains special character",test:e=>/[!@#$%^&*(),.?":{}|<>]/.test(e)}];function OE(e,t=Dx){return e?t.filter(r=>r.test(e)).length/t.length:0}function FE(e){return e<.4?"bg-red-500":e<.7?"bg-yellow-500":"bg-green-500"}function BE(e){return e<.4?"Weak":e<.7?"Medium":"Strong"}function yn(e){let t=e.replace(/^#/,""),n=t.length===3?t.split("").map(o=>o+o).join(""):t;if(n.length!==6)return null;let r=parseInt(n,16);return isNaN(r)?null:{r:r>>16&255,g:r>>8&255,b:r&255}}function $E(e){let t=e.replace(/^#/,"");if(t.length===8){let r=yn(t.slice(0,6));if(!r)return null;let o=parseInt(t.slice(6,8),16)/255;return {...r,a:Math.round(o*100)/100}}let n=yn(e);return n?{...n,a:1}:null}function Ea(e,t,n){let r=o=>{let a=Math.max(0,Math.min(255,Math.round(o))).toString(16);return a.length===1?"0"+a:a};return `#${r(e)}${r(t)}${r(n)}`}function KE(e,t,n,r){let o=Ea(e,t,n),a=Math.round(r*255).toString(16).padStart(2,"0");return `${o}${a}`}function Hx(e,t,n){e/=255,t/=255,n/=255;let r=Math.max(e,t,n),o=Math.min(e,t,n),a=0,s=0,i=(r+o)/2;if(r!==o){let l=r-o;switch(s=i>.5?l/(2-r-o):l/(r+o),r){case e:a=((t-n)/l+(t<n?6:0))/6;break;case t:a=((n-e)/l+2)/6;break;case n:a=((e-t)/l+4)/6;break}}return {h:Math.round(a*360),s:Math.round(s*100),l:Math.round(i*100)}}function Kc(e,t,n){e/=360,t/=100,n/=100;let r,o,a;if(t===0)r=o=a=n;else {let s=(c,d,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?c+(d-c)*6*u:u<.5?d:u<.6666666666666666?c+(d-c)*(.6666666666666666-u)*6:c),i=n<.5?n*(1+t):n+t-n*t,l=2*n-i;r=s(l,i,e+1/3),o=s(l,i,e),a=s(l,i,e-1/3);}return {r:Math.round(r*255),g:Math.round(o*255),b:Math.round(a*255)}}function Qr(e){let t=yn(e);return t?Hx(t.r,t.g,t.b):null}function $o(e,t,n){let r=Kc(e,t,n);return Ea(r.r,r.g,r.b)}function $c(e,t,n){let[r,o,a]=[e,t,n].map(s=>(s/=255,s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4)));return .2126*r+.7152*o+.0722*a}function Gc(e,t){let n=yn(e),r=yn(t);if(!n||!r)return 1;let o=$c(n.r,n.g,n.b),a=$c(r.r,r.g,r.b),s=Math.max(o,a),i=Math.min(o,a);return Math.round((s+.05)/(i+.05)*100)/100}function GE(e,t,n=false){let r=Gc(e,t);return n?r>=3:r>=4.5}function UE(e,t,n=false){let r=Gc(e,t);return n?r>=4.5:r>=7}function Uc(e){let t=Qr(e);return t?t.l>50:false}function _E(e){return !Uc(e)}function jE(e){return Uc(e)?"#000000":"#ffffff"}function WE(e,t){let n=Qr(e);if(!n)return e;let r=Math.min(100,n.l+t);return $o(n.h,n.s,r)}function YE(e,t){let n=Qr(e);if(!n)return e;let r=Math.max(0,n.l-t);return $o(n.h,n.s,r)}function qE(e,t){let n=Qr(e);if(!n)return e;let r=Math.min(100,n.s+t);return $o(n.h,r,n.l)}function XE(e,t){let n=Qr(e);if(!n)return e;let r=Math.max(0,n.s-t);return $o(n.h,r,n.l)}function ZE(e,t){let n=yn(e);return n?`rgba(${n.r}, ${n.g}, ${n.b}, ${t})`:e}function JE(e,t,n=.5){let r=yn(e),o=yn(t);if(!r||!o)return e;let a=Math.round(r.r*n+o.r*(1-n)),s=Math.round(r.g*n+o.g*(1-n)),i=Math.round(r.b*n+o.b*(1-n));return Ea(a,s,i)}function QE(e){let t=Qr(e);if(!t)return e;let n=(t.h+180)%360;return $o(n,t.s,t.l)}function eP(e){let t=yn(e);return t?Ea(255-t.r,255-t.g,255-t.b):e}function tP(e){if(e.startsWith("#"))return yn(e);let t=e.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*[\d.]+)?\s*\)/i);if(t)return {r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)};let n=e.match(/hsla?\s*\(\s*(\d+)\s*,\s*(\d+)%?\s*,\s*(\d+)%?\s*(?:,\s*[\d.]+)?\s*\)/i);return n?Kc(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10)):null}function ye(e){return e instanceof Date?e:typeof e=="number"?new Date(e):new Date(e)}function Ix(e){let t=ye(e);return !isNaN(t.getTime())}var nP=["January","February","March","April","May","June","July","August","September","October","November","December"],rP=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],oP=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],aP=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function _c(e,t="yyyy-MM-dd"){let n=ye(e);if(!Ix(n))return "Invalid Date";let r=n.getFullYear(),o=n.getMonth(),a=n.getDate(),s=n.getDay(),i=n.getHours(),l=n.getMinutes(),c=n.getSeconds(),d=v=>v.toString().padStart(2,"0"),u=i%12||12,p={yyyy:r.toString(),yy:r.toString().slice(-2),MMMM:nP[o],MMM:rP[o],MM:d(o+1),M:(o+1).toString(),dd:d(a),d:a.toString(),EEEE:oP[s],EEE:aP[s],HH:d(i),H:i.toString(),hh:d(u),h:u.toString(),mm:d(l),m:l.toString(),ss:d(c),s:c.toString(),a:i<12?"AM":"PM"},f=Object.keys(p).sort((v,b)=>b.length-v.length),g=t;for(let v of f)g=g.replace(new RegExp(v,"g"),p[v]);return g}function sP(e){return _c(e,"yyyy-MM-dd")}function iP(e){return ye(e).toISOString()}function lP(e,t=false){return _c(e,t?"HH:mm":"h:mm a")}var cP=[["year",31536e6],["month",2592e6],["week",6048e5],["day",864e5],["hour",36e5],["minute",6e4],["second",1e3]];function Vx(e,t={}){let{locale:n="en",addSuffix:r=true,style:o="long"}=t,a=ye(e),s=new Date,i=a.getTime()-s.getTime(),l=Math.abs(i);for(let[c,d]of cP)if(l>=d||c==="second"){let u=Math.round(i/d);try{return new Intl.RelativeTimeFormat(n,{style:o}).format(u,c)}catch{let p=Math.abs(u),f=p===1?c:`${c}s`;return r?u<0?`${p} ${f} ago`:`in ${p} ${f}`:`${p} ${f}`}}return "just now"}function dP(e,t=new Date){let n=ye(e),o=ye(t).getTime()-n.getTime();if(o<0)return Vx(e);let a=Math.floor(o/1e3),s=Math.floor(a/60),i=Math.floor(s/60),l=Math.floor(i/24),c=Math.floor(l/7),d=Math.floor(l/30),u=Math.floor(l/365);return a<60?"just now":s<60?`${s}m ago`:i<24?`${i}h ago`:l<7?`${l}d ago`:c<4?`${c}w ago`:d<12?`${d}mo ago`:`${u}y ago`}function uP(e){let t=ye(e),n=new Date;return t.getDate()===n.getDate()&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()}function mP(e){let t=ye(e),n=new Date;return n.setDate(n.getDate()-1),t.getDate()===n.getDate()&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()}function pP(e){let t=ye(e),n=new Date;return n.setDate(n.getDate()+1),t.getDate()===n.getDate()&&t.getMonth()===n.getMonth()&&t.getFullYear()===n.getFullYear()}function fP(e){return ye(e).getTime()<Date.now()}function gP(e){return ye(e).getTime()>Date.now()}function bP(e,t){let n=ye(e),r=ye(t);return n.getDate()===r.getDate()&&n.getMonth()===r.getMonth()&&n.getFullYear()===r.getFullYear()}function vP(e,t){let n=ye(e),r=ye(t);return n.getMonth()===r.getMonth()&&n.getFullYear()===r.getFullYear()}function hP(e,t){return ye(e).getFullYear()===ye(t).getFullYear()}function xP(e,t){let n=new Date(ye(e));return n.setDate(n.getDate()+t),n}function yP(e,t){let n=new Date(ye(e));return n.setMonth(n.getMonth()+t),n}function RP(e,t){let n=new Date(ye(e));return n.setFullYear(n.getFullYear()+t),n}function wP(e,t){let n=new Date(ye(e));return n.setTime(n.getTime()+t*36e5),n}function CP(e,t){let n=new Date(ye(e));return n.setTime(n.getTime()+t*6e4),n}function MP(e){let t=new Date(ye(e));return t.setHours(0,0,0,0),t}function TP(e){let t=new Date(ye(e));return t.setHours(23,59,59,999),t}function NP(e){let t=new Date(ye(e));return t.setDate(1),t.setHours(0,0,0,0),t}function kP(e){let t=new Date(ye(e));return t.setMonth(t.getMonth()+1,0),t.setHours(23,59,59,999),t}function SP(e,t){let n=ye(e),r=ye(t),o=n.getTime()-r.getTime();return Math.floor(o/864e5)}function EP(e,t){let n=ye(e),r=ye(t),o=n.getTime()-r.getTime();return Math.floor(o/36e5)}function PP(e,t){let n=ye(e),r=ye(t),o=n.getTime()-r.getTime();return Math.floor(o/6e4)}function LP(e,t={}){let{locale:n="en-US",minimumFractionDigits:r,maximumFractionDigits:o,useGrouping:a=true}=t;try{return new Intl.NumberFormat(n,{minimumFractionDigits:r,maximumFractionDigits:o,useGrouping:a}).format(e)}catch{return e.toString()}}function DP(e,t="USD",n={}){let{locale:r="en-US",display:o="symbol",minimumFractionDigits:a=2,maximumFractionDigits:s=2}=n;try{return new Intl.NumberFormat(r,{style:"currency",currency:t,currencyDisplay:o,minimumFractionDigits:a,maximumFractionDigits:s}).format(e)}catch{return `${t} ${e.toFixed(2)}`}}function HP(e,t={}){let{locale:n="en-US",minimumFractionDigits:r=0,maximumFractionDigits:o=1,signDisplay:a="auto"}=t,s=Math.abs(e)>1?e/100:e;try{return new Intl.NumberFormat(n,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:o,signDisplay:a}).format(s)}catch{return `${(s*100).toFixed(o)}%`}}function IP(e,t={}){let{decimals:n=2,binary:r=true}=t;if(e===0)return "0 Bytes";let o=r?1024:1e3,a=r?["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]:["Bytes","kB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.floor(Math.log(e)/Math.log(o));return `${(e/Math.pow(o,s)).toFixed(n)} ${a[s]}`}function VP(e,t={}){let{locale:n="en-US",maximumFractionDigits:r=1}=t;try{return new Intl.NumberFormat(n,{notation:"compact",maximumFractionDigits:r}).format(e)}catch{let o=["","K","M","B","T"],a=Math.floor(Math.log10(Math.abs(e))/3);if(a===0)return e.toString();let s=o[a]||"",i=Math.pow(10,a*3);return (e/i).toFixed(r).replace(/\.0$/,"")+s}}function AP(e){let t=["th","st","nd","rd"],n=e%100;return n>=11&&n<=13?`${e}th`:`${e}${t[n%10]||"th"}`}function zP(e,t="(###) ###-####"){let n=e.replace(/\D/g,""),r=t,o=0;for(let a=0;a<r.length&&o<n.length;a++)r[a]==="#"&&(r=r.substring(0,a)+n[o]+r.substring(a+1),o++);return r.replace(/#/g,"").trim()}function OP(e){return e.replace(/\D/g,"").slice(0,16).replace(/(.{4})/g,"$1 ").trim()}function FP(e,t,n="..."){return e.length<=t?e:e.slice(0,t-n.length)+n}function BP(e,t,n="..."){if(e.length<=t)return e;let r=t-n.length,o=Math.ceil(r/2),a=Math.floor(r/2);return e.slice(0,o)+n+e.slice(-a)}function $P(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Ax(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}function KP(e){let t=Ax(e);return t.charAt(0).toUpperCase()+t.slice(1)}function GP(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function UP(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase()}function _P(e){return e.toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function jP(e){let t=e.toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function WP(e){return e.charAt(0).toUpperCase()+e.slice(1)}function YP(e,t=2){return e.split(" ").filter(Boolean).map(n=>n[0]).slice(0,t).join("").toUpperCase()}function qP(e,t,n){return e===1?t:n||`${t}s`}function XP(e,t="and"){if(e.length===0)return "";if(e.length===1)return e[0];if(e.length===2)return `${e[0]} ${t} ${e[1]}`;let n=e[e.length-1];return `${e.slice(0,-1).join(", ")}, ${t} ${n}`}function ZP(e,t=0,n=0,r="*"){if(e.length<=t+n)return e;let o=e.slice(0,t),a=e.slice(-n||void 0),s=e.length-t-n;return `${o}${r.repeat(s)}${n>0?a:""}`}function JP(e){let[t,n]=e.split("@");return !t||!n?e:`${t.length<=2?t:t[0]+"*".repeat(t.length-2)+t[t.length-1]}@${n}`}function QP(e,t=4){let n=e.replace(/\D/g,"");return n.length<=t?e:"*".repeat(n.length-t)+n.slice(-t)}function eL(e){return `**** **** **** ${e.replace(/\D/g,"").slice(-4)}`}export{hu as Accordion,xu as AccordionItem,sv as ActionBar,iv as ActionBarButton,ov as ActionGroup,Fv as ActionSheet,jx as Alert,Yx as AlertDescription,Wx as AlertTitle,Ib as AreaChart,ju as AspectRatio,Bh as AudioPlayer,Kg as Autocomplete,Dr as Avatar,Hr as AvatarFallback,Up as AvatarGroup,so as AvatarImage,cg as BackTop,Jx as Badge,Pv as Banner,Db as BarChart,kh as Blockquote,Av as BottomNavigation,eh as Bounce,zu as Breadcrumb,Gu as BreadcrumbEllipsis,Fu as BreadcrumbItem,Bu as BreadcrumbLink,Ou as BreadcrumbList,$u as BreadcrumbPage,Ku as BreadcrumbSeparator,me as Button,Qc as ButtonGroup,ed as ButtonGroupSeparator,Xf as COUNTRIES,lo as Calendar,ad as Card,cd as CardContent,ld as CardDescription,dd as CardFooter,sd as CardHeader,id as CardTitle,$b as Carousel,Kb as CarouselContent,Gb as CarouselItem,Il as CarouselNext,Hl as CarouselPrevious,Ko as Checkbox,hh as Checkmark,qp as Chip,tf as CircularProgress,Ct as CloseButton,ib as Code,mb as CodeBlock,qv as Collapse,Tu as Collapsible,Nu as CollapsibleContent,Oi as CollapsibleTrigger,xv as ColorArea,Bf as ColorPicker,wv as ColorSlider,sa as ColorSwatch,Of as ColorSwatchPicker,Mv as ColorWheel,Qi as Command,iR as CommandDialog,Ip as CommandEmpty,Vp as CommandGroup,Dp as CommandInput,zp as CommandItem,Hp as CommandList,Ap as CommandSeparator,Op as CommandShortcut,xh as Confetti,_d as ContextMenu,eu as ContextMenuCheckboxItem,Xd as ContextMenuContent,Wd as ContextMenuGroup,Qd as ContextMenuItem,Yd as ContextMenuPortal,tu as ContextMenuSection,nu as ContextMenuSeparator,ru as ContextMenuShortcut,qd as ContextMenuSub,Jd as ContextMenuSubContent,Zd as ContextMenuSubTrigger,jd as ContextMenuTrigger,mv as ContextualHelp,kb as CopyButton,ah as Counter,_f as CurrencyInput,ga as DEFAULT_COLORS,K0 as DataTable,tv as DatePicker,hb as DateRangePicker,Gi as Drawer,bm as DrawerBody,ym as DrawerClose,fm as DrawerContent,xm as DrawerDescription,vm as DrawerFooter,km as DrawerGroup,Sm as DrawerGroupLabel,gm as DrawerHeader,Em as DrawerInset,Cm as DrawerMenu,Nm as DrawerMenuButton,Mm as DrawerMenuItem,M0 as DrawerProvider,wm as DrawerSeparator,mm as DrawerSidebar,hm as DrawerTitle,Rm as DrawerToggle,pm as DrawerTrigger,Zt as Dropdown,Qt as DropdownContent,Dd as DropdownGroup,Et as DropdownItem,zy as DropdownLabel,Mi as DropdownSection,Pd as DropdownSeparator,Ld as DropdownShortcut,Hd as DropdownSub,Vd as DropdownSubContent,Id as DropdownSubTrigger,Jt as DropdownTrigger,Al as EMOJIS,Ks as EMOJI_CATEGORIES,_b as EmojiPicker,ff as EmptyState,Xv as Expand,fN as FAB,jv as Fade,bl as FieldContext,If as FileUpload,Jv as Flip,Jl as FloatingActionButton,Gg as Form,mn as FormContext,Wg as FormControl,Yg as FormDescription,Ug as FormField,_g as FormItem,jg as FormLabel,qg as FormMessage,Pb as FullCalendar,yh as Glow,vv as GridList,wh as H1,Ch as H2,Mh as H3,Th as H4,Vh as HeatmapCalendar,Hu as HoverCard,Vu as HoverCardContent,Iu as HoverCardTrigger,bb as Image,_N as ImageComparison,Yb as ImageCropper,Nl as ImageViewer,Cb as ImageViewerTrigger,Rb as InfiniteScroll,Sh as InlineCode,er as Input,of as InputOTP,af as InputOTPGroup,lf as InputOTPSeparator,sf as InputOTPSlot,Ob as KanbanBoard,Tb as Kbd,Pr as Label,Ph as Large,Eh as Lead,Lb as LineChart,ig as Link,lw as List,Rf as ListItem,wf as ListItemText,il as MASK_PRESETS,Yf as MaskedInput,fg as Menubar,Tg as MenubarCheckboxItem,Cg as MenubarContent,bg as MenubarGroup,Mg as MenubarItem,oC as MenubarLabel,gg as MenubarMenu,vg as MenubarPortal,xg as MenubarRadioGroup,Ng as MenubarRadioItem,ul as MenubarSection,kg as MenubarSeparator,Sg as MenubarShortcut,hg as MenubarSub,wg as MenubarSubContent,Rg as MenubarSubTrigger,yg as MenubarTrigger,Mp as Modal,Sp as ModalBody,Np as ModalClose,cs as ModalContent,Lp as ModalDescription,Ep as ModalFooter,kp as ModalHeader,Ji as ModalOverlay,Zi as ModalPortal,ls as ModalRoot,Pp as ModalTitle,Tp as ModalTrigger,Dh as Muted,eg as Navbar,tg as NavbarBrand,ng as NavbarContent,rg as NavbarItem,og as NavbarLink,Ju as NavigationMenu,rm as NavigationMenuContent,sm as NavigationMenuIndicator,em as NavigationMenuItem,am as NavigationMenuLink,Qu as NavigationMenuList,nm as NavigationMenuTrigger,$i as NavigationMenuViewport,Qg as NumberField,Jo as NumberInput,$h as PDFViewer,mp as Pagination,pp as PaginationContent,vp as PaginationEllipsis,fp as PaginationItem,rs as PaginationLink,bp as PaginationNext,gp as PaginationPrevious,Nh as Paragraph,fh as Parallax,Bp as PasswordInput,Zf as PhoneInput,Hb as PieChart,oh as Pop,Pt as Popover,nr as PopoverAnchor,Lt as PopoverContent,tr as PopoverTrigger,Ja as Progress,_v as PullToRefresh,nh as Pulse,qb as QRCode,Pi as Radio,Vi as RadioContent,Li as RadioControl,Ii as RadioDescription,lu as RadioGroup,cu as RadioGroupItem,Di as RadioIndicator,Hi as RadioLabel,cv as RangeSlider,jp as Rating,Bl as ReeverUIContext,Jb as ReeverUIProvider,DR as ResizableHandle,LR as ResizablePanel,PR as ResizablePanelGroup,Qv as Ripple,Zv as Rotate,Yv as Scale,ze as ScrollArea,ph as ScrollProgress,mh as ScrollReveal,Ir as Select,tb as SelectField,by as Separator,th as Shake,vh as Shimmer,Hm as Sidebar,Vm as SidebarContent,Am as SidebarFooter,zm as SidebarGroup,Fm as SidebarGroupAction,Bm as SidebarGroupContent,Om as SidebarGroupLabel,Im as SidebarHeader,ep as SidebarInset,$m as SidebarMenu,_m as SidebarMenuAction,jm as SidebarMenuBadge,Um as SidebarMenuButton,Km as SidebarMenuItem,Xm as SidebarMenuSkeleton,Wm as SidebarMenuSub,qm as SidebarMenuSubButton,Ym as SidebarMenuSubItem,Dm as SidebarProvider,Jm as SidebarRail,Qm as SidebarSeparator,Zm as SidebarTrigger,$a as Skeleton,Wv as Slide,en as Slider,Lh as Small,gb as Snippet,Rh as Sparkles,Ha as Spinner,Sv as SpotlightSearch,vf as StatCard,Dg as Step,Pg as Steps,Kv as SwipeActions,fd as Switch,pb as TabbedCodeBlock,tp as Table,rp as TableBody,lp as TableCaption,ip as TableCell,op as TableFooter,sp as TableHead,np as TableHeader,ap as TableRow,Bd as Tabs,Gd as TabsContent,$d as TabsList,Kd as TabsTrigger,mf as TagInput,ey as TextBadge,Xg as TextField,ih as TextReveal,Ba as Textarea,Zg as TextareaField,Gs as ThemeProvider,Xb as ThemeToggle,Kf as TimeInput,xb as TimePicker,Nf as Timeline,Ef as TimelineContent,Sf as TimelineItem,Pf as TimelineOpposite,$y as Toaster,du as Toggle,mu as ToggleGroup,pu as ToggleGroupItem,Rn as Tooltip,Fg as Tree,sh as Typewriter,Hh as UL,ob as User,Oh as VideoPlayer,rh as Wiggle,lh as WordRotate,av as actionBarVariants,rv as actionGroupVariants,Ov as actionSheetItemVariants,xP as addDays,wP as addHours,CP as addMinutes,yP as addMonths,RP as addYears,Ux as alertVariants,ZE as alpha,vs as applyMask,$g as autocompleteInputVariants,Gp as avatarGroupVariants,lg as backTopVariants,qx as badgeIndicatorVariants,Ev as bannerVariants,Vv as bottomNavigationVariants,ro as buttonVariants,OE as calculatePasswordStrength,Ax as camelCase,WP as capitalize,od as cardVariants,Fb as carouselVariants,fa as chartContainerVariants,Yp as chipVariants,ef as circularProgressVariants,dm as closeButtonVariants,m as cn,sb as codeVariants,hv as colorAreaVariants,Rv as colorSliderVariants,zf as colorSwatchPickerVariants,Af as colorSwatchVariants,Cv as colorWheelVariants,QE as complement,Wl as contextualHelpTriggerVariants,Nb as copyButtonVariants,Uf as currencyInputVariants,YE as darken,ev as datePickerVariants,Dx as defaultPasswordRequirements,XE as desaturate,SP as differenceInDays,EP as differenceInHours,PP as differenceInMinutes,Tm as drawerMenuButtonVariants,Ub as emojiPickerVariants,TP as endOfDay,kP as endOfMonth,ha as fabVariants,Lf as fileUploadVariants,IP as formatBytes,VP as formatCompact,OP as formatCreditCard,DP as formatCurrency,_c as formatDate,gs as formatFileSize,sP as formatISO,iP as formatISODateTime,XP as formatList,LP as formatNumber,AP as formatOrdinal,HP as formatPercent,zP as formatPhone,hs as formatPhoneNumber,Vx as formatRelative,lP as formatTime,Eb as fullCalendarVariants,Gc as getContrastRatio,Df as getFileIcon,YP as getInitials,$c as getLuminance,Wf as getMaskPlaceholder,FE as getPasswordStrengthColor,BE as getPasswordStrengthLabel,jE as getTextColor,bv as gridListItemVariants,gv as gridListVariants,Qr as hexToHsl,yn as hexToRgb,$E as hexToRgba,$o as hslToHex,Kc as hslToRgb,Wb as imageCropperVariants,Rl as imageVariants,Tl as infiniteScrollLoaderVariants,Ml as infiniteScrollVariants,rf as inputOTPVariants,eP as invert,_E as isDarkColor,gP as isFuture,Uc as isLightColor,fP as isPast,bP as isSameDay,vP as isSameMonth,hP as isSameYear,uP as isToday,pP as isTomorrow,Ix as isValidDate,mP as isYesterday,Mb as kbdVariants,GP as kebabCase,WE as lighten,yf as listItemVariants,ra as listVariants,ZP as mask,eL as maskCreditCard,JP as maskEmail,QP as maskPhone,jf as maskedInputVariants,GE as meetsContrastAA,UE as meetsContrastAAA,JE as mix,Xi as modalContentVariants,Qf as navbarVariants,om as navigationMenuLinkStyle,tm as navigationMenuTriggerStyle,tP as parseColor,ye as parseDate,KP as pascalCase,$w as phoneInputVariants,qP as pluralize,Uv as pullToRefreshVariants,Ol as qrCodeVariants,lv as rangeSliderVariants,_p as ratingVariants,Ea as rgbToHex,Hx as rgbToHsl,KE as rgbaToHex,qE as saturate,Nd as selectVariants,jP as sentenceCase,Gm as sidebarMenuButtonVariants,bd as skeletonVariants,$P as slugify,UP as snakeCase,fb as snippetVariants,Da as spinnerVariants,MP as startOfDay,NP as startOfMonth,bf as statCardVariants,Lg as stepVariants,Eg as stepsVariants,ec as swipeActionVariants,$v as swipeActionsVariants,Aa as switchColors,uf as tagVariants,Qx as textBadgeVariants,bT as themeToggleVariants,dP as timeAgo,$f as timeInputVariants,kf as timelineItemVariants,Tf as timelineVariants,_P as titleCase,qa as toggleVariants,Vg as treeItemVariants,Ig as treeVariants,FP as truncate,BP as truncateMiddle,ll as unmask,fE as useAnimatedValue,fx as useAsync,nE as useAsyncRetry,TS as useBodyScrollLock,FS as useBooleanToggle,$k as useBreakpoint,Kk as useBreakpoints,vi as useButtonGroup,$s as useCarousel,oS as useClickOutside,aS as useClickOutsideMultiple,ON as useConfetti,iS as useCopy,sS as useCopyToClipboard,lE as useCountdown,$S as useCounter,OS as useCycle,Xk as useDebounce,Zk as useDebouncedCallback,Jk as useDebouncedCallbackWithControls,uE as useDelayedValue,ox as useDisclosure,AS as useDisclosureOpen,LE as useDistance,yE as useDocumentIsVisible,Nx as useDocumentVisibility,RE as useDocumentVisibilityCallback,b0 as useDrawer,HS as useElementSize,uS as useEventListener,mS as useEventListenerRef,oE as useFetch,Ms as useFieldContext,nR as useFocusTrap,as as useFocusTrapRef,vl as useFormContext,Px as useFullscreen,kE as useFullscreenRef,PE as useGeolocation,lS as useHotkeys,cS as useHotkeysMap,gS as useHover,hS as useHoverDelay,vS as useHoverProps,bS as useHoverRef,bE as useIdle,vE as useIdleCallback,KS as useIncrementCounter,ex as useIntersectionObserver,kS as useIntersectionObserverRef,mi as useInterval,iE as useIntervalControls,Dk as useIsDesktop,Pk as useIsMobile,Lk as useIsTablet,pS as useKeyPress,dS as useKeyPressed,dM as useKeyboardShortcut,SS as useLazyLoad,YS as useList,_k as useLocalStorage,fS as useLongPress,qS as useMap,IE as useMediaPermission,zo as useMediaQuery,yS as useMouse,RS as useMouseElement,wS as useMouseElementRef,aE as useMutation,ES as useMutationObserver,PS as useMutationObserverRef,HE as useNotificationPermission,wE as useOnlineStatus,CE as useOnlineStatusCallback,DE as usePermission,Hk as usePrefersColorScheme,Ik as usePrefersReducedMotion,GS as usePrevious,_S as usePreviousDistinct,US as usePreviousWithInitial,QS as useQueue,pE as useRafLoop,XS as useRecord,hT as useReeverUI,LS as useResizeObserver,DS as useResizeObserverRef,Zh as useScrollLock,CS as useScrollPosition,JS as useSelection,Wk as useSessionStorage,dx as useSet,H0 as useSidebar,qo as useSidebarSafe,zE as useSpeechRecognition,AE as useSpeechSynthesis,rN as useSpotlight,gE as useSpringValue,eE as useStack,tS as useThrottle,nS as useThrottledCallback,yx as useTimeout,dE as useTimeoutControls,mE as useTimeoutFlag,cE as useTimer,zS as useToggle,Bk as useWindowHeight,MS as useWindowScroll,Ma as useWindowSize,Fk as useWindowWidth,rb as userVariants,Hf as validateFile,NC as validators};//# sourceMappingURL=index.js.map
|
|
73
73
|
//# sourceMappingURL=index.js.map
|