orbcafe-ui 1.2.4 → 1.2.5
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 +4 -0
- package/dist/index.d.mts +129 -1
- package/dist/index.d.ts +129 -1
- package/dist/index.js +16 -16
- package/dist/index.mjs +15 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var ogl=require('ogl'),st=require('react'),jsxRuntime=require('react/jsx-runtime'),navigation=require('next/navigation'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),tp=require('@mui/material/Dialog'),op=require('@mui/material/DialogTitle'),ap=require('@mui/material/DialogContent'),Cg=require('@mui/material/DialogContentText'),rp=require('@mui/material/DialogActions'),Sn=require('@mui/material/Box'),wg=require('@mui/icons-material/CheckCircle'),Ig=require('@mui/icons-material/Warning'),Tg=require('@mui/icons-material/Error'),Pg=require('@mui/icons-material/Info'),material=require('@mui/material'),Dy=require('@mui/material/Paper'),My=require('@mui/material/Table'),Ay=require('@mui/material/TableBody'),el=require('@mui/material/TableCell'),sp=require('@mui/material/TableContainer'),Jg=require('@mui/material/TableHead'),ef=require('@mui/material/TableRow'),np=require('@mui/material/TextField'),Oi=require('@mui/material/Button'),ip=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),Hd=require('@mui/icons-material/Search'),Og=require('@mui/icons-material/ViewColumn'),Xd=require('@mui/icons-material/Save'),$g=require('@mui/icons-material/Download'),Hg=require('@mui/icons-material/AccountTree'),Gg=require('@mui/icons-material/Functions'),Ug=require('@mui/icons-material/Insights'),Kg=require('@mui/icons-material/Add'),qg=require('@mui/icons-material/Edit'),_g=require('@mui/icons-material/Delete'),Zg=require('@mui/icons-material/KeyboardArrowLeft'),jg=require('@mui/icons-material/KeyboardArrowRight'),tf=require('@mui/material/Checkbox'),of=require('@mui/material/TableSortLabel'),af=require('@mui/material/IconButton'),rf=require('@mui/material/Tooltip'),nf=require('@mui/icons-material/UnfoldMore'),sf=require('@mui/icons-material/UnfoldLess'),mf=require('@mui/icons-material/KeyboardArrowDown'),Pf=require('@mui/icons-material/Check'),Rf=require('@mui/icons-material/ClearAll'),th=require('@mui/icons-material/Close'),ch=require('@mui/icons-material/MicNoneOutlined'),dh=require('@mui/icons-material/SettingsOutlined'),ph=require('@mui/icons-material/SendOutlined'),sy=require('@mui/icons-material/Settings'),ly=require('@mui/icons-material/KeyboardArrowUp'),dy=require('@mui/icons-material/ArrowRightAlt'),Bh=require('@mui/icons-material/Star'),DateCalendar=require('@mui/x-date-pickers/DateCalendar'),PickersDay=require('@mui/x-date-pickers/PickersDay'),LocalizationProvider=require('@mui/x-date-pickers/LocalizationProvider'),AdapterDayjs=require('@mui/x-date-pickers/AdapterDayjs'),_h=require('@mui/icons-material/CalendarMonth'),Zh=require('@mui/icons-material/Clear'),jh=require('@mui/icons-material/ArrowForward'),_a=require('dayjs'),Xh=require('dayjs/plugin/isBetween'),Qh=require('dayjs/plugin/localizedFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var wy=require('@mui/icons-material/StarBorder'),Iy=require('@mui/icons-material/ViewQuilt'),_b=require('@mui/icons-material/CloseOutlined'),_y=require('@mui/icons-material/ContentCopyOutlined'),Zy=require('@mui/icons-material/CheckOutlined'),Sb=require('@mui/icons-material/ExpandMore'),sortable=require('@dnd-kit/sortable'),styles=require('@mui/material/styles'),Op=require('@mui/icons-material/Language'),Bx=require('@mui/icons-material/DesktopWindows'),Fx=require('@mui/icons-material/DarkMode'),Ex=require('@mui/icons-material/LightMode'),zx=require('@mui/icons-material/Logout'),Q0=require('@mui/icons-material/DeleteOutline'),n0=require('@mui/icons-material/DragIndicator'),S0=require('@mui/icons-material/FilterList'),w0=require('@mui/icons-material/TableRows'),d0=require('@mui/icons-material/LayersClear'),kv=require('@mui/icons-material/CameraAltRounded'),Sv=require('@mui/icons-material/QrCodeScannerRounded'),Pv=require('@mui/icons-material/DragIndicatorRounded'),Av=require('@mui/icons-material/BackspaceRounded'),Bv=require('@mui/icons-material/CloseRounded'),Fv=require('@mui/icons-material/CheckRounded'),Zv=require('@mui/icons-material/SearchRounded'),jv=require('@mui/icons-material/MenuOpenRounded'),Xv=require('@mui/icons-material/MenuRounded'),Qv=require('@mui/icons-material/ExpandMoreRounded'),Yv=require('@mui/icons-material/ChevronRightRounded'),PC=require('next/dynamic'),framerMotion=require('framer-motion'),$k=require('react-markdown'),Hk=require('remark-gfm'),Gk=require('remark-math'),Uk=require('rehype-katex'),Kk=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),gm=require('mermaid'),oS=require('@mui/icons-material/MicRounded'),aS=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),lS=require('@mui/icons-material/SendRounded'),cS=require('@mui/icons-material/AddRounded'),dS=require('@mui/icons-material/HardwareRounded');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var st__namespace=/*#__PURE__*/_interopNamespace(st);var tp__default=/*#__PURE__*/_interopDefault(tp);var op__default=/*#__PURE__*/_interopDefault(op);var ap__default=/*#__PURE__*/_interopDefault(ap);var Cg__default=/*#__PURE__*/_interopDefault(Cg);var rp__default=/*#__PURE__*/_interopDefault(rp);var Sn__default=/*#__PURE__*/_interopDefault(Sn);var wg__default=/*#__PURE__*/_interopDefault(wg);var Ig__default=/*#__PURE__*/_interopDefault(Ig);var Tg__default=/*#__PURE__*/_interopDefault(Tg);var Pg__default=/*#__PURE__*/_interopDefault(Pg);var Dy__default=/*#__PURE__*/_interopDefault(Dy);var My__default=/*#__PURE__*/_interopDefault(My);var Ay__default=/*#__PURE__*/_interopDefault(Ay);var el__default=/*#__PURE__*/_interopDefault(el);var sp__default=/*#__PURE__*/_interopDefault(sp);var Jg__default=/*#__PURE__*/_interopDefault(Jg);var ef__default=/*#__PURE__*/_interopDefault(ef);var np__default=/*#__PURE__*/_interopDefault(np);var Oi__default=/*#__PURE__*/_interopDefault(Oi);var ip__default=/*#__PURE__*/_interopDefault(ip);var Hd__default=/*#__PURE__*/_interopDefault(Hd);var Og__default=/*#__PURE__*/_interopDefault(Og);var Xd__default=/*#__PURE__*/_interopDefault(Xd);var $g__default=/*#__PURE__*/_interopDefault($g);var Hg__default=/*#__PURE__*/_interopDefault(Hg);var Gg__default=/*#__PURE__*/_interopDefault(Gg);var Ug__default=/*#__PURE__*/_interopDefault(Ug);var Kg__default=/*#__PURE__*/_interopDefault(Kg);var qg__default=/*#__PURE__*/_interopDefault(qg);var _g__default=/*#__PURE__*/_interopDefault(_g);var Zg__default=/*#__PURE__*/_interopDefault(Zg);var jg__default=/*#__PURE__*/_interopDefault(jg);var tf__default=/*#__PURE__*/_interopDefault(tf);var of__default=/*#__PURE__*/_interopDefault(of);var af__default=/*#__PURE__*/_interopDefault(af);var rf__default=/*#__PURE__*/_interopDefault(rf);var nf__default=/*#__PURE__*/_interopDefault(nf);var sf__default=/*#__PURE__*/_interopDefault(sf);var mf__default=/*#__PURE__*/_interopDefault(mf);var Pf__default=/*#__PURE__*/_interopDefault(Pf);var Rf__default=/*#__PURE__*/_interopDefault(Rf);var th__default=/*#__PURE__*/_interopDefault(th);var ch__default=/*#__PURE__*/_interopDefault(ch);var dh__default=/*#__PURE__*/_interopDefault(dh);var ph__default=/*#__PURE__*/_interopDefault(ph);var sy__default=/*#__PURE__*/_interopDefault(sy);var ly__default=/*#__PURE__*/_interopDefault(ly);var dy__default=/*#__PURE__*/_interopDefault(dy);var Bh__default=/*#__PURE__*/_interopDefault(Bh);var _h__default=/*#__PURE__*/_interopDefault(_h);var Zh__default=/*#__PURE__*/_interopDefault(Zh);var jh__default=/*#__PURE__*/_interopDefault(jh);var _a__default=/*#__PURE__*/_interopDefault(_a);var Xh__default=/*#__PURE__*/_interopDefault(Xh);var Qh__default=/*#__PURE__*/_interopDefault(Qh);var wy__default=/*#__PURE__*/_interopDefault(wy);var Iy__default=/*#__PURE__*/_interopDefault(Iy);var _b__default=/*#__PURE__*/_interopDefault(_b);var _y__default=/*#__PURE__*/_interopDefault(_y);var Zy__default=/*#__PURE__*/_interopDefault(Zy);var Sb__default=/*#__PURE__*/_interopDefault(Sb);var Op__default=/*#__PURE__*/_interopDefault(Op);var Bx__default=/*#__PURE__*/_interopDefault(Bx);var Fx__default=/*#__PURE__*/_interopDefault(Fx);var Ex__default=/*#__PURE__*/_interopDefault(Ex);var zx__default=/*#__PURE__*/_interopDefault(zx);var Q0__default=/*#__PURE__*/_interopDefault(Q0);var n0__default=/*#__PURE__*/_interopDefault(n0);var S0__default=/*#__PURE__*/_interopDefault(S0);var w0__default=/*#__PURE__*/_interopDefault(w0);var d0__default=/*#__PURE__*/_interopDefault(d0);var kv__default=/*#__PURE__*/_interopDefault(kv);var Sv__default=/*#__PURE__*/_interopDefault(Sv);var Pv__default=/*#__PURE__*/_interopDefault(Pv);var Av__default=/*#__PURE__*/_interopDefault(Av);var Bv__default=/*#__PURE__*/_interopDefault(Bv);var Fv__default=/*#__PURE__*/_interopDefault(Fv);var Zv__default=/*#__PURE__*/_interopDefault(Zv);var jv__default=/*#__PURE__*/_interopDefault(jv);var Xv__default=/*#__PURE__*/_interopDefault(Xv);var Qv__default=/*#__PURE__*/_interopDefault(Qv);var Yv__default=/*#__PURE__*/_interopDefault(Yv);var PC__default=/*#__PURE__*/_interopDefault(PC);var $k__default=/*#__PURE__*/_interopDefault($k);var Hk__default=/*#__PURE__*/_interopDefault(Hk);var Gk__default=/*#__PURE__*/_interopDefault(Gk);var Uk__default=/*#__PURE__*/_interopDefault(Uk);var Kk__default=/*#__PURE__*/_interopDefault(Kk);var gm__default=/*#__PURE__*/_interopDefault(gm);var oS__default=/*#__PURE__*/_interopDefault(oS);var aS__default=/*#__PURE__*/_interopDefault(aS);var lS__default=/*#__PURE__*/_interopDefault(lS);var cS__default=/*#__PURE__*/_interopDefault(cS);var dS__default=/*#__PURE__*/_interopDefault(dS);var Bc=Object.defineProperty;var Hm=(e,t,o)=>t in e?Bc(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var Gm=(e,t)=>()=>(e&&(t=e(e=0)),t);var Um=(e,t)=>{for(var o in t)Bc(e,o,{get:t[o],enumerable:true});};var Fc=(e,t,o)=>Hm(e,t+"",o);var nm={};Um(nm,{COrbCanvas:()=>wC});function wC({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:a=false,backgroundColor:r="transparent"}){let n=st.useRef(null),i=`
|
|
1
|
+
'use strict';var ogl=require('ogl'),ct=require('react'),jsxRuntime=require('react/jsx-runtime'),navigation=require('next/navigation'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),Dp=require('@mui/material/Dialog'),Mp=require('@mui/material/DialogTitle'),Ap=require('@mui/material/DialogContent'),mf=require('@mui/material/DialogContentText'),Bp=require('@mui/material/DialogActions'),Gn=require('@mui/material/Box'),hf=require('@mui/icons-material/CheckCircle'),yf=require('@mui/icons-material/Warning'),bf=require('@mui/icons-material/Error'),xf=require('@mui/icons-material/Info'),material=require('@mui/material'),vb=require('@mui/material/Paper'),Cb=require('@mui/material/Table'),kb=require('@mui/material/TableBody'),kl=require('@mui/material/TableCell'),Lp=require('@mui/material/TableContainer'),Kf=require('@mui/material/TableHead'),qf=require('@mui/material/TableRow'),Fp=require('@mui/material/TextField'),ns=require('@mui/material/Button'),Ep=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),hp=require('@mui/icons-material/Search'),Af=require('@mui/icons-material/ViewColumn'),wp=require('@mui/icons-material/Save'),Ff=require('@mui/icons-material/Download'),Ef=require('@mui/icons-material/AccountTree'),Lf=require('@mui/icons-material/Functions'),zf=require('@mui/icons-material/Insights'),Nf=require('@mui/icons-material/Add'),Vf=require('@mui/icons-material/Edit'),Of=require('@mui/icons-material/Delete'),Wf=require('@mui/icons-material/KeyboardArrowLeft'),$f=require('@mui/icons-material/KeyboardArrowRight'),_f=require('@mui/material/Checkbox'),jf=require('@mui/material/TableSortLabel'),Zf=require('@mui/material/IconButton'),Xf=require('@mui/material/Tooltip'),Qf=require('@mui/icons-material/UnfoldMore'),Yf=require('@mui/icons-material/UnfoldLess'),rh=require('@mui/icons-material/KeyboardArrowDown'),bh=require('@mui/icons-material/Check'),xh=require('@mui/icons-material/ClearAll'),qh=require('@mui/icons-material/Close'),ey=require('@mui/icons-material/MicNoneOutlined'),ty=require('@mui/icons-material/SettingsOutlined'),oy=require('@mui/icons-material/SendOutlined'),Yy=require('@mui/icons-material/Settings'),Jy=require('@mui/icons-material/KeyboardArrowUp'),tb=require('@mui/icons-material/ArrowRightAlt'),Sy=require('@mui/icons-material/Star'),DateCalendar=require('@mui/x-date-pickers/DateCalendar'),PickersDay=require('@mui/x-date-pickers/PickersDay'),LocalizationProvider=require('@mui/x-date-pickers/LocalizationProvider'),AdapterDayjs=require('@mui/x-date-pickers/AdapterDayjs'),Vy=require('@mui/icons-material/CalendarMonth'),Oy=require('@mui/icons-material/Clear'),Wy=require('@mui/icons-material/ArrowForward'),Ua=require('dayjs'),$y=require('dayjs/plugin/isBetween'),Hy=require('dayjs/plugin/localizedFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var fb=require('@mui/icons-material/StarBorder'),hb=require('@mui/icons-material/ViewQuilt'),Vx=require('@mui/icons-material/CloseOutlined'),Vb=require('@mui/icons-material/ContentCopyOutlined'),Ob=require('@mui/icons-material/CheckOutlined'),gx=require('@mui/icons-material/ExpandMore'),sortable=require('@dnd-kit/sortable'),styles=require('@mui/material/styles'),mu=require('@mui/icons-material/Language'),S0=require('@mui/icons-material/DesktopWindows'),w0=require('@mui/icons-material/DarkMode'),T0=require('@mui/icons-material/LightMode'),P0=require('@mui/icons-material/Logout'),Hv=require('@mui/icons-material/DeleteOutline'),X0=require('@mui/icons-material/DragIndicator'),gv=require('@mui/icons-material/FilterList'),fv=require('@mui/icons-material/TableRows'),tv=require('@mui/icons-material/LayersClear'),mC=require('@mui/icons-material/CameraAltRounded'),gC=require('@mui/icons-material/QrCodeScannerRounded'),bC=require('@mui/icons-material/DragIndicatorRounded'),kC=require('@mui/icons-material/BackspaceRounded'),SC=require('@mui/icons-material/CloseRounded'),wC=require('@mui/icons-material/CheckRounded'),OC=require('@mui/icons-material/SearchRounded'),WC=require('@mui/icons-material/MenuOpenRounded'),$C=require('@mui/icons-material/MenuRounded'),HC=require('@mui/icons-material/ExpandMoreRounded'),GC=require('@mui/icons-material/ChevronRightRounded'),bk=require('next/dynamic'),framerMotion=require('framer-motion'),BS=require('react-markdown'),FS=require('remark-gfm'),ES=require('remark-math'),LS=require('rehype-katex'),zS=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),Hm=require('mermaid'),_S=require('@mui/icons-material/MicRounded'),jS=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),JS=require('@mui/icons-material/SendRounded'),ew=require('@mui/icons-material/AddRounded'),tw=require('@mui/icons-material/HardwareRounded'),ww=require('@mui/icons-material/LockOutlined'),yg=require('@mui/icons-material/MailOutline'),bg=require('@mui/icons-material/PersonOutline'),Tw=require('@mui/icons-material/VpnKeyOutlined'),Zw=require('@mui/icons-material/CalendarMonthOutlined'),Jw=require('@mui/icons-material/KeyboardDoubleArrowLeftOutlined'),e1=require('@mui/icons-material/KeyboardDoubleArrowRightOutlined'),t1=require('@mui/icons-material/SplitscreenOutlined'),o1=require('@mui/icons-material/Sort');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var ct__namespace=/*#__PURE__*/_interopNamespace(ct);var Dp__default=/*#__PURE__*/_interopDefault(Dp);var Mp__default=/*#__PURE__*/_interopDefault(Mp);var Ap__default=/*#__PURE__*/_interopDefault(Ap);var mf__default=/*#__PURE__*/_interopDefault(mf);var Bp__default=/*#__PURE__*/_interopDefault(Bp);var Gn__default=/*#__PURE__*/_interopDefault(Gn);var hf__default=/*#__PURE__*/_interopDefault(hf);var yf__default=/*#__PURE__*/_interopDefault(yf);var bf__default=/*#__PURE__*/_interopDefault(bf);var xf__default=/*#__PURE__*/_interopDefault(xf);var vb__default=/*#__PURE__*/_interopDefault(vb);var Cb__default=/*#__PURE__*/_interopDefault(Cb);var kb__default=/*#__PURE__*/_interopDefault(kb);var kl__default=/*#__PURE__*/_interopDefault(kl);var Lp__default=/*#__PURE__*/_interopDefault(Lp);var Kf__default=/*#__PURE__*/_interopDefault(Kf);var qf__default=/*#__PURE__*/_interopDefault(qf);var Fp__default=/*#__PURE__*/_interopDefault(Fp);var ns__default=/*#__PURE__*/_interopDefault(ns);var Ep__default=/*#__PURE__*/_interopDefault(Ep);var hp__default=/*#__PURE__*/_interopDefault(hp);var Af__default=/*#__PURE__*/_interopDefault(Af);var wp__default=/*#__PURE__*/_interopDefault(wp);var Ff__default=/*#__PURE__*/_interopDefault(Ff);var Ef__default=/*#__PURE__*/_interopDefault(Ef);var Lf__default=/*#__PURE__*/_interopDefault(Lf);var zf__default=/*#__PURE__*/_interopDefault(zf);var Nf__default=/*#__PURE__*/_interopDefault(Nf);var Vf__default=/*#__PURE__*/_interopDefault(Vf);var Of__default=/*#__PURE__*/_interopDefault(Of);var Wf__default=/*#__PURE__*/_interopDefault(Wf);var $f__default=/*#__PURE__*/_interopDefault($f);var _f__default=/*#__PURE__*/_interopDefault(_f);var jf__default=/*#__PURE__*/_interopDefault(jf);var Zf__default=/*#__PURE__*/_interopDefault(Zf);var Xf__default=/*#__PURE__*/_interopDefault(Xf);var Qf__default=/*#__PURE__*/_interopDefault(Qf);var Yf__default=/*#__PURE__*/_interopDefault(Yf);var rh__default=/*#__PURE__*/_interopDefault(rh);var bh__default=/*#__PURE__*/_interopDefault(bh);var xh__default=/*#__PURE__*/_interopDefault(xh);var qh__default=/*#__PURE__*/_interopDefault(qh);var ey__default=/*#__PURE__*/_interopDefault(ey);var ty__default=/*#__PURE__*/_interopDefault(ty);var oy__default=/*#__PURE__*/_interopDefault(oy);var Yy__default=/*#__PURE__*/_interopDefault(Yy);var Jy__default=/*#__PURE__*/_interopDefault(Jy);var tb__default=/*#__PURE__*/_interopDefault(tb);var Sy__default=/*#__PURE__*/_interopDefault(Sy);var Vy__default=/*#__PURE__*/_interopDefault(Vy);var Oy__default=/*#__PURE__*/_interopDefault(Oy);var Wy__default=/*#__PURE__*/_interopDefault(Wy);var Ua__default=/*#__PURE__*/_interopDefault(Ua);var $y__default=/*#__PURE__*/_interopDefault($y);var Hy__default=/*#__PURE__*/_interopDefault(Hy);var fb__default=/*#__PURE__*/_interopDefault(fb);var hb__default=/*#__PURE__*/_interopDefault(hb);var Vx__default=/*#__PURE__*/_interopDefault(Vx);var Vb__default=/*#__PURE__*/_interopDefault(Vb);var Ob__default=/*#__PURE__*/_interopDefault(Ob);var gx__default=/*#__PURE__*/_interopDefault(gx);var mu__default=/*#__PURE__*/_interopDefault(mu);var S0__default=/*#__PURE__*/_interopDefault(S0);var w0__default=/*#__PURE__*/_interopDefault(w0);var T0__default=/*#__PURE__*/_interopDefault(T0);var P0__default=/*#__PURE__*/_interopDefault(P0);var Hv__default=/*#__PURE__*/_interopDefault(Hv);var X0__default=/*#__PURE__*/_interopDefault(X0);var gv__default=/*#__PURE__*/_interopDefault(gv);var fv__default=/*#__PURE__*/_interopDefault(fv);var tv__default=/*#__PURE__*/_interopDefault(tv);var mC__default=/*#__PURE__*/_interopDefault(mC);var gC__default=/*#__PURE__*/_interopDefault(gC);var bC__default=/*#__PURE__*/_interopDefault(bC);var kC__default=/*#__PURE__*/_interopDefault(kC);var SC__default=/*#__PURE__*/_interopDefault(SC);var wC__default=/*#__PURE__*/_interopDefault(wC);var OC__default=/*#__PURE__*/_interopDefault(OC);var WC__default=/*#__PURE__*/_interopDefault(WC);var $C__default=/*#__PURE__*/_interopDefault($C);var HC__default=/*#__PURE__*/_interopDefault(HC);var GC__default=/*#__PURE__*/_interopDefault(GC);var bk__default=/*#__PURE__*/_interopDefault(bk);var BS__default=/*#__PURE__*/_interopDefault(BS);var FS__default=/*#__PURE__*/_interopDefault(FS);var ES__default=/*#__PURE__*/_interopDefault(ES);var LS__default=/*#__PURE__*/_interopDefault(LS);var zS__default=/*#__PURE__*/_interopDefault(zS);var Hm__default=/*#__PURE__*/_interopDefault(Hm);var _S__default=/*#__PURE__*/_interopDefault(_S);var jS__default=/*#__PURE__*/_interopDefault(jS);var JS__default=/*#__PURE__*/_interopDefault(JS);var ew__default=/*#__PURE__*/_interopDefault(ew);var tw__default=/*#__PURE__*/_interopDefault(tw);var ww__default=/*#__PURE__*/_interopDefault(ww);var yg__default=/*#__PURE__*/_interopDefault(yg);var bg__default=/*#__PURE__*/_interopDefault(bg);var Tw__default=/*#__PURE__*/_interopDefault(Tw);var Zw__default=/*#__PURE__*/_interopDefault(Zw);var Jw__default=/*#__PURE__*/_interopDefault(Jw);var e1__default=/*#__PURE__*/_interopDefault(e1);var t1__default=/*#__PURE__*/_interopDefault(t1);var o1__default=/*#__PURE__*/_interopDefault(o1);var sd=Object.defineProperty;var Fg=(e,t,o)=>t in e?sd(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var Eg=(e,t)=>()=>(e&&(t=e(e=0)),t);var Lg=(e,t)=>{for(var o in t)sd(e,o,{get:t[o],enumerable:true});};var ld=(e,t,o)=>Fg(e,t+"",o);var Fm={};Lg(Fm,{COrbCanvas:()=>fk});function fk({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:a=false,backgroundColor:r="transparent"}){let n=ct.useRef(null),i=`
|
|
2
2
|
precision highp float;
|
|
3
3
|
attribute vec2 position;
|
|
4
4
|
attribute vec2 uv;
|
|
@@ -180,20 +180,20 @@
|
|
|
180
180
|
vec4 col = mainImage(fragCoord);
|
|
181
181
|
gl_FragColor = vec4(col.rgb * col.a, col.a);
|
|
182
182
|
}
|
|
183
|
-
`;return st.useEffect(()=>{let d=n.current;if(!d)return;let s=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),l=s.gl;l.clearColor(0,0,0,0),d.appendChild(l.canvas);let m=new ogl.Triangle(l),f=new ogl.Program(l,{vertex:i,fragment:c,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(l.canvas.width,l.canvas.height,l.canvas.width/l.canvas.height)},hue:{value:e},hover:{value:0},rot:{value:0},hoverIntensity:{value:t},backgroundColor:{value:rm(r)}}}),u=new ogl.Mesh(l,{geometry:m,program:f});function h(){if(!d)return;let P=window.devicePixelRatio||1,S=d.clientWidth,M=d.clientHeight;s.setSize(S*P,M*P),l.canvas.style.width=S+"px",l.canvas.style.height=M+"px",f.uniforms.iResolution.value.set(l.canvas.width,l.canvas.height,l.canvas.width/l.canvas.height);}window.addEventListener("resize",h),h();let I=0,p=0,C=0,g=.3,b=P=>{let S=d.getBoundingClientRect(),M=P.clientX-S.left,T=P.clientY-S.top,v=S.width,D=S.height,w=Math.min(v,D),R=v/2,F=D/2,$=(M-R)/w*2,N=(T-F)/w*2;Math.sqrt($*$+N*N)<.8?I=1:I=0;},x=()=>{I=0;};d.addEventListener("mousemove",b),d.addEventListener("mouseleave",x);let k,E=P=>{k=requestAnimationFrame(E);let S=(P-p)*.001;p=P,f.uniforms.iTime.value=P*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=rm(r);let M=a?1:I;f.uniforms.hover.value+=(M-f.uniforms.hover.value)*.1,o&&M>.5&&(C+=S*g),f.uniforms.rot.value=C,s.render({scene:u});};return k=requestAnimationFrame(E),()=>{cancelAnimationFrame(k),window.removeEventListener("resize",h),d.removeEventListener("mousemove",b),d.removeEventListener("mouseleave",x),l.canvas.parentNode===d&&d.removeChild(l.canvas),l.getExtension("WEBGL_lose_context")?.loseContext();}},[e,t,o,a,r]),jsxRuntime.jsx("div",{ref:n,className:"w-full h-full"})}function IC(e,t,o){let a,r,n;if(t===0)a=r=n=o;else {let i=(s,l,m)=>(m<0&&(m+=1),m>1&&(m-=1),m<.16666666666666666?s+(l-s)*6*m:m<.5?l:m<.6666666666666666?s+(l-s)*(.6666666666666666-m)*6:s),c=o<.5?o*(1+t):o+t-o*t,d=2*o-c;a=i(d,c,e+1/3),r=i(d,c,e),n=i(d,c,e-1/3);}return new ogl.Vec3(a,r,n)}function rm(e){if(e==="transparent")return new ogl.Vec3(0,0,0);if(e.startsWith("#")){let a=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;return new ogl.Vec3(a,r,n)}let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t)return new ogl.Vec3(parseInt(t[1])/255,parseInt(t[2])/255,parseInt(t[3])/255);let o=e.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(o){let a=parseInt(o[1])/360,r=parseInt(o[2])/100,n=parseInt(o[3])/100;return IC(a,r,n)}return new ogl.Vec3(0,0,0)}var im=Gm(()=>{"use client";});function io(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Gs={primary:"#000000",primaryHover:"#333333"},Yn={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"},rn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Ec=()=>"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 jm=classVarianceAuthority.cva(Ec(),{variants:{variant:{default:`${Yn.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:`${Yn.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:Yn.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-[${Gs.primary}] hover:bg-[${Gs.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:rn.none,sm:rn.sm,md:rn.md,full:rn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Us=st__namespace.forwardRef(({className:e,variant:t,size:o,asChild:a=false,...r},n)=>jsxRuntime.jsx(a?reactSlot.Slot:"button",{className:io(jm({variant:t,size:o,className:e})),ref:n,...r}));Us.displayName="Button";var Qm={"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"},Ym={"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"},Jm={"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"},eg={"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"},tg={"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"},og={"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"},nn={en:Qm,zh:Ym,fr:Jm,de:eg,ja:tg,ko:og};var zc=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,a)=>{let r=t[a];return r==null?"":String(r)}):e,ig={locale:"en",t:(e,t)=>zc(nn.en[e]||e,t)},Nc=st.createContext(ig),Jn=({locale:e="en",messages:t,children:o})=>{let a=st.useMemo(()=>{let r=nn[e]||nn.en,n=t?.[e]||{},i={...nn.en,...r,...n};return {locale:e,t:(c,d)=>zc(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(Nc.Provider,{value:a,children:o})},_=()=>st.useContext(Nc);function qs({items:e,onItemClick:t,className:o="",level:a=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:c}=_(),d=i==="dark",s=navigation.usePathname(),[l,m]=st.useState(false),[f,u]=st.useState(new Set),h=r!==void 0&&n!==void 0,I=h?r:f;st.useEffect(()=>{m(true);},[]);let p=g=>{if(h)n(g);else {let b=new Set(f);b.has(g)?b.delete(g):b.add(g),u(b);}},C=g=>{g.children&&g.children.length>0&&p(g.id),t&&t(g);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:io("tree-menu",o),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:io("tree-menu",o),children:e.map(g=>{let b=I.has(g.id)||g.isExpanded,x=g.children&&g.children.length>0,k=g.appurl||g.href,E=l&&k?s===k:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[E&&jsxRuntime.jsx("div",{className:io("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(Us,{variant:"ghost",className:io("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${a*4}`,E?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(g),children:[x&&jsxRuntime.jsx("div",{className:io("flex-shrink-0 transition-transform duration-200",b&&"rotate-90",E?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})}),!x&&jsxRuntime.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),g.icon&&jsxRuntime.jsx("div",{className:io("flex-shrink-0 transition-colors duration-200",E?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:g.icon}),jsxRuntime.jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsxRuntime.jsx("div",{className:io("text-sm truncate transition-colors duration-200",E?"font-semibold":"font-medium"),children:g.title||g.label}),g.description&&jsxRuntime.jsx("div",{className:io("text-xs truncate transition-colors duration-200",E?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:g.description,children:g.description})]})]}),x&&jsxRuntime.jsx("div",{className:io("grid transition-[grid-template-rows] duration-300 ease-in-out",b?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx(qs,{items:g.children,onItemClick:t,level:a+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},g.id)})})}var Gc=({collapsed:e,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light"})=>{let{t:i}=_(),c=n==="dark",d=navigation.useRouter(),[s,l]=st.useState(""),[m,f]=st.useState(new Set);st.useEffect(()=>{e&&f(new Set);},[e]);let u=st.useCallback(C=>{let g=[],b=x=>{x.forEach(k=>{g.push(k.id),k.children&&b(k.children);});};return b(C),g},[]),h=st.useMemo(()=>{if(!s.trim())return r;let C=g=>g.reduce((b,x)=>{let k=x.title?.toLowerCase().includes(s.toLowerCase())||x.description?.toLowerCase().includes(s.toLowerCase()),E=x.children?C(x.children):[];return (k||E.length>0)&&b.push({...x,children:E.length>0?E:x.children}),b},[]);return C(r)},[s,r]),I=st.useMemo(()=>s.trim()?new Set(u(r)):m,[s,r,m,u]),p=st.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 g=C.appurl||C.href;g&&(g.startsWith("http://")||g.startsWith("https://")?window.open(g,"_blank"):d.push(g));},[d]);return jsxRuntime.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:[jsxRuntime.jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsxRuntime.jsx("div",{className:"flex justify-center",children:jsxRuntime.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:jsxRuntime.jsx(lucideReact.Search,{className:"h-5 w-5"})})}):jsxRuntime.jsxs("div",{className:`relative transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:[jsxRuntime.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"}`}),jsxRuntime.jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:jsxRuntime.jsx(lucideReact.Search,{className:`h-4 w-4 ${c?"text-gray-500":"text-gray-400"}`})})]})}),jsxRuntime.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:h.length===0?jsxRuntime.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")}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e&&jsxRuntime.jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsxRuntime.jsx(qs,{items:h,onItemClick:p,className:"space-y-1",expandedIds:I,colorMode:n,onToggleExpand:C=>{let g=new Set(m);h.some(x=>x.id===C)?g.has(C)?g.delete(C):(h.forEach(x=>{x.id!==C&&g.has(x.id)&&g.delete(x.id);}),g.add(C)):g.has(C)?g.delete(C):g.add(C),f(g);}})}),e&&jsxRuntime.jsx("div",{className:"space-y-2",children:r.map(C=>jsxRuntime.jsx("div",{className:"space-y-1",children:jsxRuntime.jsx("button",{onClick:()=>{t();let g=new Set([C.id]);f(g);},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||jsxRuntime.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&&jsxRuntime.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:jsxRuntime.jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsxRuntime.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 Kc=(e={})=>{let{initialCollapsed:t=false,content:o=[]}=e,[a,r]=st.useState(t),[n,i]=st.useState(o),c=st.useCallback(()=>{r(s=>!s);},[]),d=st.useMemo(()=>({collapsed:a,onToggle:c,menuData:n}),[a,c,n]);return {collapsed:a,setCollapsed:r,toggleCollapsed:c,menuData:n,setMenuData:i,navigationIslandProps:d}};var Zs=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var js=class{constructor(){Fc(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);}},Xo=new js,hw={success:(e,t)=>Xo.show("success",e,t),error:(e,t)=>Xo.show("error",e,t),warning:(e,t)=>Xo.show("warning",e,t),info:(e,t)=>Xo.show("info",e,t),show:(e,t,o)=>Xo.show(e,t,o),hide:()=>Xo.hide()};var Rg={success:{icon:jsxRuntime.jsx(wg__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(Ig__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(Tg__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(Pg__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},sn=({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}=_(),m=n||l("messageBox.confirm"),f=i||l("messageBox.cancel"),u=()=>{r?r():a();},h=Rg[s],I=s!=="default";return jsxRuntime.jsxs(tp__default.default,{open:e,onClose:a,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...I&&{borderTop:`6px solid ${h.iconColor}`}}},children:[I&&jsxRuntime.jsx(Sn__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:h.iconColor},children:h.icon}),t&&jsxRuntime.jsx(op__default.default,{sx:{textAlign:I?"center":"left",pt:I?1:2},children:t}),jsxRuntime.jsx(ap__default.default,{sx:{textAlign:I?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(Cg__default.default,{children:o}):o}),jsxRuntime.jsxs(rp__default.default,{sx:{justifyContent:I?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(Zs,{onClick:a,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(Zs,{onClick:u,variant:"contained",sx:{bgcolor:I?h.iconColor:void 0,"&:hover":{bgcolor:I?h.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:m})]})]})},Fw=()=>{let[e,t]=st__namespace.default.useState(null),[o,a]=st__namespace.default.useState(false);st__namespace.default.useEffect(()=>{let i=c=>{c?(t(c),a(true)):(a(false),t(null));};return Xo.register(i),()=>Xo.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?jsxRuntime.jsx(sn,{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})=>jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!t&&jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(material.Typography,{variant:"h4",children:e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,overflow:"hidden"},children:o})]});var ei=e=>{let{t}=_(),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)),m=Math.min(s+1,l),f=s>0,u=s<l-1&&i!==-1;return jsxRuntime.jsxs(material.Toolbar,{sx:{pl:{sm:2},pr:{xs:1,sm:1},alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.TextField,{size:"small",placeholder:t("table.toolbar.searchPlaceholder"),value:e.filterText,onChange:h=>e.setFilterText(h.target.value),InputProps:{sx:{fontSize:o,"& .MuiInputBase-input":{fontSize:o,color:"text.primary"},"& .MuiInputBase-input::placeholder":{fontSize:o,opacity:1}},startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Hd__default.default,{fontSize:"small"})})},sx:{width:300}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,color:"text.secondary",whiteSpace:"nowrap"},children:t("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.Select,{size:"small",variant:"standard",value:i,disableUnderline:true,onChange:h=>e.onRowsPerPageChange?.(Number(h.target.value)),sx:{fontSize:o,fontWeight:600,color:"text.primary",minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"},"& .MuiSvgIcon-root":{color:"text.primary"}},children:c.map(h=>jsxRuntime.jsx(material.MenuItem,{value:h,sx:{fontSize:o},children:h===-1?t("common.all"):h},`rows-per-page-${h}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(s-1,0)),disabled:!f,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(Zg__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:t("table.toolbar.pageOf",{current:m,total:l})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(s+1,l-1)),disabled:!u,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(jg__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[n.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:n.map((h,I)=>jsxRuntime.jsx(st__namespace.default.Fragment,{children:h},`toolbar-custom-${I}`))}),jsxRuntime.jsx(material.Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.groupBy"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.setGroupAnchorEl(h.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx(Hg__default.default,{})})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.summary"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:e.showSummary?"primary.main":"text.primary"},onClick:h=>e.setSummaryAnchorEl(h.currentTarget),children:jsxRuntime.jsx(Gg__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.setAnchorEl(h.currentTarget),children:jsxRuntime.jsx(Og__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.export"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:e.handleExport,children:jsxRuntime.jsx($g__default.default,{})})}),e.showCreateButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.newItem"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenCreateDialog,color:"primary",children:jsxRuntime.jsx(Kg__default.default,{})})}),e.showEditButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.editItem"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenEditDialog,color:"primary",disabled:!!e.editDisabled,children:jsxRuntime.jsx(qg__default.default,{})})})}),e.showDeleteButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.deleteItem"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenDeleteConfirm,color:"error",disabled:!!e.deleteDisabled,children:jsxRuntime.jsx(_g__default.default,{})})})}),e.onOpenGraphReport&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.graphicReport"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:e.onOpenGraphReport,children:jsxRuntime.jsx(Ug__default.default,{})})}),e.onLayoutSave&&!e.layoutManager&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.onLayoutSave(h),children:jsxRuntime.jsx(Xd__default.default,{})})}),e.layoutManager]})]})};var Qc=e=>{let{t}=_(),{onSelectAllClick:o,order:a,orderBy:r,numSelected:n=0,rowCount:i=0,onRequestSort:c,columns:d,visibleColumns:s,selectionMode:l,grouping:m=[],isAllExpanded:f=false,handleToggleAll:u,onColumnResize:h,columnWidths:I}=e,[p,C]=st.useState(null),g=st.useRef(null),b=v=>D=>{p||c(v);},x=(v,D,w)=>{v.preventDefault(),v.stopPropagation(),C(D),g.current={startX:v.clientX,startWidth:w,colId:D},document.addEventListener("mousemove",k),document.addEventListener("mouseup",E),document.body.style.cursor="col-resize";},k=v=>{if(!g.current)return;let{startX:D,startWidth:w,colId:R}=g.current,F=v.clientX-D,$=Math.max(50,w+F);h&&h(R,$);},E=()=>{C(null),g.current=null,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",E),document.body.style.cursor="";};st.useEffect(()=>()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",E);},[]);let P=l==="multiple"||l==="single",S=m.length>0&&!!u,M=t(f?"table.group.collapseAll":"table.group.expandAll"),T=d.filter(v=>s.includes(v.id));return jsxRuntime.jsx(Jg__default.default,{children:jsxRuntime.jsxs(ef__default.default,{children:[P&&jsxRuntime.jsx(el__default.default,{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:jsxRuntime.jsx(tf__default.default,{color:"primary",indeterminate:n>0&&n<i,checked:i>0&&n===i,onChange:o,disabled:l==="single"})}),S&&jsxRuntime.jsx(el__default.default,{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:jsxRuntime.jsx(rf__default.default,{title:M,children:jsxRuntime.jsx(af__default.default,{size:"small",onClick:v=>{v.stopPropagation(),u?.(!f);},sx:{p:.2},children:f?jsxRuntime.jsx(sf__default.default,{fontSize:"small"}):jsxRuntime.jsx(nf__default.default,{fontSize:"small"})})})}),T.map(v=>{let D=I?.[v.id]||v.minWidth||100;return jsxRuntime.jsxs(el__default.default,{align:"left",padding:v.disablePadding?"none":"normal",sortDirection:r===v.id?a:false,style:{width:D,minWidth:D,maxWidth:D},sx:w=>({position:"sticky",top:0,zIndex:4,backgroundColor:w.palette.mode==="dark"?"#000000":"#f5f5f5",color:w.palette.mode==="dark"?"#ffffff":w.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsxRuntime.jsx(of__default.default,{active:r===v.id,direction:r===v.id?a:"asc",onClick:b(v.id),sx:w=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:w.palette.mode==="dark"?"#ffffff":w.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:w.palette.mode==="dark"?"#ffffff":w.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:w.palette.mode==="dark"?"#ffffff":w.palette.text.primary}),children:jsxRuntime.jsx(Sn__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:v.label})}),jsxRuntime.jsx(Sn__default.default,{onMouseDown:w=>x(w,v.id,typeof D=="number"?D:100),onClick:w=>w.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 ed=e=>{let{t}=_(),{visibleRows:o,visibleColumns:a,selected:r=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:s,grouping:l=[],isGroupFullyExpanded:m,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:u}=e,h=g=>r.indexOf(g)!==-1,I=s==="multiple"||s==="single",p=l.length>0,C=a.length+(I?1:0)+(p?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((g,b)=>{if(g.type==="group"){let x=d.has(g.id),k=g.childIds||[],E=k.filter(T=>h(T)).length,P=k.length>0&&E===k.length,S=E>0&&E<k.length;return jsxRuntime.jsxs(material.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&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:P,indeterminate:S,onChange:T=>{if(T.stopPropagation(),!!e.onSelectionChange)if(P){let v=r.filter(D=>!k.includes(D));e.onSelectionChange(v);}else {let v=Array.from(new Set([...r,...k]));e.onSelectionChange(v);}},onClick:T=>T.stopPropagation(),sx:{p:.5}})}),p&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.25},children:[l.length>1&&g.level<l.length-1&&jsxRuntime.jsx(material.Tooltip,{title:m?.(g.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>{m?.(g.id)?u?.(g.id):f?.(g.id);},sx:{p:.25},children:m?.(g.id)?jsxRuntime.jsx(sf__default.default,{fontSize:"small"}):jsxRuntime.jsx(nf__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(g.id),sx:{p:.25},children:x?jsxRuntime.jsx(mf__default.default,{}):jsxRuntime.jsx(jg__default.default,{})})]})}),jsxRuntime.jsx(material.TableCell,{colSpan:a.length,sx:{py:1,pl:g.level*3+1},children:jsxRuntime.jsxs(material.Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[g.field,": ",g.value," (",g.count,")"]})})]},g.id)}else {let x=g.data||g,k=g.id||x.id||b,E=h(k),P=`enhanced-table-checkbox-${b}`,M=(g.level!==void 0?g.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:T=>n&&n(T,x),role:"checkbox","aria-checked":E,tabIndex:-1,selected:E,sx:{cursor:"pointer"},children:[I&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{pl:M>0?M+1:void 0},children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:E,inputProps:{"aria-labelledby":P}})}),p&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(T=>a.includes(T.id)).map((T,v)=>{let w=!I&&v===0&&M>0?{pl:M+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:w,children:T.render?T.render(x[T.id],x):(function(){let F=x[T.id];if(T.numeric){if(typeof F=="number")return F.toLocaleString();if(typeof F=="string"&&F.trim()!==""&&!isNaN(Number(F)))return Number(F).toLocaleString()}return F})()},T.id)})]},k)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:C,align:"center",children:t("common.noData")})})]})};var td=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 jsxRuntime.jsx(material.TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxRuntime.jsxs(material.TableRow,{children:[n&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper"}}),i&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper",width:44}}),t.map(c=>jsxRuntime.jsx(material.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 ad=e=>{let{t}=_();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var ri=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:a,columns:r,toggleGroupField:n})=>{let{t:i}=_();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsxs(material.Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{px:1},children:i("table.menu.groupBy")}),o.length>0&&jsxRuntime.jsx(material.Button,{size:"small",color:"error",onClick:()=>a([]),startIcon:jsxRuntime.jsx(Rf__default.default,{}),children:i("table.menu.clearAll")})]}),jsxRuntime.jsx(material.Divider,{}),r.map(c=>{let d=o.includes(c.id),s=o.indexOf(c.id)+1;return jsxRuntime.jsx(material.MenuItem,{onClick:()=>n(c.id),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Checkbox,{checked:d,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:c.label}),d&&jsxRuntime.jsx(material.Badge,{badgeContent:s,color:"primary",sx:{mr:2}})]})},c.id)})]})},ni=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=_();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:n("table.menu.visibleColumns")})}),jsxRuntime.jsx(material.Divider,{}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>r(i.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:a.includes(i.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:i.label})]},i.id))]})},ii=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:a,columns:r,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=_();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{children:jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Switch,{checked:o,onChange:d=>a(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),jsxRuntime.jsx(material.Divider,{}),r.filter(d=>d.numeric).map(d=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>i(d.id),disabled:!o,children:[jsxRuntime.jsx(material.Checkbox,{checked:n.includes(d.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:d.label})]},d.id)),r.filter(d=>d.numeric).length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:c("table.menu.noNumericColumns")})})]})},si=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=_();return jsxRuntime.jsxs(material.Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsxRuntime.jsx(material.MenuItem,{onClick:t,children:n("common.copy")}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.MenuItem,{disabled:true,children:n("table.menu.visibleColumns")}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>r(i.id),children:[jsxRuntime.jsx(material.ListItemIcon,{children:a.includes(i.id)&&jsxRuntime.jsx(Pf__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})};var dn=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),id=({kpis:e})=>{let{t}=_(),o=[{label:t("graph.kpi.totalRecords"),value:dn(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:dn(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:dn(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:dn(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:dn(e.flaggedCount,0),color:"error.main"}];return jsxRuntime.jsx(material.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=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:a.label}),jsxRuntime.jsx(material.Typography,{variant:"h4",fontWeight:800,sx:{color:a.color},children:a.value})]},a.label))})};var li=({title:e,subtitle:t,children:o})=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:2,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",fontWeight:700,children:e}),t&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t}),o]});var un=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:a=210,activeName:r,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=Math.max(...e.map(c=>c.value),1);return t==="vertical"?jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:a},children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.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}}),jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:c.name,sx:{display:"block",mt:.5},children:c.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[c.value.toFixed(1),o]})]},c.name))}):jsxRuntime.jsx(material.Stack,{spacing:1,children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:c.name,children:c.name}),jsxRuntime.jsx(material.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:jsxRuntime.jsx(material.Box,{sx:{width:`${c.value/i*100}%`,height:"100%",bgcolor:c.name===r?"primary.dark":"primary.main"}})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),o]})]},c.name))})};var cd=({data:e,color:t="#42A5F5",valueSuffix:o="",height:a=220})=>{if(e.length===0)return jsxRuntime.jsx(material.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 h=n+u*(r-n*2)/Math.max(e.length-1,1),I=a-n-(f.value-c)/s*(a-n*2);return {x:h,y:I,...f}}),m=l.map(f=>`${f.x},${f.y}`).join(" ");return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsxRuntime.jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),jsxRuntime.jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:m}),l.map(f=>jsxRuntime.jsx("circle",{cx:f.x,cy:f.y,r:4,fill:t},f.name))]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(f=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:f.name,sx:{display:"block"},children:f.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[f.value.toFixed(1),o]})]},f.name))})]})};var dd=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:a=220})=>{if(e.length===0)return jsxRuntime.jsx(material.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,m)=>{let f=(r-n*2)/e.length,u=Math.max(f*.5,8),h=n+m*f+(f-u)/2,I=l.barValue/i*(a-n*2),p=a-n-I;return {x:h,y:p,barHeight:I,barWidth:u,item:l}}),s=e.map((l,m)=>{let f=(r-n*2)/e.length,u=n+m*f+f/2,h=a-n-l.lineValue/c*(a-n*2);return {x:u,y:h,item:l}});return jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsxRuntime.jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),d.map(l=>jsxRuntime.jsx("rect",{x:l.x,y:l.y,width:l.barWidth,height:Math.max(l.barHeight,4),rx:6,fill:t},l.item.name)),jsxRuntime.jsx("polyline",{fill:"none",stroke:o,strokeWidth:3,points:s.map(l=>`${l.x},${l.y}`).join(" ")}),s.map(l=>jsxRuntime.jsx("circle",{cx:l.x,cy:l.y,r:3.5,fill:o},`${l.item.name}-line`))]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(l=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:l.name,sx:{display:"block"},children:l.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",l.barValue.toFixed(1)]}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",l.lineValue.toFixed(1)]})]},l.name))})]})};var zf=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,ud=({data:e})=>{if(e.length===0)return jsxRuntime.jsx(material.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 jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsxRuntime.jsx(material.Box,{}),t.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:n},n)),o.map(n=>jsxRuntime.jsxs(material.Box,{sx:{display:"contents"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{alignSelf:"center"},children:n}),t.map(i=>{let c=r.get(`${n}__${i}`)||0,d=c/a;return jsxRuntime.jsx(material.Box,{sx:{height:36,borderRadius:1,bgcolor:zf(d),border:"1px solid rgba(148,163,184,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:c.toFixed(1)})},`${n}-${i}`)})]},n))]})})};var Nf=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],fi=({data:e,variant:t="donut",colors:o=Nf,size:a=180,activeName:r,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.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 jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:a,height:a,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:Math.round(a*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsxRuntime.jsx(material.Stack,{spacing:1,sx:{minWidth:180},children:e.map((d,s)=>jsxRuntime.jsxs(material.Box,{onClick:()=>n?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:n?"pointer":"default",opacity:r&&d.name!==r?.45:1},children:[jsxRuntime.jsx(material.Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:o[s%o.length]}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{flex:1},children:d.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var gd=({effect:e,branches:t})=>{if(t.length===0)return jsxRuntime.jsx(material.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 jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(r=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))}),jsxRuntime.jsxs(material.Box,{sx:{position:"relative",height:32},children:[jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(a.length,1)}, minmax(0, 1fr))`,gap:1},children:a.map(r=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))})]})};var hd=({data:e,height:t=240})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=0,a=e.map(m=>{let f=m.type==="total"?0:o,u=m.type==="total"?m.value:o+m.value;return m.type!=="total"&&(o=u),{...m,start:f,end:u,delta:u-f}}),r=a.flatMap(m=>[m.start,m.end]),n=Math.min(...r,0),i=Math.max(...r,1),c=680,d=30,s=i-n||1,l=m=>t-d-(m-n)/s*(t-d*2);return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${c} ${t}`,sx:{width:"100%",height:t},children:[jsxRuntime.jsx("line",{x1:d,y1:l(0),x2:c-d,y2:l(0),stroke:"rgba(148,163,184,0.4)"}),a.map((m,f)=>{let u=(c-d*2)/a.length,h=Math.max(u*.55,8),I=d+f*u+(u-h)/2,p=l(Math.max(m.start,m.end)),C=l(Math.min(m.start,m.end)),g=m.type==="total"?"#42A5F5":m.delta>=0?"#66BB6A":"#EF5350";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:I,y:p,width:h,height:Math.max(C-p,4),rx:6,fill:g}),jsxRuntime.jsx("text",{x:I+h/2,y:p-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:m.end.toFixed(1)})]},m.name)})]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${a.length}, minmax(0, 1fr))`,gap:1},children:a.map(m=>jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:m.name,children:m.name},m.name))})]})};var fn=({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}`},uI=(e,t=360)=>{let o=fn(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var xd=({apiKey:e,query:t,embedUrl:o,zoom:a=14,mapType:r="roadmap",height:n=320})=>{let i=o||(e&&t?fn({apiKey:e,query:t,zoom:a,mapType:r}):"");return i?jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:i,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:i,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var bi=({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 Sd=({keyword:e,location:t,embedUrl:o,height:a=320})=>{let r=o||bi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:r,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:a,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:r,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var wd=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:a})=>{let{t:r}=_();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(li,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(un,{data:e,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:n=>a?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(li,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(un,{data:t,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:n=>a?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(li,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsxRuntime.jsx(fi,{data:o,variant:"donut",activeName:a?.filters?.status,onItemClick:n=>a?.onStatusClick?.(n.name)})})]})};var Ka=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var ul=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var oh=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],ah=["zh","en","de","fr","ja","ko"],Pd=({open:e,onClose:t,value:o,onSaveAll:a,modelOptions:r=oh,promptLangOptions:n=ah,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:s})=>{let[l,m]=st.useState(o),[f,u]=st.useState(d||""),[h,I]=st.useState(s||""),[p,C]=st.useState(false);st.useEffect(()=>{e&&(m(o),u(d||""),I(s||""));},[e,o,d,s]);let g=(x,k)=>{m(E=>({...E,[x]:k}));},b=async()=>{if(a)try{C(!0),await a({settings:l,analysisTemplateId:f||void 0,responseTemplateId:h||void 0});}finally{C(false);}};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"lg",children:[jsxRuntime.jsxs(material.DialogTitle,{sx:{pr:7,pb:2.2},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{position:"absolute",right:12,top:12},children:jsxRuntime.jsx(th__default.default,{})})]}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"18px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2.2,children:[jsxRuntime.jsxs(material.Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Ka,{size:"small",value:l.baseUrl,onChange:x=>g("baseUrl",x.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Ka,{size:"small",type:"password",value:l.apiKey,onChange:x=>g("apiKey",x.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Ka,{size:"small",value:l.model,onChange:x=>g("model",x.target.value),fullWidth:true,select:true,label:"Model",children:r.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x,children:x},x))})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Ka,{size:"small",value:l.promptLang,onChange:x=>g("promptLang",x.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x,children:x},x))})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxRuntime.jsxs(Ka,{size:"small",value:f,onChange:x=>u(x.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),i.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,children:x.label},x.id))]}),jsxRuntime.jsx(ul,{multiline:true,minRows:8,value:l.analysisPrompt,onChange:x=>g("analysisPrompt",x.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(Ka,{size:"small",value:h,onChange:x=>I(x.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),c.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,children:x.label},x.id))]}),jsxRuntime.jsx(ul,{multiline:true,minRows:8,value:l.responsePrompt,onChange:x=>g("responsePrompt",x.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:b,disabled:!a||p,children:"Save"})]})]})};var Si=({open:e,onClose:t,model:o,tableContent:a,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:c}=_(),[d,s]=st.useState(i?.defaultPrompt||""),[l,m]=st.useState(false),[f,u]=st.useState(false),h=n?.enabled!==false&&!!n,I=i?.enabled!==false,p=n?.filters||{},C=!!(p.primaryDimension||p.secondaryDimension||p.status),g=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";st.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{m(!0),await i.onSubmit(k,{filters:p,model:o});}finally{m(false);}};return jsxRuntime.jsx(material.Dialog,{open:e,onClose:t,fullScreen:true,children:jsxRuntime.jsxs(material.Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",fontWeight:800,children:o.title}),jsxRuntime.jsx(material.Chip,{size:"small",label:c("graph.records",{count:o.kpis.totalRecords})}),h&&p.primaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${p.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),h&&p.secondaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${p.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),h&&p.status&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${p.status}`,onDelete:()=>n?.onClearFilter("status")}),h&&C&&jsxRuntime.jsx(material.Button,{size:"small",onClick:()=>n?.onClearAll(),children:"Clear"})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{width:{xs:"100%",lg:"auto"}},children:[I&&jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i?.onVoiceInput,children:jsxRuntime.jsx(ch__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:k=>s(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),x());},placeholder:g,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:x,disabled:l||!d.trim(),children:jsxRuntime.jsx(ph__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>u(true),children:jsxRuntime.jsx(dh__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(th__default.default,{})})]})]})}),jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsxRuntime.jsx(id,{kpis:o.kpis}),jsxRuntime.jsx(wd,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:h?{filters:p,onPrimaryDimensionClick:k=>n?.onPrimaryDimensionClick(k),onSecondaryDimensionClick:k=>n?.onSecondaryDimensionClick(k),onStatusClick:k=>n?.onStatusClick(k)}:void 0}),r,a]}),jsxRuntime.jsx(Pd,{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 ya={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"]},mh=5,Rd=e=>e.toLowerCase().replace(/[\s_-]/g,""),ba=(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=>[Rd(i),i]));for(let i of o){let c=n.get(Rd(i));if(c)return c}return r[0]||a},jt=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},Rt=(e,t)=>e==null||e===""?t:String(e),gh=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=Rt(i[t],r);n.set(c,(n.get(c)||0)+jt(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,a)},fh=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Rt(c[t],n),s=i.get(d)||{report:0,billable:0};s.report+=jt(c[o]),s.billable+=jt(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)},hh=(e,t,o)=>{let a=e.length;if(a===0)return [];let r=new Map;return e.forEach(n=>{let i=Rt(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}))},Dd=(e,t,o)=>{let a=new Map;return e.forEach(r=>{let n=Rt(r[t],"N/A");a.set(n,(a.get(n)||0)+jt(r[o]));}),Array.from(a.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},yh=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Rt(c[t],n),s=i.get(d)||{report:0,billable:0};s.report+=jt(c[o]),s.billable+=jt(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)},bh=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=Rt(i[t],r),d=Rt(i[o],r),s=`${c}__${d}`;n.set(s,(n.get(s)||0)+jt(i[a]));}),Array.from(n.entries()).map(([i,c])=>{let[d,s]=i.split("__");return {x:d,y:s,value:c}})},xh=(e,t,o)=>{let a=Dd(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"}]},vh=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Rt(c[t],n),s=`${Rt(c[o],n)} / ${Rt(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)},Mr=({rows:e,config:t})=>{let{t:o}=_(),a=o("graph.unassigned"),r=st.useMemo(()=>{let l=t?.fieldMapping;return {primaryDimension:ba(e,l?.primaryDimension,ya.primaryDimension,"Category"),secondaryDimension:ba(e,l?.secondaryDimension,ya.secondaryDimension,"Owner"),status:ba(e,l?.status,ya.status,"Status"),date:ba(e,l?.date,ya.date,"Date"),description:ba(e,l?.description,ya.description,"Description"),reportHours:ba(e,l?.reportHours,ya.reportHours,"ReportHours"),billableHours:ba(e,l?.billableHours,ya.billableHours,"BillableHours"),amount:ba(e,l?.amount,ya.amount,"Amount")}},[e,t?.fieldMapping]),n=st.useMemo(()=>e.map((l,m)=>{let f=jt(l[r.reportHours]),u=jt(l[r.billableHours]),h=jt(l[r.amount]),I=f>0?u/f*100:0;return {id:`graph-row-${m}`,Date:Rt(l[r.date],""),Primary:Rt(l[r.primaryDimension],a),Secondary:Rt(l[r.secondaryDimension],a),Description:Rt(l[r.description],""),ReportHours:f,BillableHours:u,Amount:h,Efficiency:I,Status:Rt(l[r.status],a)}}),[e,r,a]),i=st.useMemo(()=>{let l=n.length,m=n.reduce((C,g)=>C+jt(g.ReportHours),0),f=n.reduce((C,g)=>C+jt(g.BillableHours),0),u=n.reduce((C,g)=>C+jt(g.Amount),0),h=m>0?f/m*100:0,I=t?.statusFlagValues||["flag","flagged","warning","risk"],p=n.filter(C=>I.includes(Rt(C.Status,"").toLowerCase())).length;return {totalRecords:l,totalReportHours:m,totalBillableHours:f,efficiency:h,totalAmount:u,flaggedCount:p}},[n,t?.statusFlagValues]),c=t?.topN||mh,d=st.useMemo(()=>({billableByPrimary:gh(n,"Primary","BillableHours",c,a),efficiencyBySecondary:fh(n,"Secondary","ReportHours","BillableHours",c,a),statusDistribution:hh(n,"Status",a),lineByDate:Dd(n,"Date","BillableHours"),comboByPrimary:yh(n,"Primary","ReportHours","BillableHours",c,a),heatmapPrimarySecondary:bh(n,"Primary","Secondary","BillableHours",a),waterfallBillable:xh(n,"Date","BillableHours"),fishboneStatusCauses:vh(n,"Status","Primary","Secondary",3,a)}),[n,c,a]),s=st.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 Ar=e=>String(e??"").trim(),Ii=(e={})=>{let[t,o]=st.useState(e),a=st.useCallback((d,s)=>{o(l=>{let m=s?.trim();if(!m){let f={...l};return delete f[d],f}if(l[d]===m){let f={...l};return delete f[d],f}return {...l,[d]:m}});},[]),r=st.useCallback(d=>{o(s=>{if(!s[d])return s;let l={...s};return delete l[d],l});},[]),n=st.useCallback(()=>{o({});},[]),i=st.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=st.useCallback((d,s)=>d.filter(l=>!(t.primaryDimension&&Ar(l[s.primaryDimension])!==Ar(t.primaryDimension)||t.secondaryDimension&&Ar(l[s.secondaryDimension])!==Ar(t.secondaryDimension)||t.status&&Ar(l[s.status])!==Ar(t.status))),[t]);return {filters:t,setFilter:a,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:c}};var Pi=({variants:e,currentVariantId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=_(),d=material.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)"},[m,f]=st.useState(false),[u,h]=st.useState(""),[I,p]=st.useState(false),[C,g]=st.useState(false),b=e.find(E=>E.id===t),x=()=>{h(b?.name||i("variant.newVariant")),p(b?.isDefault||false),g(b?.isPublic||false),f(true);},k=()=>{a({name:u,isDefault:I,isPublic:C,description:""}),f(false);};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsxRuntime.jsx(material.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:jsxRuntime.jsx(material.Typography,{sx:{fontSize:s},children:i("variant.noOptions")}),options:e,getOptionLabel:E=>E.name+(E.isDefault?` (${i("variant.defaultSuffix")})`:""),value:b||null,onChange:(E,P)=>{P&&o(P);},renderInput:E=>jsxRuntime.jsx(material.TextField,{...E,variant:"outlined",size:"small",InputProps:{...E.InputProps,sx:{fontSize:s,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(E,P)=>jsxRuntime.jsx("li",{...E,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{flex:1,fontSize:s},children:P.name}),P.isDefault&&jsxRuntime.jsx(Bh__default.default,{fontSize:"small",color:"action"})]})})}),jsxRuntime.jsx(material.Tooltip,{title:i("variant.saveView"),children:jsxRuntime.jsx(material.IconButton,{onClick:x,size:"small",color:"primary",children:jsxRuntime.jsx(Xd__default.default,{fontSize:"small"})})}),jsxRuntime.jsxs(material.Dialog,{open:m,onClose:()=>f(false),children:[jsxRuntime.jsx(material.DialogTitle,{children:i("variant.saveView")}),jsxRuntime.jsxs(material.DialogContent,{children:[jsxRuntime.jsx(material.TextField,{autoFocus:true,margin:"dense",label:i("variant.viewName"),fullWidth:true,variant:"outlined",value:u,onChange:E=>h(E.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:I,onChange:E=>p(E.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C,onChange:E=>g(E.target.checked)}),label:i("variant.publicAllUsers")})]}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>f(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:k,variant:"contained",children:i("common.save")})]})]})]})};var Nd=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:a,layoutRefs:r,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:s,currentVariantId:l,onVariantChange:m})=>{let{t:f}=_(),[u,h]=st.useState([]),[I,p]=st.useState(""),C=`orbcafe.variants.${e}.${t}`,g=l!==void 0?l:I,b=D=>{l===void 0&&p(D),m&&m(D);},x=st.useCallback(()=>{try{let D=localStorage.getItem(C);if(!D)return [];let w=JSON.parse(D);return Array.isArray(w)?w:[]}catch{return []}},[C]),k=st.useCallback(D=>{try{localStorage.setItem(C,JSON.stringify(D));}catch{}},[C]),E=st.useCallback(D=>{h(D);let w=D.find(R=>R.isDefault);w&&!g&&(b(w.id),n(w));},[g,n,b]),P=st.useCallback(async()=>{if(!e)return [];try{let D=[];if(i)D=await i.getVariants(e,t);else if(c){let w=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!w.ok)throw new Error(f("variant.toast.fetchFailed"));D=await w.json();}else D=x();return E(D),D}catch(D){console.error("Error fetching variants",D);let w=x();return E(w),d&&d(f("variant.toast.fetchFailed")),w}},[e,t,i,c,x,E,d,f]);return st.useEffect(()=>{P();},[e,t]),jsxRuntime.jsx(Pi,{variants:u,currentVariantId:g,onLoad:D=>{b(D.id),n(D);},onSave:async D=>{let w=Date.now().toString(),R;try{let F=D.scope||"Both",$=u.find(Y=>Y.name===D.name);w=$?$.id:Date.now().toString();let N=[];if($&&(Array.isArray($.filters)?N=[...$.filters]:$.filters&&(N=[{scope:"default",filters:$.filters}])),F==="Search"||F==="Both"){let Y=(Array.isArray(o),o);if(Y)if(Array.isArray(Y)&&Y.length>0&&Y[0].scope)Y.forEach(te=>{let Z=N.findIndex(Ze=>Ze.scope===te.scope);Z>=0?N[Z]=te:N.push(te);});else {let te={scope:t,filters:Y},Z=N.findIndex(Ze=>Ze.scope===t);Z>=0?N[Z]=te:N.push(te);}}let j=$?.layout||{},ie=[];if($&&Array.isArray($.layoutRefs)&&(ie=[...$.layoutRefs]),F==="Layout"||F==="Both")if(r&&r.length>0)r.forEach(Y=>{let te=ie.findIndex(Z=>Z.tableKey===Y.tableKey);te>=0?ie[te]=Y:ie.push(Y);});else {let Y={tableKey:t,layoutId:a||null},te=ie.findIndex(Z=>Z.tableKey===t);te>=0?ie[te]=Y:ie.push(Y);}if(R={appId:e,tableKey:t,...D,scope:F,id:w,createdAt:new Date().toISOString(),filters:N,layout:j,layoutRefs:ie},i)await i.saveVariant(R,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let te=u.some(Z=>Z.id===w)?u.map(Z=>Z.id===w?R:Z):[...u,R];h(te),k(te);}s&&s(f("variant.toast.saveSuccess")),(i||c)&&await P(),b(w),n(R);}catch(F){console.error("Error saving variant",F);let N=u.some(j=>j.id===w)?u.map(j=>j.id===w?R:j):[...u,R];h(N),k(N),b(w),n(R),d&&d(f("variant.toast.saveFailed"));}},onDelete:async D=>{try{if(i)await i.deleteVariant(D);else if(c){if(!(await fetch(`${c}/api/variants/${D}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let w=u.filter(R=>R.id!==D);h(w),k(w);}g===D&&b(""),(i||c)&&P(),s&&s(f("variant.toast.deleteSuccess"));}catch(w){console.error("Error deleting variant",w);let R=u.filter(F=>F.id!==D);h(R),k(R),g===D&&b(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async D=>{try{let w=u.find(F=>F.id===D);if(!w)return;let R={appId:e,tableKey:t,...w,isDefault:!0};if(i)await i.setDefaultVariant(D,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let F=u.map($=>({...$,isDefault:$.id===D}));h(F),k(F);}(i||c)&&await P(),s&&s(f("variant.toast.defaultSuccess"));}catch(w){console.error("Error setting default variant",w);let R=u.map(F=>({...F,isDefault:F.id===D}));h(R),k(R),d&&d(f("variant.toast.defaultFailed"));}}})};_a__default.default.extend(Xh__default.default);_a__default.default.extend(Qh__default.default);var Yh=[null,null],yl="0.85rem",Jh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},ey=material.styled(PickersDay.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%"}})),Wd=({label:e,value:t=Yh,onChange:o})=>{let{t:a,locale:r}=_(),n=Jh[r]||"en",i=e||a("dateRange.label"),[c,d]=st.useState(null),[s,l]=st.useState(t),[m,f]=st.useState("start"),[u,h]=st.useState(null),[I,p]=st.useState((t[0]||_a__default.default()).locale(n)),C=st__namespace.default.useRef(t);st.useEffect(()=>{let[w,R]=t,[F,$]=C.current,N=Y=>Y&&typeof Y.isSame=="function",j=!(w===null&&F===null||N(w)&&N(F)&&w.isSame(F,"day")),ie=!(R===null&&$===null||N(R)&&N($)&&R.isSame($,"day"));(j||ie)&&(l(t),t[0]&&N(t[0])&&p(t[0].locale(n))),C.current=t;},[t,n]);let g=w=>{d(w.currentTarget);},b=()=>{d(null),f("start"),h(null);},x=!!c,k=w=>{if(!w)return;let R=[...s];if(m==="start")R=[w,null],f("end");else {let F=R[0];F&&w.isBefore(F)?(R=[w,null],f("end")):(R=[F,w],f("start"));}l(R);},E=w=>{let R=_a__default.default().locale(n),F=[null,null];switch(w){case "today":F=[R,R];break;case "week":F=[R.startOf("week"),R.endOf("week")];break;case "month":F=[R.startOf("month"),R.endOf("month")];break}l(F),f("start"),p(R);},P=()=>{l([null,null]),f("start"),p(_a__default.default().locale(n));},S=()=>{o&&o(s),b();},M=()=>{l(t),f("start"),b();},T=st.useCallback(w=>{let{day:R,...F}=w,[$,N]=s,j=$?R.isSame($,"day"):false,ie=N?R.isSame(N,"day"):false,Y=$&&N?R.isBetween($,N,"day","()"):false,te=false;return m==="end"&&$&&!N&&u&&R.isAfter($,"day")&&R.isBefore(u.add(1,"day"),"day")&&(te=true),jsxRuntime.jsx(ey,{...F,day:R,disableMargin:true,isStart:j,isEnd:ie,isInRange:Y||te,onMouseEnter:()=>h(R)})},[s,m,u]),v=w=>w?w.locale(n).format("YYYY-MM-DD"):"",D=w=>w?w.locale(n).format("ll"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:s[0]?`${v(s[0])} - ${v(s[1])}`:"",onClick:g,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:yl}},InputProps:{readOnly:true,sx:{fontSize:yl,"& .MuiOutlinedInput-input":{fontSize:yl},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(s[0]||s[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:w=>{w.stopPropagation(),P();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(Zh__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:g,sx:{padding:"2px"},children:jsxRuntime.jsx(_h__default.default,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(material.Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:2,justifyContent:"space-between",children:[jsxRuntime.jsxs(material.Box,{sx:{p:1,border:1,borderColor:m==="start"?"primary.main":"divider",borderRadius:1,bgcolor:m==="start"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>f("start"),children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.startDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:s[0]?D(s[0]):a("dateRange.select")})]}),jsxRuntime.jsx(jh__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsxs(material.Box,{sx:{p:1,border:1,borderColor:m==="end"?"primary.main":"divider",borderRadius:1,bgcolor:m==="end"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>{s[0]&&f("end");},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.endDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:s[1]?D(s[1]):a("dateRange.select")})]})]})}),jsxRuntime.jsx(material.Box,{sx:{p:2,pb:0},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsxRuntime.jsx(material.Chip,{label:a("dateRange.today"),onClick:()=>E("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisWeek"),onClick:()=>E("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisMonth"),onClick:()=>E("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterDayjs.AdapterDayjs,adapterLocale:n,children:jsxRuntime.jsx(DateCalendar.DateCalendar,{value:null,referenceDate:I,onMonthChange:p,onYearChange:p,onChange:k,slots:{day:T},views:["day"],showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsxRuntime.jsx(material.Button,{size:"small",onClick:M,color:"inherit",children:a("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:S,children:a("common.done")})]})]})]})};var Ai={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},py={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"},uy=["equals","contains","notContains","wildcard"],Gd=["=","!=",">","<",">=","<=","between"],et="0.85rem",my=({field:e,value:t,onChange:o})=>{let{t:a}=_(),[r,n]=st.useState(null),[i,c]=st.useState(null),[d,s]=st.useState(""),[l,m]=st.useState(""),[f,u]=st.useState(false),[h,I]=st.useState(""),[p,C]=st.useState("");st.useEffect(()=>{let v=setTimeout(()=>{C(h);},1e3);return ()=>clearTimeout(v)},[h]);let g=t?.operator||(e.type==="number"?"=":"equals"),b=t?.value,x=v=>{let D=py[v];return D?a(D):v},k=v=>{n(v.currentTarget);},E=v=>{o({...t,operator:v,value:b}),n(null);},P={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:et}},InputProps:{sx:{fontSize:et}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:et,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=e.type||"text";if(S==="date"){let D=(w=>{if(!w)return [null,null];if(Array.isArray(w)&&w.length===2){let R=w[0]?_a__default.default.isDayjs(w[0])?w[0]:_a__default.default(w[0]):null,F=w[1]?_a__default.default.isDayjs(w[1])?w[1]:_a__default.default(w[1]):null;return [R,F]}return _a__default.default.isDayjs(w)||typeof w=="string"?[_a__default.default.isDayjs(w)?w:_a__default.default(w),null]:[null,null]})(b);return jsxRuntime.jsx(Wd,{label:e.label,value:D,onChange:w=>o({value:w,operator:"between"})})}if(S==="number"&&g==="between"){let v=()=>{o({value:[d,l],operator:"between"}),c(null);},D=Array.isArray(b)?`${b[0]||""} - ${b[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...P,label:e.label,value:D,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...P.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:x("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:k,sx:{width:24,height:24,fontSize:et},children:Ai.between})})}),readOnly:true},onClick:w=>c(w.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:et,minHeight:"auto",py:.5}}},children:Gd.map(w=>jsxRuntime.jsxs(material.MenuItem,{selected:w===g,onClick:()=>E(w),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ai[w]}),jsxRuntime.jsx(material.ListItemText,{primary:x(w),primaryTypographyProps:{fontSize:et}})]},w))}),jsxRuntime.jsx(material.Popover,{open:!!i,anchorEl:i,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.min"),type:"number",value:d,onChange:w=>s(w.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:et}},InputProps:{sx:{fontSize:et}}}),jsxRuntime.jsx(dy__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.max"),type:"number",value:l,onChange:w=>m(w.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:et}},InputProps:{sx:{fontSize:et}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:v,children:a("common.ok")})]})})]})}if(S==="select")return jsxRuntime.jsxs(material.TextField,{...P,select:true,label:e.label,value:b||"",onChange:v=>o({...t,value:v.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:a("common.none")})}),e.options?.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.value,children:v.label},v.value))]});if(S==="multi-select"){let v=Array.isArray(b)?b:[],D=e.options?.filter(w=>w.label.toLowerCase().includes(p.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...P,select:true,label:e.label,value:v,onChange:w=>o({...t,value:w.target.value,operator:"anyOf"}),SelectProps:{...P.SelectProps,multiple:true,onClose:()=>{I(""),C("");},renderValue:w=>{if(!Array.isArray(w)||w.length===0)return jsxRuntime.jsx("em",{children:a("common.none")});let R=$=>e.options?.find(N=>N.value===$)?.label||$,F=w.map(R);return F.length>2?`${F.slice(0,2).join(", ")} +${F.length-2}`:F.join(", ")}},children:[jsxRuntime.jsx(material.ListSubheader,{children:jsxRuntime.jsx(material.TextField,{size:"small",autoFocus:true,placeholder:a("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Hd__default.default,{fontSize:"small"})}),sx:{fontSize:et}},value:h,onChange:w=>I(w.target.value),onKeyDown:w=>{w.key!=="Escape"&&w.stopPropagation();},onClick:w=>w.stopPropagation()})}),D.length>0?D.map(w=>jsxRuntime.jsxs(material.MenuItem,{value:w.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:v.indexOf(w.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:w.label,primaryTypographyProps:{fontSize:et}})]},w.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:a("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:et}})})]})}let M=S==="number"?Gd:uy,T=f||b!==void 0&&b!==""&&b!==null||!!r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...P,label:e.label,sx:{minWidth:"120px"},value:b||"",type:S==="number"?"number":"text",onChange:v=>o({...t,value:v.target.value,operator:g}),onFocus:()=>u(true),onBlur:()=>u(false),InputProps:{...P.InputProps,startAdornment:T?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:x(g),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:k,onMouseDown:v=>v.preventDefault(),sx:{width:24,height:24,fontSize:et,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Ai[g]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(Hd__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:et,minHeight:"auto",py:.5}}},children:M.map(v=>jsxRuntime.jsxs(material.MenuItem,{selected:v===g,onClick:()=>E(v),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ai[v]}),jsxRuntime.jsx(material.ListItemText,{primary:x(v),primaryTypographyProps:{fontSize:et}})]},v))})]})},ja=({fields:e,filters:t,onFilterChange:o,variants:a=[],currentVariantId:r,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:s,loading:l=false,appId:m,tableKey:f,currentLayout:u,currentLayoutId:h,layoutRefs:I,variantService:p,serviceUrl:C})=>{let{t:g}=_(),[b,x]=st.useState(true),[k,E]=st.useState(null),[P,S]=st.useState(e.filter(D=>!D.hidden).map(D=>D.id)),M=(D,w)=>{o({...t,[D]:w});},T=D=>{P.includes(D)?S(P.filter(w=>w!==D)):S([...P,D]);};return jsxRuntime.jsxs(material.Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[m?jsxRuntime.jsx(Nd,{appId:m,tableKey:f,currentFilters:{values:t,visibleFields:P},currentLayout:u,currentLayoutId:h,layoutRefs:I,onLoad:D=>{if(!D.filters)return;let w=null;if(Array.isArray(D.filters)){let R=f||"default",F=D.filters.find($=>$.scope===R);w=F?F.filters:null;}else w=D.filters;w&&(w.values||w.visibleFields?(w.visibleFields&&Array.isArray(w.visibleFields)&&S(w.visibleFields),w.values&&o(w.values)):o(w)),n&&n(D);},variantService:p,serviceUrl:C,currentVariantId:r}):jsxRuntime.jsx(Pi,{variants:a,currentVariantId:r,onLoad:n,onSave:D=>{i&&i({...D,filters:{values:t,visibleFields:P}});},onDelete:c,onSetDefault:d}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:g("smartFilter.addFilters"),children:jsxRuntime.jsx(material.Button,{onClick:D=>E(D.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(sy__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:et,whiteSpace:"nowrap",minWidth:"fit-content"},children:g("smartFilter.adaptFilters")})}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:s,disabled:l,sx:{minWidth:"52px",fontWeight:"bold",fontSize:et},children:g(l?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:k,open:!!k,onClose:()=>E(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:et,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:g("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:et}})}),jsxRuntime.jsx(material.Divider,{}),e.map(D=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>T(D.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:P.includes(D.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:D.label,primaryTypographyProps:{fontSize:et}})]},D.id))]})]})]}),jsxRuntime.jsx(material.Collapse,{in:b,children:jsxRuntime.jsx(material.Box,{sx:{px:2,pb:2},children:jsxRuntime.jsx(material.Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(D=>P.includes(D.id)).map(D=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(my,{field:D,value:t[D.id]||{value:"",operator:D.type==="number"?"=":"equals"},onChange:w=>M(D.id,w)})},D.id))})})}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsxRuntime.jsx(material.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?jsxRuntime.jsx(ly__default.default,{sx:{fontSize:16},color:"action"}):jsxRuntime.jsx(mf__default.default,{sx:{fontSize:16},color:"action"})})})]})};var Qd=({layouts:e,currentLayoutId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=_(),[c,d]=st.useState(null),[s,l]=st.useState(false),[m,f]=st.useState(""),[u,h]=st.useState(""),[I,p]=st.useState({isDefault:false,isPublic:false}),C=e.find(P=>P.id===t),g=P=>{d(P.currentTarget);},b=()=>{d(null);},x=P=>{o(P),b();},k=()=>{f(""),h(""),p({isDefault:false,isPublic:false}),l(true),b();},E=()=>{m.trim()&&(a({name:m,description:u,...I}),l(false));};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:i("layout.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{onClick:k,color:"primary",size:"small",children:jsxRuntime.jsx(Xd__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:g,color:C?"primary":"default",children:jsxRuntime.jsx(Iy__default.default,{})})}),jsxRuntime.jsxs(material.Menu,{anchorEl:c,open:!!c,onClose:b,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"caption",children:i("layout.selectLayout")})}),jsxRuntime.jsxs(material.MenuItem,{onClick:k,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Xd__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i("layout.saveCurrentLayout")})]}),jsxRuntime.jsx(material.Divider,{}),e.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:i("layout.noSavedLayouts")})}),e.map((P,S)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>x(P),selected:P.id===t,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:P.id===t?"bold":"normal",noWrap:true,children:P.name})}),P.description&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:P.description})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center"},onClick:M=>M.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:P.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:M=>{M.stopPropagation(),n(P.id);},children:P.isDefault?jsxRuntime.jsx(Bh__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(wy__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:M=>{M.stopPropagation(),r(P.id);},children:jsxRuntime.jsx(_g__default.default,{fontSize:"small"})})})]})]})},P.id||S))]}),jsxRuntime.jsxs(material.Dialog,{open:s,onClose:()=>l(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:i("layout.saveLayout")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[jsxRuntime.jsx(material.TextField,{label:i("layout.layoutName"),value:m,onChange:P=>f(P.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(P=>P.name===m)&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"warning.main",sx:{ml:1},children:i("layout.warningOverwrite")}),jsxRuntime.jsx(material.TextField,{label:i("layout.layoutDescription"),value:u,onChange:P=>h(P.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:I.isDefault,onChange:P=>p({...I,isDefault:P.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:I.isPublic,onChange:P=>p({...I,isPublic:P.target.checked})}),label:i("layout.publicAllUsers")})]})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>l(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:E,variant:"contained",disabled:!m,children:i("common.save")})]})]})]})};var Li=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:a,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:s}=_(),[l,m]=st.useState([]),[f,u]=st.useState(""),h=`orbcafe.layouts.${e}.${t}`,I=S=>({id:S.layoutId,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt??new Date().toISOString(),layoutData:S.layout??{}}),p=S=>({appId:e,tableKey:t,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),C=st.useCallback(()=>{try{let S=localStorage.getItem(h);if(!S)return [];let M=JSON.parse(S);return Array.isArray(M)?M:[]}catch{return []}},[h]),g=st.useCallback(S=>{try{localStorage.setItem(h,JSON.stringify(S));}catch{}},[h]);st.useEffect(()=>{n!==void 0&&u(n);},[n]),st.useEffect(()=>{if(r&&l.length>0){let S=l.find(M=>M.id===r);S&&(u(S.id),a(S));}},[r,l,a]);let b=st.useCallback(async()=>{if(e){if(!i){let S=C();m(S);let M=S.find(T=>T.isDefault);M&&!f&&!r&&(u(M.id),a(M));return}try{let S=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let T=(await S.json()).map(I);m(T);let v=T.find(D=>D.isDefault);v&&!f&&!r&&(u(v.id),a(v));}catch(S){console.error("Error fetching layouts",S);let M=C();m(M);let T=M.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 st.useEffect(()=>{b();},[e,t]),jsxRuntime.jsx(Qd,{layouts:l,currentLayoutId:f,onLoad:S=>{u(S.id),a(S);},onSave:async S=>{let M=l.find(D=>D.name===S.name),T=M?M.id:Date.now().toString(),v={id:T,...S,createdAt:new Date().toISOString(),layoutData:o,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!i){let w=l.some(R=>R.id===T)?l.map(R=>R.id===T?v:R):[...l,v];m(w),g(w),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(D){console.error("Error saving layout",D);let R=l.some(F=>F.id===T)?l.map(F=>F.id===T?v:F):[...l,v];m(R),g(R),u(T),a(v),d&&d(s("layout.toast.saveLocalSuccess")),c&&c(s("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!i){let M=l.filter(T=>T.id!==S);m(M),g(M),f===S&&u(""),d&&d(s("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===S&&u(""),d&&d(s("layout.toast.deleteSuccess")),await b();}catch(M){console.error("Error deleting layout",M);let T=l.filter(v=>v.id!==S);m(T),g(T),f===S&&u(""),d&&d(s("layout.toast.deleteLocalSuccess")),c&&c(s("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!i){let M=l.map(T=>({...T,isDefault:T.id===S}));m(M),g(M),d&&d(s("layout.toast.defaultLocalSuccess"));return}try{let M=l.find(v=>v.id===S);if(!M)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p({...M,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(s("layout.toast.defaultSuccess")),await b();}catch(M){console.error("Error setting default",M);let T=l.map(v=>({...v,isDefault:v.id===S}));m(T),g(T),d&&d(s("layout.toast.defaultLocalSuccess")),c&&c(s("layout.toast.backendUnavailableDefaultLocal"));}}})};var Jd=(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},zi=(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 ep(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function Py(e,t){return e==="desc"?(o,a)=>ep(o,a,t):(o,a)=>-ep(o,a,t)}function Ry(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 Vi=e=>{let t=st.useCallback(V=>{let U=String(V?.label??V?.id??"").length*9+64,me=typeof V?.minWidth=="number"?V.minWidth:0;return Math.max(100,me,U)},[]),o=st.useCallback(()=>(e.columns||[]).filter(V=>!!V?.numeric).map(V=>V.id),[e.columns]),[a,r]=st.useState(""),[n,i]=st.useState(e.order||"asc"),[c,d]=st.useState(e.orderBy||""),[s,l]=st.useState(e.page||0),[m,f]=st.useState(e.rowsPerPage||20),[u,h]=st.useState(e.selected||[]),[I,p]=st.useState(e.columns?e.columns.map(V=>V.id):[]),[C,g]=st.useState(e.showSummary||false),[b,x]=st.useState(()=>o()),[k,E]=st.useState([]),[P,S]=st.useState(new Set),[M,T]=st.useState(()=>{let V={};return (e.columns||[]).forEach(O=>{V[O.id]=t(O);}),V}),[v,D]=st.useState(null),[w,R]=st.useState(null),[F,$]=st.useState(null),[N,j]=st.useState(null),[ie,Y]=st.useState(false),[te,Z]=st.useState(""),[Ze,at]=st.useState("");st.useEffect(()=>{e.layout&&ke(e.layout);},[e.layout]),st.useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),st.useEffect(()=>{e.selected!==void 0&&h(e.selected);},[e.selected]),st.useEffect(()=>{e.page!==void 0&&l(e.page);},[e.page]),st.useEffect(()=>{e.rowsPerPage!==void 0&&f(e.rowsPerPage);},[e.rowsPerPage]),st.useEffect(()=>{let V=o();x(O=>O.filter(me=>V.includes(me)));},[o]),st.useEffect(()=>{T(V=>{let O={...V};return (e.columns||[]).forEach(U=>{O[U.id]===void 0&&(O[U.id]=t(U));}),O});},[e.columns,t]);let He=st.useMemo(()=>{let V=e.rows||[];return a&&(V=V.filter(O=>Object.keys(O).some(U=>String(O[U]).toLowerCase().includes(a.toLowerCase())))),V},[e.rows,a]),re=st.useMemo(()=>e.onSortChange||!c?He:Ry(He,Py(n,c)),[He,n,c,e.onSortChange]),Ie=st.useCallback(V=>{if(k.length===0)return V.map(we=>({type:"row",data:we,id:we[e.rowKey||"id"]}));let O=[...V].sort((we,ce)=>{for(let Re of k){if(we[Re]<ce[Re])return -1;if(we[Re]>ce[Re])return 1}return 0}),U=(we,ce=0)=>{if(ce>=k.length)return we;let Re=k[ce],ye={},De=[];return we.forEach(Se=>{let he=Se[Re],Ce=`${Re}:${he}`;ye[Ce]||(ye[Ce]={key:Ce,field:Re,value:he,children:[],count:0,level:ce},De.push(ye[Ce])),ye[Ce].children.push(Se),ye[Ce].count++;}),De.forEach(Se=>{Se.children&&(Se.children=U(Se.children,ce+1));}),De},me=U(O),fe=(we,ce="")=>{let Re=[];return we.forEach(ye=>{if(ye.children){let De=ce?`${ce}>${ye.key}`:ye.key,Se=P.has(De);Re.push({type:"group",id:De,field:ye.field,value:ye.value,level:ye.level,count:ye.count,isExpanded:Se,childIds:(function he(Ce){let Ft=[];return Ce.children.forEach(bo=>{bo.children?Ft=Ft.concat(he(bo)):Ft.push(bo[e.rowKey||"id"]);}),Ft})(ye)}),Se&&(Re=Re.concat(fe(ye.children,De)));}else Re.push({type:"row",data:ye,id:ye[e.rowKey||"id"],level:k.length});}),Re};return fe(me)},[k,P,e.rowKey]),Te=st.useCallback(V=>{if(k.length===0)return [];let O=[...V].sort((fe,we)=>{for(let ce of k){if(fe[ce]<we[ce])return -1;if(fe[ce]>we[ce])return 1}return 0}),U=[],me=(fe,we,ce)=>{if(we>=k.length)return;let Re=k[we],ye=new Map;fe.forEach(De=>{let Se=De[Re],he=ye.get(Se);he?he.push(De):ye.set(Se,[De]);}),ye.forEach((De,Se)=>{let he=`${Re}:${Se}`,Ce=ce?`${ce}>${he}`:he;U.push(Ce),me(De,we+1,Ce);});};return me(O,0,""),U},[k]),je=st.useMemo(()=>Ie(re),[re,Ie]),rt=st.useMemo(()=>Te(re),[re,Te]),Ne=st.useMemo(()=>{let V=(e.rows||[]).length;return typeof e.count=="number"&&e.count>V},[e.count,e.rows]),Ye=st.useMemo(()=>Ne?je:m>0?je.slice(s*m,s*m+m):je,[je,s,m,Ne]),uo=st.useMemo(()=>Ne&&typeof e.count=="number"?e.count:je.length,[je.length,Ne,e.count]),Gt=V=>{S(O=>{let U=new Set(O);return U.has(V)?U.delete(V):U.add(V),U});},Ue=V=>{let O=rt.filter(U=>U===V||U.startsWith(`${V}>`));S(U=>{let me=new Set(U);return O.forEach(fe=>me.add(fe)),me});},Tt=V=>{S(O=>{let U=new Set(O);return Array.from(U).forEach(me=>{(me===V||me.startsWith(`${V}>`))&&U.delete(me);}),U});},At=V=>{if(!V){S(new Set);return}S(new Set(rt));},ht=V=>{let O=rt.filter(U=>U.startsWith(`${V}>`));return O.length===0?P.has(V):P.has(V)&&O.every(U=>P.has(U))},H=V=>{let O=c===V&&n==="asc",U=c===V&&n==="desc";if(e.onSortChange){O?e.onSortChange(V,"desc"):U?e.onSortChange("","asc"):e.onSortChange(V,"asc");return}O?(i("desc"),d(V)):U?(i("asc"),d("")):(i("asc"),d(V));},pe=(V,O)=>{T(U=>({...U,[V]:O}));},se=V=>{if(V.target.checked){let O=He.map(U=>U[e.rowKey||"id"]);h(O),e.onSelectionChange&&e.onSelectionChange(O);return}h([]),e.onSelectionChange&&e.onSelectionChange([]);},ue=(V,O)=>{let U=O[e.rowKey||"id"],me=u.indexOf(U),fe=[];me===-1?fe=fe.concat(u,U):me===0?fe=fe.concat(u.slice(1)):me===u.length-1?fe=fe.concat(u.slice(0,-1)):me>0&&(fe=fe.concat(u.slice(0,me),u.slice(me+1))),h(fe),e.onSelectionChange&&e.onSelectionChange(fe);},Ge=V=>{l(V),e.onPageChange&&e.onPageChange(V);},Me=V=>{f(V),l(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(V);},ao=V=>{let O=I.indexOf(V),U=[...I];O===-1?U.push(V):U.splice(O,1),p(U);},mo=V=>{let O=k.indexOf(V),U=[...k];O===-1?U.push(V):U.splice(O,1),E(U);},go=V=>{o().includes(V)&&x(U=>U.includes(V)?U.filter(me=>me!==V):[...U,V]);},fo=V=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:I,order:n,orderBy:c,grouping:k,columnWidths:M,showSummary:C,summaryColumns:b});},ho=V=>{let{layout:O,layoutId:U}=zi(V,e.tableKey||"default");U?(at(U),Z(U)):(at(""),Z("")),O&&(O.visibleColumns&&p(O.visibleColumns),O.order&&i(O.order),O.orderBy&&d(O.orderBy),O.grouping&&E(O.grouping),O.columnWidths&&T(O.columnWidths),O.showSummary!==void 0&&g(!!O.showSummary),Array.isArray(O.summaryColumns)&&x(O.summaryColumns));},ke=V=>{let O=V?.layoutData||V?.layout||V||{};O.visibleColumns&&p(O.visibleColumns),O.order&&i(O.order),O.orderBy!==void 0&&d(O.orderBy),O.grouping&&E(O.grouping),O.columnWidths&&T(O.columnWidths),O.showSummary!==void 0&&g(!!O.showSummary),Array.isArray(O.summaryColumns)&&x(O.summaryColumns),S(new Set),l(0),V?.id&&Z(V.id),at("");};st.useEffect(()=>{e.layout&&ho({layout:e.layout});},[e.layout]);let de=V=>{V.preventDefault(),j(N===null?{mouseX:V.clientX+2,mouseY:V.clientY-6}:null);},yt=()=>{j(null);},Pe=st.useMemo(()=>{if(!C)return {};let V={};e.columns.forEach(U=>{if(U.numeric&&b.includes(U.id)){let me=He.reduce((fe,we)=>{let ce=parseFloat(we[U.id]);return fe+(isNaN(ce)?0:ce)},0);V[U.id]=me.toFixed(2);}else V[U.id]="";});let O=e.columns.find(U=>I.includes(U.id));return O&&!O.numeric&&(V[O.id]="Total"),V},[He,e.columns,C,b,I]),Bt=()=>{if(!e.columns||!He)return;let V=e.columns.map(we=>we.label).join(","),O=He.map(we=>e.columns.map(ce=>{let Re=we[ce.id];return `"${(Re==null?"":String(Re)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
184
|
-
`),
|
|
185
|
-
${O}`,me=encodeURI(U),fe=document.createElement("a");fe.setAttribute("href",me),fe.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(fe),fe.click(),document.body.removeChild(fe);},yo=()=>{Y(true);},Ba=()=>{Y(false);};return {isMobile:false,columns:e.columns,order:n,orderBy:c,filterText:a,setFilterText:r,visibleColumns:I,setVisibleColumns:p,showSummary:C,setShowSummary:g,summaryColumns:b,grouping:k,setGrouping:E,expandedGroups:P,setExpandedGroups:S,groupAnchorEl:w,setGroupAnchorEl:R,summaryAnchorEl:F,setSummaryAnchorEl:$,columnWidths:M,setColumnWidths:T,anchorEl:v,setAnchorEl:D,contextMenu:N,setContextMenu:j,sensors:void 0,sortedAndFilteredRows:re,visibleRows:Ye,summaryRow:Pe,page:s,setPage:Ge,rowsPerPage:m,setRowsPerPage:Me,totalDisplayCount:uo,selected:u,setSelected:h,isAllExpanded:rt.length>0&&rt.every(V=>P.has(V)),handleColumnResize:pe,handleRequestSort:H,handleSelectAllClick:se,handleClick:ue,toggleSummaryColumn:go,handleDragEnd:()=>{},handleExport:Bt,handleContextMenu:de,handleCloseContextMenu:yt,toggleColumnVisibility:ao,toggleGroupExpand:Gt,toggleGroupField:mo,handleToggleAll:At,handleExpandGroupRecursively:Ue,handleCollapseGroupRecursively:Tt,isGroupFullyExpanded:ht,handleLayoutLoad:ke,handleVariantLoad:ho,handleLayoutSave:fo,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:I,order:n,orderBy:c,grouping:k,columnWidths:M,showSummary:C,summaryColumns:b},currentLayoutId:te,layoutIdToLoad:Ze,onPageChange:Ge,onRowsPerPageChange:Me,graphReportOpen:ie,handleOpenGraphReport:yo,handleCloseGraphReport:Ba}};var JP=e=>jsxRuntime.jsx(Ay__default.default,{...e}),eR=e=>jsxRuntime.jsx(el__default.default,{...e}),tR=e=>jsxRuntime.jsx(sp__default.default,{...e}),oR=e=>jsxRuntime.jsx(Jg__default.default,{...e}),aR=e=>jsxRuntime.jsx(ef__default.default,{...e}),Sa=e=>{let{t}=_(),o="0.85rem",{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:s,fitContainer:l=false,fullWidth:m=false,maxHeight:f,loading:u=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:I,filterConfig:p,rowKey:C,tableKey:g="default",graphReport:b,quickCreate:x,quickEdit:k,quickDelete:E,serviceUrl:P}=e,S=a||t("table.title.default"),{isMobile:M,columns:T,order:v,orderBy:D,filterText:w,setFilterText:R,visibleColumns:F,showSummary:$,setShowSummary:N,summaryColumns:j,grouping:ie,setGrouping:Y,expandedGroups:te,groupAnchorEl:Z,setGroupAnchorEl:Ze,summaryAnchorEl:at,setSummaryAnchorEl:He,columnWidths:re,anchorEl:Ie,setAnchorEl:Te,contextMenu:je,sensors:rt,sortedAndFilteredRows:Ne,summaryRow:Ye,visibleRows:uo,isAllExpanded:Gt,page:Ue,setPage:Tt,rowsPerPage:At,setRowsPerPage:ht,totalDisplayCount:H,setSelected:pe,handleColumnResize:se,handleRequestSort:ue,handleSelectAllClick:Ge,handleClick:Me,toggleSummaryColumn:ao,handleDragEnd:mo,handleExport:go,handleContextMenu:fo,handleCloseContextMenu:ho,toggleColumnVisibility:ke,toggleGroupExpand:de,toggleGroupField:yt,handleToggleAll:Pe,handleExpandGroupRecursively:Bt,handleCollapseGroupRecursively:yo,isGroupFullyExpanded:Ba,handleLayoutLoad:V,handleVariantLoad:O,handleLayoutSave:U,effectiveAppId:me,currentLayoutData:fe,currentLayoutId:we,layoutIdToLoad:ce,graphReportOpen:Re,handleOpenGraphReport:ye,handleCloseGraphReport:De}=Vi(e),Se=b?.enabled??false,he=Se&&(b?.interaction?.enabled??true),Ce=Ii(),Ft=!!x?.enabled,bo=!!k?.enabled,ut=!!E?.enabled,bt=x?.fields,ro=x?.excludeFields||[],da=x?.initialValues||{},[ur,xo]=st__namespace.default.useState(false),[Ut,Fa]=st__namespace.default.useState(false),[Go,Et]=st__namespace.default.useState({}),[Kt,Pt]=st__namespace.default.useState(false),[Ae,Uo]=st__namespace.default.useState(false),[Bo,Ko]=st__namespace.default.useState({}),[Ea,Fo]=st__namespace.default.useState(false),[La,za]=st__namespace.default.useState(false),Eo=u||Ut||Ae||La,qo=st__namespace.default.useMemo(()=>{let L=[...T];if(Array.isArray(bt)&&bt.length>0){let q=new Set(bt);L=L.filter(K=>q.has(K.id));}if(ro.length>0){let q=new Set(ro);L=L.filter(K=>!q.has(K.id));}return L.filter(q=>!!q?.id)},[T,ro,bt]),pa=C||"id",Lt=st__namespace.default.useMemo(()=>{let L=new Set(i);return Ne.filter(q=>L.has(q?.[pa]))},[i,Ne,pa]),vo=Lt.length===1?Lt[0]:null,_o=k?.fields,no=k?.excludeFields||[],Lo=k?.editableFields||[],Na=k?.nonEditableFields||[],mr=k?.primaryKeys?.length?k.primaryKeys:[pa],ua=st__namespace.default.useMemo(()=>{let L=[...T];if(Array.isArray(_o)&&_o.length>0){let q=new Set(_o);L=L.filter(K=>q.has(K.id));}if(no.length>0){let q=new Set(no);L=L.filter(K=>!q.has(K.id));}return L.filter(q=>!!q?.id)},[T,no,_o]),Va=st__namespace.default.useMemo(()=>new Set(mr),[mr]),Zo=st__namespace.default.useMemo(()=>new Set(Lo),[Lo]),Ot=st__namespace.default.useMemo(()=>new Set(Na),[Na]),Co=st__namespace.default.useCallback(L=>Zo.size>0?Zo.has(L):!(Ot.has(L)||Va.has(L)),[Zo,Ot,Va]);st__namespace.default.useEffect(()=>{!Re&&Ce.hasActiveFilters&&Ce.clearAll();},[Re,Ce.hasActiveFilters,Ce.clearAll]);let gr=()=>{let L={};qo.forEach(q=>{L[q.id]=da[q.id]??"";}),Et(L),xo(true);},Oa=()=>{Ut||xo(false);},fr=(L,q)=>{Et(K=>({...K,[L]:q}));},hr=async()=>{if(!x?.onSubmit){xo(false);return}try{Fa(!0),await x.onSubmit(Go),xo(!1);}finally{Fa(false);}},yr=()=>{if(!vo)return;let L={};ua.forEach(K=>{L[K.id]=vo[K.id]??"";});let q=k?.getInitialValues?{...L,...k.getInitialValues(vo)}:L;Ko(q),Pt(true);},qt=()=>{Ae||Pt(false);},br=(L,q)=>{Ko(K=>({...K,[L]:q}));},xr=async()=>{if(vo){if(!k?.onSubmit){Pt(false);return}try{Uo(!0),await k.onSubmit(Bo,vo),Pt(!1);}finally{Uo(false);}}},Wa=()=>{Lt.length!==0&&Fo(true);},jo=()=>{La||Fo(false);},ma=async()=>{if(Lt.length===0){Fo(false);return}if(!E?.onConfirm){Fo(false),pe([]),c?.([]);return}try{za(!0),await E.onConfirm(Lt),Fo(!1),pe([]),c?.([]);}finally{za(false);}},ga=Ne,{fieldMapping:y}=Mr({rows:ga,config:{...b,title:b?.title||`${S} ${t("graph.reportTitle")}`}}),A=st__namespace.default.useMemo(()=>he?Ce.applyRows(ga,y):ga,[he,Ce.applyRows,ga,y]),{model:B}=Mr({rows:A,config:{...b,title:b?.title||`${S} ${t("graph.reportTitle")}`,fieldMapping:y}}),W=B.table.columns.map(L=>({id:L.id,label:L.label,align:L.align||"left",minWidth:120,numeric:L.align==="right"})),Q=me?jsxRuntime.jsx(Li,{appId:me,tableKey:g,currentLayoutData:fe,onLayoutLoad:V,targetLayoutId:ce,activeLayoutId:we,serviceUrl:P??p?.serviceUrl}):null,le=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ri,{groupAnchorEl:Z,setGroupAnchorEl:Ze,grouping:ie,setGrouping:Y,columns:T,toggleGroupField:yt}),jsxRuntime.jsx(ni,{anchorEl:Ie,setAnchorEl:Te,columns:T,visibleColumns:F,toggleColumnVisibility:ke}),jsxRuntime.jsx(ii,{anchorEl:at,setAnchorEl:He,showSummary:$,setShowSummary:N,columns:T,summaryColumns:j,toggleSummaryColumn:ao}),jsxRuntime.jsx(si,{contextMenu:je,handleCloseContextMenu:ho,columns:T,visibleColumns:F,toggleColumnVisibility:ke})]});return M?jsxRuntime.jsxs(Sn__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[p&&jsxRuntime.jsx(ja,{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:g,currentLayout:[{tableKey:g,layoutData:fe}],variantService:p.variantService,serviceUrl:P??p.serviceUrl}),jsxRuntime.jsx(ad,{title:S,loading:u,showSummary:$,setShowSummary:N,setAnchorEl:Te,setSummaryAnchorEl:He,filterText:w,setFilterText:R,sortedAndFilteredRows:Ne,selected:i,columns:T,visibleColumns:F,summaryRow:Ye,handleClick:Me,selectionMode:n}),le]}):jsxRuntime.jsxs(Sn__default.default,{sx:{width:m?"100%":"auto",mb:l?0:2,...l?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p&&jsxRuntime.jsx(Sn__default.default,{sx:{mb:2},children:jsxRuntime.jsx(ja,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:L=>{O(L),p.onVariantLoad&&p.onVariantLoad(L);},onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,loading:u,appId:p.appId,tableKey:g,currentLayout:[{tableKey:g,layoutData:fe}],currentLayoutId:we,layoutRefs:[{tableKey:g,layoutId:we}],variantService:p.variantService,serviceUrl:P??p.serviceUrl})}),jsxRuntime.jsxs(Dy__default.default,{sx:{width:m?"100%":"auto",mb:l?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Eo?{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&&jsxRuntime.jsx(ei,{filterText:w,setFilterText:R,onRowsPerPageChange:ht,rowsPerPage:At,rowsPerPageOptions:h,page:Ue,count:H,onPageChange:Tt,actions:d,extraTools:s,grouping:ie,setGroupAnchorEl:Ze,showSummary:$,setShowSummary:N,setAnchorEl:Te,setSummaryAnchorEl:He,handleExport:go,showCreateButton:Ft,onOpenCreateDialog:gr,showEditButton:bo,onOpenEditDialog:yr,editDisabled:Lt.length!==1,showDeleteButton:ut,onOpenDeleteConfirm:Wa,deleteDisabled:Lt.length===0,onLayoutSave:I||p?.variantService&&p?.appId?U:void 0,loading:u,layoutManager:Q,onOpenGraphReport:Se?ye:void 0}),jsxRuntime.jsx(sp__default.default,{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:jsxRuntime.jsx(core.DndContext,{sensors:rt,collisionDetection:core.closestCenter,onDragEnd:mo,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(My__default.default,{sx:{minWidth:m?750:"auto",width:m?"100%":"auto",tableLayout:Object.keys(re).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsxRuntime.jsx(Qc,{columns:T,visibleColumns:F,order:v,orderBy:D,onRequestSort:ue,onContextMenu:fo,selectionMode:n,grouping:ie,isAllExpanded:Gt,handleToggleAll:Pe,rowCount:Ne.length,numSelected:i.length,onSelectAllClick:Ge,columnWidths:re,onColumnResize:se}),jsxRuntime.jsx(ed,{visibleRows:uo,columns:T,visibleColumns:F,selectionMode:n,selected:i,orderBy:D,loading:u,expandedGroups:te,toggleGroupExpand:de,handleExpandGroupRecursively:Bt,handleCollapseGroupRecursively:yo,isGroupFullyExpanded:Ba,handleClick:Me,onSelectionChange:c,grouping:ie,rowKeyProp:C,page:Ue,rowsPerPage:At}),$&&jsxRuntime.jsx(td,{showSummary:$,columns:T,visibleColumns:F,summaryRow:Ye,selectionMode:n?.toString(),grouping:ie,orderBy:D,zIndex:3})]})})})]}),Ft&&jsxRuntime.jsxs(tp__default.default,{open:ur,onClose:Oa,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:L=>`1px solid ${L.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(op__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:x?.title||t("quickCreate.createWithTitle",{title:S})}),jsxRuntime.jsx(ap__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Sn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[qo.map(L=>{let q=L.type==="number"||L.numeric?"number":L.type==="date"?"date":"text",K=L.label||L.id;return jsxRuntime.jsx(np__default.default,{label:K,value:Go[L.id]??"",onChange:Oe=>fr(L.id,Oe.target.value),type:q,size:"small",fullWidth:true,InputLabelProps:{shrink:q==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${L.id}`)}),x?.description&&jsxRuntime.jsx(ip__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:x.description})]})}),jsxRuntime.jsxs(rp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Oi__default.default,{onClick:Oa,sx:{fontSize:"0.85rem"},disabled:Ut,children:x?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Oi__default.default,{onClick:hr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Ut,children:x?.submitLabel||t("common.save")})]})]}),bo&&jsxRuntime.jsxs(tp__default.default,{open:Kt,onClose:qt,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:L=>`1px solid ${L.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(op__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||t("quickEdit.editWithTitle",{title:S})}),jsxRuntime.jsx(ap__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Sn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ua.map(L=>{let q=L.type==="number"||L.numeric?"number":L.type==="date"?"date":"text",K=L.label||L.id,Oe=Co(L.id);return jsxRuntime.jsx(np__default.default,{label:K,value:Bo[L.id]??"",onChange:z=>br(L.id,z.target.value),type:q,size:"small",fullWidth:true,disabled:!Oe,InputLabelProps:{shrink:q==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${L.id}`)}),k?.description&&jsxRuntime.jsx(ip__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:k.description})]})}),jsxRuntime.jsxs(rp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Oi__default.default,{onClick:qt,sx:{fontSize:"0.85rem"},disabled:Ae,children:k?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Oi__default.default,{onClick:xr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Ae||!vo,children:k?.submitLabel||t("common.save")})]})]}),ut&&jsxRuntime.jsx(sn,{open:Ea,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(Lt.length>1?t("quickDelete.confirmMessageMultiple",{count:Lt.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:jo,onConfirm:ma}),le,Se&&jsxRuntime.jsx(Si,{open:Re,onClose:De,model:B,aiAssistant:b?.aiAssistant,interaction:he?{enabled:true,filters:Ce.filters,fieldMapping:y,onPrimaryDimensionClick:L=>Ce.setFilter("primaryDimension",L),onSecondaryDimensionClick:L=>Ce.setFilter("secondaryDimension",L),onStatusClick:L=>Ce.setFilter("status",L),onClearFilter:Ce.clearFilter,onClearAll:Ce.clearAll}:void 0,tableContent:jsxRuntime.jsx(Sa,{appId:me||"graph-report-internal",title:t("graph.dataBody"),columns:W,rows:B.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},rR=Sa;var pR=({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 jsxRuntime.jsxs(_c,{title:t,hideHeader:o,children:[jsxRuntime.jsxs(material.Stack,{spacing:i,sx:{height:"100%",overflow:"hidden"},children:[c==="separated"&&d&&jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx(ja,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(Sa,{...s,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var yR=({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}=_(),[s,l]=st.useState(false),[m,f]=st.useState([]),[u,h]=st.useState({}),[I,p]=st.useState(e.variants||[]),[C,g]=st.useState(e.layout||null),[b,x]=st.useState(""),[k,E]=st.useState(0),[P,S]=st.useState(0),[M,T]=st.useState(o),[v,D]=st.useState([]),[w,R]=st.useState("asc"),[F,$]=st.useState("");st.useEffect(()=>{let re={};e.filters.forEach(Ie=>{Ie.defaultValue!==void 0&&(re[Ie.id]=Ie.defaultValue);}),h(re);},[e.filters]);let N=st.useCallback(async(re,Ie,Te,je,rt)=>{l(true);try{let Ne={...re,page:Ie+1,limit:Te,sort:rt,order:je},Ye;t?Ye=await t(Ne):typeof e.api=="function"?Ye=await e.api(Ne):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,Ne),Ye={rows:[],total:0}):(console.warn("No API configured for report"),Ye={rows:[],total:0}),Ye&&(f(Ye.rows||[]),E(Ye.total||0));}catch(Ne){console.error("Failed to fetch report data",Ne);}finally{l(false);}},[e.api,t]);st.useEffect(()=>{N(u,P,M,w,F);},[N,P,M,w,F]);let j=()=>{S(0),N(u,0,M,w,F);},ie=re=>{S(0),T(re);},Y=(re,Ie)=>{R(Ie),$(re);},te=re=>{h(re);},Z=re=>{x(re?.id||"");let Ie=Jd(re,r);if(Ie){let je=Ie.values??Ie;h(je),N(je,0,M,w,F),S(0);}let{layout:Te}=zi(re,r);Te&&g(Te);},Ze=re=>{let Ie={...re,id:Date.now().toString(),createdAt:new Date().toISOString()};p(Te=>[...Te,Ie]);},at=re=>{g(re);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:u,onFilterChange:te,onSearch:j,onVariantLoad:Z,onVariantSave:Ze,onVariantDelete:re=>p(Ie=>Ie.filter(Te=>Te.id!==re)),onVariantSetDefault:re=>{p(Ie=>Ie.map(Te=>({...Te,isDefault:Te.id===re})));},variants:I,currentVariantId:b,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:m,loading:s,rowKey:"id",count:k,page:P,rowsPerPage:M,rowsPerPageOptions:a,onPageChange:S,onRowsPerPageChange:ie,selectionMode:"multiple",selected:v,onSelectionChange:D,onLayoutSave:at,layout:C,title:e.title,showSummary:true,order:w,orderBy:F,serviceUrl:i,onSortChange:Y,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:u,rows:m,loading:s,refresh:j}};var $y=e=>[...e].sort((t,o)=>o.value-t.value),vR=({bars:e=[],lines:t=[],combos:o=[],heatmap:a=[],pies:r=[],waterfalls:n=[]})=>{let i=st.useMemo(()=>$y(e),[e]),c=st.useMemo(()=>[...t],[t]),d=st.useMemo(()=>[...o],[o]),s=st.useMemo(()=>[...a],[a]),l=st.useMemo(()=>{let f=r.reduce((u,h)=>u+h.value,0);return r.map(u=>({...u,percent:f>0?u.value/f*100:u.percent}))},[r]),m=st.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:s,pies:l,waterfalls:m}};var IR=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>st.useMemo(()=>!e||!t?"":fn({apiKey:e,query:t,zoom:o,mapType:a}),[e,t,o,a]),TR=({keyword:e,location:t})=>st.useMemo(()=>bi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var wn=({code:e,language:t="text",copyable:o=true,showLineNumbers:a=false,wrapLongLines:r=false,maxHeight:n})=>{let[i,c]=st.useState(false),d=st.useMemo(()=>e.replace(/\n$/,"").split(`
|
|
186
|
-
`),[e]);return jsxRuntime.jsxs(material.Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",bgcolor:"background.paper"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.6,bgcolor:"action.hover",borderBottom:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.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&&jsxRuntime.jsx(material.Tooltip,{title:i?"Copied":"Copy",children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:async()=>{try{await navigator.clipboard.writeText(e),c(!0),window.setTimeout(()=>c(!1),1400);}catch{c(false);}},children:i?jsxRuntime.jsx(
|
|
187
|
-
`).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=
|
|
183
|
+
`;return ct.useEffect(()=>{let d=n.current;if(!d)return;let l=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),s=l.gl;s.clearColor(0,0,0,0),d.appendChild(s.canvas);let g=new ogl.Triangle(s),f=new ogl.Program(s,{vertex:i,fragment:c,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height)},hue:{value:e},hover:{value:0},rot:{value:0},hoverIntensity:{value:t},backgroundColor:{value:Bm(r)}}}),u=new ogl.Mesh(s,{geometry:g,program:f});function h(){if(!d)return;let S=window.devicePixelRatio||1,w=d.clientWidth,A=d.clientHeight;l.setSize(w*S,A*S),s.canvas.style.width=w+"px",s.canvas.style.height=A+"px",f.uniforms.iResolution.value.set(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height);}window.addEventListener("resize",h),h();let T=0,p=0,v=0,m=.3,y=S=>{let w=d.getBoundingClientRect(),A=S.clientX-w.left,R=S.clientY-w.top,C=w.width,D=w.height,I=Math.min(C,D),P=C/2,M=D/2,O=(A-P)/I*2,N=(R-M)/I*2;Math.sqrt(O*O+N*N)<.8?T=1:T=0;},x=()=>{T=0;};d.addEventListener("mousemove",y),d.addEventListener("mouseleave",x);let k,F=S=>{k=requestAnimationFrame(F);let w=(S-p)*.001;p=S,f.uniforms.iTime.value=S*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=Bm(r);let A=a?1:T;f.uniforms.hover.value+=(A-f.uniforms.hover.value)*.1,o&&A>.5&&(v+=w*m),f.uniforms.rot.value=v,l.render({scene:u});};return k=requestAnimationFrame(F),()=>{cancelAnimationFrame(k),window.removeEventListener("resize",h),d.removeEventListener("mousemove",y),d.removeEventListener("mouseleave",x),s.canvas.parentNode===d&&d.removeChild(s.canvas),s.getExtension("WEBGL_lose_context")?.loseContext();}},[e,t,o,a,r]),jsxRuntime.jsx("div",{ref:n,className:"w-full h-full"})}function hk(e,t,o){let a,r,n;if(t===0)a=r=n=o;else {let i=(l,s,g)=>(g<0&&(g+=1),g>1&&(g-=1),g<.16666666666666666?l+(s-l)*6*g:g<.5?s:g<.6666666666666666?l+(s-l)*(.6666666666666666-g)*6:l),c=o<.5?o*(1+t):o+t-o*t,d=2*o-c;a=i(d,c,e+1/3),r=i(d,c,e),n=i(d,c,e-1/3);}return new ogl.Vec3(a,r,n)}function Bm(e){if(e==="transparent")return new ogl.Vec3(0,0,0);if(e.startsWith("#")){let a=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;return new ogl.Vec3(a,r,n)}let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t)return new ogl.Vec3(parseInt(t[1])/255,parseInt(t[2])/255,parseInt(t[3])/255);let o=e.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(o){let a=parseInt(o[1])/360,r=parseInt(o[2])/100,n=parseInt(o[3])/100;return hk(a,r,n)}return new ogl.Vec3(0,0,0)}var Em=Eg(()=>{"use client";});function mo(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var ul={primary:"#000000",primaryHover:"#333333"},vi={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"},Tn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},cd=()=>"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 Wg=classVarianceAuthority.cva(cd(),{variants:{variant:{default:`${vi.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:`${vi.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:vi.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-[${ul.primary}] hover:bg-[${ul.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:Tn.none,sm:Tn.sm,md:Tn.md,full:Tn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),ml=ct__namespace.forwardRef(({className:e,variant:t,size:o,asChild:a=false,...r},n)=>jsxRuntime.jsx(a?reactSlot.Slot:"button",{className:mo(Wg({variant:t,size:o,className:e})),ref:n,...r}));ml.displayName="Button";var Hg={"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"},Gg={"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"},Ug={"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"},Kg={"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"},qg={"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"},_g={"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"},In={en:Hg,zh:Gg,fr:Ug,de:Kg,ja:qg,ko:_g};var pd=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,a)=>{let r=t[a];return r==null?"":String(r)}):e,Qg={locale:"en",t:(e,t)=>pd(In.en[e]||e,t)},ud=ct.createContext(Qg),Ci=({locale:e="en",messages:t,children:o})=>{let a=ct.useMemo(()=>{let r=In[e]||In.en,n=t?.[e]||{},i={...In.en,...r,...n};return {locale:e,t:(c,d)=>pd(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(ud.Provider,{value:a,children:o})},j=()=>ct.useContext(ud);function fl({items:e,onItemClick:t,className:o="",level:a=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:c}=j(),d=i==="dark",l=navigation.usePathname(),[s,g]=ct.useState(false),[f,u]=ct.useState(new Set),h=r!==void 0&&n!==void 0,T=h?r:f;ct.useEffect(()=>{g(true);},[]);let p=m=>{if(h)n(m);else {let y=new Set(f);y.has(m)?y.delete(m):y.add(m),u(y);}},v=m=>{m.children&&m.children.length>0&&p(m.id),t&&t(m);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:mo("tree-menu",o),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:mo("tree-menu",o),children:e.map(m=>{let y=T.has(m.id)||m.isExpanded,x=m.children&&m.children.length>0,k=m.appurl||m.href,F=s&&k?l===k:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[F&&jsxRuntime.jsx("div",{className:mo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(ml,{variant:"ghost",className:mo("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${a*4}`,F?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:()=>v(m),children:[x&&jsxRuntime.jsx("div",{className:mo("flex-shrink-0 transition-transform duration-200",y&&"rotate-90",F?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})}),!x&&jsxRuntime.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),m.icon&&jsxRuntime.jsx("div",{className:mo("flex-shrink-0 transition-colors duration-200",F?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}),jsxRuntime.jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsxRuntime.jsx("div",{className:mo("text-sm truncate transition-colors duration-200",F?"font-semibold":"font-medium"),children:m.title||m.label}),m.description&&jsxRuntime.jsx("div",{className:mo("text-xs truncate transition-colors duration-200",F?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:m.description,children:m.description})]})]}),x&&jsxRuntime.jsx("div",{className:mo("grid transition-[grid-template-rows] duration-300 ease-in-out",y?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx(fl,{items:m.children,onItemClick:t,level:a+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},m.id)})})}var bd=({collapsed:e,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light"})=>{let{t:i}=j(),c=n==="dark",d=navigation.useRouter(),[l,s]=ct.useState(""),[g,f]=ct.useState(new Set);ct.useEffect(()=>{e&&f(new Set);},[e]);let u=ct.useCallback(v=>{let m=[],y=x=>{x.forEach(k=>{m.push(k.id),k.children&&y(k.children);});};return y(v),m},[]),h=ct.useMemo(()=>{if(!l.trim())return r;let v=m=>m.reduce((y,x)=>{let k=x.title?.toLowerCase().includes(l.toLowerCase())||x.description?.toLowerCase().includes(l.toLowerCase()),F=x.children?v(x.children):[];return (k||F.length>0)&&y.push({...x,children:F.length>0?F:x.children}),y},[]);return v(r)},[l,r]),T=ct.useMemo(()=>l.trim()?new Set(u(r)):g,[l,r,g,u]),p=ct.useCallback(async v=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",v),v.id==="chat"||v.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(y){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",y),d.push("/chat");}return}let m=v.appurl||v.href;m&&(m.startsWith("http://")||m.startsWith("https://")?window.open(m,"_blank"):d.push(m));},[d]);return jsxRuntime.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:[jsxRuntime.jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsxRuntime.jsx("div",{className:"flex justify-center",children:jsxRuntime.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:jsxRuntime.jsx(lucideReact.Search,{className:"h-5 w-5"})})}):jsxRuntime.jsxs("div",{className:`relative transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:[jsxRuntime.jsx("input",{type:"text",placeholder:i("navigation.searchPlaceholder"),value:l,onChange:v=>s(v.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"}`}),jsxRuntime.jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:jsxRuntime.jsx(lucideReact.Search,{className:`h-4 w-4 ${c?"text-gray-500":"text-gray-400"}`})})]})}),jsxRuntime.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:h.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":i(l?"navigation.noMatch":"navigation.noAccessibleApp")}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e&&jsxRuntime.jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsxRuntime.jsx(fl,{items:h,onItemClick:p,className:"space-y-1",expandedIds:T,colorMode:n,onToggleExpand:v=>{let m=new Set(g);h.some(x=>x.id===v)?m.has(v)?m.delete(v):(h.forEach(x=>{x.id!==v&&m.has(x.id)&&m.delete(x.id);}),m.add(v)):m.has(v)?m.delete(v):m.add(v),f(m);}})}),e&&jsxRuntime.jsx("div",{className:"space-y-2",children:r.map(v=>jsxRuntime.jsx("div",{className:"space-y-1",children:jsxRuntime.jsx("button",{onClick:()=>{t();let m=new Set([v.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:v.title||""}),children:v.icon||jsxRuntime.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:v.title?.charAt(0)||"?"})})},v.id))})]})}),!e&&jsxRuntime.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:jsxRuntime.jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsxRuntime.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 vd=(e={})=>{let{initialCollapsed:t=false,content:o=[]}=e,[a,r]=ct.useState(t),[n,i]=ct.useState(o),c=ct.useCallback(()=>{r(l=>!l);},[]),d=ct.useMemo(()=>({collapsed:a,onToggle:c,menuData:n}),[a,c,n]);return {collapsed:a,setCollapsed:r,toggleCollapsed:c,menuData:n,setMenuData:i,navigationIslandProps:d}};var Do=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var yl=class{constructor(){ld(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);}},ra=new yl,oT={success:(e,t)=>ra.show("success",e,t),error:(e,t)=>ra.show("error",e,t),warning:(e,t)=>ra.show("warning",e,t),info:(e,t)=>ra.show("info",e,t),show:(e,t,o)=>ra.show(e,t,o),hide:()=>ra.hide()};var vf={success:{icon:jsxRuntime.jsx(hf__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(yf__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(bf__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(xf__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},Pn=({open:e,title:t,message:o,onClose:a,onConfirm:r,confirmText:n,cancelText:i,showCancel:c=true,maxWidth:d="xs",type:l="default"})=>{let{t:s}=j(),g=n||s("messageBox.confirm"),f=i||s("messageBox.cancel"),u=()=>{r?r():a();},h=vf[l],T=l!=="default";return jsxRuntime.jsxs(Dp__default.default,{open:e,onClose:a,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...T&&{borderTop:`6px solid ${h.iconColor}`}}},children:[T&&jsxRuntime.jsx(Gn__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:h.iconColor},children:h.icon}),t&&jsxRuntime.jsx(Mp__default.default,{sx:{textAlign:T?"center":"left",pt:T?1:2},children:t}),jsxRuntime.jsx(Ap__default.default,{sx:{textAlign:T?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(mf__default.default,{children:o}):o}),jsxRuntime.jsxs(Bp__default.default,{sx:{justifyContent:T?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(Do,{onClick:a,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(Do,{onClick:u,variant:"contained",sx:{bgcolor:T?h.iconColor:void 0,"&:hover":{bgcolor:T?h.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},xT=()=>{let[e,t]=ct__namespace.default.useState(null),[o,a]=ct__namespace.default.useState(false);ct__namespace.default.useEffect(()=>{let i=c=>{c?(t(c),a(true)):(a(false),t(null));};return ra.register(i),()=>ra.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?jsxRuntime.jsx(Pn,{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 kd=({title:e,hideHeader:t,children:o})=>jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!t&&jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(material.Typography,{variant:"h4",children:e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,overflow:"hidden"},children:o})]});var ki=e=>{let{t}=j(),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,l=Math.max(0,typeof e.page=="number"?e.page:0),s=i===-1?1:Math.max(1,Math.ceil(d/i)),g=Math.min(l+1,s),f=l>0,u=l<s-1&&i!==-1;return jsxRuntime.jsxs(material.Toolbar,{sx:{pl:{sm:2},pr:{xs:1,sm:1},alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.TextField,{size:"small",placeholder:t("table.toolbar.searchPlaceholder"),value:e.filterText,onChange:h=>e.setFilterText(h.target.value),InputProps:{sx:{fontSize:o,"& .MuiInputBase-input":{fontSize:o,color:"text.primary"},"& .MuiInputBase-input::placeholder":{fontSize:o,opacity:1}},startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(hp__default.default,{fontSize:"small"})})},sx:{width:300}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,color:"text.secondary",whiteSpace:"nowrap"},children:t("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.Select,{size:"small",variant:"standard",value:i,disableUnderline:true,onChange:h=>e.onRowsPerPageChange?.(Number(h.target.value)),sx:{fontSize:o,fontWeight:600,color:"text.primary",minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"},"& .MuiSvgIcon-root":{color:"text.primary"}},children:c.map(h=>jsxRuntime.jsx(material.MenuItem,{value:h,sx:{fontSize:o},children:h===-1?t("common.all"):h},`rows-per-page-${h}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(l-1,0)),disabled:!f,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(Wf__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:t("table.toolbar.pageOf",{current:g,total:s})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(l+1,s-1)),disabled:!u,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx($f__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[n.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:n.map((h,T)=>jsxRuntime.jsx(ct__namespace.default.Fragment,{children:h},`toolbar-custom-${T}`))}),jsxRuntime.jsx(material.Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.groupBy"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.setGroupAnchorEl(h.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx(Ef__default.default,{})})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.summary"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:e.showSummary?"primary.main":"text.primary"},onClick:h=>e.setSummaryAnchorEl(h.currentTarget),children:jsxRuntime.jsx(Lf__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.setAnchorEl(h.currentTarget),children:jsxRuntime.jsx(Af__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.export"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:e.handleExport,children:jsxRuntime.jsx(Ff__default.default,{})})}),e.showCreateButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.newItem"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenCreateDialog,color:"primary",children:jsxRuntime.jsx(Nf__default.default,{})})}),e.showEditButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.editItem"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenEditDialog,color:"primary",disabled:!!e.editDisabled,children:jsxRuntime.jsx(Vf__default.default,{})})})}),e.showDeleteButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.deleteItem"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenDeleteConfirm,color:"error",disabled:!!e.deleteDisabled,children:jsxRuntime.jsx(Of__default.default,{})})})}),e.onOpenGraphReport&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.graphicReport"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:e.onOpenGraphReport,children:jsxRuntime.jsx(zf__default.default,{})})}),e.onLayoutSave&&!e.layoutManager&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.onLayoutSave(h),children:jsxRuntime.jsx(wp__default.default,{})})}),e.layoutManager]})]})};var Si=e=>{let{t}=j(),{onSelectAllClick:o,order:a,orderBy:r,numSelected:n=0,rowCount:i=0,onRequestSort:c,columns:d,visibleColumns:l,selectionMode:s,grouping:g=[],isAllExpanded:f=false,handleToggleAll:u,onColumnResize:h,columnWidths:T}=e,[p,v]=ct.useState(null),m=ct.useRef(null),y=C=>D=>{p||c(C);},x=(C,D,I)=>{C.preventDefault(),C.stopPropagation(),v(D),m.current={startX:C.clientX,startWidth:I,colId:D},document.addEventListener("mousemove",k),document.addEventListener("mouseup",F),document.body.style.cursor="col-resize";},k=C=>{if(!m.current)return;let{startX:D,startWidth:I,colId:P}=m.current,M=C.clientX-D,O=Math.max(50,I+M);h&&h(P,O);},F=()=>{v(null),m.current=null,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",F),document.body.style.cursor="";};ct.useEffect(()=>()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",F);},[]);let S=s==="multiple"||s==="single",w=g.length>0&&!!u,A=t(f?"table.group.collapseAll":"table.group.expandAll"),R=d.filter(C=>l.includes(C.id));return jsxRuntime.jsx(Kf__default.default,{children:jsxRuntime.jsxs(qf__default.default,{children:[S&&jsxRuntime.jsx(kl__default.default,{padding:"checkbox",sx:C=>({width:48,position:"sticky",top:0,zIndex:4,backgroundColor:C.palette.mode==="dark"?"#000000":"#f5f5f5",color:C.palette.mode==="dark"?"#ffffff":C.palette.text.primary}),children:jsxRuntime.jsx(_f__default.default,{color:"primary",indeterminate:n>0&&n<i,checked:i>0&&n===i,onChange:o,disabled:s==="single"})}),w&&jsxRuntime.jsx(kl__default.default,{align:"center",padding:"checkbox",sx:C=>({width:44,position:"sticky",top:0,zIndex:4,backgroundColor:C.palette.mode==="dark"?"#000000":"#f5f5f5",color:C.palette.mode==="dark"?"#ffffff":C.palette.text.primary}),children:jsxRuntime.jsx(Xf__default.default,{title:A,children:jsxRuntime.jsx(Zf__default.default,{size:"small",onClick:C=>{C.stopPropagation(),u?.(!f);},sx:{p:.2},children:f?jsxRuntime.jsx(Yf__default.default,{fontSize:"small"}):jsxRuntime.jsx(Qf__default.default,{fontSize:"small"})})})}),R.map(C=>{let D=T?.[C.id]||C.minWidth||100;return jsxRuntime.jsxs(kl__default.default,{align:"left",padding:C.disablePadding?"none":"normal",sortDirection:r===C.id?a:false,style:{width:D,minWidth:D,maxWidth:D},sx:I=>({position:"sticky",top:0,zIndex:4,backgroundColor:I.palette.mode==="dark"?"#000000":"#f5f5f5",color:I.palette.mode==="dark"?"#ffffff":I.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsxRuntime.jsx(jf__default.default,{active:r===C.id,direction:r===C.id?a:"asc",onClick:y(C.id),sx:I=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:I.palette.mode==="dark"?"#ffffff":I.palette.text.primary,opacity:r===C.id?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:I.palette.mode==="dark"?"#ffffff":I.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:I.palette.mode==="dark"?"#ffffff":I.palette.text.primary}),children:jsxRuntime.jsx(Gn__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:C.label})}),jsxRuntime.jsx(Gn__default.default,{onMouseDown:I=>x(I,C.id,typeof D=="number"?D:100),onClick:I=>I.stopPropagation(),sx:{position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize","&:hover":{backgroundColor:"primary.main",opacity:.5},zIndex:1}})]},C.id)})]})})};var Rd=e=>{let{t}=j(),{visibleRows:o,visibleColumns:a,selected:r=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:l,grouping:s=[],isGroupFullyExpanded:g,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:u}=e,h=m=>r.indexOf(m)!==-1,T=l==="multiple"||l==="single",p=s.length>0,v=a.length+(T?1:0)+(p?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((m,y)=>{if(m.type==="group"){let x=d.has(m.id),k=m.childIds||[],F=k.filter(R=>h(R)).length,S=k.length>0&&F===k.length,w=F>0&&F<k.length;return jsxRuntime.jsxs(material.TableRow,{sx:R=>({backgroundColor:R.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:R.palette.text.primary,borderBottomColor:R.palette.divider},"& .MuiIconButton-root":{color:R.palette.text.primary},"& .MuiCheckbox-root":{color:R.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:R.palette.primary.main}}),children:[T&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:S,indeterminate:w,onChange:R=>{if(R.stopPropagation(),!!e.onSelectionChange)if(S){let C=r.filter(D=>!k.includes(D));e.onSelectionChange(C);}else {let C=Array.from(new Set([...r,...k]));e.onSelectionChange(C);}},onClick:R=>R.stopPropagation(),sx:{p:.5}})}),p&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.25},children:[s.length>1&&m.level<s.length-1&&jsxRuntime.jsx(material.Tooltip,{title:g?.(m.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>{g?.(m.id)?u?.(m.id):f?.(m.id);},sx:{p:.25},children:g?.(m.id)?jsxRuntime.jsx(Yf__default.default,{fontSize:"small"}):jsxRuntime.jsx(Qf__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(m.id),sx:{p:.25},children:x?jsxRuntime.jsx(rh__default.default,{}):jsxRuntime.jsx($f__default.default,{})})]})}),jsxRuntime.jsx(material.TableCell,{colSpan:a.length,sx:{py:1,pl:m.level*3+1},children:jsxRuntime.jsxs(material.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||y,F=h(k),S=`enhanced-table-checkbox-${y}`,A=(m.level!==void 0?m.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:R=>n&&n(R,x),role:"checkbox","aria-checked":F,tabIndex:-1,selected:F,sx:{cursor:"pointer"},children:[T&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{pl:A>0?A+1:void 0},children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:F,inputProps:{"aria-labelledby":S}})}),p&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(R=>a.includes(R.id)).map((R,C)=>{let I=!T&&C===0&&A>0?{pl:A+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:I,children:R.render?R.render(x[R.id],x):(function(){let M=x[R.id];if(R.numeric){if(typeof M=="number")return M.toLocaleString();if(typeof M=="string"&&M.trim()!==""&&!isNaN(Number(M)))return Number(M).toLocaleString()}return M})()},R.id)})]},k)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:v,align:"center",children:t("common.noData")})})]})};var Dd=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 jsxRuntime.jsx(material.TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxRuntime.jsxs(material.TableRow,{children:[n&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper"}}),i&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper",width:44}}),t.map(c=>jsxRuntime.jsx(material.TableCell,{sx:{fontWeight:"bold",fontSize:"0.85rem",bgcolor:"background.paper",color:"text.primary"},children:(function(){let l=o[c];return l==null||l===""?"":typeof l=="number"?l.toLocaleString():typeof l=="string"&&l.trim()!==""&&!isNaN(Number(l))?Number(l).toLocaleString():l})()},c))]})})};var Ad=e=>{let{t}=j();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var zr=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:a,columns:r,toggleGroupField:n})=>{let{t:i}=j();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsxs(material.Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{px:1},children:i("table.menu.groupBy")}),o.length>0&&jsxRuntime.jsx(material.Button,{size:"small",color:"error",onClick:()=>a([]),startIcon:jsxRuntime.jsx(xh__default.default,{}),children:i("table.menu.clearAll")})]}),jsxRuntime.jsx(material.Divider,{}),r.map(c=>{let d=o.includes(c.id),l=o.indexOf(c.id)+1;return jsxRuntime.jsx(material.MenuItem,{onClick:()=>n(c.id),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Checkbox,{checked:d,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:c.label}),d&&jsxRuntime.jsx(material.Badge,{badgeContent:l,color:"primary",sx:{mr:2}})]})},c.id)})]})},Nr=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=j();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:n("table.menu.visibleColumns")})}),jsxRuntime.jsx(material.Divider,{}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>r(i.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:a.includes(i.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:i.label})]},i.id))]})},Pi=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:a,columns:r,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=j();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{children:jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Switch,{checked:o,onChange:d=>a(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),jsxRuntime.jsx(material.Divider,{}),r.filter(d=>d.numeric).map(d=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>i(d.id),disabled:!o,children:[jsxRuntime.jsx(material.Checkbox,{checked:n.includes(d.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:d.label})]},d.id)),r.filter(d=>d.numeric).length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:c("table.menu.noNumericColumns")})})]})},Ri=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=j();return jsxRuntime.jsxs(material.Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsxRuntime.jsx(material.MenuItem,{onClick:t,children:n("common.copy")}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.MenuItem,{disabled:true,children:n("table.menu.visibleColumns")}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>r(i.id),children:[jsxRuntime.jsx(material.ListItemIcon,{children:a.includes(i.id)&&jsxRuntime.jsx(bh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})};var Mn=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),Ed=({kpis:e})=>{let{t}=j(),o=[{label:t("graph.kpi.totalRecords"),value:Mn(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:Mn(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:Mn(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:Mn(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:Mn(e.flaggedCount,0),color:"error.main"}];return jsxRuntime.jsx(material.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=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:a.label}),jsxRuntime.jsx(material.Typography,{variant:"h4",fontWeight:800,sx:{color:a.color},children:a.value})]},a.label))})};var Di=({title:e,subtitle:t,children:o})=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:2,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",fontWeight:700,children:e}),t&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t}),o]});var Bn=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:a=210,activeName:r,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=Math.max(...e.map(c=>c.value),1);return t==="vertical"?jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:a},children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.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}}),jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:c.name,sx:{display:"block",mt:.5},children:c.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[c.value.toFixed(1),o]})]},c.name))}):jsxRuntime.jsx(material.Stack,{spacing:1,children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:c.name,children:c.name}),jsxRuntime.jsx(material.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:jsxRuntime.jsx(material.Box,{sx:{width:`${c.value/i*100}%`,height:"100%",bgcolor:c.name===r?"primary.dark":"primary.main"}})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),o]})]},c.name))})};var Nd=({data:e,color:t="#42A5F5",valueSuffix:o="",height:a=220})=>{if(e.length===0)return jsxRuntime.jsx(material.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),l=Math.max(...i,1)-c||1,s=e.map((f,u)=>{let h=n+u*(r-n*2)/Math.max(e.length-1,1),T=a-n-(f.value-c)/l*(a-n*2);return {x:h,y:T,...f}}),g=s.map(f=>`${f.x},${f.y}`).join(" ");return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsxRuntime.jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),jsxRuntime.jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:g}),s.map(f=>jsxRuntime.jsx("circle",{cx:f.x,cy:f.y,r:4,fill:t},f.name))]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(f=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:f.name,sx:{display:"block"},children:f.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[f.value.toFixed(1),o]})]},f.name))})]})};var Vd=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:a=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=Math.max(...e.map(s=>s.barValue),1),c=Math.max(...e.map(s=>s.lineValue),1),d=e.map((s,g)=>{let f=(r-n*2)/e.length,u=Math.max(f*.5,8),h=n+g*f+(f-u)/2,T=s.barValue/i*(a-n*2),p=a-n-T;return {x:h,y:p,barHeight:T,barWidth:u,item:s}}),l=e.map((s,g)=>{let f=(r-n*2)/e.length,u=n+g*f+f/2,h=a-n-s.lineValue/c*(a-n*2);return {x:u,y:h,item:s}});return jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsxRuntime.jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),d.map(s=>jsxRuntime.jsx("rect",{x:s.x,y:s.y,width:s.barWidth,height:Math.max(s.barHeight,4),rx:6,fill:t},s.item.name)),jsxRuntime.jsx("polyline",{fill:"none",stroke:o,strokeWidth:3,points:l.map(s=>`${s.x},${s.y}`).join(" ")}),l.map(s=>jsxRuntime.jsx("circle",{cx:s.x,cy:s.y,r:3.5,fill:o},`${s.item.name}-line`))]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(s=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:s.name,sx:{display:"block"},children:s.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",s.barValue.toFixed(1)]}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",s.lineValue.toFixed(1)]})]},s.name))})]})};var Ph=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,Wd=({data:e})=>{if(e.length===0)return jsxRuntime.jsx(material.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 jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsxRuntime.jsx(material.Box,{}),t.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:n},n)),o.map(n=>jsxRuntime.jsxs(material.Box,{sx:{display:"contents"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{alignSelf:"center"},children:n}),t.map(i=>{let c=r.get(`${n}__${i}`)||0,d=c/a;return jsxRuntime.jsx(material.Box,{sx:{height:36,borderRadius:1,bgcolor:Ph(d),border:"1px solid rgba(148,163,184,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:c.toFixed(1)})},`${n}-${i}`)})]},n))]})})};var Rh=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],zi=({data:e,variant:t="donut",colors:o=Rh,size:a=180,activeName:r,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=0,c=e.map((d,l)=>{let s=i;return i+=d.percent,`${o[l%o.length]} ${s}% ${i}%`});return jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:a,height:a,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:Math.round(a*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsxRuntime.jsx(material.Stack,{spacing:1,sx:{minWidth:180},children:e.map((d,l)=>jsxRuntime.jsxs(material.Box,{onClick:()=>n?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:n?"pointer":"default",opacity:r&&d.name!==r?.45:1},children:[jsxRuntime.jsx(material.Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:o[l%o.length]}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{flex:1},children:d.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var Hd=({effect:e,branches:t})=>{if(t.length===0)return jsxRuntime.jsx(material.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 jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(r=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))}),jsxRuntime.jsxs(material.Box,{sx:{position:"relative",height:32},children:[jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(a.length,1)}, minmax(0, 1fr))`,gap:1},children:a.map(r=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))})]})};var Ud=({data:e,height:t=240})=>{if(e.length===0)return jsxRuntime.jsx(material.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,l=i-n||1,s=g=>t-d-(g-n)/l*(t-d*2);return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${c} ${t}`,sx:{width:"100%",height:t},children:[jsxRuntime.jsx("line",{x1:d,y1:s(0),x2:c-d,y2:s(0),stroke:"rgba(148,163,184,0.4)"}),a.map((g,f)=>{let u=(c-d*2)/a.length,h=Math.max(u*.55,8),T=d+f*u+(u-h)/2,p=s(Math.max(g.start,g.end)),v=s(Math.min(g.start,g.end)),m=g.type==="total"?"#42A5F5":g.delta>=0?"#66BB6A":"#EF5350";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:T,y:p,width:h,height:Math.max(v-p,4),rx:6,fill:m}),jsxRuntime.jsx("text",{x:T+h/2,y:p-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:g.end.toFixed(1)})]},g.name)})]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${a.length}, minmax(0, 1fr))`,gap:1},children:a.map(g=>jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:g.name,children:g.name},g.name))})]})};var Ln=({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}`},YI=(e,t=360)=>{let o=Ln(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var _d=({apiKey:e,query:t,embedUrl:o,zoom:a=14,mapType:r="roadmap",height:n=320})=>{let i=o||(e&&t?Ln({apiKey:e,query:t,zoom:a,mapType:r}):"");return i?jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:i,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:i,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var Oi=({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 Qd=({keyword:e,location:t,embedUrl:o,height:a=320})=>{let r=o||Oi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:r,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:a,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:r,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var Yd=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:a})=>{let{t:r}=j();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(Di,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(Bn,{data:e,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:n=>a?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Di,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(Bn,{data:t,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:n=>a?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Di,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsxRuntime.jsx(zi,{data:o,variant:"donut",activeName:a?.filters?.status,onItemClick:n=>a?.onStatusClick?.(n.name)})})]})};var Wt=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var El=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var _h=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],jh=["zh","en","de","fr","ja","ko"],tp=({open:e,onClose:t,value:o,onSaveAll:a,modelOptions:r=_h,promptLangOptions:n=jh,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:l})=>{let[s,g]=ct.useState(o),[f,u]=ct.useState(d||""),[h,T]=ct.useState(l||""),[p,v]=ct.useState(false);ct.useEffect(()=>{e&&(g(o),u(d||""),T(l||""));},[e,o,d,l]);let m=(x,k)=>{g(F=>({...F,[x]:k}));},y=async()=>{if(a)try{v(!0),await a({settings:s,analysisTemplateId:f||void 0,responseTemplateId:h||void 0});}finally{v(false);}};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"lg",children:[jsxRuntime.jsxs(material.DialogTitle,{sx:{pr:7,pb:2.2},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{position:"absolute",right:12,top:12},children:jsxRuntime.jsx(qh__default.default,{})})]}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"18px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2.2,children:[jsxRuntime.jsxs(material.Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Wt,{size:"small",value:s.baseUrl,onChange:x=>m("baseUrl",x.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Wt,{size:"small",type:"password",value:s.apiKey,onChange:x=>m("apiKey",x.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Wt,{size:"small",value:s.model,onChange:x=>m("model",x.target.value),fullWidth:true,select:true,label:"Model",children:r.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x,children:x},x))})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Wt,{size:"small",value:s.promptLang,onChange:x=>m("promptLang",x.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x,children:x},x))})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxRuntime.jsxs(Wt,{size:"small",value:f,onChange:x=>u(x.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),i.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,children:x.label},x.id))]}),jsxRuntime.jsx(El,{multiline:true,minRows:8,value:s.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"}}}),jsxRuntime.jsxs(Wt,{size:"small",value:h,onChange:x=>T(x.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),c.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,children:x.label},x.id))]}),jsxRuntime.jsx(El,{multiline:true,minRows:8,value:s.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"}}})]})]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:y,disabled:!a||p,children:"Save"})]})]})};var Ui=({open:e,onClose:t,model:o,tableContent:a,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:c}=j(),[d,l]=ct.useState(i?.defaultPrompt||""),[s,g]=ct.useState(false),[f,u]=ct.useState(false),h=n?.enabled!==false&&!!n,T=i?.enabled!==false,p=n?.filters||{},v=!!(p.primaryDimension||p.secondaryDimension||p.status),m=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";ct.useEffect(()=>{e&&l(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let y=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 jsxRuntime.jsx(material.Dialog,{open:e,onClose:t,fullScreen:true,children:jsxRuntime.jsxs(material.Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",fontWeight:800,children:o.title}),jsxRuntime.jsx(material.Chip,{size:"small",label:c("graph.records",{count:o.kpis.totalRecords})}),h&&p.primaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${p.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),h&&p.secondaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${p.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),h&&p.status&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${p.status}`,onDelete:()=>n?.onClearFilter("status")}),h&&v&&jsxRuntime.jsx(material.Button,{size:"small",onClick:()=>n?.onClearAll(),children:"Clear"})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{width:{xs:"100%",lg:"auto"}},children:[T&&jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i?.onVoiceInput,children:jsxRuntime.jsx(ey__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:k=>l(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),x());},placeholder:m,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:x,disabled:s||!d.trim(),children:jsxRuntime.jsx(oy__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>u(true),children:jsxRuntime.jsx(ty__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(qh__default.default,{})})]})]})}),jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsxRuntime.jsx(Ed,{kpis:o.kpis}),jsxRuntime.jsx(Yd,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:h?{filters:p,onPrimaryDimensionClick:k=>n?.onPrimaryDimensionClick(k),onSecondaryDimensionClick:k=>n?.onSecondaryDimensionClick(k),onStatusClick:k=>n?.onStatusClick(k)}:void 0}),r,a]}),jsxRuntime.jsx(tp,{open:f,onClose:()=>u(false),value:y,onSaveAll:i?.onSaveAll,modelOptions:i?.modelOptions,promptLangOptions:i?.promptLangOptions,analysisTemplateOptions:i?.analysisTemplateOptions,responseTemplateOptions:i?.responseTemplateOptions,defaultAnalysisTemplateId:i?.defaultAnalysisTemplateId,defaultResponseTemplateId:i?.defaultResponseTemplateId})]})})};var Pa={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"]},ry=5,op=e=>e.toLowerCase().replace(/[\s_-]/g,""),Ra=(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=>[op(i),i]));for(let i of o){let c=n.get(op(i));if(c)return c}return r[0]||a},to=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},Bt=(e,t)=>e==null||e===""?t:String(e),ny=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=Bt(i[t],r);n.set(c,(n.get(c)||0)+to(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,a)},iy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Bt(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=to(c[o]),l.billable+=to(c[a]),i.set(d,l);}),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)},sy=(e,t,o)=>{let a=e.length;if(a===0)return [];let r=new Map;return e.forEach(n=>{let i=Bt(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}))},ap=(e,t,o)=>{let a=new Map;return e.forEach(r=>{let n=Bt(r[t],"N/A");a.set(n,(a.get(n)||0)+to(r[o]));}),Array.from(a.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},ly=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Bt(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=to(c[o]),l.billable+=to(c[a]),i.set(d,l);}),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)},cy=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=Bt(i[t],r),d=Bt(i[o],r),l=`${c}__${d}`;n.set(l,(n.get(l)||0)+to(i[a]));}),Array.from(n.entries()).map(([i,c])=>{let[d,l]=i.split("__");return {x:d,y:l,value:c}})},dy=(e,t,o)=>{let a=ap(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"}]},py=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Bt(c[t],n),l=`${Bt(c[o],n)} / ${Bt(c[a],n)}`,s=i.get(d)||new Map;s.set(l,(s.get(l)||0)+1),i.set(d,s);}),Array.from(i.entries()).map(([c,d])=>({title:c,causes:Array.from(d.entries()).sort((l,s)=>s[1]-l[1]).slice(0,r).map(([l,s])=>`${l} (${s})`)})).slice(0,6)},_r=({rows:e,config:t})=>{let{t:o}=j(),a=o("graph.unassigned"),r=ct.useMemo(()=>{let s=t?.fieldMapping;return {primaryDimension:Ra(e,s?.primaryDimension,Pa.primaryDimension,"Category"),secondaryDimension:Ra(e,s?.secondaryDimension,Pa.secondaryDimension,"Owner"),status:Ra(e,s?.status,Pa.status,"Status"),date:Ra(e,s?.date,Pa.date,"Date"),description:Ra(e,s?.description,Pa.description,"Description"),reportHours:Ra(e,s?.reportHours,Pa.reportHours,"ReportHours"),billableHours:Ra(e,s?.billableHours,Pa.billableHours,"BillableHours"),amount:Ra(e,s?.amount,Pa.amount,"Amount")}},[e,t?.fieldMapping]),n=ct.useMemo(()=>e.map((s,g)=>{let f=to(s[r.reportHours]),u=to(s[r.billableHours]),h=to(s[r.amount]),T=f>0?u/f*100:0;return {id:`graph-row-${g}`,Date:Bt(s[r.date],""),Primary:Bt(s[r.primaryDimension],a),Secondary:Bt(s[r.secondaryDimension],a),Description:Bt(s[r.description],""),ReportHours:f,BillableHours:u,Amount:h,Efficiency:T,Status:Bt(s[r.status],a)}}),[e,r,a]),i=ct.useMemo(()=>{let s=n.length,g=n.reduce((v,m)=>v+to(m.ReportHours),0),f=n.reduce((v,m)=>v+to(m.BillableHours),0),u=n.reduce((v,m)=>v+to(m.Amount),0),h=g>0?f/g*100:0,T=t?.statusFlagValues||["flag","flagged","warning","risk"],p=n.filter(v=>T.includes(Bt(v.Status,"").toLowerCase())).length;return {totalRecords:s,totalReportHours:g,totalBillableHours:f,efficiency:h,totalAmount:u,flaggedCount:p}},[n,t?.statusFlagValues]),c=t?.topN||ry,d=ct.useMemo(()=>({billableByPrimary:ny(n,"Primary","BillableHours",c,a),efficiencyBySecondary:iy(n,"Secondary","ReportHours","BillableHours",c,a),statusDistribution:sy(n,"Status",a),lineByDate:ap(n,"Date","BillableHours"),comboByPrimary:ly(n,"Primary","ReportHours","BillableHours",c,a),heatmapPrimarySecondary:cy(n,"Primary","Secondary","BillableHours",a),waterfallBillable:dy(n,"Date","BillableHours"),fishboneStatusCauses:py(n,"Status","Primary","Secondary",3,a)}),[n,c,a]),l=ct.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:l}};var jr=e=>String(e??"").trim(),qi=(e={})=>{let[t,o]=ct.useState(e),a=ct.useCallback((d,l)=>{o(s=>{let g=l?.trim();if(!g){let f={...s};return delete f[d],f}if(s[d]===g){let f={...s};return delete f[d],f}return {...s,[d]:g}});},[]),r=ct.useCallback(d=>{o(l=>{if(!l[d])return l;let s={...l};return delete s[d],s});},[]),n=ct.useCallback(()=>{o({});},[]),i=ct.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=ct.useCallback((d,l)=>d.filter(s=>!(t.primaryDimension&&jr(s[l.primaryDimension])!==jr(t.primaryDimension)||t.secondaryDimension&&jr(s[l.secondaryDimension])!==jr(t.secondaryDimension)||t.status&&jr(s[l.status])!==jr(t.status))),[t]);return {filters:t,setFilter:a,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:c}};var ji=({variants:e,currentVariantId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=j(),d=material.useTheme().palette.mode==="dark",l="0.85rem",s={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]=ct.useState(false),[u,h]=ct.useState(""),[T,p]=ct.useState(false),[v,m]=ct.useState(false),y=e.find(F=>F.id===t),x=()=>{h(y?.name||i("variant.newVariant")),p(y?.isDefault||false),m(y?.isPublic||false),f(true);},k=()=>{a({name:u,isDefault:T,isPublic:v,description:""}),f(false);};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsxRuntime.jsx(material.Autocomplete,{size:"small",sx:{width:s,"& .MuiInputBase-root":{fontSize:l,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:l},"& .MuiAutocomplete-noOptions":{fontSize:l}},noOptionsText:jsxRuntime.jsx(material.Typography,{sx:{fontSize:l},children:i("variant.noOptions")}),options:e,getOptionLabel:F=>F.name+(F.isDefault?` (${i("variant.defaultSuffix")})`:""),value:y||null,onChange:(F,S)=>{S&&o(S);},renderInput:F=>jsxRuntime.jsx(material.TextField,{...F,variant:"outlined",size:"small",InputProps:{...F.InputProps,sx:{fontSize:l,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(F,S)=>jsxRuntime.jsx("li",{...F,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{flex:1,fontSize:l},children:S.name}),S.isDefault&&jsxRuntime.jsx(Sy__default.default,{fontSize:"small",color:"action"})]})})}),jsxRuntime.jsx(material.Tooltip,{title:i("variant.saveView"),children:jsxRuntime.jsx(material.IconButton,{onClick:x,size:"small",color:"primary",children:jsxRuntime.jsx(wp__default.default,{fontSize:"small"})})}),jsxRuntime.jsxs(material.Dialog,{open:g,onClose:()=>f(false),children:[jsxRuntime.jsx(material.DialogTitle,{children:i("variant.saveView")}),jsxRuntime.jsxs(material.DialogContent,{children:[jsxRuntime.jsx(material.TextField,{autoFocus:true,margin:"dense",label:i("variant.viewName"),fullWidth:true,variant:"outlined",value:u,onChange:F=>h(F.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:T,onChange:F=>p(F.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:v,onChange:F=>m(F.target.checked)}),label:i("variant.publicAllUsers")})]}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>f(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:k,variant:"contained",children:i("common.save")})]})]})]})};var pp=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:a,layoutRefs:r,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:l,currentVariantId:s,onVariantChange:g})=>{let{t:f}=j(),[u,h]=ct.useState([]),[T,p]=ct.useState(""),v=`orbcafe.variants.${e}.${t}`,m=s!==void 0?s:T,y=D=>{s===void 0&&p(D),g&&g(D);},x=ct.useCallback(()=>{try{let D=localStorage.getItem(v);if(!D)return [];let I=JSON.parse(D);return Array.isArray(I)?I:[]}catch{return []}},[v]),k=ct.useCallback(D=>{try{localStorage.setItem(v,JSON.stringify(D));}catch{}},[v]),F=ct.useCallback(D=>{h(D);let I=D.find(P=>P.isDefault);I&&!m&&(y(I.id),n(I));},[m,n,y]),S=ct.useCallback(async()=>{if(!e)return [];try{let D=[];if(i)D=await i.getVariants(e,t);else if(c){let I=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!I.ok)throw new Error(f("variant.toast.fetchFailed"));D=await I.json();}else D=x();return F(D),D}catch(D){console.error("Error fetching variants",D);let I=x();return F(I),d&&d(f("variant.toast.fetchFailed")),I}},[e,t,i,c,x,F,d,f]);return ct.useEffect(()=>{S();},[e,t]),jsxRuntime.jsx(ji,{variants:u,currentVariantId:m,onLoad:D=>{y(D.id),n(D);},onSave:async D=>{let I=Date.now().toString(),P;try{let M=D.scope||"Both",O=u.find(te=>te.name===D.name);I=O?O.id:Date.now().toString();let N=[];if(O&&(Array.isArray(O.filters)?N=[...O.filters]:O.filters&&(N=[{scope:"default",filters:O.filters}])),M==="Search"||M==="Both"){let te=(Array.isArray(o),o);if(te)if(Array.isArray(te)&&te.length>0&&te[0].scope)te.forEach(re=>{let Q=N.findIndex(U=>U.scope===re.scope);Q>=0?N[Q]=re:N.push(re);});else {let re={scope:t,filters:te},Q=N.findIndex(U=>U.scope===t);Q>=0?N[Q]=re:N.push(re);}}let X=O?.layout||{},oe=[];if(O&&Array.isArray(O.layoutRefs)&&(oe=[...O.layoutRefs]),M==="Layout"||M==="Both")if(r&&r.length>0)r.forEach(te=>{let re=oe.findIndex(Q=>Q.tableKey===te.tableKey);re>=0?oe[re]=te:oe.push(te);});else {let te={tableKey:t,layoutId:a||null},re=oe.findIndex(Q=>Q.tableKey===t);re>=0?oe[re]=te:oe.push(te);}if(P={appId:e,tableKey:t,...D,scope:M,id:I,createdAt:new Date().toISOString(),filters:N,layout:X,layoutRefs:oe},i)await i.saveVariant(P,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let re=u.some(Q=>Q.id===I)?u.map(Q=>Q.id===I?P:Q):[...u,P];h(re),k(re);}l&&l(f("variant.toast.saveSuccess")),(i||c)&&await S(),y(I),n(P);}catch(M){console.error("Error saving variant",M);let N=u.some(X=>X.id===I)?u.map(X=>X.id===I?P:X):[...u,P];h(N),k(N),y(I),n(P),d&&d(f("variant.toast.saveFailed"));}},onDelete:async D=>{try{if(i)await i.deleteVariant(D);else if(c){if(!(await fetch(`${c}/api/variants/${D}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let I=u.filter(P=>P.id!==D);h(I),k(I);}m===D&&y(""),(i||c)&&S(),l&&l(f("variant.toast.deleteSuccess"));}catch(I){console.error("Error deleting variant",I);let P=u.filter(M=>M.id!==D);h(P),k(P),m===D&&y(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async D=>{try{let I=u.find(M=>M.id===D);if(!I)return;let P={appId:e,tableKey:t,...I,isDefault:!0};if(i)await i.setDefaultVariant(D,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let M=u.map(O=>({...O,isDefault:O.id===D}));h(M),k(M);}(i||c)&&await S(),l&&l(f("variant.toast.defaultSuccess"));}catch(I){console.error("Error setting default variant",I);let P=u.map(M=>({...M,isDefault:M.id===D}));h(P),k(P),d&&d(f("variant.toast.defaultFailed"));}}})};Ua__default.default.extend($y__default.default);Ua__default.default.extend(Hy__default.default);var Gy=[null,null],Ol="0.85rem",Uy={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Ky=material.styled(PickersDay.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%"}})),gp=({label:e,value:t=Gy,onChange:o})=>{let{t:a,locale:r}=j(),n=Uy[r]||"en",i=e||a("dateRange.label"),[c,d]=ct.useState(null),[l,s]=ct.useState(t),[g,f]=ct.useState("start"),[u,h]=ct.useState(null),[T,p]=ct.useState((t[0]||Ua__default.default()).locale(n)),v=ct__namespace.default.useRef(t);ct.useEffect(()=>{let[I,P]=t,[M,O]=v.current,N=te=>te&&typeof te.isSame=="function",X=!(I===null&&M===null||N(I)&&N(M)&&I.isSame(M,"day")),oe=!(P===null&&O===null||N(P)&&N(O)&&P.isSame(O,"day"));(X||oe)&&(s(t),t[0]&&N(t[0])&&p(t[0].locale(n))),v.current=t;},[t,n]);let m=I=>{d(I.currentTarget);},y=()=>{d(null),f("start"),h(null);},x=!!c,k=I=>{if(!I)return;let P=[...l];if(g==="start")P=[I,null],f("end");else {let M=P[0];M&&I.isBefore(M)?(P=[I,null],f("end")):(P=[M,I],f("start"));}s(P);},F=I=>{let P=Ua__default.default().locale(n),M=[null,null];switch(I){case "today":M=[P,P];break;case "week":M=[P.startOf("week"),P.endOf("week")];break;case "month":M=[P.startOf("month"),P.endOf("month")];break}s(M),f("start"),p(P);},S=()=>{s([null,null]),f("start"),p(Ua__default.default().locale(n));},w=()=>{o&&o(l),y();},A=()=>{s(t),f("start"),y();},R=ct.useCallback(I=>{let{day:P,...M}=I,[O,N]=l,X=O?P.isSame(O,"day"):false,oe=N?P.isSame(N,"day"):false,te=O&&N?P.isBetween(O,N,"day","()"):false,re=false;return g==="end"&&O&&!N&&u&&P.isAfter(O,"day")&&P.isBefore(u.add(1,"day"),"day")&&(re=true),jsxRuntime.jsx(Ky,{...M,day:P,disableMargin:true,isStart:X,isEnd:oe,isInRange:te||re,onMouseEnter:()=>h(P)})},[l,g,u]),C=I=>I?I.locale(n).format("YYYY-MM-DD"):"",D=I=>I?I.locale(n).format("ll"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:l[0]?`${C(l[0])} - ${C(l[1])}`:"",onClick:m,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Ol}},InputProps:{readOnly:true,sx:{fontSize:Ol,"& .MuiOutlinedInput-input":{fontSize:Ol},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(l[0]||l[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:I=>{I.stopPropagation(),S();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(Oy__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:m,sx:{padding:"2px"},children:jsxRuntime.jsx(Vy__default.default,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxRuntime.jsxs(material.Popover,{open:x,anchorEl:c,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,minWidth:320}}},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:2,justifyContent:"space-between",children:[jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.startDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:l[0]?D(l[0]):a("dateRange.select")})]}),jsxRuntime.jsx(Wy__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsxs(material.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:()=>{l[0]&&f("end");},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.endDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:l[1]?D(l[1]):a("dateRange.select")})]})]})}),jsxRuntime.jsx(material.Box,{sx:{p:2,pb:0},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsxRuntime.jsx(material.Chip,{label:a("dateRange.today"),onClick:()=>F("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisWeek"),onClick:()=>F("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisMonth"),onClick:()=>F("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterDayjs.AdapterDayjs,adapterLocale:n,children:jsxRuntime.jsx(DateCalendar.DateCalendar,{value:null,referenceDate:T,onMonthChange:p,onYearChange:p,onChange:k,slots:{day:R},views:["day"],showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsxRuntime.jsx(material.Button,{size:"small",onClick:A,color:"inherit",children:a("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:w,children:a("common.done")})]})]})]})};var Yi={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},ob={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"},ab=["equals","contains","notContains","wildcard"],yp=["=","!=",">","<",">=","<=","between"],rt="0.85rem",rb=({field:e,value:t,onChange:o})=>{let{t:a}=j(),[r,n]=ct.useState(null),[i,c]=ct.useState(null),[d,l]=ct.useState(""),[s,g]=ct.useState(""),[f,u]=ct.useState(false),[h,T]=ct.useState(""),[p,v]=ct.useState("");ct.useEffect(()=>{let C=setTimeout(()=>{v(h);},1e3);return ()=>clearTimeout(C)},[h]);let m=t?.operator||(e.type==="number"?"=":"equals"),y=t?.value,x=C=>{let D=ob[C];return D?a(D):C},k=C=>{n(C.currentTarget);},F=C=>{o({...t,operator:C,value:y}),n(null);},S={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:rt}},InputProps:{sx:{fontSize:rt}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:rt,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},w=e.type||"text";if(w==="date"){let D=(I=>{if(!I)return [null,null];if(Array.isArray(I)&&I.length===2){let P=I[0]?Ua__default.default.isDayjs(I[0])?I[0]:Ua__default.default(I[0]):null,M=I[1]?Ua__default.default.isDayjs(I[1])?I[1]:Ua__default.default(I[1]):null;return [P,M]}return Ua__default.default.isDayjs(I)||typeof I=="string"?[Ua__default.default.isDayjs(I)?I:Ua__default.default(I),null]:[null,null]})(y);return jsxRuntime.jsx(gp,{label:e.label,value:D,onChange:I=>o({value:I,operator:"between"})})}if(w==="number"&&m==="between"){let C=()=>{o({value:[d,s],operator:"between"}),c(null);},D=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...S,label:e.label,value:D,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...S.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:x("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:k,sx:{width:24,height:24,fontSize:rt},children:Yi.between})})}),readOnly:true},onClick:I=>c(I.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:rt,minHeight:"auto",py:.5}}},children:yp.map(I=>jsxRuntime.jsxs(material.MenuItem,{selected:I===m,onClick:()=>F(I),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Yi[I]}),jsxRuntime.jsx(material.ListItemText,{primary:x(I),primaryTypographyProps:{fontSize:rt}})]},I))}),jsxRuntime.jsx(material.Popover,{open:!!i,anchorEl:i,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.min"),type:"number",value:d,onChange:I=>l(I.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:rt}},InputProps:{sx:{fontSize:rt}}}),jsxRuntime.jsx(tb__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.max"),type:"number",value:s,onChange:I=>g(I.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:rt}},InputProps:{sx:{fontSize:rt}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:C,children:a("common.ok")})]})})]})}if(w==="select")return jsxRuntime.jsxs(material.TextField,{...S,select:true,label:e.label,value:y||"",onChange:C=>o({...t,value:C.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:a("common.none")})}),e.options?.map(C=>jsxRuntime.jsx(material.MenuItem,{value:C.value,children:C.label},C.value))]});if(w==="multi-select"){let C=Array.isArray(y)?y:[],D=e.options?.filter(I=>I.label.toLowerCase().includes(p.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...S,select:true,label:e.label,value:C,onChange:I=>o({...t,value:I.target.value,operator:"anyOf"}),SelectProps:{...S.SelectProps,multiple:true,onClose:()=>{T(""),v("");},renderValue:I=>{if(!Array.isArray(I)||I.length===0)return jsxRuntime.jsx("em",{children:a("common.none")});let P=O=>e.options?.find(N=>N.value===O)?.label||O,M=I.map(P);return M.length>2?`${M.slice(0,2).join(", ")} +${M.length-2}`:M.join(", ")}},children:[jsxRuntime.jsx(material.ListSubheader,{children:jsxRuntime.jsx(material.TextField,{size:"small",autoFocus:true,placeholder:a("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(hp__default.default,{fontSize:"small"})}),sx:{fontSize:rt}},value:h,onChange:I=>T(I.target.value),onKeyDown:I=>{I.key!=="Escape"&&I.stopPropagation();},onClick:I=>I.stopPropagation()})}),D.length>0?D.map(I=>jsxRuntime.jsxs(material.MenuItem,{value:I.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:C.indexOf(I.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:I.label,primaryTypographyProps:{fontSize:rt}})]},I.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:a("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:rt}})})]})}let A=w==="number"?yp:ab,R=f||y!==void 0&&y!==""&&y!==null||!!r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...S,label:e.label,sx:{minWidth:"120px"},value:y||"",type:w==="number"?"number":"text",onChange:C=>o({...t,value:C.target.value,operator:m}),onFocus:()=>u(true),onBlur:()=>u(false),InputProps:{...S.InputProps,startAdornment:R?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:x(m),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:k,onMouseDown:C=>C.preventDefault(),sx:{width:24,height:24,fontSize:rt,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Yi[m]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(hp__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:rt,minHeight:"auto",py:.5}}},children:A.map(C=>jsxRuntime.jsxs(material.MenuItem,{selected:C===m,onClick:()=>F(C),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Yi[C]}),jsxRuntime.jsx(material.ListItemText,{primary:x(C),primaryTypographyProps:{fontSize:rt}})]},C))})]})},cr=({fields:e,filters:t,onFilterChange:o,variants:a=[],currentVariantId:r,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:l,loading:s=false,appId:g,tableKey:f,currentLayout:u,currentLayoutId:h,layoutRefs:T,variantService:p,serviceUrl:v})=>{let{t:m}=j(),[y,x]=ct.useState(true),[k,F]=ct.useState(null),[S,w]=ct.useState(e.filter(D=>!D.hidden).map(D=>D.id)),A=(D,I)=>{o({...t,[D]:I});},R=D=>{S.includes(D)?w(S.filter(I=>I!==D)):w([...S,D]);};return jsxRuntime.jsxs(material.Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g?jsxRuntime.jsx(pp,{appId:g,tableKey:f,currentFilters:{values:t,visibleFields:S},currentLayout:u,currentLayoutId:h,layoutRefs:T,onLoad:D=>{if(!D.filters)return;let I=null;if(Array.isArray(D.filters)){let P=f||"default",M=D.filters.find(O=>O.scope===P);I=M?M.filters:null;}else I=D.filters;I&&(I.values||I.visibleFields?(I.visibleFields&&Array.isArray(I.visibleFields)&&w(I.visibleFields),I.values&&o(I.values)):o(I)),n&&n(D);},variantService:p,serviceUrl:v,currentVariantId:r}):jsxRuntime.jsx(ji,{variants:a,currentVariantId:r,onLoad:n,onSave:D=>{i&&i({...D,filters:{values:t,visibleFields:S}});},onDelete:c,onSetDefault:d}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:m("smartFilter.addFilters"),children:jsxRuntime.jsx(material.Button,{onClick:D=>F(D.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(Yy__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:rt,whiteSpace:"nowrap",minWidth:"fit-content"},children:m("smartFilter.adaptFilters")})}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:l,disabled:s,sx:{minWidth:"52px",fontWeight:"bold",fontSize:rt},children:m(s?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:k,open:!!k,onClose:()=>F(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:rt,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:m("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:rt}})}),jsxRuntime.jsx(material.Divider,{}),e.map(D=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>R(D.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:S.includes(D.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:D.label,primaryTypographyProps:{fontSize:rt}})]},D.id))]})]})]}),jsxRuntime.jsx(material.Collapse,{in:y,children:jsxRuntime.jsx(material.Box,{sx:{px:2,pb:2},children:jsxRuntime.jsx(material.Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(D=>S.includes(D.id)).map(D=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(rb,{field:D,value:t[D.id]||{value:"",operator:D.type==="number"?"=":"equals"},onChange:I=>A(D.id,I)})},D.id))})})}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>x(!y),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:20,height:20,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:y?jsxRuntime.jsx(Jy__default.default,{sx:{fontSize:16},color:"action"}):jsxRuntime.jsx(rh__default.default,{sx:{fontSize:16},color:"action"})})})]})};var Tp=({layouts:e,currentLayoutId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=j(),[c,d]=ct.useState(null),[l,s]=ct.useState(false),[g,f]=ct.useState(""),[u,h]=ct.useState(""),[T,p]=ct.useState({isDefault:false,isPublic:false}),v=e.find(S=>S.id===t),m=S=>{d(S.currentTarget);},y=()=>{d(null);},x=S=>{o(S),y();},k=()=>{f(""),h(""),p({isDefault:false,isPublic:false}),s(true),y();},F=()=>{g.trim()&&(a({name:g,description:u,...T}),s(false));};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:i("layout.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{onClick:k,color:"primary",size:"small",children:jsxRuntime.jsx(wp__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:m,color:v?"primary":"default",children:jsxRuntime.jsx(hb__default.default,{})})}),jsxRuntime.jsxs(material.Menu,{anchorEl:c,open:!!c,onClose:y,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"caption",children:i("layout.selectLayout")})}),jsxRuntime.jsxs(material.MenuItem,{onClick:k,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(wp__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i("layout.saveCurrentLayout")})]}),jsxRuntime.jsx(material.Divider,{}),e.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:i("layout.noSavedLayouts")})}),e.map((S,w)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>x(S),selected:S.id===t,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:S.id===t?"bold":"normal",noWrap:true,children:S.name})}),S.description&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:S.description})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center"},onClick:A=>A.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:S.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:A=>{A.stopPropagation(),n(S.id);},children:S.isDefault?jsxRuntime.jsx(Sy__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(fb__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:A=>{A.stopPropagation(),r(S.id);},children:jsxRuntime.jsx(Of__default.default,{fontSize:"small"})})})]})]})},S.id||w))]}),jsxRuntime.jsxs(material.Dialog,{open:l,onClose:()=>s(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:i("layout.saveLayout")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[jsxRuntime.jsx(material.TextField,{label:i("layout.layoutName"),value:g,onChange:S=>f(S.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(S=>S.name===g)&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"warning.main",sx:{ml:1},children:i("layout.warningOverwrite")}),jsxRuntime.jsx(material.TextField,{label:i("layout.layoutDescription"),value:u,onChange:S=>h(S.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:T.isDefault,onChange:S=>p({...T,isDefault:S.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:T.isPublic,onChange:S=>p({...T,isPublic:S.target.checked})}),label:i("layout.publicAllUsers")})]})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>s(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:F,variant:"contained",disabled:!g,children:i("common.save")})]})]})]})};var os=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:a,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:l}=j(),[s,g]=ct.useState([]),[f,u]=ct.useState(""),h=`orbcafe.layouts.${e}.${t}`,T=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}),v=ct.useCallback(()=>{try{let w=localStorage.getItem(h);if(!w)return [];let A=JSON.parse(w);return Array.isArray(A)?A:[]}catch{return []}},[h]),m=ct.useCallback(w=>{try{localStorage.setItem(h,JSON.stringify(w));}catch{}},[h]);ct.useEffect(()=>{n!==void 0&&u(n);},[n]),ct.useEffect(()=>{if(r&&s.length>0){let w=s.find(A=>A.id===r);w&&(u(w.id),a(w));}},[r,s,a]);let y=ct.useCallback(async()=>{if(e){if(!i){let w=v();g(w);let A=w.find(R=>R.isDefault);A&&!f&&!r&&(u(A.id),a(A));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 R=(await w.json()).map(T);g(R);let C=R.find(D=>D.isDefault);C&&!f&&!r&&(u(C.id),a(C));}catch(w){console.error("Error fetching layouts",w);let A=v();g(A);let R=A.find(C=>C.isDefault);R&&!f&&!r&&(u(R.id),a(R)),c&&c(l("layout.toast.loadFallback"));}}},[e,t,i,c,f,a,r,v,l]);return ct.useEffect(()=>{y();},[e,t]),jsxRuntime.jsx(Tp,{layouts:s,currentLayoutId:f,onLoad:w=>{u(w.id),a(w);},onSave:async w=>{let A=s.find(D=>D.name===w.name),R=A?A.id:Date.now().toString(),C={id:R,...w,createdAt:new Date().toISOString(),layoutData:o,isDefault:w.isDefault??false,isPublic:w.isPublic??false};if(!i){let I=s.some(P=>P.id===R)?s.map(P=>P.id===R?C:P):[...s,C];g(I),m(I),u(R),a(C),d&&d(l("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p(C))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(l("layout.toast.saveSuccess")),await y(),u(R),a(C);}catch(D){console.error("Error saving layout",D);let P=s.some(M=>M.id===R)?s.map(M=>M.id===R?C:M):[...s,C];g(P),m(P),u(R),a(C),d&&d(l("layout.toast.saveLocalSuccess")),c&&c(l("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async w=>{if(!i){let A=s.filter(R=>R.id!==w);g(A),m(A),f===w&&u(""),d&&d(l("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(l("layout.toast.deleteSuccess")),await y();}catch(A){console.error("Error deleting layout",A);let R=s.filter(C=>C.id!==w);g(R),m(R),f===w&&u(""),d&&d(l("layout.toast.deleteLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async w=>{if(!i){let A=s.map(R=>({...R,isDefault:R.id===w}));g(A),m(A),d&&d(l("layout.toast.defaultLocalSuccess"));return}try{let A=s.find(C=>C.id===w);if(!A)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p({...A,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(l("layout.toast.defaultSuccess")),await y();}catch(A){console.error("Error setting default",A);let R=s.map(C=>({...C,isDefault:C.id===w}));g(R),m(R),d&&d(l("layout.toast.defaultLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDefaultLocal"));}}})};var Pp=(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},as=(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 Rp(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function bb(e,t){return e==="desc"?(o,a)=>Rp(o,a,t):(o,a)=>-Rp(o,a,t)}function xb(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 Qr=e=>{let t=ct.useCallback(V=>{let K=String(V?.label??V?.id??"").length*9+64,be=typeof V?.minWidth=="number"?V.minWidth:0;return Math.max(100,be,K)},[]),o=ct.useCallback(()=>(e.columns||[]).filter(V=>!!V?.numeric).map(V=>V.id),[e.columns]),[a,r]=ct.useState(""),[n,i]=ct.useState(e.order||"asc"),[c,d]=ct.useState(e.orderBy||""),[l,s]=ct.useState(e.page||0),[g,f]=ct.useState(e.rowsPerPage||20),[u,h]=ct.useState(e.selected||[]),[T,p]=ct.useState(e.columns?e.columns.map(V=>V.id):[]),[v,m]=ct.useState(e.showSummary||false),[y,x]=ct.useState(()=>o()),[k,F]=ct.useState([]),[S,w]=ct.useState(new Set),[A,R]=ct.useState(()=>{let V={};return (e.columns||[]).forEach(W=>{V[W.id]=t(W);}),V}),[C,D]=ct.useState(null),[I,P]=ct.useState(null),[M,O]=ct.useState(null),[N,X]=ct.useState(null),[oe,te]=ct.useState(false),[re,Q]=ct.useState(""),[U,Y]=ct.useState("");ct.useEffect(()=>{e.layout&&Me(e.layout);},[e.layout]),ct.useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),ct.useEffect(()=>{e.selected!==void 0&&h(e.selected);},[e.selected]),ct.useEffect(()=>{e.page!==void 0&&s(e.page);},[e.page]),ct.useEffect(()=>{e.rowsPerPage!==void 0&&f(e.rowsPerPage);},[e.rowsPerPage]),ct.useEffect(()=>{let V=o();x(W=>W.filter(be=>V.includes(be)));},[o]),ct.useEffect(()=>{R(V=>{let W={...V};return (e.columns||[]).forEach(K=>{W[K.id]===void 0&&(W[K.id]=t(K));}),W});},[e.columns,t]);let Re=ct.useMemo(()=>{let V=e.rows||[];return a&&(V=V.filter(W=>Object.keys(W).some(K=>String(W[K]).toLowerCase().includes(a.toLowerCase())))),V},[e.rows,a]),Z=ct.useMemo(()=>e.onSortChange||!c?Re:xb(Re,bb(n,c)),[Re,n,c,e.onSortChange]),fe=ct.useCallback(V=>{if(k.length===0)return V.map(Be=>({type:"row",data:Be,id:Be[e.rowKey||"id"]}));let W=[...V].sort((Be,me)=>{for(let Le of k){if(Be[Le]<me[Le])return -1;if(Be[Le]>me[Le])return 1}return 0}),K=(Be,me=0)=>{if(me>=k.length)return Be;let Le=k[me],we={},ze=[];return Be.forEach(Ae=>{let ke=Ae[Le],De=`${Le}:${ke}`;we[De]||(we[De]={key:De,field:Le,value:ke,children:[],count:0,level:me},ze.push(we[De])),we[De].children.push(Ae),we[De].count++;}),ze.forEach(Ae=>{Ae.children&&(Ae.children=K(Ae.children,me+1));}),ze},be=K(W),Ce=(Be,me="")=>{let Le=[];return Be.forEach(we=>{if(we.children){let ze=me?`${me}>${we.key}`:we.key,Ae=S.has(ze);Le.push({type:"group",id:ze,field:we.field,value:we.value,level:we.level,count:we.count,isExpanded:Ae,childIds:(function ke(De){let Nt=[];return De.children.forEach(To=>{To.children?Nt=Nt.concat(ke(To)):Nt.push(To[e.rowKey||"id"]);}),Nt})(we)}),Ae&&(Le=Le.concat(Ce(we.children,ze)));}else Le.push({type:"row",data:we,id:we[e.rowKey||"id"],level:k.length});}),Le};return Ce(be)},[k,S,e.rowKey]),Se=ct.useCallback(V=>{if(k.length===0)return [];let W=[...V].sort((Ce,Be)=>{for(let me of k){if(Ce[me]<Be[me])return -1;if(Ce[me]>Be[me])return 1}return 0}),K=[],be=(Ce,Be,me)=>{if(Be>=k.length)return;let Le=k[Be],we=new Map;Ce.forEach(ze=>{let Ae=ze[Le],ke=we.get(Ae);ke?ke.push(ze):we.set(Ae,[ze]);}),we.forEach((ze,Ae)=>{let ke=`${Le}:${Ae}`,De=me?`${me}>${ke}`:ke;K.push(De),be(ze,Be+1,De);});};return be(W,0,""),K},[k]),Ne=ct.useMemo(()=>fe(Z),[Z,fe]),Ke=ct.useMemo(()=>Se(Z),[Z,Se]),ve=ct.useMemo(()=>{let V=(e.rows||[]).length;return typeof e.count=="number"&&e.count>V},[e.count,e.rows]),Fe=ct.useMemo(()=>ve?Ne:g>0?Ne.slice(l*g,l*g+g):Ne,[Ne,l,g,ve]),xo=ct.useMemo(()=>ve&&typeof e.count=="number"?e.count:Ne.length,[Ne.length,ve,e.count]),Zt=V=>{w(W=>{let K=new Set(W);return K.has(V)?K.delete(V):K.add(V),K});},Qe=V=>{let W=Ke.filter(K=>K===V||K.startsWith(`${V}>`));w(K=>{let be=new Set(K);return W.forEach(Ce=>be.add(Ce)),be});},Mt=V=>{w(W=>{let K=new Set(W);return Array.from(K).forEach(be=>{(be===V||be.startsWith(`${V}>`))&&K.delete(be);}),K});},Lt=V=>{if(!V){w(new Set);return}w(new Set(Ke));},bt=V=>{let W=Ke.filter(K=>K.startsWith(`${V}>`));return W.length===0?S.has(V):S.has(V)&&W.every(K=>S.has(K))},H=V=>{let W=c===V&&n==="asc",K=c===V&&n==="desc";if(e.onSortChange){W?e.onSortChange(V,"desc"):K?e.onSortChange("","asc"):e.onSortChange(V,"asc");return}W?(i("desc"),d(V)):K?(i("asc"),d("")):(i("asc"),d(V));},he=(V,W)=>{R(K=>({...K,[V]:W}));},pe=V=>{if(V.target.checked){let W=Re.map(K=>K[e.rowKey||"id"]);h(W),e.onSelectionChange&&e.onSelectionChange(W);return}h([]),e.onSelectionChange&&e.onSelectionChange([]);},ye=(V,W)=>{let K=W[e.rowKey||"id"],be=u.indexOf(K),Ce=[];be===-1?Ce=Ce.concat(u,K):be===0?Ce=Ce.concat(u.slice(1)):be===u.length-1?Ce=Ce.concat(u.slice(0,-1)):be>0&&(Ce=Ce.concat(u.slice(0,be),u.slice(be+1))),h(Ce),e.onSelectionChange&&e.onSelectionChange(Ce);},Xe=V=>{s(V),e.onPageChange&&e.onPageChange(V);},Ve=V=>{f(V),s(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(V);},co=V=>{let W=T.indexOf(V),K=[...T];W===-1?K.push(V):K.splice(W,1),p(K);},vo=V=>{let W=k.indexOf(V),K=[...k];W===-1?K.push(V):K.splice(W,1),F(K);},Co=V=>{o().includes(V)&&x(K=>K.includes(V)?K.filter(be=>be!==V):[...K,V]);},ko=V=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:T,order:n,orderBy:c,grouping:k,columnWidths:A,showSummary:v,summaryColumns:y});},So=V=>{let{layout:W,layoutId:K}=as(V,e.tableKey||"default");K?(Y(K),Q(K)):(Y(""),Q("")),W&&(W.visibleColumns&&p(W.visibleColumns),W.order&&i(W.order),W.orderBy&&d(W.orderBy),W.grouping&&F(W.grouping),W.columnWidths&&R(W.columnWidths),W.showSummary!==void 0&&m(!!W.showSummary),Array.isArray(W.summaryColumns)&&x(W.summaryColumns));},Me=V=>{let W=V?.layoutData||V?.layout||V||{};W.visibleColumns&&p(W.visibleColumns),W.order&&i(W.order),W.orderBy!==void 0&&d(W.orderBy),W.grouping&&F(W.grouping),W.columnWidths&&R(W.columnWidths),W.showSummary!==void 0&&m(!!W.showSummary),Array.isArray(W.summaryColumns)&&x(W.summaryColumns),w(new Set),s(0),V?.id&&Q(V.id),Y("");};ct.useEffect(()=>{e.layout&&So({layout:e.layout});},[e.layout]);let ge=V=>{V.preventDefault(),X(N===null?{mouseX:V.clientX+2,mouseY:V.clientY-6}:null);},xt=()=>{X(null);},Ee=ct.useMemo(()=>{if(!v)return {};let V={};e.columns.forEach(K=>{if(K.numeric&&y.includes(K.id)){let be=Re.reduce((Ce,Be)=>{let me=parseFloat(Be[K.id]);return Ce+(isNaN(me)?0:me)},0);V[K.id]=be.toFixed(2);}else V[K.id]="";});let W=e.columns.find(K=>T.includes(K.id));return W&&!W.numeric&&(V[W.id]="Total"),V},[Re,e.columns,v,y,T]),zt=()=>{if(!e.columns||!Re)return;let V=e.columns.map(Be=>Be.label).join(","),W=Re.map(Be=>e.columns.map(me=>{let Le=Be[me.id];return `"${(Le==null?"":String(Le)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
184
|
+
`),K=`data:text/csv;charset=utf-8,${V}
|
|
185
|
+
${W}`,be=encodeURI(K),Ce=document.createElement("a");Ce.setAttribute("href",be),Ce.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce);},wo=()=>{te(true);},_a=()=>{te(false);};return {isMobile:false,columns:e.columns,order:n,orderBy:c,filterText:a,setFilterText:r,visibleColumns:T,setVisibleColumns:p,showSummary:v,setShowSummary:m,summaryColumns:y,grouping:k,setGrouping:F,expandedGroups:S,setExpandedGroups:w,groupAnchorEl:I,setGroupAnchorEl:P,summaryAnchorEl:M,setSummaryAnchorEl:O,columnWidths:A,setColumnWidths:R,anchorEl:C,setAnchorEl:D,contextMenu:N,setContextMenu:X,sensors:void 0,sortedAndFilteredRows:Z,visibleRows:Fe,summaryRow:Ee,page:l,setPage:Xe,rowsPerPage:g,setRowsPerPage:Ve,totalDisplayCount:xo,selected:u,setSelected:h,isAllExpanded:Ke.length>0&&Ke.every(V=>S.has(V)),handleColumnResize:he,handleRequestSort:H,handleSelectAllClick:pe,handleClick:ye,toggleSummaryColumn:Co,handleDragEnd:()=>{},handleExport:zt,handleContextMenu:ge,handleCloseContextMenu:xt,toggleColumnVisibility:co,toggleGroupExpand:Zt,toggleGroupField:vo,handleToggleAll:Lt,handleExpandGroupRecursively:Qe,handleCollapseGroupRecursively:Mt,isGroupFullyExpanded:bt,handleLayoutLoad:Me,handleVariantLoad:So,handleLayoutSave:ko,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:T,order:n,orderBy:c,grouping:k,columnWidths:A,showSummary:v,summaryColumns:y},currentLayoutId:re,layoutIdToLoad:U,onPageChange:Xe,onRowsPerPageChange:Ve,graphReportOpen:oe,handleOpenGraphReport:wo,handleCloseGraphReport:_a}};var OD=e=>jsxRuntime.jsx(kb__default.default,{...e}),WD=e=>jsxRuntime.jsx(kl__default.default,{...e}),$D=e=>jsxRuntime.jsx(Lp__default.default,{...e}),HD=e=>jsxRuntime.jsx(Kf__default.default,{...e}),GD=e=>jsxRuntime.jsx(qf__default.default,{...e}),Fa=e=>{let{t}=j(),o="0.85rem",{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:T,filterConfig:p,rowKey:v,tableKey:m="default",graphReport:y,quickCreate:x,quickEdit:k,quickDelete:F,serviceUrl:S}=e,w=a||t("table.title.default"),{isMobile:A,columns:R,order:C,orderBy:D,filterText:I,setFilterText:P,visibleColumns:M,showSummary:O,setShowSummary:N,summaryColumns:X,grouping:oe,setGrouping:te,expandedGroups:re,groupAnchorEl:Q,setGroupAnchorEl:U,summaryAnchorEl:Y,setSummaryAnchorEl:Re,columnWidths:Z,anchorEl:fe,setAnchorEl:Se,contextMenu:Ne,sensors:Ke,sortedAndFilteredRows:ve,summaryRow:Fe,visibleRows:xo,isAllExpanded:Zt,page:Qe,setPage:Mt,rowsPerPage:Lt,setRowsPerPage:bt,totalDisplayCount:H,setSelected:he,handleColumnResize:pe,handleRequestSort:ye,handleSelectAllClick:Xe,handleClick:Ve,toggleSummaryColumn:co,handleDragEnd:vo,handleExport:Co,handleContextMenu:ko,handleCloseContextMenu:So,toggleColumnVisibility:Me,toggleGroupExpand:ge,toggleGroupField:xt,handleToggleAll:Ee,handleExpandGroupRecursively:zt,handleCollapseGroupRecursively:wo,isGroupFullyExpanded:_a,handleLayoutLoad:V,handleVariantLoad:W,handleLayoutSave:K,effectiveAppId:be,currentLayoutData:Ce,currentLayoutId:Be,layoutIdToLoad:me,graphReportOpen:Le,handleOpenGraphReport:we,handleCloseGraphReport:ze}=Qr(e),Ae=y?.enabled??false,ke=Ae&&(y?.interaction?.enabled??true),De=qi(),Nt=!!x?.enabled,To=!!k?.enabled,gt=!!F?.enabled,vt=x?.fields,po=x?.excludeFields||[],va=x?.initialValues||{},[Pr,Io]=ct__namespace.default.useState(false),[Xt,ja]=ct__namespace.default.useState(false),[Qo,Vt]=ct__namespace.default.useState({}),[Qt,At]=ct__namespace.default.useState(false),[Oe,Yo]=ct__namespace.default.useState(false),[Wo,Jo]=ct__namespace.default.useState({}),[Za,$o]=ct__namespace.default.useState(false),[Xa,Qa]=ct__namespace.default.useState(false),Ho=u||Xt||Oe||Xa,ea=ct__namespace.default.useMemo(()=>{let L=[...R];if(Array.isArray(vt)&&vt.length>0){let _=new Set(vt);L=L.filter(q=>_.has(q.id));}if(po.length>0){let _=new Set(po);L=L.filter(q=>!_.has(q.id));}return L.filter(_=>!!_?.id)},[R,po,vt]),Ca=v||"id",Ot=ct__namespace.default.useMemo(()=>{let L=new Set(i);return ve.filter(_=>L.has(_?.[Ca]))},[i,ve,Ca]),Po=Ot.length===1?Ot[0]:null,ta=k?.fields,uo=k?.excludeFields||[],Go=k?.editableFields||[],Ya=k?.nonEditableFields||[],Rr=k?.primaryKeys?.length?k.primaryKeys:[Ca],ka=ct__namespace.default.useMemo(()=>{let L=[...R];if(Array.isArray(ta)&&ta.length>0){let _=new Set(ta);L=L.filter(q=>_.has(q.id));}if(uo.length>0){let _=new Set(uo);L=L.filter(q=>!_.has(q.id));}return L.filter(_=>!!_?.id)},[R,uo,ta]),Ja=ct__namespace.default.useMemo(()=>new Set(Rr),[Rr]),oa=ct__namespace.default.useMemo(()=>new Set(Go),[Go]),Ut=ct__namespace.default.useMemo(()=>new Set(Ya),[Ya]),Ro=ct__namespace.default.useCallback(L=>oa.size>0?oa.has(L):!(Ut.has(L)||Ja.has(L)),[oa,Ut,Ja]);ct__namespace.default.useEffect(()=>{!Le&&De.hasActiveFilters&&De.clearAll();},[Le,De.hasActiveFilters,De.clearAll]);let Dr=()=>{let L={};ea.forEach(_=>{L[_.id]=va[_.id]??"";}),Vt(L),Io(true);},er=()=>{Xt||Io(false);},Mr=(L,_)=>{Vt(q=>({...q,[L]:_}));},Ar=async()=>{if(!x?.onSubmit){Io(false);return}try{ja(!0),await x.onSubmit(Qo),Io(!1);}finally{ja(false);}},Br=()=>{if(!Po)return;let L={};ka.forEach(q=>{L[q.id]=Po[q.id]??"";});let _=k?.getInitialValues?{...L,...k.getInitialValues(Po)}:L;Jo(_),At(true);},Yt=()=>{Oe||At(false);},Fr=(L,_)=>{Jo(q=>({...q,[L]:_}));},Er=async()=>{if(Po){if(!k?.onSubmit){At(false);return}try{Yo(!0),await k.onSubmit(Wo,Po),At(!1);}finally{Yo(false);}}},tr=()=>{Ot.length!==0&&$o(true);},aa=()=>{Xa||$o(false);},Sa=async()=>{if(Ot.length===0){$o(false);return}if(!F?.onConfirm){$o(false),he([]),c?.([]);return}try{Qa(!0),await F.onConfirm(Ot),$o(!1),he([]),c?.([]);}finally{Qa(false);}},wa=ve,{fieldMapping:b}=_r({rows:wa,config:{...y,title:y?.title||`${w} ${t("graph.reportTitle")}`}}),B=ct__namespace.default.useMemo(()=>ke?De.applyRows(wa,b):wa,[ke,De.applyRows,wa,b]),{model:E}=_r({rows:B,config:{...y,title:y?.title||`${w} ${t("graph.reportTitle")}`,fieldMapping:b}}),$=E.table.columns.map(L=>({id:L.id,label:L.label,align:L.align||"left",minWidth:120,numeric:L.align==="right"})),ee=be?jsxRuntime.jsx(os,{appId:be,tableKey:m,currentLayoutData:Ce,onLayoutLoad:V,targetLayoutId:me,activeLayoutId:Be,serviceUrl:S??p?.serviceUrl}):null,ue=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(zr,{groupAnchorEl:Q,setGroupAnchorEl:U,grouping:oe,setGrouping:te,columns:R,toggleGroupField:xt}),jsxRuntime.jsx(Nr,{anchorEl:fe,setAnchorEl:Se,columns:R,visibleColumns:M,toggleColumnVisibility:Me}),jsxRuntime.jsx(Pi,{anchorEl:Y,setAnchorEl:Re,showSummary:O,setShowSummary:N,columns:R,summaryColumns:X,toggleSummaryColumn:co}),jsxRuntime.jsx(Ri,{contextMenu:Ne,handleCloseContextMenu:So,columns:R,visibleColumns:M,toggleColumnVisibility:Me})]});return A?jsxRuntime.jsxs(Gn__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[p&&jsxRuntime.jsx(cr,{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:Ce}],variantService:p.variantService,serviceUrl:S??p.serviceUrl}),jsxRuntime.jsx(Ad,{title:w,loading:u,showSummary:O,setShowSummary:N,setAnchorEl:Se,setSummaryAnchorEl:Re,filterText:I,setFilterText:P,sortedAndFilteredRows:ve,selected:i,columns:R,visibleColumns:M,summaryRow:Fe,handleClick:Ve,selectionMode:n}),ue]}):jsxRuntime.jsxs(Gn__default.default,{sx:{width:g?"100%":"auto",mb:s?0:2,...s?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p&&jsxRuntime.jsx(Gn__default.default,{sx:{mb:2},children:jsxRuntime.jsx(cr,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:L=>{W(L),p.onVariantLoad&&p.onVariantLoad(L);},onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,loading:u,appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:Ce}],currentLayoutId:Be,layoutRefs:[{tableKey:m,layoutId:Be}],variantService:p.variantService,serviceUrl:S??p.serviceUrl})}),jsxRuntime.jsxs(vb__default.default,{sx:{width:g?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Ho?{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}:s?{flex:1,minHeight:0,height:"100%"}:{}},children:[r&&jsxRuntime.jsx(ki,{filterText:I,setFilterText:P,onRowsPerPageChange:bt,rowsPerPage:Lt,rowsPerPageOptions:h,page:Qe,count:H,onPageChange:Mt,actions:d,extraTools:l,grouping:oe,setGroupAnchorEl:U,showSummary:O,setShowSummary:N,setAnchorEl:Se,setSummaryAnchorEl:Re,handleExport:Co,showCreateButton:Nt,onOpenCreateDialog:Dr,showEditButton:To,onOpenEditDialog:Br,editDisabled:Ot.length!==1,showDeleteButton:gt,onOpenDeleteConfirm:tr,deleteDisabled:Ot.length===0,onLayoutSave:T||p?.variantService&&p?.appId?K:void 0,loading:u,layoutManager:ee,onOpenGraphReport:Ae?we:void 0}),jsxRuntime.jsx(Lp__default.default,{sx:{flex:1,...f?{maxHeight:f,height:f}:s?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:jsxRuntime.jsx(core.DndContext,{sensors:Ke,collisionDetection:core.closestCenter,onDragEnd:vo,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(Cb__default.default,{sx:{minWidth:g?750:"auto",width:g?"100%":"auto",tableLayout:Object.keys(Z).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsxRuntime.jsx(Si,{columns:R,visibleColumns:M,order:C,orderBy:D,onRequestSort:ye,onContextMenu:ko,selectionMode:n,grouping:oe,isAllExpanded:Zt,handleToggleAll:Ee,rowCount:ve.length,numSelected:i.length,onSelectAllClick:Xe,columnWidths:Z,onColumnResize:pe}),jsxRuntime.jsx(Rd,{visibleRows:xo,columns:R,visibleColumns:M,selectionMode:n,selected:i,orderBy:D,loading:u,expandedGroups:re,toggleGroupExpand:ge,handleExpandGroupRecursively:zt,handleCollapseGroupRecursively:wo,isGroupFullyExpanded:_a,handleClick:Ve,onSelectionChange:c,grouping:oe,rowKeyProp:v,page:Qe,rowsPerPage:Lt}),O&&jsxRuntime.jsx(Dd,{showSummary:O,columns:R,visibleColumns:M,summaryRow:Fe,selectionMode:n?.toString(),grouping:oe,orderBy:D,zIndex:3})]})})})]}),Nt&&jsxRuntime.jsxs(Dp__default.default,{open:Pr,onClose:er,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:L=>`1px solid ${L.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Mp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:x?.title||t("quickCreate.createWithTitle",{title:w})}),jsxRuntime.jsx(Ap__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Gn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ea.map(L=>{let _=L.type==="number"||L.numeric?"number":L.type==="date"?"date":"text",q=L.label||L.id;return jsxRuntime.jsx(Fp__default.default,{label:q,value:Qo[L.id]??"",onChange:_e=>Mr(L.id,_e.target.value),type:_,size:"small",fullWidth:true,InputLabelProps:{shrink:_==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${L.id}`)}),x?.description&&jsxRuntime.jsx(Ep__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:x.description})]})}),jsxRuntime.jsxs(Bp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(ns__default.default,{onClick:er,sx:{fontSize:"0.85rem"},disabled:Xt,children:x?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(ns__default.default,{onClick:Ar,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Xt,children:x?.submitLabel||t("common.save")})]})]}),To&&jsxRuntime.jsxs(Dp__default.default,{open:Qt,onClose:Yt,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:L=>`1px solid ${L.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(Mp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||t("quickEdit.editWithTitle",{title:w})}),jsxRuntime.jsx(Ap__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Gn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ka.map(L=>{let _=L.type==="number"||L.numeric?"number":L.type==="date"?"date":"text",q=L.label||L.id,_e=Ro(L.id);return jsxRuntime.jsx(Fp__default.default,{label:q,value:Wo[L.id]??"",onChange:z=>Fr(L.id,z.target.value),type:_,size:"small",fullWidth:true,disabled:!_e,InputLabelProps:{shrink:_==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${L.id}`)}),k?.description&&jsxRuntime.jsx(Ep__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:k.description})]})}),jsxRuntime.jsxs(Bp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(ns__default.default,{onClick:Yt,sx:{fontSize:"0.85rem"},disabled:Oe,children:k?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(ns__default.default,{onClick:Er,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Oe||!Po,children:k?.submitLabel||t("common.save")})]})]}),gt&&jsxRuntime.jsx(Pn,{open:Za,type:"warning",title:F?.title||t("quickDelete.confirmTitle"),message:F?.message||(Ot.length>1?t("quickDelete.confirmMessageMultiple",{count:Ot.length}):t("quickDelete.confirmMessageSingle")),confirmText:F?.confirmText||t("common.delete"),cancelText:F?.cancelText||t("common.cancel"),onClose:aa,onConfirm:Sa}),ue,Ae&&jsxRuntime.jsx(Ui,{open:Le,onClose:ze,model:E,aiAssistant:y?.aiAssistant,interaction:ke?{enabled:true,filters:De.filters,fieldMapping:b,onPrimaryDimensionClick:L=>De.setFilter("primaryDimension",L),onSecondaryDimensionClick:L=>De.setFilter("secondaryDimension",L),onStatusClick:L=>De.setFilter("status",L),onClearFilter:De.clearFilter,onClearAll:De.clearAll}:void 0,tableContent:jsxRuntime.jsx(Fa,{appId:be||"graph-report-internal",title:t("graph.dataBody"),columns:$,rows:E.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},UD=Fa;var QD=({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,l={...r,appId:r.appId||e};return jsxRuntime.jsxs(kd,{title:t,hideHeader:o,children:[jsxRuntime.jsxs(material.Stack,{spacing:i,sx:{height:"100%",overflow:"hidden"},children:[c==="separated"&&d&&jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx(cr,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(Fa,{...l,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var a2=({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}=j(),[l,s]=ct.useState(false),[g,f]=ct.useState([]),[u,h]=ct.useState({}),[T,p]=ct.useState(e.variants||[]),[v,m]=ct.useState(e.layout||null),[y,x]=ct.useState(""),[k,F]=ct.useState(0),[S,w]=ct.useState(0),[A,R]=ct.useState(o),[C,D]=ct.useState([]),[I,P]=ct.useState("asc"),[M,O]=ct.useState("");ct.useEffect(()=>{let Z={};e.filters.forEach(fe=>{fe.defaultValue!==void 0&&(Z[fe.id]=fe.defaultValue);}),h(Z);},[e.filters]);let N=ct.useCallback(async(Z,fe,Se,Ne,Ke)=>{s(true);try{let ve={...Z,page:fe+1,limit:Se,sort:Ke,order:Ne},Fe;t?Fe=await t(ve):typeof e.api=="function"?Fe=await e.api(ve):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,ve),Fe={rows:[],total:0}):(console.warn("No API configured for report"),Fe={rows:[],total:0}),Fe&&(f(Fe.rows||[]),F(Fe.total||0));}catch(ve){console.error("Failed to fetch report data",ve);}finally{s(false);}},[e.api,t]);ct.useEffect(()=>{N(u,S,A,I,M);},[N,S,A,I,M]);let X=()=>{w(0),N(u,0,A,I,M);},oe=Z=>{w(0),R(Z);},te=(Z,fe)=>{P(fe),O(Z);},re=Z=>{h(Z);},Q=Z=>{x(Z?.id||"");let fe=Pp(Z,r);if(fe){let Ne=fe.values??fe;h(Ne),N(Ne,0,A,I,M),w(0);}let{layout:Se}=as(Z,r);Se&&m(Se);},U=Z=>{let fe={...Z,id:Date.now().toString(),createdAt:new Date().toISOString()};p(Se=>[...Se,fe]);},Y=Z=>{m(Z);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:u,onFilterChange:re,onSearch:X,onVariantLoad:Q,onVariantSave:U,onVariantDelete:Z=>p(fe=>fe.filter(Se=>Se.id!==Z)),onVariantSetDefault:Z=>{p(fe=>fe.map(Se=>({...Se,isDefault:Se.id===Z})));},variants:T,currentVariantId:y,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:g,loading:l,rowKey:"id",count:k,page:S,rowsPerPage:A,rowsPerPageOptions:a,onPageChange:w,onRowsPerPageChange:oe,selectionMode:"multiple",selected:C,onSelectionChange:D,onLayoutSave:Y,layout:v,title:e.title,showSummary:true,order:I,orderBy:M,serviceUrl:i,onSortChange:te,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:u,rows:g,loading:l,refresh:X}};var Bb=e=>[...e].sort((t,o)=>o.value-t.value),i2=({bars:e=[],lines:t=[],combos:o=[],heatmap:a=[],pies:r=[],waterfalls:n=[]})=>{let i=ct.useMemo(()=>Bb(e),[e]),c=ct.useMemo(()=>[...t],[t]),d=ct.useMemo(()=>[...o],[o]),l=ct.useMemo(()=>[...a],[a]),s=ct.useMemo(()=>{let f=r.reduce((u,h)=>u+h.value,0);return r.map(u=>({...u,percent:f>0?u.value/f*100:u.percent}))},[r]),g=ct.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:l,pies:s,waterfalls:g}};var p2=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>ct.useMemo(()=>!e||!t?"":Ln({apiKey:e,query:t,zoom:o,mapType:a}),[e,t,o,a]),u2=({keyword:e,location:t})=>ct.useMemo(()=>Oi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var Un=({code:e,language:t="text",copyable:o=true,showLineNumbers:a=false,wrapLongLines:r=false,maxHeight:n})=>{let[i,c]=ct.useState(false),d=ct.useMemo(()=>e.replace(/\n$/,"").split(`
|
|
186
|
+
`),[e]);return jsxRuntime.jsxs(material.Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",bgcolor:"background.paper"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.6,bgcolor:"action.hover",borderBottom:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.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&&jsxRuntime.jsx(material.Tooltip,{title:i?"Copied":"Copy",children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:async()=>{try{await navigator.clipboard.writeText(e),c(!0),window.setTimeout(()=>c(!1),1400);}catch{c(false);}},children:i?jsxRuntime.jsx(Ob__default.default,{fontSize:"inherit"}):jsxRuntime.jsx(Vb__default.default,{fontSize:"inherit"})})})]}),jsxRuntime.jsx(material.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((s,g)=>jsxRuntime.jsxs(material.Box,{sx:{display:"flex"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{width:34,flexShrink:0,textAlign:"right",pr:1,color:"text.disabled",userSelect:"none"},children:g+1}),jsxRuntime.jsx(material.Box,{component:"span",sx:{whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:s})]},`${g}-${s}`)):jsxRuntime.jsx(material.Box,{component:"code",sx:{display:"block",whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:e})})]})};var Ub=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},Kb=async e=>new Function("m","return import(m)")(e),Kn=({expression:e,inline:t=false,allowKatex:o=false})=>{let a=ct.useMemo(()=>Ub(e),[e]),[r,n]=ct.useState("");return ct.useEffect(()=>{let i=true;return (async()=>{if(!o||!a){n("");return}try{let d=await Kb("katex"),s=(d?.default||d)?.renderToString?.(a,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof s=="string"&&n(s);}catch{i&&n("");}})(),()=>{i=false;}},[o,a,t]),a?r?jsxRuntime.jsx(material.Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:r}}):t?jsxRuntime.jsx(material.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}):jsxRuntime.jsx(material.Box,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:jsxRuntime.jsx(material.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 Yb=async e=>new Function("m","return import(m)")(e),Xl=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:a=true})=>{let[r,n]=ct.useState(""),[i,c]=ct.useState(""),[d,l]=ct.useState(false),s=ct.useMemo(()=>e.trim(),[e]);return ct.useEffect(()=>{let g=true;return (async()=>{if(!a||!s){n(""),c("");return}l(true),c(""),n("");try{let u=await Yb("mermaid"),h=u?.default||u;if(!h||typeof h.render!="function")throw new Error("Mermaid runtime is not available");h.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let T=await h.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,s),p=typeof T=="string"?T:T?.svg;g&&typeof p=="string"&&n(p);}catch(u){if(g){let h=u instanceof Error?u.message:"Failed to render Mermaid diagram";c(h);}}finally{g&&l(false);}})(),()=>{g=false;}},[a,s]),jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[jsxRuntime.jsx(material.Box,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:t})}),jsxRuntime.jsxs(material.Box,{sx:{p:1},children:[d&&jsxRuntime.jsx(material.Box,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.CircularProgress,{size:20})}),!d&&r&&jsxRuntime.jsx(material.Box,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:r}}),!d&&!r&&jsxRuntime.jsxs(material.Box,{children:[i&&jsxRuntime.jsx(material.Alert,{severity:"info",sx:{mb:1},children:i}),jsxRuntime.jsx(Un,{code:s,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var Ql=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),ix=e=>/^:?-{3,}:?$/.test(e.trim()),sx=e=>{let t=e.trim(),o=t.startsWith(":"),a=t.endsWith(":");return o&&a?"center":a?"right":"left"},ls=e=>{let t=e.split(`
|
|
187
|
+
`).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=Ql(t[0]),a=Ql(t[1]);if(o.length===0||a.length!==o.length||!a.every(ix))return null;let r=a.map(sx),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let c=Ql(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}},Yl=({markdown:e,table:t,maxHeight:o=360})=>{let a=ct.useMemo(()=>t||(e?ls(e):null),[t,e]);return !a||a.headers.length===0?jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:o},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:a.headers.map((r,n)=>jsxRuntime.jsx(material.TableCell,{align:a.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:r},`${r}-${n}`))})}),jsxRuntime.jsx(material.TableBody,{children:a.rows.map((r,n)=>jsxRuntime.jsx(material.TableRow,{hover:true,children:r.map((i,c)=>jsxRuntime.jsx(material.TableCell,{align:a.aligns[c],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i||jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${n}-${c}`))},`row-${n}`))})]})})})};var ds=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:a=false})=>{let[r,n]=ct.useState(o);return jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.6,children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(i=>!i),sx:{transform:r?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsxRuntime.jsx(gx__default.default,{fontSize:"inherit"})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,a?" ...":""]})]}),jsxRuntime.jsx(material.Collapse,{in:r,children:jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:e})})]})};var ec=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,ps=e=>e.trim().startsWith("```"),Kp=e=>/^#{1,6}\s+/.test(e.trim()),tc=e=>/^[-*+]\s+/.test(e.trim()),oc=e=>/^\d+\.\s+/.test(e.trim()),qp=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),ac=e=>e.trim().startsWith(">"),_p=(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())},jp=e=>e.trim().startsWith("<think>")||e.trim()===":::think",jn=(e,t,o)=>{let a=[],r=0,n=0;ec.lastIndex=0;let i=ec.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(jsxRuntime.jsx("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))a.push(jsxRuntime.jsx("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))a.push(jsxRuntime.jsx(material.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 l=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/);l?a.push(jsxRuntime.jsx(material.Link,{href:l[2],target:"_blank",rel:"noreferrer",underline:"hover",children:l[1]},d)):a.push(c);}else c.startsWith("$")&&c.endsWith("$")&&t.enableMath?a.push(jsxRuntime.jsx(Kn,{expression:c,inline:true,allowKatex:true},d)):a.push(c);r=i.index+c.length,n+=1,i=ec.exec(e);}return r<e.length&&a.push(e.slice(r)),a.length>0?a:[e]},Zn=({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??"",l=ct.useMemo(()=>{let s=[],g=d.replace(/\r\n/g,`
|
|
188
188
|
`).split(`
|
|
189
|
-
`),f={enableMath:a},u=0;for(;u<
|
|
190
|
-
`).trim()},`think-tag-${u}`));continue}u+=1;let
|
|
191
|
-
`).trim()},`think-fence-${u}`));continue}if(
|
|
192
|
-
`);if(r&&
|
|
193
|
-
`).trim(),allowKatex:true},`math-${u}`));continue}if(
|
|
194
|
-
`),b=Hi(g);if(b){l.push(jsxRuntime.jsx(Ml,{table:b},`table-${u}`)),u=C;continue}}if(Ll(h)){let C=[];for(;u<m.length&&Ll(m[u]);)C.push(m[u].replace(/^\s*>\s?/,"")),u+=1;l.push(jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:C.map((g,b)=>jsxRuntime.jsxs(st.Fragment,{children:[b>0&&jsxRuntime.jsx("br",{}),Rn(g,f,`q-${u}-${b}`)]},`quote-line-${b}`))})},`quote-${u}`));continue}if(Fl(h)){let C=[];for(;u<m.length&&Fl(m[u]);)C.push(m[u].trim().replace(/^[-*+]\s+/,"")),u+=1;l.push(jsxRuntime.jsx(material.Box,{component:"ul",sx:{my:.8,pl:2.5},children:C.map((g,b)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:Rn(g,f,`ul-${u}-${b}`)})},`ul-item-${b}`))},`ul-${u}`));continue}if(El(h)){let C=[];for(;u<m.length&&El(m[u]);)C.push(m[u].trim().replace(/^\d+\.\s+/,"")),u+=1;l.push(jsxRuntime.jsx(material.Box,{component:"ol",sx:{my:.8,pl:2.7},children:C.map((g,b)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:Rn(g,f,`ol-${u}-${b}`)})},`ol-item-${b}`))},`ol-${u}`));continue}let p=[];for(;u<m.length;){let C=m[u],g=C.trim();if(!g||Ki(C)||yp(C)||bp(C)||Fl(C)||El(C)||Ll(C)||xp(m,u)||n&&vp(C)||a&&g.startsWith("$$"))break;p.push(C),u+=1;}p.length>0?l.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:p.map((C,g)=>jsxRuntime.jsxs(st.Fragment,{children:[g>0&&jsxRuntime.jsx("br",{}),Rn(C,f,`p-${u}-${g}`)]},`p-line-${g}`))},`p-${u}`)):u+=1;}return l},[d,a,r,n,i,c]);return jsxRuntime.jsx(material.Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:s})};var lD=(e,t)=>jsxRuntime.jsx(Dn,{markdown:e,...t});var Sp=({value:e,onChange:t,onSubmit:o,onVoiceInput:a,onClear:r,placeholder:n,statusText:i,loading:c=false,compact:d=false,showStatusText:s=true})=>jsxRuntime.jsxs(material.Stack,{spacing:.75,children:[jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(Hd__default.default,{sx:{fontSize:d?16:18,color:"text.secondary"}}),jsxRuntime.jsx(material.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&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:r,children:jsxRuntime.jsx(th__default.default,{sx:{fontSize:d?16:18}})}),a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,children:jsxRuntime.jsx(ch__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(ph__default.default,{sx:{fontSize:d?16:18}})})]}),s&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var wp=(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:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.slice(0,n),jsxRuntime.jsx(material.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)]})},qi=({section:e,highlightQuery:t=""})=>{let o=e.columns||2;return jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsxRuntime.jsx(material.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 jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:wp(a.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?wp(r,t):a.value})]},a.id)})})]})};var Wl=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",Zi=e=>e.trim().toLowerCase(),$b=(e,t)=>{let o=[];return e.forEach(a=>{a.fields.forEach(r=>{let n=r.searchableText||Wl(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:Zi(`${a.title} ${r.label} ${n}`)});});}),t.forEach(a=>{(a.fields||[]).forEach(r=>{let n=r.searchableText||Wl(r.value),i={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:Zi(`${a.label} ${r.label} ${n}`)});}),(a.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||Wl(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:Zi(`${a.label} ${r.title} ${n.label} ${i}`)});});});}),o},Ip=({sections:e,tabs:t=[],defaultTabId:o,ai:a})=>{let{t:r}=_(),[n,i]=st.useState(""),[c,d]=st.useState(o||t[0]?.id),[s,l]=st.useState("idle"),[m,f]=st.useState([]),[u,h]=st.useState(""),[I,p]=st.useState(""),[C,g]=st.useState(false),b=st.useMemo(()=>$b(e,t),[e,t]);st.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(M=>M.id===c)||d(o||t[0]?.id);},[t,c,o]);let x=st.useCallback(()=>{l("idle"),f([]),h(""),p("");},[]),k=st.useCallback(S=>{i(S),S.trim()||(l("idle"),f([]),h(""),p(""));},[]),E=st.useCallback(S=>{let M=Zi(S);return M?b.filter(T=>T.text.includes(M)).map(T=>T.hit):[]},[b]),P=st.useCallback(async()=>{let S=n.trim();if(!S)return;g(true);let M=E(S);if(f(M),M.length>0){l("search"),p(""),h(r("detail.searchAi.matches",{count:M.length})),g(false);return}if(a?.enabled!==false&&a?.onSubmit){l("ai"),h(r("detail.searchAi.autoAiFallback"));try{let v=await a.onSubmit(S,{query:S,hits:M,activeTabId:c,sections:e,tabs:t});p(typeof v=="string"?v:"");}finally{g(false);}return}l("search"),p(""),h(r("detail.searchAi.noMatch")),g(false);},[n,E,r,a,c,e,t]);return {query:n,setQuery:k,activeTabId:c,setActiveTabId:d,searchMode:s,hits:m,statusText:u,aiResponse:I,searching:C,handleSubmit:P,clearResult:x}};var OD=({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:m}=_(),{query:f,setQuery:u,activeTabId:h,setActiveTabId:I,searchMode:p,hits:C,statusText:g,aiResponse:b,searching:x,handleSubmit:k,clearResult:E}=Ip({sections:o,tabs:a,defaultTabId:r,ai:i}),P=st.useMemo(()=>a.find(T=>T.id===h)||a[0],[a,h]),S=st.useCallback(T=>{let v=D=>{let w=document.getElementById(T);if(w){w.scrollIntoView({behavior:"smooth",block:"center"});return}D<4&&setTimeout(()=>v(D+1),60);};requestAnimationFrame(()=>v(0));},[]),M=st.useCallback((T,v)=>{if(a.some(D=>D.id===T)){I(T),S(v?`detail-tab-${T}-section-${v}`:`detail-tab-${T}`);return}S(`detail-section-${T}`);},[a,I,S]);return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:e}),t&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:t})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[jsxRuntime.jsx(material.Box,{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:jsxRuntime.jsx(Sp,{value:f,onChange:u,onSubmit:k,onVoiceInput:i?.onVoiceInput,onClear:()=>{u(""),E();},placeholder:i?.placeholder||m("detail.searchAi.placeholder"),statusText:g,loading:x,compact:true,showStatusText:false})}),s&&jsxRuntime.jsx(material.Tooltip,{title:l,children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:s,children:jsxRuntime.jsx(_b__default.default,{fontSize:"small"})})}),c]})]}),g&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:g}),p==="search"&&C.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:m("detail.searchAi.matches",{count:C.length})}),jsxRuntime.jsx(material.Stack,{spacing:.35,children:C.slice(0,8).map(T=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>M(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:jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.secondary"},children:T.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:T.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:T.fieldValue||"-"})]})},`${T.source}|${T.sourceId}|${T.fieldId}`))})]}),p==="ai"&&b&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:m("detail.searchAi.aiResultTitle")}),jsxRuntime.jsx(material.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:jsxRuntime.jsx(Dn,{markdown:b})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(T=>jsxRuntime.jsx(material.Box,{id:`detail-section-${T.id}`,children:jsxRuntime.jsx(qi,{section:T,highlightQuery:f})},T.id))}),a.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:P?.id||false,onChange:(T,v)=>I(v),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(T=>jsxRuntime.jsx(material.Tab,{value:T.id,label:T.label,sx:{textTransform:"none"}},T.id))}),jsxRuntime.jsxs(material.Box,{sx:{p:1.5},children:[jsxRuntime.jsx(material.Box,{id:`detail-tab-${P?.id||""}`}),P?.description&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:P.description}),P?.content?P.content:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[(P?.sections||[]).map(T=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${P?.id}-section-${T.id}`,children:jsxRuntime.jsx(qi,{section:T,highlightQuery:f})},T.id)),P?.fields&&P.fields.length>0&&jsxRuntime.jsx(qi,{section:{id:`${P.id}-fields`,title:P.label,fields:P.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx(Sa,{title:n.title||m("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var Dp=({bucket:e,cardCount:t,highlighted:o=false,children:a,emptyLabel:r,maxHeight:n,sx:i})=>{let{t:c}=_();return jsxRuntime.jsx(material.Paper,{sx:[d=>{let s=e.accentColor??d.palette.primary.main;return {position:"relative",minWidth:0,borderRadius:4,overflow:"hidden",border:`1px solid ${styles.alpha(s,o?.58:d.palette.mode==="dark"?.28:.18)}`,bgcolor:styles.alpha(d.palette.background.paper,d.palette.mode==="dark"?.92:.97),boxShadow:o?`0 18px 40px ${styles.alpha(s,.22)}`:`0 10px 28px ${styles.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:jsxRuntime.jsxs(material.Stack,{spacing:1.2,sx:{p:1.5},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[e.icon,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.96rem",fontWeight:800},children:e.title})]}),e.description&&jsxRuntime.jsx(material.Typography,{sx:{mt:.45,fontSize:"0.76rem",color:"text.secondary",lineHeight:1.45},children:e.description})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.8,sx:{flexShrink:0},children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t,sx:{fontWeight:700}}),typeof e.limit=="number"&&jsxRuntime.jsx(material.Chip,{size:"small",label:`${c("kanban.bucket.limit")} ${e.limit}`,color:t>e.limit?"warning":"default",variant:"outlined"})]})]}),o&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700},children:c("kanban.bucket.dropHere")}),jsxRuntime.jsx(material.Box,{sx:{minHeight:220,maxHeight:n,overflowY:n?"auto":"visible",pr:n?.4:0},children:t>0?a:jsxRuntime.jsx(material.Box,{sx:d=>({minHeight:160,borderRadius:3,border:`1px dashed ${styles.alpha(d.palette.divider,.9)}`,bgcolor:d.palette.mode==="dark"?styles.alpha(d.palette.common.white,.02):styles.alpha(d.palette.primary.main,.03),display:"grid",placeItems:"center",px:2,textAlign:"center"}),children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:r??e.emptyLabel??c("kanban.empty")})})})]})})};var Yb={success:"success",warning:"warning",info:"info",error:"error"},Jb={critical:"error",high:"warning",medium:"info",low:"success"},ex=(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}},tx=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Hl=({card:e,bucket:t,dragging:o=false,overlay:a=false,onClick:r,sx:n})=>{let{t:i}=_(),c=!!(r&&t),d=e.tone??(e.priority?Jb[e.priority]:"default"),s=d==="default"?"primary":Yb[d],l=t?{card:e,bucket:t}:void 0;return jsxRuntime.jsx(material.Paper,{onClick:c?()=>l&&r?.(l):void 0,onKeyDown:c?m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),l&&r?.(l));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[m=>{let f=d==="default"?m.palette.primary.main:m.palette[s].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${styles.alpha(f,m.palette.mode==="dark"?.42:.2)}`,bgcolor:styles.alpha(m.palette.background.paper,m.palette.mode==="dark"?.96:.98),boxShadow:a?`0 20px 45px ${styles.alpha(m.palette.common.black,.24)}`:o?"none":`0 8px 24px ${styles.alpha(m.palette.common.black,m.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 ${styles.alpha(m.palette.common.black,m.palette.mode==="dark"?.28:.12)}`}:void 0}},...Array.isArray(n)?n:n?[n]:[]],children:jsxRuntime.jsxs(material.Stack,{spacing:1.1,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[(e.kicker||t?.title)&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:.4,color:"text.secondary",textTransform:"uppercase"},children:e.kicker??t?.title}),jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.98rem",fontWeight:800,lineHeight:1.3},children:e.title})]}),e.priority&&jsxRuntime.jsx(material.Chip,{size:"small",color:s,label:ex(e.priority,i),variant:d==="default"?"outlined":"filled",sx:{height:22,fontWeight:700}})]}),e.summary&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",color:"text.secondary",lineHeight:1.5},children:e.summary}),e.metrics&&e.metrics.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(e.metrics.length,3)}, minmax(0, 1fr))`,gap:.9},children:e.metrics.slice(0,3).map(m=>jsxRuntime.jsxs(material.Box,{sx:f=>({borderRadius:2,px:1,py:.8,bgcolor:f.palette.mode==="dark"?styles.alpha(f.palette.common.white,.05):styles.alpha(f.palette.primary.main,.05)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",textTransform:"uppercase",letterSpacing:.35},children:m.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",fontWeight:700},children:m.value})]},m.id))}),typeof e.progress=="number"&&jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:i("kanban.card.progress")}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700},children:[Math.round(e.progress),"%"]})]}),jsxRuntime.jsx(material.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)&&jsxRuntime.jsxs(material.Stack,{spacing:.9,children:[e.tags&&e.tags.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:e.tags.map(m=>jsxRuntime.jsx(material.Chip,{size:"small",label:m.label,color:m.color??"default",variant:"outlined"},m.id))}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8,minWidth:0},children:[e.assignee&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Avatar,{src:e.assignee.avatarSrc,sx:{width:28,height:28,fontSize:"0.75rem"},children:e.assignee.initials??tx(e.assignee.name)}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700,lineHeight:1.2},noWrap:true,children:e.assignee.name}),e.dueDate&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},noWrap:true,children:e.dueDate})]})]}),!e.assignee&&e.dueDate&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",color:"text.secondary"},children:e.dueDate})]}),c&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700,whiteSpace:"nowrap"},children:i("kanban.card.openDetail")})]}),e.footer]})]})})};var ax=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,Bp=({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}})}},Ro=(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=Ro(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=ax(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,m)=>({...l,bucketId:s.id,position:m}))}))}};var Gl="kanban-card|",Ul="kanban-bucket|",zp=e=>`${Gl}${e}`,hx=e=>`${Ul}${e}`,Yi=e=>e?.startsWith(Gl)?e.slice(Gl.length):void 0,Lp=e=>e?.startsWith(Ul)?e.slice(Ul.length):void 0,yx=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:a,attributes:r,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:zp(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 jsxRuntime.jsx(material.Box,{ref:a,style:s,...r,...n,children:jsxRuntime.jsx(Hl,{card:e,bucket:t,dragging:d,onClick:o})})},bx=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:a,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:hx(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(Dp,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:a,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>zp(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(yx,{card:c,bucket:e,onCardClick:r},c.id))})})})})},i2=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:a=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[c,d]=st.useState(null),[s,l]=st.useState(),m=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=st.useMemo(()=>c?Ro(e,c):void 0,[c,e]),u=st.useCallback(()=>{d(null),l(void 0);},[]),h=st.useCallback(g=>{if(!g)return;let b=Yi(g);return b?Ro(e,b)?.bucket.id:Lp(g)},[e]),I=st.useCallback(g=>{d(Yi(String(g.active.id))??null);},[]),p=st.useCallback(g=>{l(h(g.over?String(g.over.id):void 0));},[h]),C=st.useCallback(g=>{let b=Yi(String(g.active.id)),x=g.over?String(g.over.id):void 0;if(!b||!x){u();return}let k=Ro(e,b);if(!k){u();return}let E=k.bucket.id,P=k.cardIndex,S=Yi(x);if(S){let v=Ro(e,S);if(!v){u();return}E=v.bucket.id,P=v.cardIndex;}else {let v=Lp(x),D=e.buckets.find(w=>w.id===v);if(!v||!D){u();return}E=v,P=D.cards.length;}if(k.bucket.id===E&&k.cardIndex===P){u();return}let M=Qi(e,{cardId:b,fromBucketId:k.bucket.id,toBucketId:E,targetIndex:P}),T=Ro(M,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:M}),u();},[e,t,u]);return jsxRuntime.jsxs(core.DndContext,{sensors:m,collisionDetection:core.closestCorners,onDragStart:I,onDragOver:p,onDragEnd:C,onDragCancel:u,children:[jsxRuntime.jsx(material.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(g=>jsxRuntime.jsx(bx,{bucket:g,highlighted:g.id===s,bucketMaxHeight:r,emptyBucketLabel:n,onCardClick:o},g.id))}),jsxRuntime.jsx(core.DragOverlay,{children:f?jsxRuntime.jsx(material.Box,{sx:{width:Math.max(a-24,260)},children:jsxRuntime.jsx(Hl,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var kx=({initialModel:e,initialBuckets:t,initialCards:o})=>e||Bp({buckets:t??[],cards:o??[]}),p2=e=>{let{onCardMove:t,onCardClick:o}=e,[a,r]=st.useState(()=>kx(e)),n=st.useCallback(l=>{r(m=>typeof l=="function"?l(m):l);},[]),i=st.useCallback(l=>Ro(a,l),[a]),c=st.useCallback((l,m,f)=>{let u=Ro(a,l);if(!u)return;let h=Qi(a,{cardId:l,fromBucketId:u.bucket.id,toBucketId:m,targetIndex:f}),I=Ro(h,l);if(!I||I.bucket.id===u.bucket.id&&I.cardIndex===u.cardIndex)return;r(h);let p={cardId:l,fromBucketId:u.bucket.id,toBucketId:I.bucket.id,targetIndex:I.cardIndex,card:I.card,model:h};return t?.(p),p},[a,t]),d=st.useCallback((l,m)=>{r(f=>({buckets:f.buckets.map(u=>({...u,cards:u.cards.map(h=>h.id!==l?h:typeof m=="function"?m(h):{...h,...m})}))}));},[]),s=st.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 Wp=64,Nx="#E9EDF2",Vx="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",Ox=["en","zh","fr","de","ja","ko"],$p={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},os=({appTitle:e,logo:t,mode:o="dark",onToggleMode:a,locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,onSearch:s,user:l,onUserSetting:m,onUserLogout:f,userMenuItems:u,leftSlot:h,rightSlot:I})=>{let{t:p,locale:C}=_(),b=material.useTheme().palette.mode==="dark",[x,k]=st.useState(""),[E,P]=st.useState(null),[S,M]=st.useState(null),T=Z=>{Z.preventDefault(),s&&s(x.trim());},v=o==="system"?jsxRuntime.jsx(Bx__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(Fx__default.default,{fontSize:"small"}):jsxRuntime.jsx(Ex__default.default,{fontSize:"small"}),D=p(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),w=r||C,R=i&&i.length>0?i:Ox,F=n||$p[w]||w.toUpperCase(),$=!!E,N=d||p("header.searchPlaceholder"),j=!!S,ie=[{key:"setting",label:p("header.menu.setting"),icon:jsxRuntime.jsx(sy__default.default,{sx:{fontSize:18}}),onClick:m},{key:"logout",label:p("header.menu.logout"),icon:jsxRuntime.jsx(zx__default.default,{sx:{fontSize:18}}),onClick:f}],Y=u&&u.length>0?u:ie,te=Z=>{M(null),Z?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:Z=>({top:0,zIndex:Z.zIndex.drawer+10,height:Wp,backgroundColor:Z.palette.mode==="dark"?"#0D0D0D":Nx,backgroundImage:Z.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%)",Vx,"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:Z.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxRuntime.jsxs(material.Toolbar,{sx:{minHeight:`${Wp}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[h,t===null?null:t||jsxRuntime.jsx(material.Box,{component:"img",src:"/orbcafe.png",alt:"ORBCAFE Logo",sx:{width:44,height:44,display:"block",objectFit:"contain",flexShrink:0}}),e&&jsxRuntime.jsx(material.Typography,{variant:"h6",sx:{fontWeight:700,color:b?"common.white":"#111827"},children:e})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsxRuntime.jsx(material.Box,{component:"form",onSubmit:T,sx:{width:"100%",maxWidth:540},children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:x,onChange:Z=>k(Z.target.value),placeholder:N,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Hd__default.default,{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"}}})})}),jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[c?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Z=>P(Z.currentTarget),sx:{color:b?"common.white":"#111827",borderRadius:1,px:.5},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsxRuntime.jsx(Op__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:F})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:E,open:$,onClose:()=>P(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:R.map(Z=>jsxRuntime.jsx(material.MenuItem,{selected:Z===w,onClick:()=>{c(Z),P(null);},sx:{fontSize:"0.82rem"},children:$p[Z]},Z))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(Op__default.default,{sx:{color:b?"common.white":"#111827",fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:b?"common.white":"#111827",fontWeight:500},children:F})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:b?"common.white":"#111827"},onClick:a,title:D,children:v}),l&&jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1,children:[jsxRuntime.jsxs(material.Box,{sx:{textAlign:"right",minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:b?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:l.name}),l.subtitle&&jsxRuntime.jsx(material.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})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Z=>M(Z.currentTarget),sx:{p:0},children:jsxRuntime.jsx(material.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&&jsxRuntime.jsx(material.Menu,{anchorEl:S,open:j,onClose:()=>M(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:Y.map(Z=>jsxRuntime.jsxs(material.MenuItem,{disabled:Z.disabled,onClick:()=>te(Z.onClick),children:[Z.icon&&jsxRuntime.jsx(material.ListItemIcon,{children:Z.icon}),jsxRuntime.jsx(material.ListItemText,{primary:Z.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},Z.key))})]})};var Hp=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:o}=Kc({initialCollapsed:t,content:e}),[a,r]=st.useState(900);st.useEffect(()=>{let i=()=>r(window.innerHeight);return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);let n=st.useMemo(()=>Math.max(280,a-100),[a]);return {navigationIslandProps:o,navigationMaxHeight:n}};var L2=({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:m,logo:f,onSearch:u,rightHeaderSlot:h,leftHeaderSlot:I,contentSx:p})=>{let C="orbcafe:page-layout-mode",[g,b]=st.useState("system"),[x,k]=st.useState("light"),[E,P]=st.useState(false),S=g==="system"?E?x:"light":g;st.useEffect(()=>{try{let R=window.localStorage.getItem(C);(R==="light"||R==="dark"||R==="system")&&b(R);}catch{}P(true);let D=window.matchMedia("(prefers-color-scheme: dark)"),w=()=>{k(D.matches?"dark":"light");};return w(),D.addEventListener("change",w),()=>D.removeEventListener("change",w)},[]),st.useEffect(()=>{if(E)try{window.localStorage.setItem(C,g);}catch{}},[E,g]),st.useEffect(()=>{S==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[S]);let M=st.useMemo(()=>material.createTheme({palette:{mode:S}}),[S]),{navigationIslandProps:T,navigationMaxHeight:v}=Hp({menuData:t,initialNavigationCollapsed:false});return jsxRuntime.jsx(material.ThemeProvider,{theme:M,children:jsxRuntime.jsx(Jn,{locale:r,children:jsxRuntime.jsxs(material.Box,{sx:D=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:D.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":D.palette.background.default}),children:[jsxRuntime.jsx(os,{appTitle:e,logo:f,mode:g,onToggleMode:()=>b(D=>D==="system"?"dark":D==="dark"?"light":"system"),locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:s,onUserLogout:l,userMenuItems:m,onSearch:u,leftSlot:I,rightSlot:h}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[a&&jsxRuntime.jsx(material.Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(Gc,{...T,maxHeight:v,colorMode:S})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...p},children:o})]})]})})})};var rs="(blank)",Up="Result",Kp="Grand Total",qp={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},_p=["sum","count","avg","min","max"];var Zp=["palette","rows","columns","filters","values"];var jp=e=>Zp.includes(e),Xp=e=>e==="rows"||e==="columns"||e==="filters",ns=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&jp(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&jp(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},ra=e=>e==null||e===""?rs:e instanceof Date?e.toISOString().slice(0,10):String(e),or=e=>JSON.stringify(e),Qp=(e,t)=>{let o=e.join(""),a=t.join("");return o.localeCompare(a,void 0,{sensitivity:"base"})},_x=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=>_x(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)},gt=(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},na=(e,t)=>e.length!==t.length?false:e.every((o,a)=>o===t[a]),Yp=(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 na(n,i)})},is=(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}),jl=e=>!e?.aggregations||e.aggregations.length===0?_p:e.aggregations,zt=(e,t)=>{let o=jl(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},zn=(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 tu=({options:e,selectedValues:t,onChange:o,minWidth:a=96})=>{let{t:r}=_(),[n,i]=st.useState(""),c=st.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 jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:a},children:jsxRuntime.jsxs(material.Select,{multiple:true,value:t,onChange:s=>{let l=s.target.value,m=typeof l=="string"?l.split(","):l;o(m);},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:[jsxRuntime.jsx(material.ListSubheader,{disableSticky:true,sx:s=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${s.palette.divider}`}),children:jsxRuntime.jsx(material.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}}})}),jsxRuntime.jsx(material.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:jsxRuntime.jsx(material.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&&jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:r("pivot.filter.noResults")}),c.map(s=>{let l=t.includes(s);return jsxRuntime.jsxs(material.MenuItem,{value:s,sx:{fontSize:"0.75rem",py:.25},children:[jsxRuntime.jsx(material.Checkbox,{size:"small",checked:l,sx:{p:.5,mr:.5}}),jsxRuntime.jsx(material.ListItemText,{primary:s,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},s)})]})})};var Ql=({label:e,subtitle:t,isDragging:o,dragRef:a,listeners:r,attributes:n,style:i})=>jsxRuntime.jsx(material.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:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.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:jsxRuntime.jsx(n0__default.default,{sx:{fontSize:16,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary",lineHeight:1.2},children:t})]})]})}),ru=({id:e,label:t,subtitle:o})=>{let{setNodeRef:a,listeners:r,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(Ql,{label:t,subtitle:o,isDragging:i,dragRef:a,listeners:r,attributes:n})};var Wr=({zone:e,title:t,hint:o,icon:a,children:r,itemCount:n,onClear:i})=>{let c=`container|${e}`,{isOver:d,setNodeRef:s}=core.useDroppable({id:c}),{t:l}=_();return jsxRuntime.jsxs(material.Paper,{ref:s,sx:m=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:d?"primary.main":m.palette.divider,bgcolor:d?m.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":m.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:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[a,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",n,")"]})]}),n>0&&i&&jsxRuntime.jsx(material.Tooltip,{title:l("pivot.clearArea"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i,sx:{p:.25},children:jsxRuntime.jsx(d0__default.default,{sx:{fontSize:16}})})})]}),jsxRuntime.jsx(material.Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:o}),jsxRuntime.jsx(material.Box,{sx:{flex:1},children:r})]})};var iu={xs:1.2,md:1.6},Hr=({title:e,subtitle:t,collapsed:o,onToggleCollapse:a,expandAriaLabel:r,collapseAriaLabel:n,children:i,bodySx:c,unmountOnExit:d=false,headerActions:s})=>jsxRuntime.jsxs(material.Paper,{sx:l=>({borderRadius:3,border:`1px solid ${l.palette.divider}`,overflow:"hidden",bgcolor:styles.alpha(l.palette.background.paper,.95)}),children:[jsxRuntime.jsxs(material.Box,{sx:l=>({px:iu,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:o?"none":`1px solid ${l.palette.divider}`}),children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.9rem",fontWeight:800},children:e}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[s,jsxRuntime.jsx(material.IconButton,{size:"small","aria-label":o?r:n,onClick:a,sx:l=>({border:`1px solid ${l.palette.divider}`,bgcolor:styles.alpha(l.palette.background.paper,.88),width:28,height:28,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:l.palette.mode==="dark"?styles.alpha(l.palette.primary.main,.18):styles.alpha(l.palette.primary.main,.08)}}),children:jsxRuntime.jsx(ly__default.default,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),jsxRuntime.jsx(material.Collapse,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:jsxRuntime.jsx(material.Box,{sx:[{px:iu,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var ps=({label:e,caption:t,onRemove:o,trailing:a,isDragging:r,dragRef:n,listeners:i,attributes:c,style:d})=>jsxRuntime.jsx(material.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:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.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:jsxRuntime.jsx(n0__default.default,{sx:{fontSize:15,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),a,o&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:s=>{s.stopPropagation(),o();},sx:{p:.2},children:jsxRuntime.jsx(th__default.default,{sx:{fontSize:16}})})]})}),Nn=({id:e,label:t,caption:o,onRemove:a,trailing:r})=>{let{setNodeRef:n,attributes:i,listeners:c,transform:d,transition:s,isDragging:l}=sortable.useSortable({id:e}),m={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:s,zIndex:l?999:"auto"};return jsxRuntime.jsx(ps,{label:t,caption:o,onRemove:a,trailing:r,isDragging:l,dragRef:n,listeners:c,attributes:i,style:m})};var gs={rows:jsxRuntime.jsx(w0__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(Og__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(S0__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(Gg__default.default,{fontSize:"small"})},cu=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:a,filterFields:r,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:s,getFilterSelectionSummary:l,renderDimensionFilterSelect:m,renderAggregationSelect:f,getAggregationLabel:u})=>{let{t:h}=_(),I=[`${h("pivot.zone.rows")} ${i.length}`,`${h("pivot.zone.columns")} ${n.length}`,`${h("pivot.zone.filters")} ${r.length}`,`${h("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsxRuntime.jsx(Hr,{title:h("pivot.config.title"),subtitle:I,collapsed:e,onToggleCollapse:t,expandAriaLabel:h("pivot.collapse.ariaExpand"),collapseAriaLabel:h("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsxRuntime.jsx(Wr,{zone:"palette",title:h("pivot.fieldList"),hint:h("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(n0__default.default,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxRuntime.jsxs(material.Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:h("pivot.allFieldsInUse")}),o.map(p=>jsxRuntime.jsx(ru,{id:`item|palette|${p.id}`,label:p.label,subtitle:p.type??"string"},p.id))]})}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(Wr,{zone:"filters",title:h("pivot.zone.filters"),hint:h("pivot.hint.filters"),icon:gs.filters,itemCount:r.length,onClear:()=>d("filters"),children:jsxRuntime.jsx(sortable.SortableContext,{items:r.map(p=>`item|filters|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:r.map(p=>jsxRuntime.jsx(Nn,{id:`item|filters|${p}`,label:a.get(p)?.label??p,caption:l(p),trailing:m(p),onRemove:()=>s("filters",p)},p))})})}),jsxRuntime.jsx(Wr,{zone:"columns",title:h("pivot.zone.columns"),hint:h("pivot.hint.columns"),icon:gs.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsxRuntime.jsx(sortable.SortableContext,{items:n.map(p=>`item|columns|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:n.map(p=>jsxRuntime.jsx(Nn,{id:`item|columns|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${l(p)}`,trailing:m(p),onRemove:()=>s("columns",p)},p))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(Wr,{zone:"rows",title:h("pivot.zone.rows"),hint:h("pivot.hint.rows"),icon:gs.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsxRuntime.jsx(sortable.SortableContext,{items:i.map(p=>`item|rows|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:i.map(p=>jsxRuntime.jsx(Nn,{id:`item|rows|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${l(p)}`,trailing:m(p),onRemove:()=>s("rows",p)},p))})})}),jsxRuntime.jsx(Wr,{zone:"values",title:h("pivot.zone.values"),hint:h("pivot.hint.values"),icon:gs.values,itemCount:c.length,onClear:()=>d("values"),children:jsxRuntime.jsx(sortable.SortableContext,{items:c.map(p=>`item|values|${p.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:c.map(p=>{let C=a.get(p.fieldId)?.label??p.fieldId,g=`${u(p.aggregation)}(${C})`;return jsxRuntime.jsx(Nn,{id:`item|values|${p.tokenId}`,label:C,caption:g,trailing:f(p),onRemove:()=>s("values",p.tokenId)},p.tokenId)})})})})]})]})]})})};var du=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),pu=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:a,formatSecondaryValue:r})=>{let n=styles.useTheme();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),m=Math.max(...s,1),f=Math.max(...l,1),u=i-d.left-d.right,h=c-d.top-d.bottom,I=e.map((p,C)=>{let g=o?p.primaryValue:C+1,b=o?p.secondaryValue??0:p.primaryValue,x=d.left+g/m*u,k=c-d.bottom-b/f*h;return {...p,x,y:k,rawX:g,rawY:b}});return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${i} ${c}`,sx:{width:"100%",minWidth:i,height:c},children:[jsxRuntime.jsx("line",{x1:d.left,y1:c-d.bottom,x2:i-d.right,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),jsxRuntime.jsx("line",{x1:d.left,y1:d.top,x2:d.left,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),I.map(p=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:7,fill:styles.alpha(n.palette.primary.main,.18)}),jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:4.5,fill:n.palette.primary.main,children:jsxRuntime.jsxs("title",{children:[p.name,`
|
|
189
|
+
`),f={enableMath:a},u=0;for(;u<g.length;){let h=g[u],T=h.trim();if(!T){u+=1;continue}if(n&&jp(h)){if(T.startsWith("<think>")){let m=[],y=h;for(;;){let x=y.indexOf("<think>"),k=x>=0?y.slice(x+7):y,F=k.indexOf("</think>");if(F>=0){m.push(k.slice(0,F)),u+=1;break}if(m.push(k),u+=1,u>=g.length)break;y=g[u];}s.push(jsxRuntime.jsx(ds,{content:m.join(`
|
|
190
|
+
`).trim()},`think-tag-${u}`));continue}u+=1;let v=[];for(;u<g.length&&g[u].trim()!==":::";)v.push(g[u]),u+=1;u<g.length&&g[u].trim()===":::"&&(u+=1),s.push(jsxRuntime.jsx(ds,{content:v.join(`
|
|
191
|
+
`).trim()},`think-fence-${u}`));continue}if(ps(h)){let v=T.slice(3).trim().toLowerCase(),m=[];for(u+=1;u<g.length&&!ps(g[u]);)m.push(g[u]),u+=1;u<g.length&&ps(g[u])&&(u+=1);let y=m.join(`
|
|
192
|
+
`);if(r&&v==="mermaid"){s.push(jsxRuntime.jsx(Xl,{code:y},`mermaid-${u}`));continue}if(a&&["math","latex","katex"].includes(v)){s.push(jsxRuntime.jsx(Kn,{expression:y,allowKatex:true},`math-fence-${u}`));continue}s.push(jsxRuntime.jsx(Un,{code:y,language:v||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${u}`));continue}if(a&&T.startsWith("$$")){let v=[];if(T.endsWith("$$")&&T!=="$$")v.push(T.slice(2,-2)),u+=1;else {let y=h.slice(h.indexOf("$$")+2);for(y.trim()&&v.push(y),u+=1;u<g.length;){let x=g[u],k=x.indexOf("$$");if(k>=0){v.push(x.slice(0,k)),u+=1;break}v.push(x),u+=1;}}s.push(jsxRuntime.jsx(Kn,{expression:v.join(`
|
|
193
|
+
`).trim(),allowKatex:true},`math-${u}`));continue}if(Kp(h)){let v=Math.min(6,h.match(/^#{1,6}/)?.[0]?.length||1),m=h.replace(/^#{1,6}\s+/,""),y=v===1?"h5":v===2?"h6":"subtitle1";s.push(jsxRuntime.jsx(material.Typography,{variant:y,sx:{mt:v===1?1.2:.8,mb:.5,fontWeight:700},children:jn(m,f,`h-${u}`)},`heading-${u}`)),u+=1;continue}if(qp(h)){s.push(jsxRuntime.jsx(material.Divider,{sx:{my:1.2}},`hr-${u}`)),u+=1;continue}if(_p(g,u)){let v=u+2;for(;v<g.length&&g[v].trim()&&g[v].includes("|");)v+=1;let m=g.slice(u,v).join(`
|
|
194
|
+
`),y=ls(m);if(y){s.push(jsxRuntime.jsx(Yl,{table:y},`table-${u}`)),u=v;continue}}if(ac(h)){let v=[];for(;u<g.length&&ac(g[u]);)v.push(g[u].replace(/^\s*>\s?/,"")),u+=1;s.push(jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:v.map((m,y)=>jsxRuntime.jsxs(ct.Fragment,{children:[y>0&&jsxRuntime.jsx("br",{}),jn(m,f,`q-${u}-${y}`)]},`quote-line-${y}`))})},`quote-${u}`));continue}if(tc(h)){let v=[];for(;u<g.length&&tc(g[u]);)v.push(g[u].trim().replace(/^[-*+]\s+/,"")),u+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ul",sx:{my:.8,pl:2.5},children:v.map((m,y)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:jn(m,f,`ul-${u}-${y}`)})},`ul-item-${y}`))},`ul-${u}`));continue}if(oc(h)){let v=[];for(;u<g.length&&oc(g[u]);)v.push(g[u].trim().replace(/^\d+\.\s+/,"")),u+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ol",sx:{my:.8,pl:2.7},children:v.map((m,y)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:jn(m,f,`ol-${u}-${y}`)})},`ol-item-${y}`))},`ol-${u}`));continue}let p=[];for(;u<g.length;){let v=g[u],m=v.trim();if(!m||ps(v)||Kp(v)||qp(v)||tc(v)||oc(v)||ac(v)||_p(g,u)||n&&jp(v)||a&&m.startsWith("$$"))break;p.push(v),u+=1;}p.length>0?s.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:p.map((v,m)=>jsxRuntime.jsxs(ct.Fragment,{children:[m>0&&jsxRuntime.jsx("br",{}),jn(v,f,`p-${u}-${m}`)]},`p-line-${m}`))},`p-${u}`)):u+=1;}return s},[d,a,r,n,i,c]);return jsxRuntime.jsx(material.Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:l})};var j2=(e,t)=>jsxRuntime.jsx(Zn,{markdown:e,...t});var Qp=({value:e,onChange:t,onSubmit:o,onVoiceInput:a,onClear:r,placeholder:n,statusText:i,loading:c=false,compact:d=false,showStatusText:l=true})=>jsxRuntime.jsxs(material.Stack,{spacing:.75,children:[jsxRuntime.jsxs(material.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:[jsxRuntime.jsx(hp__default.default,{sx:{fontSize:d?16:18,color:"text.secondary"}}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:e,onChange:s=>t(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),o());},placeholder:n,sx:{fontSize:d?"0.84rem":"0.9rem"}}),e&&r&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:r,children:jsxRuntime.jsx(qh__default.default,{sx:{fontSize:d?16:18}})}),a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,children:jsxRuntime.jsx(ey__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(oy__default.default,{sx:{fontSize:d?16:18}})})]}),l&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var Yp=(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:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.slice(0,n),jsxRuntime.jsx(material.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)]})},us=({section:e,highlightQuery:t=""})=>{let o=e.columns||2;return jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsxRuntime.jsx(material.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 jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:Yp(a.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?Yp(r,t):a.value})]},a.id)})})]})};var lc=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",gs=e=>e.trim().toLowerCase(),Bx=(e,t)=>{let o=[];return e.forEach(a=>{a.fields.forEach(r=>{let n=r.searchableText||lc(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:gs(`${a.title} ${r.label} ${n}`)});});}),t.forEach(a=>{(a.fields||[]).forEach(r=>{let n=r.searchableText||lc(r.value),i={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:gs(`${a.label} ${r.label} ${n}`)});}),(a.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||lc(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:gs(`${a.label} ${r.title} ${n.label} ${i}`)});});});}),o},Jp=({sections:e,tabs:t=[],defaultTabId:o,ai:a})=>{let{t:r}=j(),[n,i]=ct.useState(""),[c,d]=ct.useState(o||t[0]?.id),[l,s]=ct.useState("idle"),[g,f]=ct.useState([]),[u,h]=ct.useState(""),[T,p]=ct.useState(""),[v,m]=ct.useState(false),y=ct.useMemo(()=>Bx(e,t),[e,t]);ct.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(A=>A.id===c)||d(o||t[0]?.id);},[t,c,o]);let x=ct.useCallback(()=>{s("idle"),f([]),h(""),p("");},[]),k=ct.useCallback(w=>{i(w),w.trim()||(s("idle"),f([]),h(""),p(""));},[]),F=ct.useCallback(w=>{let A=gs(w);return A?y.filter(R=>R.text.includes(A)).map(R=>R.hit):[]},[y]),S=ct.useCallback(async()=>{let w=n.trim();if(!w)return;m(true);let A=F(w);if(f(A),A.length>0){s("search"),p(""),h(r("detail.searchAi.matches",{count:A.length})),m(false);return}if(a?.enabled!==false&&a?.onSubmit){s("ai"),h(r("detail.searchAi.autoAiFallback"));try{let C=await a.onSubmit(w,{query:w,hits:A,activeTabId:c,sections:e,tabs:t});p(typeof C=="string"?C:"");}finally{m(false);}return}s("search"),p(""),h(r("detail.searchAi.noMatch")),m(false);},[n,F,r,a,c,e,t]);return {query:n,setQuery:k,activeTabId:c,setActiveTabId:d,searchMode:l,hits:g,statusText:u,aiResponse:T,searching:v,handleSubmit:S,clearResult:x}};var TM=({title:e,subtitle:t,sections:o,tabs:a=[],defaultTabId:r,table:n,ai:i,rightHeaderSlot:c,searchBarWidth:d=460,onClose:l,closeLabel:s="Close"})=>{let{t:g}=j(),{query:f,setQuery:u,activeTabId:h,setActiveTabId:T,searchMode:p,hits:v,statusText:m,aiResponse:y,searching:x,handleSubmit:k,clearResult:F}=Jp({sections:o,tabs:a,defaultTabId:r,ai:i}),S=ct.useMemo(()=>a.find(R=>R.id===h)||a[0],[a,h]),w=ct.useCallback(R=>{let C=D=>{let I=document.getElementById(R);if(I){I.scrollIntoView({behavior:"smooth",block:"center"});return}D<4&&setTimeout(()=>C(D+1),60);};requestAnimationFrame(()=>C(0));},[]),A=ct.useCallback((R,C)=>{if(a.some(D=>D.id===R)){T(R),w(C?`detail-tab-${R}-section-${C}`:`detail-tab-${R}`);return}w(`detail-section-${R}`);},[a,T,w]);return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:e}),t&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:t})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[jsxRuntime.jsx(material.Box,{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:jsxRuntime.jsx(Qp,{value:f,onChange:u,onSubmit:k,onVoiceInput:i?.onVoiceInput,onClear:()=>{u(""),F();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:m,loading:x,compact:true,showStatusText:false})}),l&&jsxRuntime.jsx(material.Tooltip,{title:s,children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l,children:jsxRuntime.jsx(Vx__default.default,{fontSize:"small"})})}),c]})]}),m&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:m}),p==="search"&&v.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:g("detail.searchAi.matches",{count:v.length})}),jsxRuntime.jsx(material.Stack,{spacing:.35,children:v.slice(0,8).map(R=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>A(R.sourceId,R.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.secondary"},children:R.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:R.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:R.fieldValue||"-"})]})},`${R.source}|${R.sourceId}|${R.fieldId}`))})]}),p==="ai"&&y&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:g("detail.searchAi.aiResultTitle")}),jsxRuntime.jsx(material.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:jsxRuntime.jsx(Zn,{markdown:y})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(R=>jsxRuntime.jsx(material.Box,{id:`detail-section-${R.id}`,children:jsxRuntime.jsx(us,{section:R,highlightQuery:f})},R.id))}),a.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:S?.id||false,onChange:(R,C)=>T(C),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(R=>jsxRuntime.jsx(material.Tab,{value:R.id,label:R.label,sx:{textTransform:"none"}},R.id))}),jsxRuntime.jsxs(material.Box,{sx:{p:1.5},children:[jsxRuntime.jsx(material.Box,{id:`detail-tab-${S?.id||""}`}),S?.description&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:S.description}),S?.content?S.content:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[(S?.sections||[]).map(R=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${S?.id}-section-${R.id}`,children:jsxRuntime.jsx(us,{section:R,highlightQuery:f})},R.id)),S?.fields&&S.fields.length>0&&jsxRuntime.jsx(us,{section:{id:`${S.id}-fields`,title:S.label,fields:S.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx(Fa,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var au=({bucket:e,cardCount:t,highlighted:o=false,children:a,emptyLabel:r,maxHeight:n,sx:i})=>{let{t:c}=j();return jsxRuntime.jsx(material.Paper,{sx:[d=>{let l=e.accentColor??d.palette.primary.main;return {position:"relative",minWidth:0,borderRadius:4,overflow:"hidden",border:`1px solid ${styles.alpha(l,o?.58:d.palette.mode==="dark"?.28:.18)}`,bgcolor:styles.alpha(d.palette.background.paper,d.palette.mode==="dark"?.92:.97),boxShadow:o?`0 18px 40px ${styles.alpha(l,.22)}`:`0 10px 28px ${styles.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:l}}},...Array.isArray(i)?i:i?[i]:[]],children:jsxRuntime.jsxs(material.Stack,{spacing:1.2,sx:{p:1.5},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[e.icon,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.96rem",fontWeight:800},children:e.title})]}),e.description&&jsxRuntime.jsx(material.Typography,{sx:{mt:.45,fontSize:"0.76rem",color:"text.secondary",lineHeight:1.45},children:e.description})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.8,sx:{flexShrink:0},children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t,sx:{fontWeight:700}}),typeof e.limit=="number"&&jsxRuntime.jsx(material.Chip,{size:"small",label:`${c("kanban.bucket.limit")} ${e.limit}`,color:t>e.limit?"warning":"default",variant:"outlined"})]})]}),o&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700},children:c("kanban.bucket.dropHere")}),jsxRuntime.jsx(material.Box,{sx:{minHeight:220,maxHeight:n,overflowY:n?"auto":"visible",pr:n?.4:0},children:t>0?a:jsxRuntime.jsx(material.Box,{sx:d=>({minHeight:160,borderRadius:3,border:`1px dashed ${styles.alpha(d.palette.divider,.9)}`,bgcolor:d.palette.mode==="dark"?styles.alpha(d.palette.common.white,.02):styles.alpha(d.palette.primary.main,.03),display:"grid",placeItems:"center",px:2,textAlign:"center"}),children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:r??e.emptyLabel??c("kanban.empty")})})})]})})};var Gx={success:"success",warning:"warning",info:"info",error:"error"},Ux={critical:"error",high:"warning",medium:"info",low:"success"},Kx=(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}},qx=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",dc=({card:e,bucket:t,dragging:o=false,overlay:a=false,onClick:r,sx:n})=>{let{t:i}=j(),c=!!(r&&t),d=e.tone??(e.priority?Ux[e.priority]:"default"),l=d==="default"?"primary":Gx[d],s=t?{card:e,bucket:t}:void 0;return jsxRuntime.jsx(material.Paper,{onClick:c?()=>s&&r?.(s):void 0,onKeyDown:c?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),s&&r?.(s));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[g=>{let f=d==="default"?g.palette.primary.main:g.palette[l].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${styles.alpha(f,g.palette.mode==="dark"?.42:.2)}`,bgcolor:styles.alpha(g.palette.background.paper,g.palette.mode==="dark"?.96:.98),boxShadow:a?`0 20px 45px ${styles.alpha(g.palette.common.black,.24)}`:o?"none":`0 8px 24px ${styles.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 ${styles.alpha(g.palette.common.black,g.palette.mode==="dark"?.28:.12)}`}:void 0}},...Array.isArray(n)?n:n?[n]:[]],children:jsxRuntime.jsxs(material.Stack,{spacing:1.1,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[(e.kicker||t?.title)&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:.4,color:"text.secondary",textTransform:"uppercase"},children:e.kicker??t?.title}),jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.98rem",fontWeight:800,lineHeight:1.3},children:e.title})]}),e.priority&&jsxRuntime.jsx(material.Chip,{size:"small",color:l,label:Kx(e.priority,i),variant:d==="default"?"outlined":"filled",sx:{height:22,fontWeight:700}})]}),e.summary&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",color:"text.secondary",lineHeight:1.5},children:e.summary}),e.metrics&&e.metrics.length>0&&jsxRuntime.jsx(material.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=>jsxRuntime.jsxs(material.Box,{sx:f=>({borderRadius:2,px:1,py:.8,bgcolor:f.palette.mode==="dark"?styles.alpha(f.palette.common.white,.05):styles.alpha(f.palette.primary.main,.05)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",textTransform:"uppercase",letterSpacing:.35},children:g.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",fontWeight:700},children:g.value})]},g.id))}),typeof e.progress=="number"&&jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:i("kanban.card.progress")}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700},children:[Math.round(e.progress),"%"]})]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:Math.max(0,Math.min(100,e.progress)),color:l,sx:{height:8,borderRadius:999}})]}),(e.tags?.length||e.assignee||e.dueDate||e.footer||c)&&jsxRuntime.jsxs(material.Stack,{spacing:.9,children:[e.tags&&e.tags.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:e.tags.map(g=>jsxRuntime.jsx(material.Chip,{size:"small",label:g.label,color:g.color??"default",variant:"outlined"},g.id))}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8,minWidth:0},children:[e.assignee&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Avatar,{src:e.assignee.avatarSrc,sx:{width:28,height:28,fontSize:"0.75rem"},children:e.assignee.initials??qx(e.assignee.name)}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700,lineHeight:1.2},noWrap:true,children:e.assignee.name}),e.dueDate&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},noWrap:true,children:e.dueDate})]})]}),!e.assignee&&e.dueDate&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",color:"text.secondary"},children:e.dueDate})]}),c&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700,whiteSpace:"nowrap"},children:i("kanban.card.openDetail")})]}),e.footer]})]})})};var jx=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,iu=({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}})}},zo=(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}}},ys=(e,t)=>{let o=zo(e,t.cardId);if(!o)return e;let a=e.buckets.findIndex(l=>l.id===t.toBucketId);if(a<0)return e;let r=e.buckets.map(l=>({...l,cards:l.cards.map(s=>({...s}))})),n=r[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let c=r[a],d=jx(t.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...i,bucketId:t.toBucketId}),{buckets:r.map(l=>({...l,cards:l.cards.map((s,g)=>({...s,bucketId:l.id,position:g}))}))}};var pc="kanban-card|",uc="kanban-bucket|",du=e=>`${pc}${e}`,s0=e=>`${uc}${e}`,bs=e=>e?.startsWith(pc)?e.slice(pc.length):void 0,cu=e=>e?.startsWith(uc)?e.slice(uc.length):void 0,l0=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:a,attributes:r,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:du(e.id)}),l={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 jsxRuntime.jsx(material.Box,{ref:a,style:l,...r,...n,children:jsxRuntime.jsx(dc,{card:e,bucket:t,dragging:d,onClick:o})})},c0=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:a,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:s0(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(au,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:a,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>du(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(l0,{card:c,bucket:e,onCardClick:r},c.id))})})})})},qM=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:a=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[c,d]=ct.useState(null),[l,s]=ct.useState(),g=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=ct.useMemo(()=>c?zo(e,c):void 0,[c,e]),u=ct.useCallback(()=>{d(null),s(void 0);},[]),h=ct.useCallback(m=>{if(!m)return;let y=bs(m);return y?zo(e,y)?.bucket.id:cu(m)},[e]),T=ct.useCallback(m=>{d(bs(String(m.active.id))??null);},[]),p=ct.useCallback(m=>{s(h(m.over?String(m.over.id):void 0));},[h]),v=ct.useCallback(m=>{let y=bs(String(m.active.id)),x=m.over?String(m.over.id):void 0;if(!y||!x){u();return}let k=zo(e,y);if(!k){u();return}let F=k.bucket.id,S=k.cardIndex,w=bs(x);if(w){let C=zo(e,w);if(!C){u();return}F=C.bucket.id,S=C.cardIndex;}else {let C=cu(x),D=e.buckets.find(I=>I.id===C);if(!C||!D){u();return}F=C,S=D.cards.length;}if(k.bucket.id===F&&k.cardIndex===S){u();return}let A=ys(e,{cardId:y,fromBucketId:k.bucket.id,toBucketId:F,targetIndex:S}),R=zo(A,y);R&&!(R.bucket.id===k.bucket.id&&R.cardIndex===k.cardIndex)&&t?.({cardId:y,fromBucketId:k.bucket.id,toBucketId:R.bucket.id,targetIndex:R.cardIndex,card:R.card,model:A}),u();},[e,t,u]);return jsxRuntime.jsxs(core.DndContext,{sensors:g,collisionDetection:core.closestCorners,onDragStart:T,onDragOver:p,onDragEnd:v,onDragCancel:u,children:[jsxRuntime.jsx(material.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=>jsxRuntime.jsx(c0,{bucket:m,highlighted:m.id===l,bucketMaxHeight:r,emptyBucketLabel:n,onCardClick:o},m.id))}),jsxRuntime.jsx(core.DragOverlay,{children:f?jsxRuntime.jsx(material.Box,{sx:{width:Math.max(a-24,260)},children:jsxRuntime.jsx(dc,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var m0=({initialModel:e,initialBuckets:t,initialCards:o})=>e||iu({buckets:t??[],cards:o??[]}),QM=e=>{let{onCardMove:t,onCardClick:o}=e,[a,r]=ct.useState(()=>m0(e)),n=ct.useCallback(s=>{r(g=>typeof s=="function"?s(g):s);},[]),i=ct.useCallback(s=>zo(a,s),[a]),c=ct.useCallback((s,g,f)=>{let u=zo(a,s);if(!u)return;let h=ys(a,{cardId:s,fromBucketId:u.bucket.id,toBucketId:g,targetIndex:f}),T=zo(h,s);if(!T||T.bucket.id===u.bucket.id&&T.cardIndex===u.cardIndex)return;r(h);let p={cardId:s,fromBucketId:u.bucket.id,toBucketId:T.bucket.id,targetIndex:T.cardIndex,card:T.card,model:h};return t?.(p),p},[a,t]),d=ct.useCallback((s,g)=>{r(f=>({buckets:f.buckets.map(u=>({...u,cards:u.cards.map(h=>h.id!==s?h:typeof g=="function"?g(h):{...h,...g})}))}));},[]),l=ct.useMemo(()=>({model:a,onCardMove:s=>{c(s.cardId,s.toBucketId,s.targetIndex);},onCardClick:o}),[a,c,o]);return {model:a,actions:{replaceModel:n,moveCard:c,updateCard:d,getCard:i},boardProps:l}};var gu=64,R0="#E9EDF2",D0="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",M0=["en","zh","fr","de","ja","ko"],fu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},ks=({appTitle:e,logo:t,mode:o="dark",onToggleMode:a,locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,onSearch:l,user:s,onUserSetting:g,onUserLogout:f,userMenuItems:u,leftSlot:h,rightSlot:T})=>{let{t:p,locale:v}=j(),y=material.useTheme().palette.mode==="dark",[x,k]=ct.useState(""),[F,S]=ct.useState(null),[w,A]=ct.useState(null),R=Q=>{Q.preventDefault(),l&&l(x.trim());},C=o==="system"?jsxRuntime.jsx(S0__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(w0__default.default,{fontSize:"small"}):jsxRuntime.jsx(T0__default.default,{fontSize:"small"}),D=p(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),I=r||v,P=i&&i.length>0?i:M0,M=n||fu[I]||I.toUpperCase(),O=!!F,N=d||p("header.searchPlaceholder"),X=!!w,oe=[{key:"setting",label:p("header.menu.setting"),icon:jsxRuntime.jsx(Yy__default.default,{sx:{fontSize:18}}),onClick:g},{key:"logout",label:p("header.menu.logout"),icon:jsxRuntime.jsx(P0__default.default,{sx:{fontSize:18}}),onClick:f}],te=u&&u.length>0?u:oe,re=Q=>{A(null),Q?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:Q=>({top:0,zIndex:Q.zIndex.drawer+10,height:gu,backgroundColor:Q.palette.mode==="dark"?"#0D0D0D":R0,backgroundImage:Q.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%)",D0,"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:Q.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxRuntime.jsxs(material.Toolbar,{sx:{minHeight:`${gu}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[h,t===null?null:t||jsxRuntime.jsx(material.Box,{component:"img",src:"/orbcafe.png",alt:"ORBCAFE Logo",sx:{width:44,height:44,display:"block",objectFit:"contain",flexShrink:0}}),e&&jsxRuntime.jsx(material.Typography,{variant:"h6",sx:{fontWeight:700,color:y?"common.white":"#111827"},children:e})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsxRuntime.jsx(material.Box,{component:"form",onSubmit:R,sx:{width:"100%",maxWidth:540},children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:x,onChange:Q=>k(Q.target.value),placeholder:N,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(hp__default.default,{sx:{color:y?"rgba(255,255,255,0.7)":"rgba(15,23,42,0.55)",fontSize:18}})}),sx:{color:y?"common.white":"rgba(17,24,39,0.9)",bgcolor:y?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,"& .MuiOutlinedInput-notchedOutline":{borderColor:y?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:y?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:y?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:y?"white":"#111827"}}})})}),jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[c?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Q=>S(Q.currentTarget),sx:{color:y?"common.white":"#111827",borderRadius:1,px:.5},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsxRuntime.jsx(mu__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:M})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:F,open:O,onClose:()=>S(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:P.map(Q=>jsxRuntime.jsx(material.MenuItem,{selected:Q===I,onClick:()=>{c(Q),S(null);},sx:{fontSize:"0.82rem"},children:fu[Q]},Q))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(mu__default.default,{sx:{color:y?"common.white":"#111827",fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:y?"common.white":"#111827",fontWeight:500},children:M})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:y?"common.white":"#111827"},onClick:a,title:D,children:C}),s&&jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1,children:[jsxRuntime.jsxs(material.Box,{sx:{textAlign:"right",minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:y?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:s.name}),s.subtitle&&jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{display:"block",mt:.25,color:y?"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:s.subtitle,children:s.subtitle})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Q=>A(Q.currentTarget),sx:{p:0},children:jsxRuntime.jsx(material.Avatar,{src:s.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:s.avatarText||s.name.slice(0,1).toUpperCase()})})]}),T]})]}),s&&jsxRuntime.jsx(material.Menu,{anchorEl:w,open:X,onClose:()=>A(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(Q=>jsxRuntime.jsxs(material.MenuItem,{disabled:Q.disabled,onClick:()=>re(Q.onClick),children:[Q.icon&&jsxRuntime.jsx(material.ListItemIcon,{children:Q.icon}),jsxRuntime.jsx(material.ListItemText,{primary:Q.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},Q.key))})]})};var hu=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:o}=vd({initialCollapsed:t,content:e}),[a,r]=ct.useState(900);ct.useEffect(()=>{let i=()=>r(window.innerHeight);return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);let n=ct.useMemo(()=>Math.max(280,a-100),[a]);return {navigationIslandProps:o,navigationMaxHeight:n}};var CA=({appTitle:e,menuData:t=[],children:o,showNavigation:a=true,locale:r="en",localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,logo:f,onSearch:u,rightHeaderSlot:h,leftHeaderSlot:T,contentSx:p})=>{let v="orbcafe:page-layout-mode",[m,y]=ct.useState("system"),[x,k]=ct.useState("light"),[F,S]=ct.useState(false),w=m==="system"?F?x:"light":m;ct.useEffect(()=>{try{let P=window.localStorage.getItem(v);(P==="light"||P==="dark"||P==="system")&&y(P);}catch{}S(true);let D=window.matchMedia("(prefers-color-scheme: dark)"),I=()=>{k(D.matches?"dark":"light");};return I(),D.addEventListener("change",I),()=>D.removeEventListener("change",I)},[]),ct.useEffect(()=>{if(F)try{window.localStorage.setItem(v,m);}catch{}},[F,m]),ct.useEffect(()=>{w==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[w]);let A=ct.useMemo(()=>material.createTheme({palette:{mode:w}}),[w]),{navigationIslandProps:R,navigationMaxHeight:C}=hu({menuData:t,initialNavigationCollapsed:false});return jsxRuntime.jsx(material.ThemeProvider,{theme:A,children:jsxRuntime.jsx(Ci,{locale:r,children:jsxRuntime.jsxs(material.Box,{sx:D=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:D.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":D.palette.background.default}),children:[jsxRuntime.jsx(ks,{appTitle:e,logo:f,mode:m,onToggleMode:()=>y(D=>D==="system"?"dark":D==="dark"?"light":"system"),locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,onSearch:u,leftSlot:T,rightSlot:h}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[a&&jsxRuntime.jsx(material.Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(bd,{...R,maxHeight:C,colorMode:w})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...p},children:o})]})]})})})};var ws="(blank)",bu="Result",xu="Grand Total",vu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Cu=["sum","count","avg","min","max"];var ku=["palette","rows","columns","filters","values"];var Su=e=>ku.includes(e),wu=e=>e==="rows"||e==="columns"||e==="filters",Ts=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&Su(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&Su(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},ua=e=>e==null||e===""?ws:e instanceof Date?e.toISOString().slice(0,10):String(e),hr=e=>JSON.stringify(e),Tu=(e,t)=>{let o=e.join(""),a=t.join("");return o.localeCompare(a,void 0,{sensitivity:"base"})},V0=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},tn=(e,t,o)=>{if(o==="count")return e.length;let a=e.map(r=>V0(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)},ht=(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},ma=(e,t)=>e.length!==t.length?false:e.every((o,a)=>o===t[a]),Iu=(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 ma(n,i)})},Is=(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}),yc=e=>!e?.aggregations||e.aggregations.length===0?Cu:e.aggregations,$t=(e,t)=>{let o=yc(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},oi=(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 Du=({options:e,selectedValues:t,onChange:o,minWidth:a=96})=>{let{t:r}=j(),[n,i]=ct.useState(""),c=ct.useMemo(()=>{let l=n.trim().toLowerCase();return l?e.filter(s=>s.toLowerCase().includes(l)):e},[e,n]),d=e.length>0&&t.length===e.length;return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:a},children:jsxRuntime.jsxs(material.Select,{multiple:true,value:t,onChange:l=>{let s=l.target.value,g=typeof s=="string"?s.split(","):s;o(g);},onClick:l=>l.stopPropagation(),onMouseDown:l=>l.stopPropagation(),renderValue:l=>{let s=l;return e.length===0?r("pivot.filter.na"):s.length===0?r("common.none"):s.length===e.length?r("common.all"):`${s.length}/${e.length}`},MenuProps:{PaperProps:{sx:{maxHeight:320,bgcolor:"background.paper"}}},sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:[jsxRuntime.jsx(material.ListSubheader,{disableSticky:true,sx:l=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${l.palette.divider}`}),children:jsxRuntime.jsx(material.TextField,{size:"small",placeholder:`${r("common.search")}...`,fullWidth:true,value:n,onChange:l=>i(l.target.value),onKeyDown:l=>l.stopPropagation(),onClick:l=>l.stopPropagation(),sx:{m:0,"& .MuiInputBase-input":{fontSize:"0.75rem",py:.7}}})}),jsxRuntime.jsx(material.Box,{sx:l=>({px:1.5,py:.5,borderBottom:`1px solid ${l.palette.divider}`,bgcolor:"background.paper"}),onMouseDown:l=>{l.preventDefault(),l.stopPropagation();},onClick:l=>{l.preventDefault(),l.stopPropagation();},children:jsxRuntime.jsx(material.Button,{variant:"text",size:"small",onClick:l=>{l.preventDefault(),l.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&&jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:r("pivot.filter.noResults")}),c.map(l=>{let s=t.includes(l);return jsxRuntime.jsxs(material.MenuItem,{value:l,sx:{fontSize:"0.75rem",py:.25},children:[jsxRuntime.jsx(material.Checkbox,{size:"small",checked:s,sx:{p:.5,mr:.5}}),jsxRuntime.jsx(material.ListItemText,{primary:l,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},l)})]})})};var xc=({label:e,subtitle:t,isDragging:o,dragRef:a,listeners:r,attributes:n,style:i})=>jsxRuntime.jsx(material.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:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.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:jsxRuntime.jsx(X0__default.default,{sx:{fontSize:16,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary",lineHeight:1.2},children:t})]})]})}),Bu=({id:e,label:t,subtitle:o})=>{let{setNodeRef:a,listeners:r,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(xc,{label:t,subtitle:o,isDragging:i,dragRef:a,listeners:r,attributes:n})};var rn=({zone:e,title:t,hint:o,icon:a,children:r,itemCount:n,onClear:i})=>{let c=`container|${e}`,{isOver:d,setNodeRef:l}=core.useDroppable({id:c}),{t:s}=j();return jsxRuntime.jsxs(material.Paper,{ref:l,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:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[a,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",n,")"]})]}),n>0&&i&&jsxRuntime.jsx(material.Tooltip,{title:s("pivot.clearArea"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i,sx:{p:.25},children:jsxRuntime.jsx(tv__default.default,{sx:{fontSize:16}})})})]}),jsxRuntime.jsx(material.Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:o}),jsxRuntime.jsx(material.Box,{sx:{flex:1},children:r})]})};var Eu={xs:1.2,md:1.6},sn=({title:e,subtitle:t,collapsed:o,onToggleCollapse:a,expandAriaLabel:r,collapseAriaLabel:n,children:i,bodySx:c,unmountOnExit:d=false,headerActions:l})=>jsxRuntime.jsxs(material.Paper,{sx:s=>({borderRadius:3,border:`1px solid ${s.palette.divider}`,overflow:"hidden",bgcolor:styles.alpha(s.palette.background.paper,.95)}),children:[jsxRuntime.jsxs(material.Box,{sx:s=>({px:Eu,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:o?"none":`1px solid ${s.palette.divider}`}),children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.9rem",fontWeight:800},children:e}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[l,jsxRuntime.jsx(material.IconButton,{size:"small","aria-label":o?r:n,onClick:a,sx:s=>({border:`1px solid ${s.palette.divider}`,bgcolor:styles.alpha(s.palette.background.paper,.88),width:28,height:28,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:s.palette.mode==="dark"?styles.alpha(s.palette.primary.main,.18):styles.alpha(s.palette.primary.main,.08)}}),children:jsxRuntime.jsx(Jy__default.default,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),jsxRuntime.jsx(material.Collapse,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:jsxRuntime.jsx(material.Box,{sx:[{px:Eu,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var As=({label:e,caption:t,onRemove:o,trailing:a,isDragging:r,dragRef:n,listeners:i,attributes:c,style:d})=>jsxRuntime.jsx(material.Paper,{ref:n,style:d,sx:l=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:l.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none",opacity:r?0:1}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{...c,...i,sx:l=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.25,borderRadius:1,bgcolor:l.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)",cursor:"grab"}),children:jsxRuntime.jsx(X0__default.default,{sx:{fontSize:15,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),a,o&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l=>{l.stopPropagation(),o();},sx:{p:.2},children:jsxRuntime.jsx(qh__default.default,{sx:{fontSize:16}})})]})}),ai=({id:e,label:t,caption:o,onRemove:a,trailing:r})=>{let{setNodeRef:n,attributes:i,listeners:c,transform:d,transition:l,isDragging:s}=sortable.useSortable({id:e}),g={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:l,zIndex:s?999:"auto"};return jsxRuntime.jsx(As,{label:t,caption:o,onRemove:a,trailing:r,isDragging:s,dragRef:n,listeners:c,attributes:i,style:g})};var Es={rows:jsxRuntime.jsx(fv__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(Af__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(gv__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(Lf__default.default,{fontSize:"small"})},Nu=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:a,filterFields:r,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:l,getFilterSelectionSummary:s,renderDimensionFilterSelect:g,renderAggregationSelect:f,getAggregationLabel:u})=>{let{t:h}=j(),T=[`${h("pivot.zone.rows")} ${i.length}`,`${h("pivot.zone.columns")} ${n.length}`,`${h("pivot.zone.filters")} ${r.length}`,`${h("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsxRuntime.jsx(sn,{title:h("pivot.config.title"),subtitle:T,collapsed:e,onToggleCollapse:t,expandAriaLabel:h("pivot.collapse.ariaExpand"),collapseAriaLabel:h("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsxRuntime.jsx(rn,{zone:"palette",title:h("pivot.fieldList"),hint:h("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(X0__default.default,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxRuntime.jsxs(material.Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:h("pivot.allFieldsInUse")}),o.map(p=>jsxRuntime.jsx(Bu,{id:`item|palette|${p.id}`,label:p.label,subtitle:p.type??"string"},p.id))]})}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(rn,{zone:"filters",title:h("pivot.zone.filters"),hint:h("pivot.hint.filters"),icon:Es.filters,itemCount:r.length,onClear:()=>d("filters"),children:jsxRuntime.jsx(sortable.SortableContext,{items:r.map(p=>`item|filters|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:r.map(p=>jsxRuntime.jsx(ai,{id:`item|filters|${p}`,label:a.get(p)?.label??p,caption:s(p),trailing:g(p),onRemove:()=>l("filters",p)},p))})})}),jsxRuntime.jsx(rn,{zone:"columns",title:h("pivot.zone.columns"),hint:h("pivot.hint.columns"),icon:Es.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsxRuntime.jsx(sortable.SortableContext,{items:n.map(p=>`item|columns|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:n.map(p=>jsxRuntime.jsx(ai,{id:`item|columns|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${s(p)}`,trailing:g(p),onRemove:()=>l("columns",p)},p))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(rn,{zone:"rows",title:h("pivot.zone.rows"),hint:h("pivot.hint.rows"),icon:Es.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsxRuntime.jsx(sortable.SortableContext,{items:i.map(p=>`item|rows|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:i.map(p=>jsxRuntime.jsx(ai,{id:`item|rows|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${s(p)}`,trailing:g(p),onRemove:()=>l("rows",p)},p))})})}),jsxRuntime.jsx(rn,{zone:"values",title:h("pivot.zone.values"),hint:h("pivot.hint.values"),icon:Es.values,itemCount:c.length,onClear:()=>d("values"),children:jsxRuntime.jsx(sortable.SortableContext,{items:c.map(p=>`item|values|${p.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:c.map(p=>{let v=a.get(p.fieldId)?.label??p.fieldId,m=`${u(p.aggregation)}(${v})`;return jsxRuntime.jsx(ai,{id:`item|values|${p.tokenId}`,label:v,caption:m,trailing:f(p),onRemove:()=>l("values",p.tokenId)},p.tokenId)})})})})]})]})]})})};var Vu=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),Ou=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:a,formatSecondaryValue:r})=>{let n=styles.useTheme();if(e.length===0)return null;let i=720,c=250,d={top:20,right:24,bottom:40,left:52},l=o?e.map(p=>p.primaryValue):e.map((p,v)=>v+1),s=o?e.map(p=>p.secondaryValue??0):e.map(p=>p.primaryValue),g=Math.max(...l,1),f=Math.max(...s,1),u=i-d.left-d.right,h=c-d.top-d.bottom,T=e.map((p,v)=>{let m=o?p.primaryValue:v+1,y=o?p.secondaryValue??0:p.primaryValue,x=d.left+m/g*u,k=c-d.bottom-y/f*h;return {...p,x,y:k,rawX:m,rawY:y}});return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${i} ${c}`,sx:{width:"100%",minWidth:i,height:c},children:[jsxRuntime.jsx("line",{x1:d.left,y1:c-d.bottom,x2:i-d.right,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),jsxRuntime.jsx("line",{x1:d.left,y1:d.top,x2:d.left,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),T.map(p=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:7,fill:styles.alpha(n.palette.primary.main,.18)}),jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:4.5,fill:n.palette.primary.main,children:jsxRuntime.jsxs("title",{children:[p.name,`
|
|
195
195
|
`,o?`${t}: ${a(p.primaryValue)}`:`${t}: ${a(p.primaryValue)}`,o?`
|
|
196
|
-
${o}: ${(r??a)(p.secondaryValue??0)}`:""]})}),jsxRuntime.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)),jsxRuntime.jsx("text",{x:i/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:n.palette.text.secondary,children:o?t:"Index"}),jsxRuntime.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}),jsxRuntime.jsx("text",{x:d.left,y:d.top-4,fontSize:"10",fill:n.palette.text.secondary,children:
|
|
197
|
-
`,o,": ",r(
|
|
198
|
-
`,a,": ",(n??r)(g.item.secondaryValue??0)]})},`secondary-${g.item.name}`))]})]})}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:e.map(g=>jsxRuntime.jsxs(material.Box,{sx:b=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${styles.alpha(b.palette.divider,.7)}`,bgcolor:styles.alpha(b.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:g.name,children:g.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:r(g.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??r)(g.secondaryValue??0)})]},g.name))})]})};var gu=(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},fu=(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}}),hu=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:a})=>{if(!t)return [];let r=new Map;return e.forEach(n=>{let i=ra(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 yu=({rows:e,fieldMap:t,rowFields:o,columnFields:a,valueFields:r,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:s,onChartDimensionFieldIdChange:l,onChartPrimaryValueFieldIdChange:m,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:u,onToggleCollapse:h,getAggregationLabel:I})=>{let{t:p}=_(),C=st.useMemo(()=>gu(o,a,t),[a,t,o]),g=st.useMemo(()=>fu(r,t,I),[t,I,r]),b=g.find(v=>v.fieldId===i)??g[0],x=g.find(v=>v.fieldId===c&&v.fieldId!==b?.fieldId)??null,k=C.find(v=>v.fieldId===n)??C[0],E=k&&b?p("pivot.chart.subtitleReady",{dimension:k.label,measure:x?`${b.label} / ${x.label}`:b.label}):p("pivot.chart.subtitle"),P=st.useMemo(()=>!k||!b?[]:hu({rows:e,dimensionFieldId:k.fieldId,primaryValue:b.item,secondaryValue:x?.item}),[b,e,x,k]),S=v=>b?zn(v,b.item,t):v.toLocaleString(),M=v=>x?zn(v,x.item,t):v.toLocaleString(),T=C.length>1||g.length>1;return jsxRuntime.jsxs(Hr,{title:p("pivot.chart.title"),subtitle:E,collapsed:s,onToggleCollapse:h,expandAriaLabel:p("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:p("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[T&&jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.dimension")}),jsxRuntime.jsx(material.Select,{value:k?.fieldId??"",onChange:v=>l(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:C.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:b?.fieldId??"",onChange:v=>m(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:g.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:x?.fieldId??"",onChange:v=>f(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("common.none")}),g.filter(v=>v.fieldId!==b?.fieldId).map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.fieldId))]})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:v=>u(v.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barVertical")}),jsxRuntime.jsx(material.MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barHorizontal")}),jsxRuntime.jsx(material.MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.line")}),jsxRuntime.jsx(material.MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.scatter")})]})]})]}),jsxRuntime.jsx(material.Box,{children:k?b?P.length===0?jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoData")})}):d==="scatter"?jsxRuntime.jsx(pu,{data:P,primaryLabel:b.label,secondaryLabel:x?.label,formatPrimaryValue:S,formatSecondaryValue:M}):jsxRuntime.jsx(mu,{data:P,chartType:d,primaryLabel:b.label,secondaryLabel:x?.label,formatPrimaryValue:S,formatSecondaryValue:M}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoValue")})}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoDimension")})})})]})};var ys=({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 jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(material.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:[jsxRuntime.jsxs(material.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&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(e.key),sx:{p:.2,mr:.5,ml:-1},children:c?jsxRuntime.jsx(mf__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(jg__default.default,{sx:{fontSize:16}})}),!d&&!s&&a>0&&jsxRuntime.jsx(material.Box,{sx:{width:20}}),e.value]}),t.map(l=>jsxRuntime.jsx(material.TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:s?800:500,borderBottom:m=>`1px solid ${m.palette.divider}`,whiteSpace:"nowrap"},children:zn(i?i(e,l.id):e.aggregatedValues[l.id]??0,l.valueItem,o)},`${e.key}-${l.id}`))]}),c&&e.children.map(l=>jsxRuntime.jsx(ys,{node:l,dataColumns:t,fieldMap:o,level:a+1,expandedKeys:r,onToggle:n,getValue:i},l.key))]})};var lc=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},vs=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",cc=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",wu=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},Tu=(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,Tu(r.children,t,o+1)),o),iv=(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},SA=({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:m,defaultPresets:f,onPresetsChange:u,initialPresetId:h,onPresetApplied:I})=>{let{t:p}=_(),C=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),g=st.useRef(0),b=st.useRef(false),x=e??p("pivot.title.default"),k=n??p("pivot.empty"),E=st.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=st.useCallback(y=>E[y]??qp[y],[E]),S=st.useMemo(()=>new Set(o.map(y=>y.id)),[o]),M=st.useMemo(()=>new Map(o.map(y=>[y.id,y])),[o]),[T,v]=st.useState(()=>gt(a?.rows,S)),[D,w]=st.useState(()=>gt(a?.columns,S)),[R,F]=st.useState(()=>gt(a?.filters,S)),[$,N]=st.useState(()=>{let y=a?.values??[],A=new Set,B=[];return y.forEach(W=>{if(!S.has(W.fieldId)||A.has(W.fieldId))return;A.add(W.fieldId),g.current+=1;let Q=M.get(W.fieldId);B.push({tokenId:`v${g.current}`,fieldId:W.fieldId,aggregation:zt(W.aggregation,Q)});}),B}),[j,ie]=st.useState({}),[Y,te]=st.useState(true),[Z,Ze]=st.useState(false),[at,He]=st.useState(()=>lc(gt(a?.rows,S),gt(a?.columns,S),r?.dimensionFieldId)),[re,Ie]=st.useState(()=>{let y=(a?.values??[]).filter((A,B,W)=>S.has(A.fieldId)&&W.findIndex(Q=>Q.fieldId===A.fieldId)===B).map(A=>({tokenId:A.fieldId,fieldId:A.fieldId,aggregation:zt(A.aggregation,M.get(A.fieldId))}));return vs(y,r?.primaryValueFieldId)}),[Te,je]=st.useState(()=>{let y=(a?.values??[]).filter((B,W,Q)=>S.has(B.fieldId)&&Q.findIndex(le=>le.fieldId===B.fieldId)===W).map(B=>({tokenId:B.fieldId,fieldId:B.fieldId,aggregation:zt(B.aggregation,M.get(B.fieldId))})),A=vs(y,r?.primaryValueFieldId);return cc(y,A,r?.secondaryValueFieldId)}),[rt,Ne]=st.useState(r?.chartType??"bar-vertical"),[Ye,uo]=st.useState(c),[Gt,Ue]=st.useState(d),[Tt,At]=st.useState(()=>f??[]),[ht,H]=st.useState(""),[pe,se]=st.useState(false),[ue,Ge]=st.useState(""),[Me,ao]=st.useState(null),[mo,go]=st.useState(new Set(["__grand_total__"])),[fo,ho]=st.useState(new Set),ke=s?.rowFields??T,de=s?.columnFields??D,yt=s?.filterFields??R,Pe=s?.valueFields??$,Bt=s?.filterSelections??j,yo=s?.showGrandTotal??Y,Ba=s?.isConfiguratorCollapsed??Z,V=s?.chartDimensionFieldId??at,O=s?.chartPrimaryValueFieldId??re,U=s?.chartSecondaryValueFieldId??Te,me=s?.chartType??rt,fe=s?.isChartCollapsed??Ye,we=s?.isTableCollapsed??Gt,ce=m??Tt,Re=l||ce.length>0||!!u,ye=st.useCallback(y=>{if(s?.setRowFields){s.setRowFields(y);return}v(y);},[s]),De=st.useCallback(y=>{if(s?.setColumnFields){s.setColumnFields(y);return}w(y);},[s]),Se=st.useCallback(y=>{if(s?.setFilterFields){s.setFilterFields(y);return}F(y);},[s]),he=st.useCallback(y=>{if(s?.setValueFields){s.setValueFields(y);return}N(y);},[s]),Ce=st.useCallback(y=>{if(s?.setFilterSelections){s.setFilterSelections(y);return}ie(y);},[s]),Ft=st.useCallback(y=>{if(s?.setShowGrandTotal){s.setShowGrandTotal(y);return}te(y);},[s]),bo=st.useCallback(y=>{if(s?.setIsConfiguratorCollapsed){s.setIsConfiguratorCollapsed(y);return}Ze(y);},[s]),ut=st.useCallback(y=>{if(s?.setChartDimensionFieldId){s.setChartDimensionFieldId(y);return}He(y);},[s]),bt=st.useCallback(y=>{if(s?.setChartPrimaryValueFieldId){s.setChartPrimaryValueFieldId(y);return}Ie(y);},[s]),ro=st.useCallback(y=>{if(s?.setChartSecondaryValueFieldId){s.setChartSecondaryValueFieldId(y);return}je(y);},[s]),da=st.useCallback(y=>{if(s?.setChartType){s.setChartType(y);return}Ne(y);},[s]),ur=st.useCallback(y=>{if(s?.setIsChartCollapsed){s.setIsChartCollapsed(y);return}uo(y);},[s]),xo=st.useCallback(y=>{if(s?.setIsTableCollapsed){s.setIsTableCollapsed(y);return}Ue(y);},[s]),Ut=st.useCallback(y=>{let A=typeof y=="function"?y(ce):y;m||At(A),u?.(A);},[u,ce,m]),Fa=st.useMemo(()=>new Set([...ke,...de,...yt]),[ke,de,yt]),Go=st.useMemo(()=>o.filter(y=>!Fa.has(y.id)),[o,Fa]),Et=st.useMemo(()=>{let y=[...ke,...de,...yt],A=new Set,B=[];return y.forEach(W=>{A.has(W)||(A.add(W),B.push(W));}),B},[de,yt,ke]);st.useEffect(()=>{ye(y=>{let A=y.filter(B=>S.has(B));return na(y,A)?y:A}),De(y=>{let A=y.filter(B=>S.has(B));return na(y,A)?y:A}),Se(y=>{let A=y.filter(B=>S.has(B));return na(y,A)?y:A}),he(y=>{let A=y.filter(B=>S.has(B.fieldId)).map(B=>({...B,aggregation:zt(B.aggregation,M.get(B.fieldId))}));return is(y,A)?y:A});},[M,S]);let Kt=st.useMemo(()=>{let y={};return Et.forEach(A=>{let B=new Set;t.forEach(W=>{B.add(ra(W[A]));}),y[A]=Array.from(B).sort((W,Q)=>W.localeCompare(Q));}),y},[Et,t]);st.useEffect(()=>{Ce(y=>{let A={};return Et.forEach(B=>{let W=Kt[B]??[],le=(y[B]??[]).filter(q=>W.includes(q)),L=Object.prototype.hasOwnProperty.call(y,B);A[B]=L?le:W;}),Yp(y,A)?y:A});},[Et,Kt]),st.useEffect(()=>{ut(y=>lc(ke,de,y));},[de,ke,ut]),st.useEffect(()=>{bt(y=>vs(Pe,y));},[bt,Pe]),st.useEffect(()=>{ro(y=>cc(Pe,O,y));},[O,ro,Pe]);let Pt=st.useMemo(()=>t.filter(y=>Et.every(A=>{let B=Bt[A]??[],W=Kt[A]??[];if(B.length===W.length)return true;if(B.length===0)return false;let Q=ra(y[A]);return B.includes(Q)})),[Et,Kt,Bt,t]),Ae=st.useMemo(()=>{if(Pe.length===0)return null;let y=new Map;if(Pt.forEach(L=>{let q=de.length>0?de.map(Oe=>ra(L[Oe])):[p("pivot.valueLabel")],K=or(q);y.set(K,q);}),y.size===0){let L=de.length>0?de.map(()=>rs):[p("pivot.valueLabel")];y.set(or(L),L);}let A=Array.from(y.entries()).sort((L,q)=>Qp(L[1],q[1])),B=A.flatMap(([L,q])=>Pe.map(K=>{let Oe=M.get(K.fieldId),z=`${P(K.aggregation)} ${Oe?.label??K.fieldId}`,X=de.length===0||Pe.length>1?`${q.join(" / ")} \u2022 ${z}`:q.join(" / ");return {id:`${L}::${K.tokenId}`,colKey:L,valueItem:K,label:X}})),W=[];de.length>0&&A.forEach(([L,q])=>{let K=B.filter(X=>X.colKey===L),Oe=W,z=[];q.forEach((X,G)=>{z.push(`d${G}:${X}`);let oe=`col::${or(z)}`,Be=Oe.find(zo=>zo.key===oe);Be||(Be={key:oe,label:X,children:[],leafColumnIds:[],path:q.slice(0,G+1),depth:G},Oe.push(Be)),K.forEach(zo=>{Be.leafColumnIds.includes(zo.id)||Be.leafColumnIds.push(zo.id);}),Oe=Be.children;});});let Q=L=>{let q={};return B.forEach(K=>{let Oe=L.filter(z=>{let X=de.length>0?de.map(G=>ra(z[G])):[p("pivot.valueLabel")];return or(X)===K.colKey});q[K.id]=Nr(Oe,K.valueItem.fieldId,K.valueItem.aggregation);}),q},le=[];if(ke.length===0)le.push({key:"root",value:p("pivot.resultLabel")||Up,children:[],isLeaf:true,aggregatedValues:Q(Pt),path:[],depth:0});else {let L=(q,K,Oe)=>{if(K>=ke.length)return [];let z=ke[K],X=new Map;return q.forEach(G=>{let oe=ra(G[z]);X.has(oe)||X.set(oe,[]),X.get(oe).push(G);}),Array.from(X.keys()).sort().map(G=>{let oe=X.get(G),Be=[...Oe,G];return {key:or(Be),value:G,fieldId:z,aggregatedValues:Q(oe),children:L(oe,K+1,Be),isLeaf:K===ke.length-1,path:Be,depth:K}})};le.push(...L(Pt,0,[]));}return {dataColumns:B,columnTree:W,rowTree:le}},[de,M,Pt,P,ke,p,Pe]),Uo=st.useCallback((y,A)=>(g.current+=1,{tokenId:`v${g.current}`,fieldId:y,aggregation:zt(A,M.get(y))}),[M]),Bo=st.useCallback(y=>{if(y==="rows")return ye([]);if(y==="columns")return De([]);if(y==="filters")return Se([]);he([]);},[]),Ko=st.useCallback((y,A)=>{if(y==="rows")return ye(B=>B.filter(W=>W!==A));if(y==="columns")return De(B=>B.filter(W=>W!==A));if(y==="filters")return Se(B=>B.filter(W=>W!==A));he(B=>B.filter(W=>W.tokenId!==A));},[]),Ea=st.useCallback((y,A)=>{he(B=>B.map(W=>W.tokenId===y?{...W,aggregation:zt(A,M.get(W.fieldId))}:W));},[M]),Fo=st.useCallback(y=>{ao(String(y.active.id));},[]),La=st.useCallback(y=>{if(ao(null),!y.over)return;let A=ns(String(y.active.id)),B=ns(String(y.over.id));if(!A||!B||A.kind!=="item"||!A.key)return;if(A.zone===B.zone&&B.kind==="item"){if(A.zone==="rows"){let G=ke.indexOf(A.key),oe=ke.indexOf(B.key??"");G!==-1&&oe!==-1&&G!==oe&&ye(Be=>sortable.arrayMove(Be,G,oe));return}if(A.zone==="columns"){let G=de.indexOf(A.key),oe=de.indexOf(B.key??"");G!==-1&&oe!==-1&&G!==oe&&De(Be=>sortable.arrayMove(Be,G,oe));return}if(A.zone==="filters"){let G=yt.indexOf(A.key),oe=yt.indexOf(B.key??"");G!==-1&&oe!==-1&&G!==oe&&Se(Be=>sortable.arrayMove(Be,G,oe));return}if(A.zone==="values"){let G=Pe.findIndex(Be=>Be.tokenId===A.key),oe=Pe.findIndex(Be=>Be.tokenId===(B.key??""));G!==-1&&oe!==-1&&G!==oe&&he(Be=>sortable.arrayMove(Be,G,oe));}return}let W=B.zone,Q=[...ke],le=[...de],L=[...yt],q=[...Pe],K="",Oe=null;if(A.zone==="palette")K=A.key;else if(A.zone==="values"){let G=q.find(oe=>oe.tokenId===A.key);if(!G)return;K=G.fieldId,Oe=G,q=q.filter(oe=>oe.tokenId!==A.key);}else A.zone==="rows"?(K=A.key,Q=Q.filter(G=>G!==K)):A.zone==="columns"?(K=A.key,le=le.filter(G=>G!==K)):A.zone==="filters"&&(K=A.key,L=L.filter(G=>G!==K));if(!K)return;let z=()=>{Q=Q.filter(G=>G!==K),le=le.filter(G=>G!==K),L=L.filter(G=>G!==K);},X=G=>{if(B.kind!=="item"||!B.key)return G==="rows"?Q.length:G==="columns"?le.length:G==="filters"?L.length:G==="values"?q.length:0;if(G==="rows"){let oe=Q.indexOf(B.key);return oe>=0?oe:Q.length}if(G==="columns"){let oe=le.indexOf(B.key);return oe>=0?oe:le.length}if(G==="filters"){let oe=L.indexOf(B.key);return oe>=0?oe:L.length}if(G==="values"){let oe=q.findIndex(Be=>Be.tokenId===B.key);return oe>=0?oe:q.length}return 0};if(W==="palette"){ye(Q),De(le),Se(L),he(q);return}if(W==="values"){let G=X("values"),oe=Oe??Uo(K);q.splice(G,0,oe),ye(Q),De(le),Se(L),he(q);return}if(Xp(W)){z();let G=X(W);W==="rows"?Q.splice(G,0,K):W==="columns"?le.splice(G,0,K):L.splice(G,0,K),ye(Q),De(le),Se(L),he(q);}},[de,Uo,yt,ke,Pe]),za=st.useCallback((y,A)=>{Ce(B=>({...B,[y]:A}));},[]),Eo=st.useCallback(y=>{go(A=>{let B=new Set(A);return B.has(y)?B.delete(y):B.add(y),B});},[]),qo=st.useCallback(y=>{ho(A=>{let B=new Set(A);return B.has(y)?B.delete(y):B.add(y),B});},[]),pa=st.useCallback(y=>{let A=M.get(y.fieldId),B=jl(A);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:y.aggregation,onChange:W=>Ea(y.tokenId,W.target.value),onClick:W=>W.stopPropagation(),onMouseDown:W=>W.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:B.map(W=>jsxRuntime.jsx(material.MenuItem,{value:W,sx:{fontSize:"0.75rem"},children:P(W)},W))})})},[M,P,Ea]),Lt=st.useCallback(y=>{let A=Kt[y]??[],B=Bt[y]??A;return A.length===0?p("pivot.filter.noValues"):B.length===0?p("pivot.filter.noneSelected"):B.length===A.length?p("pivot.filter.allValues"):p("pivot.filter.selectedCount",{selected:B.length,total:A.length})},[Kt,Bt,p]),vo=st.useCallback(y=>{let A=Kt[y]??[],B=Bt[y]??A;return jsxRuntime.jsx(tu,{options:A,selectedValues:B,onChange:W=>za(y,W)})},[Kt,Bt,za]),_o=st.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),no=st.useCallback(()=>{let y={};return new Set([...Et,...Object.keys(Bt)]).forEach(B=>{if(!S.has(B))return;let W=Bt[B]??[];y[B]=[...W];}),{layout:{rows:[...ke],columns:[...de],filters:[...yt],values:Pe.map(B=>({fieldId:B.fieldId,aggregation:B.aggregation}))},filterSelections:y,showGrandTotal:yo,chart:{dimensionFieldId:V,primaryValueFieldId:O,secondaryValueFieldId:U,chartType:me}}},[Et,V,O,U,me,de,yt,Bt,ke,yo,S,Pe]),Lo=st.useCallback(y=>{let A=gt(y.layout.rows,S),B=gt(y.layout.columns,S),W=gt(y.layout.filters,S),Q=new Set,le=(y.layout.values??[]).filter(K=>!S.has(K.fieldId)||Q.has(K.fieldId)?false:(Q.add(K.fieldId),true)).map(K=>Uo(K.fieldId,K.aggregation)),L={};Object.entries(y.filterSelections??{}).forEach(([K,Oe])=>{!S.has(K)||!Array.isArray(Oe)||(L[K]=Array.from(new Set(Oe.map(z=>String(z)))));}),ye(A),De(B),Se(W),he(le),Ce(L),typeof y.showGrandTotal=="boolean"&&Ft(y.showGrandTotal),ut(lc(A,B,y.chart?.dimensionFieldId));let q=vs(le,y.chart?.primaryValueFieldId);bt(q),ro(cc(le,q,y.chart?.secondaryValueFieldId)),da(y.chart?.chartType??"bar-vertical"),H(y.id),I?.(y);},[Uo,I,ut,bt,ro,da,De,Se,Ce,ye,Ft,he,S]),Na=st.useCallback(y=>{if(!y){H("");return}let A=ce.find(B=>B.id===y);if(!A){H("");return}Lo(A);},[Lo,ce]),mr=st.useCallback(()=>{let y=p("pivot.preset.defaultName",{index:ce.length+1});Ge(y),se(true);},[ce.length,p]),ua=st.useCallback(()=>{let y=ue.trim();if(!y)return;let A={id:_o(),name:y,...no()};Ut(B=>[...B,A]),H(A.id),se(false);},[no,_o,ue,Ut]),Va=st.useCallback(()=>{ht&&(Ut(y=>y.filter(A=>A.id!==ht)),H(""));},[ht,Ut]);st.useEffect(()=>{if(!h||b.current)return;let y=ce.find(A=>A.id===h);y&&(b.current=true,Lo(y));},[Lo,h,ce]),st.useEffect(()=>{ht&&(ce.some(y=>y.id===ht)||H(""));},[ht,ce]);let Zo=st.useMemo(()=>{if(!yo||!Ae||!ke.length)return null;let y={};return Ae.dataColumns.forEach(A=>{let B=Pt.filter(W=>{let Q=de.length>0?de.map(le=>ra(W[le])):[p("pivot.valueLabel")];return or(Q)===A.colKey});y[A.id]=Nr(B,A.valueItem.fieldId,A.valueItem.aggregation);}),{key:"__grand_total__",value:p("pivot.grandTotal")||Kp,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:y,path:[],depth:-1}},[yo,Ae,Pt,de,ke.length,p]),Ot=st.useMemo(()=>wu(Ae?.rowTree??[]),[Ae]),Co=st.useMemo(()=>wu(Ae?.columnTree??[]),[Ae]);st.useEffect(()=>{go(y=>{let A=new Set;return y.has("__grand_total__")&&A.add("__grand_total__"),Ot.forEach(B=>{y.has(B)&&A.add(B);}),A});},[Ot]),st.useEffect(()=>{ho(y=>{let A=new Set;return Co.forEach(B=>{y.has(B)&&A.add(B);}),A});},[Co]);let gr=st.useCallback(()=>{go(y=>{let A=new Set(y);return Ot.forEach(B=>A.add(B)),A});},[Ot]),Oa=st.useCallback(()=>{go(y=>{let A=new Set;return y.has("__grand_total__")&&A.add("__grand_total__"),A});},[]),fr=st.useCallback(()=>{ho(new Set(Co));},[Co]),hr=st.useCallback(()=>{ho(new Set);},[]),yr=st.useMemo(()=>!Ae||de.length===0?[]:iv(Ae.columnTree,fo),[de.length,fo,Ae]),qt=st.useMemo(()=>{if(!Ae)return [];if(de.length===0)return Ae.dataColumns.map(A=>({id:A.id,label:A.label,leafColumnIds:[A.id],valueItem:A.valueItem}));let y=new Map(Ae.dataColumns.map(A=>[A.id,A]));return yr.flatMap(A=>{let B=new Map;return A.leafColumnIds.forEach(W=>{let Q=y.get(W);if(!Q)return;let le=Q.valueItem.tokenId,L=`${P(Q.valueItem.aggregation)} ${M.get(Q.valueItem.fieldId)?.label??Q.valueItem.fieldId}`,q=B.get(le);if(q){q.leafColumnIds.push(W);return}B.set(le,{id:`${A.key}::${le}`,label:Pe.length>1?L:A.label,leafColumnIds:[W],valueItem:Q.valueItem});}),Array.from(B.values())})},[de.length,M,P,Ae,Pe.length,yr]),br=st.useMemo(()=>new Map(qt.map(y=>[y.id,y])),[qt]),xr=st.useMemo(()=>qt.map(y=>({id:y.id,colKey:y.id,valueItem:y.valueItem,label:y.label})),[qt]),Wa=st.useMemo(()=>{if(!Ae||de.length===0)return [];let y=[],A=Tu(Ae.columnTree,fo),B=A+(Pe.length>1?1:0),W=(Q,le)=>{y[le]??(y[le]=[]),Q.forEach(L=>{let q=L.children.length>0&&fo.has(L.key),K=qt.filter(z=>L.leafColumnIds.some(X=>z.leafColumnIds.includes(X))).length,Oe=q||Pe.length>1?1:B-le;y[le].push({key:L.key,label:L.label,colSpan:K,rowSpan:Oe,expandable:L.children.length>0,expanded:q}),q&&W(L.children,le+1);});};return W(Ae.columnTree,0),Pe.length>1&&(y[A]=qt.map(Q=>({key:Q.id,label:Q.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),y},[de.length,fo,Ae,Pe.length,qt]),jo=st.useCallback((y,A)=>A.leafColumnIds.reduce((B,W)=>B+(y.aggregatedValues[W]??0),0),[]),ma=st.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:gr,disabled:Ot.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Oa,disabled:Ot.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseRowsAll")}),jsxRuntime.jsx(material.Divider,{orientation:"vertical",flexItem:true}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:fr,disabled:Co.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:hr,disabled:de.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseColumnsAll")})]}),[de.length,Co.size,Ot.size,hr,Oa,fr,gr,p]),ga=()=>{if(!Me)return null;let y=ns(Me);if(!y||y.kind!=="item"||!y.key)return null;if(y.zone==="palette"){let Q=M.get(y.key);return Q?jsxRuntime.jsx(Ql,{label:Q.label,subtitle:Q.type}):null}if(y.zone==="values"){let Q=Pe.find(K=>K.tokenId===y.key);if(!Q)return null;let L=M.get(Q.fieldId)?.label??Q.fieldId,q=`${P(Q.aggregation)}(${L})`;return jsxRuntime.jsx(ps,{label:L,caption:q})}let B=M.get(y.key)?.label??y.key,W=Lt(y.key);return jsxRuntime.jsx(ps,{label:B,caption:W})};return jsxRuntime.jsxs(material.Paper,{sx:y=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${y.palette.divider}`,bgcolor:"background.paper",boxShadow:y.palette.mode==="dark"?"none":"0 12px 28px rgba(15, 23, 42, 0.08)",display:"flex",flexDirection:"column",gap:2}),children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800},children:x}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:p("pivot.subtitle.default")})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[Re&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:200},children:jsxRuntime.jsxs(material.Select,{value:ht,displayEmpty:true,onChange:y=>Na(String(y.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("pivot.preset.selectPlaceholder")}),ce.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y.id,sx:{fontSize:"0.75rem"},children:y.name},y.id))]})}),jsxRuntime.jsx(material.Tooltip,{title:p("pivot.preset.save"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:mr,"aria-label":p("pivot.preset.save"),children:jsxRuntime.jsx(Xd__default.default,{sx:{fontSize:18}})})}),jsxRuntime.jsx(material.Tooltip,{title:p("pivot.preset.delete"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Va,disabled:!ht,"aria-label":p("pivot.preset.delete"),children:jsxRuntime.jsx(Q0__default.default,{sx:{fontSize:18}})})})}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"})]}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[p("pivot.records"),": ",jsxRuntime.jsx("strong",{children:t.length.toLocaleString()})," / ",p("pivot.afterFilter"),":"," ",jsxRuntime.jsx("strong",{children:Pt.length.toLocaleString()})]}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem"},children:p("pivot.grandTotal")}),jsxRuntime.jsx(material.Switch,{size:"small",checked:yo,onChange:y=>Ft(y.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:C,collisionDetection:core.closestCenter,onDragStart:Fo,onDragEnd:La,children:[jsxRuntime.jsx(cu,{isConfiguratorCollapsed:Ba,onToggleCollapse:()=>bo(y=>!y),availableFields:Go,fieldMap:M,filterFields:yt,columnFields:de,rowFields:ke,valueFields:Pe,clearZone:Bo,removeFieldFromZone:Ko,getFilterSelectionSummary:Lt,renderDimensionFilterSelect:vo,renderAggregationSelect:pa,getAggregationLabel:P}),jsxRuntime.jsx(material.Portal,{children:jsxRuntime.jsx(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:ga()})})]}),jsxRuntime.jsx(yu,{rows:Pt,fieldMap:M,rowFields:ke,columnFields:de,valueFields:Pe,chartDimensionFieldId:V,chartPrimaryValueFieldId:O,chartSecondaryValueFieldId:U,chartType:me,isCollapsed:fe,onChartDimensionFieldIdChange:y=>ut(y),onChartPrimaryValueFieldIdChange:y=>bt(y),onChartSecondaryValueFieldIdChange:y=>ro(y),onChartTypeChange:y=>da(y),onToggleCollapse:()=>ur(y=>!y),getAggregationLabel:P}),jsxRuntime.jsx(Hr,{title:p("pivot.table.sectionTitle"),subtitle:ke.length>0?ke.map(y=>M.get(y)?.label??y).join(" > "):p("pivot.table.dimensions"),collapsed:we,onToggleCollapse:()=>xo(y=>!y),expandAriaLabel:p("pivot.table.collapse.ariaExpand"),collapseAriaLabel:p("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:ma,children:Ae===null?jsxRuntime.jsx(material.Box,{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:k})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(Wa.length>0?Wa:[[]]).map((y,A)=>jsxRuntime.jsxs(material.TableRow,{children:[A===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(Wa.length,1),sx:B=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:B.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${B.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:ke.length>0?ke.map(B=>M.get(B)?.label).join(" > "):p("pivot.table.dimensions")}),(y.length>0?y:qt.map(B=>({key:B.id,label:B.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(B=>jsxRuntime.jsx(material.TableCell,{align:"center",colSpan:B.colSpan,rowSpan:B.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:jsxRuntime.jsxs(material.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[B.expandable&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>qo(B.key),sx:{p:.1,ml:-0.3},children:B.expanded?jsxRuntime.jsx(mf__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(jg__default.default,{sx:{fontSize:16}})}),jsxRuntime.jsx(material.Box,{component:"span",children:B.label})]})},B.key))]},`pivot-header-row-${A}`))}),jsxRuntime.jsxs(material.TableBody,{children:[Ae.rowTree.map(y=>jsxRuntime.jsx(ys,{node:y,dataColumns:xr,fieldMap:M,level:0,expandedKeys:mo,onToggle:Eo,getValue:(A,B)=>{let W=br.get(B);return W?jo(A,W):0}},y.key)),Zo&&jsxRuntime.jsx(ys,{node:Zo,dataColumns:xr,fieldMap:M,level:0,expandedKeys:mo,onToggle:Eo,getValue:(y,A)=>{let B=br.get(A);return B?jo(y,B):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:pe,onClose:()=>se(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:p("pivot.preset.saveDialogTitle")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsx(material.TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:p("pivot.preset.nameLabel"),value:ue,onChange:y=>Ge(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),ua());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>se(false),children:p("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:ua,disabled:!ue.trim(),children:p("common.save")})]})]})]})};var Pu=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},pc=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Ru=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",RA=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:a=true,initialConfiguratorCollapsed:r=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=st.useRef(0),s=st.useMemo(()=>new Set(e.map(H=>H.id)),[e]),l=st.useMemo(()=>new Map(e.map(H=>[H.id,H])),[e]),[m,f]=st.useState(()=>gt(t?.rows,s)),[u,h]=st.useState(()=>gt(t?.columns,s)),[I,p]=st.useState(()=>gt(t?.filters,s)),[C,g]=st.useState(()=>{let H=t?.values??[],pe=new Set,se=[];return H.forEach(ue=>{!s.has(ue.fieldId)||pe.has(ue.fieldId)||(pe.add(ue.fieldId),d.current+=1,se.push({tokenId:`v${d.current}`,fieldId:ue.fieldId,aggregation:zt(ue.aggregation,l.get(ue.fieldId))}));}),se}),[b,x]=st.useState(o),[k,E]=st.useState(a),[P,S]=st.useState(r),[M,T]=st.useState(()=>Pu(gt(t?.rows,s),gt(t?.columns,s),n?.dimensionFieldId)),[v,D]=st.useState(()=>{let H=(()=>{let pe=t?.values??[],se=new Set,ue=[];return pe.forEach(Ge=>{!s.has(Ge.fieldId)||se.has(Ge.fieldId)||(se.add(Ge.fieldId),ue.push({tokenId:Ge.fieldId,fieldId:Ge.fieldId,aggregation:zt(Ge.aggregation,l.get(Ge.fieldId))}));}),ue})();return pc(H,n?.primaryValueFieldId)}),[w,R]=st.useState(()=>{let H=(()=>{let se=t?.values??[],ue=new Set,Ge=[];return se.forEach(Me=>{!s.has(Me.fieldId)||ue.has(Me.fieldId)||(ue.add(Me.fieldId),Ge.push({tokenId:Me.fieldId,fieldId:Me.fieldId,aggregation:zt(Me.aggregation,l.get(Me.fieldId))}));}),Ge})(),pe=pc(H,n?.primaryValueFieldId);return Ru(H,pe,n?.secondaryValueFieldId)}),[F,$]=st.useState(n?.chartType??"bar-vertical"),[N,j]=st.useState(i),[ie,Y]=st.useState(c);st.useEffect(()=>{f(H=>{let pe=H.filter(se=>s.has(se));return na(H,pe)?H:pe}),h(H=>{let pe=H.filter(se=>s.has(se));return na(H,pe)?H:pe}),p(H=>{let pe=H.filter(se=>s.has(se));return na(H,pe)?H:pe}),g(H=>{let pe=H.filter(se=>s.has(se.fieldId)).map(se=>({...se,aggregation:zt(se.aggregation,l.get(se.fieldId))}));return is(H,pe)?H:pe});},[l,s]),st.useEffect(()=>{T(H=>Pu(m,u,H));},[u,m]),st.useEffect(()=>{D(H=>pc(C,H));},[C]),st.useEffect(()=>{R(H=>Ru(C,v,H));},[v,C]);let te=st.useCallback(H=>{f(gt(H,s));},[s]),Z=st.useCallback(H=>{h(gt(H,s));},[s]),Ze=st.useCallback(H=>{p(gt(H,s));},[s]),at=st.useCallback(H=>{g(pe=>{let se=H??[],ue=new Set,Ge=[];return se.forEach(Me=>{if(!s.has(Me.fieldId)||ue.has(Me.fieldId))return;ue.add(Me.fieldId);let ao=pe.find(mo=>mo.fieldId===Me.fieldId);if(ao){Ge.push({...ao,aggregation:zt(Me.aggregation??ao.aggregation,l.get(Me.fieldId))});return}d.current+=1,Ge.push({tokenId:`v${d.current}`,fieldId:Me.fieldId,aggregation:zt(Me.aggregation,l.get(Me.fieldId))});}),Ge});},[l,s]),He=st.useCallback(H=>{te(H.rows??[]),Z(H.columns??[]),Ze(H.filters??[]),at(H.values??[]);},[Z,Ze,te,at]),re=st.useCallback(H=>{if(H==="rows")return f([]);if(H==="columns")return h([]);if(H==="filters")return p([]);g([]);},[]),Ie=st.useCallback((H,pe)=>{if(H==="rows")return f(se=>se.filter(ue=>ue!==pe));if(H==="columns")return h(se=>se.filter(ue=>ue!==pe));if(H==="filters")return p(se=>se.filter(ue=>ue!==pe));g(se=>se.filter(ue=>ue.tokenId!==pe));},[]),Te=st.useCallback((H,pe)=>{g(se=>se.map(ue=>ue.tokenId===H?{...ue,aggregation:zt(pe,l.get(ue.fieldId))}:ue));},[l]),je=st.useCallback((H,pe)=>{x(se=>({...se,[H]:pe}));},[]),rt=st.useCallback(()=>{x({});},[]),Ne=st.useCallback(()=>{E(H=>!H);},[]),Ye=st.useCallback(()=>{S(H=>!H);},[]),uo=st.useCallback(H=>{T(H);},[]),Gt=st.useCallback(H=>{D(H);},[]),Ue=st.useCallback(H=>{R(H);},[]),Tt=st.useCallback(()=>{j(H=>!H);},[]),At=st.useCallback(()=>{Y(H=>!H);},[]);return {model:st.useMemo(()=>({rowFields:m,setRowFields:f,columnFields:u,setColumnFields:h,filterFields:I,setFilterFields:p,valueFields:C,setValueFields:g,filterSelections:b,setFilterSelections:x,showGrandTotal:k,setShowGrandTotal:E,isConfiguratorCollapsed:P,setIsConfiguratorCollapsed:S,chartDimensionFieldId:M,setChartDimensionFieldId:T,chartPrimaryValueFieldId:v,setChartPrimaryValueFieldId:D,chartSecondaryValueFieldId:w,setChartSecondaryValueFieldId:R,chartType:F,setChartType:$,isChartCollapsed:N,setIsChartCollapsed:j,isTableCollapsed:ie,setIsTableCollapsed:Y}),[M,v,w,F,u,I,b,N,P,ie,m,k,C]),actions:{setRows:te,setColumns:Z,setFilters:Ze,setValues:at,setLayout:He,clearZone:re,removeFieldFromZone:Ie,setAggregationForValue:Te,setFilterSelection:je,resetFilterSelections:rt,toggleGrandTotal:Ne,toggleConfigurator:Ye,setChartDimension:uo,setChartPrimaryValue:Gt,setChartSecondaryValue:Ue,setChartType:$,toggleChart:Tt,toggleTable:At}}};var FA=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let a=styles.useTheme(),r=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),n=material.useMediaQuery(a.breakpoints.down("md"),{noSsr:true}),i=st.useMemo(()=>e==="auto"?r||n?"portrait":"landscape":e,[n,r,e]),[c,d]=st.useState(t??i==="landscape");st.useEffect(()=>{d(t??i==="landscape");},[t,i]);let s=m=>{d(m),o?.(m);};return {resolvedOrientation:i,isPortraitViewport:r,isCompactViewport:n,navigationOpen:c,setNavigationOpen:s,toggleNavigationOpen:()=>s(!c)}};var mv=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},zA=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:a})=>{let n=e[0]?.[t],[i,c]=st.useState(a??n),d=st.useMemo(()=>e.find(u=>u[t]===i)||e[0],[t,e,i]),[s,l]=st.useState(()=>{let u=d?.[o];return u==null?"0":String(u)});return {selectedId:i,selectedRecord:d,editorValue:s,setEditorValue:l,selectRecord:u=>{let h=u[t];c(h);let I=u[o];l(I==null?"0":String(I));},applyEditorValue:u=>{if(i===void 0)return;let h=mv(s),I=e.map(p=>p[t]===i?{...p,[o]:h}:p);u(I);}}};var wv=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Eu=(e,t,o,a)=>{t?.(e),a&&o?.();},HA=({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=wv,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:s="Use code",cancelLabel:l="Close",manualPlaceholder:m="Enter barcode manually",onDetected:f,onError:u,sx:h})=>{let I=st__namespace.default.useRef(null),p=st__namespace.default.useRef(null),C=st__namespace.default.useRef(null),g=st__namespace.default.useRef(null),[b,x]=st__namespace.default.useState("idle"),[k,E]=st__namespace.default.useState(""),[P,S]=st__namespace.default.useState(null),[M,T]=st__namespace.default.useState(null),v=st__namespace.default.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null),p.current&&(p.current.getTracks().forEach(R=>R.stop()),p.current=null),I.current&&(I.current.srcObject=null);},[]),D=st__namespace.default.useCallback(R=>{T(R),x("error"),u?.(R);},[u]);st__namespace.default.useEffect(()=>{if(!e){v(),x("idle"),T(null),E("");return}let R=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 $=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(R){$.getTracks().forEach(N=>N.stop());return}if(p.current=$,I.current&&(I.current.srcObject=$,await I.current.play()),!window.BarcodeDetector){x("unsupported"),T("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}g.current=new window.BarcodeDetector({formats:r}),x("ready"),C.current=window.setInterval(async()=>{if(!(!I.current||!g.current)&&!(I.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let j=(await g.current.detect(I.current)).find(Y=>Y.rawValue);if(!j?.rawValue)return;let ie={rawValue:j.rawValue,format:j.format};S(ie),v(),Eu(ie,f,t,c);}catch(N){D(N instanceof Error?N.message:"Failed to detect barcode.");}},d);}catch($){D($ instanceof Error?$.message:"Unable to start camera.");}}})(),()=>{R=true,v();}},[c,n,r,t,f,e,D,d,v]);let w=()=>{let R=k.trim();if(!R)return;let F={rawValue:R,format:"manual"};S(F),Eu(F,f,t,c);};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:900},children:o}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2,sx:h,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:a}),jsxRuntime.jsxs(material.Paper,{elevation:0,sx:R=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:R.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:[jsxRuntime.jsx("video",{ref:I,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),jsxRuntime.jsx(material.Box,{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.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:jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"#38bdf8",boxShadow:"0 0 18px rgba(56,189,248,0.85)"}})})}),jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(kv__default.default,{}),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?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(Sv__default.default,{}),label:`${P.format||"barcode"}: ${P.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),M?jsxRuntime.jsx(material.Alert,{severity:b==="unsupported"?"info":"warning",children:M}):null,i?jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsxRuntime.jsx(material.TextField,{fullWidth:true,label:"Barcode",placeholder:m,value:k,onChange:R=>E(R.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:w,sx:{minHeight:56,px:2.5},children:s})]}):null]})}),jsxRuntime.jsx(material.DialogActions,{sx:{px:3,pb:2},children:jsxRuntime.jsx(material.Button,{onClick:t,children:l})})]})};var Rv={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},ZA=({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:m=88,startAction:f,endAction:u,dragHandleProps:h,onClick:I,onSwipe:p,sx:C})=>{let[g,b]=st.useState(0),[x,k]=st.useState(false),E=st.useRef(null),P=st.useRef(0),S=st.useRef(0),M=!!(f||u),T=132,v=()=>{b(0),k(false),E.current=null,P.current=0,S.current=0;},D=N=>{(N==="start"?f:u)?.onTrigger?.(),p?.(N),v();},w=N=>{!M||N.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(E.current=N.pointerId,P.current=N.clientX,S.current=N.clientX,k(true),N.currentTarget.setPointerCapture(N.pointerId));},R=N=>{if(!x||E.current!==N.pointerId)return;S.current=N.clientX;let j=S.current-P.current,ie=Math.max(-T,Math.min(T,j));b(ie);},F=N=>{if(!x||E.current!==N.pointerId)return;let j=S.current-P.current;if(j>=m&&f){D("start");return}if(j<=-m&&u){D("end");return}Math.abs(j)<12&&I?.(),v();},$=(N,j)=>{if(!N)return null;let ie=N.backgroundColor||Rv[N.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[j]:0,width:T,px:2,display:"flex",alignItems:"center",justifyContent:j==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${ie}, rgba(15,23,42,0.92))`},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[N.icon,jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:N.label})]})})};return jsxRuntime.jsxs(material.Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...C},children:[$(f,"left"),$(u,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:w,onPointerMove:R,onPointerUp:F,onPointerCancel:v,sx:N=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:N.palette.mode==="dark"?"linear-gradient(180deg, rgba(30,41,59,0.96), rgba(15,23,42,0.92))":"linear-gradient(180deg, #ffffff, #f8fafc)",color:"text.primary",boxShadow:d?"0 18px 42px rgba(37, 99, 235, 0.18)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${g}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:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[a?jsxRuntime.jsx(material.Box,{sx:{mt:.25},children:a}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:e}),t?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:t}):null]}),s?jsxRuntime.jsx(material.Box,{"data-no-swipe":"true",...h,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsxRuntime.jsx(material.IconButton,{size:"small",children:jsxRuntime.jsx(Pv__default.default,{})})}):null]}),r.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((N,j)=>jsxRuntime.jsx(material.Chip,{label:N,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},j))}):null,n.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(N=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:N.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:N.value})]},N.id))}):null,c,i]})})]})};var qn=({label:e,onPress:t,emphasis:o="default"})=>jsxRuntime.jsx(material.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}),aB=({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:m,onSubmit:f,onClose:u,sx:h})=>{let{t:I}=_(),[p,C]=st.useState(t),g=e??p,b=v=>{e===void 0&&C(v),m?.(v);},x=v=>{c&&g.length>=c||b(`${g}${v}`);},k=v=>{if(v==="00"){if(!g){b("0");return}x("00");return}x(v);},E=()=>{!n||g.includes(".")||b(g?`${g}.`:"0.");},P=()=>{if(i){if(g.startsWith("-")){b(g.slice(1));return}b(g?`-${g}`:"-");}},S=()=>{b(g.slice(0,-1));},M=()=>{b("");},T=()=>{f?.(g);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...h},children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,a?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:a}):null]}),u?jsxRuntime.jsx(material.IconButton,{onClick:u,size:"small",children:jsxRuntime.jsx(Bv__default.default,{})}):null]}),jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{sx:{minHeight:38,fontSize:g?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:g?"text.primary":"text.disabled"},children:g||r})}),jsxRuntime.jsxs(material.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=>jsxRuntime.jsx(qn,{label:v,onPress:()=>k(v)},v)),jsxRuntime.jsx(qn,{label:i?"+/-":"00",onPress:i?P:()=>k("00")}),jsxRuntime.jsx(qn,{label:"0",onPress:()=>k("0")}),jsxRuntime.jsx(qn,{label:n?".":l?String(l):"DEL",onPress:n?E:S})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:S,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(Av__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:l||"DEL"})]})}),jsxRuntime.jsx(qn,{label:String(s||"CLR"),onPress:M,emphasis:"danger"}),jsxRuntime.jsx(material.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:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(Fv__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||I("common.ok")})]})})]})]})})};var Ou=({touchMode:e="comfortable",sx:t,...o})=>{let a=e==="expanded";return jsxRuntime.jsx(material.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:jsxRuntime.jsx(ja,{...o})})};var Wv=(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);}},Hu=({items:e,selectedId:t,orientation:o="auto",onItemSelect:a,sx:r})=>{let n=styles.useTheme(),[i,c]=st.useState(false);st.useEffect(()=>{c(true);},[]);let d=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),s=material.useMediaQuery(n.breakpoints.down("md"),{noSsr:true}),l=o==="auto"?d||s?"portrait":"landscape":o,m=navigation.useRouter();return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:!i||l==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...r},children:e.map(f=>{let u=f.id===t,h=f.color||(u?n.palette.primary.main:n.palette.divider);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:u?"primary.main":"divider",boxShadow:u?"0 18px 40px rgba(37, 99, 235, 0.16)":"none",bgcolor:n.palette.mode==="dark"?"rgba(30,41,59,0.6)":"background.paper"},children:jsxRuntime.jsx(material.Box,{component:"button",type:"button",disabled:f.disabled,onClick:()=>Wv(m,f,a),sx:{width:"100%",p:2,minHeight:l==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:f.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,sx:{height:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsx(material.Box,{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:u?"#fff":"text.primary",background:u?h:"action.hover"},children:f.icon||jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900},children:f.title.slice(0,1).toUpperCase()})}),f.badge!==void 0?jsxRuntime.jsx(material.Box,{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:u?"primary.main":"action.hover",color:u?"#fff":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:f.badge}):null]}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:f.title}),f.caption?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:f.caption}):null,f.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:f.description}):null]})]})})},f.id)})})};var qu=(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?qu(a.children,t):[];return (r||n.length>0)&&o.push({...a,children:n.length>0?n:a.children}),o},[]):e,Jv=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children?.length&&(t.add(r.id),o(r.children));});};return o(e),t},_u=({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:m}=_(),f=styles.useTheme(),u=material.useMediaQuery("(orientation: portrait)"),h=material.useMediaQuery(f.breakpoints.down("md")),I=i==="auto"?u||h?"portrait":"landscape":i,p=n==="dark",C=navigation.useRouter(),g=navigation.usePathname(),[b,x]=st.useState(""),[k,E]=st.useState(new Set),P=st.useMemo(()=>qu(r,b),[r,b]),S=st.useMemo(()=>b.trim()?Jv(P):k,[k,P,b]);st.useEffect(()=>{e&&E(new Set);},[e]);let M=R=>R.appurl||R.href||"",T=R=>{l?.(R);let F=M(R);if(F){if(F.startsWith("http://")||F.startsWith("https://")){window.open(F,"_blank");return}C.push(F);}},v=R=>{let F=!!R.children?.length;if(e&&F){t?.();return}if(F){E($=>{let N=new Set($);return N.has(R.id)?N.delete(R.id):N.add(R.id),N});return}T(R);},D=R=>{let F=s||g,$=M(R);return !!($&&F===$)},w=(R,F=0)=>{let $=!!R.children?.length,N=S.has(R.id),j=D(R);return jsxRuntime.jsx(material.Box,{sx:{pl:F===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:j?"primary.main":"divider",bgcolor:j?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>v(R),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:[jsxRuntime.jsx(material.Avatar,{variant:"rounded",sx:{width:40,height:40,bgcolor:j?"primary.main":"action.hover",color:j?"#fff":"text.primary"},children:R.icon||(R.title||R.label||"?").slice(0,1).toUpperCase()}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:R.title||R.label}),R.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:R.description}):null]}),$?jsxRuntime.jsx(Qv__default.default,{sx:{transform:N?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(Yv__default.default,{color:"action"})]}),$?jsxRuntime.jsx(material.Collapse,{in:N,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:R.children?.map(ie=>w(ie,F+1))})}):null]})},R.id)};return e?jsxRuntime.jsx(material.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:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:m("navigation.expand"),children:jsxRuntime.jsx(Xv__default.default,{})}),r.map(R=>jsxRuntime.jsx(material.IconButton,{onClick:()=>v(R),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:D(R)?"primary.main":"action.hover",color:D(R)?"#fff":"text.primary"},children:R.icon||(R.title||R.label||"?").slice(0,1).toUpperCase()},R.id))]})}):jsxRuntime.jsx(material.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:jsxRuntime.jsxs(material.Stack,{spacing:1.25,sx:{flex:1,minHeight:0},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsxRuntime.jsx(material.TextField,{value:b,onChange:R=>x(R.target.value),placeholder:m("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(Zv__default.default,{fontSize:"small",color:"action"})}}),I==="landscape"&&!e?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(jv__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:P.length>0?P.map(R=>w(R)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:m("navigation.noMatch")})}),d]})})};var tm=(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)},nC=e=>st__namespace.default.isValidElement(e)?jsxRuntime.jsx(material.Box,{sx:{display:"inline-flex",alignItems:"center"},children:e}):jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:e}),iC=(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)},sC=({summaryRow:e,visibleColumns:t,columns:o})=>{let a=o.filter(r=>t.includes(r.id)&&e[r.id]!=="");return a.length===0?null:jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:a.map(r=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:r.label}),jsxRuntime.jsx(material.Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[r.id]})]},`summary-${r.id}`))})]})})},lC=e=>{let{t}=_(),o=styles.useTheme(),{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:s,fitContainer:l=false,fullWidth:m=false,maxHeight:f,loading:u=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:I,filterConfig:p,rowKey:C,tableKey:g="default",graphReport:b,quickCreate:x,quickEdit:k,quickDelete:E,serviceUrl:P,orientation:S="auto",cardTitleField:M,cardSubtitleFields:T,toolbarSlot:v,emptyState:D,rowHeight:w="comfortable",cardActionSlot:R,renderCardFooter:F,onRowClick:$}=e,N=a||t("table.title.default"),j=material.useMediaQuery("(orientation: portrait)"),ie=material.useMediaQuery(o.breakpoints.down("md")),Y=S==="auto"?j||ie?"portrait":"landscape":S,{columns:te,filterText:Z,setFilterText:Ze,visibleColumns:at,showSummary:He,setShowSummary:re,summaryColumns:Ie,grouping:Te,setGrouping:je,expandedGroups:rt,groupAnchorEl:Ne,setGroupAnchorEl:Ye,summaryAnchorEl:uo,setSummaryAnchorEl:Gt,anchorEl:Ue,setAnchorEl:Tt,contextMenu:At,sortedAndFilteredRows:ht,summaryRow:H,visibleRows:pe,page:se,setPage:ue,rowsPerPage:Ge,setRowsPerPage:Me,totalDisplayCount:ao,setSelected:mo,handleClick:go,toggleSummaryColumn:fo,handleExport:ho,handleCloseContextMenu:ke,toggleColumnVisibility:de,toggleGroupExpand:yt,toggleGroupField:Pe,handleExpandGroupRecursively:Bt,handleCollapseGroupRecursively:yo,handleLayoutLoad:Ba,handleVariantLoad:V,handleLayoutSave:O,effectiveAppId:U,currentLayoutData:me,currentLayoutId:fe,layoutIdToLoad:we,graphReportOpen:ce,handleOpenGraphReport:Re,handleCloseGraphReport:ye}=Vi(e),De=b?.enabled??false,Se=De&&(b?.interaction?.enabled??true),he=Ii(),Ce=C||"id",Ft=st__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:styles.alpha(o.palette.divider,o.palette.mode==="dark"?.55:.3),bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.common.white,.06):styles.alpha(o.palette.background.paper,.92),color:o.palette.text.primary,"& .MuiChip-label":{px:1.05}}),[o]),bo=st__namespace.default.useMemo(()=>({...Ft,borderColor:styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.42:.24),bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.primary.main,.16):styles.alpha(o.palette.primary.main,.08)}),[Ft,o]),ut=st__namespace.default.useMemo(()=>{let z=new Set(i);return ht.filter(X=>z.has(X?.[Ce]))},[Ce,i,ht]),bt=ut.length===1?ut[0]:null,ro=!!x?.enabled,da=!!k?.enabled,ur=!!E?.enabled,xo=x?.fields,Ut=x?.excludeFields||[],Fa=x?.initialValues||{},Go=k?.fields,Et=k?.excludeFields||[],Kt=k?.editableFields||[],Pt=k?.nonEditableFields||[],Ae=k?.primaryKeys?.length?k.primaryKeys:[Ce],[Uo,Bo]=st__namespace.default.useState(false),[Ko,Ea]=st__namespace.default.useState(false),[Fo,La]=st__namespace.default.useState({}),[za,Eo]=st__namespace.default.useState(false),[qo,pa]=st__namespace.default.useState(false),[Lt,vo]=st__namespace.default.useState({}),[_o,no]=st__namespace.default.useState(false),[Lo,Na]=st__namespace.default.useState(false),mr=u||Ko||qo||Lo,ua=st__namespace.default.useMemo(()=>{let z=[...te];if(Array.isArray(xo)&&xo.length>0){let X=new Set(xo);z=z.filter(G=>X.has(G.id));}if(Ut.length>0){let X=new Set(Ut);z=z.filter(G=>!X.has(G.id));}return z.filter(X=>!!X?.id)},[te,Ut,xo]),Va=st__namespace.default.useMemo(()=>{let z=[...te];if(Array.isArray(Go)&&Go.length>0){let X=new Set(Go);z=z.filter(G=>X.has(G.id));}if(Et.length>0){let X=new Set(Et);z=z.filter(G=>!X.has(G.id));}return z.filter(X=>!!X?.id)},[te,Et,Go]),Zo=st__namespace.default.useMemo(()=>new Set(Ae),[Ae]),Ot=st__namespace.default.useMemo(()=>new Set(Kt),[Kt]),Co=st__namespace.default.useMemo(()=>new Set(Pt),[Pt]),gr=st__namespace.default.useCallback(z=>Ot.size>0?Ot.has(z):!(Co.has(z)||Zo.has(z)),[Ot,Co,Zo]);st__namespace.default.useEffect(()=>{!ce&&he.hasActiveFilters&&he.clearAll();},[he,ce]);let Oa=()=>{let z={};ua.forEach(X=>{z[X.id]=Fa[X.id]??"";}),La(z),Bo(true);},fr=(z,X)=>{La(G=>({...G,[z]:X}));},hr=async()=>{if(!x?.onSubmit){Bo(false);return}try{Ea(!0),await x.onSubmit(Fo),Bo(!1);}finally{Ea(false);}},yr=()=>{if(!bt)return;let z={};Va.forEach(G=>{z[G.id]=bt[G.id]??"";});let X=k?.getInitialValues?{...z,...k.getInitialValues(bt)}:z;vo(X),Eo(true);},qt=(z,X)=>{vo(G=>({...G,[z]:X}));},br=async()=>{if(bt){if(!k?.onSubmit){Eo(false);return}try{pa(!0),await k.onSubmit(Lt,bt),Eo(!1);}finally{pa(false);}}},xr=()=>{ut.length!==0&&no(true);},Wa=async()=>{if(ut.length===0){no(false);return}if(!E?.onConfirm){no(false),mo([]),c?.([]);return}try{Na(!0),await E.onConfirm(ut),no(!1),mo([]),c?.([]);}finally{Na(false);}},jo=ht,{fieldMapping:ma}=Mr({rows:jo,config:{...b,title:b?.title||`${N} ${t("graph.reportTitle")}`}}),ga=st__namespace.default.useMemo(()=>Se?he.applyRows(jo,ma):jo,[ma,he,Se,jo]),{model:y}=Mr({rows:ga,config:{...b,title:b?.title||`${N} ${t("graph.reportTitle")}`,fieldMapping:ma}}),A=y.table.columns.map(z=>({id:z.id,label:z.label,align:z.align||"left",minWidth:120,numeric:z.align==="right"})),B=U?jsxRuntime.jsx(Li,{appId:U,tableKey:g,currentLayoutData:me,onLayoutLoad:Ba,targetLayoutId:we,activeLayoutId:fe,serviceUrl:P??p?.serviceUrl}):null,W=te.filter(z=>at.includes(z.id)),Q=W.find(z=>z.id===M)||W[0],le=T?.map(z=>W.find(X=>X.id===z)).filter(Boolean)||W.filter(z=>z.id!==Q?.id).slice(0,Y==="portrait"?2:3),L=W.filter(z=>z.id!==Q?.id&&!le.some(X=>X.id===z.id)),q=[v,s].filter(Boolean),K=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ri,{groupAnchorEl:Ne,setGroupAnchorEl:Ye,grouping:Te,setGrouping:je,columns:te,toggleGroupField:Pe}),jsxRuntime.jsx(ni,{anchorEl:Ue,setAnchorEl:Tt,columns:te,visibleColumns:at,toggleColumnVisibility:de}),jsxRuntime.jsx(ii,{anchorEl:uo,setAnchorEl:Gt,showSummary:He,setShowSummary:re,columns:te,summaryColumns:Ie,toggleSummaryColumn:fo}),jsxRuntime.jsx(si,{contextMenu:At,handleCloseContextMenu:ke,columns:te,visibleColumns:at,toggleColumnVisibility:de})]}),Oe=(z,X,G)=>{let oe=i.includes(X),Be=Y==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",zo=G%2===0?styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.09:.04):styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.05:.022),$m=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{go({},z),$?.(z);},sx:{p:w==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:oe?styles.alpha(o.palette.primary.main,.38):$m,background:oe?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${zo}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:oe?`0 12px 30px ${styles.alpha(o.palette.primary.main,.2)}`:`0 3px 10px ${styles.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:oe?o.palette.primary.main:G%2===0?styles.alpha(o.palette.primary.main,.26):styles.alpha(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${styles.alpha(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[n?jsxRuntime.jsx(material.Checkbox,{checked:oe,onClick:_t=>_t.stopPropagation(),onChange:()=>go({},z),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[Q?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:tm(Q,z)}):null,le.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:le.map(_t=>jsxRuntime.jsx(material.Chip,{label:`${_t.label}: ${iC(_t,z)}`,size:"small",variant:"outlined",sx:Ft},`${X}-${_t.id}`))}):null]}),R?jsxRuntime.jsx(material.Box,{onClick:_t=>_t.stopPropagation(),children:R(z)}):null]}),L.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:Be,gap:1},children:L.map(_t=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.background.default,.7):styles.alpha(o.palette.background.paper,.92),border:"0.1px solid",borderColor:styles.alpha(o.palette.divider,.24)},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:_t.label}),nC(tm(_t,z))]},`${X}-${_t.id}-detail`))}):null,F?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:_t=>_t.stopPropagation(),children:F(z)})]}):null]})},X)};return jsxRuntime.jsxs(material.Box,{sx:{width:m?"100%":"auto",mb:l?0:2,...l?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p?jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(Ou,{...p,onVariantLoad:z=>{V(z),p.onVariantLoad?.(z);},appId:p.appId,tableKey:g,currentLayout:[{tableKey:g,layoutData:me}],currentLayoutId:fe,layoutRefs:[{tableKey:g,layoutId:fe}],variantService:p.variantService,serviceUrl:P??p.serviceUrl,touchMode:Y==="portrait"?"expanded":"comfortable"})}):null,jsxRuntime.jsxs(material.Paper,{sx:{width:m?"100%":"auto",mb:l?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":mr?{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?jsxRuntime.jsx(material.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:jsxRuntime.jsx(ei,{filterText:Z,setFilterText:Ze,onRowsPerPageChange:Me,rowsPerPage:Ge,rowsPerPageOptions:h,page:se,count:ao,onPageChange:ue,actions:d,extraTools:q,grouping:Te,setGroupAnchorEl:Ye,showSummary:He,setShowSummary:re,setAnchorEl:Tt,setSummaryAnchorEl:Gt,handleExport:ho,showCreateButton:ro,onOpenCreateDialog:Oa,showEditButton:da,onOpenEditDialog:yr,editDisabled:ut.length!==1,showDeleteButton:ur,onOpenDeleteConfirm:xr,deleteDisabled:ut.length===0,onLayoutSave:I||p?.variantService&&p?.appId?O:void 0,loading:u,layoutManager:B,onOpenGraphReport:De?Re:void 0})}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[pe.length===0&&!u?D||jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:t("common.noData")})}):null,pe.map((z,X)=>{if(z.type==="group"){let Be=rt.has(z.id);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>yt(z.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",color:"text.primary"},children:[Be?jsxRuntime.jsx(Qv__default.default,{}):jsxRuntime.jsx(Yv__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[z.field,": ",z.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[z.count," records"]})]}),Te.length>1&&z.level<Te.length-1?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.5,children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.expandAll"),onClick:zo=>{zo.stopPropagation(),Bt(z.id);},sx:bo}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:zo=>{zo.stopPropagation(),yo(z.id);},sx:bo})]}):null]})},z.id)}let G=z.data||z,oe=z.id||G[Ce]||X;return Oe(G,oe,X)}),He?jsxRuntime.jsx(sC,{summaryRow:H,visibleColumns:at,columns:te}):null,u?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),ro?jsxRuntime.jsxs(material.Dialog,{open:Uo,onClose:()=>!Ko&&Bo(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:x?.title||t("quickCreate.createWithTitle",{title:N})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ua.map(z=>{let X=z.type==="number"||z.numeric?"number":z.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:z.label||z.id,value:Fo[z.id]??"",onChange:G=>fr(z.id,G.target.value),type:X,fullWidth:true,InputLabelProps:{shrink:X==="date"?true:void 0}},`quick-create-${z.id}`)}),x?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:x.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Bo(false),disabled:Ko,children:x?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:hr,variant:"contained",disabled:Ko,children:x?.submitLabel||t("common.save")})]})]}):null,da?jsxRuntime.jsxs(material.Dialog,{open:za,onClose:()=>!qo&&Eo(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:k?.title||t("quickEdit.editWithTitle",{title:N})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Va.map(z=>{let X=z.type==="number"||z.numeric?"number":z.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:z.label||z.id,value:Lt[z.id]??"",onChange:G=>qt(z.id,G.target.value),type:X,disabled:!gr(z.id),fullWidth:true,InputLabelProps:{shrink:X==="date"?true:void 0}},`quick-edit-${z.id}`)}),k?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:k.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Eo(false),disabled:qo,children:k?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:br,variant:"contained",disabled:qo||!bt,children:k?.submitLabel||t("common.save")})]})]}):null,ur?jsxRuntime.jsx(sn,{open:_o,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(ut.length>1?t("quickDelete.confirmMessageMultiple",{count:ut.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:()=>!Lo&&no(false),onConfirm:Wa}):null,K,De?jsxRuntime.jsx(Si,{open:ce,onClose:ye,model:y,aiAssistant:b?.aiAssistant,interaction:Se?{enabled:true,filters:he.filters,fieldMapping:ma,onPrimaryDimensionClick:z=>he.setFilter("primaryDimension",z),onSecondaryDimensionClick:z=>he.setFilter("secondaryDimension",z),onStatusClick:z=>he.setFilter("status",z),onClearFilter:he.clearFilter,onClearAll:he.clearAll}:void 0,tableContent:jsxRuntime.jsx(lC,{appId:U||"graph-report-internal",title:t("graph.dataBody"),columns:A,rows:y.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var JB=({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:m,contentSx:f,containerSx:u,user:h,onSearch:I,defaultNavigationOpen:p,navOpen:C,onNavOpenChange:g,onWorkloadSelect:b,locale:x="en",localeLabel:k,localeOptions:E,onLocaleChange:P,onUserSetting:S,onUserLogout:M,userMenuItems:T,leftHeaderSlot:v,rightHeaderSlot:D})=>{let w="orbcafe:page-layout-mode",[R,F]=st.useState("system"),[$,N]=st.useState("light"),[j,ie]=st.useState(false),[Y,te]=st.useState(false),Z=R==="system"?Y?$:"light":R;st.useEffect(()=>{ie(true);},[]),st.useEffect(()=>{try{let At=window.localStorage.getItem(w);(At==="light"||At==="dark"||At==="system")&&F(At);}catch{}te(true);let Ue=window.matchMedia("(prefers-color-scheme: dark)"),Tt=()=>{N(Ue.matches?"dark":"light");};return Tt(),Ue.addEventListener("change",Tt),()=>Ue.removeEventListener("change",Tt)},[]),st.useEffect(()=>{if(Y)try{window.localStorage.setItem(w,R);}catch{}},[Y,R]),st.useEffect(()=>{Z==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[Z]);let Ze=st.useMemo(()=>styles.createTheme({palette:Z==="dark"?{mode:"dark",primary:{main:"#93c5fd"},background:{default:"#060913",paper:"#101826"},text:{primary:"#f8fafc",secondary:"rgba(226,232,240,0.74)"},divider:"rgba(148,163,184,0.18)",action:{hover:"rgba(148,163,184,0.10)",selected:"rgba(59,130,246,0.18)"}}:{mode:"light",background:{default:"#eef3f8",paper:"#ffffff"}},components:{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:Z==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[Z]),at=material.useMediaQuery("(orientation: portrait)"),He=material.useMediaQuery(Ze.breakpoints.down("md")),re=c==="auto"?!j||at||He?"portrait":"landscape":c,[Ie,Te]=st.useState({landscape:p??true,portrait:false}),je=Ie[re],rt=C??je,Ne=Ue=>{C===void 0&&Te(Tt=>({...Tt,[re]:Ue})),g?.(Ue);},Ye=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[!j||n&&re==="portrait"?jsxRuntime.jsx(material.IconButton,{onClick:()=>Ne(!rt),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(Xv__default.default,{})}):null,v]}),uo=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[l,D]}),Gt=jsxRuntime.jsx(_u,{collapsed:re==="landscape"?!rt:false,onToggle:()=>Ne(!rt),menuData:o,orientation:re,colorMode:Z,maxHeight:re==="landscape"?900:void 0});return jsxRuntime.jsx(styles.ThemeProvider,{theme:Ze,children:jsxRuntime.jsx(Jn,{locale:x,children:jsxRuntime.jsxs(material.Box,{sx:[Ue=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:Ue.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":Ue.palette.background.default}),...Array.isArray(u)?u:[u]],children:[jsxRuntime.jsx(os,{appTitle:e,logo:d===void 0?null:d,mode:R,onToggleMode:()=>F(Ue=>Ue==="system"?"dark":Ue==="dark"?"light":"system"),locale:x,localeLabel:k,localeOptions:E,onLocaleChange:P,user:h,onUserSetting:S,onUserLogout:M,userMenuItems:T,onSearch:I,leftSlot:Ye,rightSlot:uo}),s?jsxRuntime.jsx(material.Box,{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:s}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[j&&n&&re==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:Gt}):null,!j||n&&re==="portrait"?jsxRuntime.jsx(material.Drawer,{open:rt,onClose:()=>Ne(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Gt}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f},children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[i&&a.length>0?jsxRuntime.jsx(Hu,{items:a,selectedId:r,orientation:re,onItemSelect:b}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:re==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:Ze.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)",color:"text.primary"},children:t})]})})]}),re==="portrait"&&m?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:m})]}):null]})})})};var sm=PC__default.default(()=>Promise.resolve().then(()=>(im(),nm)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function vc({isRecording:e}){return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsx(framerMotion.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:jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0",children:jsxRuntime.jsx(sm,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),jsxRuntime.jsx("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:jsxRuntime.jsx(sm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var s5=vc;function Rs({onTextUpdate:e,onComplete:t,onError:o,wsUrl:a="ws://localhost:8765",silenceThresholdMs:r=2e3,minVolumeRms:n=.015}){let[i,c]=st.useState(false),d=st.useRef(null),s=st.useRef(null),l=st.useRef(null),m=st.useRef(null),f=st.useRef(null),u=st.useRef(0),h=st.useRef(false),I=st.useRef(false),p=st.useCallback(()=>{d.current&&(d.current.close(),d.current=null),m.current&&(m.current.disconnect(),m.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=st.useCallback(()=>{h.current||(h.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(p,500));},[p]),g=st.useCallback(async()=>{if(!(i||I.current)){I.current=true,h.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=M=>{try{let T=JSON.parse(M.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 E=new k({sampleRate:16e3});l.current=E;let P=E.createMediaStreamSource(b);f.current=P;let S=E.createScriptProcessor(4096,1,1);m.current=S,S.onaudioprocess=M=>{if(d.current?.readyState!==WebSocket.OPEN)return;let T=M.inputBuffer.getChannelData(0),v=0;for(let R=0;R<T.length;R+=1)v+=T[R]*T[R];if(Math.sqrt(v/T.length)>n)u.current=Date.now();else if(Date.now()-u.current>r&&!h.current){C();return}let w=new Int16Array(T.length);for(let R=0;R<T.length;R+=1){let F=Math.max(-1,Math.min(1,T[R]));w[R]=F<0?F*32768:F*32767;}d.current.send(w.buffer);},P.connect(S),S.connect(E.destination);}catch{o?.("Cannot access microphone"),p();}}},[p,i,n,t,o,e,r,C,a]);return st.useEffect(()=>p,[p]),{isRecording:i,startRecording:g,stopRecording:C}}var cm=st.createContext(null);function NC(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 VC({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[m,f]=st.useState(false),[u,h]=st.useState(false),I=st.useRef(null),p=st.useRef(false),C=st.useRef(false),g=st.useCallback(()=>{C.current=false,f(false);},[]),{isRecording:b,startRecording:x,stopRecording:k}=Rs({wsUrl:d,silenceThresholdMs:s,minVolumeRms:l,onTextUpdate:M=>{o?.(M);},onComplete:async M=>{try{M.trim()&&(h(!0),await t(M.trim()));}catch(T){let v=T instanceof Error?T.message:"Failed to process voice command";a?.(v);}finally{h(!1),g();}},onError:M=>{a?.(M),h(!1),p.current||g();}}),E=st.useCallback(async()=>{C.current=false,await x();},[x]),P=st.useCallback(()=>{k();},[k]);st.useEffect(()=>{if(n)return;let M=v=>{v.isComposing||(v.code==="Space"||v.key===" ")&&(p.current||v.repeat||i&&NC(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",M),window.addEventListener("keyup",T),()=>{window.removeEventListener("keydown",M),window.removeEventListener("keyup",T),I.current&&(clearTimeout(I.current),I.current=null);}},[n,i,r,x,k]);let S=st.useMemo(()=>({isRecording:b,isHotkeyRecording:m,isSubmitting:u,startRecording:E,stopRecording:P}),[m,b,u,E,P]);return jsxRuntime.jsxs(cm.Provider,{value:S,children:[c?jsxRuntime.jsx(vc,{isRecording:m}):null,e]})}function OC(){let e=st.useContext(cm);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var f5=VC,h5=OC;function xe(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var qC=({content:e,theme:t="light",size:o="base",defaultExpanded:a=false})=>{let[r,n]=st.useState(a),i=st.useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("span",{className:"mr-2",children:"\u{1F914}"}),jsxRuntime.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"})]}),jsxRuntime.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:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsxRuntime.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})]})},dm=qC;var ek=({content:e,language:t="text",isStreaming:o=false,className:a=""})=>{let{theme:r}=nextThemes.useTheme(),[n,i]=st.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"?prism.oneDark:prism.oneLight;return jsxRuntime.jsxs("div",{className:xe("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",a),children:[jsxRuntime.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:[jsxRuntime.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 uppercase",children:t}),jsxRuntime.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?jsxRuntime.jsx(lucideReact.Check,{size:14,className:"text-green-500"}):jsxRuntime.jsx(lucideReact.Clipboard,{size:14,className:"text-gray-500 dark:text-gray-400"})})]}),jsxRuntime.jsx("div",{className:"text-sm",children:jsxRuntime.jsx(reactSyntaxHighlighter.Prism,{language:t,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:r==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},um=ek;var rk=({content:e,isLoading:t,className:o="",style:a})=>{let r=st.useRef(null),[n,i]=st.useState(false),[c,d]=st.useState(null),{theme:s}=nextThemes.useTheme();return st.useEffect(()=>{let l=async()=>{if(!(!e.trim()||!r.current)){i(true),d(null);try{gm__default.default.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:h}=await gm__default.default.render(f,u);r.current&&(r.current.innerHTML=h);}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);}}},m=setTimeout(()=>{l();},100);return ()=>clearTimeout(m)},[e,s]),t||n?jsxRuntime.jsx("div",{className:`mermaid-block loading ${o}`,style:a,children:jsxRuntime.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:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500 mr-2"}),jsxRuntime.jsx("span",{className:"text-sm text-gray-500",children:"Generating Diagram..."})]})}):c?jsxRuntime.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:[jsxRuntime.jsx("p",{className:"font-semibold mb-2",children:"Mermaid Error:"}),jsxRuntime.jsx("pre",{children:c}),jsxRuntime.jsx("pre",{className:"mt-4 text-xs text-gray-500",children:e})]}):jsxRuntime.jsx("div",{className:`mermaid-block overflow-x-auto ${o}`,style:a,ref:r})},hm=rk;var dk=({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,m]=st.useState(false),[f,u]=st.useState(false),h=async()=>{if(c){u(true);try{await c();}catch(I){console.error("\u91CD\u8BD5\u5931\u8D25:",I);}finally{u(false);}}};return jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex p-4 border-l-4 border-l-red-500 bg-red-50 dark:bg-red-900/10",children:[jsxRuntime.jsx("div",{className:"flex-shrink-0 mr-3 text-red-500 mt-0.5",children:r||jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.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&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 leading-relaxed",children:typeof t=="string"?jsxRuntime.jsx("p",{className:"whitespace-pre-wrap",children:t}):t}),(c||a)&&jsxRuntime.jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[c&&jsxRuntime.jsxs("button",{onClick:h,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:[jsxRuntime.jsx(lucideReact.RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),a&&jsxRuntime.jsxs("button",{onClick:()=>m(!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?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),l?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),n&&i&&jsxRuntime.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:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),a&&l&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 border-t border-gray-100 dark:border-gray-800",children:jsxRuntime.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})})]})},Ds=dk;var hk=({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="",...m})=>{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 jsxRuntime.jsx(lucideReact.Info,{className:"w-5 h-5"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});case "success":return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-5 h-5"})}},h=f();return jsxRuntime.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}`,...m,children:[jsxRuntime.jsxs("div",{className:`flex p-4 border-l-4 ${h.borderLeftColor} ${h.bgColor}`,children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${h.iconColor}`,children:n||u()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.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&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),r&&r.length>0&&jsxRuntime.jsx("ul",{className:"mt-2 space-y-1",children:r.map((I,p)=>jsxRuntime.jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsxRuntime.jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsxRuntime.jsx("span",{children:I})]},p))})]}),i&&c&&jsxRuntime.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:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),d&&jsxRuntime.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:jsxRuntime.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"})})]})},Ms=hk;var vk=({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,m]=st.useState(false),[f,u]=st.useState(""),[h,I]=st.useState(false),p=st.useMemo(()=>f.trim()?o.filter(b=>b.toLowerCase().includes(f.toLowerCase())):o,[o,f]),C=st.useMemo(()=>l?p:p.slice(0,r),[p,l,r]),g=b=>{a?.(b);};return !o||o.length===0?null:jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2.5",children:[jsxRuntime.jsx("div",{className:"text-blue-500 flex-shrink-0",children:n||jsxRuntime.jsx(lucideReact.Lightbulb,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:e}),t&&jsxRuntime.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[o.length>3&&jsxRuntime.jsx("button",{onClick:()=>I(!h),className:`p-1.5 rounded-md transition-colors ${h?"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:h?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:jsxRuntime.jsx(lucideReact.Search,{className:"w-4 h-4"})}),i&&c&&jsxRuntime.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:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),h&&jsxRuntime.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:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.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}),jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsx("ul",{className:"space-y-1",children:C.map((b,x)=>jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{onClick:()=>g(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:[jsxRuntime.jsx("span",{children:b}),jsxRuntime.jsx(lucideReact.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&&jsxRuntime.jsx("button",{onClick:()=>m(!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&&jsxRuntime.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"})]})]})},As=vk;var Pk=({title:e,content:t,toolName:o,parameters:a,result:r,status:n,duration:i,icon:c,closable:d=false,onClose:s,onAction:l,actionText:m,className:f="",...u})=>{let[h,I]=st.useState(false),[p,C]=st.useState(true),g=()=>{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 jsxRuntime.jsx(lucideReact.Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"})}},x=P=>P?P<1e3?`${P}ms`:`${(P/1e3).toFixed(2)}s`:"",k=g(),E=e||o||"\u5DE5\u5177\u8C03\u7528";return jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-3",children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 ${k.iconColor}`,children:c||b()}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:E}),jsxRuntime.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${k.badgeBg} ${k.badgeText}`,children:k.label})]}),o&&e&&jsxRuntime.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center mt-0.5",children:[jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3 h-3 mr-1"}),o]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[i&&jsxRuntime.jsxs("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-3 h-3 mr-1"}),x(i)]}),d&&s&&jsxRuntime.jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1 rounded",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:t}),a&&jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsxs("button",{onClick:()=>I(!h),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:[h?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Box,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),h&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.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&&jsxRuntime.jsxs("div",{children:[jsxRuntime.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?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),p&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.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&&jsxRuntime.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-800 flex justify-end",children:jsxRuntime.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:m||"\u6267\u884C\u64CD\u4F5C"})})]})]})},Bs=Pk;var Dk=({data:e})=>{if(!e)return null;let t=st.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?jsxRuntime.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"}):jsxRuntime.jsx("div",{className:"w-full my-4",children:jsxRuntime.jsx(Sa,{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]})})},Fs=Dk;var Vk=({title:e,subtitle:t,data:o,type:a,config:r={}})=>{let n=()=>{switch(a){case "bar-chart-card":return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4 text-blue-500"});case "line-chart-card":return jsxRuntime.jsx(lucideReact.LineChart,{className:"w-4 h-4 text-green-500"});case "pie-chart-card":return jsxRuntime.jsx(lucideReact.PieChart,{className:"w-4 h-4 text-purple-500"});case "combo-chart-card":return jsxRuntime.jsx(lucideReact.Activity,{className:"w-4 h-4 text-orange-500"});case "heatmap-chart-card":return jsxRuntime.jsx(lucideReact.Grid,{className:"w-4 h-4 text-red-500"});case "fishbone-chart-card":return jsxRuntime.jsx(lucideReact.GitBranch,{className:"w-4 h-4 text-indigo-500"});case "waterfall-chart-card":return jsxRuntime.jsx(lucideReact.TrendingDown,{className:"w-4 h-4 text-teal-500"});case "google-map-card":return jsxRuntime.jsx(lucideReact.Globe,{className:"w-4 h-4 text-blue-600"});case "amap-card":return jsxRuntime.jsx(lucideReact.MapPin,{className:"w-4 h-4 text-blue-600"});default:return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"})}},i=()=>{if(!o&&a!=="google-map-card"&&a!=="amap-card")return jsxRuntime.jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(a){case "bar-chart-card":return jsxRuntime.jsx(un,{data:o,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsxRuntime.jsx(cd,{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 jsxRuntime.jsx(fi,{data:d,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsxRuntime.jsx(dd,{data:o,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(ud,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(gd,{branches:o,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(hd,{data:o,height:r.height});case "google-map-card":return jsxRuntime.jsx(xd,{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 jsxRuntime.jsx(Sd,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,keyword:r.keyword||o&&o[0]?.keyword||e,height:r.height});default:return jsxRuntime.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),jsxRuntime.jsx("div",{className:"text-red-500 text-sm p-4 text-center",children:"Error rendering chart"})}};return jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsx("div",{className:"mr-2 flex-shrink-0",children:n()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:t})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:"overflow-x-auto",children:i()}),jsxRuntime.jsx("div",{className:"mt-3",children:jsxRuntime.jsxs("details",{className:"text-xs text-gray-500 dark:text-gray-400",children:[jsxRuntime.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"}),jsxRuntime.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)})]})})]})]})},Es=Vk;var Wk=({type:e,manifest:t})=>jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsx(lucideReact.Box,{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400"}),jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["SAP Card: ",e]})]}),jsxRuntime.jsx("div",{className:"p-4",children:jsxRuntime.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:jsxRuntime.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})})})]}),zs=Wk;var Ns=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 qk=({content:e,theme:t,size:o="base",className:a,enableCodeHighlight:r=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=st.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,h,I,p)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:u,title:h,payload:I,rawData:p});},l=(f,u,h,I,p,C)=>{if(!(!p&&!c?.onCardEvent))return (...g)=>{let b=p?.(...g),x=C?C(...g):void 0;return s(f,u,h,x,I),b}},m=st.useMemo(()=>({div(f){let{"data-component":u,"data-think-content":h,...I}=f;return u==="thinkbox"&&h?jsxRuntime.jsx(dm,{content:decodeURIComponent(h),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...I})},table({children:f}){return jsxRuntime.jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-800",children:jsxRuntime.jsx("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:f})})},thead({children:f}){return jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/60",children:f})},tbody({children:f}){return jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-950",children:f})},tr({children:f}){return jsxRuntime.jsx("tr",{className:"border-b border-gray-200 dark:border-gray-800 last:border-b-0",children:f})},th({children:f,align:u}){return jsxRuntime.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 jsxRuntime.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:h,...I}){let p=/language-([\w-]+)/.exec(u||""),C=p?p[1]:"";if(f)return jsxRuntime.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:h});let g=String(h).replace(/\n$/,"");if(n&&C==="mermaid")return jsxRuntime.jsx(hm,{content:g});if(C==="json"){let b=Ns(g);if(b)switch(b.type){case "table":return jsxRuntime.jsx(Fs,{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 jsxRuntime.jsx(Es,{...b});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(zs,{...b});case "error-card":{let x=b;return jsxRuntime.jsx(Ds,{...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 jsxRuntime.jsx(Ms,{...x,onClose:l("warning-card","close",x.title,x,x.onClose),onConfirm:k})}case "suggestions-card":{let x=b;return jsxRuntime.jsx(As,{...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 jsxRuntime.jsx(Bs,{...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?jsxRuntime.jsx(um,{content:g,language:C,className:"not-prose"}):jsxRuntime.jsx("code",{className:u,...I,children:h})}}),[t,o,n,r,c,i]);return jsxRuntime.jsx("div",{className:xe("markdown-body prose dark:prose-invert max-w-none",a),children:jsxRuntime.jsx($k__default.default,{remarkPlugins:[Hk__default.default,Gk__default.default],rehypePlugins:[Uk__default.default,Kk__default.default],components:m,children:d})})},Vs=qk;var _k=({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,m)=>{if(!(!l&&!o?.onCardEvent))return (...f)=>{let u=l?.(...f),h=m?m(...f):void 0;return a(i,c,d,h,s),u}},n=Ns(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(Fs,{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 jsxRuntime.jsx(Es,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(zs,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(Ds,{...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 jsxRuntime.jsx(Ms,{...i,onClose:r("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(As,{...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 jsxRuntime.jsx(Bs,{...i,onClose:r("tool-result-card","close",i.title,i,i.onClose),onAction:r("tool-result-card","action",i.title,i,i.onAction)})}}return jsxRuntime.jsx("div",{className:"dynamic-card-fallback",children:jsxRuntime.jsx(Vs,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},Tm=_k;var Dc=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"}}},jk=({content:e,className:t="",messageId:o,cardHooks:a})=>{let r=st__namespace.default.useMemo(()=>Dc.analyze(e),[e]);return jsxRuntime.jsx("div",{className:`universal-content-renderer ${t}`,children:r.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsxRuntime.jsx(Tm,{content:n.content,messageId:o,cardHooks:a},`block-${i}`):jsxRuntime.jsx(Vs,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:a},`block-${i}`))})},Pm=jk;var Xk=({content:e,isStreaming:t=true,onComplete:o,className:a="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,s]=st.useState(t?0:e.length),[l,m]=st.useState(!t);st.useEffect(()=>{if(t){s(0),m(false);return}s(e.length),m(true);},[e,t]),st.useEffect(()=>{if(!t||l)return;if(d>=e.length){m(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),m(true),o?.());},u=t?e.slice(0,d):e,h=t&&!l,I=t&&!l;return jsxRuntime.jsxs("div",{className:`streaming-markdown ${a}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Pm,{content:u,messageId:i,cardHooks:c}),h&&jsxRuntime.jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),I&&jsxRuntime.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"})]})},Am=Xk;var Bm=({buttons:e,className:t})=>{let o=a=>{switch(a){case "copy":return jsxRuntime.jsx(lucideReact.Copy,{size:14});case "refresh":return jsxRuntime.jsx(lucideReact.RefreshCw,{size:14});case "volume":return jsxRuntime.jsx(lucideReact.Volume2,{size:14});case "like":return jsxRuntime.jsx(lucideReact.ThumbsUp,{size:14});case "dislike":return jsxRuntime.jsx(lucideReact.ThumbsDown,{size:14});default:return null}};return jsxRuntime.jsx("div",{className:xe("flex items-center gap-1",t),children:e.map((a,r)=>jsxRuntime.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 Os=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:a,streamChunkSize:r,cardHooks:n})=>e.type==="assistant"?jsxRuntime.jsx("div",{className:"flex justify-start mb-4",children:jsxRuntime.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:[jsxRuntime.jsx(Am,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:a,streamChunkSize:r,messageId:e.id,cardHooks:n}),e.content&&o?.isLatestAssistant&&jsxRuntime.jsx("div",{className:"flex flex-row justify-start gap-2 mt-3 pt-2 border-t border-gray-100 dark:border-gray-700",children:jsxRuntime.jsx(Bm,{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"})}),jsxRuntime.jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})}):jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.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:[jsxRuntime.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}),jsxRuntime.jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})});var Em=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:a,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:c}=Rs({onTextUpdate:e,onComplete:s=>{t?.(s);},onError:s=>{console.error("Voice input error:",s),o?.();}});return jsxRuntime.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?jsxRuntime.jsx(aS__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(oS__default.default,{sx:{fontSize:24}})})};var lt={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")},pS={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},uS=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:xe(lt.buttonBase,lt.buttonSmall,lt.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(cS__default.default,{sx:{fontSize:24}})}),mS=()=>jsxRuntime.jsxs("button",{className:xe(lt.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",lt.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(dS__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),gS=({canSend:e,isResponding:t,onSend:o,onStop:a})=>t?jsxRuntime.jsx("button",{className:xe(lt.buttonBase,lt.buttonSmall,lt.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:xe(lt.buttonBase,lt.buttonSmall,e?lt.sendButton:lt.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(lS__default.default,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),Lm=({onSend:e,onStop:t,isResponding:o=false,placeholder:a,getText:r})=>{let[n,i]=st.useState(""),[c,d]=st.useState([]),[s,l]=st.useState(false),[m,f]=st.useState(false),u=st.useRef(null),h=a||(r?r("00019","Type a message..."):"Type a message..."),I=(n.trim().length>0||c.length>0)&&!o,p={enabled:true},C=st.useCallback(F=>{i(F.target.value),F.target.style.height="auto",F.target.style.height=`${Math.min(F.target.scrollHeight,200)}px`;},[]),g=st.useCallback(F=>{if(F.target.files&&F.target.files.length>0){let $=Array.from(F.target.files);d(N=>{let j=$.filter(Y=>N.some(te=>te.name===Y.name&&te.size===Y.size));j.length>0&&console.warn("Duplicate files ignored:",j.map(Y=>Y.name));let ie=$.filter(Y=>!N.some(te=>te.name===Y.name&&te.size===Y.size));return [...N,...ie]}),u.current&&(u.current.value="");}},[]),b=st.useCallback(F=>{d($=>$.filter((N,j)=>j!==F));},[]),x=st.useCallback(()=>{u.current?.click();},[]),k=st.useCallback(async()=>{if(!I)return;let F=n,$=[...c];i(""),d([]),u.current&&(u.current.value="");try{await e(F,$);}catch(N){console.error("Failed to send message:",N),i(F),d($);}},[n,I,e,c]),E=st.useCallback(F=>{F.key==="Enter"&&!F.shiftKey&&!s&&(F.preventDefault(),k());},[k,s]),P=st.useCallback(()=>{l(true);},[]),S=st.useCallback(()=>{l(false);},[]),M=st.useCallback(F=>{i(F);},[]),T=st.useCallback(F=>{i(F);},[]),v=st.useCallback(()=>{},[]),D=st.useCallback(F=>{F.preventDefault(),f(true);},[]),w=st.useCallback(F=>{F.preventDefault(),f(false);},[]),R=st.useCallback(F=>{if(F.preventDefault(),f(false),F.dataTransfer.files&&F.dataTransfer.files.length>0){let $=Array.from(F.dataTransfer.files);d(N=>[...N,...$]);}},[]);return jsxRuntime.jsx("div",{className:lt.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:u,onChange:g}),jsxRuntime.jsxs("div",{className:xe(lt.inputContainer,m&<.dragActive),style:{borderRadius:"32px"},onDragOver:D,onDragLeave:w,onDrop:R,children:[c.length>0&&jsxRuntime.jsx("div",{className:lt.filePreviewArea,children:c.map((F,$)=>jsxRuntime.jsxs("div",{className:lt.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:F.name}),jsxRuntime.jsx("button",{onClick:()=>b($),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsxRuntime.jsx(iconsMaterial.Close,{sx:{fontSize:16}})})]},`${F.name}-${$}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:xe(lt.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:xe(lt.textarea,"min-h-[24px] py-0 px-0"),placeholder:h,value:n,onChange:C,onKeyDown:E,onCompositionStart:P,onCompositionEnd:S,style:pS,"aria-label":"Message input",spellCheck:false,rows:1})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-1 pb-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[jsxRuntime.jsx(uS,{enabled:p.enabled,onClick:x}),jsxRuntime.jsx(mS,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Em,{onTextUpdate:M,onComplete:T,onCancel:v,disabled:o,className:lt.buttonSmall}),jsxRuntime.jsx(gS,{canSend:I,isResponding:o,onSend:k,onStop:t})]})]})]})]})]})})};var Vm=({messages:e,onSend:t,onStop:o,onRegenerate:a,isResponding:r=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:s,cardHooks:l,showInput:m=true})=>{let f=st.useRef(null),u=st.useRef(e.length);return st.useEffect(()=>{e.length>u.current&&f.current?.scrollIntoView({behavior:"smooth"}),u.current=e.length;},[e]),jsxRuntime.jsxs("div",{className:xe("flex flex-col h-full w-full relative",n),children:[jsxRuntime.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((h,I)=>{let p=h.type==="assistant"&&I===e.length-1,C=h.type==="assistant"?{isLatestAssistant:p,onRegenerate:a?()=>a(h.id):void 0}:void 0;return jsxRuntime.jsx(Os,{message:h,assistantActions:C,onStreamingComplete:()=>s?.(h.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:l},h.id)}),jsxRuntime.jsx("div",{ref:f})]}),m&&jsxRuntime.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:jsxRuntime.jsx(Lm,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:r,placeholder:i})})]})};var to={};var yS={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},$E=({title:e="AI Agent",description:t,headerActions:o,className:a,agentStatus:r,showInput:n=false,...i})=>{let c=r??(i.isResponding?"running":"idle");return jsxRuntime.jsxs("div",{className:xe("relative flex h-full w-full",to.agentPanel,a),"data-status":c,children:[jsxRuntime.jsx("div",{className:to.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:to.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:xe(to.edge,to.top)}),jsxRuntime.jsx("span",{className:xe(to.edge,to.right)}),jsxRuntime.jsx("span",{className:xe(to.edge,to.bottom)}),jsxRuntime.jsx("span",{className:xe(to.edge,to.left)})]}),jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.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:[jsxRuntime.jsx("span",{className:to.statusDot,"data-status":c}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:yS[c]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(Vm,{...i,showInput:n})})]})]})};var kS={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},jE=({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:m,streamIntervalMs:f,streamChunkSize:u,onMessageStreamingComplete:h,cardHooks:I})=>{let[p,C]=st.useState(""),[g,b]=st.useState(false),x=st.useRef(null),k=kS[c];st.useEffect(()=>{x.current?.scrollIntoView({behavior:"smooth"});},[e,a]);let E=st.useCallback(async()=>{let S=p.trim();!S||a||(C(""),await t(S));},[a,t,p]),P=st.useCallback(async S=>{S.key==="Enter"&&!g&&(S.preventDefault(),await E());},[E,g]);return jsxRuntime.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&&jsxRuntime.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:jsxRuntime.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]")})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-gray-800",onPointerDown:s,children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsx("h3",{className:"text-base font-semibold tracking-tight text-gray-900 dark:text-gray-100",children:i})}),jsxRuntime.jsx("div",{})]}),jsxRuntime.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((S,M)=>{let T=S.type==="assistant"&&M===e.length-1,v=S.type==="assistant"?{isLatestAssistant:T,onRegenerate:o?()=>o(S.id):void 0}:void 0;return jsxRuntime.jsx(Os,{message:S,assistantActions:v,onStreamingComplete:()=>h?.(S.id),streamIntervalMs:f,streamChunkSize:u,cardHooks:I},S.id)}),jsxRuntime.jsx("div",{ref:x})]}),jsxRuntime.jsx("div",{className:"border-t border-gray-100 px-3 py-3 dark:border-gray-800",children:jsxRuntime.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:[jsxRuntime.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:jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4"})}),jsxRuntime.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:S=>C(S.target.value),onCompositionStart:()=>b(true),onCompositionEnd:()=>b(false),onKeyDown:P,"aria-label":"Copilot input",spellCheck:false}),jsxRuntime.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:m,type:"button","aria-label":"Microphone",children:jsxRuntime.jsx(lucideReact.Mic,{className:"h-4 w-4"})})]})})]})};var RS={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)"}}},eL=({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=material.useMediaQuery("(prefers-reduced-motion: reduce)"),[s,l]=st.useState("to"),m=!i&&!d&&o!=="none";st.useEffect(()=>{if(!m){l("to");return}l("from");let h=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{l("to");});});return ()=>cancelAnimationFrame(h)},[t,m]);let f=RS[o],u=st.useMemo(()=>m?s==="from"?f.from:f.to:{opacity:1,transform:"none"},[m,s,f.from,f.to]);return jsxRuntime.jsx(material.Box,{sx:{willChange:m?"opacity, transform":"auto",transition:m?`opacity ${a}ms ${n} ${r}ms, transform ${a}ms ${n} ${r}ms`:"none",backfaceVisibility:"hidden",...u,...c},children:e})},tL={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
|
|
199
|
-
exports.AgentPanel
|
|
196
|
+
${o}: ${(r??a)(p.secondaryValue??0)}`:""]})}),jsxRuntime.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)),jsxRuntime.jsx("text",{x:i/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:n.palette.text.secondary,children:o?t:"Index"}),jsxRuntime.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}),jsxRuntime.jsx("text",{x:d.left,y:d.top-4,fontSize:"10",fill:n.palette.text.secondary,children:Vu(f)}),jsxRuntime.jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:Vu(g)})]})}),jsxRuntime.jsx(material.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=>jsxRuntime.jsxs(material.Box,{sx:v=>({borderRadius:2,px:1.25,py:1,border:`1px solid ${styles.alpha(v.palette.divider,.7)}`,bgcolor:styles.alpha(v.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:p.name,children:p.name}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",a(p.primaryValue)]}),o&&jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(r??a)(p.secondaryValue??0)]})]},p.name))})]})};var Tc=e=>Math.max(...e,1),$u=({data:e,chartType:t,primaryLabel:o,secondaryLabel:a,formatPrimaryValue:r,formatSecondaryValue:n})=>{let i=styles.useTheme(),c=i.palette.primary.main,d=i.palette.warning.main;if(e.length===0)return null;if(t==="bar-horizontal"){let m=Tc(e.flatMap(y=>[y.primaryValue,y.secondaryValue??0]));return jsxRuntime.jsx(material.Stack,{spacing:1.1,children:e.map(y=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:y.name,children:y.name}),jsxRuntime.jsxs(material.Stack,{spacing:.65,children:[jsxRuntime.jsx(material.Box,{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${y.primaryValue/m*100}%`,height:"100%",bgcolor:c}})}),a&&jsxRuntime.jsx(material.Box,{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${(y.secondaryValue??0)/m*100}%`,height:"100%",bgcolor:d}})})]}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700},children:r(y.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"text.secondary"},children:(n??r)(y.secondaryValue??0)})]})]},y.name))})}if(t==="bar-vertical"){let m=Tc(e.flatMap(x=>[x.primaryValue,x.secondaryValue??0])),y=a?92:76;return jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto",pb:.5},children:jsxRuntime.jsx(material.Box,{sx:{minWidth:Math.max(620,e.length*y),display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:e.map(x=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[jsxRuntime.jsx(material.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&&jsxRuntime.jsx(material.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)}`})]}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:x.name,children:x.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:r(x.primaryValue),children:r(x.primaryValue)}),a&&jsxRuntime.jsx(material.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 l=Math.max(680,e.length*74),s=240,g={top:20,right:18,bottom:36,left:18},f=Tc(e.flatMap(m=>[m.primaryValue,m.secondaryValue??0])),u=l-g.left-g.right,h=s-g.top-g.bottom,T=m=>e.map((y,x)=>{let k=g.left+x*u/Math.max(e.length-1,1),F=s-g.bottom-m(y)/f*h;return {x:k,y:F,item:y}}),p=T(m=>m.primaryValue),v=a?T(m=>m.secondaryValue??0):[];return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${l} ${s}`,sx:{width:"100%",minWidth:l,height:s},children:[jsxRuntime.jsx("line",{x1:g.left,y1:s-g.bottom,x2:l-g.right,y2:s-g.bottom,stroke:styles.alpha(i.palette.text.secondary,.35)}),jsxRuntime.jsx("polyline",{fill:"none",stroke:c,strokeWidth:3,points:p.map(m=>`${m.x},${m.y}`).join(" ")}),p.map(m=>jsxRuntime.jsx("circle",{cx:m.x,cy:m.y,r:4,fill:c,children:jsxRuntime.jsxs("title",{children:[m.item.name,`
|
|
197
|
+
`,o,": ",r(m.item.primaryValue)]})},`primary-${m.item.name}`)),a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:v.map(m=>`${m.x},${m.y}`).join(" ")}),v.map(m=>jsxRuntime.jsx("circle",{cx:m.x,cy:m.y,r:3.5,fill:d,children:jsxRuntime.jsxs("title",{children:[m.item.name,`
|
|
198
|
+
`,a,": ",(n??r)(m.item.secondaryValue??0)]})},`secondary-${m.item.name}`))]})]})}),jsxRuntime.jsx(material.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=>jsxRuntime.jsxs(material.Box,{sx:y=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${styles.alpha(y.palette.divider,.7)}`,bgcolor:styles.alpha(y.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:m.name,children:m.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:r(m.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??r)(m.secondaryValue??0)})]},m.name))})]})};var Hu=(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},Gu=(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=ua(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:tn(i,o.fieldId,o.aggregation),secondaryValue:a?tn(i,a.fieldId,a.aggregation):void 0}))};var Ku=({rows:e,fieldMap:t,rowFields:o,columnFields:a,valueFields:r,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:l,onChartDimensionFieldIdChange:s,onChartPrimaryValueFieldIdChange:g,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:u,onToggleCollapse:h,getAggregationLabel:T})=>{let{t:p}=j(),v=ct.useMemo(()=>Hu(o,a,t),[a,t,o]),m=ct.useMemo(()=>Gu(r,t,T),[t,T,r]),y=m.find(C=>C.fieldId===i)??m[0],x=m.find(C=>C.fieldId===c&&C.fieldId!==y?.fieldId)??null,k=v.find(C=>C.fieldId===n)??v[0],F=k&&y?p("pivot.chart.subtitleReady",{dimension:k.label,measure:x?`${y.label} / ${x.label}`:y.label}):p("pivot.chart.subtitle"),S=ct.useMemo(()=>!k||!y?[]:Uu({rows:e,dimensionFieldId:k.fieldId,primaryValue:y.item,secondaryValue:x?.item}),[y,e,x,k]),w=C=>y?oi(C,y.item,t):C.toLocaleString(),A=C=>x?oi(C,x.item,t):C.toLocaleString(),R=v.length>1||m.length>1;return jsxRuntime.jsxs(sn,{title:p("pivot.chart.title"),subtitle:F,collapsed:l,onToggleCollapse:h,expandAriaLabel:p("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:p("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[R&&jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.dimension")}),jsxRuntime.jsx(material.Select,{value:k?.fieldId??"",onChange:C=>s(String(C.target.value)),sx:{fontSize:"0.75rem",height:32},children:v.map(C=>jsxRuntime.jsx(material.MenuItem,{value:C.fieldId,sx:{fontSize:"0.75rem"},children:C.label},C.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:y?.fieldId??"",onChange:C=>g(String(C.target.value)),sx:{fontSize:"0.75rem",height:32},children:m.map(C=>jsxRuntime.jsx(material.MenuItem,{value:C.fieldId,sx:{fontSize:"0.75rem"},children:C.label},C.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:x?.fieldId??"",onChange:C=>f(String(C.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("common.none")}),m.filter(C=>C.fieldId!==y?.fieldId).map(C=>jsxRuntime.jsx(material.MenuItem,{value:C.fieldId,sx:{fontSize:"0.75rem"},children:C.label},C.fieldId))]})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:p("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:C=>u(C.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barVertical")}),jsxRuntime.jsx(material.MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barHorizontal")}),jsxRuntime.jsx(material.MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.line")}),jsxRuntime.jsx(material.MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.scatter")})]})]})]}),jsxRuntime.jsx(material.Box,{children:k?y?S.length===0?jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoData")})}):d==="scatter"?jsxRuntime.jsx(Ou,{data:S,primaryLabel:y.label,secondaryLabel:x?.label,formatPrimaryValue:w,formatSecondaryValue:A}):jsxRuntime.jsx($u,{data:S,chartType:d,primaryLabel:y.label,secondaryLabel:x?.label,formatPrimaryValue:w,formatSecondaryValue:A}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoValue")})}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("pivot.chart.emptyNoDimension")})})})]})};var Ns=({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,l=e.isGrandTotal;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(material.TableRow,{sx:s=>({bgcolor:l?s.palette.mode==="dark"?"rgba(25, 118, 210, 0.22)":"rgba(47, 91, 255, 0.08)":s.palette.mode==="dark"?"#111111":"background.paper","&:hover":{bgcolor:l?s.palette.mode==="dark"?"rgba(25, 118, 210, 0.28)":"rgba(47, 91, 255, 0.12)":s.palette.mode==="dark"?"#181818":"rgba(0, 0, 0, 0.02)"}}),children:[jsxRuntime.jsxs(material.TableCell,{sx:s=>({fontSize:"0.76rem",fontWeight:l?800:600,borderBottom:`1px solid ${s.palette.divider}`,whiteSpace:"nowrap",pl:a*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!l&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(e.key),sx:{p:.2,mr:.5,ml:-1},children:c?jsxRuntime.jsx(rh__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx($f__default.default,{sx:{fontSize:16}})}),!d&&!l&&a>0&&jsxRuntime.jsx(material.Box,{sx:{width:20}}),e.value]}),t.map(s=>jsxRuntime.jsx(material.TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:l?800:500,borderBottom:g=>`1px solid ${g.palette.divider}`,whiteSpace:"nowrap"},children:oi(i?i(e,s.id):e.aggregatedValues[s.id]??0,s.valueItem,o)},`${e.key}-${s.id}`))]}),c&&e.children.map(s=>jsxRuntime.jsx(Ns,{node:s,dataColumns:t,fieldMap:o,level:a+1,expandedKeys:r,onToggle:n,getValue:i},s.key))]})};var Mc=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},Ws=(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??"",Yu=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},em=(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,em(r.children,t,o+1)),o),Qv=(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},c5=({title:e,rows:t,fields:o,initialLayout:a,initialChart:r,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:l,enablePresetManagement:s=false,presets:g,defaultPresets:f,onPresetsChange:u,initialPresetId:h,onPresetApplied:T})=>{let{t:p}=j(),v=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),m=ct.useRef(0),y=ct.useRef(false),x=e??p("pivot.title.default"),k=n??p("pivot.empty"),F=ct.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]),S=ct.useCallback(b=>F[b]??vu[b],[F]),w=ct.useMemo(()=>new Set(o.map(b=>b.id)),[o]),A=ct.useMemo(()=>new Map(o.map(b=>[b.id,b])),[o]),[R,C]=ct.useState(()=>ht(a?.rows,w)),[D,I]=ct.useState(()=>ht(a?.columns,w)),[P,M]=ct.useState(()=>ht(a?.filters,w)),[O,N]=ct.useState(()=>{let b=a?.values??[],B=new Set,E=[];return b.forEach($=>{if(!w.has($.fieldId)||B.has($.fieldId))return;B.add($.fieldId),m.current+=1;let ee=A.get($.fieldId);E.push({tokenId:`v${m.current}`,fieldId:$.fieldId,aggregation:$t($.aggregation,ee)});}),E}),[X,oe]=ct.useState({}),[te,re]=ct.useState(true),[Q,U]=ct.useState(false),[Y,Re]=ct.useState(()=>Mc(ht(a?.rows,w),ht(a?.columns,w),r?.dimensionFieldId)),[Z,fe]=ct.useState(()=>{let b=(a?.values??[]).filter((B,E,$)=>w.has(B.fieldId)&&$.findIndex(ee=>ee.fieldId===B.fieldId)===E).map(B=>({tokenId:B.fieldId,fieldId:B.fieldId,aggregation:$t(B.aggregation,A.get(B.fieldId))}));return Ws(b,r?.primaryValueFieldId)}),[Se,Ne]=ct.useState(()=>{let b=(a?.values??[]).filter((E,$,ee)=>w.has(E.fieldId)&&ee.findIndex(ue=>ue.fieldId===E.fieldId)===$).map(E=>({tokenId:E.fieldId,fieldId:E.fieldId,aggregation:$t(E.aggregation,A.get(E.fieldId))})),B=Ws(b,r?.primaryValueFieldId);return Ac(b,B,r?.secondaryValueFieldId)}),[Ke,ve]=ct.useState(r?.chartType??"bar-vertical"),[Fe,xo]=ct.useState(c),[Zt,Qe]=ct.useState(d),[Mt,Lt]=ct.useState(()=>f??[]),[bt,H]=ct.useState(""),[he,pe]=ct.useState(false),[ye,Xe]=ct.useState(""),[Ve,co]=ct.useState(null),[vo,Co]=ct.useState(new Set(["__grand_total__"])),[ko,So]=ct.useState(new Set),Me=l?.rowFields??R,ge=l?.columnFields??D,xt=l?.filterFields??P,Ee=l?.valueFields??O,zt=l?.filterSelections??X,wo=l?.showGrandTotal??te,_a=l?.isConfiguratorCollapsed??Q,V=l?.chartDimensionFieldId??Y,W=l?.chartPrimaryValueFieldId??Z,K=l?.chartSecondaryValueFieldId??Se,be=l?.chartType??Ke,Ce=l?.isChartCollapsed??Fe,Be=l?.isTableCollapsed??Zt,me=g??Mt,Le=s||me.length>0||!!u,we=ct.useCallback(b=>{if(l?.setRowFields){l.setRowFields(b);return}C(b);},[l]),ze=ct.useCallback(b=>{if(l?.setColumnFields){l.setColumnFields(b);return}I(b);},[l]),Ae=ct.useCallback(b=>{if(l?.setFilterFields){l.setFilterFields(b);return}M(b);},[l]),ke=ct.useCallback(b=>{if(l?.setValueFields){l.setValueFields(b);return}N(b);},[l]),De=ct.useCallback(b=>{if(l?.setFilterSelections){l.setFilterSelections(b);return}oe(b);},[l]),Nt=ct.useCallback(b=>{if(l?.setShowGrandTotal){l.setShowGrandTotal(b);return}re(b);},[l]),To=ct.useCallback(b=>{if(l?.setIsConfiguratorCollapsed){l.setIsConfiguratorCollapsed(b);return}U(b);},[l]),gt=ct.useCallback(b=>{if(l?.setChartDimensionFieldId){l.setChartDimensionFieldId(b);return}Re(b);},[l]),vt=ct.useCallback(b=>{if(l?.setChartPrimaryValueFieldId){l.setChartPrimaryValueFieldId(b);return}fe(b);},[l]),po=ct.useCallback(b=>{if(l?.setChartSecondaryValueFieldId){l.setChartSecondaryValueFieldId(b);return}Ne(b);},[l]),va=ct.useCallback(b=>{if(l?.setChartType){l.setChartType(b);return}ve(b);},[l]),Pr=ct.useCallback(b=>{if(l?.setIsChartCollapsed){l.setIsChartCollapsed(b);return}xo(b);},[l]),Io=ct.useCallback(b=>{if(l?.setIsTableCollapsed){l.setIsTableCollapsed(b);return}Qe(b);},[l]),Xt=ct.useCallback(b=>{let B=typeof b=="function"?b(me):b;g||Lt(B),u?.(B);},[u,me,g]),ja=ct.useMemo(()=>new Set([...Me,...ge,...xt]),[Me,ge,xt]),Qo=ct.useMemo(()=>o.filter(b=>!ja.has(b.id)),[o,ja]),Vt=ct.useMemo(()=>{let b=[...Me,...ge,...xt],B=new Set,E=[];return b.forEach($=>{B.has($)||(B.add($),E.push($));}),E},[ge,xt,Me]);ct.useEffect(()=>{we(b=>{let B=b.filter(E=>w.has(E));return ma(b,B)?b:B}),ze(b=>{let B=b.filter(E=>w.has(E));return ma(b,B)?b:B}),Ae(b=>{let B=b.filter(E=>w.has(E));return ma(b,B)?b:B}),ke(b=>{let B=b.filter(E=>w.has(E.fieldId)).map(E=>({...E,aggregation:$t(E.aggregation,A.get(E.fieldId))}));return Is(b,B)?b:B});},[A,w]);let Qt=ct.useMemo(()=>{let b={};return Vt.forEach(B=>{let E=new Set;t.forEach($=>{E.add(ua($[B]));}),b[B]=Array.from(E).sort(($,ee)=>$.localeCompare(ee));}),b},[Vt,t]);ct.useEffect(()=>{De(b=>{let B={};return Vt.forEach(E=>{let $=Qt[E]??[],ue=(b[E]??[]).filter(_=>$.includes(_)),L=Object.prototype.hasOwnProperty.call(b,E);B[E]=L?ue:$;}),Iu(b,B)?b:B});},[Vt,Qt]),ct.useEffect(()=>{gt(b=>Mc(Me,ge,b));},[ge,Me,gt]),ct.useEffect(()=>{vt(b=>Ws(Ee,b));},[vt,Ee]),ct.useEffect(()=>{po(b=>Ac(Ee,W,b));},[W,po,Ee]);let At=ct.useMemo(()=>t.filter(b=>Vt.every(B=>{let E=zt[B]??[],$=Qt[B]??[];if(E.length===$.length)return true;if(E.length===0)return false;let ee=ua(b[B]);return E.includes(ee)})),[Vt,Qt,zt,t]),Oe=ct.useMemo(()=>{if(Ee.length===0)return null;let b=new Map;if(At.forEach(L=>{let _=ge.length>0?ge.map(_e=>ua(L[_e])):[p("pivot.valueLabel")],q=hr(_);b.set(q,_);}),b.size===0){let L=ge.length>0?ge.map(()=>ws):[p("pivot.valueLabel")];b.set(hr(L),L);}let B=Array.from(b.entries()).sort((L,_)=>Tu(L[1],_[1])),E=B.flatMap(([L,_])=>Ee.map(q=>{let _e=A.get(q.fieldId),z=`${S(q.aggregation)} ${_e?.label??q.fieldId}`,J=ge.length===0||Ee.length>1?`${_.join(" / ")} \u2022 ${z}`:_.join(" / ");return {id:`${L}::${q.tokenId}`,colKey:L,valueItem:q,label:J}})),$=[];ge.length>0&&B.forEach(([L,_])=>{let q=E.filter(J=>J.colKey===L),_e=$,z=[];_.forEach((J,G)=>{z.push(`d${G}:${J}`);let ie=`col::${hr(z)}`,We=_e.find(Uo=>Uo.key===ie);We||(We={key:ie,label:J,children:[],leafColumnIds:[],path:_.slice(0,G+1),depth:G},_e.push(We)),q.forEach(Uo=>{We.leafColumnIds.includes(Uo.id)||We.leafColumnIds.push(Uo.id);}),_e=We.children;});});let ee=L=>{let _={};return E.forEach(q=>{let _e=L.filter(z=>{let J=ge.length>0?ge.map(G=>ua(z[G])):[p("pivot.valueLabel")];return hr(J)===q.colKey});_[q.id]=tn(_e,q.valueItem.fieldId,q.valueItem.aggregation);}),_},ue=[];if(Me.length===0)ue.push({key:"root",value:p("pivot.resultLabel")||bu,children:[],isLeaf:true,aggregatedValues:ee(At),path:[],depth:0});else {let L=(_,q,_e)=>{if(q>=Me.length)return [];let z=Me[q],J=new Map;return _.forEach(G=>{let ie=ua(G[z]);J.has(ie)||J.set(ie,[]),J.get(ie).push(G);}),Array.from(J.keys()).sort().map(G=>{let ie=J.get(G),We=[..._e,G];return {key:hr(We),value:G,fieldId:z,aggregatedValues:ee(ie),children:L(ie,q+1,We),isLeaf:q===Me.length-1,path:We,depth:q}})};ue.push(...L(At,0,[]));}return {dataColumns:E,columnTree:$,rowTree:ue}},[ge,A,At,S,Me,p,Ee]),Yo=ct.useCallback((b,B)=>(m.current+=1,{tokenId:`v${m.current}`,fieldId:b,aggregation:$t(B,A.get(b))}),[A]),Wo=ct.useCallback(b=>{if(b==="rows")return we([]);if(b==="columns")return ze([]);if(b==="filters")return Ae([]);ke([]);},[]),Jo=ct.useCallback((b,B)=>{if(b==="rows")return we(E=>E.filter($=>$!==B));if(b==="columns")return ze(E=>E.filter($=>$!==B));if(b==="filters")return Ae(E=>E.filter($=>$!==B));ke(E=>E.filter($=>$.tokenId!==B));},[]),Za=ct.useCallback((b,B)=>{ke(E=>E.map($=>$.tokenId===b?{...$,aggregation:$t(B,A.get($.fieldId))}:$));},[A]),$o=ct.useCallback(b=>{co(String(b.active.id));},[]),Xa=ct.useCallback(b=>{if(co(null),!b.over)return;let B=Ts(String(b.active.id)),E=Ts(String(b.over.id));if(!B||!E||B.kind!=="item"||!B.key)return;if(B.zone===E.zone&&E.kind==="item"){if(B.zone==="rows"){let G=Me.indexOf(B.key),ie=Me.indexOf(E.key??"");G!==-1&&ie!==-1&&G!==ie&&we(We=>sortable.arrayMove(We,G,ie));return}if(B.zone==="columns"){let G=ge.indexOf(B.key),ie=ge.indexOf(E.key??"");G!==-1&&ie!==-1&&G!==ie&&ze(We=>sortable.arrayMove(We,G,ie));return}if(B.zone==="filters"){let G=xt.indexOf(B.key),ie=xt.indexOf(E.key??"");G!==-1&&ie!==-1&&G!==ie&&Ae(We=>sortable.arrayMove(We,G,ie));return}if(B.zone==="values"){let G=Ee.findIndex(We=>We.tokenId===B.key),ie=Ee.findIndex(We=>We.tokenId===(E.key??""));G!==-1&&ie!==-1&&G!==ie&&ke(We=>sortable.arrayMove(We,G,ie));}return}let $=E.zone,ee=[...Me],ue=[...ge],L=[...xt],_=[...Ee],q="",_e=null;if(B.zone==="palette")q=B.key;else if(B.zone==="values"){let G=_.find(ie=>ie.tokenId===B.key);if(!G)return;q=G.fieldId,_e=G,_=_.filter(ie=>ie.tokenId!==B.key);}else B.zone==="rows"?(q=B.key,ee=ee.filter(G=>G!==q)):B.zone==="columns"?(q=B.key,ue=ue.filter(G=>G!==q)):B.zone==="filters"&&(q=B.key,L=L.filter(G=>G!==q));if(!q)return;let z=()=>{ee=ee.filter(G=>G!==q),ue=ue.filter(G=>G!==q),L=L.filter(G=>G!==q);},J=G=>{if(E.kind!=="item"||!E.key)return G==="rows"?ee.length:G==="columns"?ue.length:G==="filters"?L.length:G==="values"?_.length:0;if(G==="rows"){let ie=ee.indexOf(E.key);return ie>=0?ie:ee.length}if(G==="columns"){let ie=ue.indexOf(E.key);return ie>=0?ie:ue.length}if(G==="filters"){let ie=L.indexOf(E.key);return ie>=0?ie:L.length}if(G==="values"){let ie=_.findIndex(We=>We.tokenId===E.key);return ie>=0?ie:_.length}return 0};if($==="palette"){we(ee),ze(ue),Ae(L),ke(_);return}if($==="values"){let G=J("values"),ie=_e??Yo(q);_.splice(G,0,ie),we(ee),ze(ue),Ae(L),ke(_);return}if(wu($)){z();let G=J($);$==="rows"?ee.splice(G,0,q):$==="columns"?ue.splice(G,0,q):L.splice(G,0,q),we(ee),ze(ue),Ae(L),ke(_);}},[ge,Yo,xt,Me,Ee]),Qa=ct.useCallback((b,B)=>{De(E=>({...E,[b]:B}));},[]),Ho=ct.useCallback(b=>{Co(B=>{let E=new Set(B);return E.has(b)?E.delete(b):E.add(b),E});},[]),ea=ct.useCallback(b=>{So(B=>{let E=new Set(B);return E.has(b)?E.delete(b):E.add(b),E});},[]),Ca=ct.useCallback(b=>{let B=A.get(b.fieldId),E=yc(B);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:b.aggregation,onChange:$=>Za(b.tokenId,$.target.value),onClick:$=>$.stopPropagation(),onMouseDown:$=>$.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:E.map($=>jsxRuntime.jsx(material.MenuItem,{value:$,sx:{fontSize:"0.75rem"},children:S($)},$))})})},[A,S,Za]),Ot=ct.useCallback(b=>{let B=Qt[b]??[],E=zt[b]??B;return B.length===0?p("pivot.filter.noValues"):E.length===0?p("pivot.filter.noneSelected"):E.length===B.length?p("pivot.filter.allValues"):p("pivot.filter.selectedCount",{selected:E.length,total:B.length})},[Qt,zt,p]),Po=ct.useCallback(b=>{let B=Qt[b]??[],E=zt[b]??B;return jsxRuntime.jsx(Du,{options:B,selectedValues:E,onChange:$=>Qa(b,$)})},[Qt,zt,Qa]),ta=ct.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),uo=ct.useCallback(()=>{let b={};return new Set([...Vt,...Object.keys(zt)]).forEach(E=>{if(!w.has(E))return;let $=zt[E]??[];b[E]=[...$];}),{layout:{rows:[...Me],columns:[...ge],filters:[...xt],values:Ee.map(E=>({fieldId:E.fieldId,aggregation:E.aggregation}))},filterSelections:b,showGrandTotal:wo,chart:{dimensionFieldId:V,primaryValueFieldId:W,secondaryValueFieldId:K,chartType:be}}},[Vt,V,W,K,be,ge,xt,zt,Me,wo,w,Ee]),Go=ct.useCallback(b=>{let B=ht(b.layout.rows,w),E=ht(b.layout.columns,w),$=ht(b.layout.filters,w),ee=new Set,ue=(b.layout.values??[]).filter(q=>!w.has(q.fieldId)||ee.has(q.fieldId)?false:(ee.add(q.fieldId),true)).map(q=>Yo(q.fieldId,q.aggregation)),L={};Object.entries(b.filterSelections??{}).forEach(([q,_e])=>{!w.has(q)||!Array.isArray(_e)||(L[q]=Array.from(new Set(_e.map(z=>String(z)))));}),we(B),ze(E),Ae($),ke(ue),De(L),typeof b.showGrandTotal=="boolean"&&Nt(b.showGrandTotal),gt(Mc(B,E,b.chart?.dimensionFieldId));let _=Ws(ue,b.chart?.primaryValueFieldId);vt(_),po(Ac(ue,_,b.chart?.secondaryValueFieldId)),va(b.chart?.chartType??"bar-vertical"),H(b.id),T?.(b);},[Yo,T,gt,vt,po,va,ze,Ae,De,we,Nt,ke,w]),Ya=ct.useCallback(b=>{if(!b){H("");return}let B=me.find(E=>E.id===b);if(!B){H("");return}Go(B);},[Go,me]),Rr=ct.useCallback(()=>{let b=p("pivot.preset.defaultName",{index:me.length+1});Xe(b),pe(true);},[me.length,p]),ka=ct.useCallback(()=>{let b=ye.trim();if(!b)return;let B={id:ta(),name:b,...uo()};Xt(E=>[...E,B]),H(B.id),pe(false);},[uo,ta,ye,Xt]),Ja=ct.useCallback(()=>{bt&&(Xt(b=>b.filter(B=>B.id!==bt)),H(""));},[bt,Xt]);ct.useEffect(()=>{if(!h||y.current)return;let b=me.find(B=>B.id===h);b&&(y.current=true,Go(b));},[Go,h,me]),ct.useEffect(()=>{bt&&(me.some(b=>b.id===bt)||H(""));},[bt,me]);let oa=ct.useMemo(()=>{if(!wo||!Oe||!Me.length)return null;let b={};return Oe.dataColumns.forEach(B=>{let E=At.filter($=>{let ee=ge.length>0?ge.map(ue=>ua($[ue])):[p("pivot.valueLabel")];return hr(ee)===B.colKey});b[B.id]=tn(E,B.valueItem.fieldId,B.valueItem.aggregation);}),{key:"__grand_total__",value:p("pivot.grandTotal")||xu,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:b,path:[],depth:-1}},[wo,Oe,At,ge,Me.length,p]),Ut=ct.useMemo(()=>Yu(Oe?.rowTree??[]),[Oe]),Ro=ct.useMemo(()=>Yu(Oe?.columnTree??[]),[Oe]);ct.useEffect(()=>{Co(b=>{let B=new Set;return b.has("__grand_total__")&&B.add("__grand_total__"),Ut.forEach(E=>{b.has(E)&&B.add(E);}),B});},[Ut]),ct.useEffect(()=>{So(b=>{let B=new Set;return Ro.forEach(E=>{b.has(E)&&B.add(E);}),B});},[Ro]);let Dr=ct.useCallback(()=>{Co(b=>{let B=new Set(b);return Ut.forEach(E=>B.add(E)),B});},[Ut]),er=ct.useCallback(()=>{Co(b=>{let B=new Set;return b.has("__grand_total__")&&B.add("__grand_total__"),B});},[]),Mr=ct.useCallback(()=>{So(new Set(Ro));},[Ro]),Ar=ct.useCallback(()=>{So(new Set);},[]),Br=ct.useMemo(()=>!Oe||ge.length===0?[]:Qv(Oe.columnTree,ko),[ge.length,ko,Oe]),Yt=ct.useMemo(()=>{if(!Oe)return [];if(ge.length===0)return Oe.dataColumns.map(B=>({id:B.id,label:B.label,leafColumnIds:[B.id],valueItem:B.valueItem}));let b=new Map(Oe.dataColumns.map(B=>[B.id,B]));return Br.flatMap(B=>{let E=new Map;return B.leafColumnIds.forEach($=>{let ee=b.get($);if(!ee)return;let ue=ee.valueItem.tokenId,L=`${S(ee.valueItem.aggregation)} ${A.get(ee.valueItem.fieldId)?.label??ee.valueItem.fieldId}`,_=E.get(ue);if(_){_.leafColumnIds.push($);return}E.set(ue,{id:`${B.key}::${ue}`,label:Ee.length>1?L:B.label,leafColumnIds:[$],valueItem:ee.valueItem});}),Array.from(E.values())})},[ge.length,A,S,Oe,Ee.length,Br]),Fr=ct.useMemo(()=>new Map(Yt.map(b=>[b.id,b])),[Yt]),Er=ct.useMemo(()=>Yt.map(b=>({id:b.id,colKey:b.id,valueItem:b.valueItem,label:b.label})),[Yt]),tr=ct.useMemo(()=>{if(!Oe||ge.length===0)return [];let b=[],B=em(Oe.columnTree,ko),E=B+(Ee.length>1?1:0),$=(ee,ue)=>{b[ue]??(b[ue]=[]),ee.forEach(L=>{let _=L.children.length>0&&ko.has(L.key),q=Yt.filter(z=>L.leafColumnIds.some(J=>z.leafColumnIds.includes(J))).length,_e=_||Ee.length>1?1:E-ue;b[ue].push({key:L.key,label:L.label,colSpan:q,rowSpan:_e,expandable:L.children.length>0,expanded:_}),_&&$(L.children,ue+1);});};return $(Oe.columnTree,0),Ee.length>1&&(b[B]=Yt.map(ee=>({key:ee.id,label:ee.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),b},[ge.length,ko,Oe,Ee.length,Yt]),aa=ct.useCallback((b,B)=>B.leafColumnIds.reduce((E,$)=>E+(b.aggregatedValues[$]??0),0),[]),Sa=ct.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Dr,disabled:Ut.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:er,disabled:Ut.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseRowsAll")}),jsxRuntime.jsx(material.Divider,{orientation:"vertical",flexItem:true}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Mr,disabled:Ro.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Ar,disabled:ge.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseColumnsAll")})]}),[ge.length,Ro.size,Ut.size,Ar,er,Mr,Dr,p]),wa=()=>{if(!Ve)return null;let b=Ts(Ve);if(!b||b.kind!=="item"||!b.key)return null;if(b.zone==="palette"){let ee=A.get(b.key);return ee?jsxRuntime.jsx(xc,{label:ee.label,subtitle:ee.type}):null}if(b.zone==="values"){let ee=Ee.find(q=>q.tokenId===b.key);if(!ee)return null;let L=A.get(ee.fieldId)?.label??ee.fieldId,_=`${S(ee.aggregation)}(${L})`;return jsxRuntime.jsx(As,{label:L,caption:_})}let E=A.get(b.key)?.label??b.key,$=Ot(b.key);return jsxRuntime.jsx(As,{label:E,caption:$})};return jsxRuntime.jsxs(material.Paper,{sx:b=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${b.palette.divider}`,bgcolor:"background.paper",boxShadow:b.palette.mode==="dark"?"none":"0 12px 28px rgba(15, 23, 42, 0.08)",display:"flex",flexDirection:"column",gap:2}),children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800},children:x}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:p("pivot.subtitle.default")})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[Le&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:200},children:jsxRuntime.jsxs(material.Select,{value:bt,displayEmpty:true,onChange:b=>Ya(String(b.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("pivot.preset.selectPlaceholder")}),me.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b.id,sx:{fontSize:"0.75rem"},children:b.name},b.id))]})}),jsxRuntime.jsx(material.Tooltip,{title:p("pivot.preset.save"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Rr,"aria-label":p("pivot.preset.save"),children:jsxRuntime.jsx(wp__default.default,{sx:{fontSize:18}})})}),jsxRuntime.jsx(material.Tooltip,{title:p("pivot.preset.delete"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Ja,disabled:!bt,"aria-label":p("pivot.preset.delete"),children:jsxRuntime.jsx(Hv__default.default,{sx:{fontSize:18}})})})}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"})]}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[p("pivot.records"),": ",jsxRuntime.jsx("strong",{children:t.length.toLocaleString()})," / ",p("pivot.afterFilter"),":"," ",jsxRuntime.jsx("strong",{children:At.length.toLocaleString()})]}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem"},children:p("pivot.grandTotal")}),jsxRuntime.jsx(material.Switch,{size:"small",checked:wo,onChange:b=>Nt(b.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:v,collisionDetection:core.closestCenter,onDragStart:$o,onDragEnd:Xa,children:[jsxRuntime.jsx(Nu,{isConfiguratorCollapsed:_a,onToggleCollapse:()=>To(b=>!b),availableFields:Qo,fieldMap:A,filterFields:xt,columnFields:ge,rowFields:Me,valueFields:Ee,clearZone:Wo,removeFieldFromZone:Jo,getFilterSelectionSummary:Ot,renderDimensionFilterSelect:Po,renderAggregationSelect:Ca,getAggregationLabel:S}),jsxRuntime.jsx(material.Portal,{children:jsxRuntime.jsx(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:wa()})})]}),jsxRuntime.jsx(Ku,{rows:At,fieldMap:A,rowFields:Me,columnFields:ge,valueFields:Ee,chartDimensionFieldId:V,chartPrimaryValueFieldId:W,chartSecondaryValueFieldId:K,chartType:be,isCollapsed:Ce,onChartDimensionFieldIdChange:b=>gt(b),onChartPrimaryValueFieldIdChange:b=>vt(b),onChartSecondaryValueFieldIdChange:b=>po(b),onChartTypeChange:b=>va(b),onToggleCollapse:()=>Pr(b=>!b),getAggregationLabel:S}),jsxRuntime.jsx(sn,{title:p("pivot.table.sectionTitle"),subtitle:Me.length>0?Me.map(b=>A.get(b)?.label??b).join(" > "):p("pivot.table.dimensions"),collapsed:Be,onToggleCollapse:()=>Io(b=>!b),expandAriaLabel:p("pivot.table.collapse.ariaExpand"),collapseAriaLabel:p("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Sa,children:Oe===null?jsxRuntime.jsx(material.Box,{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:k})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(tr.length>0?tr:[[]]).map((b,B)=>jsxRuntime.jsxs(material.TableRow,{children:[B===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(tr.length,1),sx:E=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:E.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${E.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:Me.length>0?Me.map(E=>A.get(E)?.label).join(" > "):p("pivot.table.dimensions")}),(b.length>0?b:Yt.map(E=>({key:E.id,label:E.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(E=>jsxRuntime.jsx(material.TableCell,{align:"center",colSpan:E.colSpan,rowSpan:E.rowSpan,sx:$=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:$.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${$.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[E.expandable&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>ea(E.key),sx:{p:.1,ml:-0.3},children:E.expanded?jsxRuntime.jsx(rh__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx($f__default.default,{sx:{fontSize:16}})}),jsxRuntime.jsx(material.Box,{component:"span",children:E.label})]})},E.key))]},`pivot-header-row-${B}`))}),jsxRuntime.jsxs(material.TableBody,{children:[Oe.rowTree.map(b=>jsxRuntime.jsx(Ns,{node:b,dataColumns:Er,fieldMap:A,level:0,expandedKeys:vo,onToggle:Ho,getValue:(B,E)=>{let $=Fr.get(E);return $?aa(B,$):0}},b.key)),oa&&jsxRuntime.jsx(Ns,{node:oa,dataColumns:Er,fieldMap:A,level:0,expandedKeys:vo,onToggle:Ho,getValue:(b,B)=>{let E=Fr.get(B);return E?aa(b,E):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:he,onClose:()=>pe(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:p("pivot.preset.saveDialogTitle")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsx(material.TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:p("pivot.preset.nameLabel"),value:ye,onChange:b=>Xe(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),ka());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>pe(false),children:p("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:ka,disabled:!ye.trim(),children:p("common.save")})]})]})]})};var tm=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},Fc=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",om=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",g5=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:a=true,initialConfiguratorCollapsed:r=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=ct.useRef(0),l=ct.useMemo(()=>new Set(e.map(H=>H.id)),[e]),s=ct.useMemo(()=>new Map(e.map(H=>[H.id,H])),[e]),[g,f]=ct.useState(()=>ht(t?.rows,l)),[u,h]=ct.useState(()=>ht(t?.columns,l)),[T,p]=ct.useState(()=>ht(t?.filters,l)),[v,m]=ct.useState(()=>{let H=t?.values??[],he=new Set,pe=[];return H.forEach(ye=>{!l.has(ye.fieldId)||he.has(ye.fieldId)||(he.add(ye.fieldId),d.current+=1,pe.push({tokenId:`v${d.current}`,fieldId:ye.fieldId,aggregation:$t(ye.aggregation,s.get(ye.fieldId))}));}),pe}),[y,x]=ct.useState(o),[k,F]=ct.useState(a),[S,w]=ct.useState(r),[A,R]=ct.useState(()=>tm(ht(t?.rows,l),ht(t?.columns,l),n?.dimensionFieldId)),[C,D]=ct.useState(()=>{let H=(()=>{let he=t?.values??[],pe=new Set,ye=[];return he.forEach(Xe=>{!l.has(Xe.fieldId)||pe.has(Xe.fieldId)||(pe.add(Xe.fieldId),ye.push({tokenId:Xe.fieldId,fieldId:Xe.fieldId,aggregation:$t(Xe.aggregation,s.get(Xe.fieldId))}));}),ye})();return Fc(H,n?.primaryValueFieldId)}),[I,P]=ct.useState(()=>{let H=(()=>{let pe=t?.values??[],ye=new Set,Xe=[];return pe.forEach(Ve=>{!l.has(Ve.fieldId)||ye.has(Ve.fieldId)||(ye.add(Ve.fieldId),Xe.push({tokenId:Ve.fieldId,fieldId:Ve.fieldId,aggregation:$t(Ve.aggregation,s.get(Ve.fieldId))}));}),Xe})(),he=Fc(H,n?.primaryValueFieldId);return om(H,he,n?.secondaryValueFieldId)}),[M,O]=ct.useState(n?.chartType??"bar-vertical"),[N,X]=ct.useState(i),[oe,te]=ct.useState(c);ct.useEffect(()=>{f(H=>{let he=H.filter(pe=>l.has(pe));return ma(H,he)?H:he}),h(H=>{let he=H.filter(pe=>l.has(pe));return ma(H,he)?H:he}),p(H=>{let he=H.filter(pe=>l.has(pe));return ma(H,he)?H:he}),m(H=>{let he=H.filter(pe=>l.has(pe.fieldId)).map(pe=>({...pe,aggregation:$t(pe.aggregation,s.get(pe.fieldId))}));return Is(H,he)?H:he});},[s,l]),ct.useEffect(()=>{R(H=>tm(g,u,H));},[u,g]),ct.useEffect(()=>{D(H=>Fc(v,H));},[v]),ct.useEffect(()=>{P(H=>om(v,C,H));},[C,v]);let re=ct.useCallback(H=>{f(ht(H,l));},[l]),Q=ct.useCallback(H=>{h(ht(H,l));},[l]),U=ct.useCallback(H=>{p(ht(H,l));},[l]),Y=ct.useCallback(H=>{m(he=>{let pe=H??[],ye=new Set,Xe=[];return pe.forEach(Ve=>{if(!l.has(Ve.fieldId)||ye.has(Ve.fieldId))return;ye.add(Ve.fieldId);let co=he.find(vo=>vo.fieldId===Ve.fieldId);if(co){Xe.push({...co,aggregation:$t(Ve.aggregation??co.aggregation,s.get(Ve.fieldId))});return}d.current+=1,Xe.push({tokenId:`v${d.current}`,fieldId:Ve.fieldId,aggregation:$t(Ve.aggregation,s.get(Ve.fieldId))});}),Xe});},[s,l]),Re=ct.useCallback(H=>{re(H.rows??[]),Q(H.columns??[]),U(H.filters??[]),Y(H.values??[]);},[Q,U,re,Y]),Z=ct.useCallback(H=>{if(H==="rows")return f([]);if(H==="columns")return h([]);if(H==="filters")return p([]);m([]);},[]),fe=ct.useCallback((H,he)=>{if(H==="rows")return f(pe=>pe.filter(ye=>ye!==he));if(H==="columns")return h(pe=>pe.filter(ye=>ye!==he));if(H==="filters")return p(pe=>pe.filter(ye=>ye!==he));m(pe=>pe.filter(ye=>ye.tokenId!==he));},[]),Se=ct.useCallback((H,he)=>{m(pe=>pe.map(ye=>ye.tokenId===H?{...ye,aggregation:$t(he,s.get(ye.fieldId))}:ye));},[s]),Ne=ct.useCallback((H,he)=>{x(pe=>({...pe,[H]:he}));},[]),Ke=ct.useCallback(()=>{x({});},[]),ve=ct.useCallback(()=>{F(H=>!H);},[]),Fe=ct.useCallback(()=>{w(H=>!H);},[]),xo=ct.useCallback(H=>{R(H);},[]),Zt=ct.useCallback(H=>{D(H);},[]),Qe=ct.useCallback(H=>{P(H);},[]),Mt=ct.useCallback(()=>{X(H=>!H);},[]),Lt=ct.useCallback(()=>{te(H=>!H);},[]);return {model:ct.useMemo(()=>({rowFields:g,setRowFields:f,columnFields:u,setColumnFields:h,filterFields:T,setFilterFields:p,valueFields:v,setValueFields:m,filterSelections:y,setFilterSelections:x,showGrandTotal:k,setShowGrandTotal:F,isConfiguratorCollapsed:S,setIsConfiguratorCollapsed:w,chartDimensionFieldId:A,setChartDimensionFieldId:R,chartPrimaryValueFieldId:C,setChartPrimaryValueFieldId:D,chartSecondaryValueFieldId:I,setChartSecondaryValueFieldId:P,chartType:M,setChartType:O,isChartCollapsed:N,setIsChartCollapsed:X,isTableCollapsed:oe,setIsTableCollapsed:te}),[A,C,I,M,u,T,y,N,S,oe,g,k,v]),actions:{setRows:re,setColumns:Q,setFilters:U,setValues:Y,setLayout:Re,clearZone:Z,removeFieldFromZone:fe,setAggregationForValue:Se,setFilterSelection:Ne,resetFilterSelections:Ke,toggleGrandTotal:ve,toggleConfigurator:Fe,setChartDimension:xo,setChartPrimaryValue:Zt,setChartSecondaryValue:Qe,setChartType:O,toggleChart:Mt,toggleTable:Lt}}};var x5=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let a=styles.useTheme(),r=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),n=material.useMediaQuery(a.breakpoints.down("md"),{noSsr:true}),i=ct.useMemo(()=>e==="auto"?r||n?"portrait":"landscape":e,[n,r,e]),[c,d]=ct.useState(t??i==="landscape");ct.useEffect(()=>{d(t??i==="landscape");},[t,i]);let l=g=>{d(g),o?.(g);};return {resolvedOrientation:i,isPortraitViewport:r,isCompactViewport:n,navigationOpen:c,setNavigationOpen:l,toggleNavigationOpen:()=>l(!c)}};var rC=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},k5=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:a})=>{let n=e[0]?.[t],[i,c]=ct.useState(a??n),d=ct.useMemo(()=>e.find(u=>u[t]===i)||e[0],[t,e,i]),[l,s]=ct.useState(()=>{let u=d?.[o];return u==null?"0":String(u)});return {selectedId:i,selectedRecord:d,editorValue:l,setEditorValue:s,selectRecord:u=>{let h=u[t];c(h);let T=u[o];s(T==null?"0":String(T));},applyEditorValue:u=>{if(i===void 0)return;let h=rC(l),T=e.map(p=>p[t]===i?{...p,[o]:h}:p);u(T);}}};var fC=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],lm=(e,t,o,a)=>{t?.(e),a&&o?.();},R5=({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=fC,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:l="Use code",cancelLabel:s="Close",manualPlaceholder:g="Enter barcode manually",onDetected:f,onError:u,sx:h})=>{let T=ct__namespace.default.useRef(null),p=ct__namespace.default.useRef(null),v=ct__namespace.default.useRef(null),m=ct__namespace.default.useRef(null),[y,x]=ct__namespace.default.useState("idle"),[k,F]=ct__namespace.default.useState(""),[S,w]=ct__namespace.default.useState(null),[A,R]=ct__namespace.default.useState(null),C=ct__namespace.default.useCallback(()=>{v.current!==null&&(window.clearInterval(v.current),v.current=null),p.current&&(p.current.getTracks().forEach(P=>P.stop()),p.current=null),T.current&&(T.current.srcObject=null);},[]),D=ct__namespace.default.useCallback(P=>{R(P),x("error"),u?.(P);},[u]);ct__namespace.default.useEffect(()=>{if(!e){C(),x("idle"),R(null),F("");return}let P=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){x("unsupported"),R("Camera access is not supported in this browser.");return}x("starting"),R(null);try{let O=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(P){O.getTracks().forEach(N=>N.stop());return}if(p.current=O,T.current&&(T.current.srcObject=O,await T.current.play()),!window.BarcodeDetector){x("unsupported"),R("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}m.current=new window.BarcodeDetector({formats:r}),x("ready"),v.current=window.setInterval(async()=>{if(!(!T.current||!m.current)&&!(T.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let X=(await m.current.detect(T.current)).find(te=>te.rawValue);if(!X?.rawValue)return;let oe={rawValue:X.rawValue,format:X.format};w(oe),C(),lm(oe,f,t,c);}catch(N){D(N instanceof Error?N.message:"Failed to detect barcode.");}},d);}catch(O){D(O instanceof Error?O.message:"Unable to start camera.");}}})(),()=>{P=true,C();}},[c,n,r,t,f,e,D,d,C]);let I=()=>{let P=k.trim();if(!P)return;let M={rawValue:P,format:"manual"};w(M),lm(M,f,t,c);};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:900},children:o}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2,sx:h,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:a}),jsxRuntime.jsxs(material.Paper,{elevation:0,sx:P=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:P.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:[jsxRuntime.jsx("video",{ref:T,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),jsxRuntime.jsx(material.Box,{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.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:jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"#38bdf8",boxShadow:"0 0 18px rgba(56,189,248,0.85)"}})})}),jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(mC__default.default,{}),label:y==="ready"?"Camera ready":y==="starting"?"Starting camera":y==="unsupported"?"Preview only":y==="error"?"Scanner error":"Idle",size:"small",color:y==="error"?"error":"primary",variant:"filled"}),S?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(gC__default.default,{}),label:`${S.format||"barcode"}: ${S.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),A?jsxRuntime.jsx(material.Alert,{severity:y==="unsupported"?"info":"warning",children:A}):null,i?jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsxRuntime.jsx(material.TextField,{fullWidth:true,label:"Barcode",placeholder:g,value:k,onChange:P=>F(P.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:I,sx:{minHeight:56,px:2.5},children:l})]}):null]})}),jsxRuntime.jsx(material.DialogActions,{sx:{px:3,pb:2},children:jsxRuntime.jsx(material.Button,{onClick:t,children:s})})]})};var xC={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},E5=({title:e,description:t,kicker:o,icon:a,badges:r=[],metrics:n=[],footer:i,children:c,selected:d=false,draggable:l=false,isDragging:s=false,swipeThreshold:g=88,startAction:f,endAction:u,dragHandleProps:h,onClick:T,onSwipe:p,sx:v})=>{let[m,y]=ct.useState(0),[x,k]=ct.useState(false),F=ct.useRef(null),S=ct.useRef(0),w=ct.useRef(0),A=!!(f||u),R=132,C=()=>{y(0),k(false),F.current=null,S.current=0,w.current=0;},D=N=>{(N==="start"?f:u)?.onTrigger?.(),p?.(N),C();},I=N=>{!A||N.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(F.current=N.pointerId,S.current=N.clientX,w.current=N.clientX,k(true),N.currentTarget.setPointerCapture(N.pointerId));},P=N=>{if(!x||F.current!==N.pointerId)return;w.current=N.clientX;let X=w.current-S.current,oe=Math.max(-R,Math.min(R,X));y(oe);},M=N=>{if(!x||F.current!==N.pointerId)return;let X=w.current-S.current;if(X>=g&&f){D("start");return}if(X<=-g&&u){D("end");return}Math.abs(X)<12&&T?.(),C();},O=(N,X)=>{if(!N)return null;let oe=N.backgroundColor||xC[N.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[X]:0,width:R,px:2,display:"flex",alignItems:"center",justifyContent:X==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${oe}, rgba(15,23,42,0.92))`},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[N.icon,jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:N.label})]})})};return jsxRuntime.jsxs(material.Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...v},children:[O(f,"left"),O(u,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:I,onPointerMove:P,onPointerUp:M,onPointerCancel:C,sx:N=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:N.palette.mode==="dark"?"linear-gradient(180deg, rgba(30,41,59,0.96), rgba(15,23,42,0.92))":"linear-gradient(180deg, #ffffff, #f8fafc)",color:"text.primary",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(${s?.985:1})`,transition:x?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:T?"pointer":"default",opacity:s?.9:1}),children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[a?jsxRuntime.jsx(material.Box,{sx:{mt:.25},children:a}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:e}),t?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:t}):null]}),l?jsxRuntime.jsx(material.Box,{"data-no-swipe":"true",...h,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsxRuntime.jsx(material.IconButton,{size:"small",children:jsxRuntime.jsx(bC__default.default,{})})}):null]}),r.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((N,X)=>jsxRuntime.jsx(material.Chip,{label:N,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},X))}):null,n.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(N=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:N.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:N.value})]},N.id))}):null,c,i]})})]})};var ui=({label:e,onPress:t,emphasis:o="default"})=>jsxRuntime.jsx(material.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}),G5=({value:e,defaultValue:t="",title:o,subtitle:a,placeholder:r="0",allowDecimal:n=false,allowNegative:i=false,maxLength:c,confirmLabel:d,clearLabel:l,backspaceLabel:s,onChange:g,onSubmit:f,onClose:u,sx:h})=>{let{t:T}=j(),[p,v]=ct.useState(t),m=e??p,y=C=>{e===void 0&&v(C),g?.(C);},x=C=>{c&&m.length>=c||y(`${m}${C}`);},k=C=>{if(C==="00"){if(!m){y("0");return}x("00");return}x(C);},F=()=>{!n||m.includes(".")||y(m?`${m}.`:"0.");},S=()=>{if(i){if(m.startsWith("-")){y(m.slice(1));return}y(m?`-${m}`:"-");}},w=()=>{y(m.slice(0,-1));},A=()=>{y("");},R=()=>{f?.(m);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...h},children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,a?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:a}):null]}),u?jsxRuntime.jsx(material.IconButton,{onClick:u,size:"small",children:jsxRuntime.jsx(SC__default.default,{})}):null]}),jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{sx:{minHeight:38,fontSize:m?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:m?"text.primary":"text.disabled"},children:m||r})}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(C=>jsxRuntime.jsx(ui,{label:C,onPress:()=>k(C)},C)),jsxRuntime.jsx(ui,{label:i?"+/-":"00",onPress:i?S:()=>k("00")}),jsxRuntime.jsx(ui,{label:"0",onPress:()=>k("0")}),jsxRuntime.jsx(ui,{label:n?".":s?String(s):"DEL",onPress:n?F:w})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:w,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(kC__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:s||"DEL"})]})}),jsxRuntime.jsx(ui,{label:String(l||"CLR"),onPress:A,emphasis:"danger"}),jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:R,sx:C=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:C.palette.primary.main,color:"#fff",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(wC__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||T("common.ok")})]})})]})]})})};var mm=({touchMode:e="comfortable",sx:t,...o})=>{let a=e==="expanded";return jsxRuntime.jsx(material.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:jsxRuntime.jsx(cr,{...o})})};var AC=(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);}},hm=({items:e,selectedId:t,orientation:o="auto",onItemSelect:a,sx:r})=>{let n=styles.useTheme(),[i,c]=ct.useState(false);ct.useEffect(()=>{c(true);},[]);let d=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),l=material.useMediaQuery(n.breakpoints.down("md"),{noSsr:true}),s=o==="auto"?d||l?"portrait":"landscape":o,g=navigation.useRouter();return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:!i||s==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...r},children:e.map(f=>{let u=f.id===t,h=f.color||(u?n.palette.primary.main:n.palette.divider);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:u?"primary.main":"divider",boxShadow:u?"0 18px 40px rgba(37, 99, 235, 0.16)":"none",bgcolor:n.palette.mode==="dark"?"rgba(30,41,59,0.6)":"background.paper"},children:jsxRuntime.jsx(material.Box,{component:"button",type:"button",disabled:f.disabled,onClick:()=>AC(g,f,a),sx:{width:"100%",p:2,minHeight:s==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:f.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,sx:{height:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsx(material.Box,{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:u?"#fff":"text.primary",background:u?h:"action.hover"},children:f.icon||jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900},children:f.title.slice(0,1).toUpperCase()})}),f.badge!==void 0?jsxRuntime.jsx(material.Box,{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:u?"primary.main":"action.hover",color:u?"#fff":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:f.badge}):null]}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:f.title}),f.caption?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:f.caption}):null,f.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:f.description}):null]})]})})},f.id)})})};var vm=(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?vm(a.children,t):[];return (r||n.length>0)&&o.push({...a,children:n.length>0?n:a.children}),o},[]):e,UC=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children?.length&&(t.add(r.id),o(r.children));});};return o(e),t},Cm=({collapsed:e=false,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light",orientation:i="auto",headerSlot:c,footerSlot:d,activeHref:l,onItemSelect:s})=>{let{t:g}=j(),f=styles.useTheme(),u=material.useMediaQuery("(orientation: portrait)"),h=material.useMediaQuery(f.breakpoints.down("md")),T=i==="auto"?u||h?"portrait":"landscape":i,p=n==="dark",v=navigation.useRouter(),m=navigation.usePathname(),[y,x]=ct.useState(""),[k,F]=ct.useState(new Set),S=ct.useMemo(()=>vm(r,y),[r,y]),w=ct.useMemo(()=>y.trim()?UC(S):k,[k,S,y]);ct.useEffect(()=>{e&&F(new Set);},[e]);let A=P=>P.appurl||P.href||"",R=P=>{s?.(P);let M=A(P);if(M){if(M.startsWith("http://")||M.startsWith("https://")){window.open(M,"_blank");return}v.push(M);}},C=P=>{let M=!!P.children?.length;if(e&&M){t?.();return}if(M){F(O=>{let N=new Set(O);return N.has(P.id)?N.delete(P.id):N.add(P.id),N});return}R(P);},D=P=>{let M=l||m,O=A(P);return !!(O&&M===O)},I=(P,M=0)=>{let O=!!P.children?.length,N=w.has(P.id),X=D(P);return jsxRuntime.jsx(material.Box,{sx:{pl:M===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:X?"primary.main":"divider",bgcolor:X?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>C(P),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:[jsxRuntime.jsx(material.Avatar,{variant:"rounded",sx:{width:40,height:40,bgcolor:X?"primary.main":"action.hover",color:X?"#fff":"text.primary"},children:P.icon||(P.title||P.label||"?").slice(0,1).toUpperCase()}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:P.title||P.label}),P.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:P.description}):null]}),O?jsxRuntime.jsx(HC__default.default,{sx:{transform:N?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(GC__default.default,{color:"action"})]}),O?jsxRuntime.jsx(material.Collapse,{in:N,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:P.children?.map(oe=>I(oe,M+1))})}):null]})},P.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:T==="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:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:g("navigation.expand"),children:jsxRuntime.jsx($C__default.default,{})}),r.map(P=>jsxRuntime.jsx(material.IconButton,{onClick:()=>C(P),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:D(P)?"primary.main":"action.hover",color:D(P)?"#fff":"text.primary"},children:P.icon||(P.title||P.label||"?").slice(0,1).toUpperCase()},P.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:T==="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:jsxRuntime.jsxs(material.Stack,{spacing:1.25,sx:{flex:1,minHeight:0},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsxRuntime.jsx(material.TextField,{value:y,onChange:P=>x(P.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(OC__default.default,{fontSize:"small",color:"action"})}}),T==="landscape"&&!e?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(WC__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:S.length>0?S.map(P=>I(P)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),d]})})};var Dm=(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)},XC=e=>ct__namespace.default.isValidElement(e)?jsxRuntime.jsx(material.Box,{sx:{display:"inline-flex",alignItems:"center"},children:e}):jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:e}),QC=(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)},YC=({summaryRow:e,visibleColumns:t,columns:o})=>{let a=o.filter(r=>t.includes(r.id)&&e[r.id]!=="");return a.length===0?null:jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:a.map(r=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:r.label}),jsxRuntime.jsx(material.Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[r.id]})]},`summary-${r.id}`))})]})})},JC=e=>{let{t}=j(),o=styles.useTheme(),{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:T,filterConfig:p,rowKey:v,tableKey:m="default",graphReport:y,quickCreate:x,quickEdit:k,quickDelete:F,serviceUrl:S,orientation:w="auto",cardTitleField:A,cardSubtitleFields:R,toolbarSlot:C,emptyState:D,rowHeight:I="comfortable",cardActionSlot:P,renderCardFooter:M,onRowClick:O}=e,N=a||t("table.title.default"),X=material.useMediaQuery("(orientation: portrait)"),oe=material.useMediaQuery(o.breakpoints.down("md")),te=w==="auto"?X||oe?"portrait":"landscape":w,{columns:re,filterText:Q,setFilterText:U,visibleColumns:Y,showSummary:Re,setShowSummary:Z,summaryColumns:fe,grouping:Se,setGrouping:Ne,expandedGroups:Ke,groupAnchorEl:ve,setGroupAnchorEl:Fe,summaryAnchorEl:xo,setSummaryAnchorEl:Zt,anchorEl:Qe,setAnchorEl:Mt,contextMenu:Lt,sortedAndFilteredRows:bt,summaryRow:H,visibleRows:he,page:pe,setPage:ye,rowsPerPage:Xe,setRowsPerPage:Ve,totalDisplayCount:co,setSelected:vo,handleClick:Co,toggleSummaryColumn:ko,handleExport:So,handleCloseContextMenu:Me,toggleColumnVisibility:ge,toggleGroupExpand:xt,toggleGroupField:Ee,handleExpandGroupRecursively:zt,handleCollapseGroupRecursively:wo,handleLayoutLoad:_a,handleVariantLoad:V,handleLayoutSave:W,effectiveAppId:K,currentLayoutData:be,currentLayoutId:Ce,layoutIdToLoad:Be,graphReportOpen:me,handleOpenGraphReport:Le,handleCloseGraphReport:we}=Qr(e),ze=y?.enabled??false,Ae=ze&&(y?.interaction?.enabled??true),ke=qi(),De=v||"id",Nt=ct__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:styles.alpha(o.palette.divider,o.palette.mode==="dark"?.55:.3),bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.common.white,.06):styles.alpha(o.palette.background.paper,.92),color:o.palette.text.primary,"& .MuiChip-label":{px:1.05}}),[o]),To=ct__namespace.default.useMemo(()=>({...Nt,borderColor:styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.42:.24),bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.primary.main,.16):styles.alpha(o.palette.primary.main,.08)}),[Nt,o]),gt=ct__namespace.default.useMemo(()=>{let z=new Set(i);return bt.filter(J=>z.has(J?.[De]))},[De,i,bt]),vt=gt.length===1?gt[0]:null,po=!!x?.enabled,va=!!k?.enabled,Pr=!!F?.enabled,Io=x?.fields,Xt=x?.excludeFields||[],ja=x?.initialValues||{},Qo=k?.fields,Vt=k?.excludeFields||[],Qt=k?.editableFields||[],At=k?.nonEditableFields||[],Oe=k?.primaryKeys?.length?k.primaryKeys:[De],[Yo,Wo]=ct__namespace.default.useState(false),[Jo,Za]=ct__namespace.default.useState(false),[$o,Xa]=ct__namespace.default.useState({}),[Qa,Ho]=ct__namespace.default.useState(false),[ea,Ca]=ct__namespace.default.useState(false),[Ot,Po]=ct__namespace.default.useState({}),[ta,uo]=ct__namespace.default.useState(false),[Go,Ya]=ct__namespace.default.useState(false),Rr=u||Jo||ea||Go,ka=ct__namespace.default.useMemo(()=>{let z=[...re];if(Array.isArray(Io)&&Io.length>0){let J=new Set(Io);z=z.filter(G=>J.has(G.id));}if(Xt.length>0){let J=new Set(Xt);z=z.filter(G=>!J.has(G.id));}return z.filter(J=>!!J?.id)},[re,Xt,Io]),Ja=ct__namespace.default.useMemo(()=>{let z=[...re];if(Array.isArray(Qo)&&Qo.length>0){let J=new Set(Qo);z=z.filter(G=>J.has(G.id));}if(Vt.length>0){let J=new Set(Vt);z=z.filter(G=>!J.has(G.id));}return z.filter(J=>!!J?.id)},[re,Vt,Qo]),oa=ct__namespace.default.useMemo(()=>new Set(Oe),[Oe]),Ut=ct__namespace.default.useMemo(()=>new Set(Qt),[Qt]),Ro=ct__namespace.default.useMemo(()=>new Set(At),[At]),Dr=ct__namespace.default.useCallback(z=>Ut.size>0?Ut.has(z):!(Ro.has(z)||oa.has(z)),[Ut,Ro,oa]);ct__namespace.default.useEffect(()=>{!me&&ke.hasActiveFilters&&ke.clearAll();},[ke,me]);let er=()=>{let z={};ka.forEach(J=>{z[J.id]=ja[J.id]??"";}),Xa(z),Wo(true);},Mr=(z,J)=>{Xa(G=>({...G,[z]:J}));},Ar=async()=>{if(!x?.onSubmit){Wo(false);return}try{Za(!0),await x.onSubmit($o),Wo(!1);}finally{Za(false);}},Br=()=>{if(!vt)return;let z={};Ja.forEach(G=>{z[G.id]=vt[G.id]??"";});let J=k?.getInitialValues?{...z,...k.getInitialValues(vt)}:z;Po(J),Ho(true);},Yt=(z,J)=>{Po(G=>({...G,[z]:J}));},Fr=async()=>{if(vt){if(!k?.onSubmit){Ho(false);return}try{Ca(!0),await k.onSubmit(Ot,vt),Ho(!1);}finally{Ca(false);}}},Er=()=>{gt.length!==0&&uo(true);},tr=async()=>{if(gt.length===0){uo(false);return}if(!F?.onConfirm){uo(false),vo([]),c?.([]);return}try{Ya(!0),await F.onConfirm(gt),uo(!1),vo([]),c?.([]);}finally{Ya(false);}},aa=bt,{fieldMapping:Sa}=_r({rows:aa,config:{...y,title:y?.title||`${N} ${t("graph.reportTitle")}`}}),wa=ct__namespace.default.useMemo(()=>Ae?ke.applyRows(aa,Sa):aa,[Sa,ke,Ae,aa]),{model:b}=_r({rows:wa,config:{...y,title:y?.title||`${N} ${t("graph.reportTitle")}`,fieldMapping:Sa}}),B=b.table.columns.map(z=>({id:z.id,label:z.label,align:z.align||"left",minWidth:120,numeric:z.align==="right"})),E=K?jsxRuntime.jsx(os,{appId:K,tableKey:m,currentLayoutData:be,onLayoutLoad:_a,targetLayoutId:Be,activeLayoutId:Ce,serviceUrl:S??p?.serviceUrl}):null,$=re.filter(z=>Y.includes(z.id)),ee=$.find(z=>z.id===A)||$[0],ue=R?.map(z=>$.find(J=>J.id===z)).filter(Boolean)||$.filter(z=>z.id!==ee?.id).slice(0,te==="portrait"?2:3),L=$.filter(z=>z.id!==ee?.id&&!ue.some(J=>J.id===z.id)),_=[C,l].filter(Boolean),q=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(zr,{groupAnchorEl:ve,setGroupAnchorEl:Fe,grouping:Se,setGrouping:Ne,columns:re,toggleGroupField:Ee}),jsxRuntime.jsx(Nr,{anchorEl:Qe,setAnchorEl:Mt,columns:re,visibleColumns:Y,toggleColumnVisibility:ge}),jsxRuntime.jsx(Pi,{anchorEl:xo,setAnchorEl:Zt,showSummary:Re,setShowSummary:Z,columns:re,summaryColumns:fe,toggleSummaryColumn:ko}),jsxRuntime.jsx(Ri,{contextMenu:Lt,handleCloseContextMenu:Me,columns:re,visibleColumns:Y,toggleColumnVisibility:ge})]}),_e=(z,J,G)=>{let ie=i.includes(J),We=te==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",Uo=G%2===0?styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.09:.04):styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.05:.022),Bg=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{Co({},z),O?.(z);},sx:{p:I==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:ie?styles.alpha(o.palette.primary.main,.38):Bg,background:ie?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${Uo}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:ie?`0 12px 30px ${styles.alpha(o.palette.primary.main,.2)}`:`0 3px 10px ${styles.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:ie?o.palette.primary.main:G%2===0?styles.alpha(o.palette.primary.main,.26):styles.alpha(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${styles.alpha(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[n?jsxRuntime.jsx(material.Checkbox,{checked:ie,onClick:Jt=>Jt.stopPropagation(),onChange:()=>Co({},z),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[ee?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Dm(ee,z)}):null,ue.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:ue.map(Jt=>jsxRuntime.jsx(material.Chip,{label:`${Jt.label}: ${QC(Jt,z)}`,size:"small",variant:"outlined",sx:Nt},`${J}-${Jt.id}`))}):null]}),P?jsxRuntime.jsx(material.Box,{onClick:Jt=>Jt.stopPropagation(),children:P(z)}):null]}),L.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:We,gap:1},children:L.map(Jt=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.background.default,.7):styles.alpha(o.palette.background.paper,.92),border:"0.1px solid",borderColor:styles.alpha(o.palette.divider,.24)},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:Jt.label}),XC(Dm(Jt,z))]},`${J}-${Jt.id}-detail`))}):null,M?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:Jt=>Jt.stopPropagation(),children:M(z)})]}):null]})},J)};return jsxRuntime.jsxs(material.Box,{sx:{width:g?"100%":"auto",mb:s?0:2,...s?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p?jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(mm,{...p,onVariantLoad:z=>{V(z),p.onVariantLoad?.(z);},appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:be}],currentLayoutId:Ce,layoutRefs:[{tableKey:m,layoutId:Ce}],variantService:p.variantService,serviceUrl:S??p.serviceUrl,touchMode:te==="portrait"?"expanded":"comfortable"})}):null,jsxRuntime.jsxs(material.Paper,{sx:{width:g?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":Rr?{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}:s?{flex:1,minHeight:0,height:"100%"}:{}},children:[r?jsxRuntime.jsx(material.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:jsxRuntime.jsx(ki,{filterText:Q,setFilterText:U,onRowsPerPageChange:Ve,rowsPerPage:Xe,rowsPerPageOptions:h,page:pe,count:co,onPageChange:ye,actions:d,extraTools:_,grouping:Se,setGroupAnchorEl:Fe,showSummary:Re,setShowSummary:Z,setAnchorEl:Mt,setSummaryAnchorEl:Zt,handleExport:So,showCreateButton:po,onOpenCreateDialog:er,showEditButton:va,onOpenEditDialog:Br,editDisabled:gt.length!==1,showDeleteButton:Pr,onOpenDeleteConfirm:Er,deleteDisabled:gt.length===0,onLayoutSave:T||p?.variantService&&p?.appId?W:void 0,loading:u,layoutManager:E,onOpenGraphReport:ze?Le:void 0})}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[he.length===0&&!u?D||jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:t("common.noData")})}):null,he.map((z,J)=>{if(z.type==="group"){let We=Ke.has(z.id);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>xt(z.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",color:"text.primary"},children:[We?jsxRuntime.jsx(HC__default.default,{}):jsxRuntime.jsx(GC__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[z.field,": ",z.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[z.count," records"]})]}),Se.length>1&&z.level<Se.length-1?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.5,children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.expandAll"),onClick:Uo=>{Uo.stopPropagation(),zt(z.id);},sx:To}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:Uo=>{Uo.stopPropagation(),wo(z.id);},sx:To})]}):null]})},z.id)}let G=z.data||z,ie=z.id||G[De]||J;return _e(G,ie,J)}),Re?jsxRuntime.jsx(YC,{summaryRow:H,visibleColumns:Y,columns:re}):null,u?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),po?jsxRuntime.jsxs(material.Dialog,{open:Yo,onClose:()=>!Jo&&Wo(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:x?.title||t("quickCreate.createWithTitle",{title:N})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ka.map(z=>{let J=z.type==="number"||z.numeric?"number":z.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:z.label||z.id,value:$o[z.id]??"",onChange:G=>Mr(z.id,G.target.value),type:J,fullWidth:true,InputLabelProps:{shrink:J==="date"?true:void 0}},`quick-create-${z.id}`)}),x?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:x.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Wo(false),disabled:Jo,children:x?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Ar,variant:"contained",disabled:Jo,children:x?.submitLabel||t("common.save")})]})]}):null,va?jsxRuntime.jsxs(material.Dialog,{open:Qa,onClose:()=>!ea&&Ho(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:k?.title||t("quickEdit.editWithTitle",{title:N})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ja.map(z=>{let J=z.type==="number"||z.numeric?"number":z.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:z.label||z.id,value:Ot[z.id]??"",onChange:G=>Yt(z.id,G.target.value),type:J,disabled:!Dr(z.id),fullWidth:true,InputLabelProps:{shrink:J==="date"?true:void 0}},`quick-edit-${z.id}`)}),k?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:k.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Ho(false),disabled:ea,children:k?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Fr,variant:"contained",disabled:ea||!vt,children:k?.submitLabel||t("common.save")})]})]}):null,Pr?jsxRuntime.jsx(Pn,{open:ta,type:"warning",title:F?.title||t("quickDelete.confirmTitle"),message:F?.message||(gt.length>1?t("quickDelete.confirmMessageMultiple",{count:gt.length}):t("quickDelete.confirmMessageSingle")),confirmText:F?.confirmText||t("common.delete"),cancelText:F?.cancelText||t("common.cancel"),onClose:()=>!Go&&uo(false),onConfirm:tr}):null,q,ze?jsxRuntime.jsx(Ui,{open:me,onClose:we,model:b,aiAssistant:y?.aiAssistant,interaction:Ae?{enabled:true,filters:ke.filters,fieldMapping:Sa,onPrimaryDimensionClick:z=>ke.setFilter("primaryDimension",z),onSecondaryDimensionClick:z=>ke.setFilter("secondaryDimension",z),onStatusClick:z=>ke.setFilter("status",z),onClearFilter:ke.clearFilter,onClearAll:ke.clearAll}:void 0,tableContent:jsxRuntime.jsx(JC,{appId:K||"graph-report-internal",title:t("graph.dataBody"),columns:B,rows:b.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var OF=({appTitle:e,children:t,menuData:o=[],workloadItems:a=[],workloadSelectedId:r,showNavigation:n=true,showWorkloadNav:i=true,orientation:c="auto",logo:d,headerSlot:l,actionSlot:s,portraitBottomSlot:g,contentSx:f,containerSx:u,user:h,onSearch:T,defaultNavigationOpen:p,navOpen:v,onNavOpenChange:m,onWorkloadSelect:y,locale:x="en",localeLabel:k,localeOptions:F,onLocaleChange:S,onUserSetting:w,onUserLogout:A,userMenuItems:R,leftHeaderSlot:C,rightHeaderSlot:D})=>{let I="orbcafe:page-layout-mode",[P,M]=ct.useState("system"),[O,N]=ct.useState("light"),[X,oe]=ct.useState(false),[te,re]=ct.useState(false),Q=P==="system"?te?O:"light":P;ct.useEffect(()=>{oe(true);},[]),ct.useEffect(()=>{try{let Lt=window.localStorage.getItem(I);(Lt==="light"||Lt==="dark"||Lt==="system")&&M(Lt);}catch{}re(true);let Qe=window.matchMedia("(prefers-color-scheme: dark)"),Mt=()=>{N(Qe.matches?"dark":"light");};return Mt(),Qe.addEventListener("change",Mt),()=>Qe.removeEventListener("change",Mt)},[]),ct.useEffect(()=>{if(te)try{window.localStorage.setItem(I,P);}catch{}},[te,P]),ct.useEffect(()=>{Q==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[Q]);let U=ct.useMemo(()=>styles.createTheme({palette:Q==="dark"?{mode:"dark",primary:{main:"#93c5fd"},background:{default:"#060913",paper:"#101826"},text:{primary:"#f8fafc",secondary:"rgba(226,232,240,0.74)"},divider:"rgba(148,163,184,0.18)",action:{hover:"rgba(148,163,184,0.10)",selected:"rgba(59,130,246,0.18)"}}:{mode:"light",background:{default:"#eef3f8",paper:"#ffffff"}},components:{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:Q==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[Q]),Y=material.useMediaQuery("(orientation: portrait)"),Re=material.useMediaQuery(U.breakpoints.down("md")),Z=c==="auto"?!X||Y||Re?"portrait":"landscape":c,[fe,Se]=ct.useState({landscape:p??true,portrait:false}),Ne=fe[Z],Ke=v??Ne,ve=Qe=>{v===void 0&&Se(Mt=>({...Mt,[Z]:Qe})),m?.(Qe);},Fe=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[!X||n&&Z==="portrait"?jsxRuntime.jsx(material.IconButton,{onClick:()=>ve(!Ke),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx($C__default.default,{})}):null,C]}),xo=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[s,D]}),Zt=jsxRuntime.jsx(Cm,{collapsed:Z==="landscape"?!Ke:false,onToggle:()=>ve(!Ke),menuData:o,orientation:Z,colorMode:Q,maxHeight:Z==="landscape"?900:void 0});return jsxRuntime.jsx(styles.ThemeProvider,{theme:U,children:jsxRuntime.jsx(Ci,{locale:x,children:jsxRuntime.jsxs(material.Box,{sx:[Qe=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:Qe.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":Qe.palette.background.default}),...Array.isArray(u)?u:[u]],children:[jsxRuntime.jsx(ks,{appTitle:e,logo:d===void 0?null:d,mode:P,onToggleMode:()=>M(Qe=>Qe==="system"?"dark":Qe==="dark"?"light":"system"),locale:x,localeLabel:k,localeOptions:F,onLocaleChange:S,user:h,onUserSetting:w,onUserLogout:A,userMenuItems:R,onSearch:T,leftSlot:Fe,rightSlot:xo}),l?jsxRuntime.jsx(material.Box,{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:l}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[X&&n&&Z==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:Zt}):null,!X||n&&Z==="portrait"?jsxRuntime.jsx(material.Drawer,{open:Ke,onClose:()=>ve(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Zt}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f},children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[i&&a.length>0?jsxRuntime.jsx(hm,{items:a,selectedId:r,orientation:Z,onItemSelect:y}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:Z==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:U.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)",color:"text.primary"},children:t})]})})]}),Z==="portrait"&&g?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:g})]}):null]})})})};var Lm=bk__default.default(()=>Promise.resolve().then(()=>(Em(),Fm)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function Hc({isRecording:e}){return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsx(framerMotion.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:jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0",children:jsxRuntime.jsx(Lm,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),jsxRuntime.jsx("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:jsxRuntime.jsx(Lm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var _F=Hc;function js({onTextUpdate:e,onComplete:t,onError:o,wsUrl:a="ws://localhost:8765",silenceThresholdMs:r=2e3,minVolumeRms:n=.015}){let[i,c]=ct.useState(false),d=ct.useRef(null),l=ct.useRef(null),s=ct.useRef(null),g=ct.useRef(null),f=ct.useRef(null),u=ct.useRef(0),h=ct.useRef(false),T=ct.useRef(false),p=ct.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),l.current&&(l.current.getTracks().forEach(y=>y.stop()),l.current=null),s.current&&(s.current.close(),s.current=null),T.current=false,c(false);},[]),v=ct.useCallback(()=>{h.current||(h.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(p,500));},[p]),m=ct.useCallback(async()=>{if(!(i||T.current)){T.current=true,h.current=false,u.current=Date.now();try{let y=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});l.current=y;let x=new WebSocket(a);d.current=x,x.onopen=()=>{c(!0),T.current=!1;},x.onmessage=A=>{try{let R=JSON.parse(A.data);if(R.type==="recognition")R.is_final?t(R.text):e?.(R.text);else if(R.type==="error"){let C=R.message||"Voice recognition error";o?.(C),v();}}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 F=new k({sampleRate:16e3});s.current=F;let S=F.createMediaStreamSource(y);f.current=S;let w=F.createScriptProcessor(4096,1,1);g.current=w,w.onaudioprocess=A=>{if(d.current?.readyState!==WebSocket.OPEN)return;let R=A.inputBuffer.getChannelData(0),C=0;for(let P=0;P<R.length;P+=1)C+=R[P]*R[P];if(Math.sqrt(C/R.length)>n)u.current=Date.now();else if(Date.now()-u.current>r&&!h.current){v();return}let I=new Int16Array(R.length);for(let P=0;P<R.length;P+=1){let M=Math.max(-1,Math.min(1,R[P]));I[P]=M<0?M*32768:M*32767;}d.current.send(I.buffer);},S.connect(w),w.connect(F.destination);}catch{o?.("Cannot access microphone"),p();}}},[p,i,n,t,o,e,r,v,a]);return ct.useEffect(()=>p,[p]),{isRecording:i,startRecording:m,stopRecording:v}}var Nm=ct.createContext(null);function Rk(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 Dk({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:a,longPressMs:r=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:l,minVolumeRms:s}){let[g,f]=ct.useState(false),[u,h]=ct.useState(false),T=ct.useRef(null),p=ct.useRef(false),v=ct.useRef(false),m=ct.useCallback(()=>{v.current=false,f(false);},[]),{isRecording:y,startRecording:x,stopRecording:k}=js({wsUrl:d,silenceThresholdMs:l,minVolumeRms:s,onTextUpdate:A=>{o?.(A);},onComplete:async A=>{try{A.trim()&&(h(!0),await t(A.trim()));}catch(R){let C=R instanceof Error?R.message:"Failed to process voice command";a?.(C);}finally{h(!1),m();}},onError:A=>{a?.(A),h(!1),p.current||m();}}),F=ct.useCallback(async()=>{v.current=false,await x();},[x]),S=ct.useCallback(()=>{k();},[k]);ct.useEffect(()=>{if(n)return;let A=C=>{C.isComposing||(C.code==="Space"||C.key===" ")&&(p.current||C.repeat||i&&Rk(document.activeElement)||(p.current=true,C.preventDefault(),T.current=setTimeout(()=>{v.current=true,f(true),x();},r)));},R=C=>{(C.code==="Space"||C.key===" ")&&(T.current&&(clearTimeout(T.current),T.current=null),p.current=false,v.current&&(C.preventDefault(),f(false),k()));};return window.addEventListener("keydown",A),window.addEventListener("keyup",R),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",R),T.current&&(clearTimeout(T.current),T.current=null);}},[n,i,r,x,k]);let w=ct.useMemo(()=>({isRecording:y,isHotkeyRecording:g,isSubmitting:u,startRecording:F,stopRecording:S}),[g,y,u,F,S]);return jsxRuntime.jsxs(Nm.Provider,{value:w,children:[c?jsxRuntime.jsx(Hc,{isRecording:g}):null,e]})}function Mk(){let e=ct.useContext(Nm);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var tE=Dk,oE=Mk;function Ie(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Nk=({content:e,theme:t="light",size:o="base",defaultExpanded:a=false})=>{let[r,n]=ct.useState(a),i=ct.useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("span",{className:"mr-2",children:"\u{1F914}"}),jsxRuntime.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"})]}),jsxRuntime.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:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsxRuntime.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})]})},Vm=Nk;var Kk=({content:e,language:t="text",isStreaming:o=false,className:a=""})=>{let{theme:r}=nextThemes.useTheme(),[n,i]=ct.useState(false),c=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3);}catch(l){console.error("\u590D\u5236\u5931\u8D25:",l);}},d=r==="dark"?prism.oneDark:prism.oneLight;return jsxRuntime.jsxs("div",{className:Ie("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",a),children:[jsxRuntime.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:[jsxRuntime.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 uppercase",children:t}),jsxRuntime.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?jsxRuntime.jsx(lucideReact.Check,{size:14,className:"text-green-500"}):jsxRuntime.jsx(lucideReact.Clipboard,{size:14,className:"text-gray-500 dark:text-gray-400"})})]}),jsxRuntime.jsx("div",{className:"text-sm",children:jsxRuntime.jsx(reactSyntaxHighlighter.Prism,{language:t,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:r==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},Wm=Kk;var Zk=({content:e,isLoading:t,className:o="",style:a})=>{let r=ct.useRef(null),[n,i]=ct.useState(false),[c,d]=ct.useState(null),{theme:l}=nextThemes.useTheme();return ct.useEffect(()=>{let s=async()=>{if(!(!e.trim()||!r.current)){i(true),d(null);try{Hm__default.default.initialize({startOnLoad:!1,theme:l==="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:h}=await Hm__default.default.render(f,u);r.current&&(r.current.innerHTML=h);}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(()=>{s();},100);return ()=>clearTimeout(g)},[e,l]),t||n?jsxRuntime.jsx("div",{className:`mermaid-block loading ${o}`,style:a,children:jsxRuntime.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:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500 mr-2"}),jsxRuntime.jsx("span",{className:"text-sm text-gray-500",children:"Generating Diagram..."})]})}):c?jsxRuntime.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:[jsxRuntime.jsx("p",{className:"font-semibold mb-2",children:"Mermaid Error:"}),jsxRuntime.jsx("pre",{children:c}),jsxRuntime.jsx("pre",{className:"mt-4 text-xs text-gray-500",children:e})]}):jsxRuntime.jsx("div",{className:`mermaid-block overflow-x-auto ${o}`,style:a,ref:r})},Um=Zk;var tS=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:a,icon:r,closable:n=true,onClose:i,onRetry:c,className:d="",...l})=>{let[s,g]=ct.useState(false),[f,u]=ct.useState(false),h=async()=>{if(c){u(true);try{await c();}catch(T){console.error("\u91CD\u8BD5\u5931\u8D25:",T);}finally{u(false);}}};return jsxRuntime.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}`,...l,children:[jsxRuntime.jsxs("div",{className:"flex p-4 border-l-4 border-l-red-500 bg-red-50 dark:bg-red-900/10",children:[jsxRuntime.jsx("div",{className:"flex-shrink-0 mr-3 text-red-500 mt-0.5",children:r||jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.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&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 leading-relaxed",children:typeof t=="string"?jsxRuntime.jsx("p",{className:"whitespace-pre-wrap",children:t}):t}),(c||a)&&jsxRuntime.jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[c&&jsxRuntime.jsxs("button",{onClick:h,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:[jsxRuntime.jsx(lucideReact.RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),a&&jsxRuntime.jsxs("button",{onClick:()=>g(!s),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:[s?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),s?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),n&&i&&jsxRuntime.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:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),a&&s&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 border-t border-gray-100 dark:border-gray-800",children:jsxRuntime.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})})]})},Zs=tS;var sS=({title:e="\u8B66\u544A",content:t,warningType:o,severity:a="warning",warnings:r=[],icon:n,closable:i=true,onClose:c,onConfirm:d,actionText:l,className:s="",...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 jsxRuntime.jsx(lucideReact.Info,{className:"w-5 h-5"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});case "success":return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-5 h-5"})}},h=f();return jsxRuntime.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 ${s}`,...g,children:[jsxRuntime.jsxs("div",{className:`flex p-4 border-l-4 ${h.borderLeftColor} ${h.bgColor}`,children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${h.iconColor}`,children:n||u()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.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&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),r&&r.length>0&&jsxRuntime.jsx("ul",{className:"mt-2 space-y-1",children:r.map((T,p)=>jsxRuntime.jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsxRuntime.jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsxRuntime.jsx("span",{children:T})]},p))})]}),i&&c&&jsxRuntime.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:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),d&&jsxRuntime.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:jsxRuntime.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:l||"\u786E\u8BA4"})})]})},Xs=sS;var pS=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:a,maxDisplay:r=5,icon:n,closable:i=false,onClose:c,className:d="",...l})=>{let[s,g]=ct.useState(false),[f,u]=ct.useState(""),[h,T]=ct.useState(false),p=ct.useMemo(()=>f.trim()?o.filter(y=>y.toLowerCase().includes(f.toLowerCase())):o,[o,f]),v=ct.useMemo(()=>s?p:p.slice(0,r),[p,s,r]),m=y=>{a?.(y);};return !o||o.length===0?null:jsxRuntime.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}`,...l,children:[jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2.5",children:[jsxRuntime.jsx("div",{className:"text-blue-500 flex-shrink-0",children:n||jsxRuntime.jsx(lucideReact.Lightbulb,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:e}),t&&jsxRuntime.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[o.length>3&&jsxRuntime.jsx("button",{onClick:()=>T(!h),className:`p-1.5 rounded-md transition-colors ${h?"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:h?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:jsxRuntime.jsx(lucideReact.Search,{className:"w-4 h-4"})}),i&&c&&jsxRuntime.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:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),h&&jsxRuntime.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:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:f,onChange:y=>u(y.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}),jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsx("ul",{className:"space-y-1",children:v.map((y,x)=>jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{onClick:()=>m(y),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:[jsxRuntime.jsx("span",{children:y}),jsxRuntime.jsx(lucideReact.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&&jsxRuntime.jsx("button",{onClick:()=>g(!s),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:s?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${p.length})`}),p.length===0&&f&&jsxRuntime.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"})]})]})},Qs=pS;var bS=({title:e,content:t,toolName:o,parameters:a,result:r,status:n,duration:i,icon:c,closable:d=false,onClose:l,onAction:s,actionText:g,className:f="",...u})=>{let[h,T]=ct.useState(false),[p,v]=ct.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"}}},y=()=>{switch(n){case "pending":return jsxRuntime.jsx(lucideReact.Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"})}},x=S=>S?S<1e3?`${S}ms`:`${(S/1e3).toFixed(2)}s`:"",k=m(),F=e||o||"\u5DE5\u5177\u8C03\u7528";return jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-3",children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 ${k.iconColor}`,children:c||y()}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:F}),jsxRuntime.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${k.badgeBg} ${k.badgeText}`,children:k.label})]}),o&&e&&jsxRuntime.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center mt-0.5",children:[jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3 h-3 mr-1"}),o]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[i&&jsxRuntime.jsxs("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-3 h-3 mr-1"}),x(i)]}),d&&l&&jsxRuntime.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1 rounded",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:t}),a&&jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsxs("button",{onClick:()=>T(!h),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:[h?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Box,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),h&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.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&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{onClick:()=>v(!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?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),p&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.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)})})]}),s&&jsxRuntime.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-800 flex justify-end",children:jsxRuntime.jsx("button",{onClick:s,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"})})]})]})},Ys=bS;var vS=({data:e})=>{if(!e)return null;let t=ct.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?jsxRuntime.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"}):jsxRuntime.jsx("div",{className:"w-full my-4",children:jsxRuntime.jsx(Fa,{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]})})},Js=vS;var DS=({title:e,subtitle:t,data:o,type:a,config:r={}})=>{let n=()=>{switch(a){case "bar-chart-card":return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4 text-blue-500"});case "line-chart-card":return jsxRuntime.jsx(lucideReact.LineChart,{className:"w-4 h-4 text-green-500"});case "pie-chart-card":return jsxRuntime.jsx(lucideReact.PieChart,{className:"w-4 h-4 text-purple-500"});case "combo-chart-card":return jsxRuntime.jsx(lucideReact.Activity,{className:"w-4 h-4 text-orange-500"});case "heatmap-chart-card":return jsxRuntime.jsx(lucideReact.Grid,{className:"w-4 h-4 text-red-500"});case "fishbone-chart-card":return jsxRuntime.jsx(lucideReact.GitBranch,{className:"w-4 h-4 text-indigo-500"});case "waterfall-chart-card":return jsxRuntime.jsx(lucideReact.TrendingDown,{className:"w-4 h-4 text-teal-500"});case "google-map-card":return jsxRuntime.jsx(lucideReact.Globe,{className:"w-4 h-4 text-blue-600"});case "amap-card":return jsxRuntime.jsx(lucideReact.MapPin,{className:"w-4 h-4 text-blue-600"});default:return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"})}},i=()=>{if(!o&&a!=="google-map-card"&&a!=="amap-card")return jsxRuntime.jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(a){case "bar-chart-card":return jsxRuntime.jsx(Bn,{data:o,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsxRuntime.jsx(Nd,{data:o,color:r.color,valueSuffix:r.valueSuffix||"",height:r.height});case "pie-chart-card":let c=o.reduce((l,s)=>l+(Number(s.value)||0),0),d=o.map(l=>({name:l.name,value:Number(l.value)||0,percent:typeof l.percent=="number"?l.percent:c>0?(Number(l.value)||0)/c*100:0}));return jsxRuntime.jsx(zi,{data:d,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsxRuntime.jsx(Vd,{data:o,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(Wd,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(Hd,{branches:o,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(Ud,{data:o,height:r.height});case "google-map-card":return jsxRuntime.jsx(_d,{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 jsxRuntime.jsx(Qd,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,keyword:r.keyword||o&&o[0]?.keyword||e,height:r.height});default:return jsxRuntime.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),jsxRuntime.jsx("div",{className:"text-red-500 text-sm p-4 text-center",children:"Error rendering chart"})}};return jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsx("div",{className:"mr-2 flex-shrink-0",children:n()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:t})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:"overflow-x-auto",children:i()}),jsxRuntime.jsx("div",{className:"mt-3",children:jsxRuntime.jsxs("details",{className:"text-xs text-gray-500 dark:text-gray-400",children:[jsxRuntime.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"}),jsxRuntime.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)})]})})]})]})},el=DS;var AS=({type:e,manifest:t})=>jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsx(lucideReact.Box,{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400"}),jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["SAP Card: ",e]})]}),jsxRuntime.jsx("div",{className:"p-4",children:jsxRuntime.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:jsxRuntime.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})})})]}),ol=AS;var al=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 NS=({content:e,theme:t,size:o="base",className:a,enableCodeHighlight:r=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=ct.useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,u)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(u.trim())}"></div>`):"",[e]),l=(f,u,h,T,p)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:u,title:h,payload:T,rawData:p});},s=(f,u,h,T,p,v)=>{if(!(!p&&!c?.onCardEvent))return (...m)=>{let y=p?.(...m),x=v?v(...m):void 0;return l(f,u,h,x,T),y}},g=ct.useMemo(()=>({div(f){let{"data-component":u,"data-think-content":h,...T}=f;return u==="thinkbox"&&h?jsxRuntime.jsx(Vm,{content:decodeURIComponent(h),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...T})},table({children:f}){return jsxRuntime.jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-800",children:jsxRuntime.jsx("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:f})})},thead({children:f}){return jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/60",children:f})},tbody({children:f}){return jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-950",children:f})},tr({children:f}){return jsxRuntime.jsx("tr",{className:"border-b border-gray-200 dark:border-gray-800 last:border-b-0",children:f})},th({children:f,align:u}){return jsxRuntime.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 jsxRuntime.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:h,...T}){let p=/language-([\w-]+)/.exec(u||""),v=p?p[1]:"";if(f)return jsxRuntime.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",...T,children:h});let m=String(h).replace(/\n$/,"");if(n&&v==="mermaid")return jsxRuntime.jsx(Um,{content:m});if(v==="json"){let y=al(m);if(y)switch(y.type){case "table":return jsxRuntime.jsx(Js,{data:y.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 jsxRuntime.jsx(el,{...y});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(ol,{...y});case "error-card":{let x=y;return jsxRuntime.jsx(Zs,{...x,onClose:s("error-card","close",x.title,x,x.onClose),onRetry:s("error-card","retry",x.title,x,x.onRetry)})}case "warning-card":{let x=y,k=x.onConfirm?s("warning-card","confirm",x.title,x,x.onConfirm):x.actionText&&c?.onCardEvent?s("warning-card","confirm",x.title,x):void 0;return jsxRuntime.jsx(Xs,{...x,onClose:s("warning-card","close",x.title,x,x.onClose),onConfirm:k})}case "suggestions-card":{let x=y;return jsxRuntime.jsx(Qs,{...x,onClose:s("suggestions-card","close",x.title,x,x.onClose),onSuggestionClick:s("suggestions-card","suggestion-click",x.title,x,x.onSuggestionClick,k=>({suggestion:k}))})}case "tool-result-card":{let x=y;return jsxRuntime.jsx(Ys,{...x,onClose:s("tool-result-card","close",x.title,x,x.onClose),onAction:s("tool-result-card","action",x.title,x,x.onAction)})}}}return r?jsxRuntime.jsx(Wm,{content:m,language:v,className:"not-prose"}):jsxRuntime.jsx("code",{className:u,...T,children:h})}}),[t,o,n,r,c,i]);return jsxRuntime.jsx("div",{className:Ie("markdown-body prose dark:prose-invert max-w-none",a),children:jsxRuntime.jsx(BS__default.default,{remarkPlugins:[FS__default.default,ES__default.default],rehypePlugins:[LS__default.default,zS__default.default],components:g,children:d})})},rl=NS;var VS=({content:e,messageId:t,cardHooks:o})=>{let a=(i,c,d,l,s)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:c,title:d,payload:l,rawData:s});},r=(i,c,d,l,s,g)=>{if(!(!s&&!o?.onCardEvent))return (...f)=>{let u=s?.(...f),h=g?g(...f):void 0;return a(i,c,d,h,l),u}},n=al(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(Js,{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 jsxRuntime.jsx(el,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(ol,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(Zs,{...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 jsxRuntime.jsx(Xs,{...i,onClose:r("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(Qs,{...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 jsxRuntime.jsx(Ys,{...i,onClose:r("tool-result-card","close",i.title,i,i.onClose),onAction:r("tool-result-card","action",i.title,i,i.onAction)})}}return jsxRuntime.jsx("div",{className:"dynamic-card-fallback",children:jsxRuntime.jsx(rl,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},eg=VS;var Qc=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"}}},WS=({content:e,className:t="",messageId:o,cardHooks:a})=>{let r=ct__namespace.default.useMemo(()=>Qc.analyze(e),[e]);return jsxRuntime.jsx("div",{className:`universal-content-renderer ${t}`,children:r.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsxRuntime.jsx(eg,{content:n.content,messageId:o,cardHooks:a},`block-${i}`):jsxRuntime.jsx(rl,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:a},`block-${i}`))})},tg=WS;var $S=({content:e,isStreaming:t=true,onComplete:o,className:a="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,l]=ct.useState(t?0:e.length),[s,g]=ct.useState(!t);ct.useEffect(()=>{if(t){l(0),g(false);return}l(e.length),g(true);},[e,t]),ct.useEffect(()=>{if(!t||s)return;if(d>=e.length){g(true),o?.();return}let p=window.setTimeout(()=>{l(v=>Math.min(v+n,e.length));},r);return ()=>{window.clearTimeout(p);}},[e.length,s,t,o,n,r,d]);let f=()=>{t&&!s&&(l(e.length),g(true),o?.());},u=t?e.slice(0,d):e,h=t&&!s,T=t&&!s;return jsxRuntime.jsxs("div",{className:`streaming-markdown ${a}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(tg,{content:u,messageId:i,cardHooks:c}),h&&jsxRuntime.jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),T&&jsxRuntime.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"})]})},ng=$S;var ig=({buttons:e,className:t})=>{let o=a=>{switch(a){case "copy":return jsxRuntime.jsx(lucideReact.Copy,{size:14});case "refresh":return jsxRuntime.jsx(lucideReact.RefreshCw,{size:14});case "volume":return jsxRuntime.jsx(lucideReact.Volume2,{size:14});case "like":return jsxRuntime.jsx(lucideReact.ThumbsUp,{size:14});case "dislike":return jsxRuntime.jsx(lucideReact.ThumbsDown,{size:14});default:return null}};return jsxRuntime.jsx("div",{className:Ie("flex items-center gap-1",t),children:e.map((a,r)=>jsxRuntime.jsx("button",{onClick:a.onClick,disabled:a.disabled,className:Ie("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 nl=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:a,streamChunkSize:r,cardHooks:n})=>e.type==="assistant"?jsxRuntime.jsx("div",{className:"flex justify-start mb-4",children:jsxRuntime.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:[jsxRuntime.jsx(ng,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:a,streamChunkSize:r,messageId:e.id,cardHooks:n}),e.content&&o?.isLatestAssistant&&jsxRuntime.jsx("div",{className:"flex flex-row justify-start gap-2 mt-3 pt-2 border-t border-gray-100 dark:border-gray-700",children:jsxRuntime.jsx(ig,{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"})}),jsxRuntime.jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})}):jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.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:[jsxRuntime.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}),jsxRuntime.jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})});var lg=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:a,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:c}=js({onTextUpdate:e,onComplete:l=>{t?.(l);},onError:l=>{console.error("Voice input error:",l),o?.();}});return jsxRuntime.jsx("button",{onClick:async()=>{n?c():await i();},disabled:a,className:Ie("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?jsxRuntime.jsx(jS__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(_S__default.default,{sx:{fontSize:24}})})};var dt={container:"w-full max-w-4xl mx-auto",inputContainer:Ie("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:Ie("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:Ie("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:Ie("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:Ie("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:Ie("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:Ie("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},ow={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},aw=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:Ie(dt.buttonBase,dt.buttonSmall,dt.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(ew__default.default,{sx:{fontSize:24}})}),rw=()=>jsxRuntime.jsxs("button",{className:Ie(dt.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",dt.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(tw__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),nw=({canSend:e,isResponding:t,onSend:o,onStop:a})=>t?jsxRuntime.jsx("button",{className:Ie(dt.buttonBase,dt.buttonSmall,dt.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:Ie(dt.buttonBase,dt.buttonSmall,e?dt.sendButton:dt.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(JS__default.default,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),cg=({onSend:e,onStop:t,isResponding:o=false,placeholder:a,getText:r})=>{let[n,i]=ct.useState(""),[c,d]=ct.useState([]),[l,s]=ct.useState(false),[g,f]=ct.useState(false),u=ct.useRef(null),h=a||(r?r("00019","Type a message..."):"Type a message..."),T=(n.trim().length>0||c.length>0)&&!o,p={enabled:true},v=ct.useCallback(M=>{i(M.target.value),M.target.style.height="auto",M.target.style.height=`${Math.min(M.target.scrollHeight,200)}px`;},[]),m=ct.useCallback(M=>{if(M.target.files&&M.target.files.length>0){let O=Array.from(M.target.files);d(N=>{let X=O.filter(te=>N.some(re=>re.name===te.name&&re.size===te.size));X.length>0&&console.warn("Duplicate files ignored:",X.map(te=>te.name));let oe=O.filter(te=>!N.some(re=>re.name===te.name&&re.size===te.size));return [...N,...oe]}),u.current&&(u.current.value="");}},[]),y=ct.useCallback(M=>{d(O=>O.filter((N,X)=>X!==M));},[]),x=ct.useCallback(()=>{u.current?.click();},[]),k=ct.useCallback(async()=>{if(!T)return;let M=n,O=[...c];i(""),d([]),u.current&&(u.current.value="");try{await e(M,O);}catch(N){console.error("Failed to send message:",N),i(M),d(O);}},[n,T,e,c]),F=ct.useCallback(M=>{M.key==="Enter"&&!M.shiftKey&&!l&&(M.preventDefault(),k());},[k,l]),S=ct.useCallback(()=>{s(true);},[]),w=ct.useCallback(()=>{s(false);},[]),A=ct.useCallback(M=>{i(M);},[]),R=ct.useCallback(M=>{i(M);},[]),C=ct.useCallback(()=>{},[]),D=ct.useCallback(M=>{M.preventDefault(),f(true);},[]),I=ct.useCallback(M=>{M.preventDefault(),f(false);},[]),P=ct.useCallback(M=>{if(M.preventDefault(),f(false),M.dataTransfer.files&&M.dataTransfer.files.length>0){let O=Array.from(M.dataTransfer.files);d(N=>[...N,...O]);}},[]);return jsxRuntime.jsx("div",{className:dt.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:u,onChange:m}),jsxRuntime.jsxs("div",{className:Ie(dt.inputContainer,g&&dt.dragActive),style:{borderRadius:"32px"},onDragOver:D,onDragLeave:I,onDrop:P,children:[c.length>0&&jsxRuntime.jsx("div",{className:dt.filePreviewArea,children:c.map((M,O)=>jsxRuntime.jsxs("div",{className:dt.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:M.name}),jsxRuntime.jsx("button",{onClick:()=>y(O),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsxRuntime.jsx(iconsMaterial.Close,{sx:{fontSize:16}})})]},`${M.name}-${O}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:Ie(dt.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:Ie(dt.textarea,"min-h-[24px] py-0 px-0"),placeholder:h,value:n,onChange:v,onKeyDown:F,onCompositionStart:S,onCompositionEnd:w,style:ow,"aria-label":"Message input",spellCheck:false,rows:1})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-1 pb-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[jsxRuntime.jsx(aw,{enabled:p.enabled,onClick:x}),jsxRuntime.jsx(rw,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lg,{onTextUpdate:A,onComplete:R,onCancel:C,disabled:o,className:dt.buttonSmall}),jsxRuntime.jsx(nw,{canSend:T,isResponding:o,onSend:k,onStop:t})]})]})]})]})]})})};var ug=({messages:e,onSend:t,onStop:o,onRegenerate:a,isResponding:r=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:l,cardHooks:s,showInput:g=true})=>{let f=ct.useRef(null),u=ct.useRef(e.length);return ct.useEffect(()=>{e.length>u.current&&f.current?.scrollIntoView({behavior:"smooth"}),u.current=e.length;},[e]),jsxRuntime.jsxs("div",{className:Ie("flex flex-col h-full w-full relative",n),children:[jsxRuntime.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((h,T)=>{let p=h.type==="assistant"&&T===e.length-1,v=h.type==="assistant"?{isLatestAssistant:p,onRegenerate:a?()=>a(h.id):void 0}:void 0;return jsxRuntime.jsx(nl,{message:h,assistantActions:v,onStreamingComplete:()=>l?.(h.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:s},h.id)}),jsxRuntime.jsx("div",{ref:f})]}),g&&jsxRuntime.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:jsxRuntime.jsx(cg,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:r,placeholder:i})})]})};var so={};var lw={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},Pz=({title:e="AI Agent",description:t,headerActions:o,className:a,agentStatus:r,showInput:n=false,...i})=>{let c=r??(i.isResponding?"running":"idle");return jsxRuntime.jsxs("div",{className:Ie("relative flex h-full w-full",so.agentPanel,a),"data-status":c,children:[jsxRuntime.jsx("div",{className:so.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:so.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:Ie(so.edge,so.top)}),jsxRuntime.jsx("span",{className:Ie(so.edge,so.right)}),jsxRuntime.jsx("span",{className:Ie(so.edge,so.bottom)}),jsxRuntime.jsx("span",{className:Ie(so.edge,so.left)})]}),jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.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:[jsxRuntime.jsx("span",{className:so.statusDot,"data-status":c}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:lw[c]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(ug,{...i,showInput:n})})]})]})};var mw={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},Lz=({messages:e,onSend:t,onRegenerate:o,isResponding:a=false,className:r,placeholder:n,title:i="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:l,onPlusClick:s,onMicClick:g,streamIntervalMs:f,streamChunkSize:u,onMessageStreamingComplete:h,cardHooks:T})=>{let[p,v]=ct.useState(""),[m,y]=ct.useState(false),x=ct.useRef(null),k=mw[c];ct.useEffect(()=>{x.current?.scrollIntoView({behavior:"smooth"});},[e,a]);let F=ct.useCallback(async()=>{let w=p.trim();!w||a||(v(""),await t(w));},[a,t,p]),S=ct.useCallback(async w=>{w.key==="Enter"&&!m&&(w.preventDefault(),await F());},[F,m]);return jsxRuntime.jsxs("div",{className:Ie("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&&jsxRuntime.jsx("button",{onClick:d,className:Ie("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:jsxRuntime.jsx("span",{className:Ie("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]")})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-gray-800",onPointerDown:l,children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsx("h3",{className:"text-base font-semibold tracking-tight text-gray-900 dark:text-gray-100",children:i})}),jsxRuntime.jsx("div",{})]}),jsxRuntime.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,A)=>{let R=w.type==="assistant"&&A===e.length-1,C=w.type==="assistant"?{isLatestAssistant:R,onRegenerate:o?()=>o(w.id):void 0}:void 0;return jsxRuntime.jsx(nl,{message:w,assistantActions:C,onStreamingComplete:()=>h?.(w.id),streamIntervalMs:f,streamChunkSize:u,cardHooks:T},w.id)}),jsxRuntime.jsx("div",{ref:x})]}),jsxRuntime.jsx("div",{className:"border-t border-gray-100 px-3 py-3 dark:border-gray-800",children:jsxRuntime.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:[jsxRuntime.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:s,type:"button","aria-label":"Add",children:jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4"})}),jsxRuntime.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=>v(w.target.value),onCompositionStart:()=>y(true),onCompositionEnd:()=>y(false),onKeyDown:S,"aria-label":"Copilot input",spellCheck:false}),jsxRuntime.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:jsxRuntime.jsx(lucideReact.Mic,{className:"h-4 w-4"})})]})})]})};var Oz=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:a}={})=>{let[r,n]=ct.useState(e),[i,c]=ct.useState(false),d=ct.useCallback(async u=>{c(true);try{await u?.();}finally{c(false);}},[]),l=ct.useCallback(u=>d(()=>t?.(u)),[t,d]),s=ct.useCallback(u=>d(()=>o?.(u)),[o,d]),g=ct.useCallback(u=>d(()=>a?.(u)),[a,d]),f=ct.useMemo(()=>({mode:r,loading:i,onModeChange:n,onLogin:l,onRegister:s,onForgotPassword:g}),[g,l,s,i,r]);return {mode:r,loading:i,setMode:n,authPageProps:f}};var ed=({label:e,...t})=>jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{...t}),label:e});var bi=ct.forwardRef((e,t)=>jsxRuntime.jsx(material.Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));bi.displayName="CPaper";var Iw={productName:"ORBCAFE",headline:"Operational workbench",subheadline:"A focused entry point for reports, planning, agent workflows, and enterprise operations.",loginTitle:"Sign in",loginSubtitle:"Use your workspace account to continue.",registerTitle:"Create account",registerSubtitle:"Request a demo workspace user for evaluation.",forgotTitle:"Reset password",forgotSubtitle:"Send a password reset request to your email address."},nN=({mode:e,defaultMode:t="login",onModeChange:o,onLogin:a,onRegister:r,onForgotPassword:n,loading:i=false,logo:c,copy:d,sx:l})=>{let s=material.useTheme(),g=e!==void 0,[f,u]=ct.useState(t),h=e??f,T=ct.useMemo(()=>({...Iw,...d}),[d]),[p,v]=ct.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[m,y]=ct.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[x,k]=ct.useState({email:""}),[F,S]=ct.useState(""),w=P=>{g||u(P),S(""),o?.(P);},A=async P=>{P.preventDefault(),await a?.(p),S("Demo login accepted. No real authentication request was sent.");},R=async P=>{P.preventDefault(),await r?.(m),S("Demo registration saved locally for this screen.");},C=async P=>{P.preventDefault(),await n?.(x),S("Demo reset link request created. No email was sent.");},D=h==="login"?T.loginTitle:h==="register"?T.registerTitle:T.forgotTitle,I=h==="login"?T.loginSubtitle:h==="register"?T.registerSubtitle:T.forgotSubtitle;return jsxRuntime.jsxs(material.Box,{sx:{minHeight:"100vh",display:"grid",gridTemplateColumns:{xs:"1fr",md:"minmax(320px, 0.9fr) minmax(420px, 1.1fr)"},background:s.palette.mode==="dark"?"linear-gradient(135deg, #071018 0%, #151515 48%, #101827 100%)":"linear-gradient(135deg, #eef3f8 0%, #ffffff 52%, #e8f2f0 100%)",...l},children:[jsxRuntime.jsxs(material.Box,{sx:{display:{xs:"none",md:"flex"},flexDirection:"column",justifyContent:"space-between",p:{md:6,lg:8},borderRight:`1px solid ${s.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{spacing:4,children:[jsxRuntime.jsx(material.Box,{children:c}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:14,fontWeight:700,color:"primary.main",textTransform:"uppercase"},children:T.productName}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:T.headline}),jsxRuntime.jsx(material.Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:T.subheadline})]})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:2,sx:{color:"text.secondary",fontSize:13},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Reports"}),jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Planning"}),jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Agent UI"})]})]}),jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:{xs:2,sm:4,md:6}},children:jsxRuntime.jsx(bi,{elevation:0,sx:{width:"100%",maxWidth:460,m:0,p:{xs:2.5,sm:4},borderRadius:3,border:`1px solid ${s.palette.divider}`,backgroundColor:s.palette.mode==="dark"?"rgba(15, 23, 42, 0.86)":"rgba(255, 255, 255, 0.88)",backdropFilter:"blur(18px)",boxShadow:s.palette.mode==="dark"?"0 24px 80px rgba(0,0,0,0.34)":"0 24px 80px rgba(15,23,42,0.10)"},children:jsxRuntime.jsxs(material.Stack,{spacing:3,children:[jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Box,{sx:{display:{xs:"block",md:"none"},mb:1},children:c}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:28,fontWeight:800},children:D}),jsxRuntime.jsx(material.Typography,{sx:{color:"text.secondary"},children:I})]}),F&&jsxRuntime.jsx(material.Alert,{severity:"success",children:F}),h==="login"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:A,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Wt,{label:"Email or user ID",value:p.username,onChange:P=>v(M=>({...M,username:P.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(bg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Wt,{label:"Password",type:"password",value:p.password,onChange:P=>v(M=>({...M,password:P.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(ww__default.default,{fontSize:"small"})})}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsxRuntime.jsx(ed,{label:"Remember me",checked:p.remember,onChange:P=>v(M=>({...M,remember:P.target.checked}))}),jsxRuntime.jsx(Do,{type:"button",variant:"text",size:"small",onClick:()=>w("forgot"),children:"Forgot?"})]}),jsxRuntime.jsx(Do,{type:"submit",size:"large",disabled:i,children:"Sign in"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["New user?"," ",jsxRuntime.jsx(Do,{type:"button",variant:"text",size:"small",onClick:()=>w("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),h==="register"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:R,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Wt,{label:"Full name",value:m.name,onChange:P=>y(M=>({...M,name:P.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(bg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Wt,{label:"Work email",type:"email",value:m.email,onChange:P=>y(M=>({...M,email:P.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(yg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Wt,{label:"Password",type:"password",value:m.password,onChange:P=>y(M=>({...M,password:P.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Tw__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Wt,{label:"Confirm password",type:"password",value:m.confirmPassword,onChange:P=>y(M=>({...M,confirmPassword:P.target.value}))}),jsxRuntime.jsx(ed,{label:"I accept the demo workspace terms",checked:m.acceptedTerms,onChange:P=>y(M=>({...M,acceptedTerms:P.target.checked}))}),jsxRuntime.jsx(Do,{type:"submit",size:"large",disabled:i,children:"Create demo account"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Already have an account?"," ",jsxRuntime.jsx(Do,{type:"button",variant:"text",size:"small",onClick:()=>w("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),h==="forgot"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:C,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Wt,{label:"Work email",type:"email",value:x.email,onChange:P=>k({email:P.target.value}),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(yg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Do,{type:"submit",size:"large",disabled:i,children:"Send reset request"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Remember your password?"," ",jsxRuntime.jsx(Do,{type:"button",variant:"text",size:"small",onClick:()=>w("login"),sx:{minWidth:0,p:0},children:"Back to sign in"})]})]})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:"Demo credentials: demo@orbcafe.local / orbcafe-demo"})]})})})]})};var Dw={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},Mw=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],dN=({tasks:e,defaultScale:t="week",defaultSelectedTaskId:o,initialFilters:a})=>{let[r,n]=ct.useState(t),[i,c]=ct.useState(o??e[0]?.id??""),[d,l]=ct.useState({...Dw,...a}),s=ct.useMemo(()=>{let h=String(d.keyword?.value??"").trim().toLowerCase(),T=String(d.status?.value??"").trim(),p=String(d.owner?.value??"").trim().toLowerCase(),v=String(d.workCenter?.value??"").trim().toLowerCase(),m=d.dateRange?.value,y=m?.[0]?Ua__default.default(m[0]):null,x=m?.[1]?Ua__default.default(m[1]):null;return e.filter(k=>{if(h&&![k.id,k.code,k.title,k.project,k.workCenter,k.owner?.name].join(" ").toLowerCase().includes(h)||T&&k.status!==T||p&&!String(k.owner?.name??"").toLowerCase().includes(p)||v&&!String(k.workCenter??"").toLowerCase().includes(v))return false;if(y||x){let F=Ua__default.default(k.startDate),S=Ua__default.default(k.endDate),w=y?S.isAfter(y)||S.isSame(y,"day"):true,A=x?F.isBefore(x)||F.isSame(x,"day"):true;if(!w||!A)return false}return true})},[d,e]);ct.useEffect(()=>{s.length!==0&&(s.some(h=>h.id===i)||c(s[0].id));},[s,i]);let g=ct.useCallback(h=>{c(h.id);},[]),f=ct.useMemo(()=>({appId:"planning-gantt-filter",tableKey:"planning",fields:Mw,filters:d,onFilterChange:l,onVariantLoad:()=>{},onSearch:()=>{}}),[d]),u=ct.useMemo(()=>({tasks:s,scale:r,onScaleChange:n,selectedTaskId:i,onTaskSelect:g}),[s,g,r,i]);return {scale:r,setScale:n,selectedTaskId:i,setSelectedTaskId:c,filters:d,setFilters:l,filteredTasks:s,smartFilterProps:f,planningGanttProps:u}};var xg=e=>jsxRuntime.jsx(material.Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var Ga=ct.forwardRef(({tooltip:e,...t},o)=>{let a=jsxRuntime.jsx(material.IconButton,{ref:o,...t,size:t.size||"small"});return e?jsxRuntime.jsx(material.Tooltip,{title:e,children:a}):a});Ga.displayName="CIconButton";var Cg=({label:e,options:t,minWidth:o=120,...a})=>jsxRuntime.jsxs(material.FormControl,{fullWidth:true,size:"small",sx:{minWidth:o},children:[e&&jsxRuntime.jsx(material.InputLabel,{children:e}),jsxRuntime.jsx(material.Select,{label:e,...a,children:t.map(r=>jsxRuntime.jsx(material.MenuItem,{value:r.value,children:r.label},r.value))})]});var rd=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],Tg=56,Ka=58,nd=8,id=260,r1=320,qa="220ms cubic-bezier(0.2, 0, 0, 1)",Pg={"not-started":{label:"Not started",color:"default"},planned:{label:"Planned",color:"info"},"in-progress":{label:"In progress",color:"primary"},blocked:{label:"Blocked",color:"error"},done:{label:"Done",color:"success"}},n1=e=>e?Pg[e]?.label??e:"Planned",i1=e=>e?Pg[e]?.color??"default":"info",Rg=e=>Math.min(100,Math.max(0,e??0)),Dg=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...Dg(o.children??[],t+1)]),s1=e=>({id:e.id,code:e.code??e.id,title:e.title,titleSub:e.project??e.workCenter??"General",owner:e.owner?.name??"Unassigned",status:n1(e.status),statusTone:e.status??"planned",progress:Rg(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color}),Mg=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),Ag=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),l1=(e,t,o)=>{let a=[],r=Mg(e,o),n=Ag(t,o);for(;r.isBefore(n)||r.isSame(n);){let i=o==="month"?r.add(1,"month"):o==="week"?r.add(1,"week"):o==="day"?r.add(1,"day"):r.add(1,"hour");a.push({key:`${o}-${r.valueOf()}`,label:o==="month"?r.format("MMM YYYY"):o==="week"?r.format("MMM D"):o==="day"?r.format("D"):r.format("HH:mm"),start:r,end:i}),r=i;}return a},Ig=(e,t,o)=>{let a=0;for(let r of t){if(e.isBefore(r.start))return a;if(e.isBefore(r.end)){let n=Math.max(1,r.end.valueOf()-r.start.valueOf()),i=Math.max(0,e.valueOf()-r.start.valueOf());return a+i/n*o}a+=o;}return a},HN=({title:e="Project Plan",subtitle:t="Task table and timeline view",extraTools:o,tasks:a,scale:r="week",onScaleChange:n,timelineStart:i,timelineEnd:c,selectedTaskId:d,onTaskSelect:l,emptyLabel:s="No planning tasks available.",sx:g})=>{let f=material.useTheme(),u=ct.useRef(null),[h,T]=ct.useState(null),[p,v]=ct.useState(null),m=ct.useRef(null),y=ct.useMemo(()=>Dg(a),[a]),x=ct.useMemo(()=>new Map(y.map(U=>[U.id,U])),[y]),k=ct.useMemo(()=>y.map(U=>s1(U)),[y]),F=ct.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(U,Y)=>jsxRuntime.jsxs(material.Stack,{spacing:.2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:Y.title}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary"},children:Y.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(U,Y)=>jsxRuntime.jsx(xg,{label:Y.status,color:i1(Y.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:U=>jsxRuntime.jsxs(material.Stack,{spacing:.6,children:[jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:[U,"%"]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:U,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),S=Qr({appId:"planning-gantt",title:e,columns:F,rows:k,rowKey:"id",rowsPerPage:-1,rowsPerPageOptions:[-1],count:k.length,showSummary:false}),w=S.visibleRows,A=ct.useMemo(()=>{let U=k.map(ve=>Ua__default.default(ve.startDate)),Y=k.map(ve=>Ua__default.default(ve.endDate)),Re=i?Ua__default.default(i):U.reduce((ve,Fe)=>Fe.isBefore(ve)?Fe:ve,U[0]??Ua__default.default()),Z=c?Ua__default.default(c):Y.reduce((ve,Fe)=>Fe.isAfter(ve)?Fe:ve,Y[0]??Ua__default.default().add(30,"day")),fe=r==="month"?"month":r==="week"?"week":r==="day"?"day":"hour",Se=r==="month"?"month":r==="week"?"week":r==="day"?"day":"hour",Ne=r==="hour"?12:1,Ke=r==="hour"?12:1;return {start:Mg(Re.subtract(Ne,fe),r),end:Ag(Z.add(Ke,Se),r)}},[k,r,c,i]),R=rd.find(U=>U.value===r)??rd[1],C=Array.isArray(o)?o:o?[o]:[],D=ct.useMemo(()=>l1(A.start,A.end,r),[A.end,A.start,r]),I=D.length*R.width,P=(S.columns||[]).filter(U=>S.visibleColumns.includes(U.id)).reduce((U,Y)=>U+(S.columnWidths?.[Y.id]||Y.minWidth||100),0),M=h??P,O=p==="timeline"?0:M,N=p==="timeline",X=p==="table",oe=!N&&!X,te=X?"0px":"minmax(0, 1fr)";ct.useEffect(()=>{T(U=>U===null?null:Math.min(Math.max(U,id),P));},[P]);let re=U=>{U.preventDefault(),U.currentTarget.setPointerCapture(U.pointerId),v(null),m.current={startX:U.clientX,startWidth:M};let Y=Z=>{let fe=m.current;if(!fe)return;let Se=u.current?.clientWidth??0,Ne=Se>0?Math.max(id,Se-nd-r1):P,Ke=Math.min(Math.max(fe.startWidth+Z.clientX-fe.startX,id),Ne);T(Ke);},Re=()=>{m.current=null,window.removeEventListener("pointermove",Y),window.removeEventListener("pointerup",Re),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",Y),window.addEventListener("pointerup",Re);},Q=()=>{v(null),T(null);};return jsxRuntime.jsxs(bi,{elevation:0,sx:{m:0,p:0,overflow:"hidden",borderRadius:3,border:`1px solid ${f.palette.divider}`,backgroundColor:f.palette.background.paper,...g},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",md:"center"},spacing:2,sx:{px:2,py:1.75,borderBottom:`1px solid ${f.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:38,height:38,borderRadius:2,display:"grid",placeItems:"center",backgroundColor:"primary.main",color:"primary.contrastText"},children:jsxRuntime.jsx(Zw__default.default,{fontSize:"small"})}),jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:18,fontWeight:800},children:e}),jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t})]})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[C.length>0&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,alignItems:"center",children:C.map((U,Y)=>jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center"},children:U},`planning-extra-tool-${Y}`))}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(Ga,{tooltip:"Column visibility",onClick:U=>S.setAnchorEl(U.currentTarget),color:"default",children:jsxRuntime.jsx(Af__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ga,{tooltip:"Group by",onClick:U=>S.setGroupAnchorEl(U.currentTarget),color:"default",children:jsxRuntime.jsx(Ef__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ga,{tooltip:"Sort by first visible column",onClick:()=>{let U=(S.columns||[]).find(Y=>S.visibleColumns.includes(Y.id));U&&S.handleRequestSort(U.id);},color:S.orderBy?"primary":"default",children:jsxRuntime.jsx(o1__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(Ga,{tooltip:"Expand task table",onClick:()=>v("table"),color:p==="table"?"primary":"default",children:jsxRuntime.jsx(e1__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ga,{tooltip:"Reset split",onClick:Q,color:p===null?"primary":"default",children:jsxRuntime.jsx(t1__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ga,{tooltip:"Expand timeline",onClick:()=>v("timeline"),color:p==="timeline"?"primary":"default",children:jsxRuntime.jsx(Jw__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{minWidth:120},children:jsxRuntime.jsx(Cg,{label:"",value:r,options:rd.map(U=>({value:U.value,label:U.label})),onChange:U=>n?.(U.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),k.length===0?jsxRuntime.jsx(material.Box,{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:s}):jsxRuntime.jsx(material.Box,{sx:{overflow:"hidden"},children:jsxRuntime.jsxs(material.Box,{ref:u,sx:{display:"grid",gridTemplateColumns:`${O}px ${oe?nd:0}px ${te}`,transition:`grid-template-columns ${qa}`},children:[jsxRuntime.jsx(material.TableContainer,{sx:{width:O,overflowX:"auto",overflowY:"hidden",opacity:N?0:1,transform:N?"translateX(-10px)":"translateX(0)",pointerEvents:N?"none":"auto",transition:`opacity ${qa}, transform ${qa}, width ${qa}`},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:P,"& thead .MuiTableCell-root":{height:Tg,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsxRuntime.jsx(Si,{columns:S.columns,visibleColumns:S.visibleColumns,order:S.order,orderBy:S.orderBy,onRequestSort:S.handleRequestSort,grouping:S.grouping,isAllExpanded:S.isAllExpanded,handleToggleAll:S.handleToggleAll,columnWidths:S.columnWidths,onColumnResize:S.handleColumnResize}),jsxRuntime.jsx(material.TableBody,{children:w.map(U=>{if(U.type==="group")return jsxRuntime.jsxs(material.TableRow,{sx:{height:Ka,backgroundColor:f.palette.action.hover},children:[S.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Ka,py:0,borderBottom:`1px solid ${f.palette.divider}`},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>S.toggleGroupExpand(U.id),children:U.isExpanded?jsxRuntime.jsx(rh__default.default,{fontSize:"small"}):jsxRuntime.jsx($f__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.TableCell,{colSpan:S.visibleColumns.length,sx:{height:Ka,py:0,borderBottom:`1px solid ${f.palette.divider}`},children:jsxRuntime.jsxs(material.Typography,{sx:{fontSize:13,fontWeight:700},children:[U.field,": ",U.value," (",U.count,")"]})})]},U.id);let Y=U.data||U,Re=Y.id===d;return jsxRuntime.jsxs(material.TableRow,{hover:true,selected:Re,onClick:()=>l?.(x.get(Y.id)||Y),sx:{cursor:l?"pointer":"default",height:Ka},children:[S.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Ka,py:0,borderBottom:`1px solid ${f.palette.divider}`}}),(S.columns||[]).filter(Z=>S.visibleColumns.includes(Z.id)).map(Z=>jsxRuntime.jsx(material.TableCell,{sx:{width:S.columnWidths?.[Z.id]||Z.minWidth||100,height:Ka,py:0,overflow:"hidden",borderBottom:`1px solid ${f.palette.divider}`},children:Z.render?Z.render(Y[Z.id],Y):String(Y[Z.id]??"-")},`${Y.id}-${Z.id}`))]},Y.id)})})]})}),jsxRuntime.jsx(material.Box,{onPointerDown:oe?re:void 0,role:"separator","aria-orientation":"vertical",sx:{width:oe?nd:0,cursor:oe?"col-resize":"default",opacity:oe?1:0,pointerEvents:oe?"auto":"none",borderLeft:oe?`1px solid ${f.palette.divider}`:"0 solid transparent",borderRight:oe?`1px solid ${f.palette.divider}`:"0 solid transparent",backgroundColor:f.palette.mode==="dark"?"rgba(148,163,184,0.10)":"rgba(15,23,42,0.04)",transition:`width ${qa}, opacity ${qa}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:f.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:oe?"col-resize":"default"}}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0,overflow:"hidden",opacity:X?0:1,transform:X?"translateX(10px)":"translateX(0)",pointerEvents:X?"none":"auto",transition:`opacity ${qa}, transform ${qa}`},children:jsxRuntime.jsx(material.Box,{sx:{width:"100%",overflowX:"auto",overflowY:"hidden"},children:jsxRuntime.jsxs(material.Box,{sx:{width:I},children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${D.length}, ${R.width}px)`,height:Tg,borderBottom:`1px solid ${f.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:f.palette.background.paper},children:D.map(U=>jsxRuntime.jsx(material.Box,{sx:{px:.75,display:"flex",alignItems:"center",borderRight:`1px solid ${f.palette.divider}`,color:"text.secondary",fontSize:12,fontWeight:700},children:U.label},U.key))}),jsxRuntime.jsx(material.Stack,{sx:{position:"relative"},children:w.map(U=>{if(U.type==="group")return jsxRuntime.jsx(material.Box,{sx:{position:"relative",height:Ka,borderBottom:`1px solid ${f.palette.divider}`,backgroundColor:f.palette.action.hover}},U.id);let Y=U.data||U,Re=Ua__default.default(Y.startDate),Z=Ua__default.default(Y.endDate),fe=Ig(Re,D,R.width),Se=Ig(Z,D,R.width),Ne=Math.max(18,Se-fe),Ke=Rg(Y.progress),ve=Y.id===d,Fe=Y.color??(Y.statusTone==="blocked"?f.palette.error.main:f.palette.primary.main);return jsxRuntime.jsx(material.Box,{onClick:()=>l?.(x.get(Y.id)||Y),sx:{position:"relative",height:Ka,borderBottom:`1px solid ${f.palette.divider}`,backgroundImage:f.palette.mode==="dark"?"linear-gradient(90deg, rgba(148,163,184,0.08) 1px, transparent 1px)":"linear-gradient(90deg, rgba(15,23,42,0.06) 1px, transparent 1px)",backgroundSize:`${R.width}px 100%`,cursor:l?"pointer":"default"},children:jsxRuntime.jsx(material.Tooltip,{title:`${Y.title}: ${Re.format("MMM D HH:mm")} - ${Z.format("MMM D HH:mm")}`,children:jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",left:fe,top:16,width:Ne,height:24,borderRadius:999,overflow:"hidden",backgroundColor:f.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:ve?`2px solid ${f.palette.warning.main}`:"none",outlineOffset:2},children:[jsxRuntime.jsx(material.Box,{sx:{height:"100%",width:`${Ke}%`,backgroundColor:Fe}}),jsxRuntime.jsx(material.Typography,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"#fff",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Y.code})]})})},Y.id)})})]})})})]})}),jsxRuntime.jsx(zr,{groupAnchorEl:S.groupAnchorEl,setGroupAnchorEl:S.setGroupAnchorEl,grouping:S.grouping,setGrouping:S.setGrouping,columns:S.columns,toggleGroupField:S.toggleGroupField}),jsxRuntime.jsx(Nr,{anchorEl:S.anchorEl,setAnchorEl:S.setAnchorEl,columns:S.columns,visibleColumns:S.visibleColumns,toggleColumnVisibility:S.toggleColumnVisibility})]})};var g1={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)"}}},_N=({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=material.useMediaQuery("(prefers-reduced-motion: reduce)"),[l,s]=ct.useState("to"),g=!i&&!d&&o!=="none";ct.useEffect(()=>{if(!g){s("to");return}s("from");let h=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{s("to");});});return ()=>cancelAnimationFrame(h)},[t,g]);let f=g1[o],u=ct.useMemo(()=>g?l==="from"?f.from:f.to:{opacity:1,transform:"none"},[g,l,f.from,f.to]);return jsxRuntime.jsx(material.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})},jN={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
|
|
199
|
+
exports.AgentPanel=Pz;exports.Button=ml;exports.CAINavProvider=Dk;exports.CAmapChart=Qd;exports.CAppHeader=ks;exports.CAppPageLayout=CA;exports.CAuthPage=nN;exports.CBarChart=Bn;exports.CChartCard=Di;exports.CComboChart=Vd;exports.CCustomizeAgent=tp;exports.CDetailInfoPage=TM;exports.CDetailSearchAiBar=Qp;exports.CDetailSectionCard=us;exports.CFishboneChart=Hd;exports.CGoogleMapChart=_d;exports.CGraphCharts=Yd;exports.CGraphKpiCards=Ed;exports.CGraphReport=Ui;exports.CHeatmapChart=Wd;exports.CKanbanBoard=qM;exports.CKanbanBucket=au;exports.CKanbanCard=dc;exports.CLayoutManagement=Tp;exports.CLayoutManager=os;exports.CLineChart=Nd;exports.CMessageBox=Pn;exports.COrbCanvas=fk;exports.CPageLayout=kd;exports.CPageTransition=_N;exports.CPieChart=zi;exports.CPivotTable=c5;exports.CPlanningGantt=HN;exports.CSmartFilter=cr;exports.CSmartTable=UD;exports.CStandardPage=QD;exports.CTable=Fa;exports.CTableBody=OD;exports.CTableCell=WD;exports.CTableContainer=$D;exports.CTableHead=HD;exports.CTableRow=GD;exports.CVariantManagement=ji;exports.CVariantManager=pp;exports.CVoiceWaveOverlay=Hc;exports.CWaterfallChart=Ud;exports.CodeBlock=Un;exports.CopilotChat=Lz;exports.GlobalMessage=xT;exports.MarkdownRenderer=Zn;exports.MathBlock=Kn;exports.MermaidBlock=Xl;exports.NavigationIsland=bd;exports.ORBCAFE_I18N_MESSAGES=In;exports.OrbcafeI18nProvider=Ci;exports.PAGE_TRANSITION_PRESETS=jN;exports.PAppPageLayout=OF;exports.PBarcodeScanner=R5;exports.PNavIsland=Cm;exports.PNumericKeypad=G5;exports.PSmartFilter=mm;exports.PTable=JC;exports.PTouchCard=E5;exports.PWorkloadNav=hm;exports.PivotChartPanel=Ku;exports.StdChat=ug;exports.TableBlock=Yl;exports.ThinkBlock=ds;exports.TreeMenu=fl;exports.VoiceNavigatorProvider=tE;exports.VoiceWaveOverlay=_F;exports.buildAmapEmbedUrl=Oi;exports.buildGoogleMapEmbedUrl=Ln;exports.buildGoogleMapIframe=YI;exports.buttonVariants=Wg;exports.createKanbanBoardModel=iu;exports.findKanbanCard=zo;exports.message=oT;exports.messageManager=ra;exports.moveKanbanCard=ys;exports.parseMarkdownTable=ls;exports.renderMarkdown=j2;exports.resolveVariantFilters=Pp;exports.resolveVariantLayout=as;exports.useAINav=Mk;exports.useAmapEmbedUrl=u2;exports.useAuthPage=Oz;exports.useDetailInfo=Jp;exports.useGoogleMapEmbedUrl=p2;exports.useGraphChartData=i2;exports.useGraphInteraction=qi;exports.useGraphReport=_r;exports.useKanbanBoard=QM;exports.useNavigationIsland=vd;exports.useOrbcafeI18n=j;exports.usePadLayout=x5;exports.usePadRecordEditor=k5;exports.usePageLayout=hu;exports.usePivotTable=g5;exports.usePlanningGantt=dN;exports.useStandardReport=a2;exports.useVoiceInput=js;exports.useVoiceNavigator=oE;
|