orbcafe-ui 1.2.1 → 1.2.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/README.md +22 -3
- package/dist/index.js +16 -16
- package/dist/index.mjs +13 -13
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {a}from'./chunk-74Z76O3S.mjs';export{b as COrbCanvas}from'./chunk-74Z76O3S.mjs';import*as ut from'react';import ut__default,{createContext,useMemo,useContext,useState,useEffect,useCallback,Fragment as Fragment$1,useRef}from'react';import {usePathname,useRouter}from'next/navigation';import {ChevronRight,Search,Plus,Mic,ThumbsDown,ThumbsUp,Volume2,RefreshCw,Copy,Terminal,Clock,X,ChevronDown,Box as Box$1,Lightbulb,AlertCircle,RotateCw,Check,Clipboard,CheckCircle,XCircle,Loader2,AlertTriangle,Info,BarChart,MapPin,Globe,TrendingDown,GitBranch,Grid as Grid$1,Activity,PieChart,LineChart}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import jd from'@mui/material/Dialog';import Qd from'@mui/material/DialogTitle';import Xd from'@mui/material/DialogContent';import pg from'@mui/material/DialogContentText';import Yd from'@mui/material/DialogActions';import xn from'@mui/material/Box';import gg from'@mui/icons-material/CheckCircle';import fg from'@mui/icons-material/Warning';import hg from'@mui/icons-material/Error';import yg from'@mui/icons-material/Info';import {styled,Box,Typography,Paper,Stack,Link,Dialog,DialogTitle,IconButton,DialogContent,MenuItem,DialogActions,Button,Chip,InputBase,useTheme,Autocomplete,TextField,Tooltip,FormControlLabel,Checkbox,Menu,ListItemText,Divider,Collapse,Grid,ListItemIcon,CircularProgress,Alert,TableContainer,Table,TableHead,TableRow,TableCell,TableBody,Tabs,Tab,LinearProgress,Avatar,AppBar,Toolbar,InputAdornment,createTheme,ThemeProvider,FormControl,Select,Switch,Portal,useMediaQuery,Drawer,Popover,ListSubheader,Badge,TableFooter}from'@mui/material';import xy from'@mui/material/Paper';import vy from'@mui/material/Table';import Cy from'@mui/material/TableBody';import Zs from'@mui/material/TableCell';import tp from'@mui/material/TableContainer';import Gg from'@mui/material/TableHead';import Ug from'@mui/material/TableRow';import Jd from'@mui/material/TextField';import Ei from'@mui/material/Button';import ep from'@mui/material/Alert';import {DndContext,closestCenter,useSensors,useSensor,PointerSensor,TouchSensor,closestCorners,DragOverlay,useDroppable,useDraggable}from'@dnd-kit/core';import {restrictToHorizontalAxis}from'@dnd-kit/modifiers';import Nd from'@mui/icons-material/Search';import Dg from'@mui/icons-material/ViewColumn';import Ud from'@mui/icons-material/Save';import Ag from'@mui/icons-material/Download';import Bg from'@mui/icons-material/AccountTree';import Fg from'@mui/icons-material/Functions';import Eg from'@mui/icons-material/Insights';import Lg from'@mui/icons-material/Add';import Ng from'@mui/icons-material/Edit';import zg from'@mui/icons-material/Delete';import Vg from'@mui/icons-material/KeyboardArrowLeft';import Og from'@mui/icons-material/KeyboardArrowRight';import Kg from'@mui/material/Checkbox';import qg from'@mui/material/TableSortLabel';import _g from'@mui/material/IconButton';import Zg from'@mui/material/Tooltip';import jg from'@mui/icons-material/UnfoldMore';import Qg from'@mui/icons-material/UnfoldLess';import af from'@mui/icons-material/KeyboardArrowDown';import yf from'@mui/icons-material/Check';import bf from'@mui/icons-material/ClearAll';import Kf from'@mui/icons-material/Close';import Jf from'@mui/icons-material/MicNoneOutlined';import eh from'@mui/icons-material/SettingsOutlined';import th from'@mui/icons-material/SendOutlined';import Xh from'@mui/icons-material/Settings';import Yh from'@mui/icons-material/KeyboardArrowUp';import ey from'@mui/icons-material/ArrowRightAlt';import kh from'@mui/icons-material/Star';import {DateCalendar}from'@mui/x-date-pickers/DateCalendar';import {PickersDay}from'@mui/x-date-pickers/PickersDay';import {LocalizationProvider}from'@mui/x-date-pickers/LocalizationProvider';import {AdapterDayjs}from'@mui/x-date-pickers/AdapterDayjs';import zh from'@mui/icons-material/CalendarMonth';import Vh from'@mui/icons-material/Clear';import Oh from'@mui/icons-material/ArrowForward';import Zo from'dayjs';import Wh from'dayjs/plugin/isBetween';import $h from'dayjs/plugin/localizedFormat';import'dayjs/locale/zh-cn';import'dayjs/locale/fr';import'dayjs/locale/de';import'dayjs/locale/ja';import'dayjs/locale/ko';import gy from'@mui/icons-material/StarBorder';import fy from'@mui/icons-material/ViewQuilt';import zb from'@mui/icons-material/CloseOutlined';import zy from'@mui/icons-material/ContentCopyOutlined';import Vy from'@mui/icons-material/CheckOutlined';import mb from'@mui/icons-material/ExpandMore';import {arrayMove,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import {alpha,useTheme as useTheme$1}from'@mui/material/styles';import Fp from'@mui/icons-material/Language';import kx from'@mui/icons-material/DesktopWindows';import Sx from'@mui/icons-material/DarkMode';import wx from'@mui/icons-material/LightMode';import Tx from'@mui/icons-material/Logout';import $0 from'@mui/icons-material/DeleteOutline';import jx from'@mui/icons-material/DragIndicator';import m0 from'@mui/icons-material/FilterList';import g0 from'@mui/icons-material/TableRows';import e0 from'@mui/icons-material/LayersClear';import uv from'@mui/icons-material/CameraAltRounded';import mv from'@mui/icons-material/QrCodeScannerRounded';import yv from'@mui/icons-material/DragIndicatorRounded';import Cv from'@mui/icons-material/BackspaceRounded';import kv from'@mui/icons-material/CloseRounded';import Sv from'@mui/icons-material/CheckRounded';import Nv from'@mui/icons-material/SearchRounded';import zv from'@mui/icons-material/MenuOpenRounded';import Vv from'@mui/icons-material/MenuRounded';import Ov from'@mui/icons-material/ExpandMoreRounded';import Wv from'@mui/icons-material/ChevronRightRounded';import iC from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import vk from'react-markdown';import Ck from'remark-gfm';import kk from'remark-math';import Sk from'rehype-katex';import wk from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import {useTheme as useTheme$2}from'next-themes';import cm from'mermaid';import Lk from'@mui/icons-material/MicRounded';import Nk from'@mui/icons-material/MicOffRounded';import {InsertDriveFile,Close,Stop}from'@mui/icons-material';import $k from'@mui/icons-material/SendRounded';import Hk from'@mui/icons-material/AddRounded';import Gk from'@mui/icons-material/HardwareRounded';function ta(...e){return twMerge(clsx(e))}var zs={primary:"#000000",primaryHover:"#333333"},Zn={primary:"bg-primary text-primary-foreground hover:bg-primary/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"},en={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Pc=()=>"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";var Om=cva(Pc(),{variants:{variant:{default:`${Zn.primary} shadow-sm`,destructive:"bg-red-500 text-white hover:bg-red-600 active:bg-red-700 dark:bg-red-600 dark:hover:bg-red-500 dark:active:bg-red-700 shadow-sm",outline:`${Zn.outline} shadow-sm`,secondary:"bg-gray-200 text-gray-700 hover:bg-gray-300 active:bg-gray-400 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600 dark:active:bg-gray-500 shadow-sm",ghost:Zn.ghost,link:"text-blue-600 dark:text-blue-400 underline-offset-4 hover:underline hover:text-blue-700 dark:hover:text-blue-300 active:text-blue-800 dark:active:text-blue-200","chat-tool":"bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-text-2)] hover:bg-[var(--orbai-surface-3)] hover:border-[var(--orbai-border-strong)] hover:text-[var(--orbai-text-1)] active:scale-95 transition-all duration-200","chat-send":`bg-[${zs.primary}] hover:bg-[${zs.primaryHover}] text-white border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200`,"chat-stop":"bg-red-500 hover:bg-red-600 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-white transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:en.none,sm:en.sm,md:en.md,full:en.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Vs=ut.forwardRef(({className:e,variant:t,size:o,asChild:a=false,...r},n)=>jsx(a?Slot:"button",{className:ta(Om({variant:t,size:o,className:e})),ref:n,...r}));Vs.displayName="Button";var $m={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},Hm={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},Gm={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},Um={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},Km={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},qm={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},tn={en:$m,zh:Hm,fr:Gm,de:Um,ja:Km,ko:qm};var Dc=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,a)=>{let r=t[a];return r==null?"":String(r)}):e,Qm={locale:"en",t:(e,t)=>Dc(tn.en[e]||e,t)},Mc=createContext(Qm),Ac=({locale:e="en",messages:t,children:o})=>{let a=useMemo(()=>{let r=tn[e]||tn.en,n=t?.[e]||{},i={...tn.en,...r,...n};return {locale:e,t:(c,d)=>Dc(i[c]||c,d)}},[e,t]);return jsx(Mc.Provider,{value:a,children:o})},q=()=>useContext(Mc);function Ws({items:e,onItemClick:t,className:o="",level:a=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:c}=q(),d=i==="dark",s=usePathname(),[l,g]=useState(false),[f,u]=useState(new Set),y=r!==void 0&&n!==void 0,I=y?r:f;useEffect(()=>{g(true);},[]);let p=m=>{if(y)n(m);else {let b=new Set(f);b.has(m)?b.delete(m):b.add(m),u(b);}},C=m=>{m.children&&m.children.length>0&&p(m.id),t&&t(m);};return !e||!Array.isArray(e)?jsx("div",{className:ta("tree-menu",o),children:jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsx("div",{className:ta("tree-menu",o),children:e.map(m=>{let b=I.has(m.id)||m.isExpanded,x=m.children&&m.children.length>0,k=m.appurl||m.href,L=l&&k?s===k:false;return jsxs("div",{className:"tree-menu-item relative",children:[L&&jsx("div",{className:ta("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxs(Vs,{variant:"ghost",className:ta("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${a*4}`,L?d?"bg-transparent text-[#90caf9] hover:bg-gray-800/35":"bg-transparent text-[#1976d2] hover:bg-gray-100/60":d?"hover:bg-gray-800/50 text-gray-300":"hover:bg-gray-100/50 text-gray-700"),onClick:()=>C(m),children:[x&&jsx("div",{className:ta("flex-shrink-0 transition-transform duration-200",b&&"rotate-90",L?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:jsx(ChevronRight,{className:"h-4 w-4"})}),!x&&jsx("div",{className:"w-4 h-4 flex-shrink-0"}),m.icon&&jsx("div",{className:ta("flex-shrink-0 transition-colors duration-200",L?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:m.icon}),jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsx("div",{className:ta("text-sm truncate transition-colors duration-200",L?"font-semibold":"font-medium"),children:m.title||m.label}),m.description&&jsx("div",{className:ta("text-xs truncate transition-colors duration-200",L?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:m.description,children:m.description})]})]}),x&&jsx("div",{className:ta("grid transition-[grid-template-rows] duration-300 ease-in-out",b?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsx("div",{className:"overflow-hidden",children:jsx(Ws,{items:m.children,onItemClick:t,level:a+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},m.id)})})}var zc=({collapsed:e,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light"})=>{let{t:i}=q(),c=n==="dark",d=useRouter(),[s,l]=useState(""),[g,f]=useState(new Set);useEffect(()=>{e&&f(new Set);},[e]);let u=useCallback(C=>{let m=[],b=x=>{x.forEach(k=>{m.push(k.id),k.children&&b(k.children);});};return b(C),m},[]),y=useMemo(()=>{if(!s.trim())return r;let C=m=>m.reduce((b,x)=>{let k=x.title?.toLowerCase().includes(s.toLowerCase())||x.description?.toLowerCase().includes(s.toLowerCase()),L=x.children?C(x.children):[];return (k||L.length>0)&&b.push({...x,children:L.length>0?L:x.children}),b},[]);return C(r)},[s,r]),I=useMemo(()=>s.trim()?new Set(u(r)):g,[s,r,g,u]),p=useCallback(async C=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",C),C.id==="chat"||C.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{d.push("/chat?new=true");}catch(b){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",b),d.push("/chat");}return}let m=C.appurl||C.href;m&&(m.startsWith("http://")||m.startsWith("https://")?window.open(m,"_blank"):d.push(m));},[d]);return jsxs("div",{className:`flex flex-col backdrop-blur-xl border shadow-[0_4px_8px_0_rgba(31,38,135,0.1)] ${e?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${c?"bg-[#111111] border-white/10":"bg-white/70 border-white/30"}`,style:{backdropFilter:"blur(16px) saturate(180%)",WebkitBackdropFilter:"blur(16px) saturate(180%)",transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out",maxHeight:a?`${a}px`:void 0},children:[jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsx("div",{className:"flex justify-center",children:jsx("button",{onClick:t,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${c?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:i("navigation.expand"),children:jsx(Search,{className:"h-5 w-5"})})}):jsxs("div",{className:`relative transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:[jsx("input",{type:"text",placeholder:i("navigation.searchPlaceholder"),value:s,onChange:C=>l(C.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${c?"border-gray-700 bg-[#1A1A1A] text-white placeholder-gray-400":"border-gray-300 bg-white text-gray-900 placeholder-gray-500"}`}),jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:jsx(Search,{className:`h-4 w-4 ${c?"text-gray-500":"text-gray-400"}`})})]})}),jsx("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${e?"px-1":"px-2"}`,children:y.length===0?jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":i(s?"navigation.noMatch":"navigation.noAccessibleApp")}):jsxs(Fragment,{children:[!e&&jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsx(Ws,{items:y,onItemClick:p,className:"space-y-1",expandedIds:I,colorMode:n,onToggleExpand:C=>{let m=new Set(g);y.some(x=>x.id===C)?m.has(C)?m.delete(C):(y.forEach(x=>{x.id!==C&&m.has(x.id)&&m.delete(x.id);}),m.add(C)):m.has(C)?m.delete(C):m.add(C),f(m);}})}),e&&jsx("div",{className:"space-y-2",children:r.map(C=>jsx("div",{className:"space-y-1",children:jsx("button",{onClick:()=>{t();let m=new Set([C.id]);f(m);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${c?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:i("navigation.expandView",{title:C.title||""}),children:C.icon||jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${c?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:C.title?.charAt(0)||"?"})})},C.id))})]})}),!e&&jsx("button",{onClick:t,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${c?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:i("navigation.collapse"),children:jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsx("div",{className:c?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})})]})};var Oc=(e={})=>{let{initialCollapsed:t=false,content:o=[]}=e,[a,r]=useState(t),[n,i]=useState(o),c=useCallback(()=>{r(s=>!s);},[]),d=useMemo(()=>({collapsed:a,onToggle:c,menuData:n}),[a,c,n]);return {collapsed:a,setCollapsed:r,toggleCollapsed:c,menuData:n,setMenuData:i,navigationIslandProps:d}};var Hs=e=>jsx(Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var Gs=class{constructor(){a(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,o,a){this.listener&&this.listener({type:t,content:o,options:a});}hide(){this.listener&&this.listener(null);}},qa=new Gs,QS={success:(e,t)=>qa.show("success",e,t),error:(e,t)=>qa.show("error",e,t),warning:(e,t)=>qa.show("warning",e,t),info:(e,t)=>qa.show("info",e,t),show:(e,t,o)=>qa.show(e,t,o),hide:()=>qa.hide()};var bg={success:{icon:jsx(gg,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsx(fg,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsx(hg,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsx(yg,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},an=({open:e,title:t,message:o,onClose:a,onConfirm:r,confirmText:n,cancelText:i,showCancel:c=true,maxWidth:d="xs",type:s="default"})=>{let{t:l}=q(),g=n||l("messageBox.confirm"),f=i||l("messageBox.cancel"),u=()=>{r?r():a();},y=bg[s],I=s!=="default";return jsxs(jd,{open:e,onClose:a,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...I&&{borderTop:`6px solid ${y.iconColor}`}}},children:[I&&jsx(xn,{sx:{display:"flex",justifyContent:"center",pt:3,color:y.iconColor},children:y.icon}),t&&jsx(Qd,{sx:{textAlign:I?"center":"left",pt:I?1:2},children:t}),jsx(Xd,{sx:{textAlign:I?"center":"left"},children:typeof o=="string"?jsx(pg,{children:o}):o}),jsxs(Yd,{sx:{justifyContent:I?"center":"flex-end",pb:3,px:3},children:[c&&jsx(Hs,{onClick:a,variant:"text",color:"inherit",children:f}),jsx(Hs,{onClick:u,variant:"contained",sx:{bgcolor:I?y.iconColor:void 0,"&:hover":{bgcolor:I?y.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},mw=()=>{let[e,t]=ut__default.useState(null),[o,a]=ut__default.useState(false);ut__default.useEffect(()=>{let i=c=>{c?(t(c),a(true)):(a(false),t(null));};return qa.register(i),()=>qa.unregister()},[]);let r=()=>{a(false),e?.options?.onClose&&e.options.onClose(),t(null);},n=()=>{e?.options?.onConfirm&&e.options.onConfirm(),a(false),t(null);};return e?jsx(an,{open:o,type:e.type,message:e.content,title:e.options?.title,onClose:r,onConfirm:n,confirmText:e.options?.confirmText,cancelText:e.options?.cancelText,showCancel:e.options?.showCancel,maxWidth:e.options?.maxWidth}):null};var $c=({title:e,hideHeader:t,children:o})=>jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!t&&jsx(Box,{sx:{mb:2},children:jsx(Typography,{variant:"h4",children:e})}),jsx(Box,{sx:{flex:1,overflow:"hidden"},children:o})]});var jn=e=>{let{t}=q(),o="0.85rem",a=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],r=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],n=[...a,...r],i=typeof e.rowsPerPage=="number"?e.rowsPerPage:20,c=Array.isArray(e.rowsPerPageOptions)&&e.rowsPerPageOptions.length>0?e.rowsPerPageOptions:[20,50,100,-1],d=typeof e.count=="number"?e.count:0,s=Math.max(0,typeof e.page=="number"?e.page:0),l=i===-1?1:Math.max(1,Math.ceil(d/i)),g=Math.min(s+1,l),f=s>0,u=s<l-1&&i!==-1;return jsxs(Toolbar,{sx:{pl:{sm:2},pr:{xs:1,sm:1},alignItems:"center",gap:1},children:[jsx(TextField,{size:"small",placeholder:t("table.toolbar.searchPlaceholder"),value:e.filterText,onChange:y=>e.setFilterText(y.target.value),InputProps:{sx:{fontSize:o,"& .MuiInputBase-input":{fontSize:o},"& .MuiInputBase-input::placeholder":{fontSize:o,opacity:1}},startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Nd,{fontSize:"small"})})},sx:{width:300}}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[jsx(Typography,{sx:{fontSize:o,color:"text.secondary",whiteSpace:"nowrap"},children:t("table.toolbar.itemsPerPage")}),jsx(Select,{size:"small",variant:"standard",value:i,disableUnderline:true,onChange:y=>e.onRowsPerPageChange?.(Number(y.target.value)),sx:{fontSize:o,fontWeight:600,minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"}},children:c.map(y=>jsx(MenuItem,{value:y,sx:{fontSize:o},children:y===-1?t("common.all"):y},`rows-per-page-${y}`))}),jsx(IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(s-1,0)),disabled:!f,sx:{p:.35},children:jsx(Vg,{fontSize:"small"})}),jsx(Typography,{sx:{fontSize:o,fontWeight:600,minWidth:88,textAlign:"center"},children:t("table.toolbar.pageOf",{current:g,total:l})}),jsx(IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(s+1,l-1)),disabled:!u,sx:{p:.35},children:jsx(Og,{fontSize:"small"})})]}),jsx(Box,{sx:{flex:1}}),jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[n.length>0&&jsx(Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:n.map((y,I)=>jsx(ut__default.Fragment,{children:y},`toolbar-custom-${I}`))}),jsx(Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),jsx(Tooltip,{title:t("table.toolbar.groupBy"),children:jsx(IconButton,{onClick:y=>e.setGroupAnchorEl(y.currentTarget),children:jsx(Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsx(Bg,{})})})}),jsx(Tooltip,{title:t("table.toolbar.summary"),children:jsx(IconButton,{onClick:y=>e.setSummaryAnchorEl(y.currentTarget),color:e.showSummary?"primary":"default",children:jsx(Fg,{})})}),jsx(Tooltip,{title:t("table.toolbar.columns"),children:jsx(IconButton,{onClick:y=>e.setAnchorEl(y.currentTarget),children:jsx(Dg,{})})}),jsx(Tooltip,{title:t("table.toolbar.export"),children:jsx(IconButton,{onClick:e.handleExport,children:jsx(Ag,{})})}),e.showCreateButton&&jsx(Tooltip,{title:t("table.toolbar.newItem"),children:jsx(IconButton,{onClick:e.onOpenCreateDialog,color:"primary",children:jsx(Lg,{})})}),e.showEditButton&&jsx(Tooltip,{title:t("table.toolbar.editItem"),children:jsx("span",{children:jsx(IconButton,{onClick:e.onOpenEditDialog,color:"primary",disabled:!!e.editDisabled,children:jsx(Ng,{})})})}),e.showDeleteButton&&jsx(Tooltip,{title:t("table.toolbar.deleteItem"),children:jsx("span",{children:jsx(IconButton,{onClick:e.onOpenDeleteConfirm,color:"error",disabled:!!e.deleteDisabled,children:jsx(zg,{})})})}),e.onOpenGraphReport&&jsx(Tooltip,{title:t("table.toolbar.graphicReport"),children:jsx(IconButton,{onClick:e.onOpenGraphReport,children:jsx(Eg,{})})}),e.onLayoutSave&&!e.layoutManager&&jsx(Tooltip,{title:t("table.toolbar.saveLayout"),children:jsx(IconButton,{onClick:y=>e.onLayoutSave(y),children:jsx(Ud,{})})}),e.layoutManager]})]})};var Kc=e=>{let{t}=q(),{onSelectAllClick:o,order:a,orderBy:r,numSelected:n=0,rowCount:i=0,onRequestSort:c,columns:d,visibleColumns:s,selectionMode:l,grouping:g=[],isAllExpanded:f=false,handleToggleAll:u,onColumnResize:y,columnWidths:I}=e,[p,C]=useState(null),m=useRef(null),b=v=>M=>{p||c(v);},x=(v,M,S)=>{v.preventDefault(),v.stopPropagation(),C(M),m.current={startX:v.clientX,startWidth:S,colId:M},document.addEventListener("mousemove",k),document.addEventListener("mouseup",L),document.body.style.cursor="col-resize";},k=v=>{if(!m.current)return;let{startX:M,startWidth:S,colId:D}=m.current,B=v.clientX-M,H=Math.max(50,S+B);y&&y(D,H);},L=()=>{C(null),m.current=null,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",L),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",L);},[]);let P=l==="multiple"||l==="single",w=g.length>0&&!!u,E=t(f?"table.group.collapseAll":"table.group.expandAll"),T=d.filter(v=>s.includes(v.id));return jsx(Gg,{children:jsxs(Ug,{children:[P&&jsx(Zs,{padding:"checkbox",sx:v=>({width:48,position:"sticky",top:0,zIndex:4,backgroundColor:v.palette.mode==="dark"?"#000000":"#f5f5f5",color:v.palette.mode==="dark"?"#ffffff":v.palette.text.primary}),children:jsx(Kg,{color:"primary",indeterminate:n>0&&n<i,checked:i>0&&n===i,onChange:o,disabled:l==="single"})}),w&&jsx(Zs,{align:"center",padding:"checkbox",sx:v=>({width:44,position:"sticky",top:0,zIndex:4,backgroundColor:v.palette.mode==="dark"?"#000000":"#f5f5f5",color:v.palette.mode==="dark"?"#ffffff":v.palette.text.primary}),children:jsx(Zg,{title:E,children:jsx(_g,{size:"small",onClick:v=>{v.stopPropagation(),u?.(!f);},sx:{p:.2},children:f?jsx(Qg,{fontSize:"small"}):jsx(jg,{fontSize:"small"})})})}),T.map(v=>{let M=I?.[v.id]||v.minWidth||100;return jsxs(Zs,{align:"left",padding:v.disablePadding?"none":"normal",sortDirection:r===v.id?a:false,style:{width:M,minWidth:M,maxWidth:M},sx:S=>({position:"sticky",top:0,zIndex:4,backgroundColor:S.palette.mode==="dark"?"#000000":"#f5f5f5",color:S.palette.mode==="dark"?"#ffffff":S.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsx(qg,{active:r===v.id,direction:r===v.id?a:"asc",onClick:b(v.id),sx:S=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:S.palette.mode==="dark"?"#ffffff":S.palette.text.primary,opacity:r===v.id?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:S.palette.mode==="dark"?"#ffffff":S.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:S.palette.mode==="dark"?"#ffffff":S.palette.text.primary}),children:jsx(xn,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:v.label})}),jsx(xn,{onMouseDown:S=>x(S,v.id,typeof M=="number"?M:100),onClick:S=>S.stopPropagation(),sx:{position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize","&:hover":{backgroundColor:"primary.main",opacity:.5},zIndex:1}})]},v.id)})]})})};var Zc=e=>{let{t}=q(),{visibleRows:o,visibleColumns:a,selected:r=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:s,grouping:l=[],isGroupFullyExpanded:g,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:u}=e,y=m=>r.indexOf(m)!==-1,I=s==="multiple"||s==="single",p=l.length>0,C=a.length+(I?1:0)+(p?1:0);return jsxs(TableBody,{children:[o.map((m,b)=>{if(m.type==="group"){let x=d.has(m.id),k=m.childIds||[],L=k.filter(T=>y(T)).length,P=k.length>0&&L===k.length,w=L>0&&L<k.length;return jsxs(TableRow,{sx:T=>({backgroundColor:T.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:T.palette.text.primary,borderBottomColor:T.palette.divider},"& .MuiIconButton-root":{color:T.palette.text.primary},"& .MuiCheckbox-root":{color:T.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:T.palette.primary.main}}),children:[I&&jsx(TableCell,{padding:"checkbox",children:jsx(Checkbox,{size:"small",checked:P,indeterminate:w,onChange:T=>{if(T.stopPropagation(),!!e.onSelectionChange)if(P){let v=r.filter(M=>!k.includes(M));e.onSelectionChange(v);}else {let v=Array.from(new Set([...r,...k]));e.onSelectionChange(v);}},onClick:T=>T.stopPropagation(),sx:{p:.5}})}),p&&jsx(TableCell,{padding:"checkbox",sx:{width:44},children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.25},children:[l.length>1&&m.level<l.length-1&&jsx(Tooltip,{title:g?.(m.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsx(IconButton,{size:"small",onClick:()=>{g?.(m.id)?u?.(m.id):f?.(m.id);},sx:{p:.25},children:g?.(m.id)?jsx(Qg,{fontSize:"small"}):jsx(jg,{fontSize:"small"})})}),jsx(IconButton,{size:"small",onClick:()=>c&&c(m.id),sx:{p:.25},children:x?jsx(af,{}):jsx(Og,{})})]})}),jsx(TableCell,{colSpan:a.length,sx:{py:1,pl:m.level*3+1},children:jsxs(Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[m.field,": ",m.value," (",m.count,")"]})})]},m.id)}else {let x=m.data||m,k=m.id||x.id||b,L=y(k),P=`enhanced-table-checkbox-${b}`,E=(m.level!==void 0?m.level:0)*4;return jsxs(TableRow,{hover:true,onClick:T=>n&&n(T,x),role:"checkbox","aria-checked":L,tabIndex:-1,selected:L,sx:{cursor:"pointer"},children:[I&&jsx(TableCell,{padding:"checkbox",sx:{pl:E>0?E+1:void 0},children:jsx(Checkbox,{color:"primary",checked:L,inputProps:{"aria-labelledby":P}})}),p&&jsx(TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(T=>a.includes(T.id)).map((T,v)=>{let S=!I&&v===0&&E>0?{pl:E+2}:{};return jsx(TableCell,{align:"left",sx:S,children:T.render?T.render(x[T.id],x):(function(){let B=x[T.id];if(T.numeric){if(typeof B=="number")return B.toLocaleString();if(typeof B=="string"&&B.trim()!==""&&!isNaN(Number(B)))return Number(B).toLocaleString()}return B})()},T.id)})]},k)}}),o.length===0&&jsx(TableRow,{children:jsx(TableCell,{colSpan:C,align:"center",children:t("common.noData")})})]})};var jc=e=>{let{visibleColumns:t,summaryRow:o,selectionMode:a,grouping:r=[]}=e;if(!e.showSummary)return null;let n=a==="multiple"||a==="single",i=r.length>0;return jsx(TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxs(TableRow,{children:[n&&jsx(TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper"}}),i&&jsx(TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper",width:44}}),t.map(c=>jsx(TableCell,{sx:{fontWeight:"bold",fontSize:"0.85rem",bgcolor:"background.paper",color:"text.primary"},children:(function(){let s=o[c];return s==null||s===""?"":typeof s=="number"?s.toLocaleString():typeof s=="string"&&s.trim()!==""&&!isNaN(Number(s))?Number(s).toLocaleString():s})()},c))]})})};var Xc=e=>{let{t}=q();return jsx(Box,{sx:{p:2},children:jsx(Typography,{children:t("table.mobile.notImplemented")})})};var Jn=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:a,columns:r,toggleGroupField:n})=>{let{t:i}=q();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxs(Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsx(Typography,{variant:"subtitle2",sx:{px:1},children:i("table.menu.groupBy")}),o.length>0&&jsx(Button,{size:"small",color:"error",onClick:()=>a([]),startIcon:jsx(bf,{}),children:i("table.menu.clearAll")})]}),jsx(Divider,{}),r.map(c=>{let d=o.includes(c.id),s=o.indexOf(c.id)+1;return jsx(MenuItem,{onClick:()=>n(c.id),children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsx(Checkbox,{checked:d,size:"small"}),jsx(ListItemText,{primary:c.label}),d&&jsx(Badge,{badgeContent:s,color:"primary",sx:{mr:2}})]})},c.id)})]})},ei=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=q();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:n("table.menu.visibleColumns")})}),jsx(Divider,{}),o.map(i=>jsxs(MenuItem,{onClick:()=>r(i.id),children:[jsx(Checkbox,{checked:a.includes(i.id),size:"small"}),jsx(ListItemText,{primary:i.label})]},i.id))]})},ti=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:a,columns:r,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=q();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsx(MenuItem,{children:jsx(FormControlLabel,{control:jsx(Switch,{checked:o,onChange:d=>a(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),jsx(Divider,{}),r.filter(d=>d.numeric).map(d=>jsxs(MenuItem,{onClick:()=>i(d.id),disabled:!o,children:[jsx(Checkbox,{checked:n.includes(d.id),size:"small"}),jsx(ListItemText,{primary:d.label})]},d.id)),r.filter(d=>d.numeric).length===0&&jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:c("table.menu.noNumericColumns")})})]})},ai=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=q();return jsxs(Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsx(MenuItem,{onClick:t,children:n("common.copy")}),jsx(Divider,{}),jsx(MenuItem,{disabled:true,children:n("table.menu.visibleColumns")}),o.map(i=>jsxs(MenuItem,{onClick:()=>r(i.id),children:[jsx(ListItemIcon,{children:a.includes(i.id)&&jsx(yf,{fontSize:"small"})}),jsx(ListItemText,{children:i.label})]},i.id))]})};var nn=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),ed=({kpis:e})=>{let{t}=q(),o=[{label:t("graph.kpi.totalRecords"),value:nn(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:nn(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:nn(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:nn(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:nn(e.flaggedCount,0),color:"error.main"}];return jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(6, minmax(0, 1fr))"},gap:1.5},children:o.map(a=>jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(Typography,{variant:"caption",color:"text.secondary",children:a.label}),jsx(Typography,{variant:"h4",fontWeight:800,sx:{color:a.color},children:a.value})]},a.label))})};var oi=({title:e,subtitle:t,children:o})=>jsxs(Paper,{variant:"outlined",sx:{p:2,borderRadius:2},children:[jsx(Typography,{variant:"subtitle1",fontWeight:700,children:e}),t&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t}),o]});var ln=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:a=210,activeName:r,onItemClick:n})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=Math.max(...e.map(c=>c.value),1);return t==="vertical"?jsx(Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:a},children:e.map(c=>jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Box,{onClick:()=>n?.(c),sx:{height:`${Math.max(c.value/i*180,6)}px`,bgcolor:c.name===r?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:n?"pointer":"default",opacity:r&&c.name!==r?.45:1}}),jsx(Typography,{variant:"caption",noWrap:true,title:c.name,sx:{display:"block",mt:.5},children:c.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",children:[c.value.toFixed(1),o]})]},c.name))}):jsx(Stack,{spacing:1,children:e.map(c=>jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:c.name,children:c.name}),jsx(Box,{onClick:()=>n?.(c),sx:{alignSelf:"center",bgcolor:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:n?"pointer":"default",opacity:r&&c.name!==r?.45:1},children:jsx(Box,{sx:{width:`${c.value/i*100}%`,height:"100%",bgcolor:c.name===r?"primary.dark":"primary.main"}})}),jsxs(Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),o]})]},c.name))})};var od=({data:e,color:t="#42A5F5",valueSuffix:o="",height:a=220})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=e.map(f=>f.value),c=Math.min(...i,0),s=Math.max(...i,1)-c||1,l=e.map((f,u)=>{let y=n+u*(r-n*2)/Math.max(e.length-1,1),I=a-n-(f.value-c)/s*(a-n*2);return {x:y,y:I,...f}}),g=l.map(f=>`${f.x},${f.y}`).join(" ");return jsxs(Box,{children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:g}),l.map(f=>jsx("circle",{cx:f.x,cy:f.y,r:4,fill:t},f.name))]}),jsx(Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(f=>jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",noWrap:true,title:f.name,sx:{display:"block"},children:f.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",children:[f.value.toFixed(1),o]})]},f.name))})]})};var rd=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:a=220})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=Math.max(...e.map(l=>l.barValue),1),c=Math.max(...e.map(l=>l.lineValue),1),d=e.map((l,g)=>{let f=(r-n*2)/e.length,u=Math.max(f*.5,8),y=n+g*f+(f-u)/2,I=l.barValue/i*(a-n*2),p=a-n-I;return {x:y,y:p,barHeight:I,barWidth:u,item:l}}),s=e.map((l,g)=>{let f=(r-n*2)/e.length,u=n+g*f+f/2,y=a-n-l.lineValue/c*(a-n*2);return {x:u,y,item:l}});return jsxs(Stack,{spacing:1.25,children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),d.map(l=>jsx("rect",{x:l.x,y:l.y,width:l.barWidth,height:Math.max(l.barHeight,4),rx:6,fill:t},l.item.name)),jsx("polyline",{fill:"none",stroke:o,strokeWidth:3,points:s.map(l=>`${l.x},${l.y}`).join(" ")}),s.map(l=>jsx("circle",{cx:l.x,cy:l.y,r:3.5,fill:o},`${l.item.name}-line`))]}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(l=>jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",noWrap:true,title:l.name,sx:{display:"block"},children:l.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",l.barValue.toFixed(1)]}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",l.lineValue.toFixed(1)]})]},l.name))})]})};var Tf=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,id=({data:e})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let t=Array.from(new Set(e.map(n=>n.x))),o=Array.from(new Set(e.map(n=>n.y))),a=Math.max(...e.map(n=>n.value),1),r=new Map(e.map(n=>[`${n.y}__${n.x}`,n.value]));return jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsx(Box,{}),t.map(n=>jsx(Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:n},n)),o.map(n=>jsxs(Box,{sx:{display:"contents"},children:[jsx(Typography,{variant:"caption",sx:{alignSelf:"center"},children:n}),t.map(i=>{let c=r.get(`${n}__${i}`)||0,d=c/a;return jsx(Box,{sx:{height:36,borderRadius:1,bgcolor:Tf(d),border:"1px solid rgba(148,163,184,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(Typography,{variant:"caption",fontWeight:700,children:c.toFixed(1)})},`${n}-${i}`)})]},n))]})})};var Pf=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],di=({data:e,variant:t="donut",colors:o=Pf,size:a=180,activeName:r,onItemClick:n})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=0,c=e.map((d,s)=>{let l=i;return i+=d.percent,`${o[s%o.length]} ${l}% ${i}%`});return jsxs(Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsx(Box,{sx:{width:a,height:a,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsx(Box,{sx:{position:"absolute",inset:Math.round(a*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsx(Stack,{spacing:1,sx:{minWidth:180},children:e.map((d,s)=>jsxs(Box,{onClick:()=>n?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:n?"pointer":"default",opacity:r&&d.name!==r?.45:1},children:[jsx(Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:o[s%o.length]}}),jsx(Typography,{variant:"caption",sx:{flex:1},children:d.name}),jsxs(Typography,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var ld=({effect:e,branches:t})=>{if(t.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=t.filter((r,n)=>n%2===0),a=t.filter((r,n)=>n%2===1);return jsxs(Stack,{spacing:1.5,children:[jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(r=>jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsx(Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))}),jsxs(Box,{sx:{position:"relative",height:32},children:[jsx(Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsx(Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsx(Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(a.length,1)}, minmax(0, 1fr))`,gap:1},children:a.map(r=>jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsx(Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))})]})};var dd=({data:e,height:t=240})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=0,a=e.map(g=>{let f=g.type==="total"?0:o,u=g.type==="total"?g.value:o+g.value;return g.type!=="total"&&(o=u),{...g,start:f,end:u,delta:u-f}}),r=a.flatMap(g=>[g.start,g.end]),n=Math.min(...r,0),i=Math.max(...r,1),c=680,d=30,s=i-n||1,l=g=>t-d-(g-n)/s*(t-d*2);return jsxs(Box,{children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${c} ${t}`,sx:{width:"100%",height:t},children:[jsx("line",{x1:d,y1:l(0),x2:c-d,y2:l(0),stroke:"rgba(148,163,184,0.4)"}),a.map((g,f)=>{let u=(c-d*2)/a.length,y=Math.max(u*.55,8),I=d+f*u+(u-y)/2,p=l(Math.max(g.start,g.end)),C=l(Math.min(g.start,g.end)),m=g.type==="total"?"#42A5F5":g.delta>=0?"#66BB6A":"#EF5350";return jsxs("g",{children:[jsx("rect",{x:I,y:p,width:y,height:Math.max(C-p,4),rx:6,fill:m}),jsx("text",{x:I+y/2,y:p-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:g.end.toFixed(1)})]},g.name)})]}),jsx(Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${a.length}, minmax(0, 1fr))`,gap:1},children:a.map(g=>jsx(Typography,{variant:"caption",noWrap:true,title:g.name,children:g.name},g.name))})]})};var pn=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>{let r=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${r}&zoom=${o}&maptype=${a}`},q1=(e,t=360)=>{let o=pn(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var md=({apiKey:e,query:t,embedUrl:o,zoom:a=14,mapType:r="roadmap",height:n=320})=>{let i=o||(e&&t?pn({apiKey:e,query:t,zoom:a,mapType:r}):"");return i?jsxs(Box,{children:[jsx(Box,{component:"iframe",src:i,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsx(Link,{href:i,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsx(Box,{children:jsx(Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var mi=({keyword:e,location:t,src:o="orbcafe-ui"})=>{if(t){let a=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${a}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return e?`https://uri.amap.com/search?keyword=${encodeURIComponent(e)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var yd=({keyword:e,location:t,embedUrl:o,height:a=320})=>{let r=o||mi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxs(Box,{children:[jsx(Box,{component:"iframe",src:r,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:a,border:0,borderRadius:2}}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsx(Link,{href:r,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var bd=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:a})=>{let{t:r}=q();return jsxs(Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsx(oi,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsx(ln,{data:e,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:n=>a?.onPrimaryDimensionClick?.(n.name)})}),jsx(oi,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsx(ln,{data:t,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:n=>a?.onSecondaryDimensionClick?.(n.name)})}),jsx(oi,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsx(di,{data:o,variant:"donut",activeName:a?.filters?.status,onItemClick:n=>a?.onStatusClick?.(n.name)})})]})};var qo=e=>jsx(TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var il=e=>jsx(TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var qf=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],_f=["zh","en","de","fr","ja","ko"],Cd=({open:e,onClose:t,value:o,onSaveAll:a,modelOptions:r=qf,promptLangOptions:n=_f,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:s})=>{let[l,g]=useState(o),[f,u]=useState(d||""),[y,I]=useState(s||""),[p,C]=useState(false);useEffect(()=>{e&&(g(o),u(d||""),I(s||""));},[e,o,d,s]);let m=(x,k)=>{g(L=>({...L,[x]:k}));},b=async()=>{if(a)try{C(!0),await a({settings:l,analysisTemplateId:f||void 0,responseTemplateId:y||void 0});}finally{C(false);}};return jsxs(Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"lg",children:[jsxs(DialogTitle,{sx:{pr:7,pb:2.2},children:[jsx(Typography,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),jsx(IconButton,{onClick:t,sx:{position:"absolute",right:12,top:12},children:jsx(Kf,{})})]}),jsx(DialogContent,{sx:{pt:"18px !important"},children:jsxs(Stack,{spacing:2.2,children:[jsxs(Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsx(Box,{children:jsx(qo,{size:"small",value:l.baseUrl,onChange:x=>m("baseUrl",x.target.value),fullWidth:true,label:"Base URL"})}),jsx(Box,{children:jsx(qo,{size:"small",type:"password",value:l.apiKey,onChange:x=>m("apiKey",x.target.value),fullWidth:true,label:"API Key"})}),jsx(Box,{children:jsx(qo,{size:"small",value:l.model,onChange:x=>m("model",x.target.value),fullWidth:true,select:true,label:"Model",children:r.map(x=>jsx(MenuItem,{value:x,children:x},x))})}),jsx(Box,{children:jsx(qo,{size:"small",value:l.promptLang,onChange:x=>m("promptLang",x.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(x=>jsx(MenuItem,{value:x,children:x},x))})})]}),jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxs(qo,{size:"small",value:f,onChange:x=>u(x.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsx(MenuItem,{value:"",children:"Default"}),i.map(x=>jsx(MenuItem,{value:x.id,children:x.label},x.id))]}),jsx(il,{multiline:true,minRows:8,value:l.analysisPrompt,onChange:x=>m("analysisPrompt",x.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxs(qo,{size:"small",value:y,onChange:x=>I(x.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsx(MenuItem,{value:"",children:"Default"}),c.map(x=>jsx(MenuItem,{value:x.id,children:x.label},x.id))]}),jsx(il,{multiline:true,minRows:8,value:l.responsePrompt,onChange:x=>m("responsePrompt",x.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxs(DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsx(Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsx(Button,{variant:"contained",onClick:b,disabled:!a||p,children:"Save"})]})]})};var bi=({open:e,onClose:t,model:o,tableContent:a,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:c}=q(),[d,s]=useState(i?.defaultPrompt||""),[l,g]=useState(false),[f,u]=useState(false),y=n?.enabled!==false&&!!n,I=i?.enabled!==false,p=n?.filters||{},C=!!(p.primaryDimension||p.secondaryDimension||p.status),m=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{e&&s(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let b=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},x=async()=>{let k=d.trim();if(!(!k||!i?.onSubmit))try{g(!0),await i.onSubmit(k,{filters:p,model:o});}finally{g(false);}};return jsx(Dialog,{open:e,onClose:t,fullScreen:true,children:jsxs(Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsx(Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxs(Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsx(Typography,{variant:"h5",fontWeight:800,children:o.title}),jsx(Chip,{size:"small",label:c("graph.records",{count:o.kpis.totalRecords})}),y&&p.primaryDimension&&jsx(Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${p.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),y&&p.secondaryDimension&&jsx(Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${p.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),y&&p.status&&jsx(Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${p.status}`,onDelete:()=>n?.onClearFilter("status")}),y&&C&&jsx(Button,{size:"small",onClick:()=>n?.onClearAll(),children:"Clear"})]}),jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{width:{xs:"100%",lg:"auto"}},children:[I&&jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minWidth:{xs:0,lg:520},flex:{xs:1,lg:"0 0 auto"}},children:[jsx(IconButton,{size:"small",onClick:i?.onVoiceInput,children:jsx(Jf,{sx:{fontSize:18,color:"text.secondary"}})}),jsx(InputBase,{fullWidth:true,value:d,onChange:k=>s(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),x());},placeholder:m,sx:{fontSize:"0.9rem"}}),jsx(IconButton,{size:"small",onClick:x,disabled:l||!d.trim(),children:jsx(th,{sx:{fontSize:18}})}),jsx(IconButton,{size:"small",onClick:()=>u(true),children:jsx(eh,{sx:{fontSize:18}})})]}),jsx(IconButton,{onClick:t,children:jsx(Kf,{})})]})]})}),jsxs(Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsx(ed,{kpis:o.kpis}),jsx(bd,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:y?{filters:p,onPrimaryDimensionClick:k=>n?.onPrimaryDimensionClick(k),onSecondaryDimensionClick:k=>n?.onSecondaryDimensionClick(k),onStatusClick:k=>n?.onStatusClick(k)}:void 0}),r,a]}),jsx(Cd,{open:f,onClose:()=>u(false),value:b,onSaveAll:i?.onSaveAll,modelOptions:i?.modelOptions,promptLangOptions:i?.promptLangOptions,analysisTemplateOptions:i?.analysisTemplateOptions,responseTemplateOptions:i?.responseTemplateOptions,defaultAnalysisTemplateId:i?.defaultAnalysisTemplateId,defaultResponseTemplateId:i?.defaultResponseTemplateId})]})})};var fo={primaryDimension:["Client","Customer","Category","Project"],secondaryDimension:["Person","Consultant","Owner","Name"],status:["Status","state"],date:["Date","WorkDate","CreatedAt"],description:["Description","Task","Title","Memo"],reportHours:["Report_Hour","Report Hours","Hours","ReportHours"],billableHours:["Billable_Hour","Billable Hours","BillableHours"],amount:["Amount","Billable_Amount","Total_Amount","Value"]},oh=5,kd=e=>e.toLowerCase().replace(/[\s_-]/g,""),ho=(e,t,o,a)=>{if(t)return t;if(e.length===0)return a;let r=Object.keys(e[0]),n=new Map(r.map(i=>[kd(i),i]));for(let i of o){let c=n.get(kd(i));if(c)return c}return r[0]||a},Gt=e=>{if(typeof e=="number")return Number.isFinite(e)?e:0;if(typeof e=="string"){let t=Number(e.replace(/,/g,"").trim());return Number.isFinite(t)?t:0}return 0},kt=(e,t)=>e==null||e===""?t:String(e),rh=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=kt(i[t],r);n.set(c,(n.get(c)||0)+Gt(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,a)},nh=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=kt(c[t],n),s=i.get(d)||{report:0,billable:0};s.report+=Gt(c[o]),s.billable+=Gt(c[a]),i.set(d,s);}),Array.from(i.entries()).map(([c,d])=>({name:c,value:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>c.value-d.value).slice(0,r)},ih=(e,t,o)=>{let a=e.length;if(a===0)return [];let r=new Map;return e.forEach(n=>{let i=kt(n[t],o);r.set(i,(r.get(i)||0)+1);}),Array.from(r.entries()).map(([n,i])=>({name:n,value:i,percent:i/a*100}))},Sd=(e,t,o)=>{let a=new Map;return e.forEach(r=>{let n=kt(r[t],"N/A");a.set(n,(a.get(n)||0)+Gt(r[o]));}),Array.from(a.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},sh=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=kt(c[t],n),s=i.get(d)||{report:0,billable:0};s.report+=Gt(c[o]),s.billable+=Gt(c[a]),i.set(d,s);}),Array.from(i.entries()).map(([c,d])=>({name:c,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>d.barValue-c.barValue).slice(0,r)},lh=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=kt(i[t],r),d=kt(i[o],r),s=`${c}__${d}`;n.set(s,(n.get(s)||0)+Gt(i[a]));}),Array.from(n.entries()).map(([i,c])=>{let[d,s]=i.split("__");return {x:d,y:s,value:c}})},ch=(e,t,o)=>{let a=Sd(e,t,o),r=a.map(i=>({name:i.name,value:i.value,type:"delta"})),n=a.reduce((i,c)=>i+c.value,0);return [...r,{name:"Total",value:n,type:"total"}]},dh=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=kt(c[t],n),s=`${kt(c[o],n)} / ${kt(c[a],n)}`,l=i.get(d)||new Map;l.set(s,(l.get(s)||0)+1),i.set(d,l);}),Array.from(i.entries()).map(([c,d])=>({title:c,causes:Array.from(d.entries()).sort((s,l)=>l[1]-s[1]).slice(0,r).map(([s,l])=>`${s} (${l})`)})).slice(0,6)},Dr=({rows:e,config:t})=>{let{t:o}=q(),a=o("graph.unassigned"),r=useMemo(()=>{let l=t?.fieldMapping;return {primaryDimension:ho(e,l?.primaryDimension,fo.primaryDimension,"Category"),secondaryDimension:ho(e,l?.secondaryDimension,fo.secondaryDimension,"Owner"),status:ho(e,l?.status,fo.status,"Status"),date:ho(e,l?.date,fo.date,"Date"),description:ho(e,l?.description,fo.description,"Description"),reportHours:ho(e,l?.reportHours,fo.reportHours,"ReportHours"),billableHours:ho(e,l?.billableHours,fo.billableHours,"BillableHours"),amount:ho(e,l?.amount,fo.amount,"Amount")}},[e,t?.fieldMapping]),n=useMemo(()=>e.map((l,g)=>{let f=Gt(l[r.reportHours]),u=Gt(l[r.billableHours]),y=Gt(l[r.amount]),I=f>0?u/f*100:0;return {id:`graph-row-${g}`,Date:kt(l[r.date],""),Primary:kt(l[r.primaryDimension],a),Secondary:kt(l[r.secondaryDimension],a),Description:kt(l[r.description],""),ReportHours:f,BillableHours:u,Amount:y,Efficiency:I,Status:kt(l[r.status],a)}}),[e,r,a]),i=useMemo(()=>{let l=n.length,g=n.reduce((C,m)=>C+Gt(m.ReportHours),0),f=n.reduce((C,m)=>C+Gt(m.BillableHours),0),u=n.reduce((C,m)=>C+Gt(m.Amount),0),y=g>0?f/g*100:0,I=t?.statusFlagValues||["flag","flagged","warning","risk"],p=n.filter(C=>I.includes(kt(C.Status,"").toLowerCase())).length;return {totalRecords:l,totalReportHours:g,totalBillableHours:f,efficiency:y,totalAmount:u,flaggedCount:p}},[n,t?.statusFlagValues]),c=t?.topN||oh,d=useMemo(()=>({billableByPrimary:rh(n,"Primary","BillableHours",c,a),efficiencyBySecondary:nh(n,"Secondary","ReportHours","BillableHours",c,a),statusDistribution:ih(n,"Status",a),lineByDate:Sd(n,"Date","BillableHours"),comboByPrimary:sh(n,"Primary","ReportHours","BillableHours",c,a),heatmapPrimarySecondary:lh(n,"Primary","Secondary","BillableHours",a),waterfallBillable:ch(n,"Date","BillableHours"),fishboneStatusCauses:dh(n,"Status","Primary","Secondary",3,a)}),[n,c,a]),s=useMemo(()=>({title:t?.title||o("graph.reportTitle"),kpis:i,charts:d,table:{columns:[{id:"Date",label:r.date},{id:"Primary",label:r.primaryDimension},{id:"Secondary",label:r.secondaryDimension},{id:"Description",label:r.description},{id:"ReportHours",label:o("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:o("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:r.status}],rows:n}}),[d,t?.title,r,i,n,o]);return {fieldMapping:r,model:s}};var Mr=e=>String(e??"").trim(),vi=(e={})=>{let[t,o]=useState(e),a=useCallback((d,s)=>{o(l=>{let g=s?.trim();if(!g){let f={...l};return delete f[d],f}if(l[d]===g){let f={...l};return delete f[d],f}return {...l,[d]:g}});},[]),r=useCallback(d=>{o(s=>{if(!s[d])return s;let l={...s};return delete l[d],l});},[]),n=useCallback(()=>{o({});},[]),i=useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=useCallback((d,s)=>d.filter(l=>!(t.primaryDimension&&Mr(l[s.primaryDimension])!==Mr(t.primaryDimension)||t.secondaryDimension&&Mr(l[s.secondaryDimension])!==Mr(t.secondaryDimension)||t.status&&Mr(l[s.status])!==Mr(t.status))),[t]);return {filters:t,setFilter:a,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:c}};var ki=({variants:e,currentVariantId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=q(),d=useTheme().palette.mode==="dark",s="0.85rem",l={xs:"calc((100% - 1 * 16px) / 2)",sm:"calc((100% - 2 * 16px) / 3)",md:"calc((100% - 3 * 16px) / 4)",lg:"calc((100% - 5 * 16px) / 6)"},[g,f]=useState(false),[u,y]=useState(""),[I,p]=useState(false),[C,m]=useState(false),b=e.find(L=>L.id===t),x=()=>{y(b?.name||i("variant.newVariant")),p(b?.isDefault||false),m(b?.isPublic||false),f(true);},k=()=>{a({name:u,isDefault:I,isPublic:C,description:""}),f(false);};return jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsx(Autocomplete,{size:"small",sx:{width:l,"& .MuiInputBase-root":{fontSize:s,bgcolor:d?"rgba(25, 118, 210, 0.2)":"#e7f1ff","& .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.45)":"rgba(25,118,210,0.45)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.7)":"rgba(25,118,210,0.65)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.9)":"rgba(25,118,210,0.85)"}},"& .MuiInputBase-input":{fontSize:s},"& .MuiAutocomplete-noOptions":{fontSize:s}},noOptionsText:jsx(Typography,{sx:{fontSize:s},children:i("variant.noOptions")}),options:e,getOptionLabel:L=>L.name+(L.isDefault?` (${i("variant.defaultSuffix")})`:""),value:b||null,onChange:(L,P)=>{P&&o(P);},renderInput:L=>jsx(TextField,{...L,variant:"outlined",size:"small",InputProps:{...L.InputProps,sx:{fontSize:s,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(L,P)=>jsx("li",{...L,children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsx(Typography,{sx:{flex:1,fontSize:s},children:P.name}),P.isDefault&&jsx(kh,{fontSize:"small",color:"action"})]})})}),jsx(Tooltip,{title:i("variant.saveView"),children:jsx(IconButton,{onClick:x,size:"small",color:"primary",children:jsx(Ud,{fontSize:"small"})})}),jsxs(Dialog,{open:g,onClose:()=>f(false),children:[jsx(DialogTitle,{children:i("variant.saveView")}),jsxs(DialogContent,{children:[jsx(TextField,{autoFocus:true,margin:"dense",label:i("variant.viewName"),fullWidth:true,variant:"outlined",value:u,onChange:L=>y(L.target.value)}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:I,onChange:L=>p(L.target.checked)}),label:i("variant.setDefault")}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:C,onChange:L=>m(L.target.checked)}),label:i("variant.publicAllUsers")})]}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>f(false),children:i("common.cancel")}),jsx(Button,{onClick:k,variant:"contained",children:i("common.save")})]})]})]})};var Ad=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:a,layoutRefs:r,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:s,currentVariantId:l,onVariantChange:g})=>{let{t:f}=q(),[u,y]=useState([]),[I,p]=useState(""),C=`orbcafe.variants.${e}.${t}`,m=l!==void 0?l:I,b=M=>{l===void 0&&p(M),g&&g(M);},x=useCallback(()=>{try{let M=localStorage.getItem(C);if(!M)return [];let S=JSON.parse(M);return Array.isArray(S)?S:[]}catch{return []}},[C]),k=useCallback(M=>{try{localStorage.setItem(C,JSON.stringify(M));}catch{}},[C]),L=useCallback(M=>{y(M);let S=M.find(D=>D.isDefault);S&&!m&&(b(S.id),n(S));},[m,n,b]),P=useCallback(async()=>{if(!e)return [];try{let M=[];if(i)M=await i.getVariants(e,t);else if(c){let S=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!S.ok)throw new Error(f("variant.toast.fetchFailed"));M=await S.json();}else M=x();return L(M),M}catch(M){console.error("Error fetching variants",M);let S=x();return L(S),d&&d(f("variant.toast.fetchFailed")),S}},[e,t,i,c,x,L,d,f]);return useEffect(()=>{P();},[e,t]),jsx(ki,{variants:u,currentVariantId:m,onLoad:M=>{b(M.id),n(M);},onSave:async M=>{let S=Date.now().toString(),D;try{let B=u.find(Y=>Y.name===M.name);S=B?B.id:Date.now().toString();let H=[];if(B&&(Array.isArray(B.filters)?H=[...B.filters]:B.filters&&(H=[{scope:"default",filters:B.filters}])),M.scope==="Search"||M.scope==="Both"){let Y=(Array.isArray(o),o);if(Y)if(Array.isArray(Y)&&Y.length>0&&Y[0].scope)Y.forEach(ee=>{let te=H.findIndex(oe=>oe.scope===ee.scope);te>=0?H[te]=ee:H.push(ee);});else {let ee={scope:t,filters:Y},te=H.findIndex(oe=>oe.scope===t);te>=0?H[te]=ee:H.push(ee);}}let V=B?.layout||{},_=[];if(B&&Array.isArray(B.layoutRefs)&&(_=[...B.layoutRefs]),M.scope==="Layout"||M.scope==="Both")if(r&&r.length>0)r.forEach(Y=>{let ee=_.findIndex(te=>te.tableKey===Y.tableKey);ee>=0?_[ee]=Y:_.push(Y);});else {let Y={tableKey:t,layoutId:a||null},ee=_.findIndex(te=>te.tableKey===t);ee>=0?_[ee]=Y:_.push(Y);}if(D={appId:e,tableKey:t,...M,id:S,createdAt:new Date().toISOString(),filters:H,layout:V,layoutRefs:_},i)await i.saveVariant(D,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let ee=u.some(te=>te.id===S)?u.map(te=>te.id===S?D:te):[...u,D];y(ee),k(ee);}s&&s(f("variant.toast.saveSuccess")),(i||c)&&await P(),b(S),n(D);}catch(B){console.error("Error saving variant",B);let V=u.some(_=>_.id===S)?u.map(_=>_.id===S?D:_):[...u,D];y(V),k(V),b(S),n(D),d&&d(f("variant.toast.saveFailed"));}},onDelete:async M=>{try{if(i)await i.deleteVariant(M);else if(c){if(!(await fetch(`${c}/api/variants/${M}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let S=u.filter(D=>D.id!==M);y(S),k(S);}m===M&&b(""),(i||c)&&P(),s&&s(f("variant.toast.deleteSuccess"));}catch(S){console.error("Error deleting variant",S);let D=u.filter(B=>B.id!==M);y(D),k(D),m===M&&b(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async M=>{try{let S=u.find(B=>B.id===M);if(!S)return;let D={appId:e,tableKey:t,...S,isDefault:!0};if(i)await i.setDefaultVariant(M,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let B=u.map(H=>({...H,isDefault:H.id===M}));y(B),k(B);}(i||c)&&await P(),s&&s(f("variant.toast.defaultSuccess"));}catch(S){console.error("Error setting default variant",S);let D=u.map(B=>({...B,isDefault:B.id===M}));y(D),k(D),d&&d(f("variant.toast.defaultFailed"));}}})};Zo.extend(Wh);Zo.extend($h);var Hh=[null,null],pl="0.85rem",Gh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Uh=styled(PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:o,isEnd:a,isHovered:r})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...r&&!t&&!o&&!a&&{borderRadius:0,backgroundColor:e.palette.action.hover,border:`1px dashed ${e.palette.primary.main}`},...o&&{borderRadius:"50% 0 0 50%",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...a&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&a&&{borderRadius:"50%"}})),Ed=({label:e,value:t=Hh,onChange:o})=>{let{t:a,locale:r}=q(),n=Gh[r]||"en",i=e||a("dateRange.label"),[c,d]=useState(null),[s,l]=useState(t),[g,f]=useState("start"),[u,y]=useState(null),[I,p]=useState((t[0]||Zo()).locale(n)),C=ut__default.useRef(t);useEffect(()=>{let[S,D]=t,[B,H]=C.current,V=ee=>ee&&typeof ee.isSame=="function",_=!(S===null&&B===null||V(S)&&V(B)&&S.isSame(B,"day")),Y=!(D===null&&H===null||V(D)&&V(H)&&D.isSame(H,"day"));(_||Y)&&(l(t),t[0]&&V(t[0])&&p(t[0].locale(n))),C.current=t;},[t,n]);let m=S=>{d(S.currentTarget);},b=()=>{d(null),f("start"),y(null);},x=!!c,k=S=>{if(!S)return;let D=[...s];if(g==="start")D=[S,null],f("end");else {let B=D[0];B&&S.isBefore(B)?(D=[S,null],f("end")):(D=[B,S],f("start"));}l(D);},L=S=>{let D=Zo().locale(n),B=[null,null];switch(S){case "today":B=[D,D];break;case "week":B=[D.startOf("week"),D.endOf("week")];break;case "month":B=[D.startOf("month"),D.endOf("month")];break}l(B),f("start"),p(D);},P=()=>{l([null,null]),f("start"),p(Zo().locale(n));},w=()=>{o&&o(s),b();},E=()=>{l(t),f("start"),b();},T=useCallback(S=>{let{day:D,...B}=S,[H,V]=s,_=H?D.isSame(H,"day"):false,Y=V?D.isSame(V,"day"):false,ee=H&&V?D.isBetween(H,V,"day","()"):false,te=false;return g==="end"&&H&&!V&&u&&D.isAfter(H,"day")&&D.isBefore(u.add(1,"day"),"day")&&(te=true),jsx(Uh,{...B,day:D,disableMargin:true,isStart:_,isEnd:Y,isInRange:ee||te,onMouseEnter:()=>y(D)})},[s,g,u]),v=S=>S?S.locale(n).format("YYYY-MM-DD"):"",M=S=>S?S.locale(n).format("ll"):"";return jsxs(Box,{children:[jsx(TextField,{label:i,value:s[0]?`${v(s[0])} - ${v(s[1])}`:"",onClick:m,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:pl}},InputProps:{readOnly:true,sx:{fontSize:pl,"& .MuiOutlinedInput-input":{fontSize:pl},paddingRight:"4px"},endAdornment:jsxs(InputAdornment,{position:"end",sx:{ml:0},children:[(s[0]||s[1])&&jsx(IconButton,{size:"small",onClick:S=>{S.stopPropagation(),P();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsx(Vh,{sx:{fontSize:"1rem"}})}),jsx(IconButton,{size:"small",edge:"end",onClick:m,sx:{padding:"2px"},children:jsx(zh,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxs(Popover,{open:x,anchorEl:c,onClose:b,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,minWidth:320}}},children:[jsx(Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxs(Stack,{direction:"row",alignItems:"center",spacing:2,justifyContent:"space-between",children:[jsxs(Box,{sx:{p:1,border:1,borderColor:g==="start"?"primary.main":"divider",borderRadius:1,bgcolor:g==="start"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>f("start"),children:[jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.startDate")}),jsx(Typography,{variant:"body2",fontWeight:500,children:s[0]?M(s[0]):a("dateRange.select")})]}),jsx(Oh,{color:"action",fontSize:"small"}),jsxs(Box,{sx:{p:1,border:1,borderColor:g==="end"?"primary.main":"divider",borderRadius:1,bgcolor:g==="end"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>{s[0]&&f("end");},children:[jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.endDate")}),jsx(Typography,{variant:"body2",fontWeight:500,children:s[1]?M(s[1]):a("dateRange.select")})]})]})}),jsx(Box,{sx:{p:2,pb:0},children:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsx(Chip,{label:a("dateRange.today"),onClick:()=>L("today"),clickable:true,size:"small",variant:"outlined"}),jsx(Chip,{label:a("dateRange.thisWeek"),onClick:()=>L("week"),clickable:true,size:"small",variant:"outlined"}),jsx(Chip,{label:a("dateRange.thisMonth"),onClick:()=>L("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsx(LocalizationProvider,{dateAdapter:AdapterDayjs,adapterLocale:n,children:jsx(DateCalendar,{value:null,referenceDate:I,onMonthChange:p,onYearChange:p,onChange:k,slots:{day:T},views:["day"],showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsx(Divider,{}),jsxs(Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsx(Button,{size:"small",onClick:E,color:"inherit",children:a("common.cancel")}),jsx(Button,{size:"small",variant:"contained",onClick:w,children:a("common.done")})]})]})]})};var Ti={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},ty={equals:"smartFilter.operator.equals",contains:"smartFilter.operator.contains",notContains:"smartFilter.operator.notContains",wildcard:"smartFilter.operator.wildcard","=":"smartFilter.operator.equals","!=":"smartFilter.operator.notEquals",">":"smartFilter.operator.greaterThan","<":"smartFilter.operator.lessThan",">=":"smartFilter.operator.greaterOrEqual","<=":"smartFilter.operator.lessOrEqual",between:"smartFilter.operator.between"},ay=["equals","contains","notContains","wildcard"],zd=["=","!=",">","<",">=","<=","between"],Xe="0.85rem",oy=({field:e,value:t,onChange:o})=>{let{t:a}=q(),[r,n]=useState(null),[i,c]=useState(null),[d,s]=useState(""),[l,g]=useState(""),[f,u]=useState(false),[y,I]=useState(""),[p,C]=useState("");useEffect(()=>{let v=setTimeout(()=>{C(y);},1e3);return ()=>clearTimeout(v)},[y]);let m=t?.operator||(e.type==="number"?"=":"equals"),b=t?.value,x=v=>{let M=ty[v];return M?a(M):v},k=v=>{n(v.currentTarget);},L=v=>{o({...t,operator:v,value:b}),n(null);},P={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:Xe}},InputProps:{sx:{fontSize:Xe}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Xe,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},w=e.type||"text";if(w==="date"){let M=(S=>{if(!S)return [null,null];if(Array.isArray(S)&&S.length===2){let D=S[0]?Zo.isDayjs(S[0])?S[0]:Zo(S[0]):null,B=S[1]?Zo.isDayjs(S[1])?S[1]:Zo(S[1]):null;return [D,B]}return Zo.isDayjs(S)||typeof S=="string"?[Zo.isDayjs(S)?S:Zo(S),null]:[null,null]})(b);return jsx(Ed,{label:e.label,value:M,onChange:S=>o({value:S,operator:"between"})})}if(w==="number"&&m==="between"){let v=()=>{o({value:[d,l],operator:"between"}),c(null);},M=Array.isArray(b)?`${b[0]||""} - ${b[1]||""}`:"";return jsxs(Fragment,{children:[jsx(TextField,{...P,label:e.label,value:M,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...P.InputProps,startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Tooltip,{title:x("between"),children:jsx(IconButton,{size:"small",onClick:k,sx:{width:24,height:24,fontSize:Xe},children:Ti.between})})}),readOnly:true},onClick:S=>c(S.currentTarget)}),jsx(Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Xe,minHeight:"auto",py:.5}}},children:zd.map(S=>jsxs(MenuItem,{selected:S===m,onClick:()=>L(S),children:[jsx(Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ti[S]}),jsx(ListItemText,{primary:x(S),primaryTypographyProps:{fontSize:Xe}})]},S))}),jsx(Popover,{open:!!i,anchorEl:i,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxs(Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsx(TextField,{size:"small",label:a("smartFilter.min"),type:"number",value:d,onChange:S=>s(S.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Xe}},InputProps:{sx:{fontSize:Xe}}}),jsx(ey,{color:"action"}),jsx(TextField,{size:"small",label:a("smartFilter.max"),type:"number",value:l,onChange:S=>g(S.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Xe}},InputProps:{sx:{fontSize:Xe}}}),jsx(Button,{variant:"contained",size:"small",onClick:v,children:a("common.ok")})]})})]})}if(w==="select")return jsxs(TextField,{...P,select:true,label:e.label,value:b||"",onChange:v=>o({...t,value:v.target.value,operator:"equals"}),children:[jsx(MenuItem,{value:"",children:jsx("em",{children:a("common.none")})}),e.options?.map(v=>jsx(MenuItem,{value:v.value,children:v.label},v.value))]});if(w==="multi-select"){let v=Array.isArray(b)?b:[],M=e.options?.filter(S=>S.label.toLowerCase().includes(p.toLowerCase()))||[];return jsxs(TextField,{...P,select:true,label:e.label,value:v,onChange:S=>o({...t,value:S.target.value,operator:"anyOf"}),SelectProps:{...P.SelectProps,multiple:true,onClose:()=>{I(""),C("");},renderValue:S=>{if(!Array.isArray(S)||S.length===0)return jsx("em",{children:a("common.none")});let D=H=>e.options?.find(V=>V.value===H)?.label||H,B=S.map(D);return B.length>2?`${B.slice(0,2).join(", ")} +${B.length-2}`:B.join(", ")}},children:[jsx(ListSubheader,{children:jsx(TextField,{size:"small",autoFocus:true,placeholder:a("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Nd,{fontSize:"small"})}),sx:{fontSize:Xe}},value:y,onChange:S=>I(S.target.value),onKeyDown:S=>{S.key!=="Escape"&&S.stopPropagation();},onClick:S=>S.stopPropagation()})}),M.length>0?M.map(S=>jsxs(MenuItem,{value:S.value,children:[jsx(Checkbox,{checked:v.indexOf(S.value)>-1,size:"small"}),jsx(ListItemText,{primary:S.label,primaryTypographyProps:{fontSize:Xe}})]},S.value)):jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:a("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:Xe}})})]})}let E=w==="number"?zd:ay,T=f||b!==void 0&&b!==""&&b!==null||!!r;return jsxs(Fragment,{children:[jsx(TextField,{...P,label:e.label,sx:{minWidth:"120px"},value:b||"",type:w==="number"?"number":"text",onChange:v=>o({...t,value:v.target.value,operator:m}),onFocus:()=>u(true),onBlur:()=>u(false),InputProps:{...P.InputProps,startAdornment:T?jsx(InputAdornment,{position:"start",children:jsx(Tooltip,{title:x(m),children:jsx(IconButton,{size:"small",onClick:k,onMouseDown:v=>v.preventDefault(),sx:{width:24,height:24,fontSize:Xe,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Ti[m]})})}):null,endAdornment:e.hasSearchIcon?jsx(InputAdornment,{position:"end",children:jsx(Nd,{color:"action"})}):void 0}}),jsx(Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Xe,minHeight:"auto",py:.5}}},children:E.map(v=>jsxs(MenuItem,{selected:v===m,onClick:()=>L(v),children:[jsx(Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ti[v]}),jsx(ListItemText,{primary:x(v),primaryTypographyProps:{fontSize:Xe}})]},v))})]})},Qo=({fields:e,filters:t,onFilterChange:o,variants:a=[],currentVariantId:r,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:s,loading:l=false,appId:g,tableKey:f,currentLayout:u,currentLayoutId:y,layoutRefs:I,variantService:p,serviceUrl:C})=>{let{t:m}=q(),[b,x]=useState(true),[k,L]=useState(null),[P,w]=useState(e.filter(M=>!M.hidden).map(M=>M.id)),E=(M,S)=>{o({...t,[M]:S});},T=M=>{P.includes(M)?w(P.filter(S=>S!==M)):w([...P,M]);};return jsxs(Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxs(Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g?jsx(Ad,{appId:g,tableKey:f,currentFilters:{values:t,visibleFields:P},currentLayout:u,currentLayoutId:y,layoutRefs:I,onLoad:M=>{if(!M.filters)return;let S=null;if(Array.isArray(M.filters)){let D=f||"default",B=M.filters.find(H=>H.scope===D);S=B?B.filters:null;}else S=M.filters;S&&(S.values||S.visibleFields?(S.visibleFields&&Array.isArray(S.visibleFields)&&w(S.visibleFields),S.values&&o(S.values)):o(S)),n&&n(M);},variantService:p,serviceUrl:C,currentVariantId:r}):jsx(ki,{variants:a,currentVariantId:r,onLoad:n,onSave:M=>{i&&i({...M,filters:{values:t,visibleFields:P}});},onDelete:c,onSetDefault:d}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(Tooltip,{title:m("smartFilter.addFilters"),children:jsx(Button,{onClick:M=>L(M.currentTarget),size:"small",color:"primary",startIcon:jsx(Xh,{fontSize:"small"}),sx:{textTransform:"none",fontSize:Xe,whiteSpace:"nowrap",minWidth:"fit-content"},children:m("smartFilter.adaptFilters")})}),jsx(Button,{variant:"contained",size:"small",onClick:s,disabled:l,sx:{minWidth:"52px",fontWeight:"bold",fontSize:Xe},children:m(l?"common.loading":"smartFilter.go")}),jsxs(Menu,{anchorEl:k,open:!!k,onClose:()=>L(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:Xe,minHeight:32}}}},children:[jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:m("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:Xe}})}),jsx(Divider,{}),e.map(M=>jsxs(MenuItem,{onClick:()=>T(M.id),children:[jsx(Checkbox,{checked:P.includes(M.id),size:"small"}),jsx(ListItemText,{primary:M.label,primaryTypographyProps:{fontSize:Xe}})]},M.id))]})]})]}),jsx(Collapse,{in:b,children:jsx(Box,{sx:{px:2,pb:2},children:jsx(Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(M=>P.includes(M.id)).map(M=>jsx(Grid,{size:1,children:jsx(oy,{field:M,value:t[M.id]||{value:"",operator:M.type==="number"?"=":"equals"},onChange:S=>E(M.id,S)})},M.id))})})}),jsx(Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsx(IconButton,{size:"small",onClick:()=>x(!b),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:20,height:20,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:b?jsx(Yh,{sx:{fontSize:16},color:"action"}):jsx(af,{sx:{fontSize:16},color:"action"})})})]})};var Kd=({layouts:e,currentLayoutId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=q(),[c,d]=useState(null),[s,l]=useState(false),[g,f]=useState(""),[u,y]=useState(""),[I,p]=useState({isDefault:false,isPublic:false}),C=e.find(P=>P.id===t),m=P=>{d(P.currentTarget);},b=()=>{d(null);},x=P=>{o(P),b();},k=()=>{f(""),y(""),p({isDefault:false,isPublic:false}),l(true),b();},L=()=>{g.trim()&&(a({name:g,description:u,...I}),l(false));};return jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(Tooltip,{title:i("layout.saveLayout"),children:jsx(IconButton,{onClick:k,color:"primary",size:"small",children:jsx(Ud,{})})}),jsx(Tooltip,{title:i("layout.layoutOptions"),children:jsx(IconButton,{onClick:m,color:C?"primary":"default",children:jsx(fy,{})})}),jsxs(Menu,{anchorEl:c,open:!!c,onClose:b,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsx(MenuItem,{disabled:true,children:jsx(Typography,{variant:"caption",children:i("layout.selectLayout")})}),jsxs(MenuItem,{onClick:k,children:[jsx(ListItemIcon,{children:jsx(Ud,{fontSize:"small"})}),jsx(ListItemText,{children:i("layout.saveCurrentLayout")})]}),jsx(Divider,{}),e.length===0&&jsx(MenuItem,{disabled:true,children:jsx(Typography,{variant:"body2",color:"text.secondary",children:i("layout.noSavedLayouts")})}),e.map((P,w)=>jsx(MenuItem,{onClick:()=>x(P),selected:P.id===t,children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxs(Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(Typography,{variant:"body2",fontWeight:P.id===t?"bold":"normal",noWrap:true,children:P.name})}),P.description&&jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:P.description})]}),jsxs(Box,{sx:{display:"flex",alignItems:"center"},onClick:E=>E.stopPropagation(),children:[jsx(Tooltip,{title:P.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsx(IconButton,{size:"small",onClick:E=>{E.stopPropagation(),n(P.id);},children:P.isDefault?jsx(kh,{fontSize:"small",color:"warning"}):jsx(gy,{fontSize:"small"})})}),jsx(Tooltip,{title:i("common.delete"),children:jsx(IconButton,{size:"small",color:"error",onClick:E=>{E.stopPropagation(),r(P.id);},children:jsx(zg,{fontSize:"small"})})})]})]})},P.id||w))]}),jsxs(Dialog,{open:s,onClose:()=>l(false),maxWidth:"xs",fullWidth:true,children:[jsx(DialogTitle,{children:i("layout.saveLayout")}),jsx(DialogContent,{children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[jsx(TextField,{label:i("layout.layoutName"),value:g,onChange:P=>f(P.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(P=>P.name===g)&&jsx(Typography,{variant:"caption",color:"warning.main",sx:{ml:1},children:i("layout.warningOverwrite")}),jsx(TextField,{label:i("layout.layoutDescription"),value:u,onChange:P=>y(P.target.value),fullWidth:true,size:"small"}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:I.isDefault,onChange:P=>p({...I,isDefault:P.target.checked})}),label:i("layout.useAsDefault")}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:I.isPublic,onChange:P=>p({...I,isPublic:P.target.checked})}),label:i("layout.publicAllUsers")})]})}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>l(false),children:i("common.cancel")}),jsx(Button,{onClick:L,variant:"contained",disabled:!g,children:i("common.save")})]})]})]})};var Mi=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:a,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:s}=q(),[l,g]=useState([]),[f,u]=useState(""),y=`orbcafe.layouts.${e}.${t}`,I=w=>({id:w.layoutId,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt??new Date().toISOString(),layoutData:w.layout??{}}),p=w=>({appId:e,tableKey:t,layoutId:w.id,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt,layout:w.layoutData}),C=useCallback(()=>{try{let w=localStorage.getItem(y);if(!w)return [];let E=JSON.parse(w);return Array.isArray(E)?E:[]}catch{return []}},[y]),m=useCallback(w=>{try{localStorage.setItem(y,JSON.stringify(w));}catch{}},[y]);useEffect(()=>{n!==void 0&&u(n);},[n]),useEffect(()=>{if(r&&l.length>0){let w=l.find(E=>E.id===r);w&&(u(w.id),a(w));}},[r,l,a]);let b=useCallback(async()=>{if(e){if(!i){let w=C();g(w);let E=w.find(T=>T.isDefault);E&&!f&&!r&&(u(E.id),a(E));return}try{let w=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!w.ok)throw new Error("LAYOUT_FETCH_FAILED");let T=(await w.json()).map(I);g(T);let v=T.find(M=>M.isDefault);v&&!f&&!r&&(u(v.id),a(v));}catch(w){console.error("Error fetching layouts",w);let E=C();g(E);let T=E.find(v=>v.isDefault);T&&!f&&!r&&(u(T.id),a(T)),c&&c(s("layout.toast.loadFallback"));}}},[e,t,i,c,f,a,r,C,s]);return useEffect(()=>{b();},[e,t]),jsx(Kd,{layouts:l,currentLayoutId:f,onLoad:w=>{u(w.id),a(w);},onSave:async w=>{let E=l.find(M=>M.name===w.name),T=E?E.id:Date.now().toString(),v={id:T,...w,createdAt:new Date().toISOString(),layoutData:o,isDefault:w.isDefault??false,isPublic:w.isPublic??false};if(!i){let S=l.some(D=>D.id===T)?l.map(D=>D.id===T?v:D):[...l,v];g(S),m(S),u(T),a(v),d&&d(s("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p(v))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(s("layout.toast.saveSuccess")),await b(),u(T),a(v);}catch(M){console.error("Error saving layout",M);let D=l.some(B=>B.id===T)?l.map(B=>B.id===T?v:B):[...l,v];g(D),m(D),u(T),a(v),d&&d(s("layout.toast.saveLocalSuccess")),c&&c(s("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async w=>{if(!i){let E=l.filter(T=>T.id!==w);g(E),m(E),f===w&&u(""),d&&d(s("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(w)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===w&&u(""),d&&d(s("layout.toast.deleteSuccess")),await b();}catch(E){console.error("Error deleting layout",E);let T=l.filter(v=>v.id!==w);g(T),m(T),f===w&&u(""),d&&d(s("layout.toast.deleteLocalSuccess")),c&&c(s("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async w=>{if(!i){let E=l.map(T=>({...T,isDefault:T.id===w}));g(E),m(E),d&&d(s("layout.toast.defaultLocalSuccess"));return}try{let E=l.find(v=>v.id===w);if(!E)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p({...E,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(s("layout.toast.defaultSuccess")),await b();}catch(E){console.error("Error setting default",E);let T=l.map(v=>({...v,isDefault:v.id===w}));g(T),m(T),d&&d(s("layout.toast.defaultLocalSuccess")),c&&c(s("layout.toast.backendUnavailableDefaultLocal"));}}})};var _d=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let o=e.filters.find(r=>r.scope===t);if(o)return o.filters;let a=e.filters.find(r=>r.scope==="default");return a?a.filters:null}return typeof e.filters=="object"?e.filters:null},Ai=(e,t)=>{if(!e)return {layout:null,layoutId:null};let o=null,a=null;if(Array.isArray(e.layoutRefs)){let r=e.layoutRefs.find(n=>n.tableKey===t);r&&(o=r.layoutId);}return !o&&e.layoutId&&(o=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(a=e.layout),{layoutId:o,layout:a}};function Zd(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function yy(e,t){return e==="desc"?(o,a)=>Zd(o,a,t):(o,a)=>-Zd(o,a,t)}function by(e,t){let o=e.map((a,r)=>[a,r]);return o.sort((a,r)=>{let n=t(a[0],r[0]);return n!==0?n:a[1]-r[1]}),o.map(a=>a[0])}var Fi=e=>{let t=useCallback(z=>{let G=String(z?.label??z?.id??"").length*9+64,ue=typeof z?.minWidth=="number"?z.minWidth:0;return Math.max(100,ue,G)},[]),o=useCallback(()=>(e.columns||[]).filter(z=>!!z?.numeric).map(z=>z.id),[e.columns]),[a,r]=useState(""),[n,i]=useState(e.order||"asc"),[c,d]=useState(e.orderBy||""),[s,l]=useState(e.page||0),[g,f]=useState(e.rowsPerPage||20),[u,y]=useState(e.selected||[]),[I,p]=useState(e.columns?e.columns.map(z=>z.id):[]),[C,m]=useState(e.showSummary||false),[b,x]=useState(()=>o()),[k,L]=useState([]),[P,w]=useState(new Set),[E,T]=useState(()=>{let z={};return (e.columns||[]).forEach(O=>{z[O.id]=t(O);}),z}),[v,M]=useState(null),[S,D]=useState(null),[B,H]=useState(null),[V,_]=useState(null),[Y,ee]=useState(false),[te,oe]=useState(""),[Bt,lt]=useState("");useEffect(()=>{e.layout&&ke(e.layout);},[e.layout]),useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),useEffect(()=>{e.selected!==void 0&&y(e.selected);},[e.selected]),useEffect(()=>{e.page!==void 0&&l(e.page);},[e.page]),useEffect(()=>{e.rowsPerPage!==void 0&&f(e.rowsPerPage);},[e.rowsPerPage]),useEffect(()=>{let z=o();x(O=>O.filter(ue=>z.includes(ue)));},[o]),useEffect(()=>{T(z=>{let O={...z};return (e.columns||[]).forEach(G=>{O[G.id]===void 0&&(O[G.id]=t(G));}),O});},[e.columns,t]);let Ke=useMemo(()=>{let z=e.rows||[];return a&&(z=z.filter(O=>Object.keys(O).some(G=>String(O[G]).toLowerCase().includes(a.toLowerCase())))),z},[e.rows,a]),ge=useMemo(()=>e.onSortChange||!c?Ke:by(Ke,yy(n,c)),[Ke,n,c,e.onSortChange]),De=useCallback(z=>{if(k.length===0)return z.map(we=>({type:"row",data:we,id:we[e.rowKey||"id"]}));let O=[...z].sort((we,se)=>{for(let Pe of k){if(we[Pe]<se[Pe])return -1;if(we[Pe]>se[Pe])return 1}return 0}),G=(we,se=0)=>{if(se>=k.length)return we;let Pe=k[se],ye={},Re=[];return we.forEach(Se=>{let he=Se[Pe],Ce=`${Pe}:${he}`;ye[Ce]||(ye[Ce]={key:Ce,field:Pe,value:he,children:[],count:0,level:se},Re.push(ye[Ce])),ye[Ce].children.push(Se),ye[Ce].count++;}),Re.forEach(Se=>{Se.children&&(Se.children=G(Se.children,se+1));}),Re},ue=G(O),fe=(we,se="")=>{let Pe=[];return we.forEach(ye=>{if(ye.children){let Re=se?`${se}>${ye.key}`:ye.key,Se=P.has(Re);Pe.push({type:"group",id:Re,field:ye.field,value:ye.value,level:ye.level,count:ye.count,isExpanded:Se,childIds:(function he(Ce){let je=[];return Ce.children.forEach(Pt=>{Pt.children?je=je.concat(he(Pt)):je.push(Pt[e.rowKey||"id"]);}),je})(ye)}),Se&&(Pe=Pe.concat(fe(ye.children,Re)));}else Pe.push({type:"row",data:ye,id:ye[e.rowKey||"id"],level:k.length});}),Pe};return fe(ue)},[k,P,e.rowKey]),Fe=useCallback(z=>{if(k.length===0)return [];let O=[...z].sort((fe,we)=>{for(let se of k){if(fe[se]<we[se])return -1;if(fe[se]>we[se])return 1}return 0}),G=[],ue=(fe,we,se)=>{if(we>=k.length)return;let Pe=k[we],ye=new Map;fe.forEach(Re=>{let Se=Re[Pe],he=ye.get(Se);he?he.push(Re):ye.set(Se,[Re]);}),ye.forEach((Re,Se)=>{let he=`${Pe}:${Se}`,Ce=se?`${se}>${he}`:he;G.push(Ce),ue(Re,we+1,Ce);});};return ue(O,0,""),G},[k]),Je=useMemo(()=>De(ge),[ge,De]),It=useMemo(()=>Fe(ge),[ge,Fe]),qe=useMemo(()=>{let z=(e.rows||[]).length;return typeof e.count=="number"&&e.count>z},[e.count,e.rows]),rt=useMemo(()=>qe?Je:g>0?Je.slice(s*g,s*g+g):Je,[Je,s,g,qe]),Oa=useMemo(()=>qe&&typeof e.count=="number"?e.count:Je.length,[Je.length,qe,e.count]),ka=z=>{w(O=>{let G=new Set(O);return G.has(z)?G.delete(z):G.add(z),G});},Sa=z=>{let O=It.filter(G=>G===z||G.startsWith(`${z}>`));w(G=>{let ue=new Set(G);return O.forEach(fe=>ue.add(fe)),ue});},wa=z=>{w(O=>{let G=new Set(O);return Array.from(G).forEach(ue=>{(ue===z||ue.startsWith(`${z}>`))&&G.delete(ue);}),G});},Ia=z=>{if(!z){w(new Set);return}w(new Set(It));},mt=z=>{let O=It.filter(G=>G.startsWith(`${z}>`));return O.length===0?P.has(z):P.has(z)&&O.every(G=>P.has(G))},$=z=>{let O=c===z&&n==="asc",G=c===z&&n==="desc";if(e.onSortChange){O?e.onSortChange(z,"desc"):G?e.onSortChange("","asc"):e.onSortChange(z,"asc");return}O?(i("desc"),d(z)):G?(i("asc"),d("")):(i("asc"),d(z));},de=(z,O)=>{T(G=>({...G,[z]:O}));},ne=z=>{if(z.target.checked){let O=Ke.map(G=>G[e.rowKey||"id"]);y(O),e.onSelectionChange&&e.onSelectionChange(O);return}y([]),e.onSelectionChange&&e.onSelectionChange([]);},pe=(z,O)=>{let G=O[e.rowKey||"id"],ue=u.indexOf(G),fe=[];ue===-1?fe=fe.concat(u,G):ue===0?fe=fe.concat(u.slice(1)):ue===u.length-1?fe=fe.concat(u.slice(0,-1)):ue>0&&(fe=fe.concat(u.slice(0,ue),u.slice(ue+1))),y(fe),e.onSelectionChange&&e.onSelectionChange(fe);},Oe=z=>{l(z),e.onPageChange&&e.onPageChange(z);},Me=z=>{f(z),l(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(z);},Xt=z=>{let O=I.indexOf(z),G=[...I];O===-1?G.push(z):G.splice(O,1),p(G);},ia=z=>{let O=k.indexOf(z),G=[...k];O===-1?G.push(z):G.splice(O,1),L(G);},sa=z=>{o().includes(z)&&x(G=>G.includes(z)?G.filter(ue=>ue!==z):[...G,z]);},la=z=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:I,order:n,orderBy:c,grouping:k,columnWidths:E,showSummary:C,summaryColumns:b});},ca=z=>{let{layout:O,layoutId:G}=Ai(z,e.tableKey||"default");G?(lt(G),oe(G)):(lt(""),oe("")),O&&(O.visibleColumns&&p(O.visibleColumns),O.order&&i(O.order),O.orderBy&&d(O.orderBy),O.grouping&&L(O.grouping),O.columnWidths&&T(O.columnWidths),O.showSummary!==void 0&&m(!!O.showSummary),Array.isArray(O.summaryColumns)&&x(O.summaryColumns));},ke=z=>{let O=z?.layoutData||z?.layout||z||{};O.visibleColumns&&p(O.visibleColumns),O.order&&i(O.order),O.orderBy!==void 0&&d(O.orderBy),O.grouping&&L(O.grouping),O.columnWidths&&T(O.columnWidths),O.showSummary!==void 0&&m(!!O.showSummary),Array.isArray(O.summaryColumns)&&x(O.summaryColumns),w(new Set),l(0),z?.id&&oe(z.id),lt("");};useEffect(()=>{e.layout&&ca({layout:e.layout});},[e.layout]);let ce=z=>{z.preventDefault(),_(V===null?{mouseX:z.clientX+2,mouseY:z.clientY-6}:null);},gt=()=>{_(null);},Te=useMemo(()=>{if(!C)return {};let z={};e.columns.forEach(G=>{if(G.numeric&&b.includes(G.id)){let ue=Ke.reduce((fe,we)=>{let se=parseFloat(we[G.id]);return fe+(isNaN(se)?0:se)},0);z[G.id]=ue.toFixed(2);}else z[G.id]="";});let O=e.columns.find(G=>I.includes(G.id));return O&&!O.numeric&&(z[O.id]="Total"),z},[Ke,e.columns,C,b,I]),Tt=()=>{if(!e.columns||!Ke)return;let z=e.columns.map(we=>we.label).join(","),O=Ke.map(we=>e.columns.map(se=>{let Pe=we[se.id];return `"${(Pe==null?"":String(Pe)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
1
|
+
import {a}from'./chunk-74Z76O3S.mjs';export{b as COrbCanvas}from'./chunk-74Z76O3S.mjs';import*as mt from'react';import mt__default,{createContext,useMemo,useContext,useState,useEffect,useCallback,Fragment as Fragment$1,useRef}from'react';import {usePathname,useRouter}from'next/navigation';import {ChevronRight,Search,Plus,Mic,ThumbsDown,ThumbsUp,Volume2,RefreshCw,Copy,Terminal,Clock,X,ChevronDown,Box as Box$1,Lightbulb,AlertCircle,RotateCw,Check,Clipboard,CheckCircle,XCircle,Loader2,AlertTriangle,Info,BarChart,MapPin,Globe,TrendingDown,GitBranch,Grid as Grid$1,Activity,PieChart,LineChart}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Qd from'@mui/material/Dialog';import Xd from'@mui/material/DialogTitle';import Yd from'@mui/material/DialogContent';import ug from'@mui/material/DialogContentText';import Jd from'@mui/material/DialogActions';import Cn from'@mui/material/Box';import fg from'@mui/icons-material/CheckCircle';import hg from'@mui/icons-material/Warning';import yg from'@mui/icons-material/Error';import bg from'@mui/icons-material/Info';import {styled,Box,Typography,Paper,Stack,Link,Dialog,DialogTitle,IconButton,DialogContent,MenuItem,DialogActions,Button,Chip,InputBase,useTheme,Autocomplete,TextField,Tooltip,FormControlLabel,Checkbox,Menu,ListItemText,Divider,Collapse,Grid,ListItemIcon,CircularProgress,Alert,TableContainer,Table,TableHead,TableRow,TableCell,TableBody,Tabs,Tab,LinearProgress,Avatar,AppBar,Toolbar,InputAdornment,createTheme,ThemeProvider,FormControl,Select,Switch,Portal,useMediaQuery,Drawer,Popover,ListSubheader,Badge,TableFooter}from'@mui/material';import vy from'@mui/material/Paper';import Cy from'@mui/material/Table';import ky from'@mui/material/TableBody';import js from'@mui/material/TableCell';import ap from'@mui/material/TableContainer';import Ug from'@mui/material/TableHead';import Kg from'@mui/material/TableRow';import ep from'@mui/material/TextField';import Li from'@mui/material/Button';import tp from'@mui/material/Alert';import {DndContext,closestCenter,useSensors,useSensor,PointerSensor,TouchSensor,closestCorners,DragOverlay,useDroppable,useDraggable}from'@dnd-kit/core';import {restrictToHorizontalAxis}from'@dnd-kit/modifiers';import zd from'@mui/icons-material/Search';import Mg from'@mui/icons-material/ViewColumn';import Kd from'@mui/icons-material/Save';import Bg from'@mui/icons-material/Download';import Fg from'@mui/icons-material/AccountTree';import Eg from'@mui/icons-material/Functions';import Lg from'@mui/icons-material/Insights';import Ng from'@mui/icons-material/Add';import zg from'@mui/icons-material/Edit';import Vg from'@mui/icons-material/Delete';import Og from'@mui/icons-material/KeyboardArrowLeft';import Wg from'@mui/icons-material/KeyboardArrowRight';import qg from'@mui/material/Checkbox';import _g from'@mui/material/TableSortLabel';import Zg from'@mui/material/IconButton';import jg from'@mui/material/Tooltip';import Qg from'@mui/icons-material/UnfoldMore';import Xg from'@mui/icons-material/UnfoldLess';import of from'@mui/icons-material/KeyboardArrowDown';import bf from'@mui/icons-material/Check';import xf from'@mui/icons-material/ClearAll';import qf from'@mui/icons-material/Close';import eh from'@mui/icons-material/MicNoneOutlined';import th from'@mui/icons-material/SettingsOutlined';import ah from'@mui/icons-material/SendOutlined';import Yh from'@mui/icons-material/Settings';import Jh from'@mui/icons-material/KeyboardArrowUp';import ty from'@mui/icons-material/ArrowRightAlt';import Sh from'@mui/icons-material/Star';import {DateCalendar}from'@mui/x-date-pickers/DateCalendar';import {PickersDay}from'@mui/x-date-pickers/PickersDay';import {LocalizationProvider}from'@mui/x-date-pickers/LocalizationProvider';import {AdapterDayjs}from'@mui/x-date-pickers/AdapterDayjs';import Vh from'@mui/icons-material/CalendarMonth';import Oh from'@mui/icons-material/Clear';import Wh from'@mui/icons-material/ArrowForward';import Qo from'dayjs';import $h from'dayjs/plugin/isBetween';import Hh from'dayjs/plugin/localizedFormat';import'dayjs/locale/zh-cn';import'dayjs/locale/fr';import'dayjs/locale/de';import'dayjs/locale/ja';import'dayjs/locale/ko';import fy from'@mui/icons-material/StarBorder';import hy from'@mui/icons-material/ViewQuilt';import Vb from'@mui/icons-material/CloseOutlined';import Vy from'@mui/icons-material/ContentCopyOutlined';import Oy from'@mui/icons-material/CheckOutlined';import gb from'@mui/icons-material/ExpandMore';import {arrayMove,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import {alpha,useTheme as useTheme$1}from'@mui/material/styles';import Ep from'@mui/icons-material/Language';import Sx from'@mui/icons-material/DesktopWindows';import wx from'@mui/icons-material/DarkMode';import Ix from'@mui/icons-material/LightMode';import Px from'@mui/icons-material/Logout';import H0 from'@mui/icons-material/DeleteOutline';import Qx from'@mui/icons-material/DragIndicator';import g0 from'@mui/icons-material/FilterList';import f0 from'@mui/icons-material/TableRows';import t0 from'@mui/icons-material/LayersClear';import mv from'@mui/icons-material/CameraAltRounded';import gv from'@mui/icons-material/QrCodeScannerRounded';import bv from'@mui/icons-material/DragIndicatorRounded';import kv from'@mui/icons-material/BackspaceRounded';import Sv from'@mui/icons-material/CloseRounded';import wv from'@mui/icons-material/CheckRounded';import zv from'@mui/icons-material/SearchRounded';import Vv from'@mui/icons-material/MenuOpenRounded';import Ov from'@mui/icons-material/MenuRounded';import Wv from'@mui/icons-material/ExpandMoreRounded';import $v from'@mui/icons-material/ChevronRightRounded';import sC from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import Ck from'react-markdown';import kk from'remark-gfm';import Sk from'remark-math';import wk from'rehype-katex';import Ik from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import {useTheme as useTheme$2}from'next-themes';import dm from'mermaid';import Nk from'@mui/icons-material/MicRounded';import zk from'@mui/icons-material/MicOffRounded';import {InsertDriveFile,Close,Stop}from'@mui/icons-material';import Hk from'@mui/icons-material/SendRounded';import Gk from'@mui/icons-material/AddRounded';import Uk from'@mui/icons-material/HardwareRounded';function oa(...e){return twMerge(clsx(e))}var Vs={primary:"#000000",primaryHover:"#333333"},jn={primary:"bg-primary text-primary-foreground hover:bg-primary/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"},an={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Rc=()=>"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";var Wm=cva(Rc(),{variants:{variant:{default:`${jn.primary} shadow-sm`,destructive:"bg-red-500 text-white hover:bg-red-600 active:bg-red-700 dark:bg-red-600 dark:hover:bg-red-500 dark:active:bg-red-700 shadow-sm",outline:`${jn.outline} shadow-sm`,secondary:"bg-gray-200 text-gray-700 hover:bg-gray-300 active:bg-gray-400 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600 dark:active:bg-gray-500 shadow-sm",ghost:jn.ghost,link:"text-blue-600 dark:text-blue-400 underline-offset-4 hover:underline hover:text-blue-700 dark:hover:text-blue-300 active:text-blue-800 dark:active:text-blue-200","chat-tool":"bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-text-2)] hover:bg-[var(--orbai-surface-3)] hover:border-[var(--orbai-border-strong)] hover:text-[var(--orbai-text-1)] active:scale-95 transition-all duration-200","chat-send":`bg-[${Vs.primary}] hover:bg-[${Vs.primaryHover}] text-white border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200`,"chat-stop":"bg-red-500 hover:bg-red-600 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-white transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:an.none,sm:an.sm,md:an.md,full:an.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Os=mt.forwardRef(({className:e,variant:t,size:o,asChild:a=false,...r},n)=>jsx(a?Slot:"button",{className:oa(Wm({variant:t,size:o,className:e})),ref:n,...r}));Os.displayName="Button";var Hm={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},Gm={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},Um={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},Km={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},qm={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},_m={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},on={en:Hm,zh:Gm,fr:Um,de:Km,ja:qm,ko:_m};var Mc=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,a)=>{let r=t[a];return r==null?"":String(r)}):e,Xm={locale:"en",t:(e,t)=>Mc(on.en[e]||e,t)},Ac=createContext(Xm),Bc=({locale:e="en",messages:t,children:o})=>{let a=useMemo(()=>{let r=on[e]||on.en,n=t?.[e]||{},i={...on.en,...r,...n};return {locale:e,t:(c,d)=>Mc(i[c]||c,d)}},[e,t]);return jsx(Ac.Provider,{value:a,children:o})},K=()=>useContext(Ac);function $s({items:e,onItemClick:t,className:o="",level:a=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:c}=K(),d=i==="dark",s=usePathname(),[l,g]=useState(false),[f,u]=useState(new Set),y=r!==void 0&&n!==void 0,I=y?r:f;useEffect(()=>{g(true);},[]);let p=m=>{if(y)n(m);else {let b=new Set(f);b.has(m)?b.delete(m):b.add(m),u(b);}},C=m=>{m.children&&m.children.length>0&&p(m.id),t&&t(m);};return !e||!Array.isArray(e)?jsx("div",{className:oa("tree-menu",o),children:jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsx("div",{className:oa("tree-menu",o),children:e.map(m=>{let b=I.has(m.id)||m.isExpanded,x=m.children&&m.children.length>0,k=m.appurl||m.href,L=l&&k?s===k:false;return jsxs("div",{className:"tree-menu-item relative",children:[L&&jsx("div",{className:oa("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxs(Os,{variant:"ghost",className:oa("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${a*4}`,L?d?"bg-transparent text-[#90caf9] hover:bg-gray-800/35":"bg-transparent text-[#1976d2] hover:bg-gray-100/60":d?"hover:bg-gray-800/50 text-gray-300":"hover:bg-gray-100/50 text-gray-700"),onClick:()=>C(m),children:[x&&jsx("div",{className:oa("flex-shrink-0 transition-transform duration-200",b&&"rotate-90",L?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:jsx(ChevronRight,{className:"h-4 w-4"})}),!x&&jsx("div",{className:"w-4 h-4 flex-shrink-0"}),m.icon&&jsx("div",{className:oa("flex-shrink-0 transition-colors duration-200",L?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:m.icon}),jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsx("div",{className:oa("text-sm truncate transition-colors duration-200",L?"font-semibold":"font-medium"),children:m.title||m.label}),m.description&&jsx("div",{className:oa("text-xs truncate transition-colors duration-200",L?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:m.description,children:m.description})]})]}),x&&jsx("div",{className:oa("grid transition-[grid-template-rows] duration-300 ease-in-out",b?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsx("div",{className:"overflow-hidden",children:jsx($s,{items:m.children,onItemClick:t,level:a+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},m.id)})})}var Vc=({collapsed:e,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light"})=>{let{t:i}=K(),c=n==="dark",d=useRouter(),[s,l]=useState(""),[g,f]=useState(new Set);useEffect(()=>{e&&f(new Set);},[e]);let u=useCallback(C=>{let m=[],b=x=>{x.forEach(k=>{m.push(k.id),k.children&&b(k.children);});};return b(C),m},[]),y=useMemo(()=>{if(!s.trim())return r;let C=m=>m.reduce((b,x)=>{let k=x.title?.toLowerCase().includes(s.toLowerCase())||x.description?.toLowerCase().includes(s.toLowerCase()),L=x.children?C(x.children):[];return (k||L.length>0)&&b.push({...x,children:L.length>0?L:x.children}),b},[]);return C(r)},[s,r]),I=useMemo(()=>s.trim()?new Set(u(r)):g,[s,r,g,u]),p=useCallback(async C=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",C),C.id==="chat"||C.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{d.push("/chat?new=true");}catch(b){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",b),d.push("/chat");}return}let m=C.appurl||C.href;m&&(m.startsWith("http://")||m.startsWith("https://")?window.open(m,"_blank"):d.push(m));},[d]);return jsxs("div",{className:`flex flex-col backdrop-blur-xl border shadow-[0_4px_8px_0_rgba(31,38,135,0.1)] ${e?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${c?"bg-[#111111] border-white/10":"bg-white/70 border-white/30"}`,style:{backdropFilter:"blur(16px) saturate(180%)",WebkitBackdropFilter:"blur(16px) saturate(180%)",transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out",maxHeight:a?`${a}px`:void 0},children:[jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsx("div",{className:"flex justify-center",children:jsx("button",{onClick:t,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${c?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:i("navigation.expand"),children:jsx(Search,{className:"h-5 w-5"})})}):jsxs("div",{className:`relative transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:[jsx("input",{type:"text",placeholder:i("navigation.searchPlaceholder"),value:s,onChange:C=>l(C.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${c?"border-gray-700 bg-[#1A1A1A] text-white placeholder-gray-400":"border-gray-300 bg-white text-gray-900 placeholder-gray-500"}`}),jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:jsx(Search,{className:`h-4 w-4 ${c?"text-gray-500":"text-gray-400"}`})})]})}),jsx("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${e?"px-1":"px-2"}`,children:y.length===0?jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":i(s?"navigation.noMatch":"navigation.noAccessibleApp")}):jsxs(Fragment,{children:[!e&&jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsx($s,{items:y,onItemClick:p,className:"space-y-1",expandedIds:I,colorMode:n,onToggleExpand:C=>{let m=new Set(g);y.some(x=>x.id===C)?m.has(C)?m.delete(C):(y.forEach(x=>{x.id!==C&&m.has(x.id)&&m.delete(x.id);}),m.add(C)):m.has(C)?m.delete(C):m.add(C),f(m);}})}),e&&jsx("div",{className:"space-y-2",children:r.map(C=>jsx("div",{className:"space-y-1",children:jsx("button",{onClick:()=>{t();let m=new Set([C.id]);f(m);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${c?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:i("navigation.expandView",{title:C.title||""}),children:C.icon||jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${c?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:C.title?.charAt(0)||"?"})})},C.id))})]})}),!e&&jsx("button",{onClick:t,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${c?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:i("navigation.collapse"),children:jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsx("div",{className:c?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})})]})};var Wc=(e={})=>{let{initialCollapsed:t=false,content:o=[]}=e,[a,r]=useState(t),[n,i]=useState(o),c=useCallback(()=>{r(s=>!s);},[]),d=useMemo(()=>({collapsed:a,onToggle:c,menuData:n}),[a,c,n]);return {collapsed:a,setCollapsed:r,toggleCollapsed:c,menuData:n,setMenuData:i,navigationIslandProps:d}};var Gs=e=>jsx(Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var Us=class{constructor(){a(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,o,a){this.listener&&this.listener({type:t,content:o,options:a});}hide(){this.listener&&this.listener(null);}},Za=new Us,XS={success:(e,t)=>Za.show("success",e,t),error:(e,t)=>Za.show("error",e,t),warning:(e,t)=>Za.show("warning",e,t),info:(e,t)=>Za.show("info",e,t),show:(e,t,o)=>Za.show(e,t,o),hide:()=>Za.hide()};var xg={success:{icon:jsx(fg,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsx(hg,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsx(yg,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsx(bg,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},rn=({open:e,title:t,message:o,onClose:a,onConfirm:r,confirmText:n,cancelText:i,showCancel:c=true,maxWidth:d="xs",type:s="default"})=>{let{t:l}=K(),g=n||l("messageBox.confirm"),f=i||l("messageBox.cancel"),u=()=>{r?r():a();},y=xg[s],I=s!=="default";return jsxs(Qd,{open:e,onClose:a,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...I&&{borderTop:`6px solid ${y.iconColor}`}}},children:[I&&jsx(Cn,{sx:{display:"flex",justifyContent:"center",pt:3,color:y.iconColor},children:y.icon}),t&&jsx(Xd,{sx:{textAlign:I?"center":"left",pt:I?1:2},children:t}),jsx(Yd,{sx:{textAlign:I?"center":"left"},children:typeof o=="string"?jsx(ug,{children:o}):o}),jsxs(Jd,{sx:{justifyContent:I?"center":"flex-end",pb:3,px:3},children:[c&&jsx(Gs,{onClick:a,variant:"text",color:"inherit",children:f}),jsx(Gs,{onClick:u,variant:"contained",sx:{bgcolor:I?y.iconColor:void 0,"&:hover":{bgcolor:I?y.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},gw=()=>{let[e,t]=mt__default.useState(null),[o,a]=mt__default.useState(false);mt__default.useEffect(()=>{let i=c=>{c?(t(c),a(true)):(a(false),t(null));};return Za.register(i),()=>Za.unregister()},[]);let r=()=>{a(false),e?.options?.onClose&&e.options.onClose(),t(null);},n=()=>{e?.options?.onConfirm&&e.options.onConfirm(),a(false),t(null);};return e?jsx(rn,{open:o,type:e.type,message:e.content,title:e.options?.title,onClose:r,onConfirm:n,confirmText:e.options?.confirmText,cancelText:e.options?.cancelText,showCancel:e.options?.showCancel,maxWidth:e.options?.maxWidth}):null};var Hc=({title:e,hideHeader:t,children:o})=>jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!t&&jsx(Box,{sx:{mb:2},children:jsx(Typography,{variant:"h4",children:e})}),jsx(Box,{sx:{flex:1,overflow:"hidden"},children:o})]});var Qn=e=>{let{t}=K(),o="0.85rem",a=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],r=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],n=[...a,...r],i=typeof e.rowsPerPage=="number"?e.rowsPerPage:20,c=Array.isArray(e.rowsPerPageOptions)&&e.rowsPerPageOptions.length>0?e.rowsPerPageOptions:[20,50,100,-1],d=typeof e.count=="number"?e.count:0,s=Math.max(0,typeof e.page=="number"?e.page:0),l=i===-1?1:Math.max(1,Math.ceil(d/i)),g=Math.min(s+1,l),f=s>0,u=s<l-1&&i!==-1;return jsxs(Toolbar,{sx:{pl:{sm:2},pr:{xs:1,sm:1},alignItems:"center",gap:1},children:[jsx(TextField,{size:"small",placeholder:t("table.toolbar.searchPlaceholder"),value:e.filterText,onChange:y=>e.setFilterText(y.target.value),InputProps:{sx:{fontSize:o,"& .MuiInputBase-input":{fontSize:o},"& .MuiInputBase-input::placeholder":{fontSize:o,opacity:1}},startAdornment:jsx(InputAdornment,{position:"start",children:jsx(zd,{fontSize:"small"})})},sx:{width:300}}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[jsx(Typography,{sx:{fontSize:o,color:"text.secondary",whiteSpace:"nowrap"},children:t("table.toolbar.itemsPerPage")}),jsx(Select,{size:"small",variant:"standard",value:i,disableUnderline:true,onChange:y=>e.onRowsPerPageChange?.(Number(y.target.value)),sx:{fontSize:o,fontWeight:600,minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"}},children:c.map(y=>jsx(MenuItem,{value:y,sx:{fontSize:o},children:y===-1?t("common.all"):y},`rows-per-page-${y}`))}),jsx(IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(s-1,0)),disabled:!f,sx:{p:.35},children:jsx(Og,{fontSize:"small"})}),jsx(Typography,{sx:{fontSize:o,fontWeight:600,minWidth:88,textAlign:"center"},children:t("table.toolbar.pageOf",{current:g,total:l})}),jsx(IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(s+1,l-1)),disabled:!u,sx:{p:.35},children:jsx(Wg,{fontSize:"small"})})]}),jsx(Box,{sx:{flex:1}}),jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[n.length>0&&jsx(Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:n.map((y,I)=>jsx(mt__default.Fragment,{children:y},`toolbar-custom-${I}`))}),jsx(Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),jsx(Tooltip,{title:t("table.toolbar.groupBy"),children:jsx(IconButton,{onClick:y=>e.setGroupAnchorEl(y.currentTarget),children:jsx(Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsx(Fg,{})})})}),jsx(Tooltip,{title:t("table.toolbar.summary"),children:jsx(IconButton,{onClick:y=>e.setSummaryAnchorEl(y.currentTarget),color:e.showSummary?"primary":"default",children:jsx(Eg,{})})}),jsx(Tooltip,{title:t("table.toolbar.columns"),children:jsx(IconButton,{onClick:y=>e.setAnchorEl(y.currentTarget),children:jsx(Mg,{})})}),jsx(Tooltip,{title:t("table.toolbar.export"),children:jsx(IconButton,{onClick:e.handleExport,children:jsx(Bg,{})})}),e.showCreateButton&&jsx(Tooltip,{title:t("table.toolbar.newItem"),children:jsx(IconButton,{onClick:e.onOpenCreateDialog,color:"primary",children:jsx(Ng,{})})}),e.showEditButton&&jsx(Tooltip,{title:t("table.toolbar.editItem"),children:jsx("span",{children:jsx(IconButton,{onClick:e.onOpenEditDialog,color:"primary",disabled:!!e.editDisabled,children:jsx(zg,{})})})}),e.showDeleteButton&&jsx(Tooltip,{title:t("table.toolbar.deleteItem"),children:jsx("span",{children:jsx(IconButton,{onClick:e.onOpenDeleteConfirm,color:"error",disabled:!!e.deleteDisabled,children:jsx(Vg,{})})})}),e.onOpenGraphReport&&jsx(Tooltip,{title:t("table.toolbar.graphicReport"),children:jsx(IconButton,{onClick:e.onOpenGraphReport,children:jsx(Lg,{})})}),e.onLayoutSave&&!e.layoutManager&&jsx(Tooltip,{title:t("table.toolbar.saveLayout"),children:jsx(IconButton,{onClick:y=>e.onLayoutSave(y),children:jsx(Kd,{})})}),e.layoutManager]})]})};var qc=e=>{let{t}=K(),{onSelectAllClick:o,order:a,orderBy:r,numSelected:n=0,rowCount:i=0,onRequestSort:c,columns:d,visibleColumns:s,selectionMode:l,grouping:g=[],isAllExpanded:f=false,handleToggleAll:u,onColumnResize:y,columnWidths:I}=e,[p,C]=useState(null),m=useRef(null),b=v=>M=>{p||c(v);},x=(v,M,S)=>{v.preventDefault(),v.stopPropagation(),C(M),m.current={startX:v.clientX,startWidth:S,colId:M},document.addEventListener("mousemove",k),document.addEventListener("mouseup",L),document.body.style.cursor="col-resize";},k=v=>{if(!m.current)return;let{startX:M,startWidth:S,colId:D}=m.current,B=v.clientX-M,H=Math.max(50,S+B);y&&y(D,H);},L=()=>{C(null),m.current=null,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",L),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",L);},[]);let P=l==="multiple"||l==="single",w=g.length>0&&!!u,E=t(f?"table.group.collapseAll":"table.group.expandAll"),T=d.filter(v=>s.includes(v.id));return jsx(Ug,{children:jsxs(Kg,{children:[P&&jsx(js,{padding:"checkbox",sx:v=>({width:48,position:"sticky",top:0,zIndex:4,backgroundColor:v.palette.mode==="dark"?"#000000":"#f5f5f5",color:v.palette.mode==="dark"?"#ffffff":v.palette.text.primary}),children:jsx(qg,{color:"primary",indeterminate:n>0&&n<i,checked:i>0&&n===i,onChange:o,disabled:l==="single"})}),w&&jsx(js,{align:"center",padding:"checkbox",sx:v=>({width:44,position:"sticky",top:0,zIndex:4,backgroundColor:v.palette.mode==="dark"?"#000000":"#f5f5f5",color:v.palette.mode==="dark"?"#ffffff":v.palette.text.primary}),children:jsx(jg,{title:E,children:jsx(Zg,{size:"small",onClick:v=>{v.stopPropagation(),u?.(!f);},sx:{p:.2},children:f?jsx(Xg,{fontSize:"small"}):jsx(Qg,{fontSize:"small"})})})}),T.map(v=>{let M=I?.[v.id]||v.minWidth||100;return jsxs(js,{align:"left",padding:v.disablePadding?"none":"normal",sortDirection:r===v.id?a:false,style:{width:M,minWidth:M,maxWidth:M},sx:S=>({position:"sticky",top:0,zIndex:4,backgroundColor:S.palette.mode==="dark"?"#000000":"#f5f5f5",color:S.palette.mode==="dark"?"#ffffff":S.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsx(_g,{active:r===v.id,direction:r===v.id?a:"asc",onClick:b(v.id),sx:S=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:S.palette.mode==="dark"?"#ffffff":S.palette.text.primary,opacity:r===v.id?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:S.palette.mode==="dark"?"#ffffff":S.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:S.palette.mode==="dark"?"#ffffff":S.palette.text.primary}),children:jsx(Cn,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:v.label})}),jsx(Cn,{onMouseDown:S=>x(S,v.id,typeof M=="number"?M:100),onClick:S=>S.stopPropagation(),sx:{position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize","&:hover":{backgroundColor:"primary.main",opacity:.5},zIndex:1}})]},v.id)})]})})};var jc=e=>{let{t}=K(),{visibleRows:o,visibleColumns:a,selected:r=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:s,grouping:l=[],isGroupFullyExpanded:g,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:u}=e,y=m=>r.indexOf(m)!==-1,I=s==="multiple"||s==="single",p=l.length>0,C=a.length+(I?1:0)+(p?1:0);return jsxs(TableBody,{children:[o.map((m,b)=>{if(m.type==="group"){let x=d.has(m.id),k=m.childIds||[],L=k.filter(T=>y(T)).length,P=k.length>0&&L===k.length,w=L>0&&L<k.length;return jsxs(TableRow,{sx:T=>({backgroundColor:T.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:T.palette.text.primary,borderBottomColor:T.palette.divider},"& .MuiIconButton-root":{color:T.palette.text.primary},"& .MuiCheckbox-root":{color:T.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:T.palette.primary.main}}),children:[I&&jsx(TableCell,{padding:"checkbox",children:jsx(Checkbox,{size:"small",checked:P,indeterminate:w,onChange:T=>{if(T.stopPropagation(),!!e.onSelectionChange)if(P){let v=r.filter(M=>!k.includes(M));e.onSelectionChange(v);}else {let v=Array.from(new Set([...r,...k]));e.onSelectionChange(v);}},onClick:T=>T.stopPropagation(),sx:{p:.5}})}),p&&jsx(TableCell,{padding:"checkbox",sx:{width:44},children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.25},children:[l.length>1&&m.level<l.length-1&&jsx(Tooltip,{title:g?.(m.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsx(IconButton,{size:"small",onClick:()=>{g?.(m.id)?u?.(m.id):f?.(m.id);},sx:{p:.25},children:g?.(m.id)?jsx(Xg,{fontSize:"small"}):jsx(Qg,{fontSize:"small"})})}),jsx(IconButton,{size:"small",onClick:()=>c&&c(m.id),sx:{p:.25},children:x?jsx(of,{}):jsx(Wg,{})})]})}),jsx(TableCell,{colSpan:a.length,sx:{py:1,pl:m.level*3+1},children:jsxs(Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[m.field,": ",m.value," (",m.count,")"]})})]},m.id)}else {let x=m.data||m,k=m.id||x.id||b,L=y(k),P=`enhanced-table-checkbox-${b}`,E=(m.level!==void 0?m.level:0)*4;return jsxs(TableRow,{hover:true,onClick:T=>n&&n(T,x),role:"checkbox","aria-checked":L,tabIndex:-1,selected:L,sx:{cursor:"pointer"},children:[I&&jsx(TableCell,{padding:"checkbox",sx:{pl:E>0?E+1:void 0},children:jsx(Checkbox,{color:"primary",checked:L,inputProps:{"aria-labelledby":P}})}),p&&jsx(TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(T=>a.includes(T.id)).map((T,v)=>{let S=!I&&v===0&&E>0?{pl:E+2}:{};return jsx(TableCell,{align:"left",sx:S,children:T.render?T.render(x[T.id],x):(function(){let B=x[T.id];if(T.numeric){if(typeof B=="number")return B.toLocaleString();if(typeof B=="string"&&B.trim()!==""&&!isNaN(Number(B)))return Number(B).toLocaleString()}return B})()},T.id)})]},k)}}),o.length===0&&jsx(TableRow,{children:jsx(TableCell,{colSpan:C,align:"center",children:t("common.noData")})})]})};var Qc=e=>{let{visibleColumns:t,summaryRow:o,selectionMode:a,grouping:r=[]}=e;if(!e.showSummary)return null;let n=a==="multiple"||a==="single",i=r.length>0;return jsx(TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxs(TableRow,{children:[n&&jsx(TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper"}}),i&&jsx(TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper",width:44}}),t.map(c=>jsx(TableCell,{sx:{fontWeight:"bold",fontSize:"0.85rem",bgcolor:"background.paper",color:"text.primary"},children:(function(){let s=o[c];return s==null||s===""?"":typeof s=="number"?s.toLocaleString():typeof s=="string"&&s.trim()!==""&&!isNaN(Number(s))?Number(s).toLocaleString():s})()},c))]})})};var Yc=e=>{let{t}=K();return jsx(Box,{sx:{p:2},children:jsx(Typography,{children:t("table.mobile.notImplemented")})})};var ei=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:a,columns:r,toggleGroupField:n})=>{let{t:i}=K();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxs(Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsx(Typography,{variant:"subtitle2",sx:{px:1},children:i("table.menu.groupBy")}),o.length>0&&jsx(Button,{size:"small",color:"error",onClick:()=>a([]),startIcon:jsx(xf,{}),children:i("table.menu.clearAll")})]}),jsx(Divider,{}),r.map(c=>{let d=o.includes(c.id),s=o.indexOf(c.id)+1;return jsx(MenuItem,{onClick:()=>n(c.id),children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsx(Checkbox,{checked:d,size:"small"}),jsx(ListItemText,{primary:c.label}),d&&jsx(Badge,{badgeContent:s,color:"primary",sx:{mr:2}})]})},c.id)})]})},ti=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=K();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:n("table.menu.visibleColumns")})}),jsx(Divider,{}),o.map(i=>jsxs(MenuItem,{onClick:()=>r(i.id),children:[jsx(Checkbox,{checked:a.includes(i.id),size:"small"}),jsx(ListItemText,{primary:i.label})]},i.id))]})},ai=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:a,columns:r,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=K();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsx(MenuItem,{children:jsx(FormControlLabel,{control:jsx(Switch,{checked:o,onChange:d=>a(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),jsx(Divider,{}),r.filter(d=>d.numeric).map(d=>jsxs(MenuItem,{onClick:()=>i(d.id),disabled:!o,children:[jsx(Checkbox,{checked:n.includes(d.id),size:"small"}),jsx(ListItemText,{primary:d.label})]},d.id)),r.filter(d=>d.numeric).length===0&&jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:c("table.menu.noNumericColumns")})})]})},oi=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=K();return jsxs(Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsx(MenuItem,{onClick:t,children:n("common.copy")}),jsx(Divider,{}),jsx(MenuItem,{disabled:true,children:n("table.menu.visibleColumns")}),o.map(i=>jsxs(MenuItem,{onClick:()=>r(i.id),children:[jsx(ListItemIcon,{children:a.includes(i.id)&&jsx(bf,{fontSize:"small"})}),jsx(ListItemText,{children:i.label})]},i.id))]})};var ln=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),td=({kpis:e})=>{let{t}=K(),o=[{label:t("graph.kpi.totalRecords"),value:ln(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:ln(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:ln(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:ln(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:ln(e.flaggedCount,0),color:"error.main"}];return jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(6, minmax(0, 1fr))"},gap:1.5},children:o.map(a=>jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(Typography,{variant:"caption",color:"text.secondary",children:a.label}),jsx(Typography,{variant:"h4",fontWeight:800,sx:{color:a.color},children:a.value})]},a.label))})};var ri=({title:e,subtitle:t,children:o})=>jsxs(Paper,{variant:"outlined",sx:{p:2,borderRadius:2},children:[jsx(Typography,{variant:"subtitle1",fontWeight:700,children:e}),t&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t}),o]});var dn=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:a=210,activeName:r,onItemClick:n})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=Math.max(...e.map(c=>c.value),1);return t==="vertical"?jsx(Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:a},children:e.map(c=>jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Box,{onClick:()=>n?.(c),sx:{height:`${Math.max(c.value/i*180,6)}px`,bgcolor:c.name===r?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:n?"pointer":"default",opacity:r&&c.name!==r?.45:1}}),jsx(Typography,{variant:"caption",noWrap:true,title:c.name,sx:{display:"block",mt:.5},children:c.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",children:[c.value.toFixed(1),o]})]},c.name))}):jsx(Stack,{spacing:1,children:e.map(c=>jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:c.name,children:c.name}),jsx(Box,{onClick:()=>n?.(c),sx:{alignSelf:"center",bgcolor:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:n?"pointer":"default",opacity:r&&c.name!==r?.45:1},children:jsx(Box,{sx:{width:`${c.value/i*100}%`,height:"100%",bgcolor:c.name===r?"primary.dark":"primary.main"}})}),jsxs(Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),o]})]},c.name))})};var rd=({data:e,color:t="#42A5F5",valueSuffix:o="",height:a=220})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=e.map(f=>f.value),c=Math.min(...i,0),s=Math.max(...i,1)-c||1,l=e.map((f,u)=>{let y=n+u*(r-n*2)/Math.max(e.length-1,1),I=a-n-(f.value-c)/s*(a-n*2);return {x:y,y:I,...f}}),g=l.map(f=>`${f.x},${f.y}`).join(" ");return jsxs(Box,{children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:g}),l.map(f=>jsx("circle",{cx:f.x,cy:f.y,r:4,fill:t},f.name))]}),jsx(Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(f=>jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",noWrap:true,title:f.name,sx:{display:"block"},children:f.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",children:[f.value.toFixed(1),o]})]},f.name))})]})};var nd=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:a=220})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=Math.max(...e.map(l=>l.barValue),1),c=Math.max(...e.map(l=>l.lineValue),1),d=e.map((l,g)=>{let f=(r-n*2)/e.length,u=Math.max(f*.5,8),y=n+g*f+(f-u)/2,I=l.barValue/i*(a-n*2),p=a-n-I;return {x:y,y:p,barHeight:I,barWidth:u,item:l}}),s=e.map((l,g)=>{let f=(r-n*2)/e.length,u=n+g*f+f/2,y=a-n-l.lineValue/c*(a-n*2);return {x:u,y,item:l}});return jsxs(Stack,{spacing:1.25,children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),d.map(l=>jsx("rect",{x:l.x,y:l.y,width:l.barWidth,height:Math.max(l.barHeight,4),rx:6,fill:t},l.item.name)),jsx("polyline",{fill:"none",stroke:o,strokeWidth:3,points:s.map(l=>`${l.x},${l.y}`).join(" ")}),s.map(l=>jsx("circle",{cx:l.x,cy:l.y,r:3.5,fill:o},`${l.item.name}-line`))]}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(l=>jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",noWrap:true,title:l.name,sx:{display:"block"},children:l.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",l.barValue.toFixed(1)]}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",l.lineValue.toFixed(1)]})]},l.name))})]})};var Pf=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,sd=({data:e})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let t=Array.from(new Set(e.map(n=>n.x))),o=Array.from(new Set(e.map(n=>n.y))),a=Math.max(...e.map(n=>n.value),1),r=new Map(e.map(n=>[`${n.y}__${n.x}`,n.value]));return jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsx(Box,{}),t.map(n=>jsx(Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:n},n)),o.map(n=>jsxs(Box,{sx:{display:"contents"},children:[jsx(Typography,{variant:"caption",sx:{alignSelf:"center"},children:n}),t.map(i=>{let c=r.get(`${n}__${i}`)||0,d=c/a;return jsx(Box,{sx:{height:36,borderRadius:1,bgcolor:Pf(d),border:"1px solid rgba(148,163,184,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(Typography,{variant:"caption",fontWeight:700,children:c.toFixed(1)})},`${n}-${i}`)})]},n))]})})};var Rf=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],pi=({data:e,variant:t="donut",colors:o=Rf,size:a=180,activeName:r,onItemClick:n})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=0,c=e.map((d,s)=>{let l=i;return i+=d.percent,`${o[s%o.length]} ${l}% ${i}%`});return jsxs(Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsx(Box,{sx:{width:a,height:a,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsx(Box,{sx:{position:"absolute",inset:Math.round(a*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsx(Stack,{spacing:1,sx:{minWidth:180},children:e.map((d,s)=>jsxs(Box,{onClick:()=>n?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:n?"pointer":"default",opacity:r&&d.name!==r?.45:1},children:[jsx(Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:o[s%o.length]}}),jsx(Typography,{variant:"caption",sx:{flex:1},children:d.name}),jsxs(Typography,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var cd=({effect:e,branches:t})=>{if(t.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=t.filter((r,n)=>n%2===0),a=t.filter((r,n)=>n%2===1);return jsxs(Stack,{spacing:1.5,children:[jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(r=>jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsx(Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))}),jsxs(Box,{sx:{position:"relative",height:32},children:[jsx(Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsx(Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsx(Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(a.length,1)}, minmax(0, 1fr))`,gap:1},children:a.map(r=>jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsx(Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))})]})};var pd=({data:e,height:t=240})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=0,a=e.map(g=>{let f=g.type==="total"?0:o,u=g.type==="total"?g.value:o+g.value;return g.type!=="total"&&(o=u),{...g,start:f,end:u,delta:u-f}}),r=a.flatMap(g=>[g.start,g.end]),n=Math.min(...r,0),i=Math.max(...r,1),c=680,d=30,s=i-n||1,l=g=>t-d-(g-n)/s*(t-d*2);return jsxs(Box,{children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${c} ${t}`,sx:{width:"100%",height:t},children:[jsx("line",{x1:d,y1:l(0),x2:c-d,y2:l(0),stroke:"rgba(148,163,184,0.4)"}),a.map((g,f)=>{let u=(c-d*2)/a.length,y=Math.max(u*.55,8),I=d+f*u+(u-y)/2,p=l(Math.max(g.start,g.end)),C=l(Math.min(g.start,g.end)),m=g.type==="total"?"#42A5F5":g.delta>=0?"#66BB6A":"#EF5350";return jsxs("g",{children:[jsx("rect",{x:I,y:p,width:y,height:Math.max(C-p,4),rx:6,fill:m}),jsx("text",{x:I+y/2,y:p-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:g.end.toFixed(1)})]},g.name)})]}),jsx(Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${a.length}, minmax(0, 1fr))`,gap:1},children:a.map(g=>jsx(Typography,{variant:"caption",noWrap:true,title:g.name,children:g.name},g.name))})]})};var mn=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>{let r=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${r}&zoom=${o}&maptype=${a}`},_1=(e,t=360)=>{let o=mn(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var gd=({apiKey:e,query:t,embedUrl:o,zoom:a=14,mapType:r="roadmap",height:n=320})=>{let i=o||(e&&t?mn({apiKey:e,query:t,zoom:a,mapType:r}):"");return i?jsxs(Box,{children:[jsx(Box,{component:"iframe",src:i,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsx(Link,{href:i,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsx(Box,{children:jsx(Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var gi=({keyword:e,location:t,src:o="orbcafe-ui"})=>{if(t){let a=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${a}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return e?`https://uri.amap.com/search?keyword=${encodeURIComponent(e)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var bd=({keyword:e,location:t,embedUrl:o,height:a=320})=>{let r=o||gi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxs(Box,{children:[jsx(Box,{component:"iframe",src:r,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:a,border:0,borderRadius:2}}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsx(Link,{href:r,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var xd=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:a})=>{let{t:r}=K();return jsxs(Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsx(ri,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsx(dn,{data:e,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:n=>a?.onPrimaryDimensionClick?.(n.name)})}),jsx(ri,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsx(dn,{data:t,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:n=>a?.onSecondaryDimensionClick?.(n.name)})}),jsx(ri,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsx(pi,{data:o,variant:"donut",activeName:a?.filters?.status,onItemClick:n=>a?.onStatusClick?.(n.name)})})]})};var Zo=e=>jsx(TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var sl=e=>jsx(TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var _f=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Zf=["zh","en","de","fr","ja","ko"],kd=({open:e,onClose:t,value:o,onSaveAll:a,modelOptions:r=_f,promptLangOptions:n=Zf,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:s})=>{let[l,g]=useState(o),[f,u]=useState(d||""),[y,I]=useState(s||""),[p,C]=useState(false);useEffect(()=>{e&&(g(o),u(d||""),I(s||""));},[e,o,d,s]);let m=(x,k)=>{g(L=>({...L,[x]:k}));},b=async()=>{if(a)try{C(!0),await a({settings:l,analysisTemplateId:f||void 0,responseTemplateId:y||void 0});}finally{C(false);}};return jsxs(Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"lg",children:[jsxs(DialogTitle,{sx:{pr:7,pb:2.2},children:[jsx(Typography,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),jsx(IconButton,{onClick:t,sx:{position:"absolute",right:12,top:12},children:jsx(qf,{})})]}),jsx(DialogContent,{sx:{pt:"18px !important"},children:jsxs(Stack,{spacing:2.2,children:[jsxs(Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsx(Box,{children:jsx(Zo,{size:"small",value:l.baseUrl,onChange:x=>m("baseUrl",x.target.value),fullWidth:true,label:"Base URL"})}),jsx(Box,{children:jsx(Zo,{size:"small",type:"password",value:l.apiKey,onChange:x=>m("apiKey",x.target.value),fullWidth:true,label:"API Key"})}),jsx(Box,{children:jsx(Zo,{size:"small",value:l.model,onChange:x=>m("model",x.target.value),fullWidth:true,select:true,label:"Model",children:r.map(x=>jsx(MenuItem,{value:x,children:x},x))})}),jsx(Box,{children:jsx(Zo,{size:"small",value:l.promptLang,onChange:x=>m("promptLang",x.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(x=>jsx(MenuItem,{value:x,children:x},x))})})]}),jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxs(Zo,{size:"small",value:f,onChange:x=>u(x.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsx(MenuItem,{value:"",children:"Default"}),i.map(x=>jsx(MenuItem,{value:x.id,children:x.label},x.id))]}),jsx(sl,{multiline:true,minRows:8,value:l.analysisPrompt,onChange:x=>m("analysisPrompt",x.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxs(Zo,{size:"small",value:y,onChange:x=>I(x.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsx(MenuItem,{value:"",children:"Default"}),c.map(x=>jsx(MenuItem,{value:x.id,children:x.label},x.id))]}),jsx(sl,{multiline:true,minRows:8,value:l.responsePrompt,onChange:x=>m("responsePrompt",x.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxs(DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsx(Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsx(Button,{variant:"contained",onClick:b,disabled:!a||p,children:"Save"})]})]})};var xi=({open:e,onClose:t,model:o,tableContent:a,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:c}=K(),[d,s]=useState(i?.defaultPrompt||""),[l,g]=useState(false),[f,u]=useState(false),y=n?.enabled!==false&&!!n,I=i?.enabled!==false,p=n?.filters||{},C=!!(p.primaryDimension||p.secondaryDimension||p.status),m=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{e&&s(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let b=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},x=async()=>{let k=d.trim();if(!(!k||!i?.onSubmit))try{g(!0),await i.onSubmit(k,{filters:p,model:o});}finally{g(false);}};return jsx(Dialog,{open:e,onClose:t,fullScreen:true,children:jsxs(Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsx(Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxs(Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsx(Typography,{variant:"h5",fontWeight:800,children:o.title}),jsx(Chip,{size:"small",label:c("graph.records",{count:o.kpis.totalRecords})}),y&&p.primaryDimension&&jsx(Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${p.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),y&&p.secondaryDimension&&jsx(Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${p.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),y&&p.status&&jsx(Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${p.status}`,onDelete:()=>n?.onClearFilter("status")}),y&&C&&jsx(Button,{size:"small",onClick:()=>n?.onClearAll(),children:"Clear"})]}),jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{width:{xs:"100%",lg:"auto"}},children:[I&&jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minWidth:{xs:0,lg:520},flex:{xs:1,lg:"0 0 auto"}},children:[jsx(IconButton,{size:"small",onClick:i?.onVoiceInput,children:jsx(eh,{sx:{fontSize:18,color:"text.secondary"}})}),jsx(InputBase,{fullWidth:true,value:d,onChange:k=>s(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),x());},placeholder:m,sx:{fontSize:"0.9rem"}}),jsx(IconButton,{size:"small",onClick:x,disabled:l||!d.trim(),children:jsx(ah,{sx:{fontSize:18}})}),jsx(IconButton,{size:"small",onClick:()=>u(true),children:jsx(th,{sx:{fontSize:18}})})]}),jsx(IconButton,{onClick:t,children:jsx(qf,{})})]})]})}),jsxs(Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsx(td,{kpis:o.kpis}),jsx(xd,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:y?{filters:p,onPrimaryDimensionClick:k=>n?.onPrimaryDimensionClick(k),onSecondaryDimensionClick:k=>n?.onSecondaryDimensionClick(k),onStatusClick:k=>n?.onStatusClick(k)}:void 0}),r,a]}),jsx(kd,{open:f,onClose:()=>u(false),value:b,onSaveAll:i?.onSaveAll,modelOptions:i?.modelOptions,promptLangOptions:i?.promptLangOptions,analysisTemplateOptions:i?.analysisTemplateOptions,responseTemplateOptions:i?.responseTemplateOptions,defaultAnalysisTemplateId:i?.defaultAnalysisTemplateId,defaultResponseTemplateId:i?.defaultResponseTemplateId})]})})};var yo={primaryDimension:["Client","Customer","Category","Project"],secondaryDimension:["Person","Consultant","Owner","Name"],status:["Status","state"],date:["Date","WorkDate","CreatedAt"],description:["Description","Task","Title","Memo"],reportHours:["Report_Hour","Report Hours","Hours","ReportHours"],billableHours:["Billable_Hour","Billable Hours","BillableHours"],amount:["Amount","Billable_Amount","Total_Amount","Value"]},rh=5,Sd=e=>e.toLowerCase().replace(/[\s_-]/g,""),bo=(e,t,o,a)=>{if(t)return t;if(e.length===0)return a;let r=Object.keys(e[0]),n=new Map(r.map(i=>[Sd(i),i]));for(let i of o){let c=n.get(Sd(i));if(c)return c}return r[0]||a},Kt=e=>{if(typeof e=="number")return Number.isFinite(e)?e:0;if(typeof e=="string"){let t=Number(e.replace(/,/g,"").trim());return Number.isFinite(t)?t:0}return 0},St=(e,t)=>e==null||e===""?t:String(e),nh=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=St(i[t],r);n.set(c,(n.get(c)||0)+Kt(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,a)},ih=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=St(c[t],n),s=i.get(d)||{report:0,billable:0};s.report+=Kt(c[o]),s.billable+=Kt(c[a]),i.set(d,s);}),Array.from(i.entries()).map(([c,d])=>({name:c,value:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>c.value-d.value).slice(0,r)},sh=(e,t,o)=>{let a=e.length;if(a===0)return [];let r=new Map;return e.forEach(n=>{let i=St(n[t],o);r.set(i,(r.get(i)||0)+1);}),Array.from(r.entries()).map(([n,i])=>({name:n,value:i,percent:i/a*100}))},wd=(e,t,o)=>{let a=new Map;return e.forEach(r=>{let n=St(r[t],"N/A");a.set(n,(a.get(n)||0)+Kt(r[o]));}),Array.from(a.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},lh=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=St(c[t],n),s=i.get(d)||{report:0,billable:0};s.report+=Kt(c[o]),s.billable+=Kt(c[a]),i.set(d,s);}),Array.from(i.entries()).map(([c,d])=>({name:c,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>d.barValue-c.barValue).slice(0,r)},ch=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=St(i[t],r),d=St(i[o],r),s=`${c}__${d}`;n.set(s,(n.get(s)||0)+Kt(i[a]));}),Array.from(n.entries()).map(([i,c])=>{let[d,s]=i.split("__");return {x:d,y:s,value:c}})},dh=(e,t,o)=>{let a=wd(e,t,o),r=a.map(i=>({name:i.name,value:i.value,type:"delta"})),n=a.reduce((i,c)=>i+c.value,0);return [...r,{name:"Total",value:n,type:"total"}]},ph=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=St(c[t],n),s=`${St(c[o],n)} / ${St(c[a],n)}`,l=i.get(d)||new Map;l.set(s,(l.get(s)||0)+1),i.set(d,l);}),Array.from(i.entries()).map(([c,d])=>({title:c,causes:Array.from(d.entries()).sort((s,l)=>l[1]-s[1]).slice(0,r).map(([s,l])=>`${s} (${l})`)})).slice(0,6)},Ar=({rows:e,config:t})=>{let{t:o}=K(),a=o("graph.unassigned"),r=useMemo(()=>{let l=t?.fieldMapping;return {primaryDimension:bo(e,l?.primaryDimension,yo.primaryDimension,"Category"),secondaryDimension:bo(e,l?.secondaryDimension,yo.secondaryDimension,"Owner"),status:bo(e,l?.status,yo.status,"Status"),date:bo(e,l?.date,yo.date,"Date"),description:bo(e,l?.description,yo.description,"Description"),reportHours:bo(e,l?.reportHours,yo.reportHours,"ReportHours"),billableHours:bo(e,l?.billableHours,yo.billableHours,"BillableHours"),amount:bo(e,l?.amount,yo.amount,"Amount")}},[e,t?.fieldMapping]),n=useMemo(()=>e.map((l,g)=>{let f=Kt(l[r.reportHours]),u=Kt(l[r.billableHours]),y=Kt(l[r.amount]),I=f>0?u/f*100:0;return {id:`graph-row-${g}`,Date:St(l[r.date],""),Primary:St(l[r.primaryDimension],a),Secondary:St(l[r.secondaryDimension],a),Description:St(l[r.description],""),ReportHours:f,BillableHours:u,Amount:y,Efficiency:I,Status:St(l[r.status],a)}}),[e,r,a]),i=useMemo(()=>{let l=n.length,g=n.reduce((C,m)=>C+Kt(m.ReportHours),0),f=n.reduce((C,m)=>C+Kt(m.BillableHours),0),u=n.reduce((C,m)=>C+Kt(m.Amount),0),y=g>0?f/g*100:0,I=t?.statusFlagValues||["flag","flagged","warning","risk"],p=n.filter(C=>I.includes(St(C.Status,"").toLowerCase())).length;return {totalRecords:l,totalReportHours:g,totalBillableHours:f,efficiency:y,totalAmount:u,flaggedCount:p}},[n,t?.statusFlagValues]),c=t?.topN||rh,d=useMemo(()=>({billableByPrimary:nh(n,"Primary","BillableHours",c,a),efficiencyBySecondary:ih(n,"Secondary","ReportHours","BillableHours",c,a),statusDistribution:sh(n,"Status",a),lineByDate:wd(n,"Date","BillableHours"),comboByPrimary:lh(n,"Primary","ReportHours","BillableHours",c,a),heatmapPrimarySecondary:ch(n,"Primary","Secondary","BillableHours",a),waterfallBillable:dh(n,"Date","BillableHours"),fishboneStatusCauses:ph(n,"Status","Primary","Secondary",3,a)}),[n,c,a]),s=useMemo(()=>({title:t?.title||o("graph.reportTitle"),kpis:i,charts:d,table:{columns:[{id:"Date",label:r.date},{id:"Primary",label:r.primaryDimension},{id:"Secondary",label:r.secondaryDimension},{id:"Description",label:r.description},{id:"ReportHours",label:o("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:o("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:r.status}],rows:n}}),[d,t?.title,r,i,n,o]);return {fieldMapping:r,model:s}};var Br=e=>String(e??"").trim(),Ci=(e={})=>{let[t,o]=useState(e),a=useCallback((d,s)=>{o(l=>{let g=s?.trim();if(!g){let f={...l};return delete f[d],f}if(l[d]===g){let f={...l};return delete f[d],f}return {...l,[d]:g}});},[]),r=useCallback(d=>{o(s=>{if(!s[d])return s;let l={...s};return delete l[d],l});},[]),n=useCallback(()=>{o({});},[]),i=useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=useCallback((d,s)=>d.filter(l=>!(t.primaryDimension&&Br(l[s.primaryDimension])!==Br(t.primaryDimension)||t.secondaryDimension&&Br(l[s.secondaryDimension])!==Br(t.secondaryDimension)||t.status&&Br(l[s.status])!==Br(t.status))),[t]);return {filters:t,setFilter:a,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:c}};var Si=({variants:e,currentVariantId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=K(),d=useTheme().palette.mode==="dark",s="0.85rem",l={xs:"calc((100% - 1 * 16px) / 2)",sm:"calc((100% - 2 * 16px) / 3)",md:"calc((100% - 3 * 16px) / 4)",lg:"calc((100% - 5 * 16px) / 6)"},[g,f]=useState(false),[u,y]=useState(""),[I,p]=useState(false),[C,m]=useState(false),b=e.find(L=>L.id===t),x=()=>{y(b?.name||i("variant.newVariant")),p(b?.isDefault||false),m(b?.isPublic||false),f(true);},k=()=>{a({name:u,isDefault:I,isPublic:C,description:""}),f(false);};return jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsx(Autocomplete,{size:"small",sx:{width:l,"& .MuiInputBase-root":{fontSize:s,bgcolor:d?"rgba(25, 118, 210, 0.2)":"#e7f1ff","& .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.45)":"rgba(25,118,210,0.45)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.7)":"rgba(25,118,210,0.65)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.9)":"rgba(25,118,210,0.85)"}},"& .MuiInputBase-input":{fontSize:s},"& .MuiAutocomplete-noOptions":{fontSize:s}},noOptionsText:jsx(Typography,{sx:{fontSize:s},children:i("variant.noOptions")}),options:e,getOptionLabel:L=>L.name+(L.isDefault?` (${i("variant.defaultSuffix")})`:""),value:b||null,onChange:(L,P)=>{P&&o(P);},renderInput:L=>jsx(TextField,{...L,variant:"outlined",size:"small",InputProps:{...L.InputProps,sx:{fontSize:s,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(L,P)=>jsx("li",{...L,children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsx(Typography,{sx:{flex:1,fontSize:s},children:P.name}),P.isDefault&&jsx(Sh,{fontSize:"small",color:"action"})]})})}),jsx(Tooltip,{title:i("variant.saveView"),children:jsx(IconButton,{onClick:x,size:"small",color:"primary",children:jsx(Kd,{fontSize:"small"})})}),jsxs(Dialog,{open:g,onClose:()=>f(false),children:[jsx(DialogTitle,{children:i("variant.saveView")}),jsxs(DialogContent,{children:[jsx(TextField,{autoFocus:true,margin:"dense",label:i("variant.viewName"),fullWidth:true,variant:"outlined",value:u,onChange:L=>y(L.target.value)}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:I,onChange:L=>p(L.target.checked)}),label:i("variant.setDefault")}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:C,onChange:L=>m(L.target.checked)}),label:i("variant.publicAllUsers")})]}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>f(false),children:i("common.cancel")}),jsx(Button,{onClick:k,variant:"contained",children:i("common.save")})]})]})]})};var Bd=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:a,layoutRefs:r,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:s,currentVariantId:l,onVariantChange:g})=>{let{t:f}=K(),[u,y]=useState([]),[I,p]=useState(""),C=`orbcafe.variants.${e}.${t}`,m=l!==void 0?l:I,b=M=>{l===void 0&&p(M),g&&g(M);},x=useCallback(()=>{try{let M=localStorage.getItem(C);if(!M)return [];let S=JSON.parse(M);return Array.isArray(S)?S:[]}catch{return []}},[C]),k=useCallback(M=>{try{localStorage.setItem(C,JSON.stringify(M));}catch{}},[C]),L=useCallback(M=>{y(M);let S=M.find(D=>D.isDefault);S&&!m&&(b(S.id),n(S));},[m,n,b]),P=useCallback(async()=>{if(!e)return [];try{let M=[];if(i)M=await i.getVariants(e,t);else if(c){let S=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!S.ok)throw new Error(f("variant.toast.fetchFailed"));M=await S.json();}else M=x();return L(M),M}catch(M){console.error("Error fetching variants",M);let S=x();return L(S),d&&d(f("variant.toast.fetchFailed")),S}},[e,t,i,c,x,L,d,f]);return useEffect(()=>{P();},[e,t]),jsx(Si,{variants:u,currentVariantId:m,onLoad:M=>{b(M.id),n(M);},onSave:async M=>{let S=Date.now().toString(),D;try{let B=u.find(Y=>Y.name===M.name);S=B?B.id:Date.now().toString();let H=[];if(B&&(Array.isArray(B.filters)?H=[...B.filters]:B.filters&&(H=[{scope:"default",filters:B.filters}])),M.scope==="Search"||M.scope==="Both"){let Y=(Array.isArray(o),o);if(Y)if(Array.isArray(Y)&&Y.length>0&&Y[0].scope)Y.forEach(te=>{let ae=H.findIndex(oe=>oe.scope===te.scope);ae>=0?H[ae]=te:H.push(te);});else {let te={scope:t,filters:Y},ae=H.findIndex(oe=>oe.scope===t);ae>=0?H[ae]=te:H.push(te);}}let V=B?.layout||{},q=[];if(B&&Array.isArray(B.layoutRefs)&&(q=[...B.layoutRefs]),M.scope==="Layout"||M.scope==="Both")if(r&&r.length>0)r.forEach(Y=>{let te=q.findIndex(ae=>ae.tableKey===Y.tableKey);te>=0?q[te]=Y:q.push(Y);});else {let Y={tableKey:t,layoutId:a||null},te=q.findIndex(ae=>ae.tableKey===t);te>=0?q[te]=Y:q.push(Y);}if(D={appId:e,tableKey:t,...M,id:S,createdAt:new Date().toISOString(),filters:H,layout:V,layoutRefs:q},i)await i.saveVariant(D,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let te=u.some(ae=>ae.id===S)?u.map(ae=>ae.id===S?D:ae):[...u,D];y(te),k(te);}s&&s(f("variant.toast.saveSuccess")),(i||c)&&await P(),b(S),n(D);}catch(B){console.error("Error saving variant",B);let V=u.some(q=>q.id===S)?u.map(q=>q.id===S?D:q):[...u,D];y(V),k(V),b(S),n(D),d&&d(f("variant.toast.saveFailed"));}},onDelete:async M=>{try{if(i)await i.deleteVariant(M);else if(c){if(!(await fetch(`${c}/api/variants/${M}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let S=u.filter(D=>D.id!==M);y(S),k(S);}m===M&&b(""),(i||c)&&P(),s&&s(f("variant.toast.deleteSuccess"));}catch(S){console.error("Error deleting variant",S);let D=u.filter(B=>B.id!==M);y(D),k(D),m===M&&b(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async M=>{try{let S=u.find(B=>B.id===M);if(!S)return;let D={appId:e,tableKey:t,...S,isDefault:!0};if(i)await i.setDefaultVariant(M,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let B=u.map(H=>({...H,isDefault:H.id===M}));y(B),k(B);}(i||c)&&await P(),s&&s(f("variant.toast.defaultSuccess"));}catch(S){console.error("Error setting default variant",S);let D=u.map(B=>({...B,isDefault:B.id===M}));y(D),k(D),d&&d(f("variant.toast.defaultFailed"));}}})};Qo.extend($h);Qo.extend(Hh);var Gh=[null,null],ul="0.85rem",Uh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Kh=styled(PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:o,isEnd:a,isHovered:r})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...r&&!t&&!o&&!a&&{borderRadius:0,backgroundColor:e.palette.action.hover,border:`1px dashed ${e.palette.primary.main}`},...o&&{borderRadius:"50% 0 0 50%",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...a&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&a&&{borderRadius:"50%"}})),Ld=({label:e,value:t=Gh,onChange:o})=>{let{t:a,locale:r}=K(),n=Uh[r]||"en",i=e||a("dateRange.label"),[c,d]=useState(null),[s,l]=useState(t),[g,f]=useState("start"),[u,y]=useState(null),[I,p]=useState((t[0]||Qo()).locale(n)),C=mt__default.useRef(t);useEffect(()=>{let[S,D]=t,[B,H]=C.current,V=te=>te&&typeof te.isSame=="function",q=!(S===null&&B===null||V(S)&&V(B)&&S.isSame(B,"day")),Y=!(D===null&&H===null||V(D)&&V(H)&&D.isSame(H,"day"));(q||Y)&&(l(t),t[0]&&V(t[0])&&p(t[0].locale(n))),C.current=t;},[t,n]);let m=S=>{d(S.currentTarget);},b=()=>{d(null),f("start"),y(null);},x=!!c,k=S=>{if(!S)return;let D=[...s];if(g==="start")D=[S,null],f("end");else {let B=D[0];B&&S.isBefore(B)?(D=[S,null],f("end")):(D=[B,S],f("start"));}l(D);},L=S=>{let D=Qo().locale(n),B=[null,null];switch(S){case "today":B=[D,D];break;case "week":B=[D.startOf("week"),D.endOf("week")];break;case "month":B=[D.startOf("month"),D.endOf("month")];break}l(B),f("start"),p(D);},P=()=>{l([null,null]),f("start"),p(Qo().locale(n));},w=()=>{o&&o(s),b();},E=()=>{l(t),f("start"),b();},T=useCallback(S=>{let{day:D,...B}=S,[H,V]=s,q=H?D.isSame(H,"day"):false,Y=V?D.isSame(V,"day"):false,te=H&&V?D.isBetween(H,V,"day","()"):false,ae=false;return g==="end"&&H&&!V&&u&&D.isAfter(H,"day")&&D.isBefore(u.add(1,"day"),"day")&&(ae=true),jsx(Kh,{...B,day:D,disableMargin:true,isStart:q,isEnd:Y,isInRange:te||ae,onMouseEnter:()=>y(D)})},[s,g,u]),v=S=>S?S.locale(n).format("YYYY-MM-DD"):"",M=S=>S?S.locale(n).format("ll"):"";return jsxs(Box,{children:[jsx(TextField,{label:i,value:s[0]?`${v(s[0])} - ${v(s[1])}`:"",onClick:m,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:ul}},InputProps:{readOnly:true,sx:{fontSize:ul,"& .MuiOutlinedInput-input":{fontSize:ul},paddingRight:"4px"},endAdornment:jsxs(InputAdornment,{position:"end",sx:{ml:0},children:[(s[0]||s[1])&&jsx(IconButton,{size:"small",onClick:S=>{S.stopPropagation(),P();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsx(Oh,{sx:{fontSize:"1rem"}})}),jsx(IconButton,{size:"small",edge:"end",onClick:m,sx:{padding:"2px"},children:jsx(Vh,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxs(Popover,{open:x,anchorEl:c,onClose:b,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,minWidth:320}}},children:[jsx(Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxs(Stack,{direction:"row",alignItems:"center",spacing:2,justifyContent:"space-between",children:[jsxs(Box,{sx:{p:1,border:1,borderColor:g==="start"?"primary.main":"divider",borderRadius:1,bgcolor:g==="start"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>f("start"),children:[jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.startDate")}),jsx(Typography,{variant:"body2",fontWeight:500,children:s[0]?M(s[0]):a("dateRange.select")})]}),jsx(Wh,{color:"action",fontSize:"small"}),jsxs(Box,{sx:{p:1,border:1,borderColor:g==="end"?"primary.main":"divider",borderRadius:1,bgcolor:g==="end"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>{s[0]&&f("end");},children:[jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.endDate")}),jsx(Typography,{variant:"body2",fontWeight:500,children:s[1]?M(s[1]):a("dateRange.select")})]})]})}),jsx(Box,{sx:{p:2,pb:0},children:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsx(Chip,{label:a("dateRange.today"),onClick:()=>L("today"),clickable:true,size:"small",variant:"outlined"}),jsx(Chip,{label:a("dateRange.thisWeek"),onClick:()=>L("week"),clickable:true,size:"small",variant:"outlined"}),jsx(Chip,{label:a("dateRange.thisMonth"),onClick:()=>L("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsx(LocalizationProvider,{dateAdapter:AdapterDayjs,adapterLocale:n,children:jsx(DateCalendar,{value:null,referenceDate:I,onMonthChange:p,onYearChange:p,onChange:k,slots:{day:T},views:["day"],showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsx(Divider,{}),jsxs(Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsx(Button,{size:"small",onClick:E,color:"inherit",children:a("common.cancel")}),jsx(Button,{size:"small",variant:"contained",onClick:w,children:a("common.done")})]})]})]})};var Pi={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},ay={equals:"smartFilter.operator.equals",contains:"smartFilter.operator.contains",notContains:"smartFilter.operator.notContains",wildcard:"smartFilter.operator.wildcard","=":"smartFilter.operator.equals","!=":"smartFilter.operator.notEquals",">":"smartFilter.operator.greaterThan","<":"smartFilter.operator.lessThan",">=":"smartFilter.operator.greaterOrEqual","<=":"smartFilter.operator.lessOrEqual",between:"smartFilter.operator.between"},oy=["equals","contains","notContains","wildcard"],Vd=["=","!=",">","<",">=","<=","between"],Xe="0.85rem",ry=({field:e,value:t,onChange:o})=>{let{t:a}=K(),[r,n]=useState(null),[i,c]=useState(null),[d,s]=useState(""),[l,g]=useState(""),[f,u]=useState(false),[y,I]=useState(""),[p,C]=useState("");useEffect(()=>{let v=setTimeout(()=>{C(y);},1e3);return ()=>clearTimeout(v)},[y]);let m=t?.operator||(e.type==="number"?"=":"equals"),b=t?.value,x=v=>{let M=ay[v];return M?a(M):v},k=v=>{n(v.currentTarget);},L=v=>{o({...t,operator:v,value:b}),n(null);},P={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:Xe}},InputProps:{sx:{fontSize:Xe}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Xe,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},w=e.type||"text";if(w==="date"){let M=(S=>{if(!S)return [null,null];if(Array.isArray(S)&&S.length===2){let D=S[0]?Qo.isDayjs(S[0])?S[0]:Qo(S[0]):null,B=S[1]?Qo.isDayjs(S[1])?S[1]:Qo(S[1]):null;return [D,B]}return Qo.isDayjs(S)||typeof S=="string"?[Qo.isDayjs(S)?S:Qo(S),null]:[null,null]})(b);return jsx(Ld,{label:e.label,value:M,onChange:S=>o({value:S,operator:"between"})})}if(w==="number"&&m==="between"){let v=()=>{o({value:[d,l],operator:"between"}),c(null);},M=Array.isArray(b)?`${b[0]||""} - ${b[1]||""}`:"";return jsxs(Fragment,{children:[jsx(TextField,{...P,label:e.label,value:M,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...P.InputProps,startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Tooltip,{title:x("between"),children:jsx(IconButton,{size:"small",onClick:k,sx:{width:24,height:24,fontSize:Xe},children:Pi.between})})}),readOnly:true},onClick:S=>c(S.currentTarget)}),jsx(Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Xe,minHeight:"auto",py:.5}}},children:Vd.map(S=>jsxs(MenuItem,{selected:S===m,onClick:()=>L(S),children:[jsx(Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Pi[S]}),jsx(ListItemText,{primary:x(S),primaryTypographyProps:{fontSize:Xe}})]},S))}),jsx(Popover,{open:!!i,anchorEl:i,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxs(Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsx(TextField,{size:"small",label:a("smartFilter.min"),type:"number",value:d,onChange:S=>s(S.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Xe}},InputProps:{sx:{fontSize:Xe}}}),jsx(ty,{color:"action"}),jsx(TextField,{size:"small",label:a("smartFilter.max"),type:"number",value:l,onChange:S=>g(S.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Xe}},InputProps:{sx:{fontSize:Xe}}}),jsx(Button,{variant:"contained",size:"small",onClick:v,children:a("common.ok")})]})})]})}if(w==="select")return jsxs(TextField,{...P,select:true,label:e.label,value:b||"",onChange:v=>o({...t,value:v.target.value,operator:"equals"}),children:[jsx(MenuItem,{value:"",children:jsx("em",{children:a("common.none")})}),e.options?.map(v=>jsx(MenuItem,{value:v.value,children:v.label},v.value))]});if(w==="multi-select"){let v=Array.isArray(b)?b:[],M=e.options?.filter(S=>S.label.toLowerCase().includes(p.toLowerCase()))||[];return jsxs(TextField,{...P,select:true,label:e.label,value:v,onChange:S=>o({...t,value:S.target.value,operator:"anyOf"}),SelectProps:{...P.SelectProps,multiple:true,onClose:()=>{I(""),C("");},renderValue:S=>{if(!Array.isArray(S)||S.length===0)return jsx("em",{children:a("common.none")});let D=H=>e.options?.find(V=>V.value===H)?.label||H,B=S.map(D);return B.length>2?`${B.slice(0,2).join(", ")} +${B.length-2}`:B.join(", ")}},children:[jsx(ListSubheader,{children:jsx(TextField,{size:"small",autoFocus:true,placeholder:a("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(zd,{fontSize:"small"})}),sx:{fontSize:Xe}},value:y,onChange:S=>I(S.target.value),onKeyDown:S=>{S.key!=="Escape"&&S.stopPropagation();},onClick:S=>S.stopPropagation()})}),M.length>0?M.map(S=>jsxs(MenuItem,{value:S.value,children:[jsx(Checkbox,{checked:v.indexOf(S.value)>-1,size:"small"}),jsx(ListItemText,{primary:S.label,primaryTypographyProps:{fontSize:Xe}})]},S.value)):jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:a("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:Xe}})})]})}let E=w==="number"?Vd:oy,T=f||b!==void 0&&b!==""&&b!==null||!!r;return jsxs(Fragment,{children:[jsx(TextField,{...P,label:e.label,sx:{minWidth:"120px"},value:b||"",type:w==="number"?"number":"text",onChange:v=>o({...t,value:v.target.value,operator:m}),onFocus:()=>u(true),onBlur:()=>u(false),InputProps:{...P.InputProps,startAdornment:T?jsx(InputAdornment,{position:"start",children:jsx(Tooltip,{title:x(m),children:jsx(IconButton,{size:"small",onClick:k,onMouseDown:v=>v.preventDefault(),sx:{width:24,height:24,fontSize:Xe,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Pi[m]})})}):null,endAdornment:e.hasSearchIcon?jsx(InputAdornment,{position:"end",children:jsx(zd,{color:"action"})}):void 0}}),jsx(Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Xe,minHeight:"auto",py:.5}}},children:E.map(v=>jsxs(MenuItem,{selected:v===m,onClick:()=>L(v),children:[jsx(Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Pi[v]}),jsx(ListItemText,{primary:x(v),primaryTypographyProps:{fontSize:Xe}})]},v))})]})},Yo=({fields:e,filters:t,onFilterChange:o,variants:a=[],currentVariantId:r,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:s,loading:l=false,appId:g,tableKey:f,currentLayout:u,currentLayoutId:y,layoutRefs:I,variantService:p,serviceUrl:C})=>{let{t:m}=K(),[b,x]=useState(true),[k,L]=useState(null),[P,w]=useState(e.filter(M=>!M.hidden).map(M=>M.id)),E=(M,S)=>{o({...t,[M]:S});},T=M=>{P.includes(M)?w(P.filter(S=>S!==M)):w([...P,M]);};return jsxs(Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxs(Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g?jsx(Bd,{appId:g,tableKey:f,currentFilters:{values:t,visibleFields:P},currentLayout:u,currentLayoutId:y,layoutRefs:I,onLoad:M=>{if(!M.filters)return;let S=null;if(Array.isArray(M.filters)){let D=f||"default",B=M.filters.find(H=>H.scope===D);S=B?B.filters:null;}else S=M.filters;S&&(S.values||S.visibleFields?(S.visibleFields&&Array.isArray(S.visibleFields)&&w(S.visibleFields),S.values&&o(S.values)):o(S)),n&&n(M);},variantService:p,serviceUrl:C,currentVariantId:r}):jsx(Si,{variants:a,currentVariantId:r,onLoad:n,onSave:M=>{i&&i({...M,filters:{values:t,visibleFields:P}});},onDelete:c,onSetDefault:d}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(Tooltip,{title:m("smartFilter.addFilters"),children:jsx(Button,{onClick:M=>L(M.currentTarget),size:"small",color:"primary",startIcon:jsx(Yh,{fontSize:"small"}),sx:{textTransform:"none",fontSize:Xe,whiteSpace:"nowrap",minWidth:"fit-content"},children:m("smartFilter.adaptFilters")})}),jsx(Button,{variant:"contained",size:"small",onClick:s,disabled:l,sx:{minWidth:"52px",fontWeight:"bold",fontSize:Xe},children:m(l?"common.loading":"smartFilter.go")}),jsxs(Menu,{anchorEl:k,open:!!k,onClose:()=>L(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:Xe,minHeight:32}}}},children:[jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:m("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:Xe}})}),jsx(Divider,{}),e.map(M=>jsxs(MenuItem,{onClick:()=>T(M.id),children:[jsx(Checkbox,{checked:P.includes(M.id),size:"small"}),jsx(ListItemText,{primary:M.label,primaryTypographyProps:{fontSize:Xe}})]},M.id))]})]})]}),jsx(Collapse,{in:b,children:jsx(Box,{sx:{px:2,pb:2},children:jsx(Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(M=>P.includes(M.id)).map(M=>jsx(Grid,{size:1,children:jsx(ry,{field:M,value:t[M.id]||{value:"",operator:M.type==="number"?"=":"equals"},onChange:S=>E(M.id,S)})},M.id))})})}),jsx(Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsx(IconButton,{size:"small",onClick:()=>x(!b),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:20,height:20,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:b?jsx(Jh,{sx:{fontSize:16},color:"action"}):jsx(of,{sx:{fontSize:16},color:"action"})})})]})};var qd=({layouts:e,currentLayoutId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=K(),[c,d]=useState(null),[s,l]=useState(false),[g,f]=useState(""),[u,y]=useState(""),[I,p]=useState({isDefault:false,isPublic:false}),C=e.find(P=>P.id===t),m=P=>{d(P.currentTarget);},b=()=>{d(null);},x=P=>{o(P),b();},k=()=>{f(""),y(""),p({isDefault:false,isPublic:false}),l(true),b();},L=()=>{g.trim()&&(a({name:g,description:u,...I}),l(false));};return jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(Tooltip,{title:i("layout.saveLayout"),children:jsx(IconButton,{onClick:k,color:"primary",size:"small",children:jsx(Kd,{})})}),jsx(Tooltip,{title:i("layout.layoutOptions"),children:jsx(IconButton,{onClick:m,color:C?"primary":"default",children:jsx(hy,{})})}),jsxs(Menu,{anchorEl:c,open:!!c,onClose:b,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsx(MenuItem,{disabled:true,children:jsx(Typography,{variant:"caption",children:i("layout.selectLayout")})}),jsxs(MenuItem,{onClick:k,children:[jsx(ListItemIcon,{children:jsx(Kd,{fontSize:"small"})}),jsx(ListItemText,{children:i("layout.saveCurrentLayout")})]}),jsx(Divider,{}),e.length===0&&jsx(MenuItem,{disabled:true,children:jsx(Typography,{variant:"body2",color:"text.secondary",children:i("layout.noSavedLayouts")})}),e.map((P,w)=>jsx(MenuItem,{onClick:()=>x(P),selected:P.id===t,children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxs(Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(Typography,{variant:"body2",fontWeight:P.id===t?"bold":"normal",noWrap:true,children:P.name})}),P.description&&jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:P.description})]}),jsxs(Box,{sx:{display:"flex",alignItems:"center"},onClick:E=>E.stopPropagation(),children:[jsx(Tooltip,{title:P.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsx(IconButton,{size:"small",onClick:E=>{E.stopPropagation(),n(P.id);},children:P.isDefault?jsx(Sh,{fontSize:"small",color:"warning"}):jsx(fy,{fontSize:"small"})})}),jsx(Tooltip,{title:i("common.delete"),children:jsx(IconButton,{size:"small",color:"error",onClick:E=>{E.stopPropagation(),r(P.id);},children:jsx(Vg,{fontSize:"small"})})})]})]})},P.id||w))]}),jsxs(Dialog,{open:s,onClose:()=>l(false),maxWidth:"xs",fullWidth:true,children:[jsx(DialogTitle,{children:i("layout.saveLayout")}),jsx(DialogContent,{children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[jsx(TextField,{label:i("layout.layoutName"),value:g,onChange:P=>f(P.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(P=>P.name===g)&&jsx(Typography,{variant:"caption",color:"warning.main",sx:{ml:1},children:i("layout.warningOverwrite")}),jsx(TextField,{label:i("layout.layoutDescription"),value:u,onChange:P=>y(P.target.value),fullWidth:true,size:"small"}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:I.isDefault,onChange:P=>p({...I,isDefault:P.target.checked})}),label:i("layout.useAsDefault")}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:I.isPublic,onChange:P=>p({...I,isPublic:P.target.checked})}),label:i("layout.publicAllUsers")})]})}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>l(false),children:i("common.cancel")}),jsx(Button,{onClick:L,variant:"contained",disabled:!g,children:i("common.save")})]})]})]})};var Ai=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:a,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:s}=K(),[l,g]=useState([]),[f,u]=useState(""),y=`orbcafe.layouts.${e}.${t}`,I=w=>({id:w.layoutId,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt??new Date().toISOString(),layoutData:w.layout??{}}),p=w=>({appId:e,tableKey:t,layoutId:w.id,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt,layout:w.layoutData}),C=useCallback(()=>{try{let w=localStorage.getItem(y);if(!w)return [];let E=JSON.parse(w);return Array.isArray(E)?E:[]}catch{return []}},[y]),m=useCallback(w=>{try{localStorage.setItem(y,JSON.stringify(w));}catch{}},[y]);useEffect(()=>{n!==void 0&&u(n);},[n]),useEffect(()=>{if(r&&l.length>0){let w=l.find(E=>E.id===r);w&&(u(w.id),a(w));}},[r,l,a]);let b=useCallback(async()=>{if(e){if(!i){let w=C();g(w);let E=w.find(T=>T.isDefault);E&&!f&&!r&&(u(E.id),a(E));return}try{let w=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!w.ok)throw new Error("LAYOUT_FETCH_FAILED");let T=(await w.json()).map(I);g(T);let v=T.find(M=>M.isDefault);v&&!f&&!r&&(u(v.id),a(v));}catch(w){console.error("Error fetching layouts",w);let E=C();g(E);let T=E.find(v=>v.isDefault);T&&!f&&!r&&(u(T.id),a(T)),c&&c(s("layout.toast.loadFallback"));}}},[e,t,i,c,f,a,r,C,s]);return useEffect(()=>{b();},[e,t]),jsx(qd,{layouts:l,currentLayoutId:f,onLoad:w=>{u(w.id),a(w);},onSave:async w=>{let E=l.find(M=>M.name===w.name),T=E?E.id:Date.now().toString(),v={id:T,...w,createdAt:new Date().toISOString(),layoutData:o,isDefault:w.isDefault??false,isPublic:w.isPublic??false};if(!i){let S=l.some(D=>D.id===T)?l.map(D=>D.id===T?v:D):[...l,v];g(S),m(S),u(T),a(v),d&&d(s("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p(v))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(s("layout.toast.saveSuccess")),await b(),u(T),a(v);}catch(M){console.error("Error saving layout",M);let D=l.some(B=>B.id===T)?l.map(B=>B.id===T?v:B):[...l,v];g(D),m(D),u(T),a(v),d&&d(s("layout.toast.saveLocalSuccess")),c&&c(s("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async w=>{if(!i){let E=l.filter(T=>T.id!==w);g(E),m(E),f===w&&u(""),d&&d(s("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(w)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===w&&u(""),d&&d(s("layout.toast.deleteSuccess")),await b();}catch(E){console.error("Error deleting layout",E);let T=l.filter(v=>v.id!==w);g(T),m(T),f===w&&u(""),d&&d(s("layout.toast.deleteLocalSuccess")),c&&c(s("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async w=>{if(!i){let E=l.map(T=>({...T,isDefault:T.id===w}));g(E),m(E),d&&d(s("layout.toast.defaultLocalSuccess"));return}try{let E=l.find(v=>v.id===w);if(!E)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p({...E,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(s("layout.toast.defaultSuccess")),await b();}catch(E){console.error("Error setting default",E);let T=l.map(v=>({...v,isDefault:v.id===w}));g(T),m(T),d&&d(s("layout.toast.defaultLocalSuccess")),c&&c(s("layout.toast.backendUnavailableDefaultLocal"));}}})};var Zd=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let o=e.filters.find(r=>r.scope===t);if(o)return o.filters;let a=e.filters.find(r=>r.scope==="default");return a?a.filters:null}return typeof e.filters=="object"?e.filters:null},Bi=(e,t)=>{if(!e)return {layout:null,layoutId:null};let o=null,a=null;if(Array.isArray(e.layoutRefs)){let r=e.layoutRefs.find(n=>n.tableKey===t);r&&(o=r.layoutId);}return !o&&e.layoutId&&(o=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(a=e.layout),{layoutId:o,layout:a}};function jd(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function by(e,t){return e==="desc"?(o,a)=>jd(o,a,t):(o,a)=>-jd(o,a,t)}function xy(e,t){let o=e.map((a,r)=>[a,r]);return o.sort((a,r)=>{let n=t(a[0],r[0]);return n!==0?n:a[1]-r[1]}),o.map(a=>a[0])}var Ei=e=>{let t=useCallback(z=>{let G=String(z?.label??z?.id??"").length*9+64,ue=typeof z?.minWidth=="number"?z.minWidth:0;return Math.max(100,ue,G)},[]),o=useCallback(()=>(e.columns||[]).filter(z=>!!z?.numeric).map(z=>z.id),[e.columns]),[a,r]=useState(""),[n,i]=useState(e.order||"asc"),[c,d]=useState(e.orderBy||""),[s,l]=useState(e.page||0),[g,f]=useState(e.rowsPerPage||20),[u,y]=useState(e.selected||[]),[I,p]=useState(e.columns?e.columns.map(z=>z.id):[]),[C,m]=useState(e.showSummary||false),[b,x]=useState(()=>o()),[k,L]=useState([]),[P,w]=useState(new Set),[E,T]=useState(()=>{let z={};return (e.columns||[]).forEach(O=>{z[O.id]=t(O);}),z}),[v,M]=useState(null),[S,D]=useState(null),[B,H]=useState(null),[V,q]=useState(null),[Y,te]=useState(false),[ae,oe]=useState(""),[Ft,lt]=useState("");useEffect(()=>{e.layout&&ke(e.layout);},[e.layout]),useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),useEffect(()=>{e.selected!==void 0&&y(e.selected);},[e.selected]),useEffect(()=>{e.page!==void 0&&l(e.page);},[e.page]),useEffect(()=>{e.rowsPerPage!==void 0&&f(e.rowsPerPage);},[e.rowsPerPage]),useEffect(()=>{let z=o();x(O=>O.filter(ue=>z.includes(ue)));},[o]),useEffect(()=>{T(z=>{let O={...z};return (e.columns||[]).forEach(G=>{O[G.id]===void 0&&(O[G.id]=t(G));}),O});},[e.columns,t]);let Ke=useMemo(()=>{let z=e.rows||[];return a&&(z=z.filter(O=>Object.keys(O).some(G=>String(O[G]).toLowerCase().includes(a.toLowerCase())))),z},[e.rows,a]),ge=useMemo(()=>e.onSortChange||!c?Ke:xy(Ke,by(n,c)),[Ke,n,c,e.onSortChange]),De=useCallback(z=>{if(k.length===0)return z.map(we=>({type:"row",data:we,id:we[e.rowKey||"id"]}));let O=[...z].sort((we,ie)=>{for(let Pe of k){if(we[Pe]<ie[Pe])return -1;if(we[Pe]>ie[Pe])return 1}return 0}),G=(we,ie=0)=>{if(ie>=k.length)return we;let Pe=k[ie],ye={},Re=[];return we.forEach(Se=>{let he=Se[Pe],Ce=`${Pe}:${he}`;ye[Ce]||(ye[Ce]={key:Ce,field:Pe,value:he,children:[],count:0,level:ie},Re.push(ye[Ce])),ye[Ce].children.push(Se),ye[Ce].count++;}),Re.forEach(Se=>{Se.children&&(Se.children=G(Se.children,ie+1));}),Re},ue=G(O),fe=(we,ie="")=>{let Pe=[];return we.forEach(ye=>{if(ye.children){let Re=ie?`${ie}>${ye.key}`:ye.key,Se=P.has(Re);Pe.push({type:"group",id:Re,field:ye.field,value:ye.value,level:ye.level,count:ye.count,isExpanded:Se,childIds:(function he(Ce){let je=[];return Ce.children.forEach(Rt=>{Rt.children?je=je.concat(he(Rt)):je.push(Rt[e.rowKey||"id"]);}),je})(ye)}),Se&&(Pe=Pe.concat(fe(ye.children,Re)));}else Pe.push({type:"row",data:ye,id:ye[e.rowKey||"id"],level:k.length});}),Pe};return fe(ue)},[k,P,e.rowKey]),Fe=useCallback(z=>{if(k.length===0)return [];let O=[...z].sort((fe,we)=>{for(let ie of k){if(fe[ie]<we[ie])return -1;if(fe[ie]>we[ie])return 1}return 0}),G=[],ue=(fe,we,ie)=>{if(we>=k.length)return;let Pe=k[we],ye=new Map;fe.forEach(Re=>{let Se=Re[Pe],he=ye.get(Se);he?he.push(Re):ye.set(Se,[Re]);}),ye.forEach((Re,Se)=>{let he=`${Pe}:${Se}`,Ce=ie?`${ie}>${he}`:he;G.push(Ce),ue(Re,we+1,Ce);});};return ue(O,0,""),G},[k]),Je=useMemo(()=>De(ge),[ge,De]),Tt=useMemo(()=>Fe(ge),[ge,Fe]),qe=useMemo(()=>{let z=(e.rows||[]).length;return typeof e.count=="number"&&e.count>z},[e.count,e.rows]),rt=useMemo(()=>qe?Je:g>0?Je.slice(s*g,s*g+g):Je,[Je,s,g,qe]),$a=useMemo(()=>qe&&typeof e.count=="number"?e.count:Je.length,[Je.length,qe,e.count]),wa=z=>{w(O=>{let G=new Set(O);return G.has(z)?G.delete(z):G.add(z),G});},Ia=z=>{let O=Tt.filter(G=>G===z||G.startsWith(`${z}>`));w(G=>{let ue=new Set(G);return O.forEach(fe=>ue.add(fe)),ue});},Ta=z=>{w(O=>{let G=new Set(O);return Array.from(G).forEach(ue=>{(ue===z||ue.startsWith(`${z}>`))&&G.delete(ue);}),G});},Pa=z=>{if(!z){w(new Set);return}w(new Set(Tt));},gt=z=>{let O=Tt.filter(G=>G.startsWith(`${z}>`));return O.length===0?P.has(z):P.has(z)&&O.every(G=>P.has(G))},$=z=>{let O=c===z&&n==="asc",G=c===z&&n==="desc";if(e.onSortChange){O?e.onSortChange(z,"desc"):G?e.onSortChange("","asc"):e.onSortChange(z,"asc");return}O?(i("desc"),d(z)):G?(i("asc"),d("")):(i("asc"),d(z));},de=(z,O)=>{T(G=>({...G,[z]:O}));},ne=z=>{if(z.target.checked){let O=Ke.map(G=>G[e.rowKey||"id"]);y(O),e.onSelectionChange&&e.onSelectionChange(O);return}y([]),e.onSelectionChange&&e.onSelectionChange([]);},pe=(z,O)=>{let G=O[e.rowKey||"id"],ue=u.indexOf(G),fe=[];ue===-1?fe=fe.concat(u,G):ue===0?fe=fe.concat(u.slice(1)):ue===u.length-1?fe=fe.concat(u.slice(0,-1)):ue>0&&(fe=fe.concat(u.slice(0,ue),u.slice(ue+1))),y(fe),e.onSelectionChange&&e.onSelectionChange(fe);},$e=z=>{l(z),e.onPageChange&&e.onPageChange(z);},Me=z=>{f(z),l(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(z);},Jt=z=>{let O=I.indexOf(z),G=[...I];O===-1?G.push(z):G.splice(O,1),p(G);},la=z=>{let O=k.indexOf(z),G=[...k];O===-1?G.push(z):G.splice(O,1),L(G);},ca=z=>{o().includes(z)&&x(G=>G.includes(z)?G.filter(ue=>ue!==z):[...G,z]);},da=z=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:I,order:n,orderBy:c,grouping:k,columnWidths:E,showSummary:C,summaryColumns:b});},pa=z=>{let{layout:O,layoutId:G}=Bi(z,e.tableKey||"default");G?(lt(G),oe(G)):(lt(""),oe("")),O&&(O.visibleColumns&&p(O.visibleColumns),O.order&&i(O.order),O.orderBy&&d(O.orderBy),O.grouping&&L(O.grouping),O.columnWidths&&T(O.columnWidths),O.showSummary!==void 0&&m(!!O.showSummary),Array.isArray(O.summaryColumns)&&x(O.summaryColumns));},ke=z=>{let O=z?.layoutData||z?.layout||z||{};O.visibleColumns&&p(O.visibleColumns),O.order&&i(O.order),O.orderBy!==void 0&&d(O.orderBy),O.grouping&&L(O.grouping),O.columnWidths&&T(O.columnWidths),O.showSummary!==void 0&&m(!!O.showSummary),Array.isArray(O.summaryColumns)&&x(O.summaryColumns),w(new Set),l(0),z?.id&&oe(z.id),lt("");};useEffect(()=>{e.layout&&pa({layout:e.layout});},[e.layout]);let ce=z=>{z.preventDefault(),q(V===null?{mouseX:z.clientX+2,mouseY:z.clientY-6}:null);},ft=()=>{q(null);},Te=useMemo(()=>{if(!C)return {};let z={};e.columns.forEach(G=>{if(G.numeric&&b.includes(G.id)){let ue=Ke.reduce((fe,we)=>{let ie=parseFloat(we[G.id]);return fe+(isNaN(ie)?0:ie)},0);z[G.id]=ue.toFixed(2);}else z[G.id]="";});let O=e.columns.find(G=>I.includes(G.id));return O&&!O.numeric&&(z[O.id]="Total"),z},[Ke,e.columns,C,b,I]),Pt=()=>{if(!e.columns||!Ke)return;let z=e.columns.map(we=>we.label).join(","),O=Ke.map(we=>e.columns.map(ie=>{let Pe=we[ie.id];return `"${(Pe==null?"":String(Pe)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
2
2
|
`),G=`data:text/csv;charset=utf-8,${z}
|
|
3
|
-
${O}`,ue=encodeURI(G),fe=document.createElement("a");fe.setAttribute("href",ue),fe.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(fe),fe.click(),document.body.removeChild(fe);},da=()=>{ee(true);},Mo=()=>{ee(false);};return {isMobile:false,columns:e.columns,order:n,orderBy:c,filterText:a,setFilterText:r,visibleColumns:I,setVisibleColumns:p,showSummary:C,setShowSummary:m,summaryColumns:b,grouping:k,setGrouping:L,expandedGroups:P,setExpandedGroups:w,groupAnchorEl:S,setGroupAnchorEl:D,summaryAnchorEl:B,setSummaryAnchorEl:H,columnWidths:E,setColumnWidths:T,anchorEl:v,setAnchorEl:M,contextMenu:V,setContextMenu:_,sensors:void 0,sortedAndFilteredRows:ge,visibleRows:rt,summaryRow:Te,page:s,setPage:Oe,rowsPerPage:g,setRowsPerPage:Me,totalDisplayCount:Oa,selected:u,setSelected:y,isAllExpanded:It.length>0&&It.every(z=>P.has(z)),handleColumnResize:de,handleRequestSort:$,handleSelectAllClick:ne,handleClick:pe,toggleSummaryColumn:sa,handleDragEnd:()=>{},handleExport:Tt,handleContextMenu:ce,handleCloseContextMenu:gt,toggleColumnVisibility:Xt,toggleGroupExpand:ka,toggleGroupField:ia,handleToggleAll:Ia,handleExpandGroupRecursively:Sa,handleCollapseGroupRecursively:wa,isGroupFullyExpanded:mt,handleLayoutLoad:ke,handleVariantLoad:ca,handleLayoutSave:la,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:I,order:n,orderBy:c,grouping:k,columnWidths:E,showSummary:C,summaryColumns:b},currentLayoutId:te,layoutIdToLoad:Bt,onPageChange:Oe,onRowsPerPageChange:Me,graphReportOpen:Y,handleOpenGraphReport:da,handleCloseGraphReport:Mo}};var FP=e=>jsx(Cy,{...e}),EP=e=>jsx(Zs,{...e}),LP=e=>jsx(tp,{...e}),NP=e=>jsx(Gg,{...e}),zP=e=>jsx(Ug,{...e}),Co=e=>{let{t}=q(),o="0.85rem",{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:s,fitContainer:l=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:y=[20,50,100,-1],onLayoutSave:I,filterConfig:p,rowKey:C,tableKey:m="default",graphReport:b,quickCreate:x,quickEdit:k,quickDelete:L,serviceUrl:P}=e,w=a||t("table.title.default"),{isMobile:E,columns:T,order:v,orderBy:M,filterText:S,setFilterText:D,visibleColumns:B,showSummary:H,setShowSummary:V,summaryColumns:_,grouping:Y,setGrouping:ee,expandedGroups:te,groupAnchorEl:oe,setGroupAnchorEl:Bt,summaryAnchorEl:lt,setSummaryAnchorEl:Ke,columnWidths:ge,anchorEl:De,setAnchorEl:Fe,contextMenu:Je,sensors:It,sortedAndFilteredRows:qe,summaryRow:rt,visibleRows:Oa,isAllExpanded:ka,page:Sa,setPage:wa,rowsPerPage:Ia,setRowsPerPage:mt,totalDisplayCount:$,setSelected:de,handleColumnResize:ne,handleRequestSort:pe,handleSelectAllClick:Oe,handleClick:Me,toggleSummaryColumn:Xt,handleDragEnd:ia,handleExport:sa,handleContextMenu:la,handleCloseContextMenu:ca,toggleColumnVisibility:ke,toggleGroupExpand:ce,toggleGroupField:gt,handleToggleAll:Te,handleExpandGroupRecursively:Tt,handleCollapseGroupRecursively:da,isGroupFullyExpanded:Mo,handleLayoutLoad:z,handleVariantLoad:O,handleLayoutSave:G,effectiveAppId:ue,currentLayoutData:fe,currentLayoutId:we,layoutIdToLoad:se,graphReportOpen:Pe,handleOpenGraphReport:ye,handleCloseGraphReport:Re}=Fi(e),Se=b?.enabled??false,he=Se&&(b?.interaction?.enabled??true),Ce=vi(),je=!!x?.enabled,Pt=!!k?.enabled,pa=!!L?.enabled,Ot=x?.fields,Yt=x?.excludeFields||[],Ta=x?.initialValues||{},[Ao,so]=ut__default.useState(false),[Ft,Wa]=ut__default.useState(false),[Bo,Et]=ut__default.useState({}),[Wt,Rt]=ut__default.useState(false),[Ie,Jt]=ut__default.useState(false),[Fo,Eo]=ut__default.useState({}),[Lo,$a]=ut__default.useState(false),[Pa,Ra]=ut__default.useState(false),No=u||Ft||Ie||Pa,zo=ut__default.useMemo(()=>{let N=[...T];if(Array.isArray(Ot)&&Ot.length>0){let K=new Set(Ot);N=N.filter(R=>K.has(R.id));}if(Yt.length>0){let K=new Set(Yt);N=N.filter(R=>!K.has(R.id));}return N.filter(K=>!!K?.id)},[T,Yt,Ot]),lo=C||"id",Lt=ut__default.useMemo(()=>{let N=new Set(i);return qe.filter(K=>N.has(K?.[lo]))},[i,qe,lo]),Nt=Lt.length===1?Lt[0]:null,Da=k?.fields,Ha=k?.excludeFields||[],Ga=k?.editableFields||[],Vo=k?.nonEditableFields||[],Oo=k?.primaryKeys?.length?k.primaryKeys:[lo],co=ut__default.useMemo(()=>{let N=[...T];if(Array.isArray(Da)&&Da.length>0){let K=new Set(Da);N=N.filter(R=>K.has(R.id));}if(Ha.length>0){let K=new Set(Ha);N=N.filter(R=>!K.has(R.id));}return N.filter(K=>!!K?.id)},[T,Ha,Da]),po=ut__default.useMemo(()=>new Set(Oo),[Oo]),Ua=ut__default.useMemo(()=>new Set(Ga),[Ga]),ea=ut__default.useMemo(()=>new Set(Vo),[Vo]),Ma=ut__default.useCallback(N=>Ua.size>0?Ua.has(N):!(ea.has(N)||po.has(N)),[Ua,ea,po]);ut__default.useEffect(()=>{!Pe&&Ce.hasActiveFilters&&Ce.clearAll();},[Pe,Ce.hasActiveFilters,Ce.clearAll]);let mr=()=>{let N={};zo.forEach(K=>{N[K.id]=Ta[K.id]??"";}),Et(N),so(true);},Wo=()=>{Ft||so(false);},gr=(N,K)=>{Et(R=>({...R,[N]:K}));},fr=async()=>{if(!x?.onSubmit){so(false);return}try{Wa(!0),await x.onSubmit(Bo),so(!1);}finally{Wa(false);}},hr=()=>{if(!Nt)return;let N={};co.forEach(R=>{N[R.id]=Nt[R.id]??"";});let K=k?.getInitialValues?{...N,...k.getInitialValues(Nt)}:N;Eo(K),Rt(true);},$t=()=>{Ie||Rt(false);},yr=(N,K)=>{Eo(R=>({...R,[N]:K}));},Ka=async()=>{if(Nt){if(!k?.onSubmit){Rt(false);return}try{Jt(!0),await k.onSubmit(Fo,Nt),Rt(!1);}finally{Jt(false);}}},Aa=()=>{Lt.length!==0&&$a(true);},br=()=>{Pa||$a(false);},$o=async()=>{if(Lt.length===0){$a(false);return}if(!L?.onConfirm){$a(false),de([]),c?.([]);return}try{Ra(!0),await L.onConfirm(Lt),$a(!1),de([]),c?.([]);}finally{Ra(false);}},uo=qe,{fieldMapping:h}=Dr({rows:uo,config:{...b,title:b?.title||`${w} ${t("graph.reportTitle")}`}}),A=ut__default.useMemo(()=>he?Ce.applyRows(uo,h):uo,[he,Ce.applyRows,uo,h]),{model:F}=Dr({rows:A,config:{...b,title:b?.title||`${w} ${t("graph.reportTitle")}`,fieldMapping:h}}),W=F.table.columns.map(N=>({id:N.id,label:N.label,align:N.align||"left",minWidth:120,numeric:N.align==="right"})),j=ue?jsx(Mi,{appId:ue,tableKey:m,currentLayoutData:fe,onLayoutLoad:z,targetLayoutId:se,activeLayoutId:we,serviceUrl:P??p?.serviceUrl}):null,le=jsxs(Fragment,{children:[jsx(Jn,{groupAnchorEl:oe,setGroupAnchorEl:Bt,grouping:Y,setGrouping:ee,columns:T,toggleGroupField:gt}),jsx(ei,{anchorEl:De,setAnchorEl:Fe,columns:T,visibleColumns:B,toggleColumnVisibility:ke}),jsx(ti,{anchorEl:lt,setAnchorEl:Ke,showSummary:H,setShowSummary:V,columns:T,summaryColumns:_,toggleSummaryColumn:Xt}),jsx(ai,{contextMenu:Je,handleCloseContextMenu:ca,columns:T,visibleColumns:B,toggleColumnVisibility:ke})]});return E?jsxs(xn,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[p&&jsx(Qo,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:p.onVariantLoad,onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:fe}],variantService:p.variantService,serviceUrl:P??p.serviceUrl}),jsx(Xc,{title:w,loading:u,showSummary:H,setShowSummary:V,setAnchorEl:Fe,setSummaryAnchorEl:Ke,filterText:S,setFilterText:D,sortedAndFilteredRows:qe,selected:i,columns:T,visibleColumns:B,summaryRow:rt,handleClick:Me,selectionMode:n}),le]}):jsxs(xn,{sx:{width:g?"100%":"auto",mb:l?0:2,...l?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p&&jsx(xn,{sx:{mb:2},children:jsx(Qo,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:N=>{O(N),p.onVariantLoad&&p.onVariantLoad(N);},onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,loading:u,appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:fe}],currentLayoutId:we,layoutRefs:[{tableKey:m,layoutId:we}],variantService:p.variantService,serviceUrl:P??p.serviceUrl})}),jsxs(xy,{sx:{width:g?"100%":"auto",mb:l?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":No?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f?{height:f}:l?{flex:1,minHeight:0,height:"100%"}:{}},children:[r&&jsx(jn,{filterText:S,setFilterText:D,onRowsPerPageChange:mt,rowsPerPage:Ia,rowsPerPageOptions:y,page:Sa,count:$,onPageChange:wa,actions:d,extraTools:s,grouping:Y,setGroupAnchorEl:Bt,showSummary:H,setShowSummary:V,setAnchorEl:Fe,setSummaryAnchorEl:Ke,handleExport:sa,showCreateButton:je,onOpenCreateDialog:mr,showEditButton:Pt,onOpenEditDialog:hr,editDisabled:Lt.length!==1,showDeleteButton:pa,onOpenDeleteConfirm:Aa,deleteDisabled:Lt.length===0,onLayoutSave:I||p?.variantService&&p?.appId?G:void 0,loading:u,layoutManager:j,onOpenGraphReport:Se?ye:void 0}),jsx(tp,{sx:{flex:1,...f?{maxHeight:f,height:f}:l?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:jsx(DndContext,{sensors:It,collisionDetection:closestCenter,onDragEnd:ia,modifiers:[restrictToHorizontalAxis],children:jsxs(vy,{sx:{minWidth:g?750:"auto",width:g?"100%":"auto",tableLayout:Object.keys(ge).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsx(Kc,{columns:T,visibleColumns:B,order:v,orderBy:M,onRequestSort:pe,onContextMenu:la,selectionMode:n,grouping:Y,isAllExpanded:ka,handleToggleAll:Te,rowCount:qe.length,numSelected:i.length,onSelectAllClick:Oe,columnWidths:ge,onColumnResize:ne}),jsx(Zc,{visibleRows:Oa,columns:T,visibleColumns:B,selectionMode:n,selected:i,orderBy:M,loading:u,expandedGroups:te,toggleGroupExpand:ce,handleExpandGroupRecursively:Tt,handleCollapseGroupRecursively:da,isGroupFullyExpanded:Mo,handleClick:Me,onSelectionChange:c,grouping:Y,rowKeyProp:C,page:Sa,rowsPerPage:Ia}),H&&jsx(jc,{showSummary:H,columns:T,visibleColumns:B,summaryRow:rt,selectionMode:n?.toString(),grouping:Y,orderBy:M,zIndex:3})]})})})]}),je&&jsxs(jd,{open:Ao,onClose:Wo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:N=>`1px solid ${N.palette.divider}`,bgcolor:"background.paper"}}},children:[jsx(Qd,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:x?.title||t("quickCreate.createWithTitle",{title:w})}),jsx(Xd,{sx:{pt:"8px !important"},children:jsxs(xn,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[zo.map(N=>{let K=N.type==="number"||N.numeric?"number":N.type==="date"?"date":"text",R=N.label||N.id;return jsx(Jd,{label:R,value:Bo[N.id]??"",onChange:Z=>gr(N.id,Z.target.value),type:K,size:"small",fullWidth:true,InputLabelProps:{shrink:K==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${N.id}`)}),x?.description&&jsx(ep,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:x.description})]})}),jsxs(Yd,{sx:{px:3,pb:2},children:[jsx(Ei,{onClick:Wo,sx:{fontSize:"0.85rem"},disabled:Ft,children:x?.cancelLabel||t("common.cancel")}),jsx(Ei,{onClick:fr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Ft,children:x?.submitLabel||t("common.save")})]})]}),Pt&&jsxs(jd,{open:Wt,onClose:$t,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:N=>`1px solid ${N.palette.divider}`,bgcolor:"background.paper"}}},children:[jsx(Qd,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||t("quickEdit.editWithTitle",{title:w})}),jsx(Xd,{sx:{pt:"8px !important"},children:jsxs(xn,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[co.map(N=>{let K=N.type==="number"||N.numeric?"number":N.type==="date"?"date":"text",R=N.label||N.id,Z=Ma(N.id);return jsx(Jd,{label:R,value:Fo[N.id]??"",onChange:ie=>yr(N.id,ie.target.value),type:K,size:"small",fullWidth:true,disabled:!Z,InputLabelProps:{shrink:K==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${N.id}`)}),k?.description&&jsx(ep,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:k.description})]})}),jsxs(Yd,{sx:{px:3,pb:2},children:[jsx(Ei,{onClick:$t,sx:{fontSize:"0.85rem"},disabled:Ie,children:k?.cancelLabel||t("common.cancel")}),jsx(Ei,{onClick:Ka,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Ie||!Nt,children:k?.submitLabel||t("common.save")})]})]}),pa&&jsx(an,{open:Lo,type:"warning",title:L?.title||t("quickDelete.confirmTitle"),message:L?.message||(Lt.length>1?t("quickDelete.confirmMessageMultiple",{count:Lt.length}):t("quickDelete.confirmMessageSingle")),confirmText:L?.confirmText||t("common.delete"),cancelText:L?.cancelText||t("common.cancel"),onClose:br,onConfirm:$o}),le,Se&&jsx(bi,{open:Pe,onClose:Re,model:F,aiAssistant:b?.aiAssistant,interaction:he?{enabled:true,filters:Ce.filters,fieldMapping:h,onPrimaryDimensionClick:N=>Ce.setFilter("primaryDimension",N),onSecondaryDimensionClick:N=>Ce.setFilter("secondaryDimension",N),onStatusClick:N=>Ce.setFilter("status",N),onClearFilter:Ce.clearFilter,onClearAll:Ce.clearAll}:void 0,tableContent:jsx(Co,{appId:ue||"graph-report-internal",title:t("graph.dataBody"),columns:W,rows:F.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},VP=Co;var KP=({id:e,title:t,hideHeader:o=true,filterConfig:a,tableProps:r,children:n,spacing:i=1,mode:c="separated"})=>{let d=a?{...a,appId:a.appId||e}:void 0,s={...r,appId:r.appId||e};return jsxs($c,{title:t,hideHeader:o,children:[jsxs(Stack,{spacing:i,sx:{height:"100%",overflow:"hidden"},children:[c==="separated"&&d&&jsx(Box,{sx:{flexShrink:0},children:jsx(Qo,{...d})}),jsx(Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsx(Co,{...s,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var XP=({metadata:e,fetchData:t,initialRowsPerPage:o=20,rowsPerPageOptions:a=[20,50,100,-1],tableKey:r="default",mode:n="integrated",serviceUrl:i,variantService:c})=>{let{t:d}=q(),[s,l]=useState(false),[g,f]=useState([]),[u,y]=useState({}),[I,p]=useState(e.variants||[]),[C,m]=useState(e.layout||null),[b,x]=useState(""),[k,L]=useState(0),[P,w]=useState(0),[E,T]=useState(o),[v,M]=useState([]),[S,D]=useState("asc"),[B,H]=useState("");useEffect(()=>{let ge={};e.filters.forEach(De=>{De.defaultValue!==void 0&&(ge[De.id]=De.defaultValue);}),y(ge);},[e.filters]);let V=useCallback(async(ge,De,Fe,Je,It)=>{l(true);try{let qe={...ge,page:De+1,limit:Fe,sort:It,order:Je},rt;t?rt=await t(qe):typeof e.api=="function"?rt=await e.api(qe):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,qe),rt={rows:[],total:0}):(console.warn("No API configured for report"),rt={rows:[],total:0}),rt&&(f(rt.rows||[]),L(rt.total||0));}catch(qe){console.error("Failed to fetch report data",qe);}finally{l(false);}},[e.api,t]);useEffect(()=>{V(u,P,E,S,B);},[V,P,E,S,B]);let _=()=>{w(0),V(u,0,E,S,B);},Y=ge=>{w(0),T(ge);},ee=(ge,De)=>{D(De),H(ge);},te=ge=>{y(ge);},oe=ge=>{x(ge?.id||"");let De=_d(ge,r);if(De){let Je=De.values??De;y(Je),V(Je,0,E,S,B),w(0);}let{layout:Fe}=Ai(ge,r);Fe&&m(Fe);},Bt=ge=>{let De={...ge,id:Date.now().toString(),createdAt:new Date().toISOString()};p(Fe=>[...Fe,De]);},lt=ge=>{m(ge);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:u,onFilterChange:te,onSearch:_,onVariantLoad:oe,onVariantSave:Bt,onVariantDelete:ge=>p(De=>De.filter(Fe=>Fe.id!==ge)),onVariantSetDefault:ge=>{p(De=>De.map(Fe=>({...Fe,isDefault:Fe.id===ge})));},variants:I,currentVariantId:b,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:g,loading:s,rowKey:"id",count:k,page:P,rowsPerPage:E,rowsPerPageOptions:a,onPageChange:w,onRowsPerPageChange:Y,selectionMode:"multiple",selected:v,onSelectionChange:M,onLayoutSave:lt,layout:C,title:e.title,showSummary:true,order:S,orderBy:B,serviceUrl:i,onSortChange:ee,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:u,rows:g,loading:s,refresh:_}};var Ay=e=>[...e].sort((t,o)=>o.value-t.value),eR=({bars:e=[],lines:t=[],combos:o=[],heatmap:a=[],pies:r=[],waterfalls:n=[]})=>{let i=useMemo(()=>Ay(e),[e]),c=useMemo(()=>[...t],[t]),d=useMemo(()=>[...o],[o]),s=useMemo(()=>[...a],[a]),l=useMemo(()=>{let f=r.reduce((u,y)=>u+y.value,0);return r.map(u=>({...u,percent:f>0?u.value/f*100:u.percent}))},[r]),g=useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:s,pies:l,waterfalls:g}};var nR=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>useMemo(()=>!e||!t?"":pn({apiKey:e,query:t,zoom:o,mapType:a}),[e,t,o,a]),iR=({keyword:e,location:t})=>useMemo(()=>mi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var vn=({code:e,language:t="text",copyable:o=true,showLineNumbers:a=false,wrapLongLines:r=false,maxHeight:n})=>{let[i,c]=useState(false),d=useMemo(()=>e.replace(/\n$/,"").split(`
|
|
4
|
-
`),[e]);return jsxs(Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",bgcolor:"background.paper"},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.6,bgcolor:"action.hover",borderBottom:"1px solid",borderColor:"divider"},children:[jsx(Typography,{variant:"caption",sx:{textTransform:"uppercase",letterSpacing:.5,color:"text.secondary",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:t}),o&&jsx(Tooltip,{title:i?"Copied":"Copy",children:jsx(IconButton,{size:"small",onClick:async()=>{try{await navigator.clipboard.writeText(e),c(!0),window.setTimeout(()=>c(!1),1400);}catch{c(false);}},children:i?jsx(
|
|
5
|
-
`).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=
|
|
3
|
+
${O}`,ue=encodeURI(G),fe=document.createElement("a");fe.setAttribute("href",ue),fe.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(fe),fe.click(),document.body.removeChild(fe);},ua=()=>{te(true);},Bo=()=>{te(false);};return {isMobile:false,columns:e.columns,order:n,orderBy:c,filterText:a,setFilterText:r,visibleColumns:I,setVisibleColumns:p,showSummary:C,setShowSummary:m,summaryColumns:b,grouping:k,setGrouping:L,expandedGroups:P,setExpandedGroups:w,groupAnchorEl:S,setGroupAnchorEl:D,summaryAnchorEl:B,setSummaryAnchorEl:H,columnWidths:E,setColumnWidths:T,anchorEl:v,setAnchorEl:M,contextMenu:V,setContextMenu:q,sensors:void 0,sortedAndFilteredRows:ge,visibleRows:rt,summaryRow:Te,page:s,setPage:$e,rowsPerPage:g,setRowsPerPage:Me,totalDisplayCount:$a,selected:u,setSelected:y,isAllExpanded:Tt.length>0&&Tt.every(z=>P.has(z)),handleColumnResize:de,handleRequestSort:$,handleSelectAllClick:ne,handleClick:pe,toggleSummaryColumn:ca,handleDragEnd:()=>{},handleExport:Pt,handleContextMenu:ce,handleCloseContextMenu:ft,toggleColumnVisibility:Jt,toggleGroupExpand:wa,toggleGroupField:la,handleToggleAll:Pa,handleExpandGroupRecursively:Ia,handleCollapseGroupRecursively:Ta,isGroupFullyExpanded:gt,handleLayoutLoad:ke,handleVariantLoad:pa,handleLayoutSave:da,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:I,order:n,orderBy:c,grouping:k,columnWidths:E,showSummary:C,summaryColumns:b},currentLayoutId:ae,layoutIdToLoad:Ft,onPageChange:$e,onRowsPerPageChange:Me,graphReportOpen:Y,handleOpenGraphReport:ua,handleCloseGraphReport:Bo}};var EP=e=>jsx(ky,{...e}),LP=e=>jsx(js,{...e}),NP=e=>jsx(ap,{...e}),zP=e=>jsx(Ug,{...e}),VP=e=>jsx(Kg,{...e}),So=e=>{let{t}=K(),o="0.85rem",{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:s,fitContainer:l=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:y=[20,50,100,-1],onLayoutSave:I,filterConfig:p,rowKey:C,tableKey:m="default",graphReport:b,quickCreate:x,quickEdit:k,quickDelete:L,serviceUrl:P}=e,w=a||t("table.title.default"),{isMobile:E,columns:T,order:v,orderBy:M,filterText:S,setFilterText:D,visibleColumns:B,showSummary:H,setShowSummary:V,summaryColumns:q,grouping:Y,setGrouping:te,expandedGroups:ae,groupAnchorEl:oe,setGroupAnchorEl:Ft,summaryAnchorEl:lt,setSummaryAnchorEl:Ke,columnWidths:ge,anchorEl:De,setAnchorEl:Fe,contextMenu:Je,sensors:Tt,sortedAndFilteredRows:qe,summaryRow:rt,visibleRows:$a,isAllExpanded:wa,page:Ia,setPage:Ta,rowsPerPage:Pa,setRowsPerPage:gt,totalDisplayCount:$,setSelected:de,handleColumnResize:ne,handleRequestSort:pe,handleSelectAllClick:$e,handleClick:Me,toggleSummaryColumn:Jt,handleDragEnd:la,handleExport:ca,handleContextMenu:da,handleCloseContextMenu:pa,toggleColumnVisibility:ke,toggleGroupExpand:ce,toggleGroupField:ft,handleToggleAll:Te,handleExpandGroupRecursively:Pt,handleCollapseGroupRecursively:ua,isGroupFullyExpanded:Bo,handleLayoutLoad:z,handleVariantLoad:O,handleLayoutSave:G,effectiveAppId:ue,currentLayoutData:fe,currentLayoutId:we,layoutIdToLoad:ie,graphReportOpen:Pe,handleOpenGraphReport:ye,handleCloseGraphReport:Re}=Ei(e),Se=b?.enabled??false,he=Se&&(b?.interaction?.enabled??true),Ce=Ci(),je=!!x?.enabled,Rt=!!k?.enabled,ma=!!L?.enabled,$t=x?.fields,ea=x?.excludeFields||[],Ra=x?.initialValues||{},[Fo,co]=mt__default.useState(false),[Et,Ha]=mt__default.useState(false),[Eo,Lt]=mt__default.useState({}),[Ht,Dt]=mt__default.useState(false),[Ie,ta]=mt__default.useState(false),[Lo,No]=mt__default.useState({}),[zo,Ga]=mt__default.useState(false),[Da,Ma]=mt__default.useState(false),Vo=u||Et||Ie||Da,Oo=mt__default.useMemo(()=>{let N=[...T];if(Array.isArray($t)&&$t.length>0){let U=new Set($t);N=N.filter(R=>U.has(R.id));}if(ea.length>0){let U=new Set(ea);N=N.filter(R=>!U.has(R.id));}return N.filter(U=>!!U?.id)},[T,ea,$t]),po=C||"id",Nt=mt__default.useMemo(()=>{let N=new Set(i);return qe.filter(U=>N.has(U?.[po]))},[i,qe,po]),zt=Nt.length===1?Nt[0]:null,Aa=k?.fields,Ua=k?.excludeFields||[],Ka=k?.editableFields||[],Wo=k?.nonEditableFields||[],$o=k?.primaryKeys?.length?k.primaryKeys:[po],uo=mt__default.useMemo(()=>{let N=[...T];if(Array.isArray(Aa)&&Aa.length>0){let U=new Set(Aa);N=N.filter(R=>U.has(R.id));}if(Ua.length>0){let U=new Set(Ua);N=N.filter(R=>!U.has(R.id));}return N.filter(U=>!!U?.id)},[T,Ua,Aa]),mo=mt__default.useMemo(()=>new Set($o),[$o]),qa=mt__default.useMemo(()=>new Set(Ka),[Ka]),aa=mt__default.useMemo(()=>new Set(Wo),[Wo]),Ba=mt__default.useCallback(N=>qa.size>0?qa.has(N):!(aa.has(N)||mo.has(N)),[qa,aa,mo]);mt__default.useEffect(()=>{!Pe&&Ce.hasActiveFilters&&Ce.clearAll();},[Pe,Ce.hasActiveFilters,Ce.clearAll]);let fr=()=>{let N={};Oo.forEach(U=>{N[U.id]=Ra[U.id]??"";}),Lt(N),co(true);},Ho=()=>{Et||co(false);},hr=(N,U)=>{Lt(R=>({...R,[N]:U}));},yr=async()=>{if(!x?.onSubmit){co(false);return}try{Ha(!0),await x.onSubmit(Eo),co(!1);}finally{Ha(false);}},br=()=>{if(!zt)return;let N={};uo.forEach(R=>{N[R.id]=zt[R.id]??"";});let U=k?.getInitialValues?{...N,...k.getInitialValues(zt)}:N;No(U),Dt(true);},Gt=()=>{Ie||Dt(false);},xr=(N,U)=>{No(R=>({...R,[N]:U}));},_a=async()=>{if(zt){if(!k?.onSubmit){Dt(false);return}try{ta(!0),await k.onSubmit(Lo,zt),Dt(!1);}finally{ta(false);}}},Fa=()=>{Nt.length!==0&&Ga(true);},vr=()=>{Da||Ga(false);},Go=async()=>{if(Nt.length===0){Ga(false);return}if(!L?.onConfirm){Ga(false),de([]),c?.([]);return}try{Ma(!0),await L.onConfirm(Nt),Ga(!1),de([]),c?.([]);}finally{Ma(false);}},go=qe,{fieldMapping:h}=Ar({rows:go,config:{...b,title:b?.title||`${w} ${t("graph.reportTitle")}`}}),A=mt__default.useMemo(()=>he?Ce.applyRows(go,h):go,[he,Ce.applyRows,go,h]),{model:F}=Ar({rows:A,config:{...b,title:b?.title||`${w} ${t("graph.reportTitle")}`,fieldMapping:h}}),W=F.table.columns.map(N=>({id:N.id,label:N.label,align:N.align||"left",minWidth:120,numeric:N.align==="right"})),j=ue?jsx(Ai,{appId:ue,tableKey:m,currentLayoutData:fe,onLayoutLoad:z,targetLayoutId:ie,activeLayoutId:we,serviceUrl:P??p?.serviceUrl}):null,se=jsxs(Fragment,{children:[jsx(ei,{groupAnchorEl:oe,setGroupAnchorEl:Ft,grouping:Y,setGrouping:te,columns:T,toggleGroupField:ft}),jsx(ti,{anchorEl:De,setAnchorEl:Fe,columns:T,visibleColumns:B,toggleColumnVisibility:ke}),jsx(ai,{anchorEl:lt,setAnchorEl:Ke,showSummary:H,setShowSummary:V,columns:T,summaryColumns:q,toggleSummaryColumn:Jt}),jsx(oi,{contextMenu:Je,handleCloseContextMenu:pa,columns:T,visibleColumns:B,toggleColumnVisibility:ke})]});return E?jsxs(Cn,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[p&&jsx(Yo,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:p.onVariantLoad,onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:fe}],variantService:p.variantService,serviceUrl:P??p.serviceUrl}),jsx(Yc,{title:w,loading:u,showSummary:H,setShowSummary:V,setAnchorEl:Fe,setSummaryAnchorEl:Ke,filterText:S,setFilterText:D,sortedAndFilteredRows:qe,selected:i,columns:T,visibleColumns:B,summaryRow:rt,handleClick:Me,selectionMode:n}),se]}):jsxs(Cn,{sx:{width:g?"100%":"auto",mb:l?0:2,...l?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p&&jsx(Cn,{sx:{mb:2},children:jsx(Yo,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:N=>{O(N),p.onVariantLoad&&p.onVariantLoad(N);},onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,loading:u,appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:fe}],currentLayoutId:we,layoutRefs:[{tableKey:m,layoutId:we}],variantService:p.variantService,serviceUrl:P??p.serviceUrl})}),jsxs(vy,{sx:{width:g?"100%":"auto",mb:l?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Vo?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f?{height:f}:l?{flex:1,minHeight:0,height:"100%"}:{}},children:[r&&jsx(Qn,{filterText:S,setFilterText:D,onRowsPerPageChange:gt,rowsPerPage:Pa,rowsPerPageOptions:y,page:Ia,count:$,onPageChange:Ta,actions:d,extraTools:s,grouping:Y,setGroupAnchorEl:Ft,showSummary:H,setShowSummary:V,setAnchorEl:Fe,setSummaryAnchorEl:Ke,handleExport:ca,showCreateButton:je,onOpenCreateDialog:fr,showEditButton:Rt,onOpenEditDialog:br,editDisabled:Nt.length!==1,showDeleteButton:ma,onOpenDeleteConfirm:Fa,deleteDisabled:Nt.length===0,onLayoutSave:I||p?.variantService&&p?.appId?G:void 0,loading:u,layoutManager:j,onOpenGraphReport:Se?ye:void 0}),jsx(ap,{sx:{flex:1,...f?{maxHeight:f,height:f}:l?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:jsx(DndContext,{sensors:Tt,collisionDetection:closestCenter,onDragEnd:la,modifiers:[restrictToHorizontalAxis],children:jsxs(Cy,{sx:{minWidth:g?750:"auto",width:g?"100%":"auto",tableLayout:Object.keys(ge).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsx(qc,{columns:T,visibleColumns:B,order:v,orderBy:M,onRequestSort:pe,onContextMenu:da,selectionMode:n,grouping:Y,isAllExpanded:wa,handleToggleAll:Te,rowCount:qe.length,numSelected:i.length,onSelectAllClick:$e,columnWidths:ge,onColumnResize:ne}),jsx(jc,{visibleRows:$a,columns:T,visibleColumns:B,selectionMode:n,selected:i,orderBy:M,loading:u,expandedGroups:ae,toggleGroupExpand:ce,handleExpandGroupRecursively:Pt,handleCollapseGroupRecursively:ua,isGroupFullyExpanded:Bo,handleClick:Me,onSelectionChange:c,grouping:Y,rowKeyProp:C,page:Ia,rowsPerPage:Pa}),H&&jsx(Qc,{showSummary:H,columns:T,visibleColumns:B,summaryRow:rt,selectionMode:n?.toString(),grouping:Y,orderBy:M,zIndex:3})]})})})]}),je&&jsxs(Qd,{open:Fo,onClose:Ho,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:N=>`1px solid ${N.palette.divider}`,bgcolor:"background.paper"}}},children:[jsx(Xd,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:x?.title||t("quickCreate.createWithTitle",{title:w})}),jsx(Yd,{sx:{pt:"8px !important"},children:jsxs(Cn,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Oo.map(N=>{let U=N.type==="number"||N.numeric?"number":N.type==="date"?"date":"text",R=N.label||N.id;return jsx(ep,{label:R,value:Eo[N.id]??"",onChange:_=>hr(N.id,_.target.value),type:U,size:"small",fullWidth:true,InputLabelProps:{shrink:U==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${N.id}`)}),x?.description&&jsx(tp,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:x.description})]})}),jsxs(Jd,{sx:{px:3,pb:2},children:[jsx(Li,{onClick:Ho,sx:{fontSize:"0.85rem"},disabled:Et,children:x?.cancelLabel||t("common.cancel")}),jsx(Li,{onClick:yr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Et,children:x?.submitLabel||t("common.save")})]})]}),Rt&&jsxs(Qd,{open:Ht,onClose:Gt,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:N=>`1px solid ${N.palette.divider}`,bgcolor:"background.paper"}}},children:[jsx(Xd,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||t("quickEdit.editWithTitle",{title:w})}),jsx(Yd,{sx:{pt:"8px !important"},children:jsxs(Cn,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[uo.map(N=>{let U=N.type==="number"||N.numeric?"number":N.type==="date"?"date":"text",R=N.label||N.id,_=Ba(N.id);return jsx(ep,{label:R,value:Lo[N.id]??"",onChange:le=>xr(N.id,le.target.value),type:U,size:"small",fullWidth:true,disabled:!_,InputLabelProps:{shrink:U==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${N.id}`)}),k?.description&&jsx(tp,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:k.description})]})}),jsxs(Jd,{sx:{px:3,pb:2},children:[jsx(Li,{onClick:Gt,sx:{fontSize:"0.85rem"},disabled:Ie,children:k?.cancelLabel||t("common.cancel")}),jsx(Li,{onClick:_a,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Ie||!zt,children:k?.submitLabel||t("common.save")})]})]}),ma&&jsx(rn,{open:zo,type:"warning",title:L?.title||t("quickDelete.confirmTitle"),message:L?.message||(Nt.length>1?t("quickDelete.confirmMessageMultiple",{count:Nt.length}):t("quickDelete.confirmMessageSingle")),confirmText:L?.confirmText||t("common.delete"),cancelText:L?.cancelText||t("common.cancel"),onClose:vr,onConfirm:Go}),se,Se&&jsx(xi,{open:Pe,onClose:Re,model:F,aiAssistant:b?.aiAssistant,interaction:he?{enabled:true,filters:Ce.filters,fieldMapping:h,onPrimaryDimensionClick:N=>Ce.setFilter("primaryDimension",N),onSecondaryDimensionClick:N=>Ce.setFilter("secondaryDimension",N),onStatusClick:N=>Ce.setFilter("status",N),onClearFilter:Ce.clearFilter,onClearAll:Ce.clearAll}:void 0,tableContent:jsx(So,{appId:ue||"graph-report-internal",title:t("graph.dataBody"),columns:W,rows:F.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},OP=So;var qP=({id:e,title:t,hideHeader:o=true,filterConfig:a,tableProps:r,children:n,spacing:i=1,mode:c="separated"})=>{let d=a?{...a,appId:a.appId||e}:void 0,s={...r,appId:r.appId||e};return jsxs(Hc,{title:t,hideHeader:o,children:[jsxs(Stack,{spacing:i,sx:{height:"100%",overflow:"hidden"},children:[c==="separated"&&d&&jsx(Box,{sx:{flexShrink:0},children:jsx(Yo,{...d})}),jsx(Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsx(So,{...s,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var YP=({metadata:e,fetchData:t,initialRowsPerPage:o=20,rowsPerPageOptions:a=[20,50,100,-1],tableKey:r="default",mode:n="integrated",serviceUrl:i,variantService:c})=>{let{t:d}=K(),[s,l]=useState(false),[g,f]=useState([]),[u,y]=useState({}),[I,p]=useState(e.variants||[]),[C,m]=useState(e.layout||null),[b,x]=useState(""),[k,L]=useState(0),[P,w]=useState(0),[E,T]=useState(o),[v,M]=useState([]),[S,D]=useState("asc"),[B,H]=useState("");useEffect(()=>{let ge={};e.filters.forEach(De=>{De.defaultValue!==void 0&&(ge[De.id]=De.defaultValue);}),y(ge);},[e.filters]);let V=useCallback(async(ge,De,Fe,Je,Tt)=>{l(true);try{let qe={...ge,page:De+1,limit:Fe,sort:Tt,order:Je},rt;t?rt=await t(qe):typeof e.api=="function"?rt=await e.api(qe):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,qe),rt={rows:[],total:0}):(console.warn("No API configured for report"),rt={rows:[],total:0}),rt&&(f(rt.rows||[]),L(rt.total||0));}catch(qe){console.error("Failed to fetch report data",qe);}finally{l(false);}},[e.api,t]);useEffect(()=>{V(u,P,E,S,B);},[V,P,E,S,B]);let q=()=>{w(0),V(u,0,E,S,B);},Y=ge=>{w(0),T(ge);},te=(ge,De)=>{D(De),H(ge);},ae=ge=>{y(ge);},oe=ge=>{x(ge?.id||"");let De=Zd(ge,r);if(De){let Je=De.values??De;y(Je),V(Je,0,E,S,B),w(0);}let{layout:Fe}=Bi(ge,r);Fe&&m(Fe);},Ft=ge=>{let De={...ge,id:Date.now().toString(),createdAt:new Date().toISOString()};p(Fe=>[...Fe,De]);},lt=ge=>{m(ge);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:u,onFilterChange:ae,onSearch:q,onVariantLoad:oe,onVariantSave:Ft,onVariantDelete:ge=>p(De=>De.filter(Fe=>Fe.id!==ge)),onVariantSetDefault:ge=>{p(De=>De.map(Fe=>({...Fe,isDefault:Fe.id===ge})));},variants:I,currentVariantId:b,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:g,loading:s,rowKey:"id",count:k,page:P,rowsPerPage:E,rowsPerPageOptions:a,onPageChange:w,onRowsPerPageChange:Y,selectionMode:"multiple",selected:v,onSelectionChange:M,onLayoutSave:lt,layout:C,title:e.title,showSummary:true,order:S,orderBy:B,serviceUrl:i,onSortChange:te,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:u,rows:g,loading:s,refresh:q}};var By=e=>[...e].sort((t,o)=>o.value-t.value),tR=({bars:e=[],lines:t=[],combos:o=[],heatmap:a=[],pies:r=[],waterfalls:n=[]})=>{let i=useMemo(()=>By(e),[e]),c=useMemo(()=>[...t],[t]),d=useMemo(()=>[...o],[o]),s=useMemo(()=>[...a],[a]),l=useMemo(()=>{let f=r.reduce((u,y)=>u+y.value,0);return r.map(u=>({...u,percent:f>0?u.value/f*100:u.percent}))},[r]),g=useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:s,pies:l,waterfalls:g}};var iR=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>useMemo(()=>!e||!t?"":mn({apiKey:e,query:t,zoom:o,mapType:a}),[e,t,o,a]),sR=({keyword:e,location:t})=>useMemo(()=>gi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var kn=({code:e,language:t="text",copyable:o=true,showLineNumbers:a=false,wrapLongLines:r=false,maxHeight:n})=>{let[i,c]=useState(false),d=useMemo(()=>e.replace(/\n$/,"").split(`
|
|
4
|
+
`),[e]);return jsxs(Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",bgcolor:"background.paper"},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.6,bgcolor:"action.hover",borderBottom:"1px solid",borderColor:"divider"},children:[jsx(Typography,{variant:"caption",sx:{textTransform:"uppercase",letterSpacing:.5,color:"text.secondary",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:t}),o&&jsx(Tooltip,{title:i?"Copied":"Copy",children:jsx(IconButton,{size:"small",onClick:async()=>{try{await navigator.clipboard.writeText(e),c(!0),window.setTimeout(()=>c(!1),1400);}catch{c(false);}},children:i?jsx(Oy,{fontSize:"inherit"}):jsx(Vy,{fontSize:"inherit"})})})]}),jsx(Box,{component:"pre",sx:{m:0,p:1.25,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:n,bgcolor:"background.default",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:a?d.map((l,g)=>jsxs(Box,{sx:{display:"flex"},children:[jsx(Box,{component:"span",sx:{width:34,flexShrink:0,textAlign:"right",pr:1,color:"text.disabled",userSelect:"none"},children:g+1}),jsx(Box,{component:"span",sx:{whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:l})]},`${g}-${l}`)):jsx(Box,{component:"code",sx:{display:"block",whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:e})})]})};var Uy=e=>{let t=e.trim();return t.startsWith("$$")&&t.endsWith("$$")&&t.length>=4&&(t=t.slice(2,-2).trim()),t.startsWith("$")&&t.endsWith("$")&&t.length>=2&&(t=t.slice(1,-1).trim()),t},Ky=async e=>new Function("m","return import(m)")(e),Sn=({expression:e,inline:t=false,allowKatex:o=false})=>{let a=useMemo(()=>Uy(e),[e]),[r,n]=useState("");return useEffect(()=>{let i=true;return (async()=>{if(!o||!a){n("");return}try{let d=await Ky("katex"),l=(d?.default||d)?.renderToString?.(a,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof l=="string"&&n(l);}catch{i&&n("");}})(),()=>{i=false;}},[o,a,t]),a?r?jsx(Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:r}}):t?jsx(Box,{component:"code",sx:{px:.4,py:.05,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:a}):jsx(Box,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:jsx(Typography,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",fontSize:"0.9rem",lineHeight:1.5,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:a})}):null};var Yy=async e=>new Function("m","return import(m)")(e),Sl=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:a=true})=>{let[r,n]=useState(""),[i,c]=useState(""),[d,s]=useState(false),l=useMemo(()=>e.trim(),[e]);return useEffect(()=>{let g=true;return (async()=>{if(!a||!l){n(""),c("");return}s(true),c(""),n("");try{let u=await Yy("mermaid"),y=u?.default||u;if(!y||typeof y.render!="function")throw new Error("Mermaid runtime is not available");y.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let I=await y.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,l),p=typeof I=="string"?I:I?.svg;g&&typeof p=="string"&&n(p);}catch(u){if(g){let y=u instanceof Error?u.message:"Failed to render Mermaid diagram";c(y);}}finally{g&&s(false);}})(),()=>{g=false;}},[a,l]),jsxs(Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[jsx(Box,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsx(Typography,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:t})}),jsxs(Box,{sx:{p:1},children:[d&&jsx(Box,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(CircularProgress,{size:20})}),!d&&r&&jsx(Box,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:r}}),!d&&!r&&jsxs(Box,{children:[i&&jsx(Alert,{severity:"info",sx:{mb:1},children:i}),jsx(kn,{code:l,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var wl=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),ib=e=>/^:?-{3,}:?$/.test(e.trim()),sb=e=>{let t=e.trim(),o=t.startsWith(":"),a=t.endsWith(":");return o&&a?"center":a?"right":"left"},Vi=e=>{let t=e.split(`
|
|
5
|
+
`).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=wl(t[0]),a=wl(t[1]);if(o.length===0||a.length!==o.length||!a.every(ib))return null;let r=a.map(sb),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let c=wl(i);return c.length<o.length?[...c,...Array.from({length:o.length-c.length},()=>"")]:c.slice(0,o.length)});return {headers:o,aligns:r,rows:n}},Il=({markdown:e,table:t,maxHeight:o=360})=>{let a=useMemo(()=>t||(e?Vi(e):null),[t,e]);return !a||a.headers.length===0?jsx(Paper,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:jsx(Typography,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):jsx(Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:jsx(TableContainer,{sx:{maxHeight:o},children:jsxs(Table,{size:"small",stickyHeader:true,children:[jsx(TableHead,{children:jsx(TableRow,{children:a.headers.map((r,n)=>jsx(TableCell,{align:a.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:r},`${r}-${n}`))})}),jsx(TableBody,{children:a.rows.map((r,n)=>jsx(TableRow,{hover:true,children:r.map((i,c)=>jsx(TableCell,{align:a.aligns[c],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i||jsx(Box,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${n}-${c}`))},`row-${n}`))})]})})})};var Wi=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:a=false})=>{let[r,n]=useState(o);return jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[jsxs(Stack,{direction:"row",alignItems:"center",spacing:.6,children:[jsx(IconButton,{size:"small",onClick:()=>n(i=>!i),sx:{transform:r?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsx(gb,{fontSize:"inherit"})}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,a?" ...":""]})]}),jsx(Collapse,{in:r,children:jsx(Typography,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:e})})]})};var Pl=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,$i=e=>e.trim().startsWith("```"),up=e=>/^#{1,6}\s+/.test(e.trim()),Rl=e=>/^[-*+]\s+/.test(e.trim()),Dl=e=>/^\d+\.\s+/.test(e.trim()),mp=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),Ml=e=>e.trim().startsWith(">"),gp=(e,t)=>{if(t+1>=e.length)return false;let o=e[t],a=e[t+1];return !o.includes("|")||!a.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(a.trim())},fp=e=>e.trim().startsWith("<think>")||e.trim()===":::think",Tn=(e,t,o)=>{let a=[],r=0,n=0;Pl.lastIndex=0;let i=Pl.exec(e);for(;i;){i.index>r&&a.push(e.slice(r,i.index));let c=i[0],d=`${o}-${n}`;if(c.startsWith("**")&&c.endsWith("**"))a.push(jsx("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))a.push(jsx("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))a.push(jsx(Box,{component:"code",sx:{px:.45,py:.08,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:c.slice(1,-1)},d));else if(c.startsWith("[")&&c.includes("](")&&c.endsWith(")")){let s=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/);s?a.push(jsx(Link,{href:s[2],target:"_blank",rel:"noreferrer",underline:"hover",children:s[1]},d)):a.push(c);}else c.startsWith("$")&&c.endsWith("$")&&t.enableMath?a.push(jsx(Sn,{expression:c,inline:true,allowKatex:true},d)):a.push(c);r=i.index+c.length,n+=1,i=Pl.exec(e);}return r<e.length&&a.push(e.slice(r)),a.length>0?a:[e]},Pn=({markdown:e,content:t,className:o,enableMath:a=true,enableMermaid:r=true,enableThinkBlock:n=true,codeCopyable:i=true,codeLineNumbers:c=false})=>{let d=e??t??"",s=useMemo(()=>{let l=[],g=d.replace(/\r\n/g,`
|
|
6
6
|
`).split(`
|
|
7
|
-
`),f={enableMath:a},u=0;for(;u<g.length;){let y=g[u],I=y.trim();if(!I){u+=1;continue}if(n&&
|
|
8
|
-
`).trim()},`think-tag-${u}`));continue}u+=1;let C=[];for(;u<g.length&&g[u].trim()!==":::";)C.push(g[u]),u+=1;u<g.length&&g[u].trim()===":::"&&(u+=1),l.push(jsx(
|
|
9
|
-
`).trim()},`think-fence-${u}`));continue}if(
|
|
10
|
-
`);if(r&&C==="mermaid"){l.push(jsx(
|
|
11
|
-
`).trim(),allowKatex:true},`math-${u}`));continue}if(
|
|
12
|
-
`),b=zi(m);if(b){l.push(jsx(wl,{table:b},`table-${u}`)),u=C;continue}}if(Dl(y)){let C=[];for(;u<g.length&&Dl(g[u]);)C.push(g[u].replace(/^\s*>\s?/,"")),u+=1;l.push(jsx(Paper,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:jsx(Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:C.map((m,b)=>jsxs(Fragment$1,{children:[b>0&&jsx("br",{}),wn(m,f,`q-${u}-${b}`)]},`quote-line-${b}`))})},`quote-${u}`));continue}if(Pl(y)){let C=[];for(;u<g.length&&Pl(g[u]);)C.push(g[u].trim().replace(/^[-*+]\s+/,"")),u+=1;l.push(jsx(Box,{component:"ul",sx:{my:.8,pl:2.5},children:C.map((m,b)=>jsx(Box,{component:"li",sx:{mb:.45},children:jsx(Typography,{variant:"body2",children:wn(m,f,`ul-${u}-${b}`)})},`ul-item-${b}`))},`ul-${u}`));continue}if(Rl(y)){let C=[];for(;u<g.length&&Rl(g[u]);)C.push(g[u].trim().replace(/^\d+\.\s+/,"")),u+=1;l.push(jsx(Box,{component:"ol",sx:{my:.8,pl:2.7},children:C.map((m,b)=>jsx(Box,{component:"li",sx:{mb:.45},children:jsx(Typography,{variant:"body2",children:wn(m,f,`ol-${u}-${b}`)})},`ol-item-${b}`))},`ol-${u}`));continue}let p=[];for(;u<g.length;){let C=g[u],m=C.trim();if(!m||Wi(C)||pp(C)||up(C)||Pl(C)||Rl(C)||Dl(C)||mp(g,u)||n&&gp(C)||a&&m.startsWith("$$"))break;p.push(C),u+=1;}p.length>0?l.push(jsx(Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:p.map((C,m)=>jsxs(Fragment$1,{children:[m>0&&jsx("br",{}),wn(C,f,`p-${u}-${m}`)]},`p-line-${m}`))},`p-${u}`)):u+=1;}return l},[d,a,r,n,i,c]);return jsx(Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:s})};var HR=(e,t)=>jsx(In,{markdown:e,...t});var yp=({value:e,onChange:t,onSubmit:o,onVoiceInput:a,onClear:r,placeholder:n,statusText:i,loading:c=false,compact:d=false,showStatusText:s=true})=>jsxs(Stack,{spacing:.75,children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[jsx(Nd,{sx:{fontSize:d?16:18,color:"text.secondary"}}),jsx(InputBase,{fullWidth:true,value:e,onChange:l=>t(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),o());},placeholder:n,sx:{fontSize:d?"0.84rem":"0.9rem"}}),e&&r&&jsx(IconButton,{size:"small",onClick:r,children:jsx(Kf,{sx:{fontSize:d?16:18}})}),a&&jsx(IconButton,{size:"small",onClick:a,children:jsx(Jf,{sx:{fontSize:d?16:18}})}),jsx(IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsx(th,{sx:{fontSize:d?16:18}})})]}),s&&i&&jsx(Typography,{variant:"caption",color:"text.secondary",children:i})]});var bp=(e,t)=>{let o=t.trim();if(!o)return e;let a=e.toLowerCase(),r=o.toLowerCase(),n=a.indexOf(r);return n<0?e:jsxs(Fragment,{children:[e.slice(0,n),jsx(Box,{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:e.slice(n,n+o.length)}),e.slice(n+o.length)]})},$i=({section:e,highlightQuery:t=""})=>{let o=e.columns||2;return jsxs(Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsx(Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsx(Box,{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:o===3?"repeat(3, minmax(0, 1fr))":o===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:e.fields.map(a=>{let r=typeof a.value=="string"||typeof a.value=="number"?String(a.value):null;return jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:bp(a.label,t)}),jsx(Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?bp(r,t):a.value})]},a.id)})})]})};var El=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",Gi=e=>e.trim().toLowerCase(),Ab=(e,t)=>{let o=[];return e.forEach(a=>{a.fields.forEach(r=>{let n=r.searchableText||El(r.value),i={source:"section",sourceId:a.id,sourceSectionId:a.id,sourceTitle:a.title,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:Gi(`${a.title} ${r.label} ${n}`)});});}),t.forEach(a=>{(a.fields||[]).forEach(r=>{let n=r.searchableText||El(r.value),i={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:Gi(`${a.label} ${r.label} ${n}`)});}),(a.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||El(n.value),c={source:"tab",sourceId:a.id,sourceSectionId:r.id,sourceTitle:`${a.label} / ${r.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};o.push({hit:c,text:Gi(`${a.label} ${r.title} ${n.label} ${i}`)});});});}),o},xp=({sections:e,tabs:t=[],defaultTabId:o,ai:a})=>{let{t:r}=q(),[n,i]=useState(""),[c,d]=useState(o||t[0]?.id),[s,l]=useState("idle"),[g,f]=useState([]),[u,y]=useState(""),[I,p]=useState(""),[C,m]=useState(false),b=useMemo(()=>Ab(e,t),[e,t]);useEffect(()=>{if(t.length===0){d(void 0);return}t.some(E=>E.id===c)||d(o||t[0]?.id);},[t,c,o]);let x=useCallback(()=>{l("idle"),f([]),y(""),p("");},[]),k=useCallback(w=>{i(w),w.trim()||(l("idle"),f([]),y(""),p(""));},[]),L=useCallback(w=>{let E=Gi(w);return E?b.filter(T=>T.text.includes(E)).map(T=>T.hit):[]},[b]),P=useCallback(async()=>{let w=n.trim();if(!w)return;m(true);let E=L(w);if(f(E),E.length>0){l("search"),p(""),y(r("detail.searchAi.matches",{count:E.length})),m(false);return}if(a?.enabled!==false&&a?.onSubmit){l("ai"),y(r("detail.searchAi.autoAiFallback"));try{let v=await a.onSubmit(w,{query:w,hits:E,activeTabId:c,sections:e,tabs:t});p(typeof v=="string"?v:"");}finally{m(false);}return}l("search"),p(""),y(r("detail.searchAi.noMatch")),m(false);},[n,L,r,a,c,e,t]);return {query:n,setQuery:k,activeTabId:c,setActiveTabId:d,searchMode:s,hits:g,statusText:u,aiResponse:I,searching:C,handleSubmit:P,clearResult:x}};var xD=({title:e,subtitle:t,sections:o,tabs:a=[],defaultTabId:r,table:n,ai:i,rightHeaderSlot:c,searchBarWidth:d=460,onClose:s,closeLabel:l="Close"})=>{let{t:g}=q(),{query:f,setQuery:u,activeTabId:y,setActiveTabId:I,searchMode:p,hits:C,statusText:m,aiResponse:b,searching:x,handleSubmit:k,clearResult:L}=xp({sections:o,tabs:a,defaultTabId:r,ai:i}),P=useMemo(()=>a.find(T=>T.id===y)||a[0],[a,y]),w=useCallback(T=>{let v=M=>{let S=document.getElementById(T);if(S){S.scrollIntoView({behavior:"smooth",block:"center"});return}M<4&&setTimeout(()=>v(M+1),60);};requestAnimationFrame(()=>v(0));},[]),E=useCallback((T,v)=>{if(a.some(M=>M.id===T)){I(T),w(v?`detail-tab-${T}-section-${v}`:`detail-tab-${T}`);return}w(`detail-section-${T}`);},[a,I,w]);return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[jsxs(Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:e}),t&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:t})]}),jsxs(Stack,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[jsx(Box,{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:jsx(yp,{value:f,onChange:u,onSubmit:k,onVoiceInput:i?.onVoiceInput,onClear:()=>{u(""),L();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:m,loading:x,compact:true,showStatusText:false})}),s&&jsx(Tooltip,{title:l,children:jsx(IconButton,{size:"small",onClick:s,children:jsx(zb,{fontSize:"small"})})}),c]})]}),m&&jsx(Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:m}),p==="search"&&C.length>0&&jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:g("detail.searchAi.matches",{count:C.length})}),jsx(Stack,{spacing:.35,children:C.slice(0,8).map(T=>jsx(Box,{component:"button",type:"button",onClick:()=>E(T.sourceId,T.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:jsxs(Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsx(Box,{component:"span",sx:{color:"text.secondary"},children:T.sourceTitle})," \xB7 ",jsx(Box,{component:"span",sx:{fontWeight:700},children:T.fieldLabel})," = ",jsx(Box,{component:"span",children:T.fieldValue||"-"})]})},`${T.source}|${T.sourceId}|${T.fieldId}`))})]}),p==="ai"&&b&&jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsx(Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:g("detail.searchAi.aiResultTitle")}),jsx(Box,{sx:{fontSize:"0.9rem",lineHeight:1.6,"& p":{m:0,mb:.8},"& h1, & h2, & h3, & h4":{mt:1.2,mb:.6,lineHeight:1.3},"& ul, & ol":{mt:.4,mb:.8,pl:2.6},"& code":{px:.5,py:.1,borderRadius:.8,bgcolor:"action.hover",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"& pre":{m:0,mt:.8,mb:.8,p:1.1,borderRadius:1.2,bgcolor:"action.hover",overflowX:"auto"},"& pre code":{p:0,bgcolor:"transparent"}},children:jsx(In,{markdown:b})})]}),jsx(Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(T=>jsx(Box,{id:`detail-section-${T.id}`,children:jsx($i,{section:T,highlightQuery:f})},T.id))}),a.length>0&&jsxs(Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsx(Tabs,{value:P?.id||false,onChange:(T,v)=>I(v),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(T=>jsx(Tab,{value:T.id,label:T.label,sx:{textTransform:"none"}},T.id))}),jsxs(Box,{sx:{p:1.5},children:[jsx(Box,{id:`detail-tab-${P?.id||""}`}),P?.description&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:P.description}),P?.content?P.content:jsxs(Stack,{spacing:1.5,children:[(P?.sections||[]).map(T=>jsx(Box,{id:`detail-tab-${P?.id}-section-${T.id}`,children:jsx($i,{section:T,highlightQuery:f})},T.id)),P?.fields&&P.fields.length>0&&jsx($i,{section:{id:`${P.id}-fields`,title:P.label,fields:P.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsx(Co,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var Sp=({bucket:e,cardCount:t,highlighted:o=false,children:a,emptyLabel:r,maxHeight:n,sx:i})=>{let{t:c}=q();return jsx(Paper,{sx:[d=>{let s=e.accentColor??d.palette.primary.main;return {position:"relative",minWidth:0,borderRadius:4,overflow:"hidden",border:`1px solid ${alpha(s,o?.58:d.palette.mode==="dark"?.28:.18)}`,bgcolor:alpha(d.palette.background.paper,d.palette.mode==="dark"?.92:.97),boxShadow:o?`0 18px 40px ${alpha(s,.22)}`:`0 10px 28px ${alpha(d.palette.common.black,d.palette.mode==="dark"?.18:.08)}`,transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",height:4,bgcolor:s}}},...Array.isArray(i)?i:i?[i]:[]],children:jsxs(Stack,{spacing:1.2,sx:{p:1.5},children:[jsxs(Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{minWidth:0},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[e.icon,jsx(Typography,{sx:{fontSize:"0.96rem",fontWeight:800},children:e.title})]}),e.description&&jsx(Typography,{sx:{mt:.45,fontSize:"0.76rem",color:"text.secondary",lineHeight:1.45},children:e.description})]}),jsxs(Stack,{direction:"row",spacing:.8,sx:{flexShrink:0},children:[jsx(Chip,{size:"small",label:t,sx:{fontWeight:700}}),typeof e.limit=="number"&&jsx(Chip,{size:"small",label:`${c("kanban.bucket.limit")} ${e.limit}`,color:t>e.limit?"warning":"default",variant:"outlined"})]})]}),o&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700},children:c("kanban.bucket.dropHere")}),jsx(Box,{sx:{minHeight:220,maxHeight:n,overflowY:n?"auto":"visible",pr:n?.4:0},children:t>0?a:jsx(Box,{sx:d=>({minHeight:160,borderRadius:3,border:`1px dashed ${alpha(d.palette.divider,.9)}`,bgcolor:d.palette.mode==="dark"?alpha(d.palette.common.white,.02):alpha(d.palette.primary.main,.03),display:"grid",placeItems:"center",px:2,textAlign:"center"}),children:jsx(Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:r??e.emptyLabel??c("kanban.empty")})})})]})})};var Hb={success:"success",warning:"warning",info:"info",error:"error"},Gb={critical:"error",high:"warning",medium:"info",low:"success"},Ub=(e,t)=>{switch(e){case "critical":return t("kanban.priority.critical");case "high":return t("kanban.priority.high");case "medium":return t("kanban.priority.medium");case "low":return t("kanban.priority.low");default:return e}},Kb=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Nl=({card:e,bucket:t,dragging:o=false,overlay:a=false,onClick:r,sx:n})=>{let{t:i}=q(),c=!!(r&&t),d=e.tone??(e.priority?Gb[e.priority]:"default"),s=d==="default"?"primary":Hb[d],l=t?{card:e,bucket:t}:void 0;return jsx(Paper,{onClick:c?()=>l&&r?.(l):void 0,onKeyDown:c?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l&&r?.(l));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[g=>{let f=d==="default"?g.palette.primary.main:g.palette[s].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${alpha(f,g.palette.mode==="dark"?.42:.2)}`,bgcolor:alpha(g.palette.background.paper,g.palette.mode==="dark"?.96:.98),boxShadow:a?`0 20px 45px ${alpha(g.palette.common.black,.24)}`:o?"none":`0 8px 24px ${alpha(g.palette.common.black,g.palette.mode==="dark"?.18:.08)}`,transform:a?"rotate(1deg) scale(1.01)":"none",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease",cursor:c?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:4,bgcolor:f},"&:hover":c?{transform:"translateY(-1px)",boxShadow:`0 14px 32px ${alpha(g.palette.common.black,g.palette.mode==="dark"?.28:.12)}`}:void 0}},...Array.isArray(n)?n:n?[n]:[]],children:jsxs(Stack,{spacing:1.1,children:[jsxs(Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{minWidth:0,flex:1},children:[(e.kicker||t?.title)&&jsx(Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:.4,color:"text.secondary",textTransform:"uppercase"},children:e.kicker??t?.title}),jsx(Typography,{sx:{mt:.2,fontSize:"0.98rem",fontWeight:800,lineHeight:1.3},children:e.title})]}),e.priority&&jsx(Chip,{size:"small",color:s,label:Ub(e.priority,i),variant:d==="default"?"outlined":"filled",sx:{height:22,fontWeight:700}})]}),e.summary&&jsx(Typography,{sx:{fontSize:"0.82rem",color:"text.secondary",lineHeight:1.5},children:e.summary}),e.metrics&&e.metrics.length>0&&jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(e.metrics.length,3)}, minmax(0, 1fr))`,gap:.9},children:e.metrics.slice(0,3).map(g=>jsxs(Box,{sx:f=>({borderRadius:2,px:1,py:.8,bgcolor:f.palette.mode==="dark"?alpha(f.palette.common.white,.05):alpha(f.palette.primary.main,.05)}),children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",textTransform:"uppercase",letterSpacing:.35},children:g.label}),jsx(Typography,{sx:{fontSize:"0.86rem",fontWeight:700},children:g.value})]},g.id))}),typeof e.progress=="number"&&jsxs(Box,{children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:i("kanban.card.progress")}),jsxs(Typography,{sx:{fontSize:"0.72rem",fontWeight:700},children:[Math.round(e.progress),"%"]})]}),jsx(LinearProgress,{variant:"determinate",value:Math.max(0,Math.min(100,e.progress)),color:s,sx:{height:8,borderRadius:999}})]}),(e.tags?.length||e.assignee||e.dueDate||e.footer||c)&&jsxs(Stack,{spacing:.9,children:[e.tags&&e.tags.length>0&&jsx(Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:e.tags.map(g=>jsx(Chip,{size:"small",label:g.label,color:g.color??"default",variant:"outlined"},g.id))}),jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8,minWidth:0},children:[e.assignee&&jsxs(Fragment,{children:[jsx(Avatar,{src:e.assignee.avatarSrc,sx:{width:28,height:28,fontSize:"0.75rem"},children:e.assignee.initials??Kb(e.assignee.name)}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.78rem",fontWeight:700,lineHeight:1.2},noWrap:true,children:e.assignee.name}),e.dueDate&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},noWrap:true,children:e.dueDate})]})]}),!e.assignee&&e.dueDate&&jsx(Typography,{sx:{fontSize:"0.76rem",color:"text.secondary"},children:e.dueDate})]}),c&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700,whiteSpace:"nowrap"},children:i("kanban.card.openDetail")})]}),e.footer]})]})})};var _b=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,Tp=({buckets:e,cards:t})=>{let o=new Map;return t.forEach((a,r)=>{let n=o.get(a.bucketId)??[];n.push({card:a,sourceIndex:r}),o.set(a.bucketId,n);}),{buckets:e.map(a=>{let r=[...o.get(a.id)??[]].sort((n,i)=>n.card.position===void 0&&i.card.position===void 0?n.sourceIndex-i.sourceIndex:n.card.position===void 0?1:i.card.position===void 0?-1:n.card.position-i.card.position||n.sourceIndex-i.sourceIndex).map(({card:n},i)=>({...n,bucketId:a.id,position:i}));return {...a,cards:r}})}},ba=(e,t)=>{for(let o=0;o<e.buckets.length;o+=1){let a=e.buckets[o],r=a.cards.findIndex(n=>n.id===t);if(r>=0)return {card:a.cards[r],bucket:a,bucketIndex:o,cardIndex:r}}},qi=(e,t)=>{let o=ba(e,t.cardId);if(!o)return e;let a=e.buckets.findIndex(s=>s.id===t.toBucketId);if(a<0)return e;let r=e.buckets.map(s=>({...s,cards:s.cards.map(l=>({...l}))})),n=r[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let c=r[a],d=_b(t.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...i,bucketId:t.toBucketId}),{buckets:r.map(s=>({...s,cards:s.cards.map((l,g)=>({...l,bucketId:s.id,position:g}))}))}};var zl="kanban-card|",Vl="kanban-bucket|",Mp=e=>`${zl}${e}`,ix=e=>`${Vl}${e}`,_i=e=>e?.startsWith(zl)?e.slice(zl.length):void 0,Dp=e=>e?.startsWith(Vl)?e.slice(Vl.length):void 0,sx=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:a,attributes:r,listeners:n,transform:i,transition:c,isDragging:d}=useSortable({id:Mp(e.id)}),s={transform:i?`translate3d(${i.x}px, ${i.y}px, 0)`:void 0,transition:c,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return jsx(Box,{ref:a,style:s,...r,...n,children:jsx(Nl,{card:e,bucket:t,dragging:d,onClick:o})})},lx=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:a,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=useDroppable({id:ix(e.id)});return jsx(Box,{ref:i,sx:{minWidth:0},children:jsx(Sp,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:a,maxHeight:o,children:jsx(SortableContext,{items:e.cards.map(c=>Mp(c.id)),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:1,children:e.cards.map(c=>jsx(sx,{card:c,bucket:e,onCardClick:r},c.id))})})})})},WD=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:a=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[c,d]=useState(null),[s,l]=useState(),g=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=useMemo(()=>c?ba(e,c):void 0,[c,e]),u=useCallback(()=>{d(null),l(void 0);},[]),y=useCallback(m=>{if(!m)return;let b=_i(m);return b?ba(e,b)?.bucket.id:Dp(m)},[e]),I=useCallback(m=>{d(_i(String(m.active.id))??null);},[]),p=useCallback(m=>{l(y(m.over?String(m.over.id):void 0));},[y]),C=useCallback(m=>{let b=_i(String(m.active.id)),x=m.over?String(m.over.id):void 0;if(!b||!x){u();return}let k=ba(e,b);if(!k){u();return}let L=k.bucket.id,P=k.cardIndex,w=_i(x);if(w){let v=ba(e,w);if(!v){u();return}L=v.bucket.id,P=v.cardIndex;}else {let v=Dp(x),M=e.buckets.find(S=>S.id===v);if(!v||!M){u();return}L=v,P=M.cards.length;}if(k.bucket.id===L&&k.cardIndex===P){u();return}let E=qi(e,{cardId:b,fromBucketId:k.bucket.id,toBucketId:L,targetIndex:P}),T=ba(E,b);T&&!(T.bucket.id===k.bucket.id&&T.cardIndex===k.cardIndex)&&t?.({cardId:b,fromBucketId:k.bucket.id,toBucketId:T.bucket.id,targetIndex:T.cardIndex,card:T.card,model:E}),u();},[e,t,u]);return jsxs(DndContext,{sensors:g,collisionDetection:closestCorners,onDragStart:I,onDragOver:p,onDragEnd:C,onDragCancel:u,children:[jsx(Box,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${a}px, 1fr)`,gap:2,alignItems:"start",overflowX:"auto",pb:.5},...Array.isArray(i)?i:i?[i]:[]],children:e.buckets.map(m=>jsx(lx,{bucket:m,highlighted:m.id===s,bucketMaxHeight:r,emptyBucketLabel:n,onCardClick:o},m.id))}),jsx(DragOverlay,{children:f?jsx(Box,{sx:{width:Math.max(a-24,260)},children:jsx(Nl,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var ux=({initialModel:e,initialBuckets:t,initialCards:o})=>e||Tp({buckets:t??[],cards:o??[]}),KD=e=>{let{onCardMove:t,onCardClick:o}=e,[a,r]=useState(()=>ux(e)),n=useCallback(l=>{r(g=>typeof l=="function"?l(g):l);},[]),i=useCallback(l=>ba(a,l),[a]),c=useCallback((l,g,f)=>{let u=ba(a,l);if(!u)return;let y=qi(a,{cardId:l,fromBucketId:u.bucket.id,toBucketId:g,targetIndex:f}),I=ba(y,l);if(!I||I.bucket.id===u.bucket.id&&I.cardIndex===u.cardIndex)return;r(y);let p={cardId:l,fromBucketId:u.bucket.id,toBucketId:I.bucket.id,targetIndex:I.cardIndex,card:I.card,model:y};return t?.(p),p},[a,t]),d=useCallback((l,g)=>{r(f=>({buckets:f.buckets.map(u=>({...u,cards:u.cards.map(y=>y.id!==l?y:typeof g=="function"?g(y):{...y,...g})}))}));},[]),s=useMemo(()=>({model:a,onCardMove:l=>{c(l.cardId,l.toBucketId,l.targetIndex);},onCardClick:o}),[a,c,o]);return {model:a,actions:{replaceModel:n,moveCard:c,updateCard:d,getCard:i},boardProps:s}};var Ep=64,Px="#E9EDF2",Rx="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",Dx=["en","zh","fr","de","ja","ko"],Lp={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Np=({appTitle:e,logo:t,mode:o="dark",onToggleMode:a,locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,onSearch:s,user:l,onUserSetting:g,onUserLogout:f,userMenuItems:u,leftSlot:y,rightSlot:I})=>{let{t:p,locale:C}=q(),b=useTheme().palette.mode==="dark",[x,k]=useState(""),[L,P]=useState(null),[w,E]=useState(null),T=oe=>{oe.preventDefault(),s&&s(x.trim());},v=o==="system"?jsx(kx,{fontSize:"small"}):o==="dark"?jsx(Sx,{fontSize:"small"}):jsx(wx,{fontSize:"small"}),M=p(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),S=r||C,D=i&&i.length>0?i:Dx,B=n||Lp[S]||S.toUpperCase(),H=!!L,V=d||p("header.searchPlaceholder"),_=!!w,Y=[{key:"setting",label:p("header.menu.setting"),icon:jsx(Xh,{sx:{fontSize:18}}),onClick:g},{key:"logout",label:p("header.menu.logout"),icon:jsx(Tx,{sx:{fontSize:18}}),onClick:f}],ee=u&&u.length>0?u:Y,te=oe=>{E(null),oe?.();};return jsxs(AppBar,{position:"sticky",elevation:0,sx:oe=>({top:0,zIndex:oe.zIndex.drawer+10,height:Ep,backgroundColor:oe.palette.mode==="dark"?"#0D0D0D":Px,backgroundImage:oe.palette.mode==="dark"?["radial-gradient(circle at 18% 22%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 45%)","radial-gradient(circle at 78% 32%, rgba(144,202,249,0.14) 0%, rgba(144,202,249,0) 42%)","linear-gradient(90deg, #0A0A0A 0%, #151515 50%, #0A0A0A 100%)","linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px)","linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px)"].join(","):["radial-gradient(circle at 22% 22%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 48%)","radial-gradient(circle at 76% 24%, rgba(203,213,225,0.45) 0%, rgba(203,213,225,0) 42%)",Rx,"linear-gradient(rgba(15,23,42,0.05) 1px, transparent 1px)","linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px)"].join(","),backgroundSize:"auto, auto, auto, 24px 24px, 24px 24px",borderBottom:"1px solid",borderColor:oe.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxs(Toolbar,{sx:{minHeight:`${Ep}px !important`,px:2,gap:2},children:[jsxs(Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[t||jsx(Box,{component:"img",src:"/orbcafe.png",alt:"ORBCAFE Logo",sx:{width:44,height:44,display:"block",objectFit:"contain",flexShrink:0}}),e&&jsx(Typography,{variant:"h6",sx:{fontWeight:700,color:b?"common.white":"#111827"},children:e}),y]}),jsx(Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsx(Box,{component:"form",onSubmit:T,sx:{width:"100%",maxWidth:540},children:jsx(TextField,{size:"small",fullWidth:true,value:x,onChange:oe=>k(oe.target.value),placeholder:V,InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Nd,{sx:{color:b?"rgba(255,255,255,0.7)":"rgba(15,23,42,0.55)",fontSize:18}})}),sx:{color:b?"common.white":"rgba(17,24,39,0.9)",bgcolor:b?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,"& .MuiOutlinedInput-notchedOutline":{borderColor:b?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:b?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:b?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:b?"white":"#111827"}}})})}),jsxs(Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[c?jsxs(Fragment,{children:[jsx(IconButton,{size:"small",onClick:oe=>P(oe.currentTarget),sx:{color:b?"common.white":"#111827",borderRadius:1,px:.5},children:jsxs(Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsx(Fp,{sx:{fontSize:18}}),jsx(Typography,{variant:"caption",sx:{fontWeight:500},children:B})]})}),jsx(Menu,{anchorEl:L,open:H,onClose:()=>P(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:D.map(oe=>jsx(MenuItem,{selected:oe===S,onClick:()=>{c(oe),P(null);},sx:{fontSize:"0.82rem"},children:Lp[oe]},oe))})]}):jsxs(Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsx(Fp,{sx:{color:b?"common.white":"#111827",fontSize:18}}),jsx(Typography,{variant:"caption",sx:{color:b?"common.white":"#111827",fontWeight:500},children:B})]}),jsx(IconButton,{size:"small",sx:{color:b?"common.white":"#111827"},onClick:a,title:M,children:v}),l&&jsxs(Stack,{direction:"row",alignItems:"center",spacing:1,children:[jsxs(Box,{sx:{textAlign:"right",minWidth:0},children:[jsx(Typography,{variant:"body2",sx:{color:b?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:l.name}),l.subtitle&&jsx(Typography,{variant:"caption",sx:{display:"block",mt:.25,color:b?"rgba(255,255,255,0.72)":"rgba(17,24,39,0.62)",fontSize:"0.72rem",lineHeight:1.1,letterSpacing:"0.01em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:220},title:l.subtitle,children:l.subtitle})]}),jsx(IconButton,{size:"small",onClick:oe=>E(oe.currentTarget),sx:{p:0},children:jsx(Avatar,{src:l.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:l.avatarText||l.name.slice(0,1).toUpperCase()})})]}),I]})]}),l&&jsx(Menu,{anchorEl:w,open:_,onClose:()=>E(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:160,"& .MuiMenuItem-root":{minHeight:34,py:.5,px:1.25}}}},children:ee.map(oe=>jsxs(MenuItem,{disabled:oe.disabled,onClick:()=>te(oe.onClick),children:[oe.icon&&jsx(ListItemIcon,{children:oe.icon}),jsx(ListItemText,{primary:oe.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},oe.key))})]})};var zp=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:o}=Oc({initialCollapsed:t,content:e}),[a,r]=useState(900);useEffect(()=>{let i=()=>r(window.innerHeight);return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);let n=useMemo(()=>Math.max(280,a-100),[a]);return {navigationIslandProps:o,navigationMaxHeight:n}};var fM=({appTitle:e,menuData:t=[],children:o,showNavigation:a=true,locale:r="en",localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:s,onUserLogout:l,userMenuItems:g,logo:f,onSearch:u,rightHeaderSlot:y,leftHeaderSlot:I,contentSx:p})=>{let C="orbcafe:page-layout-mode",[m,b]=useState("system"),[x,k]=useState("light"),[L,P]=useState(false),w=m==="system"?L?x:"light":m;useEffect(()=>{try{let D=window.localStorage.getItem(C);(D==="light"||D==="dark"||D==="system")&&b(D);}catch{}P(true);let M=window.matchMedia("(prefers-color-scheme: dark)"),S=()=>{k(M.matches?"dark":"light");};return S(),M.addEventListener("change",S),()=>M.removeEventListener("change",S)},[]),useEffect(()=>{if(L)try{window.localStorage.setItem(C,m);}catch{}},[L,m]);let E=useMemo(()=>createTheme({palette:{mode:w}}),[w]),{navigationIslandProps:T,navigationMaxHeight:v}=zp({menuData:t,initialNavigationCollapsed:false});return jsx(ThemeProvider,{theme:E,children:jsx(Ac,{locale:r,children:jsxs(Box,{sx:M=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:M.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":M.palette.background.default}),children:[jsx(Np,{appTitle:e,logo:f,mode:m,onToggleMode:()=>b(M=>M==="system"?"dark":M==="dark"?"light":"system"),locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:s,onUserLogout:l,userMenuItems:g,onSearch:u,leftSlot:I,rightSlot:y}),jsxs(Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[a&&jsx(Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsx(zc,{...T,maxHeight:v,colorMode:w})}),jsx(Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...p},children:o})]})]})})})};var Yi="(blank)",Wp="Result",$p="Grand Total",Hp={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Gp=["sum","count","avg","min","max"];var Up=["palette","rows","columns","filters","values"];var Kp=e=>Up.includes(e),qp=e=>e==="rows"||e==="columns"||e==="filters",Ji=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&Kp(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&Kp(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},eo=e=>e==null||e===""?Yi:e instanceof Date?e.toISOString().slice(0,10):String(e),or=e=>JSON.stringify(e),_p=(e,t)=>{let o=e.join(""),a=t.join("");return o.localeCompare(a,void 0,{sensitivity:"base"})},zx=e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null},Nr=(e,t,o)=>{if(o==="count")return e.length;let a=e.map(r=>zx(r[t])).filter(r=>r!==null);return a.length===0?0:o==="sum"?a.reduce((r,n)=>r+n,0):o==="avg"?a.reduce((r,n)=>r+n,0)/a.length:o==="min"?Math.min(...a):Math.max(...a)},dt=(e,t)=>{if(!e||e.length===0)return [];let o=new Set,a=[];return e.forEach(r=>{!t.has(r)||o.has(r)||(o.add(r),a.push(r));}),a},to=(e,t)=>e.length!==t.length?false:e.every((o,a)=>o===t[a]),Zp=(e,t)=>{let o=Object.keys(e),a=Object.keys(t);return o.length!==a.length?false:o.every(r=>{let n=e[r]??[],i=t[r]??[];return to(n,i)})},es=(e,t)=>e.length!==t.length?false:e.every((o,a)=>{let r=t[a];return o.tokenId===r.tokenId&&o.fieldId===r.fieldId&&o.aggregation===r.aggregation}),Hl=e=>!e?.aggregations||e.aggregations.length===0?Gp:e.aggregations,Dt=(e,t)=>{let o=Hl(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},Bn=(e,t,o)=>{let a=o.get(t.fieldId);return a?.formatValue?a.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var Xp=({options:e,selectedValues:t,onChange:o,minWidth:a=96})=>{let{t:r}=q(),[n,i]=useState(""),c=useMemo(()=>{let s=n.trim().toLowerCase();return s?e.filter(l=>l.toLowerCase().includes(s)):e},[e,n]),d=e.length>0&&t.length===e.length;return jsx(FormControl,{size:"small",sx:{minWidth:a},children:jsxs(Select,{multiple:true,value:t,onChange:s=>{let l=s.target.value,g=typeof l=="string"?l.split(","):l;o(g);},onClick:s=>s.stopPropagation(),onMouseDown:s=>s.stopPropagation(),renderValue:s=>{let l=s;return e.length===0?r("pivot.filter.na"):l.length===0?r("common.none"):l.length===e.length?r("common.all"):`${l.length}/${e.length}`},MenuProps:{PaperProps:{sx:{maxHeight:320,bgcolor:"background.paper"}}},sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:[jsx(ListSubheader,{disableSticky:true,sx:s=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${s.palette.divider}`}),children:jsx(TextField,{size:"small",placeholder:`${r("common.search")}...`,fullWidth:true,value:n,onChange:s=>i(s.target.value),onKeyDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),sx:{m:0,"& .MuiInputBase-input":{fontSize:"0.75rem",py:.7}}})}),jsx(Box,{sx:s=>({px:1.5,py:.5,borderBottom:`1px solid ${s.palette.divider}`,bgcolor:"background.paper"}),onMouseDown:s=>{s.preventDefault(),s.stopPropagation();},onClick:s=>{s.preventDefault(),s.stopPropagation();},children:jsx(Button,{variant:"text",size:"small",onClick:s=>{s.preventDefault(),s.stopPropagation(),o(d?[]:e);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:r(d?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),c.length===0&&jsx(MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:r("pivot.filter.noResults")}),c.map(s=>{let l=t.includes(s);return jsxs(MenuItem,{value:s,sx:{fontSize:"0.75rem",py:.25},children:[jsx(Checkbox,{size:"small",checked:l,sx:{p:.5,mr:.5}}),jsx(ListItemText,{primary:s,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},s)})]})})};var Ul=({label:e,subtitle:t,isDragging:o,dragRef:a,listeners:r,attributes:n,style:i})=>jsx(Paper,{ref:a,...r,...n,sx:c=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:c.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none"}),style:{...i,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsx(Box,{sx:c=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.3,borderRadius:1,bgcolor:c.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)"}),children:jsx(jx,{sx:{fontSize:16,color:"text.secondary"}})}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary",lineHeight:1.2},children:t})]})]})}),eu=({id:e,label:t,subtitle:o})=>{let{setNodeRef:a,listeners:r,attributes:n,isDragging:i}=useDraggable({id:e});return jsx(Ul,{label:t,subtitle:o,isDragging:i,dragRef:a,listeners:r,attributes:n})};var Or=({zone:e,title:t,hint:o,icon:a,children:r,itemCount:n,onClear:i})=>{let c=`container|${e}`,{isOver:d,setNodeRef:s}=useDroppable({id:c}),{t:l}=q();return jsxs(Paper,{ref:s,sx:g=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:d?"primary.main":g.palette.divider,bgcolor:d?g.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":g.palette.mode==="dark"?"rgba(255,255,255,0.02)":"rgba(245, 248, 255, 0.86)",transition:"all 120ms ease",minHeight:120,display:"flex",flexDirection:"column"}),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[a,jsx(Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxs(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",n,")"]})]}),n>0&&i&&jsx(Tooltip,{title:l("pivot.clearArea"),children:jsx(IconButton,{size:"small",onClick:i,sx:{p:.25},children:jsx(e0,{sx:{fontSize:16}})})})]}),jsx(Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:o}),jsx(Box,{sx:{flex:1},children:r})]})};var au={xs:1.2,md:1.6},$r=({title:e,subtitle:t,collapsed:o,onToggleCollapse:a,expandAriaLabel:r,collapseAriaLabel:n,children:i,bodySx:c,unmountOnExit:d=false,headerActions:s})=>jsxs(Paper,{sx:l=>({borderRadius:3,border:`1px solid ${l.palette.divider}`,overflow:"hidden",bgcolor:alpha(l.palette.background.paper,.95)}),children:[jsxs(Box,{sx:l=>({px:au,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:o?"none":`1px solid ${l.palette.divider}`}),children:[jsxs(Box,{sx:{minWidth:0,flex:1},children:[jsx(Typography,{sx:{fontSize:"0.9rem",fontWeight:800},children:e}),jsx(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[s,jsx(IconButton,{size:"small","aria-label":o?r:n,onClick:a,sx:l=>({border:`1px solid ${l.palette.divider}`,bgcolor:alpha(l.palette.background.paper,.88),width:28,height:28,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:l.palette.mode==="dark"?alpha(l.palette.primary.main,.18):alpha(l.palette.primary.main,.08)}}),children:jsx(Yh,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),jsx(Collapse,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:jsx(Box,{sx:[{px:au,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var ns=({label:e,caption:t,onRemove:o,trailing:a,isDragging:r,dragRef:n,listeners:i,attributes:c,style:d})=>jsx(Paper,{ref:n,style:d,sx:s=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:s.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none",opacity:r?0:1}),children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsx(Box,{...c,...i,sx:s=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.25,borderRadius:1,bgcolor:s.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)",cursor:"grab"}),children:jsx(jx,{sx:{fontSize:15,color:"text.secondary"}})}),jsxs(Box,{sx:{minWidth:0,flex:1},children:[jsx(Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),a,o&&jsx(IconButton,{size:"small",onClick:s=>{s.stopPropagation(),o();},sx:{p:.2},children:jsx(Kf,{sx:{fontSize:16}})})]})}),Fn=({id:e,label:t,caption:o,onRemove:a,trailing:r})=>{let{setNodeRef:n,attributes:i,listeners:c,transform:d,transition:s,isDragging:l}=useSortable({id:e}),g={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:s,zIndex:l?999:"auto"};return jsx(ns,{label:t,caption:o,onRemove:a,trailing:r,isDragging:l,dragRef:n,listeners:c,attributes:i,style:g})};var ls={rows:jsx(g0,{fontSize:"small"}),columns:jsx(Dg,{fontSize:"small"}),filters:jsx(m0,{fontSize:"small"}),values:jsx(Fg,{fontSize:"small"})},nu=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:a,filterFields:r,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:s,getFilterSelectionSummary:l,renderDimensionFilterSelect:g,renderAggregationSelect:f,getAggregationLabel:u})=>{let{t:y}=q(),I=[`${y("pivot.zone.rows")} ${i.length}`,`${y("pivot.zone.columns")} ${n.length}`,`${y("pivot.zone.filters")} ${r.length}`,`${y("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsx($r,{title:y("pivot.config.title"),subtitle:I,collapsed:e,onToggleCollapse:t,expandAriaLabel:y("pivot.collapse.ariaExpand"),collapseAriaLabel:y("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsx(Or,{zone:"palette",title:y("pivot.fieldList"),hint:y("pivot.availableDimensions"),itemCount:o.length,icon:jsx(jx,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxs(Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&jsx(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:y("pivot.allFieldsInUse")}),o.map(p=>jsx(eu,{id:`item|palette|${p.id}`,label:p.label,subtitle:p.type??"string"},p.id))]})}),jsxs(Stack,{spacing:2,children:[jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsx(Or,{zone:"filters",title:y("pivot.zone.filters"),hint:y("pivot.hint.filters"),icon:ls.filters,itemCount:r.length,onClear:()=>d("filters"),children:jsx(SortableContext,{items:r.map(p=>`item|filters|${p}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:r.map(p=>jsx(Fn,{id:`item|filters|${p}`,label:a.get(p)?.label??p,caption:l(p),trailing:g(p),onRemove:()=>s("filters",p)},p))})})}),jsx(Or,{zone:"columns",title:y("pivot.zone.columns"),hint:y("pivot.hint.columns"),icon:ls.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsx(SortableContext,{items:n.map(p=>`item|columns|${p}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:n.map(p=>jsx(Fn,{id:`item|columns|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${l(p)}`,trailing:g(p),onRemove:()=>s("columns",p)},p))})})})]}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsx(Or,{zone:"rows",title:y("pivot.zone.rows"),hint:y("pivot.hint.rows"),icon:ls.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsx(SortableContext,{items:i.map(p=>`item|rows|${p}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:i.map(p=>jsx(Fn,{id:`item|rows|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${l(p)}`,trailing:g(p),onRemove:()=>s("rows",p)},p))})})}),jsx(Or,{zone:"values",title:y("pivot.zone.values"),hint:y("pivot.hint.values"),icon:ls.values,itemCount:c.length,onClear:()=>d("values"),children:jsx(SortableContext,{items:c.map(p=>`item|values|${p.tokenId}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:c.map(p=>{let C=a.get(p.fieldId)?.label??p.fieldId,m=`${u(p.aggregation)}(${C})`;return jsx(Fn,{id:`item|values|${p.tokenId}`,label:C,caption:m,trailing:f(p),onRemove:()=>s("values",p.tokenId)},p.tokenId)})})})})]})]})]})})};var iu=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),su=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:a,formatSecondaryValue:r})=>{let n=useTheme$1();if(e.length===0)return null;let i=720,c=250,d={top:20,right:24,bottom:40,left:52},s=o?e.map(p=>p.primaryValue):e.map((p,C)=>C+1),l=o?e.map(p=>p.secondaryValue??0):e.map(p=>p.primaryValue),g=Math.max(...s,1),f=Math.max(...l,1),u=i-d.left-d.right,y=c-d.top-d.bottom,I=e.map((p,C)=>{let m=o?p.primaryValue:C+1,b=o?p.secondaryValue??0:p.primaryValue,x=d.left+m/g*u,k=c-d.bottom-b/f*y;return {...p,x,y:k,rawX:m,rawY:b}});return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{component:"svg",viewBox:`0 0 ${i} ${c}`,sx:{width:"100%",minWidth:i,height:c},children:[jsx("line",{x1:d.left,y1:c-d.bottom,x2:i-d.right,y2:c-d.bottom,stroke:alpha(n.palette.text.secondary,.35)}),jsx("line",{x1:d.left,y1:d.top,x2:d.left,y2:c-d.bottom,stroke:alpha(n.palette.text.secondary,.35)}),I.map(p=>jsxs("g",{children:[jsx("circle",{cx:p.x,cy:p.y,r:7,fill:alpha(n.palette.primary.main,.18)}),jsx("circle",{cx:p.x,cy:p.y,r:4.5,fill:n.palette.primary.main,children:jsxs("title",{children:[p.name,`
|
|
7
|
+
`),f={enableMath:a},u=0;for(;u<g.length;){let y=g[u],I=y.trim();if(!I){u+=1;continue}if(n&&fp(y)){if(I.startsWith("<think>")){let m=[],b=y;for(;;){let x=b.indexOf("<think>"),k=x>=0?b.slice(x+7):b,L=k.indexOf("</think>");if(L>=0){m.push(k.slice(0,L)),u+=1;break}if(m.push(k),u+=1,u>=g.length)break;b=g[u];}l.push(jsx(Wi,{content:m.join(`
|
|
8
|
+
`).trim()},`think-tag-${u}`));continue}u+=1;let C=[];for(;u<g.length&&g[u].trim()!==":::";)C.push(g[u]),u+=1;u<g.length&&g[u].trim()===":::"&&(u+=1),l.push(jsx(Wi,{content:C.join(`
|
|
9
|
+
`).trim()},`think-fence-${u}`));continue}if($i(y)){let C=I.slice(3).trim().toLowerCase(),m=[];for(u+=1;u<g.length&&!$i(g[u]);)m.push(g[u]),u+=1;u<g.length&&$i(g[u])&&(u+=1);let b=m.join(`
|
|
10
|
+
`);if(r&&C==="mermaid"){l.push(jsx(Sl,{code:b},`mermaid-${u}`));continue}if(a&&["math","latex","katex"].includes(C)){l.push(jsx(Sn,{expression:b,allowKatex:true},`math-fence-${u}`));continue}l.push(jsx(kn,{code:b,language:C||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${u}`));continue}if(a&&I.startsWith("$$")){let C=[];if(I.endsWith("$$")&&I!=="$$")C.push(I.slice(2,-2)),u+=1;else {let b=y.slice(y.indexOf("$$")+2);for(b.trim()&&C.push(b),u+=1;u<g.length;){let x=g[u],k=x.indexOf("$$");if(k>=0){C.push(x.slice(0,k)),u+=1;break}C.push(x),u+=1;}}l.push(jsx(Sn,{expression:C.join(`
|
|
11
|
+
`).trim(),allowKatex:true},`math-${u}`));continue}if(up(y)){let C=Math.min(6,y.match(/^#{1,6}/)?.[0]?.length||1),m=y.replace(/^#{1,6}\s+/,""),b=C===1?"h5":C===2?"h6":"subtitle1";l.push(jsx(Typography,{variant:b,sx:{mt:C===1?1.2:.8,mb:.5,fontWeight:700},children:Tn(m,f,`h-${u}`)},`heading-${u}`)),u+=1;continue}if(mp(y)){l.push(jsx(Divider,{sx:{my:1.2}},`hr-${u}`)),u+=1;continue}if(gp(g,u)){let C=u+2;for(;C<g.length&&g[C].trim()&&g[C].includes("|");)C+=1;let m=g.slice(u,C).join(`
|
|
12
|
+
`),b=Vi(m);if(b){l.push(jsx(Il,{table:b},`table-${u}`)),u=C;continue}}if(Ml(y)){let C=[];for(;u<g.length&&Ml(g[u]);)C.push(g[u].replace(/^\s*>\s?/,"")),u+=1;l.push(jsx(Paper,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:jsx(Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:C.map((m,b)=>jsxs(Fragment$1,{children:[b>0&&jsx("br",{}),Tn(m,f,`q-${u}-${b}`)]},`quote-line-${b}`))})},`quote-${u}`));continue}if(Rl(y)){let C=[];for(;u<g.length&&Rl(g[u]);)C.push(g[u].trim().replace(/^[-*+]\s+/,"")),u+=1;l.push(jsx(Box,{component:"ul",sx:{my:.8,pl:2.5},children:C.map((m,b)=>jsx(Box,{component:"li",sx:{mb:.45},children:jsx(Typography,{variant:"body2",children:Tn(m,f,`ul-${u}-${b}`)})},`ul-item-${b}`))},`ul-${u}`));continue}if(Dl(y)){let C=[];for(;u<g.length&&Dl(g[u]);)C.push(g[u].trim().replace(/^\d+\.\s+/,"")),u+=1;l.push(jsx(Box,{component:"ol",sx:{my:.8,pl:2.7},children:C.map((m,b)=>jsx(Box,{component:"li",sx:{mb:.45},children:jsx(Typography,{variant:"body2",children:Tn(m,f,`ol-${u}-${b}`)})},`ol-item-${b}`))},`ol-${u}`));continue}let p=[];for(;u<g.length;){let C=g[u],m=C.trim();if(!m||$i(C)||up(C)||mp(C)||Rl(C)||Dl(C)||Ml(C)||gp(g,u)||n&&fp(C)||a&&m.startsWith("$$"))break;p.push(C),u+=1;}p.length>0?l.push(jsx(Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:p.map((C,m)=>jsxs(Fragment$1,{children:[m>0&&jsx("br",{}),Tn(C,f,`p-${u}-${m}`)]},`p-line-${m}`))},`p-${u}`)):u+=1;}return l},[d,a,r,n,i,c]);return jsx(Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:s})};var GR=(e,t)=>jsx(Pn,{markdown:e,...t});var bp=({value:e,onChange:t,onSubmit:o,onVoiceInput:a,onClear:r,placeholder:n,statusText:i,loading:c=false,compact:d=false,showStatusText:s=true})=>jsxs(Stack,{spacing:.75,children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[jsx(zd,{sx:{fontSize:d?16:18,color:"text.secondary"}}),jsx(InputBase,{fullWidth:true,value:e,onChange:l=>t(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),o());},placeholder:n,sx:{fontSize:d?"0.84rem":"0.9rem"}}),e&&r&&jsx(IconButton,{size:"small",onClick:r,children:jsx(qf,{sx:{fontSize:d?16:18}})}),a&&jsx(IconButton,{size:"small",onClick:a,children:jsx(eh,{sx:{fontSize:d?16:18}})}),jsx(IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsx(ah,{sx:{fontSize:d?16:18}})})]}),s&&i&&jsx(Typography,{variant:"caption",color:"text.secondary",children:i})]});var xp=(e,t)=>{let o=t.trim();if(!o)return e;let a=e.toLowerCase(),r=o.toLowerCase(),n=a.indexOf(r);return n<0?e:jsxs(Fragment,{children:[e.slice(0,n),jsx(Box,{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:e.slice(n,n+o.length)}),e.slice(n+o.length)]})},Hi=({section:e,highlightQuery:t=""})=>{let o=e.columns||2;return jsxs(Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsx(Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsx(Box,{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:o===3?"repeat(3, minmax(0, 1fr))":o===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:e.fields.map(a=>{let r=typeof a.value=="string"||typeof a.value=="number"?String(a.value):null;return jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:xp(a.label,t)}),jsx(Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?xp(r,t):a.value})]},a.id)})})]})};var Ll=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",Ui=e=>e.trim().toLowerCase(),Bb=(e,t)=>{let o=[];return e.forEach(a=>{a.fields.forEach(r=>{let n=r.searchableText||Ll(r.value),i={source:"section",sourceId:a.id,sourceSectionId:a.id,sourceTitle:a.title,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:Ui(`${a.title} ${r.label} ${n}`)});});}),t.forEach(a=>{(a.fields||[]).forEach(r=>{let n=r.searchableText||Ll(r.value),i={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:Ui(`${a.label} ${r.label} ${n}`)});}),(a.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||Ll(n.value),c={source:"tab",sourceId:a.id,sourceSectionId:r.id,sourceTitle:`${a.label} / ${r.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};o.push({hit:c,text:Ui(`${a.label} ${r.title} ${n.label} ${i}`)});});});}),o},vp=({sections:e,tabs:t=[],defaultTabId:o,ai:a})=>{let{t:r}=K(),[n,i]=useState(""),[c,d]=useState(o||t[0]?.id),[s,l]=useState("idle"),[g,f]=useState([]),[u,y]=useState(""),[I,p]=useState(""),[C,m]=useState(false),b=useMemo(()=>Bb(e,t),[e,t]);useEffect(()=>{if(t.length===0){d(void 0);return}t.some(E=>E.id===c)||d(o||t[0]?.id);},[t,c,o]);let x=useCallback(()=>{l("idle"),f([]),y(""),p("");},[]),k=useCallback(w=>{i(w),w.trim()||(l("idle"),f([]),y(""),p(""));},[]),L=useCallback(w=>{let E=Ui(w);return E?b.filter(T=>T.text.includes(E)).map(T=>T.hit):[]},[b]),P=useCallback(async()=>{let w=n.trim();if(!w)return;m(true);let E=L(w);if(f(E),E.length>0){l("search"),p(""),y(r("detail.searchAi.matches",{count:E.length})),m(false);return}if(a?.enabled!==false&&a?.onSubmit){l("ai"),y(r("detail.searchAi.autoAiFallback"));try{let v=await a.onSubmit(w,{query:w,hits:E,activeTabId:c,sections:e,tabs:t});p(typeof v=="string"?v:"");}finally{m(false);}return}l("search"),p(""),y(r("detail.searchAi.noMatch")),m(false);},[n,L,r,a,c,e,t]);return {query:n,setQuery:k,activeTabId:c,setActiveTabId:d,searchMode:s,hits:g,statusText:u,aiResponse:I,searching:C,handleSubmit:P,clearResult:x}};var vD=({title:e,subtitle:t,sections:o,tabs:a=[],defaultTabId:r,table:n,ai:i,rightHeaderSlot:c,searchBarWidth:d=460,onClose:s,closeLabel:l="Close"})=>{let{t:g}=K(),{query:f,setQuery:u,activeTabId:y,setActiveTabId:I,searchMode:p,hits:C,statusText:m,aiResponse:b,searching:x,handleSubmit:k,clearResult:L}=vp({sections:o,tabs:a,defaultTabId:r,ai:i}),P=useMemo(()=>a.find(T=>T.id===y)||a[0],[a,y]),w=useCallback(T=>{let v=M=>{let S=document.getElementById(T);if(S){S.scrollIntoView({behavior:"smooth",block:"center"});return}M<4&&setTimeout(()=>v(M+1),60);};requestAnimationFrame(()=>v(0));},[]),E=useCallback((T,v)=>{if(a.some(M=>M.id===T)){I(T),w(v?`detail-tab-${T}-section-${v}`:`detail-tab-${T}`);return}w(`detail-section-${T}`);},[a,I,w]);return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[jsxs(Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:e}),t&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:t})]}),jsxs(Stack,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[jsx(Box,{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:jsx(bp,{value:f,onChange:u,onSubmit:k,onVoiceInput:i?.onVoiceInput,onClear:()=>{u(""),L();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:m,loading:x,compact:true,showStatusText:false})}),s&&jsx(Tooltip,{title:l,children:jsx(IconButton,{size:"small",onClick:s,children:jsx(Vb,{fontSize:"small"})})}),c]})]}),m&&jsx(Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:m}),p==="search"&&C.length>0&&jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:g("detail.searchAi.matches",{count:C.length})}),jsx(Stack,{spacing:.35,children:C.slice(0,8).map(T=>jsx(Box,{component:"button",type:"button",onClick:()=>E(T.sourceId,T.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:jsxs(Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsx(Box,{component:"span",sx:{color:"text.secondary"},children:T.sourceTitle})," \xB7 ",jsx(Box,{component:"span",sx:{fontWeight:700},children:T.fieldLabel})," = ",jsx(Box,{component:"span",children:T.fieldValue||"-"})]})},`${T.source}|${T.sourceId}|${T.fieldId}`))})]}),p==="ai"&&b&&jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsx(Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:g("detail.searchAi.aiResultTitle")}),jsx(Box,{sx:{fontSize:"0.9rem",lineHeight:1.6,"& p":{m:0,mb:.8},"& h1, & h2, & h3, & h4":{mt:1.2,mb:.6,lineHeight:1.3},"& ul, & ol":{mt:.4,mb:.8,pl:2.6},"& code":{px:.5,py:.1,borderRadius:.8,bgcolor:"action.hover",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"& pre":{m:0,mt:.8,mb:.8,p:1.1,borderRadius:1.2,bgcolor:"action.hover",overflowX:"auto"},"& pre code":{p:0,bgcolor:"transparent"}},children:jsx(Pn,{markdown:b})})]}),jsx(Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(T=>jsx(Box,{id:`detail-section-${T.id}`,children:jsx(Hi,{section:T,highlightQuery:f})},T.id))}),a.length>0&&jsxs(Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsx(Tabs,{value:P?.id||false,onChange:(T,v)=>I(v),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(T=>jsx(Tab,{value:T.id,label:T.label,sx:{textTransform:"none"}},T.id))}),jsxs(Box,{sx:{p:1.5},children:[jsx(Box,{id:`detail-tab-${P?.id||""}`}),P?.description&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:P.description}),P?.content?P.content:jsxs(Stack,{spacing:1.5,children:[(P?.sections||[]).map(T=>jsx(Box,{id:`detail-tab-${P?.id}-section-${T.id}`,children:jsx(Hi,{section:T,highlightQuery:f})},T.id)),P?.fields&&P.fields.length>0&&jsx(Hi,{section:{id:`${P.id}-fields`,title:P.label,fields:P.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsx(So,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var wp=({bucket:e,cardCount:t,highlighted:o=false,children:a,emptyLabel:r,maxHeight:n,sx:i})=>{let{t:c}=K();return jsx(Paper,{sx:[d=>{let s=e.accentColor??d.palette.primary.main;return {position:"relative",minWidth:0,borderRadius:4,overflow:"hidden",border:`1px solid ${alpha(s,o?.58:d.palette.mode==="dark"?.28:.18)}`,bgcolor:alpha(d.palette.background.paper,d.palette.mode==="dark"?.92:.97),boxShadow:o?`0 18px 40px ${alpha(s,.22)}`:`0 10px 28px ${alpha(d.palette.common.black,d.palette.mode==="dark"?.18:.08)}`,transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",height:4,bgcolor:s}}},...Array.isArray(i)?i:i?[i]:[]],children:jsxs(Stack,{spacing:1.2,sx:{p:1.5},children:[jsxs(Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{minWidth:0},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[e.icon,jsx(Typography,{sx:{fontSize:"0.96rem",fontWeight:800},children:e.title})]}),e.description&&jsx(Typography,{sx:{mt:.45,fontSize:"0.76rem",color:"text.secondary",lineHeight:1.45},children:e.description})]}),jsxs(Stack,{direction:"row",spacing:.8,sx:{flexShrink:0},children:[jsx(Chip,{size:"small",label:t,sx:{fontWeight:700}}),typeof e.limit=="number"&&jsx(Chip,{size:"small",label:`${c("kanban.bucket.limit")} ${e.limit}`,color:t>e.limit?"warning":"default",variant:"outlined"})]})]}),o&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700},children:c("kanban.bucket.dropHere")}),jsx(Box,{sx:{minHeight:220,maxHeight:n,overflowY:n?"auto":"visible",pr:n?.4:0},children:t>0?a:jsx(Box,{sx:d=>({minHeight:160,borderRadius:3,border:`1px dashed ${alpha(d.palette.divider,.9)}`,bgcolor:d.palette.mode==="dark"?alpha(d.palette.common.white,.02):alpha(d.palette.primary.main,.03),display:"grid",placeItems:"center",px:2,textAlign:"center"}),children:jsx(Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:r??e.emptyLabel??c("kanban.empty")})})})]})})};var Gb={success:"success",warning:"warning",info:"info",error:"error"},Ub={critical:"error",high:"warning",medium:"info",low:"success"},Kb=(e,t)=>{switch(e){case "critical":return t("kanban.priority.critical");case "high":return t("kanban.priority.high");case "medium":return t("kanban.priority.medium");case "low":return t("kanban.priority.low");default:return e}},qb=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",zl=({card:e,bucket:t,dragging:o=false,overlay:a=false,onClick:r,sx:n})=>{let{t:i}=K(),c=!!(r&&t),d=e.tone??(e.priority?Ub[e.priority]:"default"),s=d==="default"?"primary":Gb[d],l=t?{card:e,bucket:t}:void 0;return jsx(Paper,{onClick:c?()=>l&&r?.(l):void 0,onKeyDown:c?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l&&r?.(l));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[g=>{let f=d==="default"?g.palette.primary.main:g.palette[s].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${alpha(f,g.palette.mode==="dark"?.42:.2)}`,bgcolor:alpha(g.palette.background.paper,g.palette.mode==="dark"?.96:.98),boxShadow:a?`0 20px 45px ${alpha(g.palette.common.black,.24)}`:o?"none":`0 8px 24px ${alpha(g.palette.common.black,g.palette.mode==="dark"?.18:.08)}`,transform:a?"rotate(1deg) scale(1.01)":"none",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease",cursor:c?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:4,bgcolor:f},"&:hover":c?{transform:"translateY(-1px)",boxShadow:`0 14px 32px ${alpha(g.palette.common.black,g.palette.mode==="dark"?.28:.12)}`}:void 0}},...Array.isArray(n)?n:n?[n]:[]],children:jsxs(Stack,{spacing:1.1,children:[jsxs(Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{minWidth:0,flex:1},children:[(e.kicker||t?.title)&&jsx(Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:.4,color:"text.secondary",textTransform:"uppercase"},children:e.kicker??t?.title}),jsx(Typography,{sx:{mt:.2,fontSize:"0.98rem",fontWeight:800,lineHeight:1.3},children:e.title})]}),e.priority&&jsx(Chip,{size:"small",color:s,label:Kb(e.priority,i),variant:d==="default"?"outlined":"filled",sx:{height:22,fontWeight:700}})]}),e.summary&&jsx(Typography,{sx:{fontSize:"0.82rem",color:"text.secondary",lineHeight:1.5},children:e.summary}),e.metrics&&e.metrics.length>0&&jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(e.metrics.length,3)}, minmax(0, 1fr))`,gap:.9},children:e.metrics.slice(0,3).map(g=>jsxs(Box,{sx:f=>({borderRadius:2,px:1,py:.8,bgcolor:f.palette.mode==="dark"?alpha(f.palette.common.white,.05):alpha(f.palette.primary.main,.05)}),children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",textTransform:"uppercase",letterSpacing:.35},children:g.label}),jsx(Typography,{sx:{fontSize:"0.86rem",fontWeight:700},children:g.value})]},g.id))}),typeof e.progress=="number"&&jsxs(Box,{children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:i("kanban.card.progress")}),jsxs(Typography,{sx:{fontSize:"0.72rem",fontWeight:700},children:[Math.round(e.progress),"%"]})]}),jsx(LinearProgress,{variant:"determinate",value:Math.max(0,Math.min(100,e.progress)),color:s,sx:{height:8,borderRadius:999}})]}),(e.tags?.length||e.assignee||e.dueDate||e.footer||c)&&jsxs(Stack,{spacing:.9,children:[e.tags&&e.tags.length>0&&jsx(Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:e.tags.map(g=>jsx(Chip,{size:"small",label:g.label,color:g.color??"default",variant:"outlined"},g.id))}),jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8,minWidth:0},children:[e.assignee&&jsxs(Fragment,{children:[jsx(Avatar,{src:e.assignee.avatarSrc,sx:{width:28,height:28,fontSize:"0.75rem"},children:e.assignee.initials??qb(e.assignee.name)}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.78rem",fontWeight:700,lineHeight:1.2},noWrap:true,children:e.assignee.name}),e.dueDate&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},noWrap:true,children:e.dueDate})]})]}),!e.assignee&&e.dueDate&&jsx(Typography,{sx:{fontSize:"0.76rem",color:"text.secondary"},children:e.dueDate})]}),c&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700,whiteSpace:"nowrap"},children:i("kanban.card.openDetail")})]}),e.footer]})]})})};var Zb=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,Pp=({buckets:e,cards:t})=>{let o=new Map;return t.forEach((a,r)=>{let n=o.get(a.bucketId)??[];n.push({card:a,sourceIndex:r}),o.set(a.bucketId,n);}),{buckets:e.map(a=>{let r=[...o.get(a.id)??[]].sort((n,i)=>n.card.position===void 0&&i.card.position===void 0?n.sourceIndex-i.sourceIndex:n.card.position===void 0?1:i.card.position===void 0?-1:n.card.position-i.card.position||n.sourceIndex-i.sourceIndex).map(({card:n},i)=>({...n,bucketId:a.id,position:i}));return {...a,cards:r}})}},va=(e,t)=>{for(let o=0;o<e.buckets.length;o+=1){let a=e.buckets[o],r=a.cards.findIndex(n=>n.id===t);if(r>=0)return {card:a.cards[r],bucket:a,bucketIndex:o,cardIndex:r}}},_i=(e,t)=>{let o=va(e,t.cardId);if(!o)return e;let a=e.buckets.findIndex(s=>s.id===t.toBucketId);if(a<0)return e;let r=e.buckets.map(s=>({...s,cards:s.cards.map(l=>({...l}))})),n=r[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let c=r[a],d=Zb(t.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...i,bucketId:t.toBucketId}),{buckets:r.map(s=>({...s,cards:s.cards.map((l,g)=>({...l,bucketId:s.id,position:g}))}))}};var Vl="kanban-card|",Ol="kanban-bucket|",Ap=e=>`${Vl}${e}`,sx=e=>`${Ol}${e}`,Zi=e=>e?.startsWith(Vl)?e.slice(Vl.length):void 0,Mp=e=>e?.startsWith(Ol)?e.slice(Ol.length):void 0,lx=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:a,attributes:r,listeners:n,transform:i,transition:c,isDragging:d}=useSortable({id:Ap(e.id)}),s={transform:i?`translate3d(${i.x}px, ${i.y}px, 0)`:void 0,transition:c,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return jsx(Box,{ref:a,style:s,...r,...n,children:jsx(zl,{card:e,bucket:t,dragging:d,onClick:o})})},cx=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:a,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=useDroppable({id:sx(e.id)});return jsx(Box,{ref:i,sx:{minWidth:0},children:jsx(wp,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:a,maxHeight:o,children:jsx(SortableContext,{items:e.cards.map(c=>Ap(c.id)),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:1,children:e.cards.map(c=>jsx(lx,{card:c,bucket:e,onCardClick:r},c.id))})})})})},$D=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:a=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[c,d]=useState(null),[s,l]=useState(),g=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=useMemo(()=>c?va(e,c):void 0,[c,e]),u=useCallback(()=>{d(null),l(void 0);},[]),y=useCallback(m=>{if(!m)return;let b=Zi(m);return b?va(e,b)?.bucket.id:Mp(m)},[e]),I=useCallback(m=>{d(Zi(String(m.active.id))??null);},[]),p=useCallback(m=>{l(y(m.over?String(m.over.id):void 0));},[y]),C=useCallback(m=>{let b=Zi(String(m.active.id)),x=m.over?String(m.over.id):void 0;if(!b||!x){u();return}let k=va(e,b);if(!k){u();return}let L=k.bucket.id,P=k.cardIndex,w=Zi(x);if(w){let v=va(e,w);if(!v){u();return}L=v.bucket.id,P=v.cardIndex;}else {let v=Mp(x),M=e.buckets.find(S=>S.id===v);if(!v||!M){u();return}L=v,P=M.cards.length;}if(k.bucket.id===L&&k.cardIndex===P){u();return}let E=_i(e,{cardId:b,fromBucketId:k.bucket.id,toBucketId:L,targetIndex:P}),T=va(E,b);T&&!(T.bucket.id===k.bucket.id&&T.cardIndex===k.cardIndex)&&t?.({cardId:b,fromBucketId:k.bucket.id,toBucketId:T.bucket.id,targetIndex:T.cardIndex,card:T.card,model:E}),u();},[e,t,u]);return jsxs(DndContext,{sensors:g,collisionDetection:closestCorners,onDragStart:I,onDragOver:p,onDragEnd:C,onDragCancel:u,children:[jsx(Box,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${a}px, 1fr)`,gap:2,alignItems:"start",overflowX:"auto",pb:.5},...Array.isArray(i)?i:i?[i]:[]],children:e.buckets.map(m=>jsx(cx,{bucket:m,highlighted:m.id===s,bucketMaxHeight:r,emptyBucketLabel:n,onCardClick:o},m.id))}),jsx(DragOverlay,{children:f?jsx(Box,{sx:{width:Math.max(a-24,260)},children:jsx(zl,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var mx=({initialModel:e,initialBuckets:t,initialCards:o})=>e||Pp({buckets:t??[],cards:o??[]}),qD=e=>{let{onCardMove:t,onCardClick:o}=e,[a,r]=useState(()=>mx(e)),n=useCallback(l=>{r(g=>typeof l=="function"?l(g):l);},[]),i=useCallback(l=>va(a,l),[a]),c=useCallback((l,g,f)=>{let u=va(a,l);if(!u)return;let y=_i(a,{cardId:l,fromBucketId:u.bucket.id,toBucketId:g,targetIndex:f}),I=va(y,l);if(!I||I.bucket.id===u.bucket.id&&I.cardIndex===u.cardIndex)return;r(y);let p={cardId:l,fromBucketId:u.bucket.id,toBucketId:I.bucket.id,targetIndex:I.cardIndex,card:I.card,model:y};return t?.(p),p},[a,t]),d=useCallback((l,g)=>{r(f=>({buckets:f.buckets.map(u=>({...u,cards:u.cards.map(y=>y.id!==l?y:typeof g=="function"?g(y):{...y,...g})}))}));},[]),s=useMemo(()=>({model:a,onCardMove:l=>{c(l.cardId,l.toBucketId,l.targetIndex);},onCardClick:o}),[a,c,o]);return {model:a,actions:{replaceModel:n,moveCard:c,updateCard:d,getCard:i},boardProps:s}};var Lp=64,Rx="#E9EDF2",Dx="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",Mx=["en","zh","fr","de","ja","ko"],Np={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},zp=({appTitle:e,logo:t,mode:o="dark",onToggleMode:a,locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,onSearch:s,user:l,onUserSetting:g,onUserLogout:f,userMenuItems:u,leftSlot:y,rightSlot:I})=>{let{t:p,locale:C}=K(),b=useTheme().palette.mode==="dark",[x,k]=useState(""),[L,P]=useState(null),[w,E]=useState(null),T=oe=>{oe.preventDefault(),s&&s(x.trim());},v=o==="system"?jsx(Sx,{fontSize:"small"}):o==="dark"?jsx(wx,{fontSize:"small"}):jsx(Ix,{fontSize:"small"}),M=p(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),S=r||C,D=i&&i.length>0?i:Mx,B=n||Np[S]||S.toUpperCase(),H=!!L,V=d||p("header.searchPlaceholder"),q=!!w,Y=[{key:"setting",label:p("header.menu.setting"),icon:jsx(Yh,{sx:{fontSize:18}}),onClick:g},{key:"logout",label:p("header.menu.logout"),icon:jsx(Px,{sx:{fontSize:18}}),onClick:f}],te=u&&u.length>0?u:Y,ae=oe=>{E(null),oe?.();};return jsxs(AppBar,{position:"sticky",elevation:0,sx:oe=>({top:0,zIndex:oe.zIndex.drawer+10,height:Lp,backgroundColor:oe.palette.mode==="dark"?"#0D0D0D":Rx,backgroundImage:oe.palette.mode==="dark"?["radial-gradient(circle at 18% 22%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 45%)","radial-gradient(circle at 78% 32%, rgba(144,202,249,0.14) 0%, rgba(144,202,249,0) 42%)","linear-gradient(90deg, #0A0A0A 0%, #151515 50%, #0A0A0A 100%)","linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px)","linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px)"].join(","):["radial-gradient(circle at 22% 22%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 48%)","radial-gradient(circle at 76% 24%, rgba(203,213,225,0.45) 0%, rgba(203,213,225,0) 42%)",Dx,"linear-gradient(rgba(15,23,42,0.05) 1px, transparent 1px)","linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px)"].join(","),backgroundSize:"auto, auto, auto, 24px 24px, 24px 24px",borderBottom:"1px solid",borderColor:oe.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxs(Toolbar,{sx:{minHeight:`${Lp}px !important`,px:2,gap:2},children:[jsxs(Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[t||jsx(Box,{component:"img",src:"/orbcafe.png",alt:"ORBCAFE Logo",sx:{width:44,height:44,display:"block",objectFit:"contain",flexShrink:0}}),e&&jsx(Typography,{variant:"h6",sx:{fontWeight:700,color:b?"common.white":"#111827"},children:e}),y]}),jsx(Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsx(Box,{component:"form",onSubmit:T,sx:{width:"100%",maxWidth:540},children:jsx(TextField,{size:"small",fullWidth:true,value:x,onChange:oe=>k(oe.target.value),placeholder:V,InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(zd,{sx:{color:b?"rgba(255,255,255,0.7)":"rgba(15,23,42,0.55)",fontSize:18}})}),sx:{color:b?"common.white":"rgba(17,24,39,0.9)",bgcolor:b?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,"& .MuiOutlinedInput-notchedOutline":{borderColor:b?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:b?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:b?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:b?"white":"#111827"}}})})}),jsxs(Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[c?jsxs(Fragment,{children:[jsx(IconButton,{size:"small",onClick:oe=>P(oe.currentTarget),sx:{color:b?"common.white":"#111827",borderRadius:1,px:.5},children:jsxs(Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsx(Ep,{sx:{fontSize:18}}),jsx(Typography,{variant:"caption",sx:{fontWeight:500},children:B})]})}),jsx(Menu,{anchorEl:L,open:H,onClose:()=>P(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:D.map(oe=>jsx(MenuItem,{selected:oe===S,onClick:()=>{c(oe),P(null);},sx:{fontSize:"0.82rem"},children:Np[oe]},oe))})]}):jsxs(Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsx(Ep,{sx:{color:b?"common.white":"#111827",fontSize:18}}),jsx(Typography,{variant:"caption",sx:{color:b?"common.white":"#111827",fontWeight:500},children:B})]}),jsx(IconButton,{size:"small",sx:{color:b?"common.white":"#111827"},onClick:a,title:M,children:v}),l&&jsxs(Stack,{direction:"row",alignItems:"center",spacing:1,children:[jsxs(Box,{sx:{textAlign:"right",minWidth:0},children:[jsx(Typography,{variant:"body2",sx:{color:b?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:l.name}),l.subtitle&&jsx(Typography,{variant:"caption",sx:{display:"block",mt:.25,color:b?"rgba(255,255,255,0.72)":"rgba(17,24,39,0.62)",fontSize:"0.72rem",lineHeight:1.1,letterSpacing:"0.01em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:220},title:l.subtitle,children:l.subtitle})]}),jsx(IconButton,{size:"small",onClick:oe=>E(oe.currentTarget),sx:{p:0},children:jsx(Avatar,{src:l.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:l.avatarText||l.name.slice(0,1).toUpperCase()})})]}),I]})]}),l&&jsx(Menu,{anchorEl:w,open:q,onClose:()=>E(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:160,"& .MuiMenuItem-root":{minHeight:34,py:.5,px:1.25}}}},children:te.map(oe=>jsxs(MenuItem,{disabled:oe.disabled,onClick:()=>ae(oe.onClick),children:[oe.icon&&jsx(ListItemIcon,{children:oe.icon}),jsx(ListItemText,{primary:oe.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},oe.key))})]})};var Vp=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:o}=Wc({initialCollapsed:t,content:e}),[a,r]=useState(900);useEffect(()=>{let i=()=>r(window.innerHeight);return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);let n=useMemo(()=>Math.max(280,a-100),[a]);return {navigationIslandProps:o,navigationMaxHeight:n}};var hM=({appTitle:e,menuData:t=[],children:o,showNavigation:a=true,locale:r="en",localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:s,onUserLogout:l,userMenuItems:g,logo:f,onSearch:u,rightHeaderSlot:y,leftHeaderSlot:I,contentSx:p})=>{let C="orbcafe:page-layout-mode",[m,b]=useState("system"),[x,k]=useState("light"),[L,P]=useState(false),w=m==="system"?L?x:"light":m;useEffect(()=>{try{let D=window.localStorage.getItem(C);(D==="light"||D==="dark"||D==="system")&&b(D);}catch{}P(true);let M=window.matchMedia("(prefers-color-scheme: dark)"),S=()=>{k(M.matches?"dark":"light");};return S(),M.addEventListener("change",S),()=>M.removeEventListener("change",S)},[]),useEffect(()=>{if(L)try{window.localStorage.setItem(C,m);}catch{}},[L,m]);let E=useMemo(()=>createTheme({palette:{mode:w}}),[w]),{navigationIslandProps:T,navigationMaxHeight:v}=Vp({menuData:t,initialNavigationCollapsed:false});return jsx(ThemeProvider,{theme:E,children:jsx(Bc,{locale:r,children:jsxs(Box,{sx:M=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:M.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":M.palette.background.default}),children:[jsx(zp,{appTitle:e,logo:f,mode:m,onToggleMode:()=>b(M=>M==="system"?"dark":M==="dark"?"light":"system"),locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:s,onUserLogout:l,userMenuItems:g,onSearch:u,leftSlot:I,rightSlot:y}),jsxs(Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[a&&jsx(Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsx(Vc,{...T,maxHeight:v,colorMode:w})}),jsx(Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...p},children:o})]})]})})})};var Ji="(blank)",$p="Result",Hp="Grand Total",Gp={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Up=["sum","count","avg","min","max"];var Kp=["palette","rows","columns","filters","values"];var qp=e=>Kp.includes(e),_p=e=>e==="rows"||e==="columns"||e==="filters",es=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&qp(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&qp(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},ao=e=>e==null||e===""?Ji:e instanceof Date?e.toISOString().slice(0,10):String(e),nr=e=>JSON.stringify(e),Zp=(e,t)=>{let o=e.join(""),a=t.join("");return o.localeCompare(a,void 0,{sensitivity:"base"})},Vx=e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null},Vr=(e,t,o)=>{if(o==="count")return e.length;let a=e.map(r=>Vx(r[t])).filter(r=>r!==null);return a.length===0?0:o==="sum"?a.reduce((r,n)=>r+n,0):o==="avg"?a.reduce((r,n)=>r+n,0)/a.length:o==="min"?Math.min(...a):Math.max(...a)},pt=(e,t)=>{if(!e||e.length===0)return [];let o=new Set,a=[];return e.forEach(r=>{!t.has(r)||o.has(r)||(o.add(r),a.push(r));}),a},oo=(e,t)=>e.length!==t.length?false:e.every((o,a)=>o===t[a]),jp=(e,t)=>{let o=Object.keys(e),a=Object.keys(t);return o.length!==a.length?false:o.every(r=>{let n=e[r]??[],i=t[r]??[];return oo(n,i)})},ts=(e,t)=>e.length!==t.length?false:e.every((o,a)=>{let r=t[a];return o.tokenId===r.tokenId&&o.fieldId===r.fieldId&&o.aggregation===r.aggregation}),Gl=e=>!e?.aggregations||e.aggregations.length===0?Up:e.aggregations,Mt=(e,t)=>{let o=Gl(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},En=(e,t,o)=>{let a=o.get(t.fieldId);return a?.formatValue?a.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var Yp=({options:e,selectedValues:t,onChange:o,minWidth:a=96})=>{let{t:r}=K(),[n,i]=useState(""),c=useMemo(()=>{let s=n.trim().toLowerCase();return s?e.filter(l=>l.toLowerCase().includes(s)):e},[e,n]),d=e.length>0&&t.length===e.length;return jsx(FormControl,{size:"small",sx:{minWidth:a},children:jsxs(Select,{multiple:true,value:t,onChange:s=>{let l=s.target.value,g=typeof l=="string"?l.split(","):l;o(g);},onClick:s=>s.stopPropagation(),onMouseDown:s=>s.stopPropagation(),renderValue:s=>{let l=s;return e.length===0?r("pivot.filter.na"):l.length===0?r("common.none"):l.length===e.length?r("common.all"):`${l.length}/${e.length}`},MenuProps:{PaperProps:{sx:{maxHeight:320,bgcolor:"background.paper"}}},sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:[jsx(ListSubheader,{disableSticky:true,sx:s=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${s.palette.divider}`}),children:jsx(TextField,{size:"small",placeholder:`${r("common.search")}...`,fullWidth:true,value:n,onChange:s=>i(s.target.value),onKeyDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),sx:{m:0,"& .MuiInputBase-input":{fontSize:"0.75rem",py:.7}}})}),jsx(Box,{sx:s=>({px:1.5,py:.5,borderBottom:`1px solid ${s.palette.divider}`,bgcolor:"background.paper"}),onMouseDown:s=>{s.preventDefault(),s.stopPropagation();},onClick:s=>{s.preventDefault(),s.stopPropagation();},children:jsx(Button,{variant:"text",size:"small",onClick:s=>{s.preventDefault(),s.stopPropagation(),o(d?[]:e);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:r(d?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),c.length===0&&jsx(MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:r("pivot.filter.noResults")}),c.map(s=>{let l=t.includes(s);return jsxs(MenuItem,{value:s,sx:{fontSize:"0.75rem",py:.25},children:[jsx(Checkbox,{size:"small",checked:l,sx:{p:.5,mr:.5}}),jsx(ListItemText,{primary:s,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},s)})]})})};var Kl=({label:e,subtitle:t,isDragging:o,dragRef:a,listeners:r,attributes:n,style:i})=>jsx(Paper,{ref:a,...r,...n,sx:c=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:c.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none"}),style:{...i,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsx(Box,{sx:c=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.3,borderRadius:1,bgcolor:c.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)"}),children:jsx(Qx,{sx:{fontSize:16,color:"text.secondary"}})}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary",lineHeight:1.2},children:t})]})]})}),tu=({id:e,label:t,subtitle:o})=>{let{setNodeRef:a,listeners:r,attributes:n,isDragging:i}=useDraggable({id:e});return jsx(Kl,{label:t,subtitle:o,isDragging:i,dragRef:a,listeners:r,attributes:n})};var $r=({zone:e,title:t,hint:o,icon:a,children:r,itemCount:n,onClear:i})=>{let c=`container|${e}`,{isOver:d,setNodeRef:s}=useDroppable({id:c}),{t:l}=K();return jsxs(Paper,{ref:s,sx:g=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:d?"primary.main":g.palette.divider,bgcolor:d?g.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":g.palette.mode==="dark"?"rgba(255,255,255,0.02)":"rgba(245, 248, 255, 0.86)",transition:"all 120ms ease",minHeight:120,display:"flex",flexDirection:"column"}),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[a,jsx(Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxs(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",n,")"]})]}),n>0&&i&&jsx(Tooltip,{title:l("pivot.clearArea"),children:jsx(IconButton,{size:"small",onClick:i,sx:{p:.25},children:jsx(t0,{sx:{fontSize:16}})})})]}),jsx(Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:o}),jsx(Box,{sx:{flex:1},children:r})]})};var ou={xs:1.2,md:1.6},Gr=({title:e,subtitle:t,collapsed:o,onToggleCollapse:a,expandAriaLabel:r,collapseAriaLabel:n,children:i,bodySx:c,unmountOnExit:d=false,headerActions:s})=>jsxs(Paper,{sx:l=>({borderRadius:3,border:`1px solid ${l.palette.divider}`,overflow:"hidden",bgcolor:alpha(l.palette.background.paper,.95)}),children:[jsxs(Box,{sx:l=>({px:ou,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:o?"none":`1px solid ${l.palette.divider}`}),children:[jsxs(Box,{sx:{minWidth:0,flex:1},children:[jsx(Typography,{sx:{fontSize:"0.9rem",fontWeight:800},children:e}),jsx(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[s,jsx(IconButton,{size:"small","aria-label":o?r:n,onClick:a,sx:l=>({border:`1px solid ${l.palette.divider}`,bgcolor:alpha(l.palette.background.paper,.88),width:28,height:28,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:l.palette.mode==="dark"?alpha(l.palette.primary.main,.18):alpha(l.palette.primary.main,.08)}}),children:jsx(Jh,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),jsx(Collapse,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:jsx(Box,{sx:[{px:ou,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var is=({label:e,caption:t,onRemove:o,trailing:a,isDragging:r,dragRef:n,listeners:i,attributes:c,style:d})=>jsx(Paper,{ref:n,style:d,sx:s=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:s.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none",opacity:r?0:1}),children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsx(Box,{...c,...i,sx:s=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.25,borderRadius:1,bgcolor:s.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)",cursor:"grab"}),children:jsx(Qx,{sx:{fontSize:15,color:"text.secondary"}})}),jsxs(Box,{sx:{minWidth:0,flex:1},children:[jsx(Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),a,o&&jsx(IconButton,{size:"small",onClick:s=>{s.stopPropagation(),o();},sx:{p:.2},children:jsx(qf,{sx:{fontSize:16}})})]})}),Ln=({id:e,label:t,caption:o,onRemove:a,trailing:r})=>{let{setNodeRef:n,attributes:i,listeners:c,transform:d,transition:s,isDragging:l}=useSortable({id:e}),g={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:s,zIndex:l?999:"auto"};return jsx(is,{label:t,caption:o,onRemove:a,trailing:r,isDragging:l,dragRef:n,listeners:c,attributes:i,style:g})};var cs={rows:jsx(f0,{fontSize:"small"}),columns:jsx(Mg,{fontSize:"small"}),filters:jsx(g0,{fontSize:"small"}),values:jsx(Eg,{fontSize:"small"})},iu=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:a,filterFields:r,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:s,getFilterSelectionSummary:l,renderDimensionFilterSelect:g,renderAggregationSelect:f,getAggregationLabel:u})=>{let{t:y}=K(),I=[`${y("pivot.zone.rows")} ${i.length}`,`${y("pivot.zone.columns")} ${n.length}`,`${y("pivot.zone.filters")} ${r.length}`,`${y("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsx(Gr,{title:y("pivot.config.title"),subtitle:I,collapsed:e,onToggleCollapse:t,expandAriaLabel:y("pivot.collapse.ariaExpand"),collapseAriaLabel:y("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsx($r,{zone:"palette",title:y("pivot.fieldList"),hint:y("pivot.availableDimensions"),itemCount:o.length,icon:jsx(Qx,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxs(Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&jsx(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:y("pivot.allFieldsInUse")}),o.map(p=>jsx(tu,{id:`item|palette|${p.id}`,label:p.label,subtitle:p.type??"string"},p.id))]})}),jsxs(Stack,{spacing:2,children:[jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsx($r,{zone:"filters",title:y("pivot.zone.filters"),hint:y("pivot.hint.filters"),icon:cs.filters,itemCount:r.length,onClear:()=>d("filters"),children:jsx(SortableContext,{items:r.map(p=>`item|filters|${p}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:r.map(p=>jsx(Ln,{id:`item|filters|${p}`,label:a.get(p)?.label??p,caption:l(p),trailing:g(p),onRemove:()=>s("filters",p)},p))})})}),jsx($r,{zone:"columns",title:y("pivot.zone.columns"),hint:y("pivot.hint.columns"),icon:cs.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsx(SortableContext,{items:n.map(p=>`item|columns|${p}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:n.map(p=>jsx(Ln,{id:`item|columns|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${l(p)}`,trailing:g(p),onRemove:()=>s("columns",p)},p))})})})]}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsx($r,{zone:"rows",title:y("pivot.zone.rows"),hint:y("pivot.hint.rows"),icon:cs.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsx(SortableContext,{items:i.map(p=>`item|rows|${p}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:i.map(p=>jsx(Ln,{id:`item|rows|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${l(p)}`,trailing:g(p),onRemove:()=>s("rows",p)},p))})})}),jsx($r,{zone:"values",title:y("pivot.zone.values"),hint:y("pivot.hint.values"),icon:cs.values,itemCount:c.length,onClear:()=>d("values"),children:jsx(SortableContext,{items:c.map(p=>`item|values|${p.tokenId}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:c.map(p=>{let C=a.get(p.fieldId)?.label??p.fieldId,m=`${u(p.aggregation)}(${C})`;return jsx(Ln,{id:`item|values|${p.tokenId}`,label:C,caption:m,trailing:f(p),onRemove:()=>s("values",p.tokenId)},p.tokenId)})})})})]})]})]})})};var su=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),lu=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:a,formatSecondaryValue:r})=>{let n=useTheme$1();if(e.length===0)return null;let i=720,c=250,d={top:20,right:24,bottom:40,left:52},s=o?e.map(p=>p.primaryValue):e.map((p,C)=>C+1),l=o?e.map(p=>p.secondaryValue??0):e.map(p=>p.primaryValue),g=Math.max(...s,1),f=Math.max(...l,1),u=i-d.left-d.right,y=c-d.top-d.bottom,I=e.map((p,C)=>{let m=o?p.primaryValue:C+1,b=o?p.secondaryValue??0:p.primaryValue,x=d.left+m/g*u,k=c-d.bottom-b/f*y;return {...p,x,y:k,rawX:m,rawY:b}});return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{component:"svg",viewBox:`0 0 ${i} ${c}`,sx:{width:"100%",minWidth:i,height:c},children:[jsx("line",{x1:d.left,y1:c-d.bottom,x2:i-d.right,y2:c-d.bottom,stroke:alpha(n.palette.text.secondary,.35)}),jsx("line",{x1:d.left,y1:d.top,x2:d.left,y2:c-d.bottom,stroke:alpha(n.palette.text.secondary,.35)}),I.map(p=>jsxs("g",{children:[jsx("circle",{cx:p.x,cy:p.y,r:7,fill:alpha(n.palette.primary.main,.18)}),jsx("circle",{cx:p.x,cy:p.y,r:4.5,fill:n.palette.primary.main,children:jsxs("title",{children:[p.name,`
|
|
13
13
|
`,o?`${t}: ${a(p.primaryValue)}`:`${t}: ${a(p.primaryValue)}`,o?`
|
|
14
|
-
${o}: ${(r??a)(p.secondaryValue??0)}`:""]})}),jsx("text",{x:p.x,y:Math.max(p.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:n.palette.text.secondary,children:p.name})]},p.name)),jsx("text",{x:i/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:n.palette.text.secondary,children:o?t:"Index"}),jsx("text",{x:16,y:c/2,textAnchor:"middle",transform:`rotate(-90 16 ${c/2})`,fontSize:"11",fill:n.palette.text.secondary,children:o??t}),jsx("text",{x:d.left,y:d.top-4,fontSize:"10",fill:n.palette.text.secondary,children:
|
|
14
|
+
${o}: ${(r??a)(p.secondaryValue??0)}`:""]})}),jsx("text",{x:p.x,y:Math.max(p.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:n.palette.text.secondary,children:p.name})]},p.name)),jsx("text",{x:i/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:n.palette.text.secondary,children:o?t:"Index"}),jsx("text",{x:16,y:c/2,textAnchor:"middle",transform:`rotate(-90 16 ${c/2})`,fontSize:"11",fill:n.palette.text.secondary,children:o??t}),jsx("text",{x:d.left,y:d.top-4,fontSize:"10",fill:n.palette.text.secondary,children:su(f)}),jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:su(g)})]})}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:e.map(p=>jsxs(Box,{sx:C=>({borderRadius:2,px:1.25,py:1,border:`1px solid ${alpha(C.palette.divider,.7)}`,bgcolor:alpha(C.palette.background.default,.35)}),children:[jsx(Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:p.name,children:p.name}),jsxs(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",a(p.primaryValue)]}),o&&jsxs(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(r??a)(p.secondaryValue??0)]})]},p.name))})]})};var Xl=e=>Math.max(...e,1),du=({data:e,chartType:t,primaryLabel:o,secondaryLabel:a,formatPrimaryValue:r,formatSecondaryValue:n})=>{let i=useTheme$1(),c=i.palette.primary.main,d=i.palette.warning.main;if(e.length===0)return null;if(t==="bar-horizontal"){let m=Xl(e.flatMap(b=>[b.primaryValue,b.secondaryValue??0]));return jsx(Stack,{spacing:1.1,children:e.map(b=>jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[jsx(Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:b.name,children:b.name}),jsxs(Stack,{spacing:.65,children:[jsx(Box,{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:alpha(i.palette.action.active,.08)},children:jsx(Box,{sx:{width:`${b.primaryValue/m*100}%`,height:"100%",bgcolor:c}})}),a&&jsx(Box,{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:alpha(i.palette.action.active,.08)},children:jsx(Box,{sx:{width:`${(b.secondaryValue??0)/m*100}%`,height:"100%",bgcolor:d}})})]}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700},children:r(b.primaryValue)}),a&&jsx(Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"text.secondary"},children:(n??r)(b.secondaryValue??0)})]})]},b.name))})}if(t==="bar-vertical"){let m=Xl(e.flatMap(x=>[x.primaryValue,x.secondaryValue??0])),b=a?92:76;return jsx(Box,{sx:{overflowX:"auto",pb:.5},children:jsx(Box,{sx:{minWidth:Math.max(620,e.length*b),display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:e.map(x=>jsxs(Box,{sx:{minWidth:0},children:[jsxs(Box,{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[jsx(Box,{sx:{width:a?16:26,minHeight:8,height:`${Math.max(x.primaryValue/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${o}: ${r(x.primaryValue)}`}),a&&jsx(Box,{sx:{width:16,minHeight:8,height:`${Math.max((x.secondaryValue??0)/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${a}: ${(n??r)(x.secondaryValue??0)}`})]}),jsx(Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:x.name,children:x.name}),jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:r(x.primaryValue),children:r(x.primaryValue)}),a&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:(n??r)(x.secondaryValue??0),children:(n??r)(x.secondaryValue??0)})]},x.name))})})}let s=Math.max(680,e.length*74),l=240,g={top:20,right:18,bottom:36,left:18},f=Xl(e.flatMap(m=>[m.primaryValue,m.secondaryValue??0])),u=s-g.left-g.right,y=l-g.top-g.bottom,I=m=>e.map((b,x)=>{let k=g.left+x*u/Math.max(e.length-1,1),L=l-g.bottom-m(b)/f*y;return {x:k,y:L,item:b}}),p=I(m=>m.primaryValue),C=a?I(m=>m.secondaryValue??0):[];return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{component:"svg",viewBox:`0 0 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[jsx("line",{x1:g.left,y1:l-g.bottom,x2:s-g.right,y2:l-g.bottom,stroke:alpha(i.palette.text.secondary,.35)}),jsx("polyline",{fill:"none",stroke:c,strokeWidth:3,points:p.map(m=>`${m.x},${m.y}`).join(" ")}),p.map(m=>jsx("circle",{cx:m.x,cy:m.y,r:4,fill:c,children:jsxs("title",{children:[m.item.name,`
|
|
15
15
|
`,o,": ",r(m.item.primaryValue)]})},`primary-${m.item.name}`)),a&&jsxs(Fragment,{children:[jsx("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:C.map(m=>`${m.x},${m.y}`).join(" ")}),C.map(m=>jsx("circle",{cx:m.x,cy:m.y,r:3.5,fill:d,children:jsxs("title",{children:[m.item.name,`
|
|
16
|
-
`,a,": ",(n??r)(m.item.secondaryValue??0)]})},`secondary-${m.item.name}`))]})]})}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:e.map(m=>jsxs(Box,{sx:b=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${alpha(b.palette.divider,.7)}`,bgcolor:alpha(b.palette.background.default,.35)}),children:[jsx(Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:m.name,children:m.name}),jsx(Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:r(m.primaryValue)}),a&&jsx(Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??r)(m.secondaryValue??0)})]},m.name))})]})};var du=(e,t,o)=>{let a=new Set,r=[];return e.forEach(n=>{a.has(n)||(a.add(n),r.push({fieldId:n,label:o.get(n)?.label??n,zone:"rows"}));}),t.forEach(n=>{a.has(n)||(a.add(n),r.push({fieldId:n,label:o.get(n)?.label??n,zone:"columns"}));}),r},pu=(e,t,o)=>e.map(a=>{let r=t.get(a.fieldId),n=r?.label??a.fieldId;return {fieldId:a.fieldId,label:`${o(a.aggregation)} \xB7 ${n}`,item:a,field:r}}),uu=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:a})=>{if(!t)return [];let r=new Map;return e.forEach(n=>{let i=eo(n[t]),c=r.get(i);if(c){c.push(n);return}r.set(i,[n]);}),Array.from(r.entries()).sort((n,i)=>n[0].localeCompare(i[0],void 0,{sensitivity:"base"})).map(([n,i])=>({name:n,primaryValue:Nr(i,o.fieldId,o.aggregation),secondaryValue:a?Nr(i,a.fieldId,a.aggregation):void 0}))};var mu=({rows:e,fieldMap:t,rowFields:o,columnFields:a,valueFields:r,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:s,onChartDimensionFieldIdChange:l,onChartPrimaryValueFieldIdChange:g,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:u,onToggleCollapse:y,getAggregationLabel:I})=>{let{t:p}=q(),C=useMemo(()=>du(o,a,t),[a,t,o]),m=useMemo(()=>pu(r,t,I),[t,I,r]),b=m.find(v=>v.fieldId===i)??m[0],x=m.find(v=>v.fieldId===c&&v.fieldId!==b?.fieldId)??null,k=C.find(v=>v.fieldId===n)??C[0],L=k&&b?p("pivot.chart.subtitleReady",{dimension:k.label,measure:x?`${b.label} / ${x.label}`:b.label}):p("pivot.chart.subtitle"),P=useMemo(()=>!k||!b?[]:uu({rows:e,dimensionFieldId:k.fieldId,primaryValue:b.item,secondaryValue:x?.item}),[b,e,x,k]),w=v=>b?Bn(v,b.item,t):v.toLocaleString(),E=v=>x?Bn(v,x.item,t):v.toLocaleString(),T=C.length>1||m.length>1;return jsxs($r,{title:p("pivot.chart.title"),subtitle:L,collapsed:s,onToggleCollapse:y,expandAriaLabel:p("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:p("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[T&&jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.dimension")}),jsx(Select,{value:k?.fieldId??"",onChange:v=>l(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:C.map(v=>jsx(MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))})]}),jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.primaryMeasure")}),jsx(Select,{value:b?.fieldId??"",onChange:v=>g(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:m.map(v=>jsx(MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))})]}),jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.secondaryMeasure")}),jsxs(Select,{value:x?.fieldId??"",onChange:v=>f(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("common.none")}),m.filter(v=>v.fieldId!==b?.fieldId).map(v=>jsx(MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))]})]}),jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.chartType")}),jsxs(Select,{value:d,onChange:v=>u(v.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barVertical")}),jsx(MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barHorizontal")}),jsx(MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.line")}),jsx(MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.scatter")})]})]})]}),jsx(Box,{children:k?b?P.length===0?jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoData")})}):d==="scatter"?jsx(su,{data:P,primaryLabel:b.label,secondaryLabel:x?.label,formatPrimaryValue:w,formatSecondaryValue:E}):jsx(cu,{data:P,chartType:d,primaryLabel:b.label,secondaryLabel:x?.label,formatPrimaryValue:w,formatSecondaryValue:E}):jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoValue")})}):jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoDimension")})})})]})};var ps=({node:e,dataColumns:t,fieldMap:o,level:a,expandedKeys:r,onToggle:n,getValue:i})=>{let c=r.has(e.key),d=e.children.length>0,s=e.isGrandTotal;return jsxs(Fragment,{children:[jsxs(TableRow,{sx:l=>({bgcolor:s?l.palette.mode==="dark"?"rgba(25, 118, 210, 0.22)":"rgba(47, 91, 255, 0.08)":l.palette.mode==="dark"?"#111111":"background.paper","&:hover":{bgcolor:s?l.palette.mode==="dark"?"rgba(25, 118, 210, 0.28)":"rgba(47, 91, 255, 0.12)":l.palette.mode==="dark"?"#181818":"rgba(0, 0, 0, 0.02)"}}),children:[jsxs(TableCell,{sx:l=>({fontSize:"0.76rem",fontWeight:s?800:600,borderBottom:`1px solid ${l.palette.divider}`,whiteSpace:"nowrap",pl:a*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!s&&jsx(IconButton,{size:"small",onClick:()=>n(e.key),sx:{p:.2,mr:.5,ml:-1},children:c?jsx(af,{sx:{fontSize:16}}):jsx(Og,{sx:{fontSize:16}})}),!d&&!s&&a>0&&jsx(Box,{sx:{width:20}}),e.value]}),t.map(l=>jsx(TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:s?800:500,borderBottom:g=>`1px solid ${g.palette.divider}`,whiteSpace:"nowrap"},children:Bn(i?i(e,l.id):e.aggregatedValues[l.id]??0,l.valueItem,o)},`${e.key}-${l.id}`))]}),c&&e.children.map(l=>jsx(ps,{node:l,dataColumns:t,fieldMap:o,level:a+1,expandedKeys:r,onToggle:n,getValue:i},l.key))]})};var tc=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},gs=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",ac=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",vu=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children.length>0&&(t.add(r.key),o(r.children));});};return o(e),t},ku=(e,t,o=0)=>e.length===0?o:e.reduce((a,r)=>r.children.length===0||!t.has(r.key)?Math.max(a,o+1):Math.max(a,ku(r.children,t,o+1)),o),Q0=(e,t)=>{let o=[],a=r=>{r.forEach(n=>{if(n.children.length>0&&t.has(n.key)){a(n.children);return}o.push(n);});};return a(e),o},o2=({title:e,rows:t,fields:o,initialLayout:a,initialChart:r,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:s,enablePresetManagement:l=false,presets:g,defaultPresets:f,onPresetsChange:u,initialPresetId:y,onPresetApplied:I})=>{let{t:p}=q(),C=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),m=useRef(0),b=useRef(false),x=e??p("pivot.title.default"),k=n??p("pivot.empty"),L=useMemo(()=>({sum:p("pivot.agg.sum"),count:p("pivot.agg.count"),avg:p("pivot.agg.avg"),min:p("pivot.agg.min"),max:p("pivot.agg.max")}),[p]),P=useCallback(h=>L[h]??Hp[h],[L]),w=useMemo(()=>new Set(o.map(h=>h.id)),[o]),E=useMemo(()=>new Map(o.map(h=>[h.id,h])),[o]),[T,v]=useState(()=>dt(a?.rows,w)),[M,S]=useState(()=>dt(a?.columns,w)),[D,B]=useState(()=>dt(a?.filters,w)),[H,V]=useState(()=>{let h=a?.values??[],A=new Set,F=[];return h.forEach(W=>{if(!w.has(W.fieldId)||A.has(W.fieldId))return;A.add(W.fieldId),m.current+=1;let j=E.get(W.fieldId);F.push({tokenId:`v${m.current}`,fieldId:W.fieldId,aggregation:Dt(W.aggregation,j)});}),F}),[_,Y]=useState({}),[ee,te]=useState(true),[oe,Bt]=useState(false),[lt,Ke]=useState(()=>tc(dt(a?.rows,w),dt(a?.columns,w),r?.dimensionFieldId)),[ge,De]=useState(()=>{let h=(a?.values??[]).filter((A,F,W)=>w.has(A.fieldId)&&W.findIndex(j=>j.fieldId===A.fieldId)===F).map(A=>({tokenId:A.fieldId,fieldId:A.fieldId,aggregation:Dt(A.aggregation,E.get(A.fieldId))}));return gs(h,r?.primaryValueFieldId)}),[Fe,Je]=useState(()=>{let h=(a?.values??[]).filter((F,W,j)=>w.has(F.fieldId)&&j.findIndex(le=>le.fieldId===F.fieldId)===W).map(F=>({tokenId:F.fieldId,fieldId:F.fieldId,aggregation:Dt(F.aggregation,E.get(F.fieldId))})),A=gs(h,r?.primaryValueFieldId);return ac(h,A,r?.secondaryValueFieldId)}),[It,qe]=useState(r?.chartType??"bar-vertical"),[rt,Oa]=useState(c),[ka,Sa]=useState(d),[wa,Ia]=useState(()=>f??[]),[mt,$]=useState(""),[de,ne]=useState(false),[pe,Oe]=useState(""),[Me,Xt]=useState(null),[ia,sa]=useState(new Set(["__grand_total__"])),[la,ca]=useState(new Set),ke=s?.rowFields??T,ce=s?.columnFields??M,gt=s?.filterFields??D,Te=s?.valueFields??H,Tt=s?.filterSelections??_,da=s?.showGrandTotal??ee,Mo=s?.isConfiguratorCollapsed??oe,z=s?.chartDimensionFieldId??lt,O=s?.chartPrimaryValueFieldId??ge,G=s?.chartSecondaryValueFieldId??Fe,ue=s?.chartType??It,fe=s?.isChartCollapsed??rt,we=s?.isTableCollapsed??ka,se=g??wa,Pe=l||se.length>0||!!u,ye=useCallback(h=>{if(s?.setRowFields){s.setRowFields(h);return}v(h);},[s]),Re=useCallback(h=>{if(s?.setColumnFields){s.setColumnFields(h);return}S(h);},[s]),Se=useCallback(h=>{if(s?.setFilterFields){s.setFilterFields(h);return}B(h);},[s]),he=useCallback(h=>{if(s?.setValueFields){s.setValueFields(h);return}V(h);},[s]),Ce=useCallback(h=>{if(s?.setFilterSelections){s.setFilterSelections(h);return}Y(h);},[s]),je=useCallback(h=>{if(s?.setShowGrandTotal){s.setShowGrandTotal(h);return}te(h);},[s]),Pt=useCallback(h=>{if(s?.setIsConfiguratorCollapsed){s.setIsConfiguratorCollapsed(h);return}Bt(h);},[s]),pa=useCallback(h=>{if(s?.setChartDimensionFieldId){s.setChartDimensionFieldId(h);return}Ke(h);},[s]),Ot=useCallback(h=>{if(s?.setChartPrimaryValueFieldId){s.setChartPrimaryValueFieldId(h);return}De(h);},[s]),Yt=useCallback(h=>{if(s?.setChartSecondaryValueFieldId){s.setChartSecondaryValueFieldId(h);return}Je(h);},[s]),Ta=useCallback(h=>{if(s?.setChartType){s.setChartType(h);return}qe(h);},[s]),Ao=useCallback(h=>{if(s?.setIsChartCollapsed){s.setIsChartCollapsed(h);return}Oa(h);},[s]),so=useCallback(h=>{if(s?.setIsTableCollapsed){s.setIsTableCollapsed(h);return}Sa(h);},[s]),Ft=useCallback(h=>{let A=typeof h=="function"?h(se):h;g||Ia(A),u?.(A);},[u,se,g]),Wa=useMemo(()=>new Set([...ke,...ce,...gt]),[ke,ce,gt]),Bo=useMemo(()=>o.filter(h=>!Wa.has(h.id)),[o,Wa]),Et=useMemo(()=>{let h=[...ke,...ce,...gt],A=new Set,F=[];return h.forEach(W=>{A.has(W)||(A.add(W),F.push(W));}),F},[ce,gt,ke]);useEffect(()=>{ye(h=>{let A=h.filter(F=>w.has(F));return to(h,A)?h:A}),Re(h=>{let A=h.filter(F=>w.has(F));return to(h,A)?h:A}),Se(h=>{let A=h.filter(F=>w.has(F));return to(h,A)?h:A}),he(h=>{let A=h.filter(F=>w.has(F.fieldId)).map(F=>({...F,aggregation:Dt(F.aggregation,E.get(F.fieldId))}));return es(h,A)?h:A});},[E,w]);let Wt=useMemo(()=>{let h={};return Et.forEach(A=>{let F=new Set;t.forEach(W=>{F.add(eo(W[A]));}),h[A]=Array.from(F).sort((W,j)=>W.localeCompare(j));}),h},[Et,t]);useEffect(()=>{Ce(h=>{let A={};return Et.forEach(F=>{let W=Wt[F]??[],le=(h[F]??[]).filter(K=>W.includes(K)),N=Object.prototype.hasOwnProperty.call(h,F);A[F]=N?le:W;}),Zp(h,A)?h:A});},[Et,Wt]),useEffect(()=>{pa(h=>tc(ke,ce,h));},[ce,ke,pa]),useEffect(()=>{Ot(h=>gs(Te,h));},[Ot,Te]),useEffect(()=>{Yt(h=>ac(Te,O,h));},[O,Yt,Te]);let Rt=useMemo(()=>t.filter(h=>Et.every(A=>{let F=Tt[A]??[],W=Wt[A]??[];if(F.length===W.length)return true;if(F.length===0)return false;let j=eo(h[A]);return F.includes(j)})),[Et,Wt,Tt,t]),Ie=useMemo(()=>{if(Te.length===0)return null;let h=new Map;if(Rt.forEach(N=>{let K=ce.length>0?ce.map(Z=>eo(N[Z])):[p("pivot.valueLabel")],R=or(K);h.set(R,K);}),h.size===0){let N=ce.length>0?ce.map(()=>Yi):[p("pivot.valueLabel")];h.set(or(N),N);}let A=Array.from(h.entries()).sort((N,K)=>_p(N[1],K[1])),F=A.flatMap(([N,K])=>Te.map(R=>{let Z=E.get(R.fieldId),ie=`${P(R.aggregation)} ${Z?.label??R.fieldId}`,$e=ce.length===0||Te.length>1?`${K.join(" / ")} \u2022 ${ie}`:K.join(" / ");return {id:`${N}::${R.tokenId}`,colKey:N,valueItem:R,label:$e}})),W=[];ce.length>0&&A.forEach(([N,K])=>{let R=F.filter($e=>$e.colKey===N),Z=W,ie=[];K.forEach(($e,U)=>{ie.push(`d${U}:${$e}`);let ae=`col::${or(ie)}`,We=Z.find(_n=>_n.key===ae);We||(We={key:ae,label:$e,children:[],leafColumnIds:[],path:K.slice(0,U+1),depth:U},Z.push(We)),R.forEach(_n=>{We.leafColumnIds.includes(_n.id)||We.leafColumnIds.push(_n.id);}),Z=We.children;});});let j=N=>{let K={};return F.forEach(R=>{let Z=N.filter(ie=>{let $e=ce.length>0?ce.map(U=>eo(ie[U])):[p("pivot.valueLabel")];return or($e)===R.colKey});K[R.id]=Nr(Z,R.valueItem.fieldId,R.valueItem.aggregation);}),K},le=[];if(ke.length===0)le.push({key:"root",value:p("pivot.resultLabel")||Wp,children:[],isLeaf:true,aggregatedValues:j(Rt),path:[],depth:0});else {let N=(K,R,Z)=>{if(R>=ke.length)return [];let ie=ke[R],$e=new Map;return K.forEach(U=>{let ae=eo(U[ie]);$e.has(ae)||$e.set(ae,[]),$e.get(ae).push(U);}),Array.from($e.keys()).sort().map(U=>{let ae=$e.get(U),We=[...Z,U];return {key:or(We),value:U,fieldId:ie,aggregatedValues:j(ae),children:N(ae,R+1,We),isLeaf:R===ke.length-1,path:We,depth:R}})};le.push(...N(Rt,0,[]));}return {dataColumns:F,columnTree:W,rowTree:le}},[ce,E,Rt,P,ke,p,Te]),Jt=useCallback((h,A)=>(m.current+=1,{tokenId:`v${m.current}`,fieldId:h,aggregation:Dt(A,E.get(h))}),[E]),Fo=useCallback(h=>{if(h==="rows")return ye([]);if(h==="columns")return Re([]);if(h==="filters")return Se([]);he([]);},[]),Eo=useCallback((h,A)=>{if(h==="rows")return ye(F=>F.filter(W=>W!==A));if(h==="columns")return Re(F=>F.filter(W=>W!==A));if(h==="filters")return Se(F=>F.filter(W=>W!==A));he(F=>F.filter(W=>W.tokenId!==A));},[]),Lo=useCallback((h,A)=>{he(F=>F.map(W=>W.tokenId===h?{...W,aggregation:Dt(A,E.get(W.fieldId))}:W));},[E]),$a=useCallback(h=>{Xt(String(h.active.id));},[]),Pa=useCallback(h=>{if(Xt(null),!h.over)return;let A=Ji(String(h.active.id)),F=Ji(String(h.over.id));if(!A||!F||A.kind!=="item"||!A.key)return;if(A.zone===F.zone&&F.kind==="item"){if(A.zone==="rows"){let U=ke.indexOf(A.key),ae=ke.indexOf(F.key??"");U!==-1&&ae!==-1&&U!==ae&&ye(We=>arrayMove(We,U,ae));return}if(A.zone==="columns"){let U=ce.indexOf(A.key),ae=ce.indexOf(F.key??"");U!==-1&&ae!==-1&&U!==ae&&Re(We=>arrayMove(We,U,ae));return}if(A.zone==="filters"){let U=gt.indexOf(A.key),ae=gt.indexOf(F.key??"");U!==-1&&ae!==-1&&U!==ae&&Se(We=>arrayMove(We,U,ae));return}if(A.zone==="values"){let U=Te.findIndex(We=>We.tokenId===A.key),ae=Te.findIndex(We=>We.tokenId===(F.key??""));U!==-1&&ae!==-1&&U!==ae&&he(We=>arrayMove(We,U,ae));}return}let W=F.zone,j=[...ke],le=[...ce],N=[...gt],K=[...Te],R="",Z=null;if(A.zone==="palette")R=A.key;else if(A.zone==="values"){let U=K.find(ae=>ae.tokenId===A.key);if(!U)return;R=U.fieldId,Z=U,K=K.filter(ae=>ae.tokenId!==A.key);}else A.zone==="rows"?(R=A.key,j=j.filter(U=>U!==R)):A.zone==="columns"?(R=A.key,le=le.filter(U=>U!==R)):A.zone==="filters"&&(R=A.key,N=N.filter(U=>U!==R));if(!R)return;let ie=()=>{j=j.filter(U=>U!==R),le=le.filter(U=>U!==R),N=N.filter(U=>U!==R);},$e=U=>{if(F.kind!=="item"||!F.key)return U==="rows"?j.length:U==="columns"?le.length:U==="filters"?N.length:U==="values"?K.length:0;if(U==="rows"){let ae=j.indexOf(F.key);return ae>=0?ae:j.length}if(U==="columns"){let ae=le.indexOf(F.key);return ae>=0?ae:le.length}if(U==="filters"){let ae=N.indexOf(F.key);return ae>=0?ae:N.length}if(U==="values"){let ae=K.findIndex(We=>We.tokenId===F.key);return ae>=0?ae:K.length}return 0};if(W==="palette"){ye(j),Re(le),Se(N),he(K);return}if(W==="values"){let U=$e("values"),ae=Z??Jt(R);K.splice(U,0,ae),ye(j),Re(le),Se(N),he(K);return}if(qp(W)){ie();let U=$e(W);W==="rows"?j.splice(U,0,R):W==="columns"?le.splice(U,0,R):N.splice(U,0,R),ye(j),Re(le),Se(N),he(K);}},[ce,Jt,gt,ke,Te]),Ra=useCallback((h,A)=>{Ce(F=>({...F,[h]:A}));},[]),No=useCallback(h=>{sa(A=>{let F=new Set(A);return F.has(h)?F.delete(h):F.add(h),F});},[]),zo=useCallback(h=>{ca(A=>{let F=new Set(A);return F.has(h)?F.delete(h):F.add(h),F});},[]),lo=useCallback(h=>{let A=E.get(h.fieldId),F=Hl(A);return jsx(FormControl,{size:"small",sx:{minWidth:98},children:jsx(Select,{value:h.aggregation,onChange:W=>Lo(h.tokenId,W.target.value),onClick:W=>W.stopPropagation(),onMouseDown:W=>W.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:F.map(W=>jsx(MenuItem,{value:W,sx:{fontSize:"0.75rem"},children:P(W)},W))})})},[E,P,Lo]),Lt=useCallback(h=>{let A=Wt[h]??[],F=Tt[h]??A;return A.length===0?p("pivot.filter.noValues"):F.length===0?p("pivot.filter.noneSelected"):F.length===A.length?p("pivot.filter.allValues"):p("pivot.filter.selectedCount",{selected:F.length,total:A.length})},[Wt,Tt,p]),Nt=useCallback(h=>{let A=Wt[h]??[],F=Tt[h]??A;return jsx(Xp,{options:A,selectedValues:F,onChange:W=>Ra(h,W)})},[Wt,Tt,Ra]),Da=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Ha=useCallback(()=>{let h={};return new Set([...Et,...Object.keys(Tt)]).forEach(F=>{if(!w.has(F))return;let W=Tt[F]??[];h[F]=[...W];}),{layout:{rows:[...ke],columns:[...ce],filters:[...gt],values:Te.map(F=>({fieldId:F.fieldId,aggregation:F.aggregation}))},filterSelections:h,showGrandTotal:da,chart:{dimensionFieldId:z,primaryValueFieldId:O,secondaryValueFieldId:G,chartType:ue}}},[Et,z,O,G,ue,ce,gt,Tt,ke,da,w,Te]),Ga=useCallback(h=>{let A=dt(h.layout.rows,w),F=dt(h.layout.columns,w),W=dt(h.layout.filters,w),j=new Set,le=(h.layout.values??[]).filter(R=>!w.has(R.fieldId)||j.has(R.fieldId)?false:(j.add(R.fieldId),true)).map(R=>Jt(R.fieldId,R.aggregation)),N={};Object.entries(h.filterSelections??{}).forEach(([R,Z])=>{!w.has(R)||!Array.isArray(Z)||(N[R]=Array.from(new Set(Z.map(ie=>String(ie)))));}),ye(A),Re(F),Se(W),he(le),Ce(N),typeof h.showGrandTotal=="boolean"&&je(h.showGrandTotal),pa(tc(A,F,h.chart?.dimensionFieldId));let K=gs(le,h.chart?.primaryValueFieldId);Ot(K),Yt(ac(le,K,h.chart?.secondaryValueFieldId)),Ta(h.chart?.chartType??"bar-vertical"),$(h.id),I?.(h);},[Jt,I,pa,Ot,Yt,Ta,Re,Se,Ce,ye,je,he,w]),Vo=useCallback(h=>{if(!h){$("");return}let A=se.find(F=>F.id===h);if(!A){$("");return}Ga(A);},[Ga,se]),Oo=useCallback(()=>{let h=p("pivot.preset.defaultName",{index:se.length+1});Oe(h),ne(true);},[se.length,p]),co=useCallback(()=>{let h=pe.trim();if(!h)return;let A={id:Da(),name:h,...Ha()};Ft(F=>[...F,A]),$(A.id),ne(false);},[Ha,Da,pe,Ft]),po=useCallback(()=>{mt&&(Ft(h=>h.filter(A=>A.id!==mt)),$(""));},[mt,Ft]);useEffect(()=>{if(!y||b.current)return;let h=se.find(A=>A.id===y);h&&(b.current=true,Ga(h));},[Ga,y,se]),useEffect(()=>{mt&&(se.some(h=>h.id===mt)||$(""));},[mt,se]);let Ua=useMemo(()=>{if(!da||!Ie||!ke.length)return null;let h={};return Ie.dataColumns.forEach(A=>{let F=Rt.filter(W=>{let j=ce.length>0?ce.map(le=>eo(W[le])):[p("pivot.valueLabel")];return or(j)===A.colKey});h[A.id]=Nr(F,A.valueItem.fieldId,A.valueItem.aggregation);}),{key:"__grand_total__",value:p("pivot.grandTotal")||$p,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:h,path:[],depth:-1}},[da,Ie,Rt,ce,ke.length,p]),ea=useMemo(()=>vu(Ie?.rowTree??[]),[Ie]),Ma=useMemo(()=>vu(Ie?.columnTree??[]),[Ie]);useEffect(()=>{sa(h=>{let A=new Set;return h.has("__grand_total__")&&A.add("__grand_total__"),ea.forEach(F=>{h.has(F)&&A.add(F);}),A});},[ea]),useEffect(()=>{ca(h=>{let A=new Set;return Ma.forEach(F=>{h.has(F)&&A.add(F);}),A});},[Ma]);let mr=useCallback(()=>{sa(h=>{let A=new Set(h);return ea.forEach(F=>A.add(F)),A});},[ea]),Wo=useCallback(()=>{sa(h=>{let A=new Set;return h.has("__grand_total__")&&A.add("__grand_total__"),A});},[]),gr=useCallback(()=>{ca(new Set(Ma));},[Ma]),fr=useCallback(()=>{ca(new Set);},[]),hr=useMemo(()=>!Ie||ce.length===0?[]:Q0(Ie.columnTree,la),[ce.length,la,Ie]),$t=useMemo(()=>{if(!Ie)return [];if(ce.length===0)return Ie.dataColumns.map(A=>({id:A.id,label:A.label,leafColumnIds:[A.id],valueItem:A.valueItem}));let h=new Map(Ie.dataColumns.map(A=>[A.id,A]));return hr.flatMap(A=>{let F=new Map;return A.leafColumnIds.forEach(W=>{let j=h.get(W);if(!j)return;let le=j.valueItem.tokenId,N=`${P(j.valueItem.aggregation)} ${E.get(j.valueItem.fieldId)?.label??j.valueItem.fieldId}`,K=F.get(le);if(K){K.leafColumnIds.push(W);return}F.set(le,{id:`${A.key}::${le}`,label:Te.length>1?N:A.label,leafColumnIds:[W],valueItem:j.valueItem});}),Array.from(F.values())})},[ce.length,E,P,Ie,Te.length,hr]),yr=useMemo(()=>new Map($t.map(h=>[h.id,h])),[$t]),Ka=useMemo(()=>$t.map(h=>({id:h.id,colKey:h.id,valueItem:h.valueItem,label:h.label})),[$t]),Aa=useMemo(()=>{if(!Ie||ce.length===0)return [];let h=[],A=ku(Ie.columnTree,la),F=A+(Te.length>1?1:0),W=(j,le)=>{h[le]??(h[le]=[]),j.forEach(N=>{let K=N.children.length>0&&la.has(N.key),R=$t.filter(ie=>N.leafColumnIds.some($e=>ie.leafColumnIds.includes($e))).length,Z=K||Te.length>1?1:F-le;h[le].push({key:N.key,label:N.label,colSpan:R,rowSpan:Z,expandable:N.children.length>0,expanded:K}),K&&W(N.children,le+1);});};return W(Ie.columnTree,0),Te.length>1&&(h[A]=$t.map(j=>({key:j.id,label:j.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),h},[ce.length,la,Ie,Te.length,$t]),br=useCallback((h,A)=>A.leafColumnIds.reduce((F,W)=>F+(h.aggregatedValues[W]??0),0),[]),$o=useMemo(()=>jsxs(Fragment,{children:[jsx(Button,{size:"small",variant:"text",onClick:mr,disabled:ea.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandRowsAll")}),jsx(Button,{size:"small",variant:"text",onClick:Wo,disabled:ea.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseRowsAll")}),jsx(Divider,{orientation:"vertical",flexItem:true}),jsx(Button,{size:"small",variant:"text",onClick:gr,disabled:Ma.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandColumnsAll")}),jsx(Button,{size:"small",variant:"text",onClick:fr,disabled:ce.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseColumnsAll")})]}),[ce.length,Ma.size,ea.size,fr,Wo,gr,mr,p]),uo=()=>{if(!Me)return null;let h=Ji(Me);if(!h||h.kind!=="item"||!h.key)return null;if(h.zone==="palette"){let j=E.get(h.key);return j?jsx(Ul,{label:j.label,subtitle:j.type}):null}if(h.zone==="values"){let j=Te.find(R=>R.tokenId===h.key);if(!j)return null;let N=E.get(j.fieldId)?.label??j.fieldId,K=`${P(j.aggregation)}(${N})`;return jsx(ns,{label:N,caption:K})}let F=E.get(h.key)?.label??h.key,W=Lt(h.key);return jsx(ns,{label:F,caption:W})};return jsxs(Paper,{sx:h=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${h.palette.divider}`,bgcolor:"background.paper",boxShadow:h.palette.mode==="dark"?"none":"0 12px 28px rgba(15, 23, 42, 0.08)",display:"flex",flexDirection:"column",gap:2}),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:800},children:x}),jsx(Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:p("pivot.subtitle.default")})]}),jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[Pe&&jsxs(Fragment,{children:[jsx(FormControl,{size:"small",sx:{minWidth:200},children:jsxs(Select,{value:mt,displayEmpty:true,onChange:h=>Vo(String(h.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("pivot.preset.selectPlaceholder")}),se.map(h=>jsx(MenuItem,{value:h.id,sx:{fontSize:"0.75rem"},children:h.name},h.id))]})}),jsx(Tooltip,{title:p("pivot.preset.save"),children:jsx(IconButton,{size:"small",onClick:Oo,"aria-label":p("pivot.preset.save"),children:jsx(Ud,{sx:{fontSize:18}})})}),jsx(Tooltip,{title:p("pivot.preset.delete"),children:jsx("span",{children:jsx(IconButton,{size:"small",onClick:po,disabled:!mt,"aria-label":p("pivot.preset.delete"),children:jsx($0,{sx:{fontSize:18}})})})}),jsx(Divider,{flexItem:true,orientation:"vertical"})]}),jsxs(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[p("pivot.records"),": ",jsx("strong",{children:t.length.toLocaleString()})," / ",p("pivot.afterFilter"),":"," ",jsx("strong",{children:Rt.length.toLocaleString()})]}),jsx(Divider,{flexItem:true,orientation:"vertical"}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsx(Typography,{sx:{fontSize:"0.74rem"},children:p("pivot.grandTotal")}),jsx(Switch,{size:"small",checked:da,onChange:h=>je(h.target.checked)})]})]})]}),jsx(Divider,{}),jsxs(DndContext,{sensors:C,collisionDetection:closestCenter,onDragStart:$a,onDragEnd:Pa,children:[jsx(nu,{isConfiguratorCollapsed:Mo,onToggleCollapse:()=>Pt(h=>!h),availableFields:Bo,fieldMap:E,filterFields:gt,columnFields:ce,rowFields:ke,valueFields:Te,clearZone:Fo,removeFieldFromZone:Eo,getFilterSelectionSummary:Lt,renderDimensionFilterSelect:Nt,renderAggregationSelect:lo,getAggregationLabel:P}),jsx(Portal,{children:jsx(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:uo()})})]}),jsx(mu,{rows:Rt,fieldMap:E,rowFields:ke,columnFields:ce,valueFields:Te,chartDimensionFieldId:z,chartPrimaryValueFieldId:O,chartSecondaryValueFieldId:G,chartType:ue,isCollapsed:fe,onChartDimensionFieldIdChange:h=>pa(h),onChartPrimaryValueFieldIdChange:h=>Ot(h),onChartSecondaryValueFieldIdChange:h=>Yt(h),onChartTypeChange:h=>Ta(h),onToggleCollapse:()=>Ao(h=>!h),getAggregationLabel:P}),jsx($r,{title:p("pivot.table.sectionTitle"),subtitle:ke.length>0?ke.map(h=>E.get(h)?.label??h).join(" > "):p("pivot.table.dimensions"),collapsed:we,onToggleCollapse:()=>so(h=>!h),expandAriaLabel:p("pivot.table.collapse.ariaExpand"),collapseAriaLabel:p("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:$o,children:Ie===null?jsx(Box,{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:k})}):jsx(TableContainer,{sx:{maxHeight:i},children:jsxs(Table,{size:"small",stickyHeader:true,children:[jsx(TableHead,{children:(Aa.length>0?Aa:[[]]).map((h,A)=>jsxs(TableRow,{children:[A===0&&jsx(TableCell,{rowSpan:Math.max(Aa.length,1),sx:F=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:F.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${F.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:ke.length>0?ke.map(F=>E.get(F)?.label).join(" > "):p("pivot.table.dimensions")}),(h.length>0?h:$t.map(F=>({key:F.id,label:F.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(F=>jsx(TableCell,{align:"center",colSpan:F.colSpan,rowSpan:F.rowSpan,sx:W=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:W.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${W.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxs(Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[F.expandable&&jsx(IconButton,{size:"small",onClick:()=>zo(F.key),sx:{p:.1,ml:-0.3},children:F.expanded?jsx(af,{sx:{fontSize:16}}):jsx(Og,{sx:{fontSize:16}})}),jsx(Box,{component:"span",children:F.label})]})},F.key))]},`pivot-header-row-${A}`))}),jsxs(TableBody,{children:[Ie.rowTree.map(h=>jsx(ps,{node:h,dataColumns:Ka,fieldMap:E,level:0,expandedKeys:ia,onToggle:No,getValue:(A,F)=>{let W=yr.get(F);return W?br(A,W):0}},h.key)),Ua&&jsx(ps,{node:Ua,dataColumns:Ka,fieldMap:E,level:0,expandedKeys:ia,onToggle:No,getValue:(h,A)=>{let F=yr.get(A);return F?br(h,F):0}})]})]})})}),jsxs(Dialog,{open:de,onClose:()=>ne(false),maxWidth:"xs",fullWidth:true,children:[jsx(DialogTitle,{children:p("pivot.preset.saveDialogTitle")}),jsx(DialogContent,{children:jsx(TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:p("pivot.preset.nameLabel"),value:pe,onChange:h=>Oe(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),co());}})}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>ne(false),children:p("common.cancel")}),jsx(Button,{variant:"contained",onClick:co,disabled:!pe.trim(),children:p("common.save")})]})]})]})};var Su=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},rc=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",wu=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",l2=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:a=true,initialConfiguratorCollapsed:r=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=useRef(0),s=useMemo(()=>new Set(e.map($=>$.id)),[e]),l=useMemo(()=>new Map(e.map($=>[$.id,$])),[e]),[g,f]=useState(()=>dt(t?.rows,s)),[u,y]=useState(()=>dt(t?.columns,s)),[I,p]=useState(()=>dt(t?.filters,s)),[C,m]=useState(()=>{let $=t?.values??[],de=new Set,ne=[];return $.forEach(pe=>{!s.has(pe.fieldId)||de.has(pe.fieldId)||(de.add(pe.fieldId),d.current+=1,ne.push({tokenId:`v${d.current}`,fieldId:pe.fieldId,aggregation:Dt(pe.aggregation,l.get(pe.fieldId))}));}),ne}),[b,x]=useState(o),[k,L]=useState(a),[P,w]=useState(r),[E,T]=useState(()=>Su(dt(t?.rows,s),dt(t?.columns,s),n?.dimensionFieldId)),[v,M]=useState(()=>{let $=(()=>{let de=t?.values??[],ne=new Set,pe=[];return de.forEach(Oe=>{!s.has(Oe.fieldId)||ne.has(Oe.fieldId)||(ne.add(Oe.fieldId),pe.push({tokenId:Oe.fieldId,fieldId:Oe.fieldId,aggregation:Dt(Oe.aggregation,l.get(Oe.fieldId))}));}),pe})();return rc($,n?.primaryValueFieldId)}),[S,D]=useState(()=>{let $=(()=>{let ne=t?.values??[],pe=new Set,Oe=[];return ne.forEach(Me=>{!s.has(Me.fieldId)||pe.has(Me.fieldId)||(pe.add(Me.fieldId),Oe.push({tokenId:Me.fieldId,fieldId:Me.fieldId,aggregation:Dt(Me.aggregation,l.get(Me.fieldId))}));}),Oe})(),de=rc($,n?.primaryValueFieldId);return wu($,de,n?.secondaryValueFieldId)}),[B,H]=useState(n?.chartType??"bar-vertical"),[V,_]=useState(i),[Y,ee]=useState(c);useEffect(()=>{f($=>{let de=$.filter(ne=>s.has(ne));return to($,de)?$:de}),y($=>{let de=$.filter(ne=>s.has(ne));return to($,de)?$:de}),p($=>{let de=$.filter(ne=>s.has(ne));return to($,de)?$:de}),m($=>{let de=$.filter(ne=>s.has(ne.fieldId)).map(ne=>({...ne,aggregation:Dt(ne.aggregation,l.get(ne.fieldId))}));return es($,de)?$:de});},[l,s]),useEffect(()=>{T($=>Su(g,u,$));},[u,g]),useEffect(()=>{M($=>rc(C,$));},[C]),useEffect(()=>{D($=>wu(C,v,$));},[v,C]);let te=useCallback($=>{f(dt($,s));},[s]),oe=useCallback($=>{y(dt($,s));},[s]),Bt=useCallback($=>{p(dt($,s));},[s]),lt=useCallback($=>{m(de=>{let ne=$??[],pe=new Set,Oe=[];return ne.forEach(Me=>{if(!s.has(Me.fieldId)||pe.has(Me.fieldId))return;pe.add(Me.fieldId);let Xt=de.find(ia=>ia.fieldId===Me.fieldId);if(Xt){Oe.push({...Xt,aggregation:Dt(Me.aggregation??Xt.aggregation,l.get(Me.fieldId))});return}d.current+=1,Oe.push({tokenId:`v${d.current}`,fieldId:Me.fieldId,aggregation:Dt(Me.aggregation,l.get(Me.fieldId))});}),Oe});},[l,s]),Ke=useCallback($=>{te($.rows??[]),oe($.columns??[]),Bt($.filters??[]),lt($.values??[]);},[oe,Bt,te,lt]),ge=useCallback($=>{if($==="rows")return f([]);if($==="columns")return y([]);if($==="filters")return p([]);m([]);},[]),De=useCallback(($,de)=>{if($==="rows")return f(ne=>ne.filter(pe=>pe!==de));if($==="columns")return y(ne=>ne.filter(pe=>pe!==de));if($==="filters")return p(ne=>ne.filter(pe=>pe!==de));m(ne=>ne.filter(pe=>pe.tokenId!==de));},[]),Fe=useCallback(($,de)=>{m(ne=>ne.map(pe=>pe.tokenId===$?{...pe,aggregation:Dt(de,l.get(pe.fieldId))}:pe));},[l]),Je=useCallback(($,de)=>{x(ne=>({...ne,[$]:de}));},[]),It=useCallback(()=>{x({});},[]),qe=useCallback(()=>{L($=>!$);},[]),rt=useCallback(()=>{w($=>!$);},[]),Oa=useCallback($=>{T($);},[]),ka=useCallback($=>{M($);},[]),Sa=useCallback($=>{D($);},[]),wa=useCallback(()=>{_($=>!$);},[]),Ia=useCallback(()=>{ee($=>!$);},[]);return {model:useMemo(()=>({rowFields:g,setRowFields:f,columnFields:u,setColumnFields:y,filterFields:I,setFilterFields:p,valueFields:C,setValueFields:m,filterSelections:b,setFilterSelections:x,showGrandTotal:k,setShowGrandTotal:L,isConfiguratorCollapsed:P,setIsConfiguratorCollapsed:w,chartDimensionFieldId:E,setChartDimensionFieldId:T,chartPrimaryValueFieldId:v,setChartPrimaryValueFieldId:M,chartSecondaryValueFieldId:S,setChartSecondaryValueFieldId:D,chartType:B,setChartType:H,isChartCollapsed:V,setIsChartCollapsed:_,isTableCollapsed:Y,setIsTableCollapsed:ee}),[E,v,S,B,u,I,b,V,P,Y,g,k,C]),actions:{setRows:te,setColumns:oe,setFilters:Bt,setValues:lt,setLayout:Ke,clearZone:ge,removeFieldFromZone:De,setAggregationForValue:Fe,setFilterSelection:Je,resetFilterSelections:It,toggleGrandTotal:qe,toggleConfigurator:rt,setChartDimension:Oa,setChartPrimaryValue:ka,setChartSecondaryValue:Sa,setChartType:H,toggleChart:wa,toggleTable:Ia}}};var m2=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let a=useTheme$1(),r=useMediaQuery("(orientation: portrait)",{noSsr:true}),n=useMediaQuery(a.breakpoints.down("md"),{noSsr:true}),i=useMemo(()=>e==="auto"?r||n?"portrait":"landscape":e,[n,r,e]),[c,d]=useState(t??i==="landscape");useEffect(()=>{d(t??i==="landscape");},[t,i]);let s=g=>{d(g),o?.(g);};return {resolvedOrientation:i,isPortraitViewport:r,isCompactViewport:n,navigationOpen:c,setNavigationOpen:s,toggleNavigationOpen:()=>s(!c)}};var ov=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},h2=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:a})=>{let n=e[0]?.[t],[i,c]=useState(a??n),d=useMemo(()=>e.find(u=>u[t]===i)||e[0],[t,e,i]),[s,l]=useState(()=>{let u=d?.[o];return u==null?"0":String(u)});return {selectedId:i,selectedRecord:d,editorValue:s,setEditorValue:l,selectRecord:u=>{let y=u[t];c(y);let I=u[o];l(I==null?"0":String(I));},applyEditorValue:u=>{if(i===void 0)return;let y=ov(s),I=e.map(p=>p[t]===i?{...p,[o]:y}:p);u(I);}}};var gv=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Mu=(e,t,o,a)=>{t?.(e),a&&o?.();},k2=({open:e,onClose:t,title:o="Scan barcode",subtitle:a="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:r=gv,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:s="Use code",cancelLabel:l="Close",manualPlaceholder:g="Enter barcode manually",onDetected:f,onError:u,sx:y})=>{let I=ut__default.useRef(null),p=ut__default.useRef(null),C=ut__default.useRef(null),m=ut__default.useRef(null),[b,x]=ut__default.useState("idle"),[k,L]=ut__default.useState(""),[P,w]=ut__default.useState(null),[E,T]=ut__default.useState(null),v=ut__default.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null),p.current&&(p.current.getTracks().forEach(D=>D.stop()),p.current=null),I.current&&(I.current.srcObject=null);},[]),M=ut__default.useCallback(D=>{T(D),x("error"),u?.(D);},[u]);ut__default.useEffect(()=>{if(!e){v(),x("idle"),T(null),L("");return}let D=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){x("unsupported"),T("Camera access is not supported in this browser.");return}x("starting"),T(null);try{let H=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(D){H.getTracks().forEach(V=>V.stop());return}if(p.current=H,I.current&&(I.current.srcObject=H,await I.current.play()),!window.BarcodeDetector){x("unsupported"),T("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}m.current=new window.BarcodeDetector({formats:r}),x("ready"),C.current=window.setInterval(async()=>{if(!(!I.current||!m.current)&&!(I.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let _=(await m.current.detect(I.current)).find(ee=>ee.rawValue);if(!_?.rawValue)return;let Y={rawValue:_.rawValue,format:_.format};w(Y),v(),Mu(Y,f,t,c);}catch(V){M(V instanceof Error?V.message:"Failed to detect barcode.");}},d);}catch(H){M(H instanceof Error?H.message:"Unable to start camera.");}}})(),()=>{D=true,v();}},[c,n,r,t,f,e,M,d,v]);let S=()=>{let D=k.trim();if(!D)return;let B={rawValue:D,format:"manual"};w(B),Mu(B,f,t,c);};return jsxs(Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"sm",children:[jsx(DialogTitle,{sx:{fontSize:"1rem",fontWeight:900},children:o}),jsx(DialogContent,{sx:{pt:"8px !important"},children:jsxs(Stack,{spacing:2,sx:y,children:[jsx(Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:a}),jsxs(Paper,{elevation:0,sx:D=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:D.palette.mode==="dark"?"linear-gradient(180deg, rgba(15,23,42,0.92), rgba(2,6,23,0.96))":"linear-gradient(180deg, rgba(241,245,249,1), rgba(226,232,240,0.92))"}),children:[jsx("video",{ref:I,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),jsx(Box,{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(Box,{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:jsx(Box,{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"#38bdf8",boxShadow:"0 0 18px rgba(56,189,248,0.85)"}})})}),jsxs(Box,{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[jsx(Chip,{icon:jsx(uv,{}),label:b==="ready"?"Camera ready":b==="starting"?"Starting camera":b==="unsupported"?"Preview only":b==="error"?"Scanner error":"Idle",size:"small",color:b==="error"?"error":"primary",variant:"filled"}),P?jsx(Chip,{icon:jsx(mv,{}),label:`${P.format||"barcode"}: ${P.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),E?jsx(Alert,{severity:b==="unsupported"?"info":"warning",children:E}):null,i?jsxs(Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsx(TextField,{fullWidth:true,label:"Barcode",placeholder:g,value:k,onChange:D=>L(D.target.value)}),jsx(Button,{variant:"contained",onClick:S,sx:{minHeight:56,px:2.5},children:s})]}):null]})}),jsx(DialogActions,{sx:{px:3,pb:2},children:jsx(Button,{onClick:t,children:l})})]})};var bv={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},R2=({title:e,description:t,kicker:o,icon:a,badges:r=[],metrics:n=[],footer:i,children:c,selected:d=false,draggable:s=false,isDragging:l=false,swipeThreshold:g=88,startAction:f,endAction:u,dragHandleProps:y,onClick:I,onSwipe:p,sx:C})=>{let[m,b]=useState(0),[x,k]=useState(false),L=useRef(null),P=useRef(0),w=useRef(0),E=!!(f||u),T=132,v=()=>{b(0),k(false),L.current=null,P.current=0,w.current=0;},M=V=>{(V==="start"?f:u)?.onTrigger?.(),p?.(V),v();},S=V=>{!E||V.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(L.current=V.pointerId,P.current=V.clientX,w.current=V.clientX,k(true),V.currentTarget.setPointerCapture(V.pointerId));},D=V=>{if(!x||L.current!==V.pointerId)return;w.current=V.clientX;let _=w.current-P.current,Y=Math.max(-T,Math.min(T,_));b(Y);},B=V=>{if(!x||L.current!==V.pointerId)return;let _=w.current-P.current;if(_>=g&&f){M("start");return}if(_<=-g&&u){M("end");return}Math.abs(_)<12&&I?.(),v();},H=(V,_)=>{if(!V)return null;let Y=V.backgroundColor||bv[V.tone||"default"];return jsx(Box,{sx:{position:"absolute",top:0,bottom:0,[_]:0,width:T,px:2,display:"flex",alignItems:"center",justifyContent:_==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${Y}, rgba(15,23,42,0.92))`},children:jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[V.icon,jsx(Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:V.label})]})})};return jsxs(Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...C},children:[H(f,"left"),H(u,"right"),jsx(Paper,{elevation:0,onPointerDown:S,onPointerMove:D,onPointerUp:B,onPointerCancel:v,sx:V=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:V.palette.mode==="dark"?"linear-gradient(180deg, rgba(17,24,39,0.96), rgba(15,23,42,0.92))":"linear-gradient(180deg, #ffffff, #f8fafc)",boxShadow:d?"0 18px 42px rgba(37, 99, 235, 0.18)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${m}px, 0, 0) scale(${l?.985:1})`,transition:x?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:I?"pointer":"default",opacity:l?.9:1}),children:jsxs(Stack,{spacing:1.5,children:[jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[a?jsx(Box,{sx:{mt:.25},children:a}):null,jsxs(Box,{sx:{flex:1,minWidth:0},children:[o?jsx(Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:e}),t?jsx(Typography,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:t}):null]}),s?jsx(Box,{"data-no-swipe":"true",...y,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsx(IconButton,{size:"small",children:jsx(yv,{})})}):null]}),r.length>0?jsx(Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((V,_)=>jsx(Chip,{label:V,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover"}},_))}):null,n.length>0?jsx(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(V=>jsxs(Paper,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider"},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:V.label}),jsx(Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:V.value})]},V.id))}):null,c,i]})})]})};var Hn=({label:e,onPress:t,emphasis:o="default"})=>jsx(Box,{component:"button",type:"button",onClick:t,sx:a=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?a.palette.primary.main:o==="danger"?a.palette.mode==="dark"?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.10)":a.palette.mode==="dark"?"rgba(255,255,255,0.04)":"#fff",color:o==="primary"?"#fff":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:e}),z2=({value:e,defaultValue:t="",title:o,subtitle:a,placeholder:r="0",allowDecimal:n=false,allowNegative:i=false,maxLength:c,confirmLabel:d,clearLabel:s,backspaceLabel:l,onChange:g,onSubmit:f,onClose:u,sx:y})=>{let{t:I}=q(),[p,C]=useState(t),m=e??p,b=v=>{e===void 0&&C(v),g?.(v);},x=v=>{c&&m.length>=c||b(`${m}${v}`);},k=v=>{if(v==="00"){if(!m){b("0");return}x("00");return}x(v);},L=()=>{!n||m.includes(".")||b(m?`${m}.`:"0.");},P=()=>{if(i){if(m.startsWith("-")){b(m.slice(1));return}b(m?`-${m}`:"-");}},w=()=>{b(m.slice(0,-1));},E=()=>{b("");},T=()=>{f?.(m);};return jsx(Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",background:"background.paper",...y},children:jsxs(Stack,{spacing:2,children:[jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxs(Box,{sx:{minWidth:0},children:[o?jsx(Typography,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,a?jsx(Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:a}):null]}),u?jsx(IconButton,{onClick:u,size:"small",children:jsx(kv,{})}):null]}),jsx(Paper,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsx(Typography,{sx:{minHeight:38,fontSize:m?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:m?"text.primary":"text.disabled"},children:m||r})}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(v=>jsx(Hn,{label:v,onPress:()=>k(v)},v)),jsx(Hn,{label:i?"+/-":"00",onPress:i?P:()=>k("00")}),jsx(Hn,{label:"0",onPress:()=>k("0")}),jsx(Hn,{label:n?".":l?String(l):"DEL",onPress:n?L:w})]}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[jsx(Box,{component:"button",type:"button",onClick:w,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",background:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsx(Cv,{}),jsx(Typography,{sx:{fontWeight:700},children:l||"DEL"})]})}),jsx(Hn,{label:String(s||"CLR"),onPress:E,emphasis:"danger"}),jsx(Box,{component:"button",type:"button",onClick:T,sx:v=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:v.palette.primary.main,color:"#fff",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsx(Sv,{}),jsx(Typography,{sx:{fontWeight:800},children:d||I("common.ok")})]})})]})]})})};var Lu=({touchMode:e="comfortable",sx:t,...o})=>{let a=e==="expanded";return jsx(Box,{sx:{"& .MuiPaper-root":{borderRadius:4},"& .MuiAutocomplete-root":{minWidth:{xs:"100%",md:260}},"& .MuiInputBase-root":{minHeight:a?56:50,borderRadius:3,fontSize:a?"0.98rem":"0.92rem"},"& .MuiInputBase-input":{py:a?1.6:1.25,fontSize:a?"0.98rem":"0.92rem"},"& .MuiInputLabel-root":{fontSize:a?"0.95rem":"0.88rem"},"& .MuiButton-root":{minHeight:a?48:44,px:a?2.25:1.75,borderRadius:3,fontSize:a?"0.95rem":"0.88rem",fontWeight:700},"& .MuiIconButton-root":{width:a?40:36,height:a?40:36},"& .MuiMenuItem-root":{minHeight:a?44:38,fontSize:a?"0.95rem":"0.88rem"},"& .MuiListSubheader-root":{py:1},"& .MuiCheckbox-root":{p:a?1:.75},"& .MuiFormControlLabel-label":{fontSize:a?"0.95rem":"0.88rem"},"& .MuiDialog-paper":{borderRadius:4},"& .MuiDialogTitle-root":{fontSize:a?"1.05rem":"0.98rem",fontWeight:800},"& .MuiDialogContent-root .MuiInputBase-root":{minHeight:52},'& .MuiGrid-root > .MuiGrid-item, & .MuiGrid-root > .MuiGrid-sizeXs-1, & .MuiGrid-root > [class*="MuiGrid-grid-"]':{minWidth:0},...t},children:jsx(Qo,{...o})})};var Rv=(e,t,o)=>{if(o?.(t),!!t.href){if(t.href.startsWith("http://")||t.href.startsWith("https://")){window.open(t.href,"_blank");return}e.push(t.href);}},Vu=({items:e,selectedId:t,orientation:o="auto",onItemSelect:a,sx:r})=>{let n=useTheme$1(),i=useMediaQuery("(orientation: portrait)"),c=useMediaQuery(n.breakpoints.down("md")),d=o==="auto"?i||c?"portrait":"landscape":o,s=useRouter();return jsx(Box,{sx:{display:"grid",gridTemplateColumns:d==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...r},children:e.map(l=>{let g=l.id===t,f=l.color||(g?n.palette.primary.main:n.palette.divider);return jsx(Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:g?"primary.main":"divider",boxShadow:g?"0 18px 40px rgba(37, 99, 235, 0.16)":"none"},children:jsx(Box,{component:"button",type:"button",disabled:l.disabled,onClick:()=>Rv(s,l,a),sx:{width:"100%",p:2,minHeight:d==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:l.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:jsxs(Stack,{spacing:1.5,sx:{height:"100%"},children:[jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsx(Box,{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:g?"#fff":"text.primary",background:g?f:"action.hover"},children:l.icon||jsx(Typography,{sx:{fontSize:"1rem",fontWeight:900},children:l.title.slice(0,1).toUpperCase()})}),l.badge!==void 0?jsx(Box,{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:g?"primary.main":"action.hover",color:g?"#fff":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:l.badge}):null]}),jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:l.title}),l.caption?jsx(Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:l.caption}):null,l.description?jsx(Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:l.description}):null]})]})})},l.id)})})};var Hu=(e,t)=>t.trim()?e.reduce((o,a)=>{let r=a.title?.toLowerCase().includes(t.toLowerCase())||a.label?.toLowerCase().includes(t.toLowerCase())||a.description?.toLowerCase().includes(t.toLowerCase()),n=a.children?Hu(a.children,t):[];return (r||n.length>0)&&o.push({...a,children:n.length>0?n:a.children}),o},[]):e,$v=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children?.length&&(t.add(r.id),o(r.children));});};return o(e),t},Gu=({collapsed:e=false,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light",orientation:i="auto",headerSlot:c,footerSlot:d,activeHref:s,onItemSelect:l})=>{let{t:g}=q(),f=useTheme$1(),u=useMediaQuery("(orientation: portrait)"),y=useMediaQuery(f.breakpoints.down("md")),I=i==="auto"?u||y?"portrait":"landscape":i,p=n==="dark",C=useRouter(),m=usePathname(),[b,x]=useState(""),[k,L]=useState(new Set),P=useMemo(()=>Hu(r,b),[r,b]),w=useMemo(()=>b.trim()?$v(P):k,[k,P,b]);useEffect(()=>{e&&L(new Set);},[e]);let E=D=>D.appurl||D.href||"",T=D=>{l?.(D);let B=E(D);if(B){if(B.startsWith("http://")||B.startsWith("https://")){window.open(B,"_blank");return}C.push(B);}},v=D=>{let B=!!D.children?.length;if(e&&B){t?.();return}if(B){L(H=>{let V=new Set(H);return V.has(D.id)?V.delete(D.id):V.add(D.id),V});return}T(D);},M=D=>{let B=s||m,H=E(D);return !!(H&&B===H)},S=(D,B=0)=>{let H=!!D.children?.length,V=w.has(D.id),_=M(D);return jsx(Box,{sx:{pl:B===0?0:1.5},children:jsxs(Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:_?"primary.main":"divider",bgcolor:_?"action.selected":"background.paper"},children:[jsxs(Box,{component:"button",type:"button",onClick:()=>v(D),sx:{width:"100%",px:1.5,py:1.4,display:"flex",alignItems:"center",gap:1.25,border:0,background:"transparent",textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:[jsx(Avatar,{variant:"rounded",sx:{width:40,height:40,bgcolor:_?"primary.main":"action.hover",color:_?"#fff":"text.primary"},children:D.icon||(D.title||D.label||"?").slice(0,1).toUpperCase()}),jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:D.title||D.label}),D.description?jsx(Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:D.description}):null]}),H?jsx(Ov,{sx:{transform:V?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsx(Wv,{color:"action"})]}),H?jsx(Collapse,{in:V,children:jsx(Box,{sx:{px:1.25,pb:1.25},children:D.children?.map(Y=>S(Y,B+1))})}):null]})},D.id)};return e?jsx(Paper,{elevation:0,className:o,sx:{width:I==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:p?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}px`:void 0,overflowY:"auto"},children:jsxs(Stack,{spacing:1,children:[jsx(IconButton,{onClick:t,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:g("navigation.expand"),children:jsx(Vv,{})}),r.map(D=>jsx(IconButton,{onClick:()=>v(D),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:M(D)?"primary.main":"action.hover",color:M(D)?"#fff":"text.primary"},children:D.icon||(D.title||D.label||"?").slice(0,1).toUpperCase()},D.id))]})}):jsx(Paper,{elevation:0,className:o,sx:{width:I==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:p?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxs(Stack,{spacing:1.25,sx:{flex:1,minHeight:0},children:[jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsx(TextField,{value:b,onChange:D=>x(D.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsx(Nv,{fontSize:"small",color:"action"})}}),I==="landscape"?jsx(IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsx(zv,{})}):null]}),c,jsx(Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:P.length>0?P.map(D=>S(D)):jsx(Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),d]})})};var Xu=(e,t)=>{let o=t[e.id];if(e.render)return e.render(o,t);if(o==null||o==="")return "--";if(e.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},_v=e=>ut__default.isValidElement(e)?jsx(Box,{sx:{display:"inline-flex",alignItems:"center"},children:e}):jsx(Typography,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:e}),Zv=(e,t)=>{let o=t[e.id];if(o==null||o==="")return "--";if(e.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},jv=({summaryRow:e,visibleColumns:t,columns:o})=>{let a=o.filter(r=>t.includes(r.id)&&e[r.id]!=="");return a.length===0?null:jsx(Paper,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxs(Stack,{spacing:1,children:[jsx(Typography,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:a.map(r=>jsxs(Paper,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:r.label}),jsx(Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[r.id]})]},`summary-${r.id}`))})]})})},Qv=e=>{let{t}=q(),o=useTheme$1(),{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:s,fitContainer:l=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:y=[20,50,100,-1],onLayoutSave:I,filterConfig:p,rowKey:C,tableKey:m="default",graphReport:b,quickCreate:x,quickEdit:k,quickDelete:L,serviceUrl:P,orientation:w="auto",cardTitleField:E,cardSubtitleFields:T,toolbarSlot:v,emptyState:M,rowHeight:S="comfortable",cardActionSlot:D,renderCardFooter:B,onRowClick:H}=e,V=a||t("table.title.default"),_=useMediaQuery("(orientation: portrait)"),Y=useMediaQuery(o.breakpoints.down("md")),ee=w==="auto"?_||Y?"portrait":"landscape":w,{columns:te,filterText:oe,setFilterText:Bt,visibleColumns:lt,showSummary:Ke,setShowSummary:ge,summaryColumns:De,grouping:Fe,setGrouping:Je,expandedGroups:It,groupAnchorEl:qe,setGroupAnchorEl:rt,summaryAnchorEl:Oa,setSummaryAnchorEl:ka,anchorEl:Sa,setAnchorEl:wa,contextMenu:Ia,sortedAndFilteredRows:mt,summaryRow:$,visibleRows:de,page:ne,setPage:pe,rowsPerPage:Oe,setRowsPerPage:Me,totalDisplayCount:Xt,setSelected:ia,handleClick:sa,toggleSummaryColumn:la,handleExport:ca,handleCloseContextMenu:ke,toggleColumnVisibility:ce,toggleGroupExpand:gt,toggleGroupField:Te,handleExpandGroupRecursively:Tt,handleCollapseGroupRecursively:da,handleLayoutLoad:Mo,handleVariantLoad:z,handleLayoutSave:O,effectiveAppId:G,currentLayoutData:ue,currentLayoutId:fe,layoutIdToLoad:we,graphReportOpen:se,handleOpenGraphReport:Pe,handleCloseGraphReport:ye}=Fi(e),Re=b?.enabled??false,Se=Re&&(b?.interaction?.enabled??true),he=vi(),Ce=C||"id",je=ut__default.useMemo(()=>{let R=new Set(i);return mt.filter(Z=>R.has(Z?.[Ce]))},[Ce,i,mt]),Pt=je.length===1?je[0]:null,pa=!!x?.enabled,Ot=!!k?.enabled,Yt=!!L?.enabled,Ta=x?.fields,Ao=x?.excludeFields||[],so=x?.initialValues||{},Ft=k?.fields,Wa=k?.excludeFields||[],Bo=k?.editableFields||[],Et=k?.nonEditableFields||[],Wt=k?.primaryKeys?.length?k.primaryKeys:[Ce],[Rt,Ie]=ut__default.useState(false),[Jt,Fo]=ut__default.useState(false),[Eo,Lo]=ut__default.useState({}),[$a,Pa]=ut__default.useState(false),[Ra,No]=ut__default.useState(false),[zo,lo]=ut__default.useState({}),[Lt,Nt]=ut__default.useState(false),[Da,Ha]=ut__default.useState(false),Ga=u||Jt||Ra||Da,Vo=ut__default.useMemo(()=>{let R=[...te];if(Array.isArray(Ta)&&Ta.length>0){let Z=new Set(Ta);R=R.filter(ie=>Z.has(ie.id));}if(Ao.length>0){let Z=new Set(Ao);R=R.filter(ie=>!Z.has(ie.id));}return R.filter(Z=>!!Z?.id)},[te,Ao,Ta]),Oo=ut__default.useMemo(()=>{let R=[...te];if(Array.isArray(Ft)&&Ft.length>0){let Z=new Set(Ft);R=R.filter(ie=>Z.has(ie.id));}if(Wa.length>0){let Z=new Set(Wa);R=R.filter(ie=>!Z.has(ie.id));}return R.filter(Z=>!!Z?.id)},[te,Wa,Ft]),co=ut__default.useMemo(()=>new Set(Wt),[Wt]),po=ut__default.useMemo(()=>new Set(Bo),[Bo]),Ua=ut__default.useMemo(()=>new Set(Et),[Et]),ea=ut__default.useCallback(R=>po.size>0?po.has(R):!(Ua.has(R)||co.has(R)),[po,Ua,co]);ut__default.useEffect(()=>{!se&&he.hasActiveFilters&&he.clearAll();},[he,se]);let Ma=()=>{let R={};Vo.forEach(Z=>{R[Z.id]=so[Z.id]??"";}),Lo(R),Ie(true);},mr=(R,Z)=>{Lo(ie=>({...ie,[R]:Z}));},Wo=async()=>{if(!x?.onSubmit){Ie(false);return}try{Fo(!0),await x.onSubmit(Eo),Ie(!1);}finally{Fo(false);}},gr=()=>{if(!Pt)return;let R={};Oo.forEach(ie=>{R[ie.id]=Pt[ie.id]??"";});let Z=k?.getInitialValues?{...R,...k.getInitialValues(Pt)}:R;lo(Z),Pa(true);},fr=(R,Z)=>{lo(ie=>({...ie,[R]:Z}));},hr=async()=>{if(Pt){if(!k?.onSubmit){Pa(false);return}try{No(!0),await k.onSubmit(zo,Pt),Pa(!1);}finally{No(false);}}},$t=()=>{je.length!==0&&Nt(true);},yr=async()=>{if(je.length===0){Nt(false);return}if(!L?.onConfirm){Nt(false),ia([]),c?.([]);return}try{Ha(!0),await L.onConfirm(je),Nt(!1),ia([]),c?.([]);}finally{Ha(false);}},Ka=mt,{fieldMapping:Aa}=Dr({rows:Ka,config:{...b,title:b?.title||`${V} ${t("graph.reportTitle")}`}}),br=ut__default.useMemo(()=>Se?he.applyRows(Ka,Aa):Ka,[Aa,he,Se,Ka]),{model:$o}=Dr({rows:br,config:{...b,title:b?.title||`${V} ${t("graph.reportTitle")}`,fieldMapping:Aa}}),uo=$o.table.columns.map(R=>({id:R.id,label:R.label,align:R.align||"left",minWidth:120,numeric:R.align==="right"})),h=G?jsx(Mi,{appId:G,tableKey:m,currentLayoutData:ue,onLayoutLoad:Mo,targetLayoutId:we,activeLayoutId:fe,serviceUrl:P??p?.serviceUrl}):null,A=te.filter(R=>lt.includes(R.id)),F=A.find(R=>R.id===E)||A[0],W=T?.map(R=>A.find(Z=>Z.id===R)).filter(Boolean)||A.filter(R=>R.id!==F?.id).slice(0,ee==="portrait"?2:3),j=A.filter(R=>R.id!==F?.id&&!W.some(Z=>Z.id===R.id)),le=[v,s].filter(Boolean),N=jsxs(Fragment,{children:[jsx(Jn,{groupAnchorEl:qe,setGroupAnchorEl:rt,grouping:Fe,setGrouping:Je,columns:te,toggleGroupField:Te}),jsx(ei,{anchorEl:Sa,setAnchorEl:wa,columns:te,visibleColumns:lt,toggleColumnVisibility:ce}),jsx(ti,{anchorEl:Oa,setAnchorEl:ka,showSummary:Ke,setShowSummary:ge,columns:te,summaryColumns:De,toggleSummaryColumn:la}),jsx(ai,{contextMenu:Ia,handleCloseContextMenu:ke,columns:te,visibleColumns:lt,toggleColumnVisibility:ce})]}),K=(R,Z)=>{let ie=i.includes(Z),$e=ee==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))";return jsx(Paper,{elevation:0,onClick:()=>{sa({},R),H?.(R);},sx:{p:S==="compact"?1.25:1.5,borderRadius:4,border:"1px solid",borderColor:ie?"primary.main":"divider",boxShadow:ie?"0 12px 36px rgba(37, 99, 235, 0.14)":"none",cursor:"pointer",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease","&:active":{transform:"scale(0.995)"}},children:jsxs(Stack,{spacing:1.25,children:[jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[n?jsx(Checkbox,{checked:ie,onClick:U=>U.stopPropagation(),onChange:()=>sa({},R),sx:{mt:-0.6,ml:-0.6}}):null,jsxs(Box,{sx:{flex:1,minWidth:0},children:[F?jsx(Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Xu(F,R)}):null,W.length>0?jsx(Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:W.map(U=>jsx(Chip,{label:`${U.label}: ${Zv(U,R)}`,size:"small",variant:"outlined",sx:{borderRadius:999,fontWeight:600}},`${Z}-${U.id}`))}):null]}),D?jsx(Box,{onClick:U=>U.stopPropagation(),children:D(R)}):null]}),j.length>0?jsx(Box,{sx:{display:"grid",gridTemplateColumns:$e,gap:1},children:j.map(U=>jsxs(Paper,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider"},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:U.label}),_v(Xu(U,R))]},`${Z}-${U.id}-detail`))}):null,B?jsxs(Fragment,{children:[jsx(Divider,{}),jsx(Box,{onClick:U=>U.stopPropagation(),children:B(R)})]}):null]})},Z)};return jsxs(Box,{sx:{width:g?"100%":"auto",mb:l?0:2,...l?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p?jsx(Box,{sx:{mb:2},children:jsx(Lu,{...p,onVariantLoad:R=>{z(R),p.onVariantLoad?.(R);},appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:ue}],currentLayoutId:fe,layoutRefs:[{tableKey:m,layoutId:fe}],variantService:p.variantService,serviceUrl:P??p.serviceUrl,touchMode:ee==="portrait"?"expanded":"comfortable"})}):null,jsxs(Paper,{sx:{width:g?"100%":"auto",mb:l?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Ga?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f?{height:f}:l?{flex:1,minHeight:0,height:"100%"}:{}},children:[r?jsx(Box,{sx:{"& .MuiToolbar-root":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .MuiToolbar-root > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .MuiTextField-root":{width:{xs:"100%",md:300}}},"& .MuiToolbar-root > :nth-of-type(2)":{flexShrink:0},"& .MuiToolbar-root > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .MuiToolbar-root > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .MuiInputBase-root":{minHeight:46},"& .MuiIconButton-root":{width:40,height:40},"& .MuiTypography-root":{fontSize:"0.9rem"},"& .MuiButtonBase-root":{borderRadius:2.5}},children:jsx(jn,{filterText:oe,setFilterText:Bt,onRowsPerPageChange:Me,rowsPerPage:Oe,rowsPerPageOptions:y,page:ne,count:Xt,onPageChange:pe,actions:d,extraTools:le,grouping:Fe,setGroupAnchorEl:rt,showSummary:Ke,setShowSummary:ge,setAnchorEl:wa,setSummaryAnchorEl:ka,handleExport:ca,showCreateButton:pa,onOpenCreateDialog:Ma,showEditButton:Ot,onOpenEditDialog:gr,editDisabled:je.length!==1,showDeleteButton:Yt,onOpenDeleteConfirm:$t,deleteDisabled:je.length===0,onLayoutSave:I||p?.variantService&&p?.appId?O:void 0,loading:u,layoutManager:h,onOpenGraphReport:Re?Pe:void 0})}):null,jsx(Box,{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:jsxs(Stack,{spacing:1.25,children:[de.length===0&&!u?M||jsx(Paper,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:t("common.noData")})}):null,de.map((R,Z)=>{if(R.type==="group"){let U=It.has(R.id);return jsx(Paper,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxs(Box,{component:"button",type:"button",onClick:()=>gt(R.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none"},children:[U?jsx(Ov,{}):jsx(Wv,{}),jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsxs(Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[R.field,": ",R.value]}),jsxs(Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[R.count," records"]})]}),Fe.length>1&&R.level<Fe.length-1?jsxs(Stack,{direction:"row",spacing:.5,children:[jsx(Chip,{size:"small",label:t("table.group.expandAll"),onClick:ae=>{ae.stopPropagation(),Tt(R.id);}}),jsx(Chip,{size:"small",label:t("table.group.collapseAll"),onClick:ae=>{ae.stopPropagation(),da(R.id);}})]}):null]})},R.id)}let ie=R.data||R,$e=R.id||ie[Ce]||Z;return K(ie,$e)}),Ke?jsx(jv,{summaryRow:$,visibleColumns:lt,columns:te}):null,u?jsx(Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),pa?jsxs(Dialog,{open:Rt,onClose:()=>!Jt&&Ie(false),fullWidth:true,maxWidth:"sm",children:[jsx(DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:x?.title||t("quickCreate.createWithTitle",{title:V})}),jsx(DialogContent,{sx:{pt:"8px !important"},children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Vo.map(R=>{let Z=R.type==="number"||R.numeric?"number":R.type==="date"?"date":"text";return jsx(TextField,{label:R.label||R.id,value:Eo[R.id]??"",onChange:ie=>mr(R.id,ie.target.value),type:Z,fullWidth:true,InputLabelProps:{shrink:Z==="date"?true:void 0}},`quick-create-${R.id}`)}),x?.description?jsx(Alert,{severity:"info",children:x.description}):null]})}),jsxs(DialogActions,{sx:{px:3,pb:2},children:[jsx(Button,{onClick:()=>Ie(false),disabled:Jt,children:x?.cancelLabel||t("common.cancel")}),jsx(Button,{onClick:Wo,variant:"contained",disabled:Jt,children:x?.submitLabel||t("common.save")})]})]}):null,Ot?jsxs(Dialog,{open:$a,onClose:()=>!Ra&&Pa(false),fullWidth:true,maxWidth:"sm",children:[jsx(DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:k?.title||t("quickEdit.editWithTitle",{title:V})}),jsx(DialogContent,{sx:{pt:"8px !important"},children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Oo.map(R=>{let Z=R.type==="number"||R.numeric?"number":R.type==="date"?"date":"text";return jsx(TextField,{label:R.label||R.id,value:zo[R.id]??"",onChange:ie=>fr(R.id,ie.target.value),type:Z,disabled:!ea(R.id),fullWidth:true,InputLabelProps:{shrink:Z==="date"?true:void 0}},`quick-edit-${R.id}`)}),k?.description?jsx(Alert,{severity:"info",children:k.description}):null]})}),jsxs(DialogActions,{sx:{px:3,pb:2},children:[jsx(Button,{onClick:()=>Pa(false),disabled:Ra,children:k?.cancelLabel||t("common.cancel")}),jsx(Button,{onClick:hr,variant:"contained",disabled:Ra||!Pt,children:k?.submitLabel||t("common.save")})]})]}):null,Yt?jsx(an,{open:Lt,type:"warning",title:L?.title||t("quickDelete.confirmTitle"),message:L?.message||(je.length>1?t("quickDelete.confirmMessageMultiple",{count:je.length}):t("quickDelete.confirmMessageSingle")),confirmText:L?.confirmText||t("common.delete"),cancelText:L?.cancelText||t("common.cancel"),onClose:()=>!Da&&Nt(false),onConfirm:yr}):null,N,Re?jsx(bi,{open:se,onClose:ye,model:$o,aiAssistant:b?.aiAssistant,interaction:Se?{enabled:true,filters:he.filters,fieldMapping:Aa,onPrimaryDimensionClick:R=>he.setFilter("primaryDimension",R),onSecondaryDimensionClick:R=>he.setFilter("secondaryDimension",R),onStatusClick:R=>he.setFilter("status",R),onClearFilter:he.clearFilter,onClearAll:he.clearAll}:void 0,tableContent:jsx(Qv,{appId:G||"graph-report-internal",title:t("graph.dataBody"),columns:uo,rows:$o.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var AB=({appTitle:e,children:t,menuData:o=[],workloadItems:a=[],workloadSelectedId:r,showNavigation:n=true,showWorkloadNav:i=true,orientation:c="auto",logo:d,headerSlot:s,actionSlot:l,portraitBottomSlot:g,contentSx:f,containerSx:u,user:y,onSearch:I,defaultNavigationOpen:p,navOpen:C,onNavOpenChange:m,onWorkloadSelect:b})=>{let x=useTheme$1(),k=useMediaQuery("(orientation: portrait)",{noSsr:true}),L=useMediaQuery(x.breakpoints.down("md"),{noSsr:true}),P=c==="auto"?k||L?"portrait":"landscape":c,[w,E]=useState(p??false),[T,v]=useState(""),[M,S]=useState(false),D=C??w;useEffect(()=>{S(true);},[]),useEffect(()=>{C===void 0&&E(P==="landscape");},[C,P]);let B=_=>{C===void 0&&E(_),m?.(_);},H=jsxs(Paper,{elevation:0,sx:{px:2,py:1.25,borderRadius:0,borderBottom:"1px solid",borderColor:"divider",background:x.palette.mode==="dark"?"linear-gradient(180deg, rgba(15,23,42,0.96), rgba(17,24,39,0.92))":"linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94))"},children:[jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[n?jsx(IconButton,{onClick:()=>B(!D),sx:{bgcolor:"action.hover"},children:jsx(Vv,{})}):null,d?jsx(Box,{sx:{display:"grid",placeItems:"center"},children:d}):null,jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:900},children:e}),jsx(Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:M?P==="portrait"?"Pad portrait workspace":"Pad landscape workspace":"Pad workspace"})]}),jsx(Box,{sx:{flex:1}}),I?jsx(TextField,{value:T,onChange:_=>v(_.target.value),onKeyDown:_=>{_.key==="Enter"&&I(T);},size:"small",placeholder:"Search...",sx:{minWidth:{md:240},display:{xs:"none",sm:"block"}},InputProps:{startAdornment:jsx(Nv,{fontSize:"small",color:"action"})}}):null,l,y?jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsx(Avatar,{src:y.avatarSrc,sx:{width:38,height:38},children:y.avatarText||y.name.slice(0,1).toUpperCase()}),jsxs(Box,{sx:{display:{xs:"none",md:"block"}},children:[jsx(Typography,{sx:{fontSize:"0.86rem",fontWeight:800},children:y.name}),y.subtitle?jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:y.subtitle}):null]})]}):null]}),s?jsx(Box,{sx:{mt:1.25},children:s}):null]}),V=jsx(Gu,{collapsed:P==="landscape"?!D:false,onToggle:()=>B(!D),menuData:o,orientation:P,colorMode:x.palette.mode,maxHeight:P==="landscape"?900:void 0});return jsxs(Box,{sx:{minHeight:"100vh",display:"flex",flexDirection:"column",background:x.palette.mode==="dark"?"linear-gradient(180deg, #020617 0%, #0f172a 58%, #111827 100%)":"linear-gradient(180deg, #f8fafc 0%, #eef2ff 58%, #e2e8f0 100%)",...u},children:[H,jsxs(Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[n&&P==="landscape"?jsx(Box,{sx:{p:1.5,pr:0,flexShrink:0},children:V}):null,n&&P==="portrait"?jsx(Drawer,{open:D,onClose:()=>B(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:V}):null,jsx(Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f},children:jsxs(Stack,{spacing:1.5,children:[i&&a.length>0?jsx(Vu,{items:a,selectedId:r,orientation:P,onItemSelect:b}):null,jsx(Paper,{elevation:0,sx:{flex:1,minHeight:P==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:x.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)"},children:t})]})})]}),P==="portrait"&&g?jsxs(Fragment,{children:[jsx(Divider,{}),jsx(Box,{sx:{p:1.5},children:g})]}):null]})};var am=iC(()=>import('./COrbCanvas-EGX5NO3Y.mjs').then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsx("div",{className:"h-full w-full bg-transparent"})});function gc({isRecording:e}){return jsx(AnimatePresence,{children:e&&jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"pointer-events-none absolute inset-0 z-0 overflow-hidden",children:jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[jsx("div",{className:"absolute inset-0",children:jsx(am,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),jsx("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:jsx(am,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var NB=gc;function ks({onTextUpdate:e,onComplete:t,onError:o,wsUrl:a="ws://localhost:8765",silenceThresholdMs:r=2e3,minVolumeRms:n=.015}){let[i,c]=useState(false),d=useRef(null),s=useRef(null),l=useRef(null),g=useRef(null),f=useRef(null),u=useRef(0),y=useRef(false),I=useRef(false),p=useCallback(()=>{d.current&&(d.current.close(),d.current=null),g.current&&(g.current.disconnect(),g.current=null),f.current&&(f.current.disconnect(),f.current=null),s.current&&(s.current.getTracks().forEach(b=>b.stop()),s.current=null),l.current&&(l.current.close(),l.current=null),I.current=false,c(false);},[]),C=useCallback(()=>{y.current||(y.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(p,500));},[p]),m=useCallback(async()=>{if(!(i||I.current)){I.current=true,y.current=false,u.current=Date.now();try{let b=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});s.current=b;let x=new WebSocket(a);d.current=x,x.onopen=()=>{c(!0),I.current=!1;},x.onmessage=E=>{try{let T=JSON.parse(E.data);if(T.type==="recognition")T.is_final?t(T.text):e?.(T.text);else if(T.type==="error"){let v=T.message||"Voice recognition error";o?.(v),C();}}catch{o?.("Failed to parse voice message");}},x.onerror=()=>{o?.("Voice service connection failed"),p();},x.onclose=()=>{p();};let k=window.AudioContext||window.webkitAudioContext;if(!k)throw new Error("AudioContext is not supported in this browser");let L=new k({sampleRate:16e3});l.current=L;let P=L.createMediaStreamSource(b);f.current=P;let w=L.createScriptProcessor(4096,1,1);g.current=w,w.onaudioprocess=E=>{if(d.current?.readyState!==WebSocket.OPEN)return;let T=E.inputBuffer.getChannelData(0),v=0;for(let D=0;D<T.length;D+=1)v+=T[D]*T[D];if(Math.sqrt(v/T.length)>n)u.current=Date.now();else if(Date.now()-u.current>r&&!y.current){C();return}let S=new Int16Array(T.length);for(let D=0;D<T.length;D+=1){let B=Math.max(-1,Math.min(1,T[D]));S[D]=B<0?B*32768:B*32767;}d.current.send(S.buffer);},P.connect(w),w.connect(L.destination);}catch{o?.("Cannot access microphone"),p();}}},[p,i,n,t,o,e,r,C,a]);return useEffect(()=>p,[p]),{isRecording:i,startRecording:m,stopRecording:C}}var rm=createContext(null);function hC(e){if(!e||!(e instanceof HTMLElement))return false;let t=e.tagName;return !!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable||e.closest('[data-voice-hotkey-ignore="true"]'))}function yC({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:a,longPressMs:r=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:s,minVolumeRms:l}){let[g,f]=useState(false),[u,y]=useState(false),I=useRef(null),p=useRef(false),C=useRef(false),m=useCallback(()=>{C.current=false,f(false);},[]),{isRecording:b,startRecording:x,stopRecording:k}=ks({wsUrl:d,silenceThresholdMs:s,minVolumeRms:l,onTextUpdate:E=>{o?.(E);},onComplete:async E=>{try{E.trim()&&(y(!0),await t(E.trim()));}catch(T){let v=T instanceof Error?T.message:"Failed to process voice command";a?.(v);}finally{y(!1),m();}},onError:E=>{a?.(E),y(!1),p.current||m();}}),L=useCallback(async()=>{C.current=false,await x();},[x]),P=useCallback(()=>{k();},[k]);useEffect(()=>{if(n)return;let E=v=>{v.isComposing||(v.code==="Space"||v.key===" ")&&(p.current||v.repeat||i&&hC(document.activeElement)||(p.current=true,v.preventDefault(),I.current=setTimeout(()=>{C.current=true,f(true),x();},r)));},T=v=>{(v.code==="Space"||v.key===" ")&&(I.current&&(clearTimeout(I.current),I.current=null),p.current=false,C.current&&(v.preventDefault(),f(false),k()));};return window.addEventListener("keydown",E),window.addEventListener("keyup",T),()=>{window.removeEventListener("keydown",E),window.removeEventListener("keyup",T),I.current&&(clearTimeout(I.current),I.current=null);}},[n,i,r,x,k]);let w=useMemo(()=>({isRecording:b,isHotkeyRecording:g,isSubmitting:u,startRecording:L,stopRecording:P}),[g,b,u,L,P]);return jsxs(rm.Provider,{value:w,children:[c?jsx(gc,{isRecording:g}):null,e]})}function bC(){let e=useContext(rm);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var UB=yC,KB=bC;function xe(...e){return twMerge(clsx(e))}var IC=({content:e,theme:t="light",size:o="base",defaultExpanded:a=false})=>{let[r,n]=useState(a),i=useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return jsxs("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${t==="dark"?"bg-gray-800":"bg-white"}`,style:{border:`0.5px solid ${t==="dark"?"#4b5563":"#d1d5db"}`},children:[jsxs("div",{className:`px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 ${t==="dark"?"bg-gray-700 hover:bg-gray-650":"bg-gray-50 hover:bg-gray-100"}`,style:{borderBottom:`0.5px solid ${t==="dark"?"#4b5563":"#e5e7eb"}`},onClick:()=>n(!r),children:[jsxs("span",{className:"flex items-center",children:[jsx("span",{className:"mr-2",children:"\u{1F914}"}),jsx("span",{className:`font-medium ${t==="dark"?"text-gray-300":"text-gray-700"}`,style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${r?"rotate-180":""} ${t==="dark"?"text-gray-400":"text-gray-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsx("div",{className:`p-4 whitespace-pre-wrap italic font-light ${t==="dark"?"text-gray-400":"text-gray-600"}`,style:{fontSize:i,lineHeight:"1.3 !important"},children:e})]})},nm=IC;var FC=({content:e,language:t="text",isStreaming:o=false,className:a=""})=>{let{theme:r}=useTheme$2(),[n,i]=useState(false),c=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3);}catch(s){console.error("\u590D\u5236\u5931\u8D25:",s);}},d=r==="dark"?oneDark:oneLight;return jsxs("div",{className:xe("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",a),children:[jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 uppercase",children:t}),jsx("button",{onClick:c,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",disabled:o,title:n?"Copied":"Copy code",children:n?jsx(Check,{size:14,className:"text-green-500"}):jsx(Clipboard,{size:14,className:"text-gray-500 dark:text-gray-400"})})]}),jsx("div",{className:"text-sm",children:jsx(Prism,{language:t,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:r==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},sm=FC;var zC=({content:e,isLoading:t,className:o="",style:a})=>{let r=useRef(null),[n,i]=useState(false),[c,d]=useState(null),{theme:s}=useTheme$2();return useEffect(()=>{let l=async()=>{if(!(!e.trim()||!r.current)){i(true),d(null);try{cm.initialize({startOnLoad:!1,theme:s==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,u=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:y}=await cm.render(f,u);r.current&&(r.current.innerHTML=y);}catch(f){console.error("Mermaid render failed:",f),d(f instanceof Error?f.message:"Render failed"),r.current&&(r.current.innerText=e);}finally{i(false);}}},g=setTimeout(()=>{l();},100);return ()=>clearTimeout(g)},[e,s]),t||n?jsx("div",{className:`mermaid-block loading ${o}`,style:a,children:jsxs("div",{className:"flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700",children:[jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500 mr-2"}),jsx("span",{className:"text-sm text-gray-500",children:"Generating Diagram..."})]})}):c?jsxs("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded text-red-600 dark:text-red-400 text-sm overflow-auto",children:[jsx("p",{className:"font-semibold mb-2",children:"Mermaid Error:"}),jsx("pre",{children:c}),jsx("pre",{className:"mt-4 text-xs text-gray-500",children:e})]}):jsx("div",{className:`mermaid-block overflow-x-auto ${o}`,style:a,ref:r})},pm=zC;var GC=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:a,icon:r,closable:n=true,onClose:i,onRetry:c,className:d="",...s})=>{let[l,g]=useState(false),[f,u]=useState(false),y=async()=>{if(c){u(true);try{await c();}catch(I){console.error("\u91CD\u8BD5\u5931\u8D25:",I);}finally{u(false);}}};return jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...s,children:[jsxs("div",{className:"flex p-4 border-l-4 border-l-red-500 bg-red-50 dark:bg-red-900/10",children:[jsx("div",{className:"flex-shrink-0 mr-3 text-red-500 mt-0.5",children:r||jsx(AlertCircle,{className:"w-5 h-5"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300",children:o})]}),t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 leading-relaxed",children:typeof t=="string"?jsx("p",{className:"whitespace-pre-wrap",children:t}):t}),(c||a)&&jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[c&&jsxs("button",{onClick:y,disabled:f,className:"flex items-center text-xs font-medium text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 transition-colors disabled:opacity-50",children:[jsx(RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),a&&jsxs("button",{onClick:()=>g(!l),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 transition-colors",children:[l?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),l?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),n&&i&&jsx("button",{onClick:i,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors self-start",children:jsx(X,{className:"w-4 h-4"})})]}),a&&l&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 border-t border-gray-100 dark:border-gray-800",children:jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap p-2 bg-white dark:bg-gray-900 rounded border border-gray-200 dark:border-gray-800",children:a})})]})},Ss=GC;var jC=({title:e="\u8B66\u544A",content:t,warningType:o,severity:a="warning",warnings:r=[],icon:n,closable:i=true,onClose:c,onConfirm:d,actionText:s,className:l="",...g})=>{let f=()=>{switch(a){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-blue-500",bgColor:"bg-blue-50 dark:bg-blue-900/10"};case "error":return {borderLeftColor:"border-l-red-500",iconColor:"text-red-500",bgColor:"bg-red-50 dark:bg-red-900/10"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-green-500",bgColor:"bg-green-50 dark:bg-green-900/10"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-yellow-500",bgColor:"bg-yellow-50 dark:bg-yellow-900/10"}}},u=()=>{switch(a){case "info":return jsx(Info,{className:"w-5 h-5"});case "error":return jsx(XCircle,{className:"w-5 h-5"});case "success":return jsx(CheckCircle,{className:"w-5 h-5"});default:return jsx(AlertTriangle,{className:"w-5 h-5"})}},y=f();return jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${l}`,...g,children:[jsxs("div",{className:`flex p-4 border-l-4 ${y.borderLeftColor} ${y.bgColor}`,children:[jsx("div",{className:`flex-shrink-0 mr-3 ${y.iconColor}`,children:n||u()}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400",children:o})]}),t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),r&&r.length>0&&jsx("ul",{className:"mt-2 space-y-1",children:r.map((I,p)=>jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsx("span",{children:I})]},p))})]}),i&&c&&jsx("button",{onClick:c,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:jsx(X,{className:"w-4 h-4"})})]}),d&&jsx("div",{className:"bg-gray-50 dark:bg-gray-800/50 px-4 py-3 flex justify-end border-t border-gray-100 dark:border-gray-800",children:jsx("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:s||"\u786E\u8BA4"})})]})},ws=jC;var JC=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:a,maxDisplay:r=5,icon:n,closable:i=false,onClose:c,className:d="",...s})=>{let[l,g]=useState(false),[f,u]=useState(""),[y,I]=useState(false),p=useMemo(()=>f.trim()?o.filter(b=>b.toLowerCase().includes(f.toLowerCase())):o,[o,f]),C=useMemo(()=>l?p:p.slice(0,r),[p,l,r]),m=b=>{a?.(b);};return !o||o.length===0?null:jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...s,children:[jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/30 dark:bg-blue-900/10",children:[jsxs("div",{className:"flex items-center space-x-2.5",children:[jsx("div",{className:"text-blue-500 flex-shrink-0",children:n||jsx(Lightbulb,{className:"w-5 h-5"})}),jsxs("div",{className:"flex flex-col",children:[jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:e}),t&&jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]})]}),jsxs("div",{className:"flex items-center space-x-1",children:[o.length>3&&jsx("button",{onClick:()=>I(!y),className:`p-1.5 rounded-md transition-colors ${y?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"}`,title:y?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:jsx(Search,{className:"w-4 h-4"})}),i&&c&&jsx("button",{onClick:c,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",title:"\u5173\u95ED",children:jsx(X,{className:"w-4 h-4"})})]})]}),y&&jsx("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/50",children:jsxs("div",{className:"relative",children:[jsx("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:f,onChange:b=>u(b.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 outline-none transition-shadow",autoFocus:true}),jsx(Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxs("div",{className:"p-2",children:[jsx("ul",{className:"space-y-1",children:C.map((b,x)=>jsx("li",{children:jsxs("button",{onClick:()=>m(b),className:"w-full text-left px-3 py-2 rounded-md text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-blue-600 dark:hover:text-blue-400 transition-colors group flex items-start justify-between",children:[jsx("span",{children:b}),jsx(ChevronRight,{className:"w-4 h-4 text-gray-300 group-hover:text-blue-400 opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},x))}),p.length>r&&jsx("button",{onClick:()=>g(!l),className:"w-full text-center py-2 text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors border-t border-gray-50 dark:border-gray-800/50 mt-1",children:l?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${p.length})`}),p.length===0&&f&&jsx("div",{className:"text-center py-4 text-sm text-gray-500 dark:text-gray-400",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},Is=JC;var ik=({title:e,content:t,toolName:o,parameters:a,result:r,status:n,duration:i,icon:c,closable:d=false,onClose:s,onAction:l,actionText:g,className:f="",...u})=>{let[y,I]=useState(false),[p,C]=useState(true),m=()=>{switch(n){case "pending":return {iconColor:"text-blue-500",badgeBg:"bg-blue-50 dark:bg-blue-900/30",badgeText:"text-blue-600 dark:text-blue-400",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-red-500",badgeBg:"bg-red-50 dark:bg-red-900/30",badgeText:"text-red-600 dark:text-red-400",label:"\u5931\u8D25"};default:return {iconColor:"text-green-500",badgeBg:"bg-green-50 dark:bg-green-900/30",badgeText:"text-green-600 dark:text-green-400",label:"\u6210\u529F"}}},b=()=>{switch(n){case "pending":return jsx(Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsx(XCircle,{className:"w-5 h-5"});default:return jsx(CheckCircle,{className:"w-5 h-5"})}},x=P=>P?P<1e3?`${P}ms`:`${(P/1e3).toFixed(2)}s`:"",k=m(),L=e||o||"\u5DE5\u5177\u8C03\u7528";return jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${f}`,...u,children:[jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsxs("div",{className:"flex items-center space-x-3",children:[jsx("div",{className:`flex-shrink-0 ${k.iconColor}`,children:c||b()}),jsxs("div",{children:[jsxs("div",{className:"flex items-center space-x-2",children:[jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:L}),jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${k.badgeBg} ${k.badgeText}`,children:k.label})]}),o&&e&&jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center mt-0.5",children:[jsx(Terminal,{className:"w-3 h-3 mr-1"}),o]})]})]}),jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[i&&jsxs("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded",children:[jsx(Clock,{className:"w-3 h-3 mr-1"}),x(i)]}),d&&s&&jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1 rounded",children:jsx(X,{className:"w-4 h-4"})})]})]}),jsxs("div",{className:"p-4",children:[t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:t}),a&&jsxs("div",{className:"mb-3",children:[jsxs("button",{onClick:()=>I(!y),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[y?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsx(Box$1,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),y&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:JSON.stringify(a,null,2)})})]}),r&&jsxs("div",{children:[jsxs("button",{onClick:()=>C(!p),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[p?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsx(Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),p&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:typeof r=="string"?r:JSON.stringify(r,null,2)})})]}),l&&jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-800 flex justify-end",children:jsx("button",{onClick:l,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:g||"\u6267\u884C\u64CD\u4F5C"})})]})]})},Ts=ik;var lk=({data:e})=>{if(!e)return null;let t=useMemo(()=>{let o=[],a=[],r="\u6570\u636E\u8868\u683C";return Array.isArray(e)?(o=e,o.length>0&&(a=Object.keys(o[0]).map(n=>({id:n,label:n.charAt(0).toUpperCase()+n.slice(1),numeric:typeof o[0][n]=="number"})))):typeof e=="object"&&(r=e.title||r,o=Array.isArray(e.rows)?e.rows:Array.isArray(e.data)?e.data:[],Array.isArray(e.columns)?a=e.columns.map(i=>({id:i.key||i.id,label:i.title||i.label,numeric:i.dataType==="number"||i.numeric})):o.length>0&&(a=Object.keys(o[0]).map(i=>({id:i,label:i,numeric:typeof o[0][i]=="number"})))),o=o.map((n,i)=>({...n,id:n.id||`row_${i}`})),{title:r,columns:a,rows:o}},[e]);return t.rows.length===0?jsx("div",{className:"w-full my-4 p-4 border border-dashed border-gray-300 rounded text-center text-gray-500",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):jsx("div",{className:"w-full my-4",children:jsx(Co,{appId:"agent-ui-table-card",title:t.title,columns:t.columns,rows:t.rows,count:t.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},Ps=lk;var yk=({title:e,subtitle:t,data:o,type:a,config:r={}})=>{let n=()=>{switch(a){case "bar-chart-card":return jsx(BarChart,{className:"w-4 h-4 text-blue-500"});case "line-chart-card":return jsx(LineChart,{className:"w-4 h-4 text-green-500"});case "pie-chart-card":return jsx(PieChart,{className:"w-4 h-4 text-purple-500"});case "combo-chart-card":return jsx(Activity,{className:"w-4 h-4 text-orange-500"});case "heatmap-chart-card":return jsx(Grid$1,{className:"w-4 h-4 text-red-500"});case "fishbone-chart-card":return jsx(GitBranch,{className:"w-4 h-4 text-indigo-500"});case "waterfall-chart-card":return jsx(TrendingDown,{className:"w-4 h-4 text-teal-500"});case "google-map-card":return jsx(Globe,{className:"w-4 h-4 text-blue-600"});case "amap-card":return jsx(MapPin,{className:"w-4 h-4 text-blue-600"});default:return jsx(BarChart,{className:"w-4 h-4"})}},i=()=>{if(!o&&a!=="google-map-card"&&a!=="amap-card")return jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(a){case "bar-chart-card":return jsx(ln,{data:o,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsx(od,{data:o,color:r.color,valueSuffix:r.valueSuffix||"",height:r.height});case "pie-chart-card":let c=o.reduce((s,l)=>s+(Number(l.value)||0),0),d=o.map(s=>({name:s.name,value:Number(s.value)||0,percent:typeof s.percent=="number"?s.percent:c>0?(Number(s.value)||0)/c*100:0}));return jsx(di,{data:d,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsx(rd,{data:o,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsx(id,{data:o});case "fishbone-chart-card":return jsx(ld,{branches:o,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsx(dd,{data:o,height:r.height});case "google-map-card":return jsx(md,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,apiKey:r.apiKey,query:r.query||o&&o[0]?.query||e,height:r.height});case "amap-card":return jsx(yd,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,keyword:r.keyword||o&&o[0]?.keyword||e,height:r.height});default:return jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",a]})}}catch(c){return console.error("Error rendering chart:",c),jsx("div",{className:"text-red-500 text-sm p-4 text-center",children:"Error rendering chart"})}};return jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsx("div",{className:"mr-2 flex-shrink-0",children:n()}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),t&&jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:t})]})]}),jsxs("div",{className:"p-4",children:[jsx("div",{className:"overflow-x-auto",children:i()}),jsx("div",{className:"mt-3",children:jsxs("details",{className:"text-xs text-gray-500 dark:text-gray-400",children:[jsx("summary",{className:"cursor-pointer hover:text-gray-700 dark:hover:text-gray-300 transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),jsx("pre",{className:"mt-2 p-2 bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto max-h-40",children:JSON.stringify(o,null,2)})]})})]})]})},Rs=yk;var xk=({type:e,manifest:t})=>jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/50 dark:bg-blue-900/10",children:[jsx(Box$1,{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400"}),jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["SAP Card: ",e]})]}),jsx("div",{className:"p-4",children:jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto",children:jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})})})]}),Ms=xk;var As=e=>{let t;try{t=JSON.parse(e);}catch{return null}return t&&typeof t=="object"&&((t.type==="bar-chart-card"||t.type==="line-chart-card"||t.type==="pie-chart-card"||t.type==="combo-chart-card"||t.type==="heatmap-chart-card"||t.type==="fishbone-chart-card"||t.type==="waterfall-chart-card"||t.type==="google-map-card"||t.type==="amap-card")&&t.title||(t.type==="sap-analytical-card"||t.type==="sap-list-card"||t.type==="sap-object-card"||t.type==="sap-component-card")&&t.manifest||t.type==="error-card"||t.type==="warning-card"||t.type==="suggestions-card"||t.type==="tool-result-card"||t.type==="table"&&t.data)?t:null};var Ik=({content:e,theme:t,size:o="base",className:a,enableCodeHighlight:r=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,u)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(u.trim())}"></div>`):"",[e]),s=(f,u,y,I,p)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:u,title:y,payload:I,rawData:p});},l=(f,u,y,I,p,C)=>{if(!(!p&&!c?.onCardEvent))return (...m)=>{let b=p?.(...m),x=C?C(...m):void 0;return s(f,u,y,x,I),b}},g=useMemo(()=>({div(f){let{"data-component":u,"data-think-content":y,...I}=f;return u==="thinkbox"&&y?jsx(nm,{content:decodeURIComponent(y),theme:t,size:o,defaultExpanded:false}):jsx("div",{...I})},table({children:f}){return jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-800",children:jsx("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:f})})},thead({children:f}){return jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/60",children:f})},tbody({children:f}){return jsx("tbody",{className:"bg-white dark:bg-gray-950",children:f})},tr({children:f}){return jsx("tr",{className:"border-b border-gray-200 dark:border-gray-800 last:border-b-0",children:f})},th({children:f,align:u}){return jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${u==="center"?"text-center":u==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:u}){return jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${u==="center"?"text-center":u==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:u,children:y,...I}){let p=/language-([\w-]+)/.exec(u||""),C=p?p[1]:"";if(f)return jsx("code",{className:"font-mono text-sm bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded text-red-600 dark:text-red-400",...I,children:y});let m=String(y).replace(/\n$/,"");if(n&&C==="mermaid")return jsx(pm,{content:m});if(C==="json"){let b=As(m);if(b)switch(b.type){case "table":return jsx(Ps,{data:b.data});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return jsx(Rs,{...b});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsx(Ms,{...b});case "error-card":{let x=b;return jsx(Ss,{...x,onClose:l("error-card","close",x.title,x,x.onClose),onRetry:l("error-card","retry",x.title,x,x.onRetry)})}case "warning-card":{let x=b,k=x.onConfirm?l("warning-card","confirm",x.title,x,x.onConfirm):x.actionText&&c?.onCardEvent?l("warning-card","confirm",x.title,x):void 0;return jsx(ws,{...x,onClose:l("warning-card","close",x.title,x,x.onClose),onConfirm:k})}case "suggestions-card":{let x=b;return jsx(Is,{...x,onClose:l("suggestions-card","close",x.title,x,x.onClose),onSuggestionClick:l("suggestions-card","suggestion-click",x.title,x,x.onSuggestionClick,k=>({suggestion:k}))})}case "tool-result-card":{let x=b;return jsx(Ts,{...x,onClose:l("tool-result-card","close",x.title,x,x.onClose),onAction:l("tool-result-card","action",x.title,x,x.onAction)})}}}return r?jsx(sm,{content:m,language:C,className:"not-prose"}):jsx("code",{className:u,...I,children:y})}}),[t,o,n,r,c,i]);return jsx("div",{className:xe("markdown-body prose dark:prose-invert max-w-none",a),children:jsx(vk,{remarkPlugins:[Ck,kk],rehypePlugins:[Sk,wk],components:g,children:d})})},Bs=Ik;var Tk=({content:e,messageId:t,cardHooks:o})=>{let a=(i,c,d,s,l)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:c,title:d,payload:s,rawData:l});},r=(i,c,d,s,l,g)=>{if(!(!l&&!o?.onCardEvent))return (...f)=>{let u=l?.(...f),y=g?g(...f):void 0;return a(i,c,d,y,s),u}},n=As(e);if(n)switch(n.type){case "table":return jsx(Ps,{data:n.data});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return jsx(Rs,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsx(Ms,{...n});case "error-card":{let i=n;return jsx(Ss,{...i,onClose:r("error-card","close",i.title,i,i.onClose),onRetry:r("error-card","retry",i.title,i,i.onRetry)})}case "warning-card":{let i=n,c=i.onConfirm?r("warning-card","confirm",i.title,i,i.onConfirm):i.actionText&&o?.onCardEvent?r("warning-card","confirm",i.title,i):void 0;return jsx(ws,{...i,onClose:r("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsx(Is,{...i,onClose:r("suggestions-card","close",i.title,i,i.onClose),onSuggestionClick:r("suggestions-card","suggestion-click",i.title,i,i.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let i=n;return jsx(Ts,{...i,onClose:r("tool-result-card","close",i.title,i,i.onClose),onAction:r("tool-result-card","action",i.title,i,i.onAction)})}}return jsx("div",{className:"dynamic-card-fallback",children:jsx(Bs,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},Cm=Tk;var Sc=class{static analyze(t){if(!t.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let a=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(t),r=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(t),n=t.includes("NQ#")||t.includes("data-component");return a||r||n?{blocks:[{type:"mixed",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:false,overallType:"simple"}}},Rk=({content:e,className:t="",messageId:o,cardHooks:a})=>{let r=ut__default.useMemo(()=>Sc.analyze(e),[e]);return jsx("div",{className:`universal-content-renderer ${t}`,children:r.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsx(Cm,{content:n.content,messageId:o,cardHooks:a},`block-${i}`):jsx(Bs,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:a},`block-${i}`))})},km=Rk;var Dk=({content:e,isStreaming:t=true,onComplete:o,className:a="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,s]=useState(t?0:e.length),[l,g]=useState(!t);useEffect(()=>{if(t){s(0),g(false);return}s(e.length),g(true);},[e,t]),useEffect(()=>{if(!t||l)return;if(d>=e.length){g(true),o?.();return}let p=window.setTimeout(()=>{s(C=>Math.min(C+n,e.length));},r);return ()=>{window.clearTimeout(p);}},[e.length,l,t,o,n,r,d]);let f=()=>{t&&!l&&(s(e.length),g(true),o?.());},u=t?e.slice(0,d):e,y=t&&!l,I=t&&!l;return jsxs("div",{className:`streaming-markdown ${a}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxs("div",{className:"relative",children:[jsx(km,{content:u,messageId:i,cardHooks:c}),y&&jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),I&&jsx("div",{className:"streaming-hint",style:{fontSize:"9px",color:"#999",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},Tm=Dk;var Pm=({buttons:e,className:t})=>{let o=a=>{switch(a){case "copy":return jsx(Copy,{size:14});case "refresh":return jsx(RefreshCw,{size:14});case "volume":return jsx(Volume2,{size:14});case "like":return jsx(ThumbsUp,{size:14});case "dislike":return jsx(ThumbsDown,{size:14});default:return null}};return jsx("div",{className:xe("flex items-center gap-1",t),children:e.map((a,r)=>jsx("button",{onClick:a.onClick,disabled:a.disabled,className:xe("p-1.5 rounded-md transition-colors","text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-50 disabled:cursor-not-allowed",a.active&&"text-blue-600 bg-blue-50 dark:text-blue-400 dark:bg-blue-900/20",a.type==="refresh"&&a.disabled&&"animate-spin"),title:a.type,type:"button",children:o(a.type)},`${a.type}-${r}`))})};var Fs=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:a,streamChunkSize:r,cardHooks:n})=>e.type==="assistant"?jsx("div",{className:"flex justify-start mb-4",children:jsxs("div",{className:"w-full bg-transparent text-black dark:text-gray-100 rounded-2xl px-4 py-3 mr-auto",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[jsx(Tm,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:a,streamChunkSize:r,messageId:e.id,cardHooks:n}),e.content&&o?.isLatestAssistant&&jsx("div",{className:"flex flex-row justify-start gap-2 mt-3 pt-2 border-t border-gray-100 dark:border-gray-700",children:jsx(Pm,{buttons:[{type:"refresh",onClick:()=>o?.onRegenerate?.(),disabled:!o?.onRegenerate},{type:"copy",onClick:()=>navigator.clipboard.writeText(e.content),disabled:false},{type:"volume",onClick:()=>console.log("\u8BED\u97F3\u64AD\u653E"),disabled:false},{type:"like",onClick:()=>console.log("\u70B9\u8D5E"),disabled:false},{type:"dislike",onClick:()=>console.log("\u70B9\u8E29"),disabled:false}],size:"sm",variant:"default"})}),jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})}):jsx("div",{className:"flex justify-end",children:jsxs("div",{className:"max-w-[80%] bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-100 rounded-2xl px-4 py-3 ml-auto",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[jsx("div",{className:"whitespace-pre-wrap",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:e.content}),jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})});var Dm=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:a,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:c}=ks({onTextUpdate:e,onComplete:s=>{t?.(s);},onError:s=>{console.error("Voice input error:",s),o?.();}});return jsx("button",{onClick:async()=>{n?c():await i();},disabled:a,className:xe("transition-all duration-200 flex items-center justify-center rounded-full",n?"bg-red-100 text-red-600 hover:bg-red-200 animate-pulse":"bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 active:scale-95",a&&"opacity-50 cursor-not-allowed",r),title:n?"Stop recording":"Start recording",type:"button",children:n?jsx(Nk,{sx:{fontSize:24}}):jsx(Lk,{sx:{fontSize:24}})})};var ot={container:"w-full max-w-4xl mx-auto",inputContainer:xe("w-full border backdrop-blur-xl transition-all duration-300 shadow-2xl flex flex-col","bg-white/80 dark:bg-gray-900/80","border-gray-200/60 dark:border-gray-600/40","shadow-gray-900/5","hover:border-blue-300/80 hover:shadow-blue-500/10 hover:shadow-2xl","focus-within:border-blue-400/90 focus-within:shadow-blue-500/20 focus-within:shadow-3xl focus-within:scale-[1.005] transform-gpu"),dragActive:"border-blue-500 bg-blue-50/50 dark:bg-blue-900/20",textareaWrapper:"flex-1 relative flex items-center",textarea:xe("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-2","placeholder:text-gray-400/70 dark:placeholder:text-gray-500/60 placeholder:font-normal","text-gray-800 dark:text-gray-100 selection:bg-blue-200/50 dark:selection:bg-blue-500/30","focus:ring-0 focus:outline-none focus:border-none focus:shadow-none","min-h-[44px] max-h-[12em] overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600"),filePreviewArea:"px-6 pt-3 pb-1 flex flex-wrap gap-2",fileTag:xe("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300","border border-gray-200 dark:border-gray-700","transition-all hover:bg-gray-200 dark:hover:bg-gray-700"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"w-10 h-10",buttonNormal:xe("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:xe("cursor-pointer bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 shadow-none active:scale-95"),sendButtonDisabled:xe("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:xe("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},Uk={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},Kk=({enabled:e,onClick:t})=>jsx("button",{className:xe(ot.buttonBase,ot.buttonSmall,ot.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsx(Hk,{sx:{fontSize:24}})}),qk=()=>jsxs("button",{className:xe(ot.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",ot.buttonNormal),"aria-label":"Tools",type:"button",children:[jsx(Gk,{sx:{fontSize:20}}),jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),_k=({canSend:e,isResponding:t,onSend:o,onStop:a})=>t?jsx("button",{className:xe(ot.buttonBase,ot.buttonSmall,ot.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:jsx(Stop,{sx:{fontSize:20}})}):jsx("button",{className:xe(ot.buttonBase,ot.buttonSmall,e?ot.sendButton:ot.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsx($k,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),Mm=({onSend:e,onStop:t,isResponding:o=false,placeholder:a,getText:r})=>{let[n,i]=useState(""),[c,d]=useState([]),[s,l]=useState(false),[g,f]=useState(false),u=useRef(null),y=a||(r?r("00019","Type a message..."):"Type a message..."),I=(n.trim().length>0||c.length>0)&&!o,p={enabled:true},C=useCallback(B=>{i(B.target.value),B.target.style.height="auto",B.target.style.height=`${Math.min(B.target.scrollHeight,200)}px`;},[]),m=useCallback(B=>{if(B.target.files&&B.target.files.length>0){let H=Array.from(B.target.files);d(V=>{let _=H.filter(ee=>V.some(te=>te.name===ee.name&&te.size===ee.size));_.length>0&&console.warn("Duplicate files ignored:",_.map(ee=>ee.name));let Y=H.filter(ee=>!V.some(te=>te.name===ee.name&&te.size===ee.size));return [...V,...Y]}),u.current&&(u.current.value="");}},[]),b=useCallback(B=>{d(H=>H.filter((V,_)=>_!==B));},[]),x=useCallback(()=>{u.current?.click();},[]),k=useCallback(async()=>{if(!I)return;let B=n,H=[...c];i(""),d([]),u.current&&(u.current.value="");try{await e(B,H);}catch(V){console.error("Failed to send message:",V),i(B),d(H);}},[n,I,e,c]),L=useCallback(B=>{B.key==="Enter"&&!B.shiftKey&&!s&&(B.preventDefault(),k());},[k,s]),P=useCallback(()=>{l(true);},[]),w=useCallback(()=>{l(false);},[]),E=useCallback(B=>{i(B);},[]),T=useCallback(B=>{i(B);},[]),v=useCallback(()=>{},[]),M=useCallback(B=>{B.preventDefault(),f(true);},[]),S=useCallback(B=>{B.preventDefault(),f(false);},[]),D=useCallback(B=>{if(B.preventDefault(),f(false),B.dataTransfer.files&&B.dataTransfer.files.length>0){let H=Array.from(B.dataTransfer.files);d(V=>[...V,...H]);}},[]);return jsx("div",{className:ot.container,children:jsxs("div",{className:"relative",children:[jsx("input",{type:"file",multiple:true,className:"hidden",ref:u,onChange:m}),jsxs("div",{className:xe(ot.inputContainer,g&&ot.dragActive),style:{borderRadius:"32px"},onDragOver:M,onDragLeave:S,onDrop:D,children:[c.length>0&&jsx("div",{className:ot.filePreviewArea,children:c.map((B,H)=>jsxs("div",{className:ot.fileTag,children:[jsx(InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsx("span",{className:"truncate max-w-[150px]",children:B.name}),jsx("button",{onClick:()=>b(H),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsx(Close,{sx:{fontSize:16}})})]},`${B.name}-${H}`))}),jsxs("div",{className:"flex flex-col w-full p-2",children:[jsx("div",{className:xe(ot.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsx("textarea",{className:xe(ot.textarea,"min-h-[24px] py-0 px-0"),placeholder:y,value:n,onChange:C,onKeyDown:L,onCompositionStart:P,onCompositionEnd:w,style:Uk,"aria-label":"Message input",spellCheck:false,rows:1})}),jsxs("div",{className:"flex items-center justify-between px-1 pb-1",children:[jsxs("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[jsx(Kk,{enabled:p.enabled,onClick:x}),jsx(qk,{})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(Dm,{onTextUpdate:E,onComplete:T,onCancel:v,disabled:o,className:ot.buttonSmall}),jsx(_k,{canSend:I,isResponding:o,onSend:k,onStop:t})]})]})]})]})]})})};var Bm=({messages:e,onSend:t,onStop:o,onRegenerate:a,isResponding:r=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:s,cardHooks:l,showInput:g=true})=>{let f=useRef(null);return useEffect(()=>{f.current?.scrollIntoView({behavior:"smooth"});},[e,r]),jsxs("div",{className:xe("flex flex-col h-full w-full relative",n),children:[jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((u,y)=>{let I=u.type==="assistant"&&y===e.length-1,p=u.type==="assistant"?{isLatestAssistant:I,onRegenerate:a?()=>a(u.id):void 0}:void 0;return jsx(Fs,{message:u,assistantActions:p,onStreamingComplete:()=>s?.(u.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:l},u.id)}),jsx("div",{ref:f})]}),g&&jsx("div",{className:"p-4 bg-gradient-to-t from-white via-white to-transparent dark:from-gray-900 dark:via-gray-900 pb-8 z-10",children:jsx(Mm,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:r,placeholder:i})})]})};var jt={};var Xk={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},hE=({title:e="AI Agent",description:t,headerActions:o,className:a,agentStatus:r,showInput:n=false,...i})=>{let c=r??(i.isResponding?"running":"idle");return jsxs("div",{className:xe("relative flex h-full w-full",jt.agentPanel,a),"data-status":c,children:[jsx("div",{className:jt.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxs("div",{className:jt.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsx("span",{className:xe(jt.edge,jt.top)}),jsx("span",{className:xe(jt.edge,jt.right)}),jsx("span",{className:xe(jt.edge,jt.bottom)}),jsx("span",{className:xe(jt.edge,jt.left)})]}),jsxs("div",{className:"relative z-10 flex h-full w-full flex-col rounded-xl border border-slate-200/70 bg-white shadow-sm overflow-hidden dark:border-slate-800 dark:bg-gray-950",children:[jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 dark:border-gray-800 bg-white/50 dark:bg-gray-900/50 backdrop-blur-sm z-20",children:[jsxs("div",{children:[jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t&&jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("div",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-full bg-gray-100/80 dark:bg-gray-800/70",children:[jsx("span",{className:jt.statusDot,"data-status":c}),jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:Xk[c]})]}),o]})]}),jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsx(Bm,{...i,showInput:n})})]})]})};var aS={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},wE=({messages:e,onSend:t,onRegenerate:o,isResponding:a=false,className:r,placeholder:n,title:i="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:s,onPlusClick:l,onMicClick:g,streamIntervalMs:f,streamChunkSize:u,onMessageStreamingComplete:y,cardHooks:I})=>{let[p,C]=useState(""),[m,b]=useState(false),x=useRef(null),k=aS[c];useEffect(()=>{x.current?.scrollIntoView({behavior:"smooth"});},[e,a]);let L=useCallback(async()=>{let w=p.trim();!w||a||(C(""),await t(w));},[a,t,p]),P=useCallback(async w=>{w.key==="Enter"&&!m&&(w.preventDefault(),await L());},[L,m]);return jsxs("div",{className:xe("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-gray-200 bg-white shadow-none dark:border-gray-800 dark:bg-gray-900",r),children:[d&&jsx("button",{onClick:d,className:xe("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",k==="top-left"&&"-left-2 -top-2",k==="top-right"&&"-right-2 -top-2",k==="bottom-left"&&"-bottom-2 -left-2",k==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsx("span",{className:xe("block h-4 w-4 border-[#21BCFF]",k==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",k==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",k==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",k==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-gray-800",onPointerDown:s,children:[jsx("div",{className:"flex items-center",children:jsx("h3",{className:"text-base font-semibold tracking-tight text-gray-900 dark:text-gray-100",children:i})}),jsx("div",{})]}),jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((w,E)=>{let T=w.type==="assistant"&&E===e.length-1,v=w.type==="assistant"?{isLatestAssistant:T,onRegenerate:o?()=>o(w.id):void 0}:void 0;return jsx(Fs,{message:w,assistantActions:v,onStreamingComplete:()=>y?.(w.id),streamIntervalMs:f,streamChunkSize:u,cardHooks:I},w.id)}),jsx("div",{ref:x})]}),jsx("div",{className:"border-t border-gray-100 px-3 py-3 dark:border-gray-800",children:jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-blue-300/80 bg-white px-2 py-1.5 dark:bg-gray-900",children:[jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:l,type:"button","aria-label":"Add",children:jsx(Plus,{className:"h-4 w-4"})}),jsx("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-gray-800 outline-none placeholder:text-gray-400 dark:text-gray-100 dark:placeholder:text-gray-500",placeholder:n||"Ask Copilot...",value:p,onChange:w=>C(w.target.value),onCompositionStart:()=>b(true),onCompositionEnd:()=>b(false),onKeyDown:P,"aria-label":"Copilot input",spellCheck:false}),jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:g,type:"button","aria-label":"Microphone",children:jsx(Mic,{className:"h-4 w-4"})})]})})]})};var lS={none:{from:{},to:{}},fade:{from:{opacity:0},to:{opacity:1}},"slide-up":{from:{opacity:0,transform:"translate3d(0, 12px, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},"slide-left":{from:{opacity:0,transform:"translate3d(12px, 0, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},scale:{from:{opacity:0,transform:"scale(0.985)"},to:{opacity:1,transform:"scale(1)"}}},DE=({children:e,transitionKey:t,variant:o="fade",durationMs:a=220,delayMs:r=0,easing:n="cubic-bezier(0.22, 1, 0.36, 1)",disabled:i=false,sx:c})=>{let d=useMediaQuery("(prefers-reduced-motion: reduce)"),[s,l]=useState("to"),g=!i&&!d&&o!=="none";useEffect(()=>{if(!g){l("to");return}l("from");let y=requestAnimationFrame(()=>{y=requestAnimationFrame(()=>{l("to");});});return ()=>cancelAnimationFrame(y)},[t,g]);let f=lS[o],u=useMemo(()=>g?s==="from"?f.from:f.to:{opacity:1,transform:"none"},[g,s,f.from,f.to]);return jsx(Box,{sx:{willChange:g?"opacity, transform":"auto",transition:g?`opacity ${a}ms ${n} ${r}ms, transform ${a}ms ${n} ${r}ms`:"none",backfaceVisibility:"hidden",...u,...c},children:e})},ME={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
|
|
17
|
-
export{
|
|
16
|
+
`,a,": ",(n??r)(m.item.secondaryValue??0)]})},`secondary-${m.item.name}`))]})]})}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:e.map(m=>jsxs(Box,{sx:b=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${alpha(b.palette.divider,.7)}`,bgcolor:alpha(b.palette.background.default,.35)}),children:[jsx(Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:m.name,children:m.name}),jsx(Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:r(m.primaryValue)}),a&&jsx(Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??r)(m.secondaryValue??0)})]},m.name))})]})};var pu=(e,t,o)=>{let a=new Set,r=[];return e.forEach(n=>{a.has(n)||(a.add(n),r.push({fieldId:n,label:o.get(n)?.label??n,zone:"rows"}));}),t.forEach(n=>{a.has(n)||(a.add(n),r.push({fieldId:n,label:o.get(n)?.label??n,zone:"columns"}));}),r},uu=(e,t,o)=>e.map(a=>{let r=t.get(a.fieldId),n=r?.label??a.fieldId;return {fieldId:a.fieldId,label:`${o(a.aggregation)} \xB7 ${n}`,item:a,field:r}}),mu=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:a})=>{if(!t)return [];let r=new Map;return e.forEach(n=>{let i=ao(n[t]),c=r.get(i);if(c){c.push(n);return}r.set(i,[n]);}),Array.from(r.entries()).sort((n,i)=>n[0].localeCompare(i[0],void 0,{sensitivity:"base"})).map(([n,i])=>({name:n,primaryValue:Vr(i,o.fieldId,o.aggregation),secondaryValue:a?Vr(i,a.fieldId,a.aggregation):void 0}))};var gu=({rows:e,fieldMap:t,rowFields:o,columnFields:a,valueFields:r,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:s,onChartDimensionFieldIdChange:l,onChartPrimaryValueFieldIdChange:g,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:u,onToggleCollapse:y,getAggregationLabel:I})=>{let{t:p}=K(),C=useMemo(()=>pu(o,a,t),[a,t,o]),m=useMemo(()=>uu(r,t,I),[t,I,r]),b=m.find(v=>v.fieldId===i)??m[0],x=m.find(v=>v.fieldId===c&&v.fieldId!==b?.fieldId)??null,k=C.find(v=>v.fieldId===n)??C[0],L=k&&b?p("pivot.chart.subtitleReady",{dimension:k.label,measure:x?`${b.label} / ${x.label}`:b.label}):p("pivot.chart.subtitle"),P=useMemo(()=>!k||!b?[]:mu({rows:e,dimensionFieldId:k.fieldId,primaryValue:b.item,secondaryValue:x?.item}),[b,e,x,k]),w=v=>b?En(v,b.item,t):v.toLocaleString(),E=v=>x?En(v,x.item,t):v.toLocaleString(),T=C.length>1||m.length>1;return jsxs(Gr,{title:p("pivot.chart.title"),subtitle:L,collapsed:s,onToggleCollapse:y,expandAriaLabel:p("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:p("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[T&&jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.dimension")}),jsx(Select,{value:k?.fieldId??"",onChange:v=>l(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:C.map(v=>jsx(MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))})]}),jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.primaryMeasure")}),jsx(Select,{value:b?.fieldId??"",onChange:v=>g(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:m.map(v=>jsx(MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))})]}),jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.secondaryMeasure")}),jsxs(Select,{value:x?.fieldId??"",onChange:v=>f(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("common.none")}),m.filter(v=>v.fieldId!==b?.fieldId).map(v=>jsx(MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))]})]}),jsxs(FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsx(Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.chartType")}),jsxs(Select,{value:d,onChange:v=>u(v.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barVertical")}),jsx(MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barHorizontal")}),jsx(MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.line")}),jsx(MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.scatter")})]})]})]}),jsx(Box,{children:k?b?P.length===0?jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoData")})}):d==="scatter"?jsx(lu,{data:P,primaryLabel:b.label,secondaryLabel:x?.label,formatPrimaryValue:w,formatSecondaryValue:E}):jsx(du,{data:P,chartType:d,primaryLabel:b.label,secondaryLabel:x?.label,formatPrimaryValue:w,formatSecondaryValue:E}):jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoValue")})}):jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoDimension")})})})]})};var us=({node:e,dataColumns:t,fieldMap:o,level:a,expandedKeys:r,onToggle:n,getValue:i})=>{let c=r.has(e.key),d=e.children.length>0,s=e.isGrandTotal;return jsxs(Fragment,{children:[jsxs(TableRow,{sx:l=>({bgcolor:s?l.palette.mode==="dark"?"rgba(25, 118, 210, 0.22)":"rgba(47, 91, 255, 0.08)":l.palette.mode==="dark"?"#111111":"background.paper","&:hover":{bgcolor:s?l.palette.mode==="dark"?"rgba(25, 118, 210, 0.28)":"rgba(47, 91, 255, 0.12)":l.palette.mode==="dark"?"#181818":"rgba(0, 0, 0, 0.02)"}}),children:[jsxs(TableCell,{sx:l=>({fontSize:"0.76rem",fontWeight:s?800:600,borderBottom:`1px solid ${l.palette.divider}`,whiteSpace:"nowrap",pl:a*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!s&&jsx(IconButton,{size:"small",onClick:()=>n(e.key),sx:{p:.2,mr:.5,ml:-1},children:c?jsx(of,{sx:{fontSize:16}}):jsx(Wg,{sx:{fontSize:16}})}),!d&&!s&&a>0&&jsx(Box,{sx:{width:20}}),e.value]}),t.map(l=>jsx(TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:s?800:500,borderBottom:g=>`1px solid ${g.palette.divider}`,whiteSpace:"nowrap"},children:En(i?i(e,l.id):e.aggregatedValues[l.id]??0,l.valueItem,o)},`${e.key}-${l.id}`))]}),c&&e.children.map(l=>jsx(us,{node:l,dataColumns:t,fieldMap:o,level:a+1,expandedKeys:r,onToggle:n,getValue:i},l.key))]})};var ac=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},fs=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",oc=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",Cu=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children.length>0&&(t.add(r.key),o(r.children));});};return o(e),t},Su=(e,t,o=0)=>e.length===0?o:e.reduce((a,r)=>r.children.length===0||!t.has(r.key)?Math.max(a,o+1):Math.max(a,Su(r.children,t,o+1)),o),X0=(e,t)=>{let o=[],a=r=>{r.forEach(n=>{if(n.children.length>0&&t.has(n.key)){a(n.children);return}o.push(n);});};return a(e),o},r2=({title:e,rows:t,fields:o,initialLayout:a,initialChart:r,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:s,enablePresetManagement:l=false,presets:g,defaultPresets:f,onPresetsChange:u,initialPresetId:y,onPresetApplied:I})=>{let{t:p}=K(),C=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),m=useRef(0),b=useRef(false),x=e??p("pivot.title.default"),k=n??p("pivot.empty"),L=useMemo(()=>({sum:p("pivot.agg.sum"),count:p("pivot.agg.count"),avg:p("pivot.agg.avg"),min:p("pivot.agg.min"),max:p("pivot.agg.max")}),[p]),P=useCallback(h=>L[h]??Gp[h],[L]),w=useMemo(()=>new Set(o.map(h=>h.id)),[o]),E=useMemo(()=>new Map(o.map(h=>[h.id,h])),[o]),[T,v]=useState(()=>pt(a?.rows,w)),[M,S]=useState(()=>pt(a?.columns,w)),[D,B]=useState(()=>pt(a?.filters,w)),[H,V]=useState(()=>{let h=a?.values??[],A=new Set,F=[];return h.forEach(W=>{if(!w.has(W.fieldId)||A.has(W.fieldId))return;A.add(W.fieldId),m.current+=1;let j=E.get(W.fieldId);F.push({tokenId:`v${m.current}`,fieldId:W.fieldId,aggregation:Mt(W.aggregation,j)});}),F}),[q,Y]=useState({}),[te,ae]=useState(true),[oe,Ft]=useState(false),[lt,Ke]=useState(()=>ac(pt(a?.rows,w),pt(a?.columns,w),r?.dimensionFieldId)),[ge,De]=useState(()=>{let h=(a?.values??[]).filter((A,F,W)=>w.has(A.fieldId)&&W.findIndex(j=>j.fieldId===A.fieldId)===F).map(A=>({tokenId:A.fieldId,fieldId:A.fieldId,aggregation:Mt(A.aggregation,E.get(A.fieldId))}));return fs(h,r?.primaryValueFieldId)}),[Fe,Je]=useState(()=>{let h=(a?.values??[]).filter((F,W,j)=>w.has(F.fieldId)&&j.findIndex(se=>se.fieldId===F.fieldId)===W).map(F=>({tokenId:F.fieldId,fieldId:F.fieldId,aggregation:Mt(F.aggregation,E.get(F.fieldId))})),A=fs(h,r?.primaryValueFieldId);return oc(h,A,r?.secondaryValueFieldId)}),[Tt,qe]=useState(r?.chartType??"bar-vertical"),[rt,$a]=useState(c),[wa,Ia]=useState(d),[Ta,Pa]=useState(()=>f??[]),[gt,$]=useState(""),[de,ne]=useState(false),[pe,$e]=useState(""),[Me,Jt]=useState(null),[la,ca]=useState(new Set(["__grand_total__"])),[da,pa]=useState(new Set),ke=s?.rowFields??T,ce=s?.columnFields??M,ft=s?.filterFields??D,Te=s?.valueFields??H,Pt=s?.filterSelections??q,ua=s?.showGrandTotal??te,Bo=s?.isConfiguratorCollapsed??oe,z=s?.chartDimensionFieldId??lt,O=s?.chartPrimaryValueFieldId??ge,G=s?.chartSecondaryValueFieldId??Fe,ue=s?.chartType??Tt,fe=s?.isChartCollapsed??rt,we=s?.isTableCollapsed??wa,ie=g??Ta,Pe=l||ie.length>0||!!u,ye=useCallback(h=>{if(s?.setRowFields){s.setRowFields(h);return}v(h);},[s]),Re=useCallback(h=>{if(s?.setColumnFields){s.setColumnFields(h);return}S(h);},[s]),Se=useCallback(h=>{if(s?.setFilterFields){s.setFilterFields(h);return}B(h);},[s]),he=useCallback(h=>{if(s?.setValueFields){s.setValueFields(h);return}V(h);},[s]),Ce=useCallback(h=>{if(s?.setFilterSelections){s.setFilterSelections(h);return}Y(h);},[s]),je=useCallback(h=>{if(s?.setShowGrandTotal){s.setShowGrandTotal(h);return}ae(h);},[s]),Rt=useCallback(h=>{if(s?.setIsConfiguratorCollapsed){s.setIsConfiguratorCollapsed(h);return}Ft(h);},[s]),ma=useCallback(h=>{if(s?.setChartDimensionFieldId){s.setChartDimensionFieldId(h);return}Ke(h);},[s]),$t=useCallback(h=>{if(s?.setChartPrimaryValueFieldId){s.setChartPrimaryValueFieldId(h);return}De(h);},[s]),ea=useCallback(h=>{if(s?.setChartSecondaryValueFieldId){s.setChartSecondaryValueFieldId(h);return}Je(h);},[s]),Ra=useCallback(h=>{if(s?.setChartType){s.setChartType(h);return}qe(h);},[s]),Fo=useCallback(h=>{if(s?.setIsChartCollapsed){s.setIsChartCollapsed(h);return}$a(h);},[s]),co=useCallback(h=>{if(s?.setIsTableCollapsed){s.setIsTableCollapsed(h);return}Ia(h);},[s]),Et=useCallback(h=>{let A=typeof h=="function"?h(ie):h;g||Pa(A),u?.(A);},[u,ie,g]),Ha=useMemo(()=>new Set([...ke,...ce,...ft]),[ke,ce,ft]),Eo=useMemo(()=>o.filter(h=>!Ha.has(h.id)),[o,Ha]),Lt=useMemo(()=>{let h=[...ke,...ce,...ft],A=new Set,F=[];return h.forEach(W=>{A.has(W)||(A.add(W),F.push(W));}),F},[ce,ft,ke]);useEffect(()=>{ye(h=>{let A=h.filter(F=>w.has(F));return oo(h,A)?h:A}),Re(h=>{let A=h.filter(F=>w.has(F));return oo(h,A)?h:A}),Se(h=>{let A=h.filter(F=>w.has(F));return oo(h,A)?h:A}),he(h=>{let A=h.filter(F=>w.has(F.fieldId)).map(F=>({...F,aggregation:Mt(F.aggregation,E.get(F.fieldId))}));return ts(h,A)?h:A});},[E,w]);let Ht=useMemo(()=>{let h={};return Lt.forEach(A=>{let F=new Set;t.forEach(W=>{F.add(ao(W[A]));}),h[A]=Array.from(F).sort((W,j)=>W.localeCompare(j));}),h},[Lt,t]);useEffect(()=>{Ce(h=>{let A={};return Lt.forEach(F=>{let W=Ht[F]??[],se=(h[F]??[]).filter(U=>W.includes(U)),N=Object.prototype.hasOwnProperty.call(h,F);A[F]=N?se:W;}),jp(h,A)?h:A});},[Lt,Ht]),useEffect(()=>{ma(h=>ac(ke,ce,h));},[ce,ke,ma]),useEffect(()=>{$t(h=>fs(Te,h));},[$t,Te]),useEffect(()=>{ea(h=>oc(Te,O,h));},[O,ea,Te]);let Dt=useMemo(()=>t.filter(h=>Lt.every(A=>{let F=Pt[A]??[],W=Ht[A]??[];if(F.length===W.length)return true;if(F.length===0)return false;let j=ao(h[A]);return F.includes(j)})),[Lt,Ht,Pt,t]),Ie=useMemo(()=>{if(Te.length===0)return null;let h=new Map;if(Dt.forEach(N=>{let U=ce.length>0?ce.map(_=>ao(N[_])):[p("pivot.valueLabel")],R=nr(U);h.set(R,U);}),h.size===0){let N=ce.length>0?ce.map(()=>Ji):[p("pivot.valueLabel")];h.set(nr(N),N);}let A=Array.from(h.entries()).sort((N,U)=>Zp(N[1],U[1])),F=A.flatMap(([N,U])=>Te.map(R=>{let _=E.get(R.fieldId),le=`${P(R.aggregation)} ${_?.label??R.fieldId}`,Ee=ce.length===0||Te.length>1?`${U.join(" / ")} \u2022 ${le}`:U.join(" / ");return {id:`${N}::${R.tokenId}`,colKey:N,valueItem:R,label:Ee}})),W=[];ce.length>0&&A.forEach(([N,U])=>{let R=F.filter(Ee=>Ee.colKey===N),_=W,le=[];U.forEach((Ee,Z)=>{le.push(`d${Z}:${Ee}`);let ee=`col::${nr(le)}`,ze=_.find(ct=>ct.key===ee);ze||(ze={key:ee,label:Ee,children:[],leafColumnIds:[],path:U.slice(0,Z+1),depth:Z},_.push(ze)),R.forEach(ct=>{ze.leafColumnIds.includes(ct.id)||ze.leafColumnIds.push(ct.id);}),_=ze.children;});});let j=N=>{let U={};return F.forEach(R=>{let _=N.filter(le=>{let Ee=ce.length>0?ce.map(Z=>ao(le[Z])):[p("pivot.valueLabel")];return nr(Ee)===R.colKey});U[R.id]=Vr(_,R.valueItem.fieldId,R.valueItem.aggregation);}),U},se=[];if(ke.length===0)se.push({key:"root",value:p("pivot.resultLabel")||$p,children:[],isLeaf:true,aggregatedValues:j(Dt),path:[],depth:0});else {let N=(U,R,_)=>{if(R>=ke.length)return [];let le=ke[R],Ee=new Map;return U.forEach(Z=>{let ee=ao(Z[le]);Ee.has(ee)||Ee.set(ee,[]),Ee.get(ee).push(Z);}),Array.from(Ee.keys()).sort().map(Z=>{let ee=Ee.get(Z),ze=[..._,Z];return {key:nr(ze),value:Z,fieldId:le,aggregatedValues:j(ee),children:N(ee,R+1,ze),isLeaf:R===ke.length-1,path:ze,depth:R}})};se.push(...N(Dt,0,[]));}return {dataColumns:F,columnTree:W,rowTree:se}},[ce,E,Dt,P,ke,p,Te]),ta=useCallback((h,A)=>(m.current+=1,{tokenId:`v${m.current}`,fieldId:h,aggregation:Mt(A,E.get(h))}),[E]),Lo=useCallback(h=>{if(h==="rows")return ye([]);if(h==="columns")return Re([]);if(h==="filters")return Se([]);he([]);},[]),No=useCallback((h,A)=>{if(h==="rows")return ye(F=>F.filter(W=>W!==A));if(h==="columns")return Re(F=>F.filter(W=>W!==A));if(h==="filters")return Se(F=>F.filter(W=>W!==A));he(F=>F.filter(W=>W.tokenId!==A));},[]),zo=useCallback((h,A)=>{he(F=>F.map(W=>W.tokenId===h?{...W,aggregation:Mt(A,E.get(W.fieldId))}:W));},[E]),Ga=useCallback(h=>{Jt(String(h.active.id));},[]),Da=useCallback(h=>{if(Jt(null),!h.over)return;let A=es(String(h.active.id)),F=es(String(h.over.id));if(!A||!F||A.kind!=="item"||!A.key)return;if(A.zone===F.zone&&F.kind==="item"){if(A.zone==="rows"){let Z=ke.indexOf(A.key),ee=ke.indexOf(F.key??"");Z!==-1&&ee!==-1&&Z!==ee&&ye(ze=>arrayMove(ze,Z,ee));return}if(A.zone==="columns"){let Z=ce.indexOf(A.key),ee=ce.indexOf(F.key??"");Z!==-1&&ee!==-1&&Z!==ee&&Re(ze=>arrayMove(ze,Z,ee));return}if(A.zone==="filters"){let Z=ft.indexOf(A.key),ee=ft.indexOf(F.key??"");Z!==-1&&ee!==-1&&Z!==ee&&Se(ze=>arrayMove(ze,Z,ee));return}if(A.zone==="values"){let Z=Te.findIndex(ze=>ze.tokenId===A.key),ee=Te.findIndex(ze=>ze.tokenId===(F.key??""));Z!==-1&&ee!==-1&&Z!==ee&&he(ze=>arrayMove(ze,Z,ee));}return}let W=F.zone,j=[...ke],se=[...ce],N=[...ft],U=[...Te],R="",_=null;if(A.zone==="palette")R=A.key;else if(A.zone==="values"){let Z=U.find(ee=>ee.tokenId===A.key);if(!Z)return;R=Z.fieldId,_=Z,U=U.filter(ee=>ee.tokenId!==A.key);}else A.zone==="rows"?(R=A.key,j=j.filter(Z=>Z!==R)):A.zone==="columns"?(R=A.key,se=se.filter(Z=>Z!==R)):A.zone==="filters"&&(R=A.key,N=N.filter(Z=>Z!==R));if(!R)return;let le=()=>{j=j.filter(Z=>Z!==R),se=se.filter(Z=>Z!==R),N=N.filter(Z=>Z!==R);},Ee=Z=>{if(F.kind!=="item"||!F.key)return Z==="rows"?j.length:Z==="columns"?se.length:Z==="filters"?N.length:Z==="values"?U.length:0;if(Z==="rows"){let ee=j.indexOf(F.key);return ee>=0?ee:j.length}if(Z==="columns"){let ee=se.indexOf(F.key);return ee>=0?ee:se.length}if(Z==="filters"){let ee=N.indexOf(F.key);return ee>=0?ee:N.length}if(Z==="values"){let ee=U.findIndex(ze=>ze.tokenId===F.key);return ee>=0?ee:U.length}return 0};if(W==="palette"){ye(j),Re(se),Se(N),he(U);return}if(W==="values"){let Z=Ee("values"),ee=_??ta(R);U.splice(Z,0,ee),ye(j),Re(se),Se(N),he(U);return}if(_p(W)){le();let Z=Ee(W);W==="rows"?j.splice(Z,0,R):W==="columns"?se.splice(Z,0,R):N.splice(Z,0,R),ye(j),Re(se),Se(N),he(U);}},[ce,ta,ft,ke,Te]),Ma=useCallback((h,A)=>{Ce(F=>({...F,[h]:A}));},[]),Vo=useCallback(h=>{ca(A=>{let F=new Set(A);return F.has(h)?F.delete(h):F.add(h),F});},[]),Oo=useCallback(h=>{pa(A=>{let F=new Set(A);return F.has(h)?F.delete(h):F.add(h),F});},[]),po=useCallback(h=>{let A=E.get(h.fieldId),F=Gl(A);return jsx(FormControl,{size:"small",sx:{minWidth:98},children:jsx(Select,{value:h.aggregation,onChange:W=>zo(h.tokenId,W.target.value),onClick:W=>W.stopPropagation(),onMouseDown:W=>W.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:F.map(W=>jsx(MenuItem,{value:W,sx:{fontSize:"0.75rem"},children:P(W)},W))})})},[E,P,zo]),Nt=useCallback(h=>{let A=Ht[h]??[],F=Pt[h]??A;return A.length===0?p("pivot.filter.noValues"):F.length===0?p("pivot.filter.noneSelected"):F.length===A.length?p("pivot.filter.allValues"):p("pivot.filter.selectedCount",{selected:F.length,total:A.length})},[Ht,Pt,p]),zt=useCallback(h=>{let A=Ht[h]??[],F=Pt[h]??A;return jsx(Yp,{options:A,selectedValues:F,onChange:W=>Ma(h,W)})},[Ht,Pt,Ma]),Aa=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Ua=useCallback(()=>{let h={};return new Set([...Lt,...Object.keys(Pt)]).forEach(F=>{if(!w.has(F))return;let W=Pt[F]??[];h[F]=[...W];}),{layout:{rows:[...ke],columns:[...ce],filters:[...ft],values:Te.map(F=>({fieldId:F.fieldId,aggregation:F.aggregation}))},filterSelections:h,showGrandTotal:ua,chart:{dimensionFieldId:z,primaryValueFieldId:O,secondaryValueFieldId:G,chartType:ue}}},[Lt,z,O,G,ue,ce,ft,Pt,ke,ua,w,Te]),Ka=useCallback(h=>{let A=pt(h.layout.rows,w),F=pt(h.layout.columns,w),W=pt(h.layout.filters,w),j=new Set,se=(h.layout.values??[]).filter(R=>!w.has(R.fieldId)||j.has(R.fieldId)?false:(j.add(R.fieldId),true)).map(R=>ta(R.fieldId,R.aggregation)),N={};Object.entries(h.filterSelections??{}).forEach(([R,_])=>{!w.has(R)||!Array.isArray(_)||(N[R]=Array.from(new Set(_.map(le=>String(le)))));}),ye(A),Re(F),Se(W),he(se),Ce(N),typeof h.showGrandTotal=="boolean"&&je(h.showGrandTotal),ma(ac(A,F,h.chart?.dimensionFieldId));let U=fs(se,h.chart?.primaryValueFieldId);$t(U),ea(oc(se,U,h.chart?.secondaryValueFieldId)),Ra(h.chart?.chartType??"bar-vertical"),$(h.id),I?.(h);},[ta,I,ma,$t,ea,Ra,Re,Se,Ce,ye,je,he,w]),Wo=useCallback(h=>{if(!h){$("");return}let A=ie.find(F=>F.id===h);if(!A){$("");return}Ka(A);},[Ka,ie]),$o=useCallback(()=>{let h=p("pivot.preset.defaultName",{index:ie.length+1});$e(h),ne(true);},[ie.length,p]),uo=useCallback(()=>{let h=pe.trim();if(!h)return;let A={id:Aa(),name:h,...Ua()};Et(F=>[...F,A]),$(A.id),ne(false);},[Ua,Aa,pe,Et]),mo=useCallback(()=>{gt&&(Et(h=>h.filter(A=>A.id!==gt)),$(""));},[gt,Et]);useEffect(()=>{if(!y||b.current)return;let h=ie.find(A=>A.id===y);h&&(b.current=true,Ka(h));},[Ka,y,ie]),useEffect(()=>{gt&&(ie.some(h=>h.id===gt)||$(""));},[gt,ie]);let qa=useMemo(()=>{if(!ua||!Ie||!ke.length)return null;let h={};return Ie.dataColumns.forEach(A=>{let F=Dt.filter(W=>{let j=ce.length>0?ce.map(se=>ao(W[se])):[p("pivot.valueLabel")];return nr(j)===A.colKey});h[A.id]=Vr(F,A.valueItem.fieldId,A.valueItem.aggregation);}),{key:"__grand_total__",value:p("pivot.grandTotal")||Hp,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:h,path:[],depth:-1}},[ua,Ie,Dt,ce,ke.length,p]),aa=useMemo(()=>Cu(Ie?.rowTree??[]),[Ie]),Ba=useMemo(()=>Cu(Ie?.columnTree??[]),[Ie]);useEffect(()=>{ca(h=>{let A=new Set;return h.has("__grand_total__")&&A.add("__grand_total__"),aa.forEach(F=>{h.has(F)&&A.add(F);}),A});},[aa]),useEffect(()=>{pa(h=>{let A=new Set;return Ba.forEach(F=>{h.has(F)&&A.add(F);}),A});},[Ba]);let fr=useCallback(()=>{ca(h=>{let A=new Set(h);return aa.forEach(F=>A.add(F)),A});},[aa]),Ho=useCallback(()=>{ca(h=>{let A=new Set;return h.has("__grand_total__")&&A.add("__grand_total__"),A});},[]),hr=useCallback(()=>{pa(new Set(Ba));},[Ba]),yr=useCallback(()=>{pa(new Set);},[]),br=useMemo(()=>!Ie||ce.length===0?[]:X0(Ie.columnTree,da),[ce.length,da,Ie]),Gt=useMemo(()=>{if(!Ie)return [];if(ce.length===0)return Ie.dataColumns.map(A=>({id:A.id,label:A.label,leafColumnIds:[A.id],valueItem:A.valueItem}));let h=new Map(Ie.dataColumns.map(A=>[A.id,A]));return br.flatMap(A=>{let F=new Map;return A.leafColumnIds.forEach(W=>{let j=h.get(W);if(!j)return;let se=j.valueItem.tokenId,N=`${P(j.valueItem.aggregation)} ${E.get(j.valueItem.fieldId)?.label??j.valueItem.fieldId}`,U=F.get(se);if(U){U.leafColumnIds.push(W);return}F.set(se,{id:`${A.key}::${se}`,label:Te.length>1?N:A.label,leafColumnIds:[W],valueItem:j.valueItem});}),Array.from(F.values())})},[ce.length,E,P,Ie,Te.length,br]),xr=useMemo(()=>new Map(Gt.map(h=>[h.id,h])),[Gt]),_a=useMemo(()=>Gt.map(h=>({id:h.id,colKey:h.id,valueItem:h.valueItem,label:h.label})),[Gt]),Fa=useMemo(()=>{if(!Ie||ce.length===0)return [];let h=[],A=Su(Ie.columnTree,da),F=A+(Te.length>1?1:0),W=(j,se)=>{h[se]??(h[se]=[]),j.forEach(N=>{let U=N.children.length>0&&da.has(N.key),R=Gt.filter(le=>N.leafColumnIds.some(Ee=>le.leafColumnIds.includes(Ee))).length,_=U||Te.length>1?1:F-se;h[se].push({key:N.key,label:N.label,colSpan:R,rowSpan:_,expandable:N.children.length>0,expanded:U}),U&&W(N.children,se+1);});};return W(Ie.columnTree,0),Te.length>1&&(h[A]=Gt.map(j=>({key:j.id,label:j.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),h},[ce.length,da,Ie,Te.length,Gt]),vr=useCallback((h,A)=>A.leafColumnIds.reduce((F,W)=>F+(h.aggregatedValues[W]??0),0),[]),Go=useMemo(()=>jsxs(Fragment,{children:[jsx(Button,{size:"small",variant:"text",onClick:fr,disabled:aa.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandRowsAll")}),jsx(Button,{size:"small",variant:"text",onClick:Ho,disabled:aa.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseRowsAll")}),jsx(Divider,{orientation:"vertical",flexItem:true}),jsx(Button,{size:"small",variant:"text",onClick:hr,disabled:Ba.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandColumnsAll")}),jsx(Button,{size:"small",variant:"text",onClick:yr,disabled:ce.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseColumnsAll")})]}),[ce.length,Ba.size,aa.size,yr,Ho,hr,fr,p]),go=()=>{if(!Me)return null;let h=es(Me);if(!h||h.kind!=="item"||!h.key)return null;if(h.zone==="palette"){let j=E.get(h.key);return j?jsx(Kl,{label:j.label,subtitle:j.type}):null}if(h.zone==="values"){let j=Te.find(R=>R.tokenId===h.key);if(!j)return null;let N=E.get(j.fieldId)?.label??j.fieldId,U=`${P(j.aggregation)}(${N})`;return jsx(is,{label:N,caption:U})}let F=E.get(h.key)?.label??h.key,W=Nt(h.key);return jsx(is,{label:F,caption:W})};return jsxs(Paper,{sx:h=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${h.palette.divider}`,bgcolor:"background.paper",boxShadow:h.palette.mode==="dark"?"none":"0 12px 28px rgba(15, 23, 42, 0.08)",display:"flex",flexDirection:"column",gap:2}),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:800},children:x}),jsx(Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:p("pivot.subtitle.default")})]}),jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[Pe&&jsxs(Fragment,{children:[jsx(FormControl,{size:"small",sx:{minWidth:200},children:jsxs(Select,{value:gt,displayEmpty:true,onChange:h=>Wo(String(h.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("pivot.preset.selectPlaceholder")}),ie.map(h=>jsx(MenuItem,{value:h.id,sx:{fontSize:"0.75rem"},children:h.name},h.id))]})}),jsx(Tooltip,{title:p("pivot.preset.save"),children:jsx(IconButton,{size:"small",onClick:$o,"aria-label":p("pivot.preset.save"),children:jsx(Kd,{sx:{fontSize:18}})})}),jsx(Tooltip,{title:p("pivot.preset.delete"),children:jsx("span",{children:jsx(IconButton,{size:"small",onClick:mo,disabled:!gt,"aria-label":p("pivot.preset.delete"),children:jsx(H0,{sx:{fontSize:18}})})})}),jsx(Divider,{flexItem:true,orientation:"vertical"})]}),jsxs(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[p("pivot.records"),": ",jsx("strong",{children:t.length.toLocaleString()})," / ",p("pivot.afterFilter"),":"," ",jsx("strong",{children:Dt.length.toLocaleString()})]}),jsx(Divider,{flexItem:true,orientation:"vertical"}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsx(Typography,{sx:{fontSize:"0.74rem"},children:p("pivot.grandTotal")}),jsx(Switch,{size:"small",checked:ua,onChange:h=>je(h.target.checked)})]})]})]}),jsx(Divider,{}),jsxs(DndContext,{sensors:C,collisionDetection:closestCenter,onDragStart:Ga,onDragEnd:Da,children:[jsx(iu,{isConfiguratorCollapsed:Bo,onToggleCollapse:()=>Rt(h=>!h),availableFields:Eo,fieldMap:E,filterFields:ft,columnFields:ce,rowFields:ke,valueFields:Te,clearZone:Lo,removeFieldFromZone:No,getFilterSelectionSummary:Nt,renderDimensionFilterSelect:zt,renderAggregationSelect:po,getAggregationLabel:P}),jsx(Portal,{children:jsx(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:go()})})]}),jsx(gu,{rows:Dt,fieldMap:E,rowFields:ke,columnFields:ce,valueFields:Te,chartDimensionFieldId:z,chartPrimaryValueFieldId:O,chartSecondaryValueFieldId:G,chartType:ue,isCollapsed:fe,onChartDimensionFieldIdChange:h=>ma(h),onChartPrimaryValueFieldIdChange:h=>$t(h),onChartSecondaryValueFieldIdChange:h=>ea(h),onChartTypeChange:h=>Ra(h),onToggleCollapse:()=>Fo(h=>!h),getAggregationLabel:P}),jsx(Gr,{title:p("pivot.table.sectionTitle"),subtitle:ke.length>0?ke.map(h=>E.get(h)?.label??h).join(" > "):p("pivot.table.dimensions"),collapsed:we,onToggleCollapse:()=>co(h=>!h),expandAriaLabel:p("pivot.table.collapse.ariaExpand"),collapseAriaLabel:p("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Go,children:Ie===null?jsx(Box,{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:k})}):jsx(TableContainer,{sx:{maxHeight:i},children:jsxs(Table,{size:"small",stickyHeader:true,children:[jsx(TableHead,{children:(Fa.length>0?Fa:[[]]).map((h,A)=>jsxs(TableRow,{children:[A===0&&jsx(TableCell,{rowSpan:Math.max(Fa.length,1),sx:F=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:F.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${F.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:ke.length>0?ke.map(F=>E.get(F)?.label).join(" > "):p("pivot.table.dimensions")}),(h.length>0?h:Gt.map(F=>({key:F.id,label:F.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(F=>jsx(TableCell,{align:"center",colSpan:F.colSpan,rowSpan:F.rowSpan,sx:W=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:W.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${W.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxs(Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[F.expandable&&jsx(IconButton,{size:"small",onClick:()=>Oo(F.key),sx:{p:.1,ml:-0.3},children:F.expanded?jsx(of,{sx:{fontSize:16}}):jsx(Wg,{sx:{fontSize:16}})}),jsx(Box,{component:"span",children:F.label})]})},F.key))]},`pivot-header-row-${A}`))}),jsxs(TableBody,{children:[Ie.rowTree.map(h=>jsx(us,{node:h,dataColumns:_a,fieldMap:E,level:0,expandedKeys:la,onToggle:Vo,getValue:(A,F)=>{let W=xr.get(F);return W?vr(A,W):0}},h.key)),qa&&jsx(us,{node:qa,dataColumns:_a,fieldMap:E,level:0,expandedKeys:la,onToggle:Vo,getValue:(h,A)=>{let F=xr.get(A);return F?vr(h,F):0}})]})]})})}),jsxs(Dialog,{open:de,onClose:()=>ne(false),maxWidth:"xs",fullWidth:true,children:[jsx(DialogTitle,{children:p("pivot.preset.saveDialogTitle")}),jsx(DialogContent,{children:jsx(TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:p("pivot.preset.nameLabel"),value:pe,onChange:h=>$e(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),uo());}})}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>ne(false),children:p("common.cancel")}),jsx(Button,{variant:"contained",onClick:uo,disabled:!pe.trim(),children:p("common.save")})]})]})]})};var wu=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},nc=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Iu=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",c2=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:a=true,initialConfiguratorCollapsed:r=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=useRef(0),s=useMemo(()=>new Set(e.map($=>$.id)),[e]),l=useMemo(()=>new Map(e.map($=>[$.id,$])),[e]),[g,f]=useState(()=>pt(t?.rows,s)),[u,y]=useState(()=>pt(t?.columns,s)),[I,p]=useState(()=>pt(t?.filters,s)),[C,m]=useState(()=>{let $=t?.values??[],de=new Set,ne=[];return $.forEach(pe=>{!s.has(pe.fieldId)||de.has(pe.fieldId)||(de.add(pe.fieldId),d.current+=1,ne.push({tokenId:`v${d.current}`,fieldId:pe.fieldId,aggregation:Mt(pe.aggregation,l.get(pe.fieldId))}));}),ne}),[b,x]=useState(o),[k,L]=useState(a),[P,w]=useState(r),[E,T]=useState(()=>wu(pt(t?.rows,s),pt(t?.columns,s),n?.dimensionFieldId)),[v,M]=useState(()=>{let $=(()=>{let de=t?.values??[],ne=new Set,pe=[];return de.forEach($e=>{!s.has($e.fieldId)||ne.has($e.fieldId)||(ne.add($e.fieldId),pe.push({tokenId:$e.fieldId,fieldId:$e.fieldId,aggregation:Mt($e.aggregation,l.get($e.fieldId))}));}),pe})();return nc($,n?.primaryValueFieldId)}),[S,D]=useState(()=>{let $=(()=>{let ne=t?.values??[],pe=new Set,$e=[];return ne.forEach(Me=>{!s.has(Me.fieldId)||pe.has(Me.fieldId)||(pe.add(Me.fieldId),$e.push({tokenId:Me.fieldId,fieldId:Me.fieldId,aggregation:Mt(Me.aggregation,l.get(Me.fieldId))}));}),$e})(),de=nc($,n?.primaryValueFieldId);return Iu($,de,n?.secondaryValueFieldId)}),[B,H]=useState(n?.chartType??"bar-vertical"),[V,q]=useState(i),[Y,te]=useState(c);useEffect(()=>{f($=>{let de=$.filter(ne=>s.has(ne));return oo($,de)?$:de}),y($=>{let de=$.filter(ne=>s.has(ne));return oo($,de)?$:de}),p($=>{let de=$.filter(ne=>s.has(ne));return oo($,de)?$:de}),m($=>{let de=$.filter(ne=>s.has(ne.fieldId)).map(ne=>({...ne,aggregation:Mt(ne.aggregation,l.get(ne.fieldId))}));return ts($,de)?$:de});},[l,s]),useEffect(()=>{T($=>wu(g,u,$));},[u,g]),useEffect(()=>{M($=>nc(C,$));},[C]),useEffect(()=>{D($=>Iu(C,v,$));},[v,C]);let ae=useCallback($=>{f(pt($,s));},[s]),oe=useCallback($=>{y(pt($,s));},[s]),Ft=useCallback($=>{p(pt($,s));},[s]),lt=useCallback($=>{m(de=>{let ne=$??[],pe=new Set,$e=[];return ne.forEach(Me=>{if(!s.has(Me.fieldId)||pe.has(Me.fieldId))return;pe.add(Me.fieldId);let Jt=de.find(la=>la.fieldId===Me.fieldId);if(Jt){$e.push({...Jt,aggregation:Mt(Me.aggregation??Jt.aggregation,l.get(Me.fieldId))});return}d.current+=1,$e.push({tokenId:`v${d.current}`,fieldId:Me.fieldId,aggregation:Mt(Me.aggregation,l.get(Me.fieldId))});}),$e});},[l,s]),Ke=useCallback($=>{ae($.rows??[]),oe($.columns??[]),Ft($.filters??[]),lt($.values??[]);},[oe,Ft,ae,lt]),ge=useCallback($=>{if($==="rows")return f([]);if($==="columns")return y([]);if($==="filters")return p([]);m([]);},[]),De=useCallback(($,de)=>{if($==="rows")return f(ne=>ne.filter(pe=>pe!==de));if($==="columns")return y(ne=>ne.filter(pe=>pe!==de));if($==="filters")return p(ne=>ne.filter(pe=>pe!==de));m(ne=>ne.filter(pe=>pe.tokenId!==de));},[]),Fe=useCallback(($,de)=>{m(ne=>ne.map(pe=>pe.tokenId===$?{...pe,aggregation:Mt(de,l.get(pe.fieldId))}:pe));},[l]),Je=useCallback(($,de)=>{x(ne=>({...ne,[$]:de}));},[]),Tt=useCallback(()=>{x({});},[]),qe=useCallback(()=>{L($=>!$);},[]),rt=useCallback(()=>{w($=>!$);},[]),$a=useCallback($=>{T($);},[]),wa=useCallback($=>{M($);},[]),Ia=useCallback($=>{D($);},[]),Ta=useCallback(()=>{q($=>!$);},[]),Pa=useCallback(()=>{te($=>!$);},[]);return {model:useMemo(()=>({rowFields:g,setRowFields:f,columnFields:u,setColumnFields:y,filterFields:I,setFilterFields:p,valueFields:C,setValueFields:m,filterSelections:b,setFilterSelections:x,showGrandTotal:k,setShowGrandTotal:L,isConfiguratorCollapsed:P,setIsConfiguratorCollapsed:w,chartDimensionFieldId:E,setChartDimensionFieldId:T,chartPrimaryValueFieldId:v,setChartPrimaryValueFieldId:M,chartSecondaryValueFieldId:S,setChartSecondaryValueFieldId:D,chartType:B,setChartType:H,isChartCollapsed:V,setIsChartCollapsed:q,isTableCollapsed:Y,setIsTableCollapsed:te}),[E,v,S,B,u,I,b,V,P,Y,g,k,C]),actions:{setRows:ae,setColumns:oe,setFilters:Ft,setValues:lt,setLayout:Ke,clearZone:ge,removeFieldFromZone:De,setAggregationForValue:Fe,setFilterSelection:Je,resetFilterSelections:Tt,toggleGrandTotal:qe,toggleConfigurator:rt,setChartDimension:$a,setChartPrimaryValue:wa,setChartSecondaryValue:Ia,setChartType:H,toggleChart:Ta,toggleTable:Pa}}};var g2=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let a=useTheme$1(),r=useMediaQuery("(orientation: portrait)",{noSsr:true}),n=useMediaQuery(a.breakpoints.down("md"),{noSsr:true}),i=useMemo(()=>e==="auto"?r||n?"portrait":"landscape":e,[n,r,e]),[c,d]=useState(t??i==="landscape");useEffect(()=>{d(t??i==="landscape");},[t,i]);let s=g=>{d(g),o?.(g);};return {resolvedOrientation:i,isPortraitViewport:r,isCompactViewport:n,navigationOpen:c,setNavigationOpen:s,toggleNavigationOpen:()=>s(!c)}};var rv=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},y2=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:a})=>{let n=e[0]?.[t],[i,c]=useState(a??n),d=useMemo(()=>e.find(u=>u[t]===i)||e[0],[t,e,i]),[s,l]=useState(()=>{let u=d?.[o];return u==null?"0":String(u)});return {selectedId:i,selectedRecord:d,editorValue:s,setEditorValue:l,selectRecord:u=>{let y=u[t];c(y);let I=u[o];l(I==null?"0":String(I));},applyEditorValue:u=>{if(i===void 0)return;let y=rv(s),I=e.map(p=>p[t]===i?{...p,[o]:y}:p);u(I);}}};var fv=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Au=(e,t,o,a)=>{t?.(e),a&&o?.();},S2=({open:e,onClose:t,title:o="Scan barcode",subtitle:a="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:r=fv,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:s="Use code",cancelLabel:l="Close",manualPlaceholder:g="Enter barcode manually",onDetected:f,onError:u,sx:y})=>{let I=mt__default.useRef(null),p=mt__default.useRef(null),C=mt__default.useRef(null),m=mt__default.useRef(null),[b,x]=mt__default.useState("idle"),[k,L]=mt__default.useState(""),[P,w]=mt__default.useState(null),[E,T]=mt__default.useState(null),v=mt__default.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null),p.current&&(p.current.getTracks().forEach(D=>D.stop()),p.current=null),I.current&&(I.current.srcObject=null);},[]),M=mt__default.useCallback(D=>{T(D),x("error"),u?.(D);},[u]);mt__default.useEffect(()=>{if(!e){v(),x("idle"),T(null),L("");return}let D=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){x("unsupported"),T("Camera access is not supported in this browser.");return}x("starting"),T(null);try{let H=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(D){H.getTracks().forEach(V=>V.stop());return}if(p.current=H,I.current&&(I.current.srcObject=H,await I.current.play()),!window.BarcodeDetector){x("unsupported"),T("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}m.current=new window.BarcodeDetector({formats:r}),x("ready"),C.current=window.setInterval(async()=>{if(!(!I.current||!m.current)&&!(I.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let q=(await m.current.detect(I.current)).find(te=>te.rawValue);if(!q?.rawValue)return;let Y={rawValue:q.rawValue,format:q.format};w(Y),v(),Au(Y,f,t,c);}catch(V){M(V instanceof Error?V.message:"Failed to detect barcode.");}},d);}catch(H){M(H instanceof Error?H.message:"Unable to start camera.");}}})(),()=>{D=true,v();}},[c,n,r,t,f,e,M,d,v]);let S=()=>{let D=k.trim();if(!D)return;let B={rawValue:D,format:"manual"};w(B),Au(B,f,t,c);};return jsxs(Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"sm",children:[jsx(DialogTitle,{sx:{fontSize:"1rem",fontWeight:900},children:o}),jsx(DialogContent,{sx:{pt:"8px !important"},children:jsxs(Stack,{spacing:2,sx:y,children:[jsx(Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:a}),jsxs(Paper,{elevation:0,sx:D=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:D.palette.mode==="dark"?"linear-gradient(180deg, rgba(15,23,42,0.92), rgba(2,6,23,0.96))":"linear-gradient(180deg, rgba(241,245,249,1), rgba(226,232,240,0.92))"}),children:[jsx("video",{ref:I,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),jsx(Box,{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(Box,{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:jsx(Box,{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"#38bdf8",boxShadow:"0 0 18px rgba(56,189,248,0.85)"}})})}),jsxs(Box,{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[jsx(Chip,{icon:jsx(mv,{}),label:b==="ready"?"Camera ready":b==="starting"?"Starting camera":b==="unsupported"?"Preview only":b==="error"?"Scanner error":"Idle",size:"small",color:b==="error"?"error":"primary",variant:"filled"}),P?jsx(Chip,{icon:jsx(gv,{}),label:`${P.format||"barcode"}: ${P.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),E?jsx(Alert,{severity:b==="unsupported"?"info":"warning",children:E}):null,i?jsxs(Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsx(TextField,{fullWidth:true,label:"Barcode",placeholder:g,value:k,onChange:D=>L(D.target.value)}),jsx(Button,{variant:"contained",onClick:S,sx:{minHeight:56,px:2.5},children:s})]}):null]})}),jsx(DialogActions,{sx:{px:3,pb:2},children:jsx(Button,{onClick:t,children:l})})]})};var xv={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},D2=({title:e,description:t,kicker:o,icon:a,badges:r=[],metrics:n=[],footer:i,children:c,selected:d=false,draggable:s=false,isDragging:l=false,swipeThreshold:g=88,startAction:f,endAction:u,dragHandleProps:y,onClick:I,onSwipe:p,sx:C})=>{let[m,b]=useState(0),[x,k]=useState(false),L=useRef(null),P=useRef(0),w=useRef(0),E=!!(f||u),T=132,v=()=>{b(0),k(false),L.current=null,P.current=0,w.current=0;},M=V=>{(V==="start"?f:u)?.onTrigger?.(),p?.(V),v();},S=V=>{!E||V.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(L.current=V.pointerId,P.current=V.clientX,w.current=V.clientX,k(true),V.currentTarget.setPointerCapture(V.pointerId));},D=V=>{if(!x||L.current!==V.pointerId)return;w.current=V.clientX;let q=w.current-P.current,Y=Math.max(-T,Math.min(T,q));b(Y);},B=V=>{if(!x||L.current!==V.pointerId)return;let q=w.current-P.current;if(q>=g&&f){M("start");return}if(q<=-g&&u){M("end");return}Math.abs(q)<12&&I?.(),v();},H=(V,q)=>{if(!V)return null;let Y=V.backgroundColor||xv[V.tone||"default"];return jsx(Box,{sx:{position:"absolute",top:0,bottom:0,[q]:0,width:T,px:2,display:"flex",alignItems:"center",justifyContent:q==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${Y}, rgba(15,23,42,0.92))`},children:jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[V.icon,jsx(Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:V.label})]})})};return jsxs(Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...C},children:[H(f,"left"),H(u,"right"),jsx(Paper,{elevation:0,onPointerDown:S,onPointerMove:D,onPointerUp:B,onPointerCancel:v,sx:V=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:V.palette.mode==="dark"?"linear-gradient(180deg, rgba(17,24,39,0.96), rgba(15,23,42,0.92))":"linear-gradient(180deg, #ffffff, #f8fafc)",boxShadow:d?"0 18px 42px rgba(37, 99, 235, 0.18)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${m}px, 0, 0) scale(${l?.985:1})`,transition:x?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:I?"pointer":"default",opacity:l?.9:1}),children:jsxs(Stack,{spacing:1.5,children:[jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[a?jsx(Box,{sx:{mt:.25},children:a}):null,jsxs(Box,{sx:{flex:1,minWidth:0},children:[o?jsx(Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:e}),t?jsx(Typography,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:t}):null]}),s?jsx(Box,{"data-no-swipe":"true",...y,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsx(IconButton,{size:"small",children:jsx(bv,{})})}):null]}),r.length>0?jsx(Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((V,q)=>jsx(Chip,{label:V,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover"}},q))}):null,n.length>0?jsx(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(V=>jsxs(Paper,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider"},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:V.label}),jsx(Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:V.value})]},V.id))}):null,c,i]})})]})};var Un=({label:e,onPress:t,emphasis:o="default"})=>jsx(Box,{component:"button",type:"button",onClick:t,sx:a=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?a.palette.primary.main:o==="danger"?a.palette.mode==="dark"?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.10)":a.palette.mode==="dark"?"rgba(255,255,255,0.04)":"#fff",color:o==="primary"?"#fff":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:e}),V2=({value:e,defaultValue:t="",title:o,subtitle:a,placeholder:r="0",allowDecimal:n=false,allowNegative:i=false,maxLength:c,confirmLabel:d,clearLabel:s,backspaceLabel:l,onChange:g,onSubmit:f,onClose:u,sx:y})=>{let{t:I}=K(),[p,C]=useState(t),m=e??p,b=v=>{e===void 0&&C(v),g?.(v);},x=v=>{c&&m.length>=c||b(`${m}${v}`);},k=v=>{if(v==="00"){if(!m){b("0");return}x("00");return}x(v);},L=()=>{!n||m.includes(".")||b(m?`${m}.`:"0.");},P=()=>{if(i){if(m.startsWith("-")){b(m.slice(1));return}b(m?`-${m}`:"-");}},w=()=>{b(m.slice(0,-1));},E=()=>{b("");},T=()=>{f?.(m);};return jsx(Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",background:"background.paper",...y},children:jsxs(Stack,{spacing:2,children:[jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxs(Box,{sx:{minWidth:0},children:[o?jsx(Typography,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,a?jsx(Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:a}):null]}),u?jsx(IconButton,{onClick:u,size:"small",children:jsx(Sv,{})}):null]}),jsx(Paper,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsx(Typography,{sx:{minHeight:38,fontSize:m?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:m?"text.primary":"text.disabled"},children:m||r})}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(v=>jsx(Un,{label:v,onPress:()=>k(v)},v)),jsx(Un,{label:i?"+/-":"00",onPress:i?P:()=>k("00")}),jsx(Un,{label:"0",onPress:()=>k("0")}),jsx(Un,{label:n?".":l?String(l):"DEL",onPress:n?L:w})]}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[jsx(Box,{component:"button",type:"button",onClick:w,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",background:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsx(kv,{}),jsx(Typography,{sx:{fontWeight:700},children:l||"DEL"})]})}),jsx(Un,{label:String(s||"CLR"),onPress:E,emphasis:"danger"}),jsx(Box,{component:"button",type:"button",onClick:T,sx:v=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:v.palette.primary.main,color:"#fff",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsx(wv,{}),jsx(Typography,{sx:{fontWeight:800},children:d||I("common.ok")})]})})]})]})})};var Nu=({touchMode:e="comfortable",sx:t,...o})=>{let a=e==="expanded";return jsx(Box,{sx:{"& .MuiPaper-root":{borderRadius:4},"& .MuiAutocomplete-root":{minWidth:{xs:"100%",md:260}},"& .MuiAutocomplete-root .MuiInputBase-root":{backgroundColor:"transparent !important"},"& .MuiInputBase-root":{minHeight:a?56:50,borderRadius:3,fontSize:a?"0.98rem":"0.92rem"},"& .MuiInputBase-input":{py:a?1.6:1.25,fontSize:a?"0.98rem":"0.92rem"},"& .MuiInputLabel-root":{fontSize:a?"0.95rem":"0.88rem"},"& .MuiButton-root":{minHeight:a?48:44,px:a?2.25:1.75,borderRadius:3,fontSize:a?"0.95rem":"0.88rem",fontWeight:700},"& .MuiIconButton-root":{width:a?40:36,height:a?40:36},"& .MuiMenuItem-root":{minHeight:a?44:38,fontSize:a?"0.95rem":"0.88rem"},"& .MuiListSubheader-root":{py:1},"& .MuiCheckbox-root":{p:a?1:.75},"& .MuiFormControlLabel-label":{fontSize:a?"0.95rem":"0.88rem"},"& .MuiDialog-paper":{borderRadius:4},"& .MuiDialogTitle-root":{fontSize:a?"1.05rem":"0.98rem",fontWeight:800},"& .MuiDialogContent-root .MuiInputBase-root":{minHeight:52},'& .MuiGrid-root > .MuiGrid-item, & .MuiGrid-root > .MuiGrid-sizeXs-1, & .MuiGrid-root > [class*="MuiGrid-grid-"]':{minWidth:0},...t},children:jsx(Yo,{...o})})};var Dv=(e,t,o)=>{if(o?.(t),!!t.href){if(t.href.startsWith("http://")||t.href.startsWith("https://")){window.open(t.href,"_blank");return}e.push(t.href);}},Ou=({items:e,selectedId:t,orientation:o="auto",onItemSelect:a,sx:r})=>{let n=useTheme$1(),i=useMediaQuery("(orientation: portrait)"),c=useMediaQuery(n.breakpoints.down("md")),d=o==="auto"?i||c?"portrait":"landscape":o,s=useRouter();return jsx(Box,{sx:{display:"grid",gridTemplateColumns:d==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...r},children:e.map(l=>{let g=l.id===t,f=l.color||(g?n.palette.primary.main:n.palette.divider);return jsx(Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:g?"primary.main":"divider",boxShadow:g?"0 18px 40px rgba(37, 99, 235, 0.16)":"none"},children:jsx(Box,{component:"button",type:"button",disabled:l.disabled,onClick:()=>Dv(s,l,a),sx:{width:"100%",p:2,minHeight:d==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:l.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:jsxs(Stack,{spacing:1.5,sx:{height:"100%"},children:[jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsx(Box,{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:g?"#fff":"text.primary",background:g?f:"action.hover"},children:l.icon||jsx(Typography,{sx:{fontSize:"1rem",fontWeight:900},children:l.title.slice(0,1).toUpperCase()})}),l.badge!==void 0?jsx(Box,{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:g?"primary.main":"action.hover",color:g?"#fff":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:l.badge}):null]}),jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:l.title}),l.caption?jsx(Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:l.caption}):null,l.description?jsx(Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:l.description}):null]})]})})},l.id)})})};var Gu=(e,t)=>t.trim()?e.reduce((o,a)=>{let r=a.title?.toLowerCase().includes(t.toLowerCase())||a.label?.toLowerCase().includes(t.toLowerCase())||a.description?.toLowerCase().includes(t.toLowerCase()),n=a.children?Gu(a.children,t):[];return (r||n.length>0)&&o.push({...a,children:n.length>0?n:a.children}),o},[]):e,Hv=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children?.length&&(t.add(r.id),o(r.children));});};return o(e),t},Uu=({collapsed:e=false,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light",orientation:i="auto",headerSlot:c,footerSlot:d,activeHref:s,onItemSelect:l})=>{let{t:g}=K(),f=useTheme$1(),u=useMediaQuery("(orientation: portrait)"),y=useMediaQuery(f.breakpoints.down("md")),I=i==="auto"?u||y?"portrait":"landscape":i,p=n==="dark",C=useRouter(),m=usePathname(),[b,x]=useState(""),[k,L]=useState(new Set),P=useMemo(()=>Gu(r,b),[r,b]),w=useMemo(()=>b.trim()?Hv(P):k,[k,P,b]);useEffect(()=>{e&&L(new Set);},[e]);let E=D=>D.appurl||D.href||"",T=D=>{l?.(D);let B=E(D);if(B){if(B.startsWith("http://")||B.startsWith("https://")){window.open(B,"_blank");return}C.push(B);}},v=D=>{let B=!!D.children?.length;if(e&&B){t?.();return}if(B){L(H=>{let V=new Set(H);return V.has(D.id)?V.delete(D.id):V.add(D.id),V});return}T(D);},M=D=>{let B=s||m,H=E(D);return !!(H&&B===H)},S=(D,B=0)=>{let H=!!D.children?.length,V=w.has(D.id),q=M(D);return jsx(Box,{sx:{pl:B===0?0:1.5},children:jsxs(Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:q?"primary.main":"divider",bgcolor:q?"action.selected":"background.paper"},children:[jsxs(Box,{component:"button",type:"button",onClick:()=>v(D),sx:{width:"100%",px:1.5,py:1.4,display:"flex",alignItems:"center",gap:1.25,border:0,background:"transparent",textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:[jsx(Avatar,{variant:"rounded",sx:{width:40,height:40,bgcolor:q?"primary.main":"action.hover",color:q?"#fff":"text.primary"},children:D.icon||(D.title||D.label||"?").slice(0,1).toUpperCase()}),jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:D.title||D.label}),D.description?jsx(Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:D.description}):null]}),H?jsx(Wv,{sx:{transform:V?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsx($v,{color:"action"})]}),H?jsx(Collapse,{in:V,children:jsx(Box,{sx:{px:1.25,pb:1.25},children:D.children?.map(Y=>S(Y,B+1))})}):null]})},D.id)};return e?jsx(Paper,{elevation:0,className:o,sx:{width:I==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:p?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}px`:void 0,overflowY:"auto"},children:jsxs(Stack,{spacing:1,children:[jsx(IconButton,{onClick:t,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:g("navigation.expand"),children:jsx(Ov,{})}),r.map(D=>jsx(IconButton,{onClick:()=>v(D),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:M(D)?"primary.main":"action.hover",color:M(D)?"#fff":"text.primary"},children:D.icon||(D.title||D.label||"?").slice(0,1).toUpperCase()},D.id))]})}):jsx(Paper,{elevation:0,className:o,sx:{width:I==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:p?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxs(Stack,{spacing:1.25,sx:{flex:1,minHeight:0},children:[jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsx(TextField,{value:b,onChange:D=>x(D.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsx(zv,{fontSize:"small",color:"action"})}}),I==="landscape"?jsx(IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsx(Vv,{})}):null]}),c,jsx(Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:P.length>0?P.map(D=>S(D)):jsx(Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),d]})})};var Yu=(e,t)=>{let o=t[e.id];if(e.render)return e.render(o,t);if(o==null||o==="")return "--";if(e.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},Zv=e=>mt__default.isValidElement(e)?jsx(Box,{sx:{display:"inline-flex",alignItems:"center"},children:e}):jsx(Typography,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:e}),jv=(e,t)=>{let o=t[e.id];if(o==null||o==="")return "--";if(e.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},Qv=({summaryRow:e,visibleColumns:t,columns:o})=>{let a=o.filter(r=>t.includes(r.id)&&e[r.id]!=="");return a.length===0?null:jsx(Paper,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxs(Stack,{spacing:1,children:[jsx(Typography,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:a.map(r=>jsxs(Paper,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:r.label}),jsx(Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[r.id]})]},`summary-${r.id}`))})]})})},Xv=e=>{let{t}=K(),o=useTheme$1(),{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:s,fitContainer:l=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:y=[20,50,100,-1],onLayoutSave:I,filterConfig:p,rowKey:C,tableKey:m="default",graphReport:b,quickCreate:x,quickEdit:k,quickDelete:L,serviceUrl:P,orientation:w="auto",cardTitleField:E,cardSubtitleFields:T,toolbarSlot:v,emptyState:M,rowHeight:S="comfortable",cardActionSlot:D,renderCardFooter:B,onRowClick:H}=e,V=a||t("table.title.default"),q=useMediaQuery("(orientation: portrait)"),Y=useMediaQuery(o.breakpoints.down("md")),te=w==="auto"?q||Y?"portrait":"landscape":w,{columns:ae,filterText:oe,setFilterText:Ft,visibleColumns:lt,showSummary:Ke,setShowSummary:ge,summaryColumns:De,grouping:Fe,setGrouping:Je,expandedGroups:Tt,groupAnchorEl:qe,setGroupAnchorEl:rt,summaryAnchorEl:$a,setSummaryAnchorEl:wa,anchorEl:Ia,setAnchorEl:Ta,contextMenu:Pa,sortedAndFilteredRows:gt,summaryRow:$,visibleRows:de,page:ne,setPage:pe,rowsPerPage:$e,setRowsPerPage:Me,totalDisplayCount:Jt,setSelected:la,handleClick:ca,toggleSummaryColumn:da,handleExport:pa,handleCloseContextMenu:ke,toggleColumnVisibility:ce,toggleGroupExpand:ft,toggleGroupField:Te,handleExpandGroupRecursively:Pt,handleCollapseGroupRecursively:ua,handleLayoutLoad:Bo,handleVariantLoad:z,handleLayoutSave:O,effectiveAppId:G,currentLayoutData:ue,currentLayoutId:fe,layoutIdToLoad:we,graphReportOpen:ie,handleOpenGraphReport:Pe,handleCloseGraphReport:ye}=Ei(e),Re=b?.enabled??false,Se=Re&&(b?.interaction?.enabled??true),he=Ci(),Ce=C||"id",je=mt__default.useMemo(()=>{let R=new Set(i);return gt.filter(_=>R.has(_?.[Ce]))},[Ce,i,gt]),Rt=je.length===1?je[0]:null,ma=!!x?.enabled,$t=!!k?.enabled,ea=!!L?.enabled,Ra=x?.fields,Fo=x?.excludeFields||[],co=x?.initialValues||{},Et=k?.fields,Ha=k?.excludeFields||[],Eo=k?.editableFields||[],Lt=k?.nonEditableFields||[],Ht=k?.primaryKeys?.length?k.primaryKeys:[Ce],[Dt,Ie]=mt__default.useState(false),[ta,Lo]=mt__default.useState(false),[No,zo]=mt__default.useState({}),[Ga,Da]=mt__default.useState(false),[Ma,Vo]=mt__default.useState(false),[Oo,po]=mt__default.useState({}),[Nt,zt]=mt__default.useState(false),[Aa,Ua]=mt__default.useState(false),Ka=u||ta||Ma||Aa,Wo=mt__default.useMemo(()=>{let R=[...ae];if(Array.isArray(Ra)&&Ra.length>0){let _=new Set(Ra);R=R.filter(le=>_.has(le.id));}if(Fo.length>0){let _=new Set(Fo);R=R.filter(le=>!_.has(le.id));}return R.filter(_=>!!_?.id)},[ae,Fo,Ra]),$o=mt__default.useMemo(()=>{let R=[...ae];if(Array.isArray(Et)&&Et.length>0){let _=new Set(Et);R=R.filter(le=>_.has(le.id));}if(Ha.length>0){let _=new Set(Ha);R=R.filter(le=>!_.has(le.id));}return R.filter(_=>!!_?.id)},[ae,Ha,Et]),uo=mt__default.useMemo(()=>new Set(Ht),[Ht]),mo=mt__default.useMemo(()=>new Set(Eo),[Eo]),qa=mt__default.useMemo(()=>new Set(Lt),[Lt]),aa=mt__default.useCallback(R=>mo.size>0?mo.has(R):!(qa.has(R)||uo.has(R)),[mo,qa,uo]);mt__default.useEffect(()=>{!ie&&he.hasActiveFilters&&he.clearAll();},[he,ie]);let Ba=()=>{let R={};Wo.forEach(_=>{R[_.id]=co[_.id]??"";}),zo(R),Ie(true);},fr=(R,_)=>{zo(le=>({...le,[R]:_}));},Ho=async()=>{if(!x?.onSubmit){Ie(false);return}try{Lo(!0),await x.onSubmit(No),Ie(!1);}finally{Lo(false);}},hr=()=>{if(!Rt)return;let R={};$o.forEach(le=>{R[le.id]=Rt[le.id]??"";});let _=k?.getInitialValues?{...R,...k.getInitialValues(Rt)}:R;po(_),Da(true);},yr=(R,_)=>{po(le=>({...le,[R]:_}));},br=async()=>{if(Rt){if(!k?.onSubmit){Da(false);return}try{Vo(!0),await k.onSubmit(Oo,Rt),Da(!1);}finally{Vo(false);}}},Gt=()=>{je.length!==0&&zt(true);},xr=async()=>{if(je.length===0){zt(false);return}if(!L?.onConfirm){zt(false),la([]),c?.([]);return}try{Ua(!0),await L.onConfirm(je),zt(!1),la([]),c?.([]);}finally{Ua(false);}},_a=gt,{fieldMapping:Fa}=Ar({rows:_a,config:{...b,title:b?.title||`${V} ${t("graph.reportTitle")}`}}),vr=mt__default.useMemo(()=>Se?he.applyRows(_a,Fa):_a,[Fa,he,Se,_a]),{model:Go}=Ar({rows:vr,config:{...b,title:b?.title||`${V} ${t("graph.reportTitle")}`,fieldMapping:Fa}}),go=Go.table.columns.map(R=>({id:R.id,label:R.label,align:R.align||"left",minWidth:120,numeric:R.align==="right"})),h=G?jsx(Ai,{appId:G,tableKey:m,currentLayoutData:ue,onLayoutLoad:Bo,targetLayoutId:we,activeLayoutId:fe,serviceUrl:P??p?.serviceUrl}):null,A=ae.filter(R=>lt.includes(R.id)),F=A.find(R=>R.id===E)||A[0],W=T?.map(R=>A.find(_=>_.id===R)).filter(Boolean)||A.filter(R=>R.id!==F?.id).slice(0,te==="portrait"?2:3),j=A.filter(R=>R.id!==F?.id&&!W.some(_=>_.id===R.id)),se=[v,s].filter(Boolean),N=jsxs(Fragment,{children:[jsx(ei,{groupAnchorEl:qe,setGroupAnchorEl:rt,grouping:Fe,setGrouping:Je,columns:ae,toggleGroupField:Te}),jsx(ti,{anchorEl:Ia,setAnchorEl:Ta,columns:ae,visibleColumns:lt,toggleColumnVisibility:ce}),jsx(ai,{anchorEl:$a,setAnchorEl:wa,showSummary:Ke,setShowSummary:ge,columns:ae,summaryColumns:De,toggleSummaryColumn:da}),jsx(oi,{contextMenu:Pa,handleCloseContextMenu:ke,columns:ae,visibleColumns:lt,toggleColumnVisibility:ce})]}),U=(R,_,le)=>{let Ee=i.includes(_),Z=te==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",ee=le%2===0?alpha(o.palette.primary.main,.04):alpha(o.palette.primary.main,.022),ze=alpha(o.palette.divider,.22);return jsx(Paper,{elevation:0,onClick:()=>{ca({},R),H?.(R);},sx:{p:S==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Ee?alpha(o.palette.primary.main,.38):ze,background:Ee?`linear-gradient(135deg, ${alpha(o.palette.primary.main,.13)}, ${alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${ee}, ${alpha(o.palette.primary.main,.015)})`,boxShadow:Ee?`0 12px 30px ${alpha(o.palette.primary.main,.2)}`:`0 3px 10px ${alpha(o.palette.common.black,.045)}`,cursor:"pointer",position:"relative",overflow:"hidden",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background 160ms ease","&::before":{content:'""',position:"absolute",left:0,top:0,bottom:0,width:4,background:Ee?o.palette.primary.main:le%2===0?alpha(o.palette.primary.main,.26):alpha(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${alpha(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:jsxs(Stack,{spacing:1.25,children:[jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[n?jsx(Checkbox,{checked:Ee,onClick:ct=>ct.stopPropagation(),onChange:()=>ca({},R),sx:{mt:-0.6,ml:-0.6}}):null,jsxs(Box,{sx:{flex:1,minWidth:0},children:[F?jsx(Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Yu(F,R)}):null,W.length>0?jsx(Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:W.map(ct=>jsx(Chip,{label:`${ct.label}: ${jv(ct,R)}`,size:"small",variant:"outlined",sx:{borderRadius:999,fontWeight:600}},`${_}-${ct.id}`))}):null]}),D?jsx(Box,{onClick:ct=>ct.stopPropagation(),children:D(R)}):null]}),j.length>0?jsx(Box,{sx:{display:"grid",gridTemplateColumns:Z,gap:1},children:j.map(ct=>jsxs(Paper,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:alpha(o.palette.background.paper,.8),border:"0.1px solid",borderColor:alpha(o.palette.divider,.24)},children:[jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:ct.label}),Zv(Yu(ct,R))]},`${_}-${ct.id}-detail`))}):null,B?jsxs(Fragment,{children:[jsx(Divider,{}),jsx(Box,{onClick:ct=>ct.stopPropagation(),children:B(R)})]}):null]})},_)};return jsxs(Box,{sx:{width:g?"100%":"auto",mb:l?0:2,...l?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p?jsx(Box,{sx:{mb:2},children:jsx(Nu,{...p,onVariantLoad:R=>{z(R),p.onVariantLoad?.(R);},appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:ue}],currentLayoutId:fe,layoutRefs:[{tableKey:m,layoutId:fe}],variantService:p.variantService,serviceUrl:P??p.serviceUrl,touchMode:te==="portrait"?"expanded":"comfortable"})}):null,jsxs(Paper,{sx:{width:g?"100%":"auto",mb:l?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Ka?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f?{height:f}:l?{flex:1,minHeight:0,height:"100%"}:{}},children:[r?jsx(Box,{sx:{"& .MuiToolbar-root":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .MuiToolbar-root > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .MuiTextField-root":{width:{xs:"100%",md:300}}},"& .MuiToolbar-root > :nth-of-type(2)":{flexShrink:0},"& .MuiToolbar-root > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .MuiToolbar-root > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .MuiInputBase-root":{minHeight:46},"& .MuiIconButton-root":{width:40,height:40},"& .MuiTypography-root":{fontSize:"0.9rem"},"& .MuiButtonBase-root":{borderRadius:2.5}},children:jsx(Qn,{filterText:oe,setFilterText:Ft,onRowsPerPageChange:Me,rowsPerPage:$e,rowsPerPageOptions:y,page:ne,count:Jt,onPageChange:pe,actions:d,extraTools:se,grouping:Fe,setGroupAnchorEl:rt,showSummary:Ke,setShowSummary:ge,setAnchorEl:Ta,setSummaryAnchorEl:wa,handleExport:pa,showCreateButton:ma,onOpenCreateDialog:Ba,showEditButton:$t,onOpenEditDialog:hr,editDisabled:je.length!==1,showDeleteButton:ea,onOpenDeleteConfirm:Gt,deleteDisabled:je.length===0,onLayoutSave:I||p?.variantService&&p?.appId?O:void 0,loading:u,layoutManager:h,onOpenGraphReport:Re?Pe:void 0})}):null,jsx(Box,{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:jsxs(Stack,{spacing:1.25,children:[de.length===0&&!u?M||jsx(Paper,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:t("common.noData")})}):null,de.map((R,_)=>{if(R.type==="group"){let Z=Tt.has(R.id);return jsx(Paper,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxs(Box,{component:"button",type:"button",onClick:()=>ft(R.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none"},children:[Z?jsx(Wv,{}):jsx($v,{}),jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsxs(Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[R.field,": ",R.value]}),jsxs(Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[R.count," records"]})]}),Fe.length>1&&R.level<Fe.length-1?jsxs(Stack,{direction:"row",spacing:.5,children:[jsx(Chip,{size:"small",label:t("table.group.expandAll"),onClick:ee=>{ee.stopPropagation(),Pt(R.id);}}),jsx(Chip,{size:"small",label:t("table.group.collapseAll"),onClick:ee=>{ee.stopPropagation(),ua(R.id);}})]}):null]})},R.id)}let le=R.data||R,Ee=R.id||le[Ce]||_;return U(le,Ee,_)}),Ke?jsx(Qv,{summaryRow:$,visibleColumns:lt,columns:ae}):null,u?jsx(Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),ma?jsxs(Dialog,{open:Dt,onClose:()=>!ta&&Ie(false),fullWidth:true,maxWidth:"sm",children:[jsx(DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:x?.title||t("quickCreate.createWithTitle",{title:V})}),jsx(DialogContent,{sx:{pt:"8px !important"},children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Wo.map(R=>{let _=R.type==="number"||R.numeric?"number":R.type==="date"?"date":"text";return jsx(TextField,{label:R.label||R.id,value:No[R.id]??"",onChange:le=>fr(R.id,le.target.value),type:_,fullWidth:true,InputLabelProps:{shrink:_==="date"?true:void 0}},`quick-create-${R.id}`)}),x?.description?jsx(Alert,{severity:"info",children:x.description}):null]})}),jsxs(DialogActions,{sx:{px:3,pb:2},children:[jsx(Button,{onClick:()=>Ie(false),disabled:ta,children:x?.cancelLabel||t("common.cancel")}),jsx(Button,{onClick:Ho,variant:"contained",disabled:ta,children:x?.submitLabel||t("common.save")})]})]}):null,$t?jsxs(Dialog,{open:Ga,onClose:()=>!Ma&&Da(false),fullWidth:true,maxWidth:"sm",children:[jsx(DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:k?.title||t("quickEdit.editWithTitle",{title:V})}),jsx(DialogContent,{sx:{pt:"8px !important"},children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[$o.map(R=>{let _=R.type==="number"||R.numeric?"number":R.type==="date"?"date":"text";return jsx(TextField,{label:R.label||R.id,value:Oo[R.id]??"",onChange:le=>yr(R.id,le.target.value),type:_,disabled:!aa(R.id),fullWidth:true,InputLabelProps:{shrink:_==="date"?true:void 0}},`quick-edit-${R.id}`)}),k?.description?jsx(Alert,{severity:"info",children:k.description}):null]})}),jsxs(DialogActions,{sx:{px:3,pb:2},children:[jsx(Button,{onClick:()=>Da(false),disabled:Ma,children:k?.cancelLabel||t("common.cancel")}),jsx(Button,{onClick:br,variant:"contained",disabled:Ma||!Rt,children:k?.submitLabel||t("common.save")})]})]}):null,ea?jsx(rn,{open:Nt,type:"warning",title:L?.title||t("quickDelete.confirmTitle"),message:L?.message||(je.length>1?t("quickDelete.confirmMessageMultiple",{count:je.length}):t("quickDelete.confirmMessageSingle")),confirmText:L?.confirmText||t("common.delete"),cancelText:L?.cancelText||t("common.cancel"),onClose:()=>!Aa&&zt(false),onConfirm:xr}):null,N,Re?jsx(xi,{open:ie,onClose:ye,model:Go,aiAssistant:b?.aiAssistant,interaction:Se?{enabled:true,filters:he.filters,fieldMapping:Fa,onPrimaryDimensionClick:R=>he.setFilter("primaryDimension",R),onSecondaryDimensionClick:R=>he.setFilter("secondaryDimension",R),onStatusClick:R=>he.setFilter("status",R),onClearFilter:he.clearFilter,onClearAll:he.clearAll}:void 0,tableContent:jsx(Xv,{appId:G||"graph-report-internal",title:t("graph.dataBody"),columns:go,rows:Go.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var BB=({appTitle:e,children:t,menuData:o=[],workloadItems:a=[],workloadSelectedId:r,showNavigation:n=true,showWorkloadNav:i=true,orientation:c="auto",logo:d,headerSlot:s,actionSlot:l,portraitBottomSlot:g,contentSx:f,containerSx:u,user:y,onSearch:I,defaultNavigationOpen:p,navOpen:C,onNavOpenChange:m,onWorkloadSelect:b})=>{let x=useTheme$1(),k=useMediaQuery("(orientation: portrait)",{noSsr:true}),L=useMediaQuery(x.breakpoints.down("md"),{noSsr:true}),P=c==="auto"?k||L?"portrait":"landscape":c,[w,E]=useState(p??false),[T,v]=useState(""),[M,S]=useState(false),D=C??w;useEffect(()=>{S(true);},[]),useEffect(()=>{C===void 0&&E(P==="landscape");},[C,P]);let B=q=>{C===void 0&&E(q),m?.(q);},H=jsxs(Paper,{elevation:0,sx:{px:2,py:1.25,borderRadius:0,borderBottom:"1px solid",borderColor:"divider",background:x.palette.mode==="dark"?"linear-gradient(180deg, rgba(15,23,42,0.96), rgba(17,24,39,0.92))":"linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94))"},children:[jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[n?jsx(IconButton,{onClick:()=>B(!D),sx:{bgcolor:"action.hover"},children:jsx(Ov,{})}):null,d?jsx(Box,{sx:{display:"grid",placeItems:"center"},children:d}):null,jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:900},children:e}),jsx(Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:M?P==="portrait"?"Pad portrait workspace":"Pad landscape workspace":"Pad workspace"})]}),jsx(Box,{sx:{flex:1}}),I?jsx(TextField,{value:T,onChange:q=>v(q.target.value),onKeyDown:q=>{q.key==="Enter"&&I(T);},size:"small",placeholder:"Search...",sx:{minWidth:{md:240},display:{xs:"none",sm:"block"}},InputProps:{startAdornment:jsx(zv,{fontSize:"small",color:"action"})}}):null,l,y?jsxs(Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsx(Avatar,{src:y.avatarSrc,sx:{width:38,height:38},children:y.avatarText||y.name.slice(0,1).toUpperCase()}),jsxs(Box,{sx:{display:{xs:"none",md:"block"}},children:[jsx(Typography,{sx:{fontSize:"0.86rem",fontWeight:800},children:y.name}),y.subtitle?jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:y.subtitle}):null]})]}):null]}),s?jsx(Box,{sx:{mt:1.25},children:s}):null]}),V=jsx(Uu,{collapsed:P==="landscape"?!D:false,onToggle:()=>B(!D),menuData:o,orientation:P,colorMode:x.palette.mode,maxHeight:P==="landscape"?900:void 0});return jsxs(Box,{sx:{minHeight:"100vh",display:"flex",flexDirection:"column",background:x.palette.mode==="dark"?"linear-gradient(180deg, #020617 0%, #0f172a 58%, #111827 100%)":"linear-gradient(180deg, #f8fafc 0%, #eef2ff 58%, #e2e8f0 100%)",...u},children:[H,jsxs(Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[n&&P==="landscape"?jsx(Box,{sx:{p:1.5,pr:0,flexShrink:0},children:V}):null,n&&P==="portrait"?jsx(Drawer,{open:D,onClose:()=>B(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:V}):null,jsx(Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f},children:jsxs(Stack,{spacing:1.5,children:[i&&a.length>0?jsx(Ou,{items:a,selectedId:r,orientation:P,onItemSelect:b}):null,jsx(Paper,{elevation:0,sx:{flex:1,minHeight:P==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:x.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)"},children:t})]})})]}),P==="portrait"&&g?jsxs(Fragment,{children:[jsx(Divider,{}),jsx(Box,{sx:{p:1.5},children:g})]}):null]})};var om=sC(()=>import('./COrbCanvas-EGX5NO3Y.mjs').then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsx("div",{className:"h-full w-full bg-transparent"})});function fc({isRecording:e}){return jsx(AnimatePresence,{children:e&&jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"pointer-events-none absolute inset-0 z-0 overflow-hidden",children:jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[jsx("div",{className:"absolute inset-0",children:jsx(om,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),jsx("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:jsx(om,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var zB=fc;function Ss({onTextUpdate:e,onComplete:t,onError:o,wsUrl:a="ws://localhost:8765",silenceThresholdMs:r=2e3,minVolumeRms:n=.015}){let[i,c]=useState(false),d=useRef(null),s=useRef(null),l=useRef(null),g=useRef(null),f=useRef(null),u=useRef(0),y=useRef(false),I=useRef(false),p=useCallback(()=>{d.current&&(d.current.close(),d.current=null),g.current&&(g.current.disconnect(),g.current=null),f.current&&(f.current.disconnect(),f.current=null),s.current&&(s.current.getTracks().forEach(b=>b.stop()),s.current=null),l.current&&(l.current.close(),l.current=null),I.current=false,c(false);},[]),C=useCallback(()=>{y.current||(y.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(p,500));},[p]),m=useCallback(async()=>{if(!(i||I.current)){I.current=true,y.current=false,u.current=Date.now();try{let b=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});s.current=b;let x=new WebSocket(a);d.current=x,x.onopen=()=>{c(!0),I.current=!1;},x.onmessage=E=>{try{let T=JSON.parse(E.data);if(T.type==="recognition")T.is_final?t(T.text):e?.(T.text);else if(T.type==="error"){let v=T.message||"Voice recognition error";o?.(v),C();}}catch{o?.("Failed to parse voice message");}},x.onerror=()=>{o?.("Voice service connection failed"),p();},x.onclose=()=>{p();};let k=window.AudioContext||window.webkitAudioContext;if(!k)throw new Error("AudioContext is not supported in this browser");let L=new k({sampleRate:16e3});l.current=L;let P=L.createMediaStreamSource(b);f.current=P;let w=L.createScriptProcessor(4096,1,1);g.current=w,w.onaudioprocess=E=>{if(d.current?.readyState!==WebSocket.OPEN)return;let T=E.inputBuffer.getChannelData(0),v=0;for(let D=0;D<T.length;D+=1)v+=T[D]*T[D];if(Math.sqrt(v/T.length)>n)u.current=Date.now();else if(Date.now()-u.current>r&&!y.current){C();return}let S=new Int16Array(T.length);for(let D=0;D<T.length;D+=1){let B=Math.max(-1,Math.min(1,T[D]));S[D]=B<0?B*32768:B*32767;}d.current.send(S.buffer);},P.connect(w),w.connect(L.destination);}catch{o?.("Cannot access microphone"),p();}}},[p,i,n,t,o,e,r,C,a]);return useEffect(()=>p,[p]),{isRecording:i,startRecording:m,stopRecording:C}}var nm=createContext(null);function yC(e){if(!e||!(e instanceof HTMLElement))return false;let t=e.tagName;return !!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable||e.closest('[data-voice-hotkey-ignore="true"]'))}function bC({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:a,longPressMs:r=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:s,minVolumeRms:l}){let[g,f]=useState(false),[u,y]=useState(false),I=useRef(null),p=useRef(false),C=useRef(false),m=useCallback(()=>{C.current=false,f(false);},[]),{isRecording:b,startRecording:x,stopRecording:k}=Ss({wsUrl:d,silenceThresholdMs:s,minVolumeRms:l,onTextUpdate:E=>{o?.(E);},onComplete:async E=>{try{E.trim()&&(y(!0),await t(E.trim()));}catch(T){let v=T instanceof Error?T.message:"Failed to process voice command";a?.(v);}finally{y(!1),m();}},onError:E=>{a?.(E),y(!1),p.current||m();}}),L=useCallback(async()=>{C.current=false,await x();},[x]),P=useCallback(()=>{k();},[k]);useEffect(()=>{if(n)return;let E=v=>{v.isComposing||(v.code==="Space"||v.key===" ")&&(p.current||v.repeat||i&&yC(document.activeElement)||(p.current=true,v.preventDefault(),I.current=setTimeout(()=>{C.current=true,f(true),x();},r)));},T=v=>{(v.code==="Space"||v.key===" ")&&(I.current&&(clearTimeout(I.current),I.current=null),p.current=false,C.current&&(v.preventDefault(),f(false),k()));};return window.addEventListener("keydown",E),window.addEventListener("keyup",T),()=>{window.removeEventListener("keydown",E),window.removeEventListener("keyup",T),I.current&&(clearTimeout(I.current),I.current=null);}},[n,i,r,x,k]);let w=useMemo(()=>({isRecording:b,isHotkeyRecording:g,isSubmitting:u,startRecording:L,stopRecording:P}),[g,b,u,L,P]);return jsxs(nm.Provider,{value:w,children:[c?jsx(fc,{isRecording:g}):null,e]})}function xC(){let e=useContext(nm);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var KB=bC,qB=xC;function xe(...e){return twMerge(clsx(e))}var TC=({content:e,theme:t="light",size:o="base",defaultExpanded:a=false})=>{let[r,n]=useState(a),i=useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return jsxs("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${t==="dark"?"bg-gray-800":"bg-white"}`,style:{border:`0.5px solid ${t==="dark"?"#4b5563":"#d1d5db"}`},children:[jsxs("div",{className:`px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 ${t==="dark"?"bg-gray-700 hover:bg-gray-650":"bg-gray-50 hover:bg-gray-100"}`,style:{borderBottom:`0.5px solid ${t==="dark"?"#4b5563":"#e5e7eb"}`},onClick:()=>n(!r),children:[jsxs("span",{className:"flex items-center",children:[jsx("span",{className:"mr-2",children:"\u{1F914}"}),jsx("span",{className:`font-medium ${t==="dark"?"text-gray-300":"text-gray-700"}`,style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${r?"rotate-180":""} ${t==="dark"?"text-gray-400":"text-gray-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsx("div",{className:`p-4 whitespace-pre-wrap italic font-light ${t==="dark"?"text-gray-400":"text-gray-600"}`,style:{fontSize:i,lineHeight:"1.3 !important"},children:e})]})},im=TC;var EC=({content:e,language:t="text",isStreaming:o=false,className:a=""})=>{let{theme:r}=useTheme$2(),[n,i]=useState(false),c=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3);}catch(s){console.error("\u590D\u5236\u5931\u8D25:",s);}},d=r==="dark"?oneDark:oneLight;return jsxs("div",{className:xe("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",a),children:[jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 uppercase",children:t}),jsx("button",{onClick:c,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",disabled:o,title:n?"Copied":"Copy code",children:n?jsx(Check,{size:14,className:"text-green-500"}):jsx(Clipboard,{size:14,className:"text-gray-500 dark:text-gray-400"})})]}),jsx("div",{className:"text-sm",children:jsx(Prism,{language:t,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:r==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},lm=EC;var VC=({content:e,isLoading:t,className:o="",style:a})=>{let r=useRef(null),[n,i]=useState(false),[c,d]=useState(null),{theme:s}=useTheme$2();return useEffect(()=>{let l=async()=>{if(!(!e.trim()||!r.current)){i(true),d(null);try{dm.initialize({startOnLoad:!1,theme:s==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,u=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:y}=await dm.render(f,u);r.current&&(r.current.innerHTML=y);}catch(f){console.error("Mermaid render failed:",f),d(f instanceof Error?f.message:"Render failed"),r.current&&(r.current.innerText=e);}finally{i(false);}}},g=setTimeout(()=>{l();},100);return ()=>clearTimeout(g)},[e,s]),t||n?jsx("div",{className:`mermaid-block loading ${o}`,style:a,children:jsxs("div",{className:"flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700",children:[jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500 mr-2"}),jsx("span",{className:"text-sm text-gray-500",children:"Generating Diagram..."})]})}):c?jsxs("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded text-red-600 dark:text-red-400 text-sm overflow-auto",children:[jsx("p",{className:"font-semibold mb-2",children:"Mermaid Error:"}),jsx("pre",{children:c}),jsx("pre",{className:"mt-4 text-xs text-gray-500",children:e})]}):jsx("div",{className:`mermaid-block overflow-x-auto ${o}`,style:a,ref:r})},um=VC;var UC=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:a,icon:r,closable:n=true,onClose:i,onRetry:c,className:d="",...s})=>{let[l,g]=useState(false),[f,u]=useState(false),y=async()=>{if(c){u(true);try{await c();}catch(I){console.error("\u91CD\u8BD5\u5931\u8D25:",I);}finally{u(false);}}};return jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...s,children:[jsxs("div",{className:"flex p-4 border-l-4 border-l-red-500 bg-red-50 dark:bg-red-900/10",children:[jsx("div",{className:"flex-shrink-0 mr-3 text-red-500 mt-0.5",children:r||jsx(AlertCircle,{className:"w-5 h-5"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300",children:o})]}),t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 leading-relaxed",children:typeof t=="string"?jsx("p",{className:"whitespace-pre-wrap",children:t}):t}),(c||a)&&jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[c&&jsxs("button",{onClick:y,disabled:f,className:"flex items-center text-xs font-medium text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 transition-colors disabled:opacity-50",children:[jsx(RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),a&&jsxs("button",{onClick:()=>g(!l),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 transition-colors",children:[l?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),l?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),n&&i&&jsx("button",{onClick:i,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors self-start",children:jsx(X,{className:"w-4 h-4"})})]}),a&&l&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 border-t border-gray-100 dark:border-gray-800",children:jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap p-2 bg-white dark:bg-gray-900 rounded border border-gray-200 dark:border-gray-800",children:a})})]})},ws=UC;var QC=({title:e="\u8B66\u544A",content:t,warningType:o,severity:a="warning",warnings:r=[],icon:n,closable:i=true,onClose:c,onConfirm:d,actionText:s,className:l="",...g})=>{let f=()=>{switch(a){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-blue-500",bgColor:"bg-blue-50 dark:bg-blue-900/10"};case "error":return {borderLeftColor:"border-l-red-500",iconColor:"text-red-500",bgColor:"bg-red-50 dark:bg-red-900/10"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-green-500",bgColor:"bg-green-50 dark:bg-green-900/10"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-yellow-500",bgColor:"bg-yellow-50 dark:bg-yellow-900/10"}}},u=()=>{switch(a){case "info":return jsx(Info,{className:"w-5 h-5"});case "error":return jsx(XCircle,{className:"w-5 h-5"});case "success":return jsx(CheckCircle,{className:"w-5 h-5"});default:return jsx(AlertTriangle,{className:"w-5 h-5"})}},y=f();return jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${l}`,...g,children:[jsxs("div",{className:`flex p-4 border-l-4 ${y.borderLeftColor} ${y.bgColor}`,children:[jsx("div",{className:`flex-shrink-0 mr-3 ${y.iconColor}`,children:n||u()}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400",children:o})]}),t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),r&&r.length>0&&jsx("ul",{className:"mt-2 space-y-1",children:r.map((I,p)=>jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsx("span",{children:I})]},p))})]}),i&&c&&jsx("button",{onClick:c,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:jsx(X,{className:"w-4 h-4"})})]}),d&&jsx("div",{className:"bg-gray-50 dark:bg-gray-800/50 px-4 py-3 flex justify-end border-t border-gray-100 dark:border-gray-800",children:jsx("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:s||"\u786E\u8BA4"})})]})},Is=QC;var ek=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:a,maxDisplay:r=5,icon:n,closable:i=false,onClose:c,className:d="",...s})=>{let[l,g]=useState(false),[f,u]=useState(""),[y,I]=useState(false),p=useMemo(()=>f.trim()?o.filter(b=>b.toLowerCase().includes(f.toLowerCase())):o,[o,f]),C=useMemo(()=>l?p:p.slice(0,r),[p,l,r]),m=b=>{a?.(b);};return !o||o.length===0?null:jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...s,children:[jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/30 dark:bg-blue-900/10",children:[jsxs("div",{className:"flex items-center space-x-2.5",children:[jsx("div",{className:"text-blue-500 flex-shrink-0",children:n||jsx(Lightbulb,{className:"w-5 h-5"})}),jsxs("div",{className:"flex flex-col",children:[jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:e}),t&&jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]})]}),jsxs("div",{className:"flex items-center space-x-1",children:[o.length>3&&jsx("button",{onClick:()=>I(!y),className:`p-1.5 rounded-md transition-colors ${y?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"}`,title:y?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:jsx(Search,{className:"w-4 h-4"})}),i&&c&&jsx("button",{onClick:c,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",title:"\u5173\u95ED",children:jsx(X,{className:"w-4 h-4"})})]})]}),y&&jsx("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/50",children:jsxs("div",{className:"relative",children:[jsx("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:f,onChange:b=>u(b.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 outline-none transition-shadow",autoFocus:true}),jsx(Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxs("div",{className:"p-2",children:[jsx("ul",{className:"space-y-1",children:C.map((b,x)=>jsx("li",{children:jsxs("button",{onClick:()=>m(b),className:"w-full text-left px-3 py-2 rounded-md text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-blue-600 dark:hover:text-blue-400 transition-colors group flex items-start justify-between",children:[jsx("span",{children:b}),jsx(ChevronRight,{className:"w-4 h-4 text-gray-300 group-hover:text-blue-400 opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},x))}),p.length>r&&jsx("button",{onClick:()=>g(!l),className:"w-full text-center py-2 text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors border-t border-gray-50 dark:border-gray-800/50 mt-1",children:l?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${p.length})`}),p.length===0&&f&&jsx("div",{className:"text-center py-4 text-sm text-gray-500 dark:text-gray-400",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},Ts=ek;var sk=({title:e,content:t,toolName:o,parameters:a,result:r,status:n,duration:i,icon:c,closable:d=false,onClose:s,onAction:l,actionText:g,className:f="",...u})=>{let[y,I]=useState(false),[p,C]=useState(true),m=()=>{switch(n){case "pending":return {iconColor:"text-blue-500",badgeBg:"bg-blue-50 dark:bg-blue-900/30",badgeText:"text-blue-600 dark:text-blue-400",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-red-500",badgeBg:"bg-red-50 dark:bg-red-900/30",badgeText:"text-red-600 dark:text-red-400",label:"\u5931\u8D25"};default:return {iconColor:"text-green-500",badgeBg:"bg-green-50 dark:bg-green-900/30",badgeText:"text-green-600 dark:text-green-400",label:"\u6210\u529F"}}},b=()=>{switch(n){case "pending":return jsx(Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsx(XCircle,{className:"w-5 h-5"});default:return jsx(CheckCircle,{className:"w-5 h-5"})}},x=P=>P?P<1e3?`${P}ms`:`${(P/1e3).toFixed(2)}s`:"",k=m(),L=e||o||"\u5DE5\u5177\u8C03\u7528";return jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${f}`,...u,children:[jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsxs("div",{className:"flex items-center space-x-3",children:[jsx("div",{className:`flex-shrink-0 ${k.iconColor}`,children:c||b()}),jsxs("div",{children:[jsxs("div",{className:"flex items-center space-x-2",children:[jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:L}),jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${k.badgeBg} ${k.badgeText}`,children:k.label})]}),o&&e&&jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center mt-0.5",children:[jsx(Terminal,{className:"w-3 h-3 mr-1"}),o]})]})]}),jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[i&&jsxs("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded",children:[jsx(Clock,{className:"w-3 h-3 mr-1"}),x(i)]}),d&&s&&jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1 rounded",children:jsx(X,{className:"w-4 h-4"})})]})]}),jsxs("div",{className:"p-4",children:[t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:t}),a&&jsxs("div",{className:"mb-3",children:[jsxs("button",{onClick:()=>I(!y),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[y?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsx(Box$1,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),y&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:JSON.stringify(a,null,2)})})]}),r&&jsxs("div",{children:[jsxs("button",{onClick:()=>C(!p),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[p?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsx(Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),p&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:typeof r=="string"?r:JSON.stringify(r,null,2)})})]}),l&&jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-800 flex justify-end",children:jsx("button",{onClick:l,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:g||"\u6267\u884C\u64CD\u4F5C"})})]})]})},Ps=sk;var ck=({data:e})=>{if(!e)return null;let t=useMemo(()=>{let o=[],a=[],r="\u6570\u636E\u8868\u683C";return Array.isArray(e)?(o=e,o.length>0&&(a=Object.keys(o[0]).map(n=>({id:n,label:n.charAt(0).toUpperCase()+n.slice(1),numeric:typeof o[0][n]=="number"})))):typeof e=="object"&&(r=e.title||r,o=Array.isArray(e.rows)?e.rows:Array.isArray(e.data)?e.data:[],Array.isArray(e.columns)?a=e.columns.map(i=>({id:i.key||i.id,label:i.title||i.label,numeric:i.dataType==="number"||i.numeric})):o.length>0&&(a=Object.keys(o[0]).map(i=>({id:i,label:i,numeric:typeof o[0][i]=="number"})))),o=o.map((n,i)=>({...n,id:n.id||`row_${i}`})),{title:r,columns:a,rows:o}},[e]);return t.rows.length===0?jsx("div",{className:"w-full my-4 p-4 border border-dashed border-gray-300 rounded text-center text-gray-500",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):jsx("div",{className:"w-full my-4",children:jsx(So,{appId:"agent-ui-table-card",title:t.title,columns:t.columns,rows:t.rows,count:t.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},Rs=ck;var bk=({title:e,subtitle:t,data:o,type:a,config:r={}})=>{let n=()=>{switch(a){case "bar-chart-card":return jsx(BarChart,{className:"w-4 h-4 text-blue-500"});case "line-chart-card":return jsx(LineChart,{className:"w-4 h-4 text-green-500"});case "pie-chart-card":return jsx(PieChart,{className:"w-4 h-4 text-purple-500"});case "combo-chart-card":return jsx(Activity,{className:"w-4 h-4 text-orange-500"});case "heatmap-chart-card":return jsx(Grid$1,{className:"w-4 h-4 text-red-500"});case "fishbone-chart-card":return jsx(GitBranch,{className:"w-4 h-4 text-indigo-500"});case "waterfall-chart-card":return jsx(TrendingDown,{className:"w-4 h-4 text-teal-500"});case "google-map-card":return jsx(Globe,{className:"w-4 h-4 text-blue-600"});case "amap-card":return jsx(MapPin,{className:"w-4 h-4 text-blue-600"});default:return jsx(BarChart,{className:"w-4 h-4"})}},i=()=>{if(!o&&a!=="google-map-card"&&a!=="amap-card")return jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(a){case "bar-chart-card":return jsx(dn,{data:o,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsx(rd,{data:o,color:r.color,valueSuffix:r.valueSuffix||"",height:r.height});case "pie-chart-card":let c=o.reduce((s,l)=>s+(Number(l.value)||0),0),d=o.map(s=>({name:s.name,value:Number(s.value)||0,percent:typeof s.percent=="number"?s.percent:c>0?(Number(s.value)||0)/c*100:0}));return jsx(pi,{data:d,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsx(nd,{data:o,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsx(sd,{data:o});case "fishbone-chart-card":return jsx(cd,{branches:o,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsx(pd,{data:o,height:r.height});case "google-map-card":return jsx(gd,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,apiKey:r.apiKey,query:r.query||o&&o[0]?.query||e,height:r.height});case "amap-card":return jsx(bd,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,keyword:r.keyword||o&&o[0]?.keyword||e,height:r.height});default:return jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",a]})}}catch(c){return console.error("Error rendering chart:",c),jsx("div",{className:"text-red-500 text-sm p-4 text-center",children:"Error rendering chart"})}};return jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsx("div",{className:"mr-2 flex-shrink-0",children:n()}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),t&&jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:t})]})]}),jsxs("div",{className:"p-4",children:[jsx("div",{className:"overflow-x-auto",children:i()}),jsx("div",{className:"mt-3",children:jsxs("details",{className:"text-xs text-gray-500 dark:text-gray-400",children:[jsx("summary",{className:"cursor-pointer hover:text-gray-700 dark:hover:text-gray-300 transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),jsx("pre",{className:"mt-2 p-2 bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto max-h-40",children:JSON.stringify(o,null,2)})]})})]})]})},Ds=bk;var vk=({type:e,manifest:t})=>jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/50 dark:bg-blue-900/10",children:[jsx(Box$1,{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400"}),jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["SAP Card: ",e]})]}),jsx("div",{className:"p-4",children:jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto",children:jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})})})]}),As=vk;var Bs=e=>{let t;try{t=JSON.parse(e);}catch{return null}return t&&typeof t=="object"&&((t.type==="bar-chart-card"||t.type==="line-chart-card"||t.type==="pie-chart-card"||t.type==="combo-chart-card"||t.type==="heatmap-chart-card"||t.type==="fishbone-chart-card"||t.type==="waterfall-chart-card"||t.type==="google-map-card"||t.type==="amap-card")&&t.title||(t.type==="sap-analytical-card"||t.type==="sap-list-card"||t.type==="sap-object-card"||t.type==="sap-component-card")&&t.manifest||t.type==="error-card"||t.type==="warning-card"||t.type==="suggestions-card"||t.type==="tool-result-card"||t.type==="table"&&t.data)?t:null};var Tk=({content:e,theme:t,size:o="base",className:a,enableCodeHighlight:r=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,u)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(u.trim())}"></div>`):"",[e]),s=(f,u,y,I,p)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:u,title:y,payload:I,rawData:p});},l=(f,u,y,I,p,C)=>{if(!(!p&&!c?.onCardEvent))return (...m)=>{let b=p?.(...m),x=C?C(...m):void 0;return s(f,u,y,x,I),b}},g=useMemo(()=>({div(f){let{"data-component":u,"data-think-content":y,...I}=f;return u==="thinkbox"&&y?jsx(im,{content:decodeURIComponent(y),theme:t,size:o,defaultExpanded:false}):jsx("div",{...I})},table({children:f}){return jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-800",children:jsx("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:f})})},thead({children:f}){return jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/60",children:f})},tbody({children:f}){return jsx("tbody",{className:"bg-white dark:bg-gray-950",children:f})},tr({children:f}){return jsx("tr",{className:"border-b border-gray-200 dark:border-gray-800 last:border-b-0",children:f})},th({children:f,align:u}){return jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${u==="center"?"text-center":u==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:u}){return jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${u==="center"?"text-center":u==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:u,children:y,...I}){let p=/language-([\w-]+)/.exec(u||""),C=p?p[1]:"";if(f)return jsx("code",{className:"font-mono text-sm bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded text-red-600 dark:text-red-400",...I,children:y});let m=String(y).replace(/\n$/,"");if(n&&C==="mermaid")return jsx(um,{content:m});if(C==="json"){let b=Bs(m);if(b)switch(b.type){case "table":return jsx(Rs,{data:b.data});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return jsx(Ds,{...b});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsx(As,{...b});case "error-card":{let x=b;return jsx(ws,{...x,onClose:l("error-card","close",x.title,x,x.onClose),onRetry:l("error-card","retry",x.title,x,x.onRetry)})}case "warning-card":{let x=b,k=x.onConfirm?l("warning-card","confirm",x.title,x,x.onConfirm):x.actionText&&c?.onCardEvent?l("warning-card","confirm",x.title,x):void 0;return jsx(Is,{...x,onClose:l("warning-card","close",x.title,x,x.onClose),onConfirm:k})}case "suggestions-card":{let x=b;return jsx(Ts,{...x,onClose:l("suggestions-card","close",x.title,x,x.onClose),onSuggestionClick:l("suggestions-card","suggestion-click",x.title,x,x.onSuggestionClick,k=>({suggestion:k}))})}case "tool-result-card":{let x=b;return jsx(Ps,{...x,onClose:l("tool-result-card","close",x.title,x,x.onClose),onAction:l("tool-result-card","action",x.title,x,x.onAction)})}}}return r?jsx(lm,{content:m,language:C,className:"not-prose"}):jsx("code",{className:u,...I,children:y})}}),[t,o,n,r,c,i]);return jsx("div",{className:xe("markdown-body prose dark:prose-invert max-w-none",a),children:jsx(Ck,{remarkPlugins:[kk,Sk],rehypePlugins:[wk,Ik],components:g,children:d})})},Fs=Tk;var Pk=({content:e,messageId:t,cardHooks:o})=>{let a=(i,c,d,s,l)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:c,title:d,payload:s,rawData:l});},r=(i,c,d,s,l,g)=>{if(!(!l&&!o?.onCardEvent))return (...f)=>{let u=l?.(...f),y=g?g(...f):void 0;return a(i,c,d,y,s),u}},n=Bs(e);if(n)switch(n.type){case "table":return jsx(Rs,{data:n.data});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return jsx(Ds,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsx(As,{...n});case "error-card":{let i=n;return jsx(ws,{...i,onClose:r("error-card","close",i.title,i,i.onClose),onRetry:r("error-card","retry",i.title,i,i.onRetry)})}case "warning-card":{let i=n,c=i.onConfirm?r("warning-card","confirm",i.title,i,i.onConfirm):i.actionText&&o?.onCardEvent?r("warning-card","confirm",i.title,i):void 0;return jsx(Is,{...i,onClose:r("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsx(Ts,{...i,onClose:r("suggestions-card","close",i.title,i,i.onClose),onSuggestionClick:r("suggestions-card","suggestion-click",i.title,i,i.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let i=n;return jsx(Ps,{...i,onClose:r("tool-result-card","close",i.title,i,i.onClose),onAction:r("tool-result-card","action",i.title,i,i.onAction)})}}return jsx("div",{className:"dynamic-card-fallback",children:jsx(Fs,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},km=Pk;var wc=class{static analyze(t){if(!t.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let a=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(t),r=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(t),n=t.includes("NQ#")||t.includes("data-component");return a||r||n?{blocks:[{type:"mixed",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:false,overallType:"simple"}}},Dk=({content:e,className:t="",messageId:o,cardHooks:a})=>{let r=mt__default.useMemo(()=>wc.analyze(e),[e]);return jsx("div",{className:`universal-content-renderer ${t}`,children:r.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsx(km,{content:n.content,messageId:o,cardHooks:a},`block-${i}`):jsx(Fs,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:a},`block-${i}`))})},Sm=Dk;var Mk=({content:e,isStreaming:t=true,onComplete:o,className:a="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,s]=useState(t?0:e.length),[l,g]=useState(!t);useEffect(()=>{if(t){s(0),g(false);return}s(e.length),g(true);},[e,t]),useEffect(()=>{if(!t||l)return;if(d>=e.length){g(true),o?.();return}let p=window.setTimeout(()=>{s(C=>Math.min(C+n,e.length));},r);return ()=>{window.clearTimeout(p);}},[e.length,l,t,o,n,r,d]);let f=()=>{t&&!l&&(s(e.length),g(true),o?.());},u=t?e.slice(0,d):e,y=t&&!l,I=t&&!l;return jsxs("div",{className:`streaming-markdown ${a}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxs("div",{className:"relative",children:[jsx(Sm,{content:u,messageId:i,cardHooks:c}),y&&jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),I&&jsx("div",{className:"streaming-hint",style:{fontSize:"9px",color:"#999",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},Pm=Mk;var Rm=({buttons:e,className:t})=>{let o=a=>{switch(a){case "copy":return jsx(Copy,{size:14});case "refresh":return jsx(RefreshCw,{size:14});case "volume":return jsx(Volume2,{size:14});case "like":return jsx(ThumbsUp,{size:14});case "dislike":return jsx(ThumbsDown,{size:14});default:return null}};return jsx("div",{className:xe("flex items-center gap-1",t),children:e.map((a,r)=>jsx("button",{onClick:a.onClick,disabled:a.disabled,className:xe("p-1.5 rounded-md transition-colors","text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-50 disabled:cursor-not-allowed",a.active&&"text-blue-600 bg-blue-50 dark:text-blue-400 dark:bg-blue-900/20",a.type==="refresh"&&a.disabled&&"animate-spin"),title:a.type,type:"button",children:o(a.type)},`${a.type}-${r}`))})};var Es=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:a,streamChunkSize:r,cardHooks:n})=>e.type==="assistant"?jsx("div",{className:"flex justify-start mb-4",children:jsxs("div",{className:"w-full bg-transparent text-black dark:text-gray-100 rounded-2xl px-4 py-3 mr-auto",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[jsx(Pm,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:a,streamChunkSize:r,messageId:e.id,cardHooks:n}),e.content&&o?.isLatestAssistant&&jsx("div",{className:"flex flex-row justify-start gap-2 mt-3 pt-2 border-t border-gray-100 dark:border-gray-700",children:jsx(Rm,{buttons:[{type:"refresh",onClick:()=>o?.onRegenerate?.(),disabled:!o?.onRegenerate},{type:"copy",onClick:()=>navigator.clipboard.writeText(e.content),disabled:false},{type:"volume",onClick:()=>console.log("\u8BED\u97F3\u64AD\u653E"),disabled:false},{type:"like",onClick:()=>console.log("\u70B9\u8D5E"),disabled:false},{type:"dislike",onClick:()=>console.log("\u70B9\u8E29"),disabled:false}],size:"sm",variant:"default"})}),jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})}):jsx("div",{className:"flex justify-end",children:jsxs("div",{className:"max-w-[80%] bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-100 rounded-2xl px-4 py-3 ml-auto",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[jsx("div",{className:"whitespace-pre-wrap",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:e.content}),jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})});var Mm=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:a,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:c}=Ss({onTextUpdate:e,onComplete:s=>{t?.(s);},onError:s=>{console.error("Voice input error:",s),o?.();}});return jsx("button",{onClick:async()=>{n?c():await i();},disabled:a,className:xe("transition-all duration-200 flex items-center justify-center rounded-full",n?"bg-red-100 text-red-600 hover:bg-red-200 animate-pulse":"bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 active:scale-95",a&&"opacity-50 cursor-not-allowed",r),title:n?"Stop recording":"Start recording",type:"button",children:n?jsx(zk,{sx:{fontSize:24}}):jsx(Nk,{sx:{fontSize:24}})})};var ot={container:"w-full max-w-4xl mx-auto",inputContainer:xe("w-full border backdrop-blur-xl transition-all duration-300 shadow-2xl flex flex-col","bg-white/80 dark:bg-gray-900/80","border-gray-200/60 dark:border-gray-600/40","shadow-gray-900/5","hover:border-blue-300/80 hover:shadow-blue-500/10 hover:shadow-2xl","focus-within:border-blue-400/90 focus-within:shadow-blue-500/20 focus-within:shadow-3xl focus-within:scale-[1.005] transform-gpu"),dragActive:"border-blue-500 bg-blue-50/50 dark:bg-blue-900/20",textareaWrapper:"flex-1 relative flex items-center",textarea:xe("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-2","placeholder:text-gray-400/70 dark:placeholder:text-gray-500/60 placeholder:font-normal","text-gray-800 dark:text-gray-100 selection:bg-blue-200/50 dark:selection:bg-blue-500/30","focus:ring-0 focus:outline-none focus:border-none focus:shadow-none","min-h-[44px] max-h-[12em] overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600"),filePreviewArea:"px-6 pt-3 pb-1 flex flex-wrap gap-2",fileTag:xe("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300","border border-gray-200 dark:border-gray-700","transition-all hover:bg-gray-200 dark:hover:bg-gray-700"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"w-10 h-10",buttonNormal:xe("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:xe("cursor-pointer bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 shadow-none active:scale-95"),sendButtonDisabled:xe("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:xe("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},Kk={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},qk=({enabled:e,onClick:t})=>jsx("button",{className:xe(ot.buttonBase,ot.buttonSmall,ot.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsx(Gk,{sx:{fontSize:24}})}),_k=()=>jsxs("button",{className:xe(ot.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",ot.buttonNormal),"aria-label":"Tools",type:"button",children:[jsx(Uk,{sx:{fontSize:20}}),jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),Zk=({canSend:e,isResponding:t,onSend:o,onStop:a})=>t?jsx("button",{className:xe(ot.buttonBase,ot.buttonSmall,ot.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:jsx(Stop,{sx:{fontSize:20}})}):jsx("button",{className:xe(ot.buttonBase,ot.buttonSmall,e?ot.sendButton:ot.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsx(Hk,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),Am=({onSend:e,onStop:t,isResponding:o=false,placeholder:a,getText:r})=>{let[n,i]=useState(""),[c,d]=useState([]),[s,l]=useState(false),[g,f]=useState(false),u=useRef(null),y=a||(r?r("00019","Type a message..."):"Type a message..."),I=(n.trim().length>0||c.length>0)&&!o,p={enabled:true},C=useCallback(B=>{i(B.target.value),B.target.style.height="auto",B.target.style.height=`${Math.min(B.target.scrollHeight,200)}px`;},[]),m=useCallback(B=>{if(B.target.files&&B.target.files.length>0){let H=Array.from(B.target.files);d(V=>{let q=H.filter(te=>V.some(ae=>ae.name===te.name&&ae.size===te.size));q.length>0&&console.warn("Duplicate files ignored:",q.map(te=>te.name));let Y=H.filter(te=>!V.some(ae=>ae.name===te.name&&ae.size===te.size));return [...V,...Y]}),u.current&&(u.current.value="");}},[]),b=useCallback(B=>{d(H=>H.filter((V,q)=>q!==B));},[]),x=useCallback(()=>{u.current?.click();},[]),k=useCallback(async()=>{if(!I)return;let B=n,H=[...c];i(""),d([]),u.current&&(u.current.value="");try{await e(B,H);}catch(V){console.error("Failed to send message:",V),i(B),d(H);}},[n,I,e,c]),L=useCallback(B=>{B.key==="Enter"&&!B.shiftKey&&!s&&(B.preventDefault(),k());},[k,s]),P=useCallback(()=>{l(true);},[]),w=useCallback(()=>{l(false);},[]),E=useCallback(B=>{i(B);},[]),T=useCallback(B=>{i(B);},[]),v=useCallback(()=>{},[]),M=useCallback(B=>{B.preventDefault(),f(true);},[]),S=useCallback(B=>{B.preventDefault(),f(false);},[]),D=useCallback(B=>{if(B.preventDefault(),f(false),B.dataTransfer.files&&B.dataTransfer.files.length>0){let H=Array.from(B.dataTransfer.files);d(V=>[...V,...H]);}},[]);return jsx("div",{className:ot.container,children:jsxs("div",{className:"relative",children:[jsx("input",{type:"file",multiple:true,className:"hidden",ref:u,onChange:m}),jsxs("div",{className:xe(ot.inputContainer,g&&ot.dragActive),style:{borderRadius:"32px"},onDragOver:M,onDragLeave:S,onDrop:D,children:[c.length>0&&jsx("div",{className:ot.filePreviewArea,children:c.map((B,H)=>jsxs("div",{className:ot.fileTag,children:[jsx(InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsx("span",{className:"truncate max-w-[150px]",children:B.name}),jsx("button",{onClick:()=>b(H),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsx(Close,{sx:{fontSize:16}})})]},`${B.name}-${H}`))}),jsxs("div",{className:"flex flex-col w-full p-2",children:[jsx("div",{className:xe(ot.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsx("textarea",{className:xe(ot.textarea,"min-h-[24px] py-0 px-0"),placeholder:y,value:n,onChange:C,onKeyDown:L,onCompositionStart:P,onCompositionEnd:w,style:Kk,"aria-label":"Message input",spellCheck:false,rows:1})}),jsxs("div",{className:"flex items-center justify-between px-1 pb-1",children:[jsxs("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[jsx(qk,{enabled:p.enabled,onClick:x}),jsx(_k,{})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(Mm,{onTextUpdate:E,onComplete:T,onCancel:v,disabled:o,className:ot.buttonSmall}),jsx(Zk,{canSend:I,isResponding:o,onSend:k,onStop:t})]})]})]})]})]})})};var Fm=({messages:e,onSend:t,onStop:o,onRegenerate:a,isResponding:r=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:s,cardHooks:l,showInput:g=true})=>{let f=useRef(null);return useEffect(()=>{f.current?.scrollIntoView({behavior:"smooth"});},[e,r]),jsxs("div",{className:xe("flex flex-col h-full w-full relative",n),children:[jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((u,y)=>{let I=u.type==="assistant"&&y===e.length-1,p=u.type==="assistant"?{isLatestAssistant:I,onRegenerate:a?()=>a(u.id):void 0}:void 0;return jsx(Es,{message:u,assistantActions:p,onStreamingComplete:()=>s?.(u.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:l},u.id)}),jsx("div",{ref:f})]}),g&&jsx("div",{className:"p-4 bg-gradient-to-t from-white via-white to-transparent dark:from-gray-900 dark:via-gray-900 pb-8 z-10",children:jsx(Am,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:r,placeholder:i})})]})};var Xt={};var Yk={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},yE=({title:e="AI Agent",description:t,headerActions:o,className:a,agentStatus:r,showInput:n=false,...i})=>{let c=r??(i.isResponding?"running":"idle");return jsxs("div",{className:xe("relative flex h-full w-full",Xt.agentPanel,a),"data-status":c,children:[jsx("div",{className:Xt.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxs("div",{className:Xt.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsx("span",{className:xe(Xt.edge,Xt.top)}),jsx("span",{className:xe(Xt.edge,Xt.right)}),jsx("span",{className:xe(Xt.edge,Xt.bottom)}),jsx("span",{className:xe(Xt.edge,Xt.left)})]}),jsxs("div",{className:"relative z-10 flex h-full w-full flex-col rounded-xl border border-slate-200/70 bg-white shadow-sm overflow-hidden dark:border-slate-800 dark:bg-gray-950",children:[jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 dark:border-gray-800 bg-white/50 dark:bg-gray-900/50 backdrop-blur-sm z-20",children:[jsxs("div",{children:[jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t&&jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsxs("div",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-full bg-gray-100/80 dark:bg-gray-800/70",children:[jsx("span",{className:Xt.statusDot,"data-status":c}),jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:Yk[c]})]}),o]})]}),jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsx(Fm,{...i,showInput:n})})]})]})};var oS={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},IE=({messages:e,onSend:t,onRegenerate:o,isResponding:a=false,className:r,placeholder:n,title:i="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:s,onPlusClick:l,onMicClick:g,streamIntervalMs:f,streamChunkSize:u,onMessageStreamingComplete:y,cardHooks:I})=>{let[p,C]=useState(""),[m,b]=useState(false),x=useRef(null),k=oS[c];useEffect(()=>{x.current?.scrollIntoView({behavior:"smooth"});},[e,a]);let L=useCallback(async()=>{let w=p.trim();!w||a||(C(""),await t(w));},[a,t,p]),P=useCallback(async w=>{w.key==="Enter"&&!m&&(w.preventDefault(),await L());},[L,m]);return jsxs("div",{className:xe("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-gray-200 bg-white shadow-none dark:border-gray-800 dark:bg-gray-900",r),children:[d&&jsx("button",{onClick:d,className:xe("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",k==="top-left"&&"-left-2 -top-2",k==="top-right"&&"-right-2 -top-2",k==="bottom-left"&&"-bottom-2 -left-2",k==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsx("span",{className:xe("block h-4 w-4 border-[#21BCFF]",k==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",k==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",k==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",k==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-gray-800",onPointerDown:s,children:[jsx("div",{className:"flex items-center",children:jsx("h3",{className:"text-base font-semibold tracking-tight text-gray-900 dark:text-gray-100",children:i})}),jsx("div",{})]}),jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((w,E)=>{let T=w.type==="assistant"&&E===e.length-1,v=w.type==="assistant"?{isLatestAssistant:T,onRegenerate:o?()=>o(w.id):void 0}:void 0;return jsx(Es,{message:w,assistantActions:v,onStreamingComplete:()=>y?.(w.id),streamIntervalMs:f,streamChunkSize:u,cardHooks:I},w.id)}),jsx("div",{ref:x})]}),jsx("div",{className:"border-t border-gray-100 px-3 py-3 dark:border-gray-800",children:jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-blue-300/80 bg-white px-2 py-1.5 dark:bg-gray-900",children:[jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:l,type:"button","aria-label":"Add",children:jsx(Plus,{className:"h-4 w-4"})}),jsx("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-gray-800 outline-none placeholder:text-gray-400 dark:text-gray-100 dark:placeholder:text-gray-500",placeholder:n||"Ask Copilot...",value:p,onChange:w=>C(w.target.value),onCompositionStart:()=>b(true),onCompositionEnd:()=>b(false),onKeyDown:P,"aria-label":"Copilot input",spellCheck:false}),jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:g,type:"button","aria-label":"Microphone",children:jsx(Mic,{className:"h-4 w-4"})})]})})]})};var cS={none:{from:{},to:{}},fade:{from:{opacity:0},to:{opacity:1}},"slide-up":{from:{opacity:0,transform:"translate3d(0, 12px, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},"slide-left":{from:{opacity:0,transform:"translate3d(12px, 0, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},scale:{from:{opacity:0,transform:"scale(0.985)"},to:{opacity:1,transform:"scale(1)"}}},ME=({children:e,transitionKey:t,variant:o="fade",durationMs:a=220,delayMs:r=0,easing:n="cubic-bezier(0.22, 1, 0.36, 1)",disabled:i=false,sx:c})=>{let d=useMediaQuery("(prefers-reduced-motion: reduce)"),[s,l]=useState("to"),g=!i&&!d&&o!=="none";useEffect(()=>{if(!g){l("to");return}l("from");let y=requestAnimationFrame(()=>{y=requestAnimationFrame(()=>{l("to");});});return ()=>cancelAnimationFrame(y)},[t,g]);let f=cS[o],u=useMemo(()=>g?s==="from"?f.from:f.to:{opacity:1,transform:"none"},[g,s,f.from,f.to]);return jsx(Box,{sx:{willChange:g?"opacity, transform":"auto",transition:g?`opacity ${a}ms ${n} ${r}ms, transform ${a}ms ${n} ${r}ms`:"none",backfaceVisibility:"hidden",...u,...c},children:e})},AE={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
|
|
17
|
+
export{yE as AgentPanel,Os as Button,bC as CAINavProvider,bd as CAmapChart,zp as CAppHeader,hM as CAppPageLayout,dn as CBarChart,ri as CChartCard,nd as CComboChart,kd as CCustomizeAgent,vD as CDetailInfoPage,bp as CDetailSearchAiBar,Hi as CDetailSectionCard,cd as CFishboneChart,gd as CGoogleMapChart,xd as CGraphCharts,td as CGraphKpiCards,xi as CGraphReport,sd as CHeatmapChart,$D as CKanbanBoard,wp as CKanbanBucket,zl as CKanbanCard,qd as CLayoutManagement,Ai as CLayoutManager,rd as CLineChart,rn as CMessageBox,Hc as CPageLayout,ME as CPageTransition,pi as CPieChart,r2 as CPivotTable,Yo as CSmartFilter,OP as CSmartTable,qP as CStandardPage,So as CTable,EP as CTableBody,LP as CTableCell,NP as CTableContainer,zP as CTableHead,VP as CTableRow,Si as CVariantManagement,Bd as CVariantManager,fc as CVoiceWaveOverlay,pd as CWaterfallChart,kn as CodeBlock,IE as CopilotChat,gw as GlobalMessage,Pn as MarkdownRenderer,Sn as MathBlock,Sl as MermaidBlock,Vc as NavigationIsland,on as ORBCAFE_I18N_MESSAGES,Bc as OrbcafeI18nProvider,AE as PAGE_TRANSITION_PRESETS,BB as PAppPageLayout,S2 as PBarcodeScanner,Uu as PNavIsland,V2 as PNumericKeypad,Nu as PSmartFilter,Xv as PTable,D2 as PTouchCard,Ou as PWorkloadNav,gu as PivotChartPanel,Fm as StdChat,Il as TableBlock,Wi as ThinkBlock,$s as TreeMenu,KB as VoiceNavigatorProvider,zB as VoiceWaveOverlay,gi as buildAmapEmbedUrl,mn as buildGoogleMapEmbedUrl,_1 as buildGoogleMapIframe,Wm as buttonVariants,Pp as createKanbanBoardModel,va as findKanbanCard,XS as message,Za as messageManager,_i as moveKanbanCard,Vi as parseMarkdownTable,GR as renderMarkdown,Zd as resolveVariantFilters,Bi as resolveVariantLayout,xC as useAINav,sR as useAmapEmbedUrl,vp as useDetailInfo,iR as useGoogleMapEmbedUrl,tR as useGraphChartData,Ci as useGraphInteraction,Ar as useGraphReport,qD as useKanbanBoard,Wc as useNavigationIsland,K as useOrbcafeI18n,g2 as usePadLayout,y2 as usePadRecordEditor,Vp as usePageLayout,c2 as usePivotTable,YP as useStandardReport,Ss as useVoiceInput,qB as useVoiceNavigator};
|