@moontra/moonui-pro 2.28.0 → 2.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { twMerge } from 'tailwind-merge';
4
4
  import * as React67 from 'react';
5
5
  import React67__default, { useState, useMemo, useCallback, useRef, useEffect, forwardRef, createContext, useContext, useLayoutEffect, useDebugValue, Component } from 'react';
6
6
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
7
- import { Loader2, Play, ExternalLink, ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Minus, Clock, ChevronUp, Search, Mic, MicOff, Settings, RefreshCw, Zap, ChevronRight, Crown, Circle, ChevronLeft, Plus, Lock, Sparkles, ZoomOut, ZoomIn, Pause, VolumeX, Volume2, Download, Maximize2, Filter, Image as Image$1, Video, RotateCw, Minimize2, BarChart3, Menu, Bell, CheckCheck, CheckCircle, Palette, User, Settings2, LogOut, Edit3, LayoutGrid, Upload, Share2, Save, Phone, Globe, Eye, CheckCircle2, RotateCcw, Copy, Share, Trash2, CreditCard, XCircle, HelpCircle, GripVertical, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, Code as Code$1, Type, Heading1, Heading2, Heading3, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, CheckSquare, Quote, Highlighter, Link2, Table as Table$1, Undo, Redo, Edit, Wand2, Maximize, FileText, Briefcase, MessageSquare, Heart, GraduationCap, Languages, Lightbulb, MoreVertical, TrendingUp, Activity, BellOff, Target, ArrowUpRight, ArrowDownRight, CalendarIcon, MapPin, Navigation, ArrowUp, ArrowDown, ArrowUpDown, Calendar as Calendar$1, DollarSign, Users, Map as Map$1, Music, Archive, File, FileSpreadsheet, FileJson, FileDown, ChevronsLeft, ChevronsRight, Star, Shield, Award, Gem, Flame, Repeat, Move, EyeOff, Timer, Square, Cpu, GitBranch, ArrowRight, Trash, MessageCircle, Paperclip, Printer, TrendingDown, Grip, Unlock, Github, Server, Monitor, MemoryStick, HardDrive, Network, Columns, PlusCircle, Pin, Sun, Moon, Home, Send, Tag, Flag, Trophy, GitFork, Package } from 'lucide-react';
7
+ import { Loader2, Play, ExternalLink, ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Minus, Clock, ChevronUp, Search, Mic, MicOff, Settings, RefreshCw, Zap, ChevronRight, Crown, Circle, ChevronLeft, Plus, Lock, Sparkles, ZoomOut, ZoomIn, Pause, VolumeX, Volume2, Download, Maximize2, Filter, Image as Image$1, Video, RotateCw, Minimize2, BarChart3, Menu, Bell, CheckCheck, CheckCircle, Palette, User, Settings2, LogOut, Edit3, LayoutGrid, Upload, Share2, Save, Phone, Globe, Eye, CheckCircle2, RotateCcw, Copy, Share, Trash2, CreditCard, XCircle, HelpCircle, GripVertical, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, Code as Code$1, Type, Heading1, Heading2, Heading3, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, CheckSquare, Quote, Highlighter, Link2, Table as Table$1, Undo, Redo, Edit, Wand2, Maximize, FileText, Briefcase, MessageSquare, Heart, GraduationCap, Languages, Lightbulb, MoreVertical, TrendingUp, Activity, BellOff, Target, ArrowUpRight, ArrowDownRight, CalendarIcon, MapPin, Navigation, ArrowUp, ArrowDown, ArrowUpDown, Calendar as Calendar$1, DollarSign, Users, Map as Map$1, Music, Archive, File, FileSpreadsheet, FileJson, FileDown, ChevronsLeft, ChevronsRight, Star, Shield, Award, Gem, Flame, TrendingDown, Repeat, Move, EyeOff, Timer, Square, Cpu, GitBranch, ArrowRight, Trash, MessageCircle, Paperclip, Printer, Grip, Unlock, Github, Server, Monitor, MemoryStick, HardDrive, Network, Columns, PlusCircle, Pin, Sun, Moon, Home, Send, Tag, Flag, Trophy, Wifi, WifiOff, Thermometer, GitFork, Package, PoundSterling, Euro, Database, ShoppingCart } from 'lucide-react';
8
8
  import { cva } from 'class-variance-authority';
9
9
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
10
10
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
@@ -78963,5 +78963,1949 @@ var MoonUIAsyncAvatarPro = React67.forwardRef(({ userId, fetchUser, ...props },
78963
78963
  );
78964
78964
  });
78965
78965
  MoonUIAsyncAvatarPro.displayName = "MoonUIAsyncAvatarPro";
78966
+ function WidgetBase({
78967
+ title,
78968
+ subtitle,
78969
+ children,
78970
+ variant = "default",
78971
+ colorScheme = "blue",
78972
+ className,
78973
+ headerAction,
78974
+ loading = false,
78975
+ error = null,
78976
+ animate: animate4 = true
78977
+ }) {
78978
+ const colorSchemeClasses = {
78979
+ blue: "from-blue-500/10 via-blue-400/5 to-transparent border-blue-200/20",
78980
+ green: "from-green-500/10 via-green-400/5 to-transparent border-green-200/20",
78981
+ purple: "from-purple-500/10 via-purple-400/5 to-transparent border-purple-200/20",
78982
+ orange: "from-orange-500/10 via-orange-400/5 to-transparent border-orange-200/20",
78983
+ pink: "from-pink-500/10 via-pink-400/5 to-transparent border-pink-200/20",
78984
+ cyan: "from-cyan-500/10 via-cyan-400/5 to-transparent border-cyan-200/20",
78985
+ neutral: "from-gray-500/10 via-gray-400/5 to-transparent border-gray-200/20"
78986
+ };
78987
+ const variantClasses = {
78988
+ default: "bg-card border shadow-sm",
78989
+ minimal: "border-0 shadow-none bg-card/50",
78990
+ glass: "bg-background/60 backdrop-blur-md border-white/10",
78991
+ bordered: "border-2 bg-card",
78992
+ gradient: `bg-gradient-to-br ${colorSchemeClasses[colorScheme]} shadow-sm`,
78993
+ colored: `bg-gradient-to-br ${colorSchemeClasses[colorScheme]} border-2 shadow-lg`
78994
+ };
78995
+ const content = /* @__PURE__ */ jsxs(MoonUICardPro, { className: cn(
78996
+ variantClasses[variant],
78997
+ "transition-all duration-200",
78998
+ className
78999
+ ), children: [
79000
+ (title || subtitle || headerAction) && /* @__PURE__ */ jsxs(MoonUICardHeaderPro, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
79001
+ /* @__PURE__ */ jsxs("div", { children: [
79002
+ title && /* @__PURE__ */ jsx(MoonUICardTitlePro, { className: "text-base font-semibold", children: title }),
79003
+ subtitle && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: subtitle })
79004
+ ] }),
79005
+ headerAction && /* @__PURE__ */ jsx("div", { className: "ml-4", children: headerAction })
79006
+ ] }),
79007
+ /* @__PURE__ */ jsx(MoonUICardContentPro, { className: cn(
79008
+ title || subtitle || headerAction ? "pt-0" : "pt-6"
79009
+ ), children: loading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ jsxs("div", { className: "animate-pulse space-y-2", children: [
79010
+ /* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded w-24 mx-auto" }),
79011
+ /* @__PURE__ */ jsx("div", { className: "h-8 bg-muted rounded w-16 mx-auto" })
79012
+ ] }) }) : error ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-8 text-center", children: /* @__PURE__ */ jsxs("div", { className: "text-destructive", children: [
79013
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: "Error" }),
79014
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: error })
79015
+ ] }) }) : children })
79016
+ ] });
79017
+ if (animate4) {
79018
+ return /* @__PURE__ */ jsx(
79019
+ motion.div,
79020
+ {
79021
+ initial: { opacity: 0, y: 20 },
79022
+ animate: { opacity: 1, y: 0 },
79023
+ transition: { duration: 0.3, ease: "easeOut" },
79024
+ children: content
79025
+ }
79026
+ );
79027
+ }
79028
+ return content;
79029
+ }
79030
+ function KPIWidget({
79031
+ data,
79032
+ title,
79033
+ variant = "default",
79034
+ orientation = "horizontal",
79035
+ showTrend = true,
79036
+ showTarget = true,
79037
+ showChange = true,
79038
+ animate: animate4 = true,
79039
+ icon,
79040
+ onKPIClick,
79041
+ ...widgetProps
79042
+ }) {
79043
+ const kpis = Array.isArray(data) ? data : [data];
79044
+ const formatValue = (value, unit) => {
79045
+ if (typeof value === "string")
79046
+ return value;
79047
+ let formattedValue;
79048
+ if (value % 1 !== 0) {
79049
+ formattedValue = (Math.round(value * 100) / 100).toString();
79050
+ } else {
79051
+ formattedValue = value.toString();
79052
+ }
79053
+ return unit ? `${formattedValue}${unit}` : formattedValue;
79054
+ };
79055
+ const getStatusColor = (status) => {
79056
+ switch (status) {
79057
+ case "success":
79058
+ return "text-green-600 dark:text-green-400";
79059
+ case "warning":
79060
+ return "text-yellow-600 dark:text-yellow-400";
79061
+ case "danger":
79062
+ return "text-red-600 dark:text-red-400";
79063
+ case "info":
79064
+ return "text-blue-600 dark:text-blue-400";
79065
+ default:
79066
+ return "text-foreground";
79067
+ }
79068
+ };
79069
+ const renderTrend = (trend) => {
79070
+ if (!trend || trend.length < 2)
79071
+ return null;
79072
+ const max2 = Math.max(...trend);
79073
+ const min2 = Math.min(...trend);
79074
+ const range = max2 - min2 || 1;
79075
+ return /* @__PURE__ */ jsx("div", { className: "flex items-end gap-0.5 h-8 w-16", children: trend.map((value, index2) => /* @__PURE__ */ jsx(
79076
+ motion.div,
79077
+ {
79078
+ className: "flex-1 bg-primary/60 rounded-t-sm min-h-[2px]",
79079
+ initial: { height: 0 },
79080
+ animate: { height: `${Math.max((value - min2) / range * 100, 10)}%` },
79081
+ transition: { delay: index2 * 0.05, duration: animate4 ? 0.3 : 0 }
79082
+ },
79083
+ index2
79084
+ )) });
79085
+ };
79086
+ const renderKPI = (kpi, index2) => {
79087
+ const progress = kpi.target ? typeof kpi.value === "number" ? kpi.value / kpi.target.value * 100 : 0 : 0;
79088
+ return /* @__PURE__ */ jsxs(
79089
+ motion.div,
79090
+ {
79091
+ className: cn(
79092
+ "space-y-2",
79093
+ onKPIClick && "cursor-pointer hover:bg-muted/30 p-2 -m-2 rounded-lg transition-colors"
79094
+ ),
79095
+ onClick: () => onKPIClick?.(kpi),
79096
+ initial: { opacity: 0, y: 10 },
79097
+ animate: { opacity: 1, y: 0 },
79098
+ transition: { delay: index2 * 0.1, duration: animate4 ? 0.3 : 0 },
79099
+ children: [
79100
+ (variant === "default" || variant === "detailed") && /* @__PURE__ */ jsxs("div", { className: cn(
79101
+ "flex items-center",
79102
+ orientation === "vertical" ? "flex-col space-y-2" : "justify-between"
79103
+ ), children: [
79104
+ /* @__PURE__ */ jsxs("div", { className: cn(
79105
+ "flex items-center gap-2",
79106
+ orientation === "vertical" ? "flex-col text-center" : ""
79107
+ ), children: [
79108
+ kpi.icon && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: kpi.icon }),
79109
+ /* @__PURE__ */ jsxs("div", { className: orientation === "vertical" ? "text-center" : "", children: [
79110
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground font-medium", children: kpi.label }),
79111
+ kpi.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70", children: kpi.description })
79112
+ ] })
79113
+ ] }),
79114
+ /* @__PURE__ */ jsxs("div", { className: cn(
79115
+ "flex items-center gap-3",
79116
+ orientation === "vertical" ? "flex-col" : ""
79117
+ ), children: [
79118
+ /* @__PURE__ */ jsx("div", { className: cn(
79119
+ "text-right",
79120
+ orientation === "vertical" ? "text-center" : ""
79121
+ ), children: /* @__PURE__ */ jsx("p", { className: cn(
79122
+ "text-2xl font-bold tracking-tight",
79123
+ getStatusColor(kpi.status)
79124
+ ), children: formatValue(kpi.value, kpi.unit) }) }),
79125
+ showChange && kpi.change && /* @__PURE__ */ jsxs("div", { className: cn(
79126
+ "flex items-center gap-1",
79127
+ kpi.change.type === "increase" ? "text-green-600" : kpi.change.type === "decrease" ? "text-red-600" : "text-gray-600"
79128
+ ), children: [
79129
+ kpi.change.type === "increase" ? /* @__PURE__ */ jsx(TrendingUp, { className: "h-4 w-4" }) : kpi.change.type === "decrease" ? /* @__PURE__ */ jsx(TrendingDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Minus, { className: "h-4 w-4" }),
79130
+ /* @__PURE__ */ jsxs("span", { className: "text-sm font-medium", children: [
79131
+ kpi.change.type !== "neutral" && (kpi.change.type === "increase" ? "+" : "-"),
79132
+ Math.abs(kpi.change.value),
79133
+ "%"
79134
+ ] })
79135
+ ] }),
79136
+ showTrend && kpi.trend && renderTrend(kpi.trend)
79137
+ ] })
79138
+ ] }),
79139
+ variant === "card" && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
79140
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
79141
+ /* @__PURE__ */ jsxs("div", { children: [
79142
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: kpi.label }),
79143
+ /* @__PURE__ */ jsx("p", { className: "text-3xl font-bold tracking-tight", children: formatValue(kpi.value, kpi.unit) })
79144
+ ] }),
79145
+ icon && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 p-3 rounded-xl bg-primary/10", children: icon })
79146
+ ] }),
79147
+ showChange && kpi.change && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
79148
+ /* @__PURE__ */ jsxs(
79149
+ MoonUIBadgePro,
79150
+ {
79151
+ variant: kpi.change.type === "increase" ? "success" : kpi.change.type === "decrease" ? "destructive" : "secondary",
79152
+ leftIcon: kpi.change.type === "increase" ? /* @__PURE__ */ jsx(ArrowUpRight, { className: "h-3 w-3" }) : kpi.change.type === "decrease" ? /* @__PURE__ */ jsx(ArrowDownRight, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(Minus, { className: "h-3 w-3" }),
79153
+ className: "text-xs",
79154
+ children: [
79155
+ kpi.change.type !== "neutral" && (kpi.change.type === "increase" ? "+" : "-"),
79156
+ Math.abs(kpi.change.value),
79157
+ "%"
79158
+ ]
79159
+ }
79160
+ ),
79161
+ kpi.change.period && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
79162
+ "vs ",
79163
+ kpi.change.period
79164
+ ] })
79165
+ ] })
79166
+ ] }),
79167
+ variant === "compact" && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
79168
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
79169
+ kpi.icon && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground text-sm", children: kpi.icon }),
79170
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: kpi.label })
79171
+ ] }),
79172
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
79173
+ /* @__PURE__ */ jsx("span", { className: "font-bold", children: formatValue(kpi.value, kpi.unit) }),
79174
+ showChange && kpi.change && /* @__PURE__ */ jsxs(
79175
+ MoonUIBadgePro,
79176
+ {
79177
+ variant: "outline",
79178
+ className: "text-xs",
79179
+ leftIcon: kpi.change.type === "increase" ? /* @__PURE__ */ jsx(ArrowUpRight, { className: "h-3 w-3" }) : kpi.change.type === "decrease" ? /* @__PURE__ */ jsx(ArrowDownRight, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(Minus, { className: "h-3 w-3" }),
79180
+ children: [
79181
+ kpi.change.type !== "neutral" && (kpi.change.type === "increase" ? "+" : "-"),
79182
+ Math.abs(kpi.change.value),
79183
+ "%"
79184
+ ]
79185
+ }
79186
+ )
79187
+ ] })
79188
+ ] }),
79189
+ variant === "detailed" && showTarget && kpi.target && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
79190
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
79191
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: kpi.target.label || "Target" }),
79192
+ /* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
79193
+ progress.toFixed(1),
79194
+ "% of ",
79195
+ formatValue(kpi.target.value, kpi.unit)
79196
+ ] })
79197
+ ] }),
79198
+ /* @__PURE__ */ jsx(MoonUIProgressPro, { value: progress, className: "h-2" })
79199
+ ] })
79200
+ ]
79201
+ },
79202
+ index2
79203
+ );
79204
+ };
79205
+ return /* @__PURE__ */ jsx(
79206
+ WidgetBase,
79207
+ {
79208
+ title,
79209
+ ...widgetProps,
79210
+ children: /* @__PURE__ */ jsx("div", { className: cn(
79211
+ "space-y-4",
79212
+ variant === "compact" && "space-y-2"
79213
+ ), children: kpis.map((kpi, index2) => renderKPI(kpi, index2)) })
79214
+ }
79215
+ );
79216
+ }
79217
+ function ChartWidget2({
79218
+ data,
79219
+ title,
79220
+ type = "line",
79221
+ variant = "default",
79222
+ height = 300,
79223
+ showLegend = true,
79224
+ showGrid = true,
79225
+ showTooltip = true,
79226
+ showDataLabels = false,
79227
+ animate: animate4 = true,
79228
+ colors,
79229
+ onDataPointClick,
79230
+ ...widgetProps
79231
+ }) {
79232
+ const [hoveredIndex, setHoveredIndex] = React67__default.useState(null);
79233
+ const defaultColors2 = [
79234
+ "#3b82f6",
79235
+ // blue
79236
+ "#10b981",
79237
+ // emerald
79238
+ "#f59e0b",
79239
+ // amber
79240
+ "#ef4444",
79241
+ // red
79242
+ "#8b5cf6",
79243
+ // violet
79244
+ "#ec4899"
79245
+ // pink
79246
+ ];
79247
+ const chartColors = colors || defaultColors2;
79248
+ const maxValue = React67__default.useMemo(() => {
79249
+ if (data.values) {
79250
+ return Math.max(...data.values);
79251
+ }
79252
+ if (data.series) {
79253
+ return Math.max(...data.series.flatMap((s) => s.data.map((d) => d.value)));
79254
+ }
79255
+ return 100;
79256
+ }, [data]);
79257
+ const formatNumber2 = (value) => {
79258
+ if (value % 1 !== 0) {
79259
+ return (Math.round(value * 100) / 100).toString();
79260
+ }
79261
+ return value.toString();
79262
+ };
79263
+ const renderBarChart = () => {
79264
+ const values = data.values || [];
79265
+ const labels = data.labels || data.categories || [];
79266
+ console.log("ChartWidget Debug:", { values, maxValue, labels });
79267
+ return /* @__PURE__ */ jsxs("div", { className: "relative h-full", children: [
79268
+ /* @__PURE__ */ jsx("div", { className: "flex items-end justify-between h-full gap-2 px-4", children: values.map((value, index2) => {
79269
+ const percentage = value / maxValue * 100;
79270
+ const isHovered = hoveredIndex === index2;
79271
+ console.log(`Bar ${index2}:`, { value, percentage, maxValue });
79272
+ return /* @__PURE__ */ jsxs(
79273
+ motion.div,
79274
+ {
79275
+ className: "flex-1 flex flex-col items-center justify-end gap-2",
79276
+ onMouseEnter: () => setHoveredIndex(index2),
79277
+ onMouseLeave: () => setHoveredIndex(null),
79278
+ initial: { opacity: 0, y: 20 },
79279
+ animate: { opacity: 1, y: 0 },
79280
+ transition: { delay: index2 * 0.05 },
79281
+ children: [
79282
+ showDataLabels && /* @__PURE__ */ jsx(
79283
+ motion.span,
79284
+ {
79285
+ className: "text-xs font-medium",
79286
+ initial: { opacity: 0 },
79287
+ animate: { opacity: isHovered ? 1 : 0 },
79288
+ children: formatNumber2(value)
79289
+ }
79290
+ ),
79291
+ /* @__PURE__ */ jsx(
79292
+ motion.div,
79293
+ {
79294
+ className: cn(
79295
+ "w-full rounded-t cursor-pointer",
79296
+ isHovered && "opacity-80"
79297
+ ),
79298
+ style: {
79299
+ backgroundColor: chartColors[index2 % chartColors.length],
79300
+ height: `${percentage}%`,
79301
+ minHeight: "4px"
79302
+ },
79303
+ initial: { scaleY: 0, transformOrigin: "bottom" },
79304
+ animate: { scaleY: 1 },
79305
+ transition: {
79306
+ duration: animate4 ? 0.6 : 0,
79307
+ delay: index2 * 0.1,
79308
+ ease: "easeOut"
79309
+ },
79310
+ onClick: () => onDataPointClick?.({ label: labels[index2], value })
79311
+ }
79312
+ ),
79313
+ labels[index2] && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground truncate max-w-full", children: labels[index2] })
79314
+ ]
79315
+ },
79316
+ index2
79317
+ );
79318
+ }) }),
79319
+ showGrid && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 pointer-events-none", children: [0, 25, 50, 75, 100].map((percentage) => /* @__PURE__ */ jsx(
79320
+ "div",
79321
+ {
79322
+ className: "absolute w-full border-b border-muted/20",
79323
+ style: { bottom: `${percentage}%` },
79324
+ children: /* @__PURE__ */ jsx("span", { className: "absolute -left-8 text-xs text-muted-foreground -translate-y-1/2", children: Math.round(percentage / 100 * maxValue) })
79325
+ },
79326
+ percentage
79327
+ )) })
79328
+ ] });
79329
+ };
79330
+ const renderLineChart = () => {
79331
+ const values = data.values || [];
79332
+ const labels = data.labels || data.categories || [];
79333
+ if (values.length < 2)
79334
+ return null;
79335
+ const points = values.map((value, index2) => {
79336
+ const x = index2 / (values.length - 1) * 100;
79337
+ const y = 100 - value / maxValue * 100;
79338
+ return { x, y, value, label: labels[index2] };
79339
+ });
79340
+ const pathData = points.map((point, index2) => `${index2 === 0 ? "M" : "L"} ${point.x} ${point.y}`).join(" ");
79341
+ return /* @__PURE__ */ jsxs("div", { className: "relative h-full", children: [
79342
+ /* @__PURE__ */ jsxs(
79343
+ "svg",
79344
+ {
79345
+ className: "w-full h-full",
79346
+ viewBox: "0 0 100 100",
79347
+ preserveAspectRatio: "none",
79348
+ children: [
79349
+ showGrid && /* @__PURE__ */ jsx("g", { className: "opacity-20", children: [0, 25, 50, 75, 100].map((y) => /* @__PURE__ */ jsx(
79350
+ "line",
79351
+ {
79352
+ x1: "0",
79353
+ y1: y,
79354
+ x2: "100",
79355
+ y2: y,
79356
+ stroke: "currentColor",
79357
+ strokeWidth: "0.5"
79358
+ },
79359
+ y
79360
+ )) }),
79361
+ /* @__PURE__ */ jsx(
79362
+ motion.path,
79363
+ {
79364
+ d: pathData,
79365
+ fill: "none",
79366
+ stroke: chartColors[0],
79367
+ strokeWidth: "2",
79368
+ initial: { pathLength: 0 },
79369
+ animate: { pathLength: 1 },
79370
+ transition: { duration: animate4 ? 1 : 0 }
79371
+ }
79372
+ ),
79373
+ type === "area" && /* @__PURE__ */ jsx(
79374
+ motion.path,
79375
+ {
79376
+ d: `${pathData} L 100 100 L 0 100 Z`,
79377
+ fill: `${chartColors[0]}20`,
79378
+ initial: { opacity: 0 },
79379
+ animate: { opacity: 1 },
79380
+ transition: { duration: animate4 ? 0.5 : 0, delay: 0.5 }
79381
+ }
79382
+ ),
79383
+ points.map((point, index2) => /* @__PURE__ */ jsx(
79384
+ motion.circle,
79385
+ {
79386
+ cx: point.x,
79387
+ cy: point.y,
79388
+ r: "2",
79389
+ fill: chartColors[0],
79390
+ initial: { r: 0 },
79391
+ animate: { r: hoveredIndex === index2 ? 3 : 2 },
79392
+ onMouseEnter: () => setHoveredIndex(index2),
79393
+ onMouseLeave: () => setHoveredIndex(null),
79394
+ className: "cursor-pointer",
79395
+ onClick: () => onDataPointClick?.(point)
79396
+ },
79397
+ index2
79398
+ ))
79399
+ ]
79400
+ }
79401
+ ),
79402
+ showTooltip && hoveredIndex !== null && points[hoveredIndex] && /* @__PURE__ */ jsxs(
79403
+ "div",
79404
+ {
79405
+ className: "absolute bg-background border rounded px-2 py-1 text-xs pointer-events-none",
79406
+ style: {
79407
+ left: `${points[hoveredIndex].x}%`,
79408
+ top: `${points[hoveredIndex].y}%`,
79409
+ transform: "translate(-50%, -150%)"
79410
+ },
79411
+ children: [
79412
+ /* @__PURE__ */ jsx("div", { className: "font-medium", children: points[hoveredIndex].label }),
79413
+ /* @__PURE__ */ jsx("div", { children: formatNumber2(points[hoveredIndex].value) })
79414
+ ]
79415
+ }
79416
+ )
79417
+ ] });
79418
+ };
79419
+ const renderPieChart = () => {
79420
+ const values = data.values || [];
79421
+ const labels = data.labels || data.categories || [];
79422
+ const total = values.reduce((sum, val) => sum + val, 0);
79423
+ let currentAngle = -90;
79424
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
79425
+ /* @__PURE__ */ jsxs("div", { className: "relative w-48 h-48", children: [
79426
+ /* @__PURE__ */ jsxs("svg", { className: "w-full h-full transform", viewBox: "0 0 100 100", children: [
79427
+ values.map((value, index2) => {
79428
+ const percentage = value / total * 100;
79429
+ const angle = percentage / 100 * 360;
79430
+ const startAngle = currentAngle;
79431
+ const endAngle = currentAngle + angle;
79432
+ const start = polarToCartesian(50, 50, 40, startAngle);
79433
+ const end = polarToCartesian(50, 50, 40, endAngle);
79434
+ const largeArcFlag = angle > 180 ? 1 : 0;
79435
+ const pathData = [
79436
+ `M 50 50`,
79437
+ `L ${start.x} ${start.y}`,
79438
+ `A 40 40 0 ${largeArcFlag} 1 ${end.x} ${end.y}`,
79439
+ `Z`
79440
+ ].join(" ");
79441
+ currentAngle = endAngle;
79442
+ return /* @__PURE__ */ jsx(
79443
+ motion.path,
79444
+ {
79445
+ d: pathData,
79446
+ fill: chartColors[index2 % chartColors.length],
79447
+ initial: { scale: 0 },
79448
+ animate: { scale: hoveredIndex === index2 ? 1.05 : 1 },
79449
+ style: { transformOrigin: "50px 50px" },
79450
+ transition: { duration: animate4 ? 0.3 : 0, delay: index2 * 0.05 },
79451
+ onMouseEnter: () => setHoveredIndex(index2),
79452
+ onMouseLeave: () => setHoveredIndex(null),
79453
+ className: "cursor-pointer",
79454
+ onClick: () => onDataPointClick?.({ label: labels[index2], value, percentage })
79455
+ },
79456
+ index2
79457
+ );
79458
+ }),
79459
+ type === "donut" && /* @__PURE__ */ jsx("circle", { cx: "50", cy: "50", r: "25", fill: "var(--background)" })
79460
+ ] }),
79461
+ type === "donut" && /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
79462
+ /* @__PURE__ */ jsx("div", { className: "text-2xl font-bold", children: total }),
79463
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: "Total" })
79464
+ ] })
79465
+ ] }),
79466
+ showLegend && /* @__PURE__ */ jsx("div", { className: "space-y-2", children: values.map((value, index2) => {
79467
+ const percentage = (value / total * 100).toFixed(1);
79468
+ return /* @__PURE__ */ jsxs(
79469
+ "div",
79470
+ {
79471
+ className: cn(
79472
+ "flex items-center gap-2 cursor-pointer",
79473
+ hoveredIndex === index2 && "opacity-80"
79474
+ ),
79475
+ onMouseEnter: () => setHoveredIndex(index2),
79476
+ onMouseLeave: () => setHoveredIndex(null),
79477
+ children: [
79478
+ /* @__PURE__ */ jsx(
79479
+ "div",
79480
+ {
79481
+ className: "w-3 h-3 rounded",
79482
+ style: { backgroundColor: chartColors[index2 % chartColors.length] }
79483
+ }
79484
+ ),
79485
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: labels[index2] }),
79486
+ /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground ml-auto", children: [
79487
+ percentage,
79488
+ "%"
79489
+ ] })
79490
+ ]
79491
+ },
79492
+ index2
79493
+ );
79494
+ }) })
79495
+ ] });
79496
+ };
79497
+ const polarToCartesian = (centerX, centerY, radius, angleInDegrees) => {
79498
+ const angleInRadians = angleInDegrees * Math.PI / 180;
79499
+ return {
79500
+ x: centerX + radius * Math.cos(angleInRadians),
79501
+ y: centerY + radius * Math.sin(angleInRadians)
79502
+ };
79503
+ };
79504
+ const renderChart = () => {
79505
+ switch (type) {
79506
+ case "bar":
79507
+ return renderBarChart();
79508
+ case "line":
79509
+ case "area":
79510
+ return renderLineChart();
79511
+ case "pie":
79512
+ case "donut":
79513
+ return renderPieChart();
79514
+ default:
79515
+ return renderBarChart();
79516
+ }
79517
+ };
79518
+ return /* @__PURE__ */ jsx(
79519
+ WidgetBase,
79520
+ {
79521
+ title,
79522
+ ...widgetProps,
79523
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
79524
+ data.total !== void 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
79525
+ /* @__PURE__ */ jsxs("div", { children: [
79526
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Total" }),
79527
+ /* @__PURE__ */ jsx("p", { className: "text-2xl font-bold", children: formatNumber2(data.total) })
79528
+ ] }),
79529
+ data.change && /* @__PURE__ */ jsxs("div", { className: cn(
79530
+ "flex items-center gap-1",
79531
+ data.change.type === "increase" ? "text-green-600" : data.change.type === "decrease" ? "text-red-600" : "text-gray-600"
79532
+ ), children: [
79533
+ data.change.type === "increase" ? /* @__PURE__ */ jsx(ArrowUpRight, { className: "h-4 w-4" }) : data.change.type === "decrease" ? /* @__PURE__ */ jsx(ArrowDownRight, { className: "h-4 w-4" }) : null,
79534
+ /* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
79535
+ data.change.type !== "neutral" && (data.change.type === "increase" ? "+" : "-"),
79536
+ Math.abs(data.change.value),
79537
+ "%"
79538
+ ] }),
79539
+ data.change.period && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
79540
+ "vs ",
79541
+ data.change.period
79542
+ ] })
79543
+ ] })
79544
+ ] }),
79545
+ /* @__PURE__ */ jsx("div", { style: { height: `${height}px` }, children: renderChart() })
79546
+ ] })
79547
+ }
79548
+ );
79549
+ }
79550
+ function GaugeWidget({
79551
+ data,
79552
+ title,
79553
+ variant = "radial",
79554
+ showValue = true,
79555
+ showTarget = true,
79556
+ showThresholds = true,
79557
+ showLabels = true,
79558
+ showTrend = true,
79559
+ showPercentage = true,
79560
+ size: size4 = "md",
79561
+ animate: animate4 = true,
79562
+ strokeWidth = 12,
79563
+ onGaugeClick,
79564
+ ...widgetProps
79565
+ }) {
79566
+ const gauges = Array.isArray(data) ? data : [data];
79567
+ const sizeConfig = {
79568
+ sm: { width: 120, height: 120, fontSize: "text-lg", strokeWidth: 8 },
79569
+ md: { width: 180, height: 180, fontSize: "text-2xl", strokeWidth: 12 },
79570
+ lg: { width: 240, height: 240, fontSize: "text-3xl", strokeWidth: 16 },
79571
+ xl: { width: 320, height: 320, fontSize: "text-4xl", strokeWidth: 20 }
79572
+ };
79573
+ const config = sizeConfig[size4];
79574
+ const formatNumber2 = (value) => {
79575
+ if (value % 1 !== 0) {
79576
+ return (Math.round(value * 100) / 100).toString();
79577
+ }
79578
+ return value.toString();
79579
+ };
79580
+ const getPercentage = (gauge) => {
79581
+ const min2 = gauge.min ?? 0;
79582
+ const max2 = gauge.max ?? 100;
79583
+ const range = max2 - min2;
79584
+ return (gauge.value - min2) / range * 100;
79585
+ };
79586
+ const getColor = (gauge, percentage) => {
79587
+ if (gauge.thresholds && gauge.thresholds.length > 0) {
79588
+ const sortedThresholds = [...gauge.thresholds].sort((a, b) => a.value - b.value);
79589
+ for (let i = sortedThresholds.length - 1; i >= 0; i--) {
79590
+ if (percentage >= sortedThresholds[i].value) {
79591
+ return sortedThresholds[i].color;
79592
+ }
79593
+ }
79594
+ return sortedThresholds[0].color;
79595
+ }
79596
+ const statusColors = {
79597
+ success: "#22c55e",
79598
+ warning: "#f59e0b",
79599
+ danger: "#ef4444",
79600
+ info: "#3b82f6",
79601
+ neutral: "#6b7280"
79602
+ };
79603
+ if (gauge.status) {
79604
+ return statusColors[gauge.status];
79605
+ }
79606
+ if (percentage >= 75)
79607
+ return "#22c55e";
79608
+ if (percentage >= 50)
79609
+ return "#f59e0b";
79610
+ if (percentage >= 25)
79611
+ return "#fb923c";
79612
+ return "#ef4444";
79613
+ };
79614
+ const renderRadialGauge = (gauge, index2) => {
79615
+ const percentage = getPercentage(gauge);
79616
+ const radius = (config.width - config.strokeWidth) / 2;
79617
+ const circumference = 2 * Math.PI * radius;
79618
+ const strokeDashoffset = circumference - percentage / 100 * circumference;
79619
+ const color = getColor(gauge, percentage);
79620
+ const targetAngle = gauge.target ? (gauge.target - (gauge.min ?? 0)) / ((gauge.max ?? 100) - (gauge.min ?? 0)) * 360 : null;
79621
+ return /* @__PURE__ */ jsxs(
79622
+ motion.div,
79623
+ {
79624
+ className: "relative flex flex-col items-center cursor-pointer",
79625
+ onClick: () => onGaugeClick?.(gauge),
79626
+ whileHover: { scale: 1.02 },
79627
+ whileTap: { scale: 0.98 },
79628
+ children: [
79629
+ /* @__PURE__ */ jsxs(
79630
+ "svg",
79631
+ {
79632
+ width: config.width,
79633
+ height: config.height,
79634
+ className: "transform -rotate-90",
79635
+ children: [
79636
+ /* @__PURE__ */ jsx(
79637
+ "circle",
79638
+ {
79639
+ cx: config.width / 2,
79640
+ cy: config.height / 2,
79641
+ r: radius,
79642
+ fill: "none",
79643
+ stroke: "currentColor",
79644
+ strokeWidth: config.strokeWidth,
79645
+ className: "text-muted/20"
79646
+ }
79647
+ ),
79648
+ showThresholds && gauge.thresholds && gauge.thresholds.map((threshold, idx) => {
79649
+ const thresholdAngle = (threshold.value / 100 * 360 - 90) * (Math.PI / 180);
79650
+ const x1 = config.width / 2 + (radius - config.strokeWidth) * Math.cos(thresholdAngle);
79651
+ const y1 = config.height / 2 + (radius - config.strokeWidth) * Math.sin(thresholdAngle);
79652
+ const x2 = config.width / 2 + (radius + config.strokeWidth) * Math.cos(thresholdAngle);
79653
+ const y2 = config.height / 2 + (radius + config.strokeWidth) * Math.sin(thresholdAngle);
79654
+ return /* @__PURE__ */ jsx(
79655
+ "line",
79656
+ {
79657
+ x1,
79658
+ y1,
79659
+ x2,
79660
+ y2,
79661
+ stroke: threshold.color,
79662
+ strokeWidth: 2,
79663
+ opacity: 0.5
79664
+ },
79665
+ idx
79666
+ );
79667
+ }),
79668
+ /* @__PURE__ */ jsx(
79669
+ motion.circle,
79670
+ {
79671
+ cx: config.width / 2,
79672
+ cy: config.height / 2,
79673
+ r: radius,
79674
+ fill: "none",
79675
+ stroke: color,
79676
+ strokeWidth: config.strokeWidth,
79677
+ strokeLinecap: "round",
79678
+ strokeDasharray: circumference,
79679
+ initial: { strokeDashoffset: circumference },
79680
+ animate: { strokeDashoffset },
79681
+ transition: { duration: animate4 ? 1 : 0, ease: "easeOut" }
79682
+ }
79683
+ ),
79684
+ showTarget && targetAngle !== null && /* @__PURE__ */ jsx("g", { transform: `rotate(${targetAngle} ${config.width / 2} ${config.height / 2})`, children: /* @__PURE__ */ jsx(
79685
+ "line",
79686
+ {
79687
+ x1: config.width / 2,
79688
+ y1: config.strokeWidth,
79689
+ x2: config.width / 2,
79690
+ y2: config.strokeWidth + 10,
79691
+ stroke: "currentColor",
79692
+ strokeWidth: 3,
79693
+ className: "text-primary"
79694
+ }
79695
+ ) })
79696
+ ]
79697
+ }
79698
+ ),
79699
+ /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center transform rotate-0", children: [
79700
+ showValue && /* @__PURE__ */ jsxs(
79701
+ motion.div,
79702
+ {
79703
+ className: cn(config.fontSize, "font-bold"),
79704
+ initial: { opacity: 0, scale: 0.5 },
79705
+ animate: { opacity: 1, scale: 1 },
79706
+ transition: { delay: 0.3 },
79707
+ children: [
79708
+ formatNumber2(gauge.value),
79709
+ gauge.unit && /* @__PURE__ */ jsx("span", { className: "text-sm ml-1", children: gauge.unit })
79710
+ ]
79711
+ }
79712
+ ),
79713
+ showPercentage && /* @__PURE__ */ jsxs("div", { className: "text-sm text-muted-foreground", children: [
79714
+ formatNumber2(percentage),
79715
+ "%"
79716
+ ] }),
79717
+ showLabels && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground mt-1 text-center px-2", children: gauge.label }),
79718
+ showTrend && gauge.trend && /* @__PURE__ */ jsxs("div", { className: cn(
79719
+ "flex items-center gap-1 mt-2",
79720
+ gauge.trend.type === "increase" ? "text-green-600" : gauge.trend.type === "decrease" ? "text-red-600" : "text-gray-600"
79721
+ ), children: [
79722
+ gauge.trend.type === "increase" ? /* @__PURE__ */ jsx(TrendingUp, { className: "h-3 w-3" }) : gauge.trend.type === "decrease" ? /* @__PURE__ */ jsx(TrendingDown, { className: "h-3 w-3" }) : null,
79723
+ /* @__PURE__ */ jsxs("span", { className: "text-xs font-medium", children: [
79724
+ formatNumber2(gauge.trend.value),
79725
+ "%"
79726
+ ] })
79727
+ ] })
79728
+ ] })
79729
+ ]
79730
+ },
79731
+ index2
79732
+ );
79733
+ };
79734
+ const renderLinearGauge = (gauge, index2) => {
79735
+ const percentage = getPercentage(gauge);
79736
+ const color = getColor(gauge, percentage);
79737
+ return /* @__PURE__ */ jsxs(
79738
+ motion.div,
79739
+ {
79740
+ className: "w-full space-y-2 cursor-pointer",
79741
+ onClick: () => onGaugeClick?.(gauge),
79742
+ whileHover: { scale: 1.01 },
79743
+ children: [
79744
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
79745
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
79746
+ showLabels && /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: gauge.label }),
79747
+ gauge.status && /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "outline", className: "text-xs", children: gauge.status })
79748
+ ] }),
79749
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
79750
+ showValue && /* @__PURE__ */ jsxs("span", { className: cn("font-bold", size4 === "sm" ? "text-base" : "text-lg"), children: [
79751
+ formatNumber2(gauge.value),
79752
+ gauge.unit && /* @__PURE__ */ jsx("span", { className: "text-sm ml-1 text-muted-foreground", children: gauge.unit })
79753
+ ] }),
79754
+ showPercentage && /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
79755
+ "(",
79756
+ formatNumber2(percentage),
79757
+ "%)"
79758
+ ] })
79759
+ ] })
79760
+ ] }),
79761
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
79762
+ /* @__PURE__ */ jsx("div", { className: cn(
79763
+ "w-full rounded-full bg-muted/30 overflow-hidden",
79764
+ size4 === "sm" ? "h-2" : size4 === "md" ? "h-3" : size4 === "lg" ? "h-4" : "h-5"
79765
+ ), children: /* @__PURE__ */ jsx(
79766
+ motion.div,
79767
+ {
79768
+ className: "h-full rounded-full",
79769
+ style: { backgroundColor: color },
79770
+ initial: { width: 0 },
79771
+ animate: { width: `${percentage}%` },
79772
+ transition: { duration: animate4 ? 1 : 0, ease: "easeOut" }
79773
+ }
79774
+ ) }),
79775
+ showThresholds && gauge.thresholds && gauge.thresholds.map((threshold, idx) => /* @__PURE__ */ jsx(MoonUITooltipProviderPro, { children: /* @__PURE__ */ jsxs(MoonUITooltipPro, { children: [
79776
+ /* @__PURE__ */ jsx(MoonUITooltipTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(
79777
+ "div",
79778
+ {
79779
+ className: "absolute top-1/2 -translate-y-1/2 w-0.5 h-full bg-background",
79780
+ style: { left: `${threshold.value}%` }
79781
+ }
79782
+ ) }),
79783
+ /* @__PURE__ */ jsx(MoonUITooltipContentPro, { children: /* @__PURE__ */ jsx("p", { children: threshold.label || `${threshold.value}%` }) })
79784
+ ] }) }, idx)),
79785
+ showTarget && gauge.target && /* @__PURE__ */ jsx(MoonUITooltipProviderPro, { children: /* @__PURE__ */ jsxs(MoonUITooltipPro, { children: [
79786
+ /* @__PURE__ */ jsx(MoonUITooltipTriggerPro, { asChild: true, children: /* @__PURE__ */ jsx(
79787
+ "div",
79788
+ {
79789
+ className: "absolute -top-1 w-0 h-0 border-l-[6px] border-l-transparent border-r-[6px] border-r-transparent border-t-[8px] border-t-primary",
79790
+ style: {
79791
+ left: `${(gauge.target - (gauge.min ?? 0)) / ((gauge.max ?? 100) - (gauge.min ?? 0)) * 100}%`,
79792
+ transform: "translateX(-50%)"
79793
+ }
79794
+ }
79795
+ ) }),
79796
+ /* @__PURE__ */ jsx(MoonUITooltipContentPro, { children: /* @__PURE__ */ jsxs("p", { children: [
79797
+ "Target: ",
79798
+ formatNumber2(gauge.target),
79799
+ gauge.unit
79800
+ ] }) })
79801
+ ] }) })
79802
+ ] }),
79803
+ showLabels && /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-xs text-muted-foreground", children: [
79804
+ /* @__PURE__ */ jsx("span", { children: gauge.min ?? 0 }),
79805
+ /* @__PURE__ */ jsx("span", { children: gauge.max ?? 100 })
79806
+ ] })
79807
+ ]
79808
+ },
79809
+ index2
79810
+ );
79811
+ };
79812
+ const renderGauge = (gauge, index2) => {
79813
+ switch (variant) {
79814
+ case "linear":
79815
+ case "progress":
79816
+ return renderLinearGauge(gauge, index2);
79817
+ case "radial":
79818
+ default:
79819
+ return renderRadialGauge(gauge, index2);
79820
+ }
79821
+ };
79822
+ return /* @__PURE__ */ jsx(
79823
+ WidgetBase,
79824
+ {
79825
+ title,
79826
+ ...widgetProps,
79827
+ children: /* @__PURE__ */ jsx("div", { className: cn(
79828
+ "flex flex-wrap items-center justify-center",
79829
+ variant === "linear" || variant === "progress" ? "flex-col space-y-4" : "gap-6",
79830
+ "p-4"
79831
+ ), children: gauges.map((gauge, index2) => renderGauge(gauge, index2)) })
79832
+ }
79833
+ );
79834
+ }
79835
+ function FunnelWidget({
79836
+ data,
79837
+ title,
79838
+ variant = "vertical",
79839
+ showValues = true,
79840
+ showPercentages = true,
79841
+ showDropoff = true,
79842
+ showTargets = false,
79843
+ showDuration = false,
79844
+ showConversionRate = true,
79845
+ animate: animate4 = true,
79846
+ interactive = true,
79847
+ onStageClick,
79848
+ ...widgetProps
79849
+ }) {
79850
+ const [hoveredStage, setHoveredStage] = React67__default.useState(null);
79851
+ const formatNumber2 = (value) => {
79852
+ if (value % 1 !== 0) {
79853
+ return (Math.round(value * 100) / 100).toString();
79854
+ }
79855
+ return value.toString();
79856
+ };
79857
+ const processedStages = React67__default.useMemo(() => {
79858
+ const maxValue = Math.max(...data.stages.map((s) => s.value));
79859
+ return data.stages.map((stage, index2) => {
79860
+ const percentage = stage.percentage ?? stage.value / maxValue * 100;
79861
+ const previousValue = index2 > 0 ? data.stages[index2 - 1].value : stage.value;
79862
+ const dropoff = stage.dropoff ?? previousValue - stage.value;
79863
+ const dropoffPercentage = stage.dropoffPercentage ?? (previousValue > 0 ? (previousValue - stage.value) / previousValue * 100 : 0);
79864
+ return {
79865
+ ...stage,
79866
+ percentage,
79867
+ dropoff,
79868
+ dropoffPercentage
79869
+ };
79870
+ });
79871
+ }, [data.stages]);
79872
+ const getStageColor = (stage, index2) => {
79873
+ if (stage.color)
79874
+ return stage.color;
79875
+ const defaultColors2 = [
79876
+ "#3b82f6",
79877
+ // blue
79878
+ "#8b5cf6",
79879
+ // violet
79880
+ "#ec4899",
79881
+ // pink
79882
+ "#f59e0b",
79883
+ // amber
79884
+ "#10b981",
79885
+ // emerald
79886
+ "#06b6d4"
79887
+ // cyan
79888
+ ];
79889
+ return defaultColors2[index2 % defaultColors2.length];
79890
+ };
79891
+ const getStageIcon = (stage, index2) => {
79892
+ if (stage.icon)
79893
+ return stage.icon;
79894
+ const defaultIcons = [
79895
+ /* @__PURE__ */ jsx(Users, { className: "h-4 w-4" }),
79896
+ /* @__PURE__ */ jsx(ShoppingCart, { className: "h-4 w-4" }),
79897
+ /* @__PURE__ */ jsx(CreditCard, { className: "h-4 w-4" }),
79898
+ /* @__PURE__ */ jsx(CheckCircle, { className: "h-4 w-4" })
79899
+ ];
79900
+ return defaultIcons[index2] || /* @__PURE__ */ jsx(Target, { className: "h-4 w-4" });
79901
+ };
79902
+ const formatValue = (value) => {
79903
+ if (data.currency) {
79904
+ return new Intl.NumberFormat("en-US", {
79905
+ style: "currency",
79906
+ currency: data.currency,
79907
+ minimumFractionDigits: 0,
79908
+ maximumFractionDigits: 0
79909
+ }).format(value);
79910
+ }
79911
+ if (value >= 1e6) {
79912
+ return `${formatNumber2(value / 1e6)}M`;
79913
+ } else if (value >= 1e3) {
79914
+ return `${formatNumber2(value / 1e3)}K`;
79915
+ }
79916
+ return value.toLocaleString();
79917
+ };
79918
+ const renderVerticalFunnel = () => {
79919
+ return /* @__PURE__ */ jsx("div", { className: "space-y-2", children: processedStages.map((stage, index2) => {
79920
+ const width = `${stage.percentage}%`;
79921
+ const color = getStageColor(stage, index2);
79922
+ const icon = getStageIcon(stage, index2);
79923
+ const isHovered = hoveredStage === stage.id;
79924
+ return /* @__PURE__ */ jsx(
79925
+ motion.div,
79926
+ {
79927
+ className: cn(
79928
+ "relative group",
79929
+ interactive && "cursor-pointer"
79930
+ ),
79931
+ onMouseEnter: () => setHoveredStage(stage.id),
79932
+ onMouseLeave: () => setHoveredStage(null),
79933
+ onClick: () => interactive && onStageClick?.(stage),
79934
+ initial: { opacity: 0, x: -20 },
79935
+ animate: { opacity: 1, x: 0 },
79936
+ transition: { delay: index2 * 0.1 },
79937
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
79938
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
79939
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-1", children: [
79940
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
79941
+ /* @__PURE__ */ jsx(
79942
+ "div",
79943
+ {
79944
+ className: "p-1.5 rounded",
79945
+ style: { backgroundColor: `${color}20` },
79946
+ children: /* @__PURE__ */ jsx("div", { style: { color }, children: icon })
79947
+ }
79948
+ ),
79949
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: stage.name }),
79950
+ stage.description && /* @__PURE__ */ jsx(MoonUITooltipProviderPro, { children: /* @__PURE__ */ jsxs(MoonUITooltipPro, { children: [
79951
+ /* @__PURE__ */ jsx(MoonUITooltipTriggerPro, { children: /* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3 text-muted-foreground" }) }),
79952
+ /* @__PURE__ */ jsx(MoonUITooltipContentPro, { children: /* @__PURE__ */ jsx("p", { className: "max-w-xs", children: stage.description }) })
79953
+ ] }) })
79954
+ ] }),
79955
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
79956
+ showValues && /* @__PURE__ */ jsx("span", { className: "text-sm font-bold", children: formatValue(stage.value) }),
79957
+ showPercentages && /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "outline", className: "text-xs", children: [
79958
+ formatNumber2(stage.percentage),
79959
+ "%"
79960
+ ] }),
79961
+ showDuration && stage.duration && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: stage.duration })
79962
+ ] })
79963
+ ] }),
79964
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
79965
+ /* @__PURE__ */ jsx("div", { className: "h-8 bg-muted/30 rounded overflow-hidden", children: /* @__PURE__ */ jsx(
79966
+ motion.div,
79967
+ {
79968
+ className: "h-full rounded transition-all duration-300",
79969
+ style: {
79970
+ backgroundColor: color,
79971
+ opacity: isHovered ? 1 : 0.8
79972
+ },
79973
+ initial: { width: 0 },
79974
+ animate: { width },
79975
+ transition: { duration: animate4 ? 0.5 : 0, delay: index2 * 0.1 }
79976
+ }
79977
+ ) }),
79978
+ showTargets && stage.target && /* @__PURE__ */ jsx(
79979
+ "div",
79980
+ {
79981
+ className: "absolute top-0 bottom-0 w-0.5 bg-foreground/50",
79982
+ style: { left: `${stage.target / Math.max(...data.stages.map((s) => s.value)) * 100}%` },
79983
+ children: /* @__PURE__ */ jsx("div", { className: "absolute -top-1 -left-1 w-2 h-2 rounded-full bg-foreground/50" })
79984
+ }
79985
+ )
79986
+ ] }),
79987
+ index2 < processedStages.length - 1 && /* @__PURE__ */ jsx("div", { className: "flex justify-center mt-2 mb-1", children: /* @__PURE__ */ jsx(ArrowDown, { className: "h-4 w-4 text-muted-foreground/50" }) })
79988
+ ] }),
79989
+ showDropoff && index2 > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs", children: [
79990
+ /* @__PURE__ */ jsx(ArrowDown, { className: "h-3 w-3 text-red-500" }),
79991
+ /* @__PURE__ */ jsxs("span", { className: "text-red-500 font-medium", children: [
79992
+ "-",
79993
+ formatNumber2(stage.dropoffPercentage),
79994
+ "%"
79995
+ ] })
79996
+ ] })
79997
+ ] })
79998
+ },
79999
+ stage.id
80000
+ );
80001
+ }) });
80002
+ };
80003
+ const renderStepsFunnel = () => {
80004
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between", children: processedStages.map((stage, index2) => {
80005
+ const color = getStageColor(stage, index2);
80006
+ const icon = getStageIcon(stage, index2);
80007
+ const isHovered = hoveredStage === stage.id;
80008
+ const isLast = index2 === processedStages.length - 1;
80009
+ return /* @__PURE__ */ jsxs(React67__default.Fragment, { children: [
80010
+ /* @__PURE__ */ jsxs(
80011
+ motion.div,
80012
+ {
80013
+ className: cn(
80014
+ "flex flex-col items-center gap-2 flex-1",
80015
+ interactive && "cursor-pointer"
80016
+ ),
80017
+ onMouseEnter: () => setHoveredStage(stage.id),
80018
+ onMouseLeave: () => setHoveredStage(null),
80019
+ onClick: () => interactive && onStageClick?.(stage),
80020
+ initial: { opacity: 0, y: 20 },
80021
+ animate: { opacity: 1, y: 0 },
80022
+ transition: { delay: index2 * 0.1 },
80023
+ children: [
80024
+ /* @__PURE__ */ jsxs(
80025
+ motion.div,
80026
+ {
80027
+ className: "relative",
80028
+ whileHover: { scale: 1.1 },
80029
+ whileTap: { scale: 0.95 },
80030
+ children: [
80031
+ /* @__PURE__ */ jsx(
80032
+ "div",
80033
+ {
80034
+ className: cn(
80035
+ "w-16 h-16 rounded-full flex items-center justify-center",
80036
+ "border-2 transition-all duration-300"
80037
+ ),
80038
+ style: {
80039
+ borderColor: color,
80040
+ backgroundColor: isHovered ? `${color}20` : "transparent"
80041
+ },
80042
+ children: /* @__PURE__ */ jsx("div", { style: { color }, children: icon })
80043
+ }
80044
+ ),
80045
+ /* @__PURE__ */ jsx("svg", { className: "absolute inset-0 -rotate-90", width: "64", height: "64", children: /* @__PURE__ */ jsx(
80046
+ "circle",
80047
+ {
80048
+ cx: "32",
80049
+ cy: "32",
80050
+ r: "30",
80051
+ fill: "none",
80052
+ stroke: color,
80053
+ strokeWidth: "2",
80054
+ strokeDasharray: `${stage.percentage * 1.88} 188`,
80055
+ opacity: "0.3"
80056
+ }
80057
+ ) })
80058
+ ]
80059
+ }
80060
+ ),
80061
+ /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
80062
+ /* @__PURE__ */ jsx("div", { className: "font-medium text-sm", children: stage.name }),
80063
+ showValues && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground mt-1", children: formatValue(stage.value) }),
80064
+ showPercentages && /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "outline", className: "text-xs mt-1", children: [
80065
+ formatNumber2(stage.percentage),
80066
+ "%"
80067
+ ] })
80068
+ ] })
80069
+ ]
80070
+ }
80071
+ ),
80072
+ !isLast && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 px-2", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
80073
+ /* @__PURE__ */ jsx(ArrowRight, { className: "h-5 w-5 text-muted-foreground" }),
80074
+ showDropoff && /* @__PURE__ */ jsxs("div", { className: "absolute -top-6 left-1/2 -translate-x-1/2 text-xs text-red-500 whitespace-nowrap", children: [
80075
+ "-",
80076
+ formatNumber2(processedStages[index2 + 1].dropoffPercentage),
80077
+ "%"
80078
+ ] })
80079
+ ] }) })
80080
+ ] }, stage.id);
80081
+ }) });
80082
+ };
80083
+ const renderCardsFunnel = () => {
80084
+ return /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4", children: processedStages.map((stage, index2) => {
80085
+ const color = getStageColor(stage, index2);
80086
+ const icon = getStageIcon(stage, index2);
80087
+ const isHovered = hoveredStage === stage.id;
80088
+ return /* @__PURE__ */ jsxs(
80089
+ motion.div,
80090
+ {
80091
+ className: cn(
80092
+ "relative p-4 rounded-lg border transition-all",
80093
+ interactive && "cursor-pointer hover:shadow-lg",
80094
+ isHovered && "border-primary"
80095
+ ),
80096
+ style: {
80097
+ borderColor: isHovered ? color : void 0
80098
+ },
80099
+ onMouseEnter: () => setHoveredStage(stage.id),
80100
+ onMouseLeave: () => setHoveredStage(null),
80101
+ onClick: () => interactive && onStageClick?.(stage),
80102
+ initial: { opacity: 0, y: 20 },
80103
+ animate: { opacity: 1, y: 0 },
80104
+ transition: { delay: index2 * 0.1 },
80105
+ children: [
80106
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [
80107
+ /* @__PURE__ */ jsx(
80108
+ "div",
80109
+ {
80110
+ className: "p-2 rounded",
80111
+ style: { backgroundColor: `${color}20` },
80112
+ children: /* @__PURE__ */ jsx("div", { style: { color }, children: icon })
80113
+ }
80114
+ ),
80115
+ index2 > 0 && showDropoff && /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "destructive", className: "text-xs", children: [
80116
+ /* @__PURE__ */ jsx(TrendingDown, { className: "h-3 w-3 mr-1" }),
80117
+ formatNumber2(stage.dropoffPercentage),
80118
+ "%"
80119
+ ] })
80120
+ ] }),
80121
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
80122
+ /* @__PURE__ */ jsx("h4", { className: "font-semibold", children: stage.name }),
80123
+ showValues && /* @__PURE__ */ jsx("div", { className: "text-2xl font-bold", children: formatValue(stage.value) }),
80124
+ showPercentages && /* @__PURE__ */ jsx(MoonUIProgressPro, { value: stage.percentage, className: "h-2" }),
80125
+ stage.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: stage.description }),
80126
+ showTargets && stage.target && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs", children: [
80127
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Target" }),
80128
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: formatValue(stage.target) })
80129
+ ] })
80130
+ ] })
80131
+ ]
80132
+ },
80133
+ stage.id
80134
+ );
80135
+ }) });
80136
+ };
80137
+ const renderFunnel = () => {
80138
+ switch (variant) {
80139
+ case "steps":
80140
+ return renderStepsFunnel();
80141
+ case "cards":
80142
+ return renderCardsFunnel();
80143
+ case "vertical":
80144
+ default:
80145
+ return renderVerticalFunnel();
80146
+ }
80147
+ };
80148
+ return /* @__PURE__ */ jsx(
80149
+ WidgetBase,
80150
+ {
80151
+ title,
80152
+ ...widgetProps,
80153
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
80154
+ showConversionRate && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-3 bg-muted/30 rounded-lg", children: [
80155
+ /* @__PURE__ */ jsxs("div", { children: [
80156
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Overall Conversion Rate" }),
80157
+ /* @__PURE__ */ jsx("p", { className: "text-2xl font-bold", children: data.conversionRate ? `${formatNumber2(data.conversionRate)}%` : `${formatNumber2(processedStages[processedStages.length - 1].value / processedStages[0].value * 100)}%` })
80158
+ ] }),
80159
+ data.comparison && /* @__PURE__ */ jsxs("div", { className: cn(
80160
+ "flex items-center gap-1",
80161
+ data.comparison.type === "increase" ? "text-green-600" : "text-red-600"
80162
+ ), children: [
80163
+ data.comparison.type === "increase" ? /* @__PURE__ */ jsx(TrendingUp, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(TrendingDown, { className: "h-4 w-4" }),
80164
+ /* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
80165
+ data.comparison.type === "increase" ? "+" : "-",
80166
+ Math.abs(data.comparison.value),
80167
+ "%"
80168
+ ] }),
80169
+ /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
80170
+ "vs ",
80171
+ data.comparison.period
80172
+ ] })
80173
+ ] })
80174
+ ] }),
80175
+ renderFunnel()
80176
+ ] })
80177
+ }
80178
+ );
80179
+ }
80180
+ function RevenueWidget({
80181
+ data,
80182
+ title,
80183
+ variant = "default",
80184
+ showStreams = true,
80185
+ showMetrics = true,
80186
+ showBreakdown = true,
80187
+ showForecast = true,
80188
+ showTimeline = false,
80189
+ showTopProducts = false,
80190
+ showCustomerMetrics = false,
80191
+ animate: animate4 = true,
80192
+ onStreamClick,
80193
+ onMetricClick,
80194
+ ...widgetProps
80195
+ }) {
80196
+ const [selectedTab, setSelectedTab] = React67__default.useState("overview");
80197
+ const formatNumber2 = (value) => {
80198
+ if (value % 1 !== 0) {
80199
+ return (Math.round(value * 100) / 100).toString();
80200
+ }
80201
+ return value.toString();
80202
+ };
80203
+ const getCurrencySymbol = (currency) => {
80204
+ switch (currency) {
80205
+ case "EUR":
80206
+ return "\u20AC";
80207
+ case "GBP":
80208
+ return "\xA3";
80209
+ case "USD":
80210
+ default:
80211
+ return "$";
80212
+ }
80213
+ };
80214
+ const currencySymbol = getCurrencySymbol(data.currency);
80215
+ const getCurrencyIcon = (currency) => {
80216
+ switch (currency) {
80217
+ case "EUR":
80218
+ return /* @__PURE__ */ jsx(Euro, { className: "h-5 w-5" });
80219
+ case "GBP":
80220
+ return /* @__PURE__ */ jsx(PoundSterling, { className: "h-5 w-5" });
80221
+ case "USD":
80222
+ default:
80223
+ return /* @__PURE__ */ jsx(DollarSign, { className: "h-5 w-5" });
80224
+ }
80225
+ };
80226
+ const formatCurrency = (value) => {
80227
+ return new Intl.NumberFormat("en-US", {
80228
+ style: "currency",
80229
+ currency: data.currency || "USD",
80230
+ minimumFractionDigits: 0,
80231
+ maximumFractionDigits: 0
80232
+ }).format(value);
80233
+ };
80234
+ const formatCompact = (value) => {
80235
+ if (value >= 1e6) {
80236
+ return `${currencySymbol}${formatNumber2(value / 1e6)}M`;
80237
+ } else if (value >= 1e3) {
80238
+ return `${currencySymbol}${formatNumber2(value / 1e3)}K`;
80239
+ }
80240
+ return `${currencySymbol}${formatNumber2(value)}`;
80241
+ };
80242
+ const progress = data.target ? data.total / data.target.value * 100 : 0;
80243
+ const streamColors = [
80244
+ "#3b82f6",
80245
+ // blue
80246
+ "#8b5cf6",
80247
+ // violet
80248
+ "#10b981",
80249
+ // emerald
80250
+ "#f59e0b",
80251
+ // amber
80252
+ "#ef4444",
80253
+ // red
80254
+ "#ec4899"
80255
+ // pink
80256
+ ];
80257
+ const getStreamColor = (stream, index2) => {
80258
+ if (stream.color)
80259
+ return stream.color;
80260
+ return streamColors[index2 % streamColors.length];
80261
+ };
80262
+ const renderMainRevenue = () => {
80263
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
80264
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
80265
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80266
+ /* @__PURE__ */ jsx("div", { className: cn(
80267
+ "p-2 rounded-lg bg-gradient-to-br from-primary/20 to-primary/10"
80268
+ ), children: getCurrencyIcon(data.currency) }),
80269
+ /* @__PURE__ */ jsxs("div", { children: [
80270
+ /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
80271
+ "Total Revenue ",
80272
+ data.period && `(${data.period})`
80273
+ ] }),
80274
+ /* @__PURE__ */ jsx(
80275
+ motion.p,
80276
+ {
80277
+ className: "text-3xl font-bold",
80278
+ initial: { opacity: 0, scale: 0.5 },
80279
+ animate: { opacity: 1, scale: 1 },
80280
+ transition: { duration: animate4 ? 0.3 : 0 },
80281
+ children: formatCurrency(data.total)
80282
+ }
80283
+ )
80284
+ ] })
80285
+ ] }) }),
80286
+ data.change && /* @__PURE__ */ jsxs(
80287
+ motion.div,
80288
+ {
80289
+ className: cn(
80290
+ "flex items-center gap-1",
80291
+ data.change.type === "increase" ? "text-green-600" : data.change.type === "decrease" ? "text-red-600" : "text-gray-600"
80292
+ ),
80293
+ initial: { opacity: 0, x: 20 },
80294
+ animate: { opacity: 1, x: 0 },
80295
+ transition: { delay: 0.1 },
80296
+ children: [
80297
+ data.change.type === "increase" ? /* @__PURE__ */ jsx(ArrowUpRight, { className: "h-5 w-5" }) : data.change.type === "decrease" ? /* @__PURE__ */ jsx(ArrowDownRight, { className: "h-5 w-5" }) : null,
80298
+ /* @__PURE__ */ jsxs("div", { className: "text-right", children: [
80299
+ /* @__PURE__ */ jsxs("p", { className: "text-lg font-bold", children: [
80300
+ data.change.type !== "neutral" && (data.change.type === "increase" ? "+" : "-"),
80301
+ Math.abs(data.change.value),
80302
+ "%"
80303
+ ] }),
80304
+ data.change.period && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
80305
+ "vs ",
80306
+ data.change.period
80307
+ ] })
80308
+ ] })
80309
+ ]
80310
+ }
80311
+ )
80312
+ ] }),
80313
+ data.target && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
80314
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm", children: [
80315
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: data.target.label || "Target" }),
80316
+ /* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
80317
+ formatNumber2(progress),
80318
+ "% of ",
80319
+ formatCurrency(data.target.value)
80320
+ ] })
80321
+ ] }),
80322
+ /* @__PURE__ */ jsx(MoonUIProgressPro, { value: progress, className: "h-2" })
80323
+ ] }),
80324
+ showForecast && data.forecast && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-3 bg-muted/30 rounded-lg", children: [
80325
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80326
+ /* @__PURE__ */ jsx(TrendingUp, { className: "h-4 w-4 text-muted-foreground" }),
80327
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: data.forecast.label || "Forecast" })
80328
+ ] }),
80329
+ /* @__PURE__ */ jsxs("div", { className: "text-right", children: [
80330
+ /* @__PURE__ */ jsx("p", { className: "font-semibold", children: formatCurrency(data.forecast.value) }),
80331
+ data.forecast.confidence && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
80332
+ data.forecast.confidence,
80333
+ "% confidence"
80334
+ ] })
80335
+ ] })
80336
+ ] })
80337
+ ] });
80338
+ };
80339
+ const renderStreams = () => {
80340
+ if (!data.streams || data.streams.length === 0)
80341
+ return null;
80342
+ const totalStreams = data.streams.reduce((sum, stream) => sum + stream.amount, 0);
80343
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
80344
+ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-muted-foreground", children: "Revenue Streams" }),
80345
+ data.streams.map((stream, index2) => {
80346
+ const percentage = stream.percentage ?? stream.amount / totalStreams * 100;
80347
+ const color = getStreamColor(stream, index2);
80348
+ return /* @__PURE__ */ jsxs(
80349
+ motion.div,
80350
+ {
80351
+ className: cn(
80352
+ "space-y-2",
80353
+ onStreamClick && "cursor-pointer hover:bg-muted/30 p-2 -m-2 rounded-lg transition-colors"
80354
+ ),
80355
+ onClick: () => onStreamClick?.(stream),
80356
+ initial: { opacity: 0, x: -20 },
80357
+ animate: { opacity: 1, x: 0 },
80358
+ transition: { delay: index2 * 0.05 },
80359
+ children: [
80360
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
80361
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80362
+ /* @__PURE__ */ jsx(
80363
+ "div",
80364
+ {
80365
+ className: "w-3 h-3 rounded-full",
80366
+ style: { backgroundColor: color }
80367
+ }
80368
+ ),
80369
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: stream.name }),
80370
+ stream.icon && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: stream.icon })
80371
+ ] }),
80372
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80373
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: formatCompact(stream.amount) }),
80374
+ /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "outline", className: "text-xs", children: [
80375
+ formatNumber2(percentage),
80376
+ "%"
80377
+ ] }),
80378
+ stream.change && /* @__PURE__ */ jsxs("div", { className: cn(
80379
+ "flex items-center gap-0.5 text-xs",
80380
+ stream.change.type === "increase" ? "text-green-600" : stream.change.type === "decrease" ? "text-red-600" : "text-gray-600"
80381
+ ), children: [
80382
+ stream.change.type === "increase" ? /* @__PURE__ */ jsx(ArrowUpRight, { className: "h-3 w-3" }) : stream.change.type === "decrease" ? /* @__PURE__ */ jsx(ArrowDownRight, { className: "h-3 w-3" }) : null,
80383
+ Math.abs(stream.change.value),
80384
+ "%"
80385
+ ] })
80386
+ ] })
80387
+ ] }),
80388
+ /* @__PURE__ */ jsx("div", { className: "relative h-2 bg-muted/30 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
80389
+ motion.div,
80390
+ {
80391
+ className: "h-full rounded-full",
80392
+ style: { backgroundColor: color },
80393
+ initial: { width: 0 },
80394
+ animate: { width: `${percentage}%` },
80395
+ transition: { duration: animate4 ? 0.5 : 0, delay: index2 * 0.05 }
80396
+ }
80397
+ ) })
80398
+ ]
80399
+ },
80400
+ stream.id
80401
+ );
80402
+ })
80403
+ ] });
80404
+ };
80405
+ const renderBreakdown = () => {
80406
+ if (!data.breakdown)
80407
+ return null;
80408
+ const total = data.breakdown.recurring + data.breakdown.oneTime + (data.breakdown.refunds || 0);
80409
+ const recurringPercentage = data.breakdown.recurring / total * 100;
80410
+ const oneTimePercentage = data.breakdown.oneTime / total * 100;
80411
+ const refundsPercentage = data.breakdown.refunds ? data.breakdown.refunds / total * 100 : 0;
80412
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
80413
+ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-muted-foreground", children: "Revenue Breakdown" }),
80414
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
80415
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
80416
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80417
+ /* @__PURE__ */ jsx(Repeat, { className: "h-4 w-4 text-blue-600" }),
80418
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: "Recurring" })
80419
+ ] }),
80420
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80421
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: formatCompact(data.breakdown.recurring) }),
80422
+ /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "outline", className: "text-xs", children: [
80423
+ formatNumber2(recurringPercentage),
80424
+ "%"
80425
+ ] })
80426
+ ] })
80427
+ ] }),
80428
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
80429
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80430
+ /* @__PURE__ */ jsx(CreditCard, { className: "h-4 w-4 text-green-600" }),
80431
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: "One-time" })
80432
+ ] }),
80433
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80434
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: formatCompact(data.breakdown.oneTime) }),
80435
+ /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "outline", className: "text-xs", children: [
80436
+ formatNumber2(oneTimePercentage),
80437
+ "%"
80438
+ ] })
80439
+ ] })
80440
+ ] }),
80441
+ data.breakdown.refunds && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
80442
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80443
+ /* @__PURE__ */ jsx(ArrowDownRight, { className: "h-4 w-4 text-red-600" }),
80444
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: "Refunds" })
80445
+ ] }),
80446
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80447
+ /* @__PURE__ */ jsxs("span", { className: "text-sm font-semibold text-red-600", children: [
80448
+ "-",
80449
+ formatCompact(Math.abs(data.breakdown.refunds))
80450
+ ] }),
80451
+ /* @__PURE__ */ jsxs(MoonUIBadgePro, { variant: "destructive", className: "text-xs", children: [
80452
+ formatNumber2(refundsPercentage),
80453
+ "%"
80454
+ ] })
80455
+ ] })
80456
+ ] })
80457
+ ] }),
80458
+ /* @__PURE__ */ jsxs("div", { className: "h-3 flex rounded-full overflow-hidden", children: [
80459
+ /* @__PURE__ */ jsx(
80460
+ motion.div,
80461
+ {
80462
+ className: "bg-blue-600",
80463
+ initial: { width: 0 },
80464
+ animate: { width: `${recurringPercentage}%` },
80465
+ transition: { duration: animate4 ? 0.5 : 0 }
80466
+ }
80467
+ ),
80468
+ /* @__PURE__ */ jsx(
80469
+ motion.div,
80470
+ {
80471
+ className: "bg-green-600",
80472
+ initial: { width: 0 },
80473
+ animate: { width: `${oneTimePercentage}%` },
80474
+ transition: { duration: animate4 ? 0.5 : 0, delay: 0.1 }
80475
+ }
80476
+ ),
80477
+ data.breakdown.refunds && /* @__PURE__ */ jsx(
80478
+ motion.div,
80479
+ {
80480
+ className: "bg-red-600",
80481
+ initial: { width: 0 },
80482
+ animate: { width: `${refundsPercentage}%` },
80483
+ transition: { duration: animate4 ? 0.5 : 0, delay: 0.2 }
80484
+ }
80485
+ )
80486
+ ] })
80487
+ ] });
80488
+ };
80489
+ const renderContent = () => {
80490
+ switch (variant) {
80491
+ case "compact":
80492
+ return /* @__PURE__ */ jsx("div", { className: "space-y-4", children: renderMainRevenue() });
80493
+ case "detailed":
80494
+ return /* @__PURE__ */ jsxs(Tabs, { value: selectedTab, onValueChange: setSelectedTab, children: [
80495
+ /* @__PURE__ */ jsxs(TabsList, { className: "grid grid-cols-3 w-full", children: [
80496
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "overview", children: "Overview" }),
80497
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "streams", children: "Streams" }),
80498
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "metrics", children: "Metrics" })
80499
+ ] }),
80500
+ /* @__PURE__ */ jsxs(TabsContent, { value: "overview", className: "space-y-4", children: [
80501
+ renderMainRevenue(),
80502
+ showBreakdown && renderBreakdown()
80503
+ ] }),
80504
+ /* @__PURE__ */ jsx(TabsContent, { value: "streams", className: "space-y-4", children: renderStreams() }),
80505
+ /* @__PURE__ */ jsx(TabsContent, { value: "metrics", className: "space-y-4", children: /* @__PURE__ */ jsx("div", { className: "text-center py-8 text-muted-foreground", children: /* @__PURE__ */ jsx("p", { children: "Metrics coming soon" }) }) })
80506
+ ] });
80507
+ case "dashboard":
80508
+ return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
80509
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
80510
+ renderMainRevenue(),
80511
+ showBreakdown && renderBreakdown()
80512
+ ] }),
80513
+ /* @__PURE__ */ jsx("div", { className: "space-y-4", children: showStreams && renderStreams() })
80514
+ ] });
80515
+ case "default":
80516
+ default:
80517
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
80518
+ renderMainRevenue(),
80519
+ showStreams && renderStreams(),
80520
+ showBreakdown && renderBreakdown()
80521
+ ] });
80522
+ }
80523
+ };
80524
+ return /* @__PURE__ */ jsx(
80525
+ WidgetBase,
80526
+ {
80527
+ title,
80528
+ ...widgetProps,
80529
+ children: renderContent()
80530
+ }
80531
+ );
80532
+ }
80533
+ function ServerMonitorWidget({
80534
+ data,
80535
+ title,
80536
+ variant = "default",
80537
+ showMetrics = true,
80538
+ showAlerts = true,
80539
+ showServices = false,
80540
+ showHistory = false,
80541
+ showUptime = true,
80542
+ updateInterval = 30,
80543
+ animate: animate4 = true,
80544
+ onServerClick,
80545
+ onAlertClick,
80546
+ ...widgetProps
80547
+ }) {
80548
+ const servers = Array.isArray(data) ? data : [data];
80549
+ const [selectedTab, setSelectedTab] = React67__default.useState("overview");
80550
+ const [liveData, setLiveData] = React67__default.useState(servers);
80551
+ const formatNumber2 = (value) => {
80552
+ if (typeof value === "string")
80553
+ return value;
80554
+ if (value % 1 !== 0) {
80555
+ return (Math.round(value * 100) / 100).toString();
80556
+ }
80557
+ return value.toString();
80558
+ };
80559
+ React67__default.useEffect(() => {
80560
+ if (!animate4)
80561
+ return;
80562
+ const interval = setInterval(() => {
80563
+ setLiveData(
80564
+ (prevData) => prevData.map((server) => ({
80565
+ ...server,
80566
+ lastUpdated: /* @__PURE__ */ new Date(),
80567
+ metrics: {
80568
+ ...server.metrics,
80569
+ cpu: server.metrics.cpu ? {
80570
+ ...server.metrics.cpu,
80571
+ value: Math.min(100, Math.max(0, server.metrics.cpu.value + (Math.random() - 0.5) * 10))
80572
+ } : void 0,
80573
+ memory: server.metrics.memory ? {
80574
+ ...server.metrics.memory,
80575
+ value: Math.min(100, Math.max(0, server.metrics.memory.value + (Math.random() - 0.5) * 5))
80576
+ } : void 0
80577
+ }
80578
+ }))
80579
+ );
80580
+ }, updateInterval * 1e3);
80581
+ return () => clearInterval(interval);
80582
+ }, [updateInterval, animate4]);
80583
+ const getServerIcon = (type) => {
80584
+ switch (type) {
80585
+ case "database":
80586
+ return /* @__PURE__ */ jsx(Database, { className: "h-5 w-5" });
80587
+ case "cache":
80588
+ return /* @__PURE__ */ jsx(MemoryStick, { className: "h-5 w-5" });
80589
+ case "storage":
80590
+ return /* @__PURE__ */ jsx(HardDrive, { className: "h-5 w-5" });
80591
+ case "compute":
80592
+ return /* @__PURE__ */ jsx(Cpu, { className: "h-5 w-5" });
80593
+ case "web":
80594
+ default:
80595
+ return /* @__PURE__ */ jsx(Server, { className: "h-5 w-5" });
80596
+ }
80597
+ };
80598
+ const getMetricStatus = (metric) => {
80599
+ if (metric.status)
80600
+ return metric.status;
80601
+ const value = metric.value;
80602
+ const max2 = metric.max || 100;
80603
+ const percentage = value / max2 * 100;
80604
+ if (percentage >= 90)
80605
+ return "critical";
80606
+ if (percentage >= 75)
80607
+ return "warning";
80608
+ return "healthy";
80609
+ };
80610
+ const renderMetricBar = (metric, icon) => {
80611
+ const value = metric.value;
80612
+ const max2 = metric.max || 100;
80613
+ const percentage = value / max2 * 100;
80614
+ const status = getMetricStatus(metric);
80615
+ const statusColors = {
80616
+ healthy: "bg-green-600",
80617
+ warning: "bg-yellow-600",
80618
+ critical: "bg-red-600",
80619
+ offline: "bg-gray-600"
80620
+ };
80621
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
80622
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
80623
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80624
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: icon }),
80625
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: metric.label }),
80626
+ metric.trend && /* @__PURE__ */ jsx("div", { className: cn(
80627
+ "text-xs",
80628
+ metric.trend === "up" ? "text-green-600" : metric.trend === "down" ? "text-red-600" : "text-gray-600"
80629
+ ), children: metric.trend === "up" ? /* @__PURE__ */ jsx(TrendingUp, { className: "h-3 w-3" }) : metric.trend === "down" ? /* @__PURE__ */ jsx(TrendingDown, { className: "h-3 w-3" }) : null })
80630
+ ] }),
80631
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80632
+ /* @__PURE__ */ jsxs("span", { className: "text-sm font-semibold", children: [
80633
+ formatNumber2(value),
80634
+ metric.unit || "%"
80635
+ ] }),
80636
+ max2 && max2 !== 100 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
80637
+ "/ ",
80638
+ formatNumber2(max2),
80639
+ metric.unit
80640
+ ] })
80641
+ ] })
80642
+ ] }),
80643
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
80644
+ /* @__PURE__ */ jsx(
80645
+ MoonUIProgressPro,
80646
+ {
80647
+ value: percentage,
80648
+ className: "h-2"
80649
+ }
80650
+ ),
80651
+ /* @__PURE__ */ jsx(
80652
+ motion.div,
80653
+ {
80654
+ className: cn(
80655
+ "absolute top-0 left-0 h-2 rounded-full",
80656
+ statusColors[status]
80657
+ ),
80658
+ initial: { width: 0 },
80659
+ animate: { width: `${percentage}%` },
80660
+ transition: { duration: animate4 ? 0.5 : 0 }
80661
+ }
80662
+ )
80663
+ ] }),
80664
+ showHistory && metric.history && metric.history.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex items-end gap-0.5 h-8", children: metric.history.slice(-20).map((val, idx) => /* @__PURE__ */ jsx(
80665
+ motion.div,
80666
+ {
80667
+ className: cn(
80668
+ "flex-1 rounded-t",
80669
+ val > 75 ? "bg-red-600/50" : val > 50 ? "bg-yellow-600/50" : "bg-green-600/50"
80670
+ ),
80671
+ initial: { height: 0 },
80672
+ animate: { height: `${val / 100 * 32}px` },
80673
+ transition: { delay: idx * 0.01 }
80674
+ },
80675
+ idx
80676
+ )) })
80677
+ ] });
80678
+ };
80679
+ const renderServerCard = (server) => {
80680
+ const isOnline = server.status === "online";
80681
+ const metrics = server.metrics;
80682
+ return /* @__PURE__ */ jsxs(
80683
+ MoonUICardPro,
80684
+ {
80685
+ className: cn(
80686
+ "p-4 transition-all",
80687
+ onServerClick && "cursor-pointer hover:shadow-lg",
80688
+ !isOnline && "opacity-75"
80689
+ ),
80690
+ onClick: () => onServerClick?.(server),
80691
+ children: [
80692
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between mb-4", children: [
80693
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
80694
+ /* @__PURE__ */ jsx("div", { className: cn(
80695
+ "p-2 rounded-lg bg-gradient-to-br from-primary/20 to-primary/10"
80696
+ ), children: getServerIcon(server.type) }),
80697
+ /* @__PURE__ */ jsxs("div", { children: [
80698
+ /* @__PURE__ */ jsx("h4", { className: "font-semibold", children: server.name }),
80699
+ server.location && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground flex items-center gap-1", children: [
80700
+ /* @__PURE__ */ jsx(Globe, { className: "h-3 w-3" }),
80701
+ server.location
80702
+ ] })
80703
+ ] })
80704
+ ] }),
80705
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80706
+ /* @__PURE__ */ jsx(
80707
+ MoonUIBadgePro,
80708
+ {
80709
+ variant: isOnline ? "secondary" : "destructive",
80710
+ leftIcon: isOnline ? /* @__PURE__ */ jsx(CheckCircle, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(XCircle, { className: "h-3 w-3" }),
80711
+ children: server.status
80712
+ }
80713
+ ),
80714
+ isOnline ? /* @__PURE__ */ jsx(Wifi, { className: "h-4 w-4 text-green-600" }) : /* @__PURE__ */ jsx(WifiOff, { className: "h-4 w-4 text-red-600" })
80715
+ ] })
80716
+ ] }),
80717
+ showUptime && server.uptime !== void 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
80718
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm mb-1", children: [
80719
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Uptime" }),
80720
+ /* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
80721
+ formatNumber2(server.uptime),
80722
+ "%"
80723
+ ] })
80724
+ ] }),
80725
+ /* @__PURE__ */ jsx(MoonUIProgressPro, { value: server.uptime, className: "h-1" })
80726
+ ] }),
80727
+ showMetrics && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
80728
+ metrics.cpu && renderMetricBar(metrics.cpu, /* @__PURE__ */ jsx(Cpu, { className: "h-4 w-4" })),
80729
+ metrics.memory && renderMetricBar(metrics.memory, /* @__PURE__ */ jsx(MemoryStick, { className: "h-4 w-4" })),
80730
+ metrics.disk && renderMetricBar(metrics.disk, /* @__PURE__ */ jsx(HardDrive, { className: "h-4 w-4" })),
80731
+ metrics.network && renderMetricBar(metrics.network, /* @__PURE__ */ jsx(Network, { className: "h-4 w-4" })),
80732
+ metrics.temperature && renderMetricBar(metrics.temperature, /* @__PURE__ */ jsx(Thermometer, { className: "h-4 w-4" }))
80733
+ ] }),
80734
+ metrics.requests || metrics.responseTime || metrics.errorRate ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-2 mt-4 pt-4 border-t", children: [
80735
+ metrics.requests && /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
80736
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Requests" }),
80737
+ /* @__PURE__ */ jsxs("p", { className: "text-sm font-semibold", children: [
80738
+ formatNumber2(metrics.requests.value),
80739
+ "/s"
80740
+ ] })
80741
+ ] }),
80742
+ metrics.responseTime && /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
80743
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Response" }),
80744
+ /* @__PURE__ */ jsxs("p", { className: "text-sm font-semibold", children: [
80745
+ formatNumber2(metrics.responseTime.value),
80746
+ "ms"
80747
+ ] })
80748
+ ] }),
80749
+ metrics.errorRate && /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
80750
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Errors" }),
80751
+ /* @__PURE__ */ jsxs("p", { className: "text-sm font-semibold", children: [
80752
+ formatNumber2(metrics.errorRate.value),
80753
+ "%"
80754
+ ] })
80755
+ ] })
80756
+ ] }) : null,
80757
+ showAlerts && server.alerts && server.alerts.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-4 pt-4 border-t", children: [
80758
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
80759
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Recent Alerts" }),
80760
+ /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "outline", className: "text-xs", children: server.alerts.length })
80761
+ ] }),
80762
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: server.alerts.slice(0, 3).map((alert) => /* @__PURE__ */ jsxs(
80763
+ "div",
80764
+ {
80765
+ className: cn(
80766
+ "text-xs p-2 rounded flex items-start gap-2",
80767
+ alert.type === "error" ? "bg-red-100 dark:bg-red-900/20" : alert.type === "warning" ? "bg-yellow-100 dark:bg-yellow-900/20" : "bg-blue-100 dark:bg-blue-900/20",
80768
+ onAlertClick && "cursor-pointer hover:opacity-80"
80769
+ ),
80770
+ onClick: (e) => {
80771
+ e.stopPropagation();
80772
+ onAlertClick?.(alert);
80773
+ },
80774
+ children: [
80775
+ alert.type === "error" ? /* @__PURE__ */ jsx(XCircle, { className: "h-3 w-3 text-red-600 flex-shrink-0" }) : alert.type === "warning" ? /* @__PURE__ */ jsx(AlertTriangle, { className: "h-3 w-3 text-yellow-600 flex-shrink-0" }) : /* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3 text-blue-600 flex-shrink-0" }),
80776
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: alert.message })
80777
+ ]
80778
+ },
80779
+ alert.id
80780
+ )) })
80781
+ ] }),
80782
+ server.lastUpdated && /* @__PURE__ */ jsxs("div", { className: "mt-4 pt-4 border-t flex items-center justify-between text-xs text-muted-foreground", children: [
80783
+ /* @__PURE__ */ jsx("span", { children: "Last updated" }),
80784
+ /* @__PURE__ */ jsx("span", { children: new Date(server.lastUpdated).toLocaleTimeString() })
80785
+ ] })
80786
+ ]
80787
+ }
80788
+ );
80789
+ };
80790
+ const renderCompactView = () => {
80791
+ return /* @__PURE__ */ jsx("div", { className: "space-y-2", children: liveData.map((server, index2) => /* @__PURE__ */ jsxs(
80792
+ motion.div,
80793
+ {
80794
+ className: cn(
80795
+ "flex items-center justify-between p-3 rounded-lg border",
80796
+ onServerClick && "cursor-pointer hover:bg-muted/30 transition-colors"
80797
+ ),
80798
+ onClick: () => onServerClick?.(server),
80799
+ initial: { opacity: 0, x: -20 },
80800
+ animate: { opacity: 1, x: 0 },
80801
+ transition: { delay: index2 * 0.05 },
80802
+ children: [
80803
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
80804
+ getServerIcon(server.type),
80805
+ /* @__PURE__ */ jsxs("div", { children: [
80806
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
80807
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: server.name }),
80808
+ /* @__PURE__ */ jsx(
80809
+ MoonUIBadgePro,
80810
+ {
80811
+ variant: server.status === "online" ? "secondary" : "destructive",
80812
+ className: "text-xs",
80813
+ leftIcon: server.status === "online" ? /* @__PURE__ */ jsx(CheckCircle, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(XCircle, { className: "h-3 w-3" }),
80814
+ children: server.status
80815
+ }
80816
+ )
80817
+ ] }),
80818
+ server.location && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: server.location })
80819
+ ] })
80820
+ ] }),
80821
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
80822
+ server.metrics.cpu && /* @__PURE__ */ jsxs("div", { className: "text-right", children: [
80823
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "CPU" }),
80824
+ /* @__PURE__ */ jsxs("p", { className: "text-sm font-semibold", children: [
80825
+ formatNumber2(server.metrics.cpu.value),
80826
+ "%"
80827
+ ] })
80828
+ ] }),
80829
+ server.metrics.memory && /* @__PURE__ */ jsxs("div", { className: "text-right", children: [
80830
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Memory" }),
80831
+ /* @__PURE__ */ jsxs("p", { className: "text-sm font-semibold", children: [
80832
+ formatNumber2(server.metrics.memory.value),
80833
+ server.metrics.memory.unit || "%"
80834
+ ] })
80835
+ ] }),
80836
+ showUptime && server.uptime !== void 0 && /* @__PURE__ */ jsxs("div", { className: "text-right", children: [
80837
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Uptime" }),
80838
+ /* @__PURE__ */ jsxs("p", { className: "text-sm font-semibold", children: [
80839
+ formatNumber2(server.uptime),
80840
+ "%"
80841
+ ] })
80842
+ ] })
80843
+ ] })
80844
+ ]
80845
+ },
80846
+ server.id
80847
+ )) });
80848
+ };
80849
+ const renderContent = () => {
80850
+ switch (variant) {
80851
+ case "compact":
80852
+ return renderCompactView();
80853
+ case "grid":
80854
+ return /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: liveData.map((server) => /* @__PURE__ */ jsx("div", { children: renderServerCard(server) }, server.id)) });
80855
+ case "detailed":
80856
+ return /* @__PURE__ */ jsxs(Tabs, { value: selectedTab, onValueChange: setSelectedTab, children: [
80857
+ /* @__PURE__ */ jsxs(TabsList, { className: "grid grid-cols-3 w-full", children: [
80858
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "overview", children: "Overview" }),
80859
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "metrics", children: "Metrics" }),
80860
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "alerts", children: "Alerts" })
80861
+ ] }),
80862
+ liveData.map((server) => /* @__PURE__ */ jsxs("div", { children: [
80863
+ /* @__PURE__ */ jsx(TabsContent, { value: "overview", children: renderServerCard(server) }),
80864
+ /* @__PURE__ */ jsx(TabsContent, { value: "metrics", className: "space-y-4", children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-4", children: Object.entries(server.metrics).map(([key, metric]) => {
80865
+ if (!metric || key === "custom" || Array.isArray(metric))
80866
+ return null;
80867
+ return /* @__PURE__ */ jsx(MoonUICardPro, { className: "p-4", children: renderMetricBar(
80868
+ metric,
80869
+ key === "cpu" ? /* @__PURE__ */ jsx(Cpu, { className: "h-4 w-4" }) : key === "memory" ? /* @__PURE__ */ jsx(MemoryStick, { className: "h-4 w-4" }) : key === "disk" ? /* @__PURE__ */ jsx(HardDrive, { className: "h-4 w-4" }) : key === "network" ? /* @__PURE__ */ jsx(Network, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Activity, { className: "h-4 w-4" })
80870
+ ) }, key);
80871
+ }) }) }),
80872
+ /* @__PURE__ */ jsx(TabsContent, { value: "alerts", children: server.alerts && server.alerts.length > 0 ? /* @__PURE__ */ jsx("div", { className: "space-y-2", children: server.alerts.map((alert) => /* @__PURE__ */ jsxs(
80873
+ "div",
80874
+ {
80875
+ className: cn(
80876
+ "p-3 rounded-lg flex items-start gap-3",
80877
+ alert.type === "error" ? "bg-red-100 dark:bg-red-900/20" : alert.type === "warning" ? "bg-yellow-100 dark:bg-yellow-900/20" : "bg-blue-100 dark:bg-blue-900/20",
80878
+ onAlertClick && "cursor-pointer hover:opacity-80"
80879
+ ),
80880
+ onClick: () => onAlertClick?.(alert),
80881
+ children: [
80882
+ alert.type === "error" ? /* @__PURE__ */ jsx(XCircle, { className: "h-5 w-5 text-red-600" }) : alert.type === "warning" ? /* @__PURE__ */ jsx(AlertTriangle, { className: "h-5 w-5 text-yellow-600" }) : /* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5 text-blue-600" }),
80883
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
80884
+ /* @__PURE__ */ jsx("p", { className: "font-medium", children: alert.message }),
80885
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: new Date(alert.timestamp).toLocaleString() })
80886
+ ] })
80887
+ ]
80888
+ },
80889
+ alert.id
80890
+ )) }) : /* @__PURE__ */ jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
80891
+ /* @__PURE__ */ jsx(CheckCircle, { className: "h-12 w-12 mx-auto mb-2 opacity-50" }),
80892
+ /* @__PURE__ */ jsx("p", { children: "No active alerts" })
80893
+ ] }) })
80894
+ ] }, server.id))
80895
+ ] });
80896
+ case "default":
80897
+ default:
80898
+ return /* @__PURE__ */ jsx("div", { className: "space-y-4", children: liveData.map((server) => /* @__PURE__ */ jsx("div", { children: renderServerCard(server) }, server.id)) });
80899
+ }
80900
+ };
80901
+ return /* @__PURE__ */ jsx(
80902
+ WidgetBase,
80903
+ {
80904
+ title,
80905
+ ...widgetProps,
80906
+ children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: renderContent() })
80907
+ }
80908
+ );
80909
+ }
78966
80910
 
78967
- export { MoonUIAccordionPro as Accordion, MoonUIAccordionContentPro as AccordionContent, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, Calendar3 as AdvancedCalendar, AdvancedChart, AdvancedForms, MoonUIAlertPro as Alert, MoonUIAlertDescriptionPro as AlertDescription, MoonUIAlertTitlePro as AlertTitle, MoonUIAspectRatioPro as AspectRatio, MoonUIAvatarPro as Avatar, MoonUIAvatarFallbackPro as AvatarFallback, MoonUIAvatarImagePro as AvatarImage, MoonUIBadgePro as Badge, MoonUIBreadcrumbPro as Breadcrumb, MoonUIBreadcrumbEllipsisPro as BreadcrumbEllipsis, MoonUIBreadcrumbItemPro as BreadcrumbItem, MoonUIBreadcrumbLinkPro as BreadcrumbLink, MoonUIBreadcrumbListPro as BreadcrumbList, MoonUIBreadcrumbPagePro as BreadcrumbPage, MoonUIBreadcrumbSeparatorPro as BreadcrumbSeparator, MoonUIButtonPro as Button, Calendar, Calendar3 as CalendarPro, MoonUICardPro as Card, MoonUICardContentPro as CardContent, MoonUICardDescriptionPro as CardDescription, MoonUICardFooterPro as CardFooter, MoonUICardHeaderPro as CardHeader, MoonUICardTitlePro as CardTitle, MoonUICheckboxPro as Checkbox, ClaudeProvider, MoonUICollapsiblePro as Collapsible, MoonUICollapsibleContentPro as CollapsibleContent, MoonUICollapsibleTriggerPro as CollapsibleTrigger, MoonUIColorPickerPro as ColorPicker, MoonUICommandPro as Command, MoonUICommandDialogPro as CommandDialog, MoonUICommandEmptyPro as CommandEmpty, MoonUICommandGroupPro as CommandGroup, MoonUICommandInputPro as CommandInput, MoonUICommandItemPro as CommandItem, MoonUICommandListPro as CommandList, MoonUICommandSeparatorPro as CommandSeparator, MoonUICommandShortcutPro as CommandShortcut, Dashboard, DataTable, MoonUIDialogPro as Dialog, MoonUIDialogClosePro as DialogClose, MoonUIDialogContentPro as DialogContent, MoonUIDialogDescriptionPro as DialogDescription, MoonUIDialogFooterPro as DialogFooter, MoonUIDialogHeaderPro as DialogHeader, MoonUIDialogTitlePro as DialogTitle, MoonUIDialogTriggerPro as DialogTrigger, DraggableList, MoonUIDropdownMenuPro as DropdownMenu, MoonUIDropdownMenuCheckboxItemPro as DropdownMenuCheckboxItem, MoonUIDropdownMenuContentPro as DropdownMenuContent, MoonUIDropdownMenuGroupPro as DropdownMenuGroup, MoonUIDropdownMenuItemPro as DropdownMenuItem, MoonUIDropdownMenuLabelPro as DropdownMenuLabel, MoonUIDropdownMenuPortalPro as DropdownMenuPortal, MoonUIDropdownMenuRadioGroupPro as DropdownMenuRadioGroup, MoonUIDropdownMenuRadioItemPro as DropdownMenuRadioItem, MoonUIDropdownMenuSeparatorPro as DropdownMenuSeparator, MoonUIDropdownMenuShortcutPro as DropdownMenuShortcut, MoonUIDropdownMenuSubPro as DropdownMenuSub, MoonUIDropdownMenuSubContentPro as DropdownMenuSubContent, MoonUIDropdownMenuSubTriggerPro as DropdownMenuSubTrigger, MoonUIDropdownMenuTriggerPro as DropdownMenuTrigger, ErrorBoundary, FloatingActionButton, FormWizard, FormWizardNavigation, FormWizardProgress, FormWizardStep, MoonUIGalleryItemPro as GalleryItem, GeminiProvider, GestureDrawer, GitHubStars, HealthCheck, HoverCard2 as HoverCard, HoverCard3D, HoverCardContent2 as HoverCardContent, HoverCardTrigger2 as HoverCardTrigger, MoonUIInputPro as Input, Kanban, LANGUAGE_COLORS, MoonUILabelPro as Label, LazyComponent, LazyImage, LazyList, LightboxContent, LightboxProvider, LightboxTrigger, MagneticButton, MoonUIMediaGalleryPro as MediaGallery, MemoryAnalytics, MemoryEfficientData, MoonUIAccordionContentPro, MoonUIAccordionItemPro, MoonUIAccordionPro, MoonUIAccordionTriggerPro, MoonUIAdvancedChartPro, MoonUIAlertDescriptionPro, MoonUIAlertPro, MoonUIAlertTitlePro, MoonUIAnimatedButtonPro, MoonUIAspectRatioPro, MoonUIAsyncAvatarPro, MoonUIAvatarFallbackPro, MoonUIAvatarGroupPro2 as MoonUIAvatarGroupPro, MoonUIAvatarImagePro, MoonUIAvatarPro2 as MoonUIAvatarPro, MoonUIBadgePro, MoonUIBreadcrumbEllipsisPro, MoonUIBreadcrumbItemPro, MoonUIBreadcrumbLinkPro, MoonUIBreadcrumbListPro, MoonUIBreadcrumbPagePro, MoonUIBreadcrumbPro, MoonUIBreadcrumbSeparatorPro, MoonUIButtonPro, MoonUICardContentPro, MoonUICardDescriptionPro, MoonUICardFooterPro, MoonUICardHeaderPro, MoonUICardPro, MoonUICardTitlePro, MoonUICheckboxPro, MoonUICollapsibleContentPro, MoonUICollapsiblePro, MoonUICollapsibleTriggerPro, MoonUIColorPickerPro, MoonUICommandDialogPro, MoonUICommandEmptyPro, MoonUICommandGroupPro, MoonUICommandInputPro, MoonUICommandItemPro, MoonUICommandListPro, MoonUICommandPro, MoonUICommandSeparatorPro, MoonUICommandShortcutPro, MoonUICreditCardInputPro, MoonUIDashboardPro, MoonUIDataTable, MoonUIDataTablePro, MoonUIDialogClosePro, MoonUIDialogContentPro, MoonUIDialogDescriptionPro, MoonUIDialogFooterPro, MoonUIDialogHeaderPro, MoonUIDialogPro, MoonUIDialogTitlePro, MoonUIDialogTriggerPro, DraggableList as MoonUIDraggableListPro, MoonUIDropdownMenuCheckboxItemPro, MoonUIDropdownMenuContentPro, MoonUIDropdownMenuGroupPro, MoonUIDropdownMenuItemPro, MoonUIDropdownMenuLabelPro, MoonUIDropdownMenuPortalPro, MoonUIDropdownMenuPro, MoonUIDropdownMenuRadioGroupPro, MoonUIDropdownMenuRadioItemPro, MoonUIDropdownMenuSeparatorPro, MoonUIDropdownMenuShortcutPro, MoonUIDropdownMenuSubContentPro, MoonUIDropdownMenuSubPro, MoonUIDropdownMenuSubTriggerPro, MoonUIDropdownMenuTriggerPro, MoonUIFileUploadPro, MoonUIFormWizardPro, MoonUIGalleryItemPro, MoonUIGestureDrawerPro, MoonUIInputPro, MoonUILabelPro, LightboxContent as MoonUILightboxContentPro, SimpleLightbox as MoonUILightboxPro, LightboxProvider as MoonUILightboxProviderPro, LightboxTrigger as MoonUILightboxTriggerPro, MoonUIMediaGalleryPro, MoonUIMemoryEfficientDataPro, MoonUINavbarPro, MoonUIPaginationContentPro, MoonUIPaginationEllipsisPro, MoonUIPaginationItemPro, MoonUIPaginationLinkPro, MoonUIPaginationNextPro, MoonUIPaginationPreviousPro, MoonUIPaginationPro, MoonUIPhoneNumberInputPro, MoonUIPhoneNumberInputSimple, MoonUIPopoverContentPro, MoonUIPopoverPro, MoonUIPopoverTriggerPro, MoonUIProgressPro, MoonUIQuizFormPro2 as MoonUIQuizFormPro, MoonUIRadioGroupContextPro, MoonUIRadioGroupItemPro, MoonUIRadioGroupPro, MoonUIRadioItemWithLabelPro, MoonUIRadioLabelPro, MoonUISelectContentPro, MoonUISelectGroupPro, MoonUISelectItemPro, MoonUISelectLabelPro, MoonUISelectPro, MoonUISelectSeparatorPro, MoonUISelectTriggerPro, MoonUISelectValuePro, MoonUISelectableVirtualListPro, MoonUISeparatorPro, MoonUISidebarPro, MoonUISkeletonPro, MoonUISliderPro, MoonUISwipeableCardPro, MoonUISwitchPro, MoonUITableBodyPro, MoonUITableCaptionPro, MoonUITableCellPro, MoonUITableFooterPro, MoonUITableHeadPro, MoonUITableHeaderPro, MoonUITablePro, MoonUITableRowPro, MoonUITabsContentPro, MoonUITabsPro as MoonUITabsEnhanced, MoonUITabsListPro, MoonUITabsPro, MoonUITabsTriggerPro, MoonUITextareaPro, MoonUITimelinePro, MoonUIToastPro, MoonUITogglePro, MoonUITooltipContentPro, MoonUITooltipPro, MoonUITooltipProviderPro, MoonUITooltipTriggerPro, MoonUIVirtualListPro, MoonUIalertVariantsPro, MoonUIaspectRatioVariantsPro, MoonUIbreadcrumbVariantsPro, collapsibleContentVariants as MoonUIcollapsibleContentVariantsPro, collapsibleTriggerVariants as MoonUIcollapsibleTriggerVariantsPro, MoonUIradioGroupItemVariantsPro, MoonUItableVariantsPro, MoonUItoggleVariantsPro, Navbar, NavigationMenu2 as NavigationMenu, NavigationMenuContent2 as NavigationMenuContent, NavigationMenuIndicator2 as NavigationMenuIndicator, NavigationMenuItem2 as NavigationMenuItem, NavigationMenuLink2 as NavigationMenuLink, NavigationMenuList2 as NavigationMenuList, NavigationMenuTrigger2 as NavigationMenuTrigger, NavigationMenuViewport2 as NavigationMenuViewport, OpenAIProvider, OptimizedImage, MoonUIPaginationPro as Pagination, MoonUIPaginationContentPro as PaginationContent, MoonUIPaginationEllipsisPro as PaginationEllipsis, MoonUIPaginationItemPro as PaginationItem, MoonUIPaginationLinkPro as PaginationLink, MoonUIPaginationNextPro as PaginationNext, MoonUIPaginationPreviousPro as PaginationPrevious, PerformanceDebugger, PerformanceMonitor, PhoneNumberInput, PinchZoom, MoonUIPopoverPro as Popover, MoonUIPopoverContentPro as PopoverContent, MoonUIPopoverTriggerPro as PopoverTrigger, MoonUIProgressPro as Progress, QuizForm, MoonUIRadioGroupPro as RadioGroup, MoonUIRadioGroupContextPro as RadioGroupContext, MoonUIRadioGroupItemPro as RadioGroupItem, MoonUIRadioItemWithLabelPro as RadioItemWithLabel, MoonUIRadioLabelPro as RadioLabel, RealTimePerformanceMonitor, RichTextEditor, ScrollArea, ScrollBar, MoonUISelectPro as Select, MoonUISelectContentPro as SelectContent, MoonUISelectGroupPro as SelectGroup, MoonUISelectItemPro as SelectItem, MoonUISelectLabelPro as SelectLabel, MoonUISelectSeparatorPro as SelectSeparator, MoonUISelectTriggerPro as SelectTrigger, MoonUISelectValuePro as SelectValue, SelectableVirtualList, MoonUISeparatorPro as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SimpleLightbox, MoonUISkeletonPro as Skeleton, MoonUISliderPro as Slider, SpotlightCard, SwipeableCard, MoonUISwitchPro as Switch, MoonUITablePro as Table, MoonUITableBodyPro as TableBody, MoonUITableCaptionPro as TableCaption, MoonUITableCellPro as TableCell, MoonUITableFooterPro as TableFooter, MoonUITableHeadPro as TableHead, MoonUITableHeaderPro as TableHeader, MoonUITableRowPro as TableRow, Tabs, TabsContent, TabsList, TabsTrigger, MoonUITextareaPro as Textarea, Timeline, MoonUIToastPro as Toast, MoonUITogglePro as Toggle, MoonUITooltipPro as Tooltip, MoonUITooltipContentPro as TooltipContent, MoonUITooltipProviderPro as TooltipProvider, MoonUITooltipTriggerPro as TooltipTrigger, VirtualList, MoonUIalertVariantsPro as alertVariants, MoonUIaspectRatioVariantsPro as aspectRatioVariants, moonUIBadgeVariantsPro as badgeVariants, MoonUIbreadcrumbVariantsPro as breadcrumbVariants, moonUIButtonProVariants as buttonVariants, cn, collapsibleContentVariants, collapsibleTriggerVariants, commandVariantsPro, createAIProvider, galleryItemVariants, galleryVariants, getExpandableColumn, hoverCard3DVariants, moonUIAnimatedButtonProVariants, badgeVariants as moonUIAvatarBadgeVariants, avatarVariants as moonUIAvatarProVariants, statusVariants as moonUIAvatarStatusVariants, moonUIBadgeVariantsPro, moonUIButtonProVariants, gestureDrawerVariants as moonUIGestureDrawerProVariants, moonUISeparatorVariantsPro, navigationMenuTriggerStyle, countries as phoneCountries, MoonUIradioGroupItemVariantsPro as radioGroupItemVariants, moonUISeparatorVariantsPro as separatorVariants, MoonUItableVariantsPro as tableVariants, MoonUItoggleVariantsPro as toggleVariants, useAccordionAnalytics, useCollapsibleAnalytics, useExpandableRows, useFormWizard, useStreamingData, useVirtualList };
80911
+ export { MoonUIAccordionPro as Accordion, MoonUIAccordionContentPro as AccordionContent, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, Calendar3 as AdvancedCalendar, AdvancedChart, AdvancedForms, MoonUIAlertPro as Alert, MoonUIAlertDescriptionPro as AlertDescription, MoonUIAlertTitlePro as AlertTitle, MoonUIAspectRatioPro as AspectRatio, MoonUIAvatarPro as Avatar, MoonUIAvatarFallbackPro as AvatarFallback, MoonUIAvatarImagePro as AvatarImage, MoonUIBadgePro as Badge, MoonUIBreadcrumbPro as Breadcrumb, MoonUIBreadcrumbEllipsisPro as BreadcrumbEllipsis, MoonUIBreadcrumbItemPro as BreadcrumbItem, MoonUIBreadcrumbLinkPro as BreadcrumbLink, MoonUIBreadcrumbListPro as BreadcrumbList, MoonUIBreadcrumbPagePro as BreadcrumbPage, MoonUIBreadcrumbSeparatorPro as BreadcrumbSeparator, MoonUIButtonPro as Button, Calendar, Calendar3 as CalendarPro, MoonUICardPro as Card, MoonUICardContentPro as CardContent, MoonUICardDescriptionPro as CardDescription, MoonUICardFooterPro as CardFooter, MoonUICardHeaderPro as CardHeader, MoonUICardTitlePro as CardTitle, ChartWidget2 as ChartWidget, MoonUICheckboxPro as Checkbox, ClaudeProvider, MoonUICollapsiblePro as Collapsible, MoonUICollapsibleContentPro as CollapsibleContent, MoonUICollapsibleTriggerPro as CollapsibleTrigger, MoonUIColorPickerPro as ColorPicker, MoonUICommandPro as Command, MoonUICommandDialogPro as CommandDialog, MoonUICommandEmptyPro as CommandEmpty, MoonUICommandGroupPro as CommandGroup, MoonUICommandInputPro as CommandInput, MoonUICommandItemPro as CommandItem, MoonUICommandListPro as CommandList, MoonUICommandSeparatorPro as CommandSeparator, MoonUICommandShortcutPro as CommandShortcut, Dashboard, DataTable, MoonUIDialogPro as Dialog, MoonUIDialogClosePro as DialogClose, MoonUIDialogContentPro as DialogContent, MoonUIDialogDescriptionPro as DialogDescription, MoonUIDialogFooterPro as DialogFooter, MoonUIDialogHeaderPro as DialogHeader, MoonUIDialogTitlePro as DialogTitle, MoonUIDialogTriggerPro as DialogTrigger, DraggableList, MoonUIDropdownMenuPro as DropdownMenu, MoonUIDropdownMenuCheckboxItemPro as DropdownMenuCheckboxItem, MoonUIDropdownMenuContentPro as DropdownMenuContent, MoonUIDropdownMenuGroupPro as DropdownMenuGroup, MoonUIDropdownMenuItemPro as DropdownMenuItem, MoonUIDropdownMenuLabelPro as DropdownMenuLabel, MoonUIDropdownMenuPortalPro as DropdownMenuPortal, MoonUIDropdownMenuRadioGroupPro as DropdownMenuRadioGroup, MoonUIDropdownMenuRadioItemPro as DropdownMenuRadioItem, MoonUIDropdownMenuSeparatorPro as DropdownMenuSeparator, MoonUIDropdownMenuShortcutPro as DropdownMenuShortcut, MoonUIDropdownMenuSubPro as DropdownMenuSub, MoonUIDropdownMenuSubContentPro as DropdownMenuSubContent, MoonUIDropdownMenuSubTriggerPro as DropdownMenuSubTrigger, MoonUIDropdownMenuTriggerPro as DropdownMenuTrigger, ErrorBoundary, FloatingActionButton, FormWizard, FormWizardNavigation, FormWizardProgress, FormWizardStep, FunnelWidget, MoonUIGalleryItemPro as GalleryItem, GaugeWidget, GeminiProvider, GestureDrawer, GitHubStars, HealthCheck, HoverCard2 as HoverCard, HoverCard3D, HoverCardContent2 as HoverCardContent, HoverCardTrigger2 as HoverCardTrigger, MoonUIInputPro as Input, KPIWidget, Kanban, LANGUAGE_COLORS, MoonUILabelPro as Label, LazyComponent, LazyImage, LazyList, LightboxContent, LightboxProvider, LightboxTrigger, MagneticButton, MoonUIMediaGalleryPro as MediaGallery, MemoryAnalytics, MemoryEfficientData, MoonUIAccordionContentPro, MoonUIAccordionItemPro, MoonUIAccordionPro, MoonUIAccordionTriggerPro, MoonUIAdvancedChartPro, MoonUIAlertDescriptionPro, MoonUIAlertPro, MoonUIAlertTitlePro, MoonUIAnimatedButtonPro, MoonUIAspectRatioPro, MoonUIAsyncAvatarPro, MoonUIAvatarFallbackPro, MoonUIAvatarGroupPro2 as MoonUIAvatarGroupPro, MoonUIAvatarImagePro, MoonUIAvatarPro2 as MoonUIAvatarPro, MoonUIBadgePro, MoonUIBreadcrumbEllipsisPro, MoonUIBreadcrumbItemPro, MoonUIBreadcrumbLinkPro, MoonUIBreadcrumbListPro, MoonUIBreadcrumbPagePro, MoonUIBreadcrumbPro, MoonUIBreadcrumbSeparatorPro, MoonUIButtonPro, MoonUICardContentPro, MoonUICardDescriptionPro, MoonUICardFooterPro, MoonUICardHeaderPro, MoonUICardPro, MoonUICardTitlePro, MoonUICheckboxPro, MoonUICollapsibleContentPro, MoonUICollapsiblePro, MoonUICollapsibleTriggerPro, MoonUIColorPickerPro, MoonUICommandDialogPro, MoonUICommandEmptyPro, MoonUICommandGroupPro, MoonUICommandInputPro, MoonUICommandItemPro, MoonUICommandListPro, MoonUICommandPro, MoonUICommandSeparatorPro, MoonUICommandShortcutPro, MoonUICreditCardInputPro, MoonUIDashboardPro, MoonUIDataTable, MoonUIDataTablePro, MoonUIDialogClosePro, MoonUIDialogContentPro, MoonUIDialogDescriptionPro, MoonUIDialogFooterPro, MoonUIDialogHeaderPro, MoonUIDialogPro, MoonUIDialogTitlePro, MoonUIDialogTriggerPro, DraggableList as MoonUIDraggableListPro, MoonUIDropdownMenuCheckboxItemPro, MoonUIDropdownMenuContentPro, MoonUIDropdownMenuGroupPro, MoonUIDropdownMenuItemPro, MoonUIDropdownMenuLabelPro, MoonUIDropdownMenuPortalPro, MoonUIDropdownMenuPro, MoonUIDropdownMenuRadioGroupPro, MoonUIDropdownMenuRadioItemPro, MoonUIDropdownMenuSeparatorPro, MoonUIDropdownMenuShortcutPro, MoonUIDropdownMenuSubContentPro, MoonUIDropdownMenuSubPro, MoonUIDropdownMenuSubTriggerPro, MoonUIDropdownMenuTriggerPro, MoonUIFileUploadPro, MoonUIFormWizardPro, MoonUIGalleryItemPro, MoonUIGestureDrawerPro, MoonUIInputPro, MoonUILabelPro, LightboxContent as MoonUILightboxContentPro, SimpleLightbox as MoonUILightboxPro, LightboxProvider as MoonUILightboxProviderPro, LightboxTrigger as MoonUILightboxTriggerPro, MoonUIMediaGalleryPro, MoonUIMemoryEfficientDataPro, MoonUINavbarPro, MoonUIPaginationContentPro, MoonUIPaginationEllipsisPro, MoonUIPaginationItemPro, MoonUIPaginationLinkPro, MoonUIPaginationNextPro, MoonUIPaginationPreviousPro, MoonUIPaginationPro, MoonUIPhoneNumberInputPro, MoonUIPhoneNumberInputSimple, MoonUIPopoverContentPro, MoonUIPopoverPro, MoonUIPopoverTriggerPro, MoonUIProgressPro, MoonUIQuizFormPro2 as MoonUIQuizFormPro, MoonUIRadioGroupContextPro, MoonUIRadioGroupItemPro, MoonUIRadioGroupPro, MoonUIRadioItemWithLabelPro, MoonUIRadioLabelPro, MoonUISelectContentPro, MoonUISelectGroupPro, MoonUISelectItemPro, MoonUISelectLabelPro, MoonUISelectPro, MoonUISelectSeparatorPro, MoonUISelectTriggerPro, MoonUISelectValuePro, MoonUISelectableVirtualListPro, MoonUISeparatorPro, MoonUISidebarPro, MoonUISkeletonPro, MoonUISliderPro, MoonUISwipeableCardPro, MoonUISwitchPro, MoonUITableBodyPro, MoonUITableCaptionPro, MoonUITableCellPro, MoonUITableFooterPro, MoonUITableHeadPro, MoonUITableHeaderPro, MoonUITablePro, MoonUITableRowPro, MoonUITabsContentPro, MoonUITabsPro as MoonUITabsEnhanced, MoonUITabsListPro, MoonUITabsPro, MoonUITabsTriggerPro, MoonUITextareaPro, MoonUITimelinePro, MoonUIToastPro, MoonUITogglePro, MoonUITooltipContentPro, MoonUITooltipPro, MoonUITooltipProviderPro, MoonUITooltipTriggerPro, MoonUIVirtualListPro, MoonUIalertVariantsPro, MoonUIaspectRatioVariantsPro, MoonUIbreadcrumbVariantsPro, collapsibleContentVariants as MoonUIcollapsibleContentVariantsPro, collapsibleTriggerVariants as MoonUIcollapsibleTriggerVariantsPro, MoonUIradioGroupItemVariantsPro, MoonUItableVariantsPro, MoonUItoggleVariantsPro, Navbar, NavigationMenu2 as NavigationMenu, NavigationMenuContent2 as NavigationMenuContent, NavigationMenuIndicator2 as NavigationMenuIndicator, NavigationMenuItem2 as NavigationMenuItem, NavigationMenuLink2 as NavigationMenuLink, NavigationMenuList2 as NavigationMenuList, NavigationMenuTrigger2 as NavigationMenuTrigger, NavigationMenuViewport2 as NavigationMenuViewport, OpenAIProvider, OptimizedImage, MoonUIPaginationPro as Pagination, MoonUIPaginationContentPro as PaginationContent, MoonUIPaginationEllipsisPro as PaginationEllipsis, MoonUIPaginationItemPro as PaginationItem, MoonUIPaginationLinkPro as PaginationLink, MoonUIPaginationNextPro as PaginationNext, MoonUIPaginationPreviousPro as PaginationPrevious, PerformanceDebugger, PerformanceMonitor, PhoneNumberInput, PinchZoom, MoonUIPopoverPro as Popover, MoonUIPopoverContentPro as PopoverContent, MoonUIPopoverTriggerPro as PopoverTrigger, MoonUIProgressPro as Progress, QuizForm, MoonUIRadioGroupPro as RadioGroup, MoonUIRadioGroupContextPro as RadioGroupContext, MoonUIRadioGroupItemPro as RadioGroupItem, MoonUIRadioItemWithLabelPro as RadioItemWithLabel, MoonUIRadioLabelPro as RadioLabel, RealTimePerformanceMonitor, RevenueWidget, RichTextEditor, ScrollArea, ScrollBar, MoonUISelectPro as Select, MoonUISelectContentPro as SelectContent, MoonUISelectGroupPro as SelectGroup, MoonUISelectItemPro as SelectItem, MoonUISelectLabelPro as SelectLabel, MoonUISelectSeparatorPro as SelectSeparator, MoonUISelectTriggerPro as SelectTrigger, MoonUISelectValuePro as SelectValue, SelectableVirtualList, MoonUISeparatorPro as Separator, ServerMonitorWidget, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SimpleLightbox, MoonUISkeletonPro as Skeleton, MoonUISliderPro as Slider, SpotlightCard, SwipeableCard, MoonUISwitchPro as Switch, MoonUITablePro as Table, MoonUITableBodyPro as TableBody, MoonUITableCaptionPro as TableCaption, MoonUITableCellPro as TableCell, MoonUITableFooterPro as TableFooter, MoonUITableHeadPro as TableHead, MoonUITableHeaderPro as TableHeader, MoonUITableRowPro as TableRow, Tabs, TabsContent, TabsList, TabsTrigger, MoonUITextareaPro as Textarea, Timeline, MoonUIToastPro as Toast, MoonUITogglePro as Toggle, MoonUITooltipPro as Tooltip, MoonUITooltipContentPro as TooltipContent, MoonUITooltipProviderPro as TooltipProvider, MoonUITooltipTriggerPro as TooltipTrigger, VirtualList, WidgetBase, MoonUIalertVariantsPro as alertVariants, MoonUIaspectRatioVariantsPro as aspectRatioVariants, moonUIBadgeVariantsPro as badgeVariants, MoonUIbreadcrumbVariantsPro as breadcrumbVariants, moonUIButtonProVariants as buttonVariants, cn, collapsibleContentVariants, collapsibleTriggerVariants, commandVariantsPro, createAIProvider, galleryItemVariants, galleryVariants, getExpandableColumn, hoverCard3DVariants, moonUIAnimatedButtonProVariants, badgeVariants as moonUIAvatarBadgeVariants, avatarVariants as moonUIAvatarProVariants, statusVariants as moonUIAvatarStatusVariants, moonUIBadgeVariantsPro, moonUIButtonProVariants, gestureDrawerVariants as moonUIGestureDrawerProVariants, moonUISeparatorVariantsPro, navigationMenuTriggerStyle, countries as phoneCountries, MoonUIradioGroupItemVariantsPro as radioGroupItemVariants, moonUISeparatorVariantsPro as separatorVariants, MoonUItableVariantsPro as tableVariants, MoonUItoggleVariantsPro as toggleVariants, useAccordionAnalytics, useCollapsibleAnalytics, useExpandableRows, useFormWizard, useStreamingData, useVirtualList };